aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorheretic <heretic@yandex-team.ru>2022-03-25 12:34:53 +0300
committerheretic <heretic@yandex-team.ru>2022-03-25 12:34:53 +0300
commita41f3739eed6fceb6f62056a7620d220958a47e7 (patch)
tree278103258b510cb4a96761ea79d6ccd397ca05a0
parent73d3613a82e5c217fcbe0ab8bbf8120c1ed1af55 (diff)
downloadydb-a41f3739eed6fceb6f62056a7620d220958a47e7.tar.gz
Update grpc to 1.43.2 DTCC-864
ref:50a492c335cda70f458797cf945e49fe739c2715
-rw-r--r--CMakeLists.darwin.txt4
-rw-r--r--CMakeLists.linux.txt4
-rw-r--r--build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource6
-rw-r--r--build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource6
-rw-r--r--build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource6
-rw-r--r--contrib/libs/grpc/.yandex_meta/devtools.copyrights.report420
-rw-r--r--contrib/libs/grpc/.yandex_meta/devtools.licenses.report572
-rw-r--r--contrib/libs/grpc/.yandex_meta/licenses.list.txt69
-rw-r--r--contrib/libs/grpc/BUILD.gn1616
-rw-r--r--contrib/libs/grpc/BUILDING.md6
-rw-r--r--contrib/libs/grpc/CONCEPTS.md7
-rw-r--r--contrib/libs/grpc/LICENSE40
-rw-r--r--contrib/libs/grpc/MAINTAINERS.md2
-rw-r--r--contrib/libs/grpc/README.md2
-rw-r--r--contrib/libs/grpc/grpc++/CMakeLists.txt25
-rw-r--r--contrib/libs/grpc/grpc/CMakeLists.txt94
-rw-r--r--contrib/libs/grpc/include/grpc/byte_buffer.h2
-rw-r--r--contrib/libs/grpc/include/grpc/byte_buffer_reader.h2
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/README.md38
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/endpoint_config.h43
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/event_engine.h399
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h68
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/memory_allocator.h226
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/memory_request.h57
-rw-r--r--contrib/libs/grpc/include/grpc/event_engine/port.h39
-rw-r--r--contrib/libs/grpc/include/grpc/fork.h2
-rw-r--r--contrib/libs/grpc/include/grpc/grpc.h33
-rw-r--r--contrib/libs/grpc/include/grpc/grpc_posix.h7
-rw-r--r--contrib/libs/grpc/include/grpc/grpc_security.h471
-rw-r--r--contrib/libs/grpc/include/grpc/grpc_security_constants.h31
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/atm.h8
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_sync.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/atm_windows.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer_reader.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/compression_types.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/connectivity_state.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/fork.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/gpr_slice.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/gpr_types.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/grpc_types.h72
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/log.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/port_platform.h105
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/propagation_bits.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/slice.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/status.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync.h13
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync_abseil.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync_custom.h2
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync_generic.h3
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync_posix.h6
-rw-r--r--contrib/libs/grpc/include/grpc/impl/codegen/sync_windows.h2
-rw-r--r--contrib/libs/grpc/include/grpc/module.modulemap28
-rw-r--r--contrib/libs/grpc/include/grpc/slice.h2
-rw-r--r--contrib/libs/grpc/include/grpc/status.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/atm.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/atm_gcc_atomic.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/atm_gcc_sync.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/atm_windows.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/log.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/port_platform.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync_abseil.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync_custom.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync_generic.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync_posix.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/sync_windows.h2
-rw-r--r--contrib/libs/grpc/include/grpc/support/time.h4
-rw-r--r--contrib/libs/grpc/include/grpcpp/alarm.h27
-rw-r--r--contrib/libs/grpc/include/grpcpp/channel.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/client_context.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/completion_queue.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/create_channel_binder.h86
-rw-r--r--contrib/libs/grpc/include/grpcpp/create_channel_posix.h3
-rw-r--r--contrib/libs/grpc/include/grpcpp/generic/async_generic_service.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/generic/generic_stub.h99
-rw-r--r--contrib/libs/grpc/include/grpcpp/grpcpp.h1
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/client_unary_call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h9
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h14
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/call_hook.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/callback_common.h14
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h3
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h51
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h28
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/client_interceptor.h11
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h11
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/config.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/config_protobuf.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen.h3
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h3
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/create_auth_context.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/delegating_channel.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/grpc_library.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor_common.h5
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/message_allocator.h24
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/metadata_map.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h14
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler_impl.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h9
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/proto_utils.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_method.h23
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/security/auth_context.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/serialization_traits.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h16
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h31
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h91
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/server_interceptor.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h32
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h47
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/slice.h16
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/status.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/status_code_enum.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/string_ref.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/stub_options.h17
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/sync.h12
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h14
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/codegen/time.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/grpc_library.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/rpc_method.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/rpc_service_method.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/serialization_traits.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/impl/service_type.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/alts_context.h6
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/alts_util.h4
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/auth_context.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/authorization_policy_provider.h92
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/binder_credentials.h43
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/binder_security_policy.h58
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/credentials.h10
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/server_credentials.h11
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/tls_certificate_provider.h6
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/tls_certificate_verifier.h225
-rw-r--r--contrib/libs/grpc/include/grpcpp/security/tls_credentials_options.h139
-rw-r--r--contrib/libs/grpc/include/grpcpp/server.h52
-rw-r--r--contrib/libs/grpc/include/grpcpp/server_builder.h52
-rw-r--r--contrib/libs/grpc/include/grpcpp/server_context.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/server_posix.h3
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/async_stream.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/async_unary_call.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/byte_buffer.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/channel_arguments.h8
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/client_callback.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/client_interceptor.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/config.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/interceptor.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/message_allocator.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/method_handler.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/proto_buffer_reader.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/proto_buffer_writer.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/server_callback.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/server_interceptor.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/slice.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/status.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/status_code_enum.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/string_ref.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/stub_options.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/sync_stream.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/support/time.h2
-rw-r--r--contrib/libs/grpc/include/grpcpp/test/client_context_test_peer.h62
-rw-r--r--contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h15
-rw-r--r--contrib/libs/grpc/include/grpcpp/test/mock_stream.h49
-rw-r--r--contrib/libs/grpc/include/grpcpp/xds_server_builder.h50
-rw-r--r--contrib/libs/grpc/src/compiler/config.h4
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_generator.cc402
-rw-r--r--contrib/libs/grpc/src/compiler/cpp_plugin.h1
-rw-r--r--contrib/libs/grpc/src/compiler/csharp_generator.cc34
-rw-r--r--contrib/libs/grpc/src/compiler/csharp_generator_helpers.h7
-rw-r--r--contrib/libs/grpc/src/compiler/node_generator.cc3
-rw-r--r--contrib/libs/grpc/src/compiler/objective_c_generator.cc7
-rw-r--r--contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h7
-rw-r--r--contrib/libs/grpc/src/compiler/php_generator.cc184
-rw-r--r--contrib/libs/grpc/src/compiler/php_generator_helpers.h12
-rw-r--r--contrib/libs/grpc/src/compiler/protobuf_plugin.h4
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator.cc3
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator.h2
-rw-r--r--contrib/libs/grpc/src/compiler/python_generator_helpers.h4
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator.cc5
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h4
-rw-r--r--contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h4
-rw-r--r--contrib/libs/grpc/src/compiler/schema_interface.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/census/grpc_context.cc1
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc45
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc9
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.h1
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc360
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc4521
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h616
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc15
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc3
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.h36
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc31
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc3
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h30
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/connector.h38
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc29
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h1
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc91
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h66
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc86
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h12
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc17
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc18
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h285
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc8
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc33
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc365
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc5
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc7
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h11
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc5
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc67
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc94
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc733
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc2502
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc34
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc51
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc232
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc198
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc103
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc463
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h3
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc19
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md9
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc139
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc76
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h7
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc31
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc179
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc11
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc65
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc133
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h24
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc28
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc38
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc45
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc54
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h12
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc61
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc814
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc27
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h3
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc278
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h71
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc2573
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.h (renamed from contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h)15
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.cc316
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.h96
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc65
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc94
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc263
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h91
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc29
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h13
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc268
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.cc96
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.h66
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc69
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc91
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc28
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc174
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc38
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc122
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc77
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc59
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc206
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc72
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc82
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc67
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h70
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc265
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h (renamed from contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.h)19
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc210
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.cc53
-rw-r--r--contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.h39
-rw-r--r--contrib/libs/grpc/src/core/ext/service_config/service_config.cc (renamed from contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc)33
-rw-r--r--contrib/libs/grpc/src/core/ext/service_config/service_config.h (renamed from contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h)21
-rw-r--r--contrib/libs/grpc/src/core/ext/service_config/service_config_call_data.h (renamed from contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h)48
-rw-r--r--contrib/libs/grpc/src/core/ext/service_config/service_config_parser.cc (renamed from contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc)18
-rw-r--r--contrib/libs/grpc/src/core/ext/service_config/service_config_parser.h (renamed from contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h)25
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/README.md6
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.cc133
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.h44
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create.cc172
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc105
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.h42
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc70
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.h52
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc113
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h65
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.cc85
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.h43
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc45
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.h51
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc52
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc249
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.h67
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc76
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_stream.h114
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.cc777
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.h95
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc165
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.h107
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h71
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc255
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h112
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder.h105
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc310
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.h122
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc29
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h43
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.cc33
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.h102
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h38
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc386
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h137
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc184
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h84
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc3
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.cc42
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.h36
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc36
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h14
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc59
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc22
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc93
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc233
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc13
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc21
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc33
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h3
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc1
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc511
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h6
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.cc10
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc103
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h42
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc46
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.h21
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc41
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h13
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc26
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h14
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc27
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h13
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc66
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h13
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc29
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h11
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h41
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc1046
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h342
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h107
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc86
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h69
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc2011
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h181
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc146
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h137
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc242
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h148
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.cc46
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.h30
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc66
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h58
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h84
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc442
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/popularity_count.h60
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc4
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.cc20
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.h67
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc121
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc341
-rw-r--r--contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c364
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h312
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c43
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h20
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c191
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h214
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c359
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h490
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c59
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c488
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h617
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c63
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c97
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h102
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c310
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h415
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c89
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h74
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c206
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h186
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c163
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h131
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c25
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c230
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h426
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h135
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c27
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c36
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c70
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c114
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h193
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c103
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h74
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c142
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h273
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c149
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h117
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c59
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h179
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h78
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c110
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h116
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c121
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h186
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c179
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h136
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c78
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h95
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c978
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h943
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c41
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c57
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h74
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c78
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h50
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c36
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h44
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c402
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h619
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c119
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h171
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c55
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c158
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h165
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c135
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h88
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c109
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h181
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c74
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h207
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c35
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h36
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c25
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c44
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c49
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c61
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h102
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c69
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h74
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c24
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c33
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c22
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h9
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c211
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h158
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c102
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h306
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c56
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h135
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c222
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h172
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c115
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h371
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c59
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c19
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c459
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h382
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c19
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c62
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c19
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c57
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h130
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c25
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c42
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c190
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h144
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c22
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c114
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h178
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c68
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h156
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c76
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h71
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h9
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h23
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c58
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h124
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c33
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h77
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c597
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h688
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c103
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h199
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c19
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c30
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c29
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c46
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h32
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c29
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h18
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c71
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h132
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c44
-rw-r--r--contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h85
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c51
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c26
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c142
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c632
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c912
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c422
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h15
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c35
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c138
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c428
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h15
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c52
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h40
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c63
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c47
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h35
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c162
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c273
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c275
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c85
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h35
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c67
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c23
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c68
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c131
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c1677
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c36
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c32
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c845
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h10
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c4
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c267
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c370
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c202
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c53
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h50
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c38
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c80
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c21
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c4
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c4
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c13
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c267
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c15
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c9
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c25
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c22
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c51
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c11
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c17
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c18
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c44
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h35
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c395
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c64
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h50
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c34
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c60
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c42
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c42
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c76
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c46
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c40
-rw-r--r--contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h35
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h2
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.h8
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h4
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_api.cc3263
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_api.h295
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc335
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h53
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc14
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.h11
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h7
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc112
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.h52
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client.cc1661
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client.h190
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc31
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h19
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc7
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.h5
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc6
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_http_filters.h3
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_routing.cc247
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_routing.h98
-rw-r--r--contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc1268
-rw-r--r--contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt6
-rw-r--r--contrib/libs/grpc/src/core/lib/CMakeLists.txt8
-rw-r--r--contrib/libs/grpc/src/core/lib/address_utils/parse_address.cc (renamed from contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc)48
-rw-r--r--contrib/libs/grpc/src/core/lib/address_utils/parse_address.h (renamed from contrib/libs/grpc/src/core/lib/iomgr/parse_address.h)14
-rw-r--r--contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.cc (renamed from contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc)40
-rw-r--r--contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.h (renamed from contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h)27
-rw-r--r--contrib/libs/grpc/src/core/lib/avl/avl.cc306
-rw-r--r--contrib/libs/grpc/src/core/lib/avl/avl.h477
-rw-r--r--contrib/libs/grpc/src/core/lib/backoff/backoff.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/call_tracer.h85
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args.cc35
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.cc47
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.h62
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_stack.cc27
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_stack.h21
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc22
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_trace.cc21
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channel_trace.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz.cc116
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz.h61
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc15
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/channelz_registry.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/connected_channel.cc13
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/connected_channel.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/context.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker.cc16
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker.h13
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker_factory.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc85
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/handshaker_registry.h41
-rw-r--r--contrib/libs/grpc/src/core/lib/channel/status_util.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/algorithm_metadata.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/compression.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/compression_args.cc25
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/compression_args.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/compression_internal.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/compression_internal.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/message_compress.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression.h5
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/config/core_configuration.cc98
-rw-r--r--contrib/libs/grpc/src/core/lib/config/core_configuration.h157
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats_data.cc29
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/stats_data.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/trace.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/debug/trace.h7
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc46
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h42
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/event_engine.cc37
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.cc49
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.h33
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/memory_allocator.cc70
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/sockaddr.cc40
-rw-r--r--contrib/libs/grpc/src/core/lib/event_engine/sockaddr.h44
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/alloc.cc7
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/arena.h47
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/atm.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/cpu_posix.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/env_linux.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/env_posix.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log_android.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log_linux.cc11
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/log_posix.cc9
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/murmur_hash.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/string.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/string.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc13
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/time_windows.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tls.h165
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tls_gcc.h52
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tls_msvc.h54
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tls_pthread.h56
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tls_stdcpp.h48
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/useful.h111
-rw-r--r--contrib/libs/grpc/src/core/lib/gpr/wrap_memcpy.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/arena.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/arena.h20
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/atomic.h104
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/atomic_utils.h47
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/bitset.h188
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/capture.h76
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/chunked_vector.h211
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/construct_destruct.h (renamed from contrib/libs/grpc/src/core/lib/transport/authority_override.cc)33
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/cpp_impl_of.h45
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h51
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/fork.cc26
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/fork.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/global_config.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/global_config_env.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/global_config_generic.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/manual_constructor.h20
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/match.h73
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/memory.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/mpscq.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/orphanable.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/overload.h59
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h80
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc429
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/status_helper.h194
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/sync.h36
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/table.h423
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc15
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/time_util.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/gprpp/time_util.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/http/format_request.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/http/format_request.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/http/httpcli.cc418
-rw-r--r--contrib/libs/grpc/src/core/lib/http/httpcli.h23
-rw-r--r--contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc31
-rw-r--r--contrib/libs/grpc/src/core/lib/http/parser.cc36
-rw-r--r--contrib/libs/grpc/src/core/lib/http/parser.h9
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc33
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h36
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/call_combiner.cc63
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h26
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/closure.h13
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/combiner.cc58
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/combiner.h5
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint.h9
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc79
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.h8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc32
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc40
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc11
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error.cc356
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error.h392
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/error_internal.h7
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc79
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc144
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc134
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/ev_posix.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.cc77
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.h42
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.cc172
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.h52
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/iomgr.cc84
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.cc88
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.h25
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/promise.h51
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc41
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h35
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolver.cc115
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/tcp.cc295
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/event_engine/timer.cc63
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc17
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h61
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor.cc76
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc31
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.cc9
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.h7
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/internal_errqueue.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iocp_windows.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc54
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_uv.cc43
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/load_file.cc12
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/load_file.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_interface.h35
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc88
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h88
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc21
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.cc93
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.h32
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/port.h17
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/python_util.h5
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc15
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address.h22
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc27
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h7
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc24
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc22
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc1016
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/resource_quota.h177
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/sockaddr.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/sockaddr_custom.h54
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc21
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h30
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc55
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h44
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_uv.cc49
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc38
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc37
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc79
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc85
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h27
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc285
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.h29
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc12
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h30
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc92
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc78
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h63
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc42
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc23
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc67
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc419
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc60
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_custom.cc7
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_custom.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc84
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/timer_uv.cc66
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc747
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/udp_server.h103
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc17
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc13
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc7
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.h14
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc159
-rw-r--r--contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h38
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_reader.cc155
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_util.cc70
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_util.h180
-rw-r--r--contrib/libs/grpc/src/core/lib/json/json_writer.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/matchers/matchers.cc104
-rw-r--r--contrib/libs/grpc/src/core/lib/matchers/matchers.h60
-rw-r--r--contrib/libs/grpc/src/core/lib/profiling/basic_timers.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/profiling/stap_timers.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/activity.cc115
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/activity.h499
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/arena_promise.h184
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/context.h86
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h199
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/basic_seq.h407
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/promise_factory.h189
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/promise_like.h85
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/status.h44
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/detail/switch.h1455
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h48
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/for_each.h140
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/if.h134
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h49
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/join.h55
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/latch.h104
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/loop.h108
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/map.h88
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/observable.h295
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/pipe.h599
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/poll.h60
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/promise.h90
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/race.h84
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/seq.h71
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/try_join.h83
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/try_seq.h106
-rw-r--r--contrib/libs/grpc/src/core/lib/promise/wait_set.h76
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/api.cc108
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/api.h41
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.cc478
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.h457
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.cc33
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.h58
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.cc (renamed from contrib/libs/grpc/src/core/lib/transport/authority_override.h)38
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.h57
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/trace.cc19
-rw-r--r--contrib/libs/grpc/src/core/lib/resource_quota/trace.h24
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h66
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider.h33
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc24
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc46
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h85
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc207
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h54
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h60
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h103
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/matchers.h197
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h102
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.cc173
-rw-r--r--contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.h67
-rw-r--r--contrib/libs/grpc/src/core/lib/security/context/security_context.cc19
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc17
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/credentials.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/credentials.h13
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/credentials_metadata.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc92
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h27
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc9
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc139
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc9
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.h7
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc29
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h16
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc92
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc7
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc51
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc38
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h6
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc90
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc20
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h34
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc105
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h32
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc201
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h106
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc101
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h105
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc31
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc32
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.h13
-rw-r--r--contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc67
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc22
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc37
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h28
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc11
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc36
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc13
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h15
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc33
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc50
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h10
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc659
-rw-r--r--contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h191
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/auth_filters.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc48
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc26
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc210
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/server_auth_filter.cc43
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/tsi_error.cc11
-rw-r--r--contrib/libs/grpc/src/core/lib/security/transport/tsi_error.h3
-rw-r--r--contrib/libs/grpc/src/core/lib/security/util/json_util.cc18
-rw-r--r--contrib/libs/grpc/src/core/lib/security/util/json_util.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc181
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/percent_encoding.h51
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice.cc49
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice.h341
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_api.cc (renamed from contrib/libs/grpc/test/core/util/trickle_endpoint.h)29
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc17
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_intern.cc28
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_internal.h248
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_refcount.cc17
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_refcount.h125
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_refcount_base.h181
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_split.cc100
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_split.h40
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc83
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/static_slice.cc377
-rw-r--r--contrib/libs/grpc/src/core/lib/slice/static_slice.h300
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/api_trace.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/api_trace.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/builtins.cc49
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/builtins.h26
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc2
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call.cc438
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call.h15
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call_details.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel.cc77
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel.h22
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel_init.cc99
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel_init.h96
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel_ping.cc5
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/channel_stack_type.cc3
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/completion_queue.cc266
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/completion_queue.h5
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.h1
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/event_string.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init.cc57
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init.h12
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init_secure.cc50
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/init_unsecure.cc6
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/lame_client.cc83
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/lame_client.h2
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/metadata_array.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/server.cc176
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/server.h101
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc79
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/validate_metadata.h5
-rw-r--r--contrib/libs/grpc/src/core/lib/surface/version.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc4
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/byte_stream.cc14
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/byte_stream.h17
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc15
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/connectivity_state.h4
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/error_utils.cc91
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/error_utils.h18
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/metadata.cc61
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/metadata.h35
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc408
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/metadata_batch.h1065
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/parsed_metadata.cc35
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/parsed_metadata.h382
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/pid_controller.cc8
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/static_metadata.cc1481
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/static_metadata.h512
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/status_metadata.cc1
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/transport.cc46
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/transport.h11
-rw-r--r--contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc72
-rw-r--r--contrib/libs/grpc/src/core/lib/uri/uri_parser.cc38
-rw-r--r--contrib/libs/grpc/src/core/lib/uri/uri_parser.h2
-rw-r--r--contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc123
-rw-r--r--contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc86
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/crypt/aes_gcm.cc9
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/crypt/gsec.h5
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc25
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc21
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc18
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h5
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc27
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h3
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options2
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc4
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc2
-rw-r--r--contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc4
-rw-r--r--contrib/libs/grpc/src/core/tsi/fake_transport_security.cc22
-rw-r--r--contrib/libs/grpc/src/core/tsi/local_transport_security.cc123
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc73
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h7
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc4
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc109
-rw-r--r--contrib/libs/grpc/src/core/tsi/ssl_transport_security.h12
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/BUILD2
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf3
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key52
-rw-r--r--contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem34
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security.cc18
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security.h17
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security_grpc.h1
-rw-r--r--contrib/libs/grpc/src/core/tsi/transport_security_interface.h26
-rwxr-xr-xcontrib/libs/grpc/src/cpp/README.md47
-rw-r--r--contrib/libs/grpc/src/cpp/client/channel_cc.cc38
-rw-r--r--contrib/libs/grpc/src/cpp/client/client_callback.cc7
-rw-r--r--contrib/libs/grpc/src/cpp/client/client_context.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel_internal.cc5
-rw-r--r--contrib/libs/grpc/src/cpp/client/create_channel_internal.h2
-rw-r--r--contrib/libs/grpc/src/cpp/client/insecure_credentials.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/client/secure_credentials.cc21
-rw-r--r--contrib/libs/grpc/src/cpp/client/secure_credentials.h5
-rw-r--r--contrib/libs/grpc/src/cpp/client/xds_credentials.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt6
-rw-r--r--contrib/libs/grpc/src/cpp/common/alarm.cc15
-rw-r--r--contrib/libs/grpc/src/cpp/common/auth_property_iterator.cc3
-rw-r--r--contrib/libs/grpc/src/cpp/common/channel_arguments.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/common/channel_filter.cc60
-rw-r--r--contrib/libs/grpc/src/cpp/common/channel_filter.h115
-rw-r--r--contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc9
-rw-r--r--contrib/libs/grpc/src/cpp/common/core_codegen.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc2
-rw-r--r--contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc1
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_certificate_verifier.cc244
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc128
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc76
-rw-r--r--contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h44
-rw-r--r--contrib/libs/grpc/src/cpp/common/validate_service_config.cc6
-rw-r--r--contrib/libs/grpc/src/cpp/common/version_cc.cc2
-rw-r--r--contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h1
-rw-r--r--contrib/libs/grpc/src/cpp/server/async_generic_service.cc1
-rw-r--r--contrib/libs/grpc/src/cpp/server/channelz/channelz_service.h1
-rw-r--r--contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc24
-rw-r--r--contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc3
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc5
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc1
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/server/load_reporter/util.cc3
-rw-r--r--contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc5
-rw-r--r--contrib/libs/grpc/src/cpp/server/secure_server_credentials.h3
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_builder.cc63
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_callback.cc4
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_cc.cc109
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_context.cc10
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_credentials.cc3
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_posix.cc3
-rw-r--r--contrib/libs/grpc/src/cpp/server/xds_server_credentials.cc8
-rw-r--r--contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc18
-rw-r--r--contrib/libs/grpc/src/cpp/thread_manager/thread_manager.h5
-rw-r--r--contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc31
-rw-r--r--contrib/libs/grpc/src/proto/grpc/auth/v1/authz_policy.proto122
-rw-r--r--contrib/libs/grpc/src/proto/grpc/binary_log/v1alpha/log.proto93
-rw-r--r--contrib/libs/grpc/src/proto/grpc/health/v1/health.options1
-rw-r--r--contrib/libs/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto51
-rw-r--r--contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.options5
-rw-r--r--contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto14
-rw-r--r--contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto62
-rw-r--r--contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto225
-rw-r--r--contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto147
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/echo.proto1
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto58
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto7
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto2
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto3
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto52
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto53
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto11
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto38
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto2
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto5
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto97
-rw-r--r--contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto198
-rw-r--r--contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt10
-rw-r--r--contrib/libs/grpc/src/python/grpcio/README.rst2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/commands.py18
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/__init__.py41
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_channel.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_common.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi27
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi20
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi6
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi22
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi37
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi256
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi56
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi63
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi225
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi48
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi1
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi58
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi15
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/csds.pyx.pxi (renamed from contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi)18
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi21
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi31
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi33
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi6
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx5
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_server.py14
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/_utilities.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py48
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py15
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py79
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py48
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py37
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py60
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/beta/interfaces.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/base/base.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/face/face.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py115
-rw-r--r--contrib/libs/grpc/src/python/grpcio/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio/support.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_admin/README.rst23
-rw-r--r--contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py42
-rw-r--r--contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py (renamed from contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi)13
-rw-r--r--contrib/libs/grpc/src/python/grpcio_admin/setup.py60
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/README.rst6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_channelz/setup.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_csds/README.rst10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py61
-rw-r--r--contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py17
-rw-r--r--contrib/libs/grpc/src/python/grpcio_csds/setup.py61
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/README.rst6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_health_checking/setup.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/README.rst6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_reflection/setup.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/README.rst6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_status/setup.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/README.rst6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_testing/setup.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/commands.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/setup.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/admin/test_admin.py60
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/csds/test_csds.py147
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py11
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/resources.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_application_testing_common.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_server_application.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py45
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_credentials_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_empty_message_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_grpc_shutdown_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py62
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py23
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py23
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_scenarios.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_handling_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_version_test.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_xds_credentials_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_utilities_test.py1
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py13
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests/unit/thread_pool.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py9
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py7
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py10
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py15
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py15
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py11
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py12
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py3
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py162
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py30
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py6
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py8
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py84
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py5
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py4
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py11
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py17
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/__init__.py13
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/__init__.py13
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/_test_server.py61
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py105
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py56
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py177
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py2
-rw-r--r--contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py11
-rw-r--r--contrib/libs/grpc/test/core/util/.yandex_meta/licenses.list.txt4
-rw-r--r--contrib/libs/grpc/test/core/util/build.cc77
-rw-r--r--contrib/libs/grpc/test/core/util/build.h33
-rw-r--r--contrib/libs/grpc/test/core/util/cmdline.cc4
-rw-r--r--contrib/libs/grpc/test/core/util/cmdline_test.cc3
-rw-r--r--contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.cc119
-rw-r--r--contrib/libs/grpc/test/core/util/evaluate_args_test_util.h68
-rw-r--r--contrib/libs/grpc/test/core/util/fuzzer_corpus_test.cc13
-rw-r--r--contrib/libs/grpc/test/core/util/fuzzer_util.cc4
-rw-r--r--contrib/libs/grpc/test/core/util/grpc_fuzzer.bzl77
-rw-r--r--contrib/libs/grpc/test/core/util/histogram.cc14
-rw-r--r--contrib/libs/grpc/test/core/util/histogram.h1
-rw-r--r--contrib/libs/grpc/test/core/util/histogram_test.cc1
-rw-r--r--contrib/libs/grpc/test/core/util/memory_counters.cc6
-rw-r--r--contrib/libs/grpc/test/core/util/mock_authorization_endpoint.h62
-rw-r--r--contrib/libs/grpc/test/core/util/mock_endpoint.cc26
-rw-r--r--contrib/libs/grpc/test/core/util/mock_endpoint.h3
-rw-r--r--contrib/libs/grpc/test/core/util/one_corpus_entry_fuzzer.cc2
-rw-r--r--contrib/libs/grpc/test/core/util/parse_hexstring.cc1
-rw-r--r--contrib/libs/grpc/test/core/util/passthru_endpoint.cc348
-rw-r--r--contrib/libs/grpc/test/core/util/passthru_endpoint.h21
-rw-r--r--contrib/libs/grpc/test/core/util/port.cc6
-rw-r--r--contrib/libs/grpc/test/core/util/port_isolated_runtime_environment.cc4
-rw-r--r--contrib/libs/grpc/test/core/util/port_server_client.cc33
-rw-r--r--contrib/libs/grpc/test/core/util/reconnect_server.cc6
-rw-r--r--contrib/libs/grpc/test/core/util/reconnect_server.h1
-rw-r--r--contrib/libs/grpc/test/core/util/resolve_localhost_ip46.cc2
-rw-r--r--contrib/libs/grpc/test/core/util/slice_splitter.cc4
-rw-r--r--contrib/libs/grpc/test/core/util/stack_tracer.cc27
-rw-r--r--contrib/libs/grpc/test/core/util/stack_tracer_test.cc3
-rw-r--r--contrib/libs/grpc/test/core/util/subprocess_posix.cc4
-rw-r--r--contrib/libs/grpc/test/core/util/subprocess_windows.cc1
-rw-r--r--contrib/libs/grpc/test/core/util/test_config.cc73
-rw-r--r--contrib/libs/grpc/test/core/util/test_config.h14
-rw-r--r--contrib/libs/grpc/test/core/util/test_lb_policies.cc246
-rw-r--r--contrib/libs/grpc/test/core/util/test_lb_policies.h46
-rw-r--r--contrib/libs/grpc/test/core/util/test_tcp_server.cc24
-rw-r--r--contrib/libs/grpc/test/core/util/test_tcp_server.h1
-rw-r--r--contrib/libs/grpc/test/core/util/tls_utils.cc118
-rw-r--r--contrib/libs/grpc/test/core/util/tls_utils.h98
-rw-r--r--contrib/libs/grpc/test/core/util/tracer_util.cc7
-rw-r--r--contrib/libs/grpc/test/core/util/tracer_util.h2
-rw-r--r--contrib/libs/grpc/test/core/util/trickle_endpoint.cc215
-rw-r--r--contrib/libs/grpc/test/core/util/tsan_suppressions.txt2
-rw-r--r--contrib/libs/grpc/test/core/util/ubsan_suppressions.txt1
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/.yandex_meta/licenses.list.txt4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/admin_services_end2end_test.cc38
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/async_end2end_test.cc7
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/cfstream_test.cc7
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/channelz_service_test.cc10
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/client_callback_end2end_test.cc273
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/client_crash_test.cc8
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/client_crash_test_server.cc11
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/client_interceptors_end2end_test.cc29
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/client_lb_end2end_test.cc117
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/context_allocator_end2end_test.cc32
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/counted_service.h64
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/delegating_channel_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/end2end_test.cc48
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/exception_test.cc7
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/filter_end2end_test.cc12
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/flaky_network_test.cc24
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/generic_end2end_test.cc8
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/grpclb_end2end_test.cc184
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/health_service_end2end_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/hybrid_end2end_test.cc15
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/interceptors_util.cc20
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/interceptors_util.h43
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/message_allocator_end2end_test.cc54
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/mock_test.cc59
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/nonblocking_test.cc21
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/port_sharing_end2end_test.cc18
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/proto_server_reflection_test.cc8
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/raw_end2end_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/rls_end2end_test.cc1458
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/sdk_authz_end2end_test.cc763
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/server_builder_plugin_test.cc8
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/server_crash_test.cc8
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/server_crash_test_client.cc13
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/server_early_return_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/server_interceptors_end2end_test.cc10
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/service_config_end2end_test.cc41
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/shutdown_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/streaming_throughput_test.cc5
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/test_service_impl.cc93
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/test_service_impl.h51
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/thread_stress_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/time_change_test.cc14
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/xds_credentials_end2end_test.cc127
-rw-r--r--contrib/libs/grpc/test/cpp/end2end/xds_end2end_test.cc11355
-rw-r--r--contrib/libs/grpc/test/cpp/util/.yandex_meta/licenses.list.txt18
-rw-r--r--contrib/libs/grpc/test/cpp/util/byte_buffer_test.cc37
-rw-r--r--contrib/libs/grpc/test/cpp/util/channel_trace_proto_helper.cc7
-rw-r--r--contrib/libs/grpc/test/cpp/util/channelz_sampler.cc27
-rw-r--r--contrib/libs/grpc/test/cpp/util/channelz_sampler_test.cc29
-rw-r--r--contrib/libs/grpc/test/cpp/util/cli_call.cc22
-rw-r--r--contrib/libs/grpc/test/cpp/util/cli_call.h13
-rw-r--r--contrib/libs/grpc/test/cpp/util/cli_call_test.cc9
-rw-r--r--contrib/libs/grpc/test/cpp/util/cli_credentials.cc3
-rw-r--r--contrib/libs/grpc/test/cpp/util/create_test_channel.cc3
-rw-r--r--contrib/libs/grpc/test/cpp/util/error_details_test.cc3
-rw-r--r--contrib/libs/grpc/test/cpp/util/grpc_cli.cc5
-rw-r--r--contrib/libs/grpc/test/cpp/util/grpc_tool.cc18
-rw-r--r--contrib/libs/grpc/test/cpp/util/grpc_tool_test.cc27
-rw-r--r--contrib/libs/grpc/test/cpp/util/proto_reflection_descriptor_database.h1
-rw-r--r--contrib/libs/grpc/test/cpp/util/service_describer.h1
-rw-r--r--contrib/libs/grpc/test/cpp/util/slice_test.cc12
-rw-r--r--contrib/libs/grpc/test/cpp/util/string_ref_test.cc4
-rw-r--r--contrib/libs/grpc/test/cpp/util/test_config.h5
-rw-r--r--contrib/libs/grpc/test/cpp/util/test_config_cc.cc1
-rw-r--r--contrib/libs/grpc/test/cpp/util/test_credentials_provider.cc9
-rw-r--r--contrib/libs/grpc/test/cpp/util/time_test.cc3
-rw-r--r--contrib/libs/grpc/test/cpp/util/tls_test_utils.cc99
-rw-r--r--contrib/libs/grpc/test/cpp/util/tls_test_utils.h82
-rw-r--r--contrib/libs/grpc/third_party/ABSEIL_MANUAL.md3
-rw-r--r--contrib/libs/grpc/third_party/README.md53
-rw-r--r--contrib/libs/grpc/third_party/address_sorting/address_sorting_posix.c1
-rw-r--r--contrib/libs/grpc/third_party/upb/.yandex_meta/licenses.list.txt409
-rw-r--r--contrib/libs/grpc/third_party/upb/CONTRIBUTING.md42
-rw-r--r--contrib/libs/grpc/third_party/upb/DESIGN.md271
-rw-r--r--contrib/libs/grpc/third_party/upb/LICENSE6
-rw-r--r--contrib/libs/grpc/third_party/upb/README.md158
-rw-r--r--contrib/libs/grpc/third_party/upb/third_party/wyhash/LICENSE25
-rw-r--r--contrib/libs/grpc/third_party/upb/third_party/wyhash/wyhash.h145
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/decode.c566
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/decode.h36
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/decode_fast.c1013
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/decode_fast.h27
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/decode_internal.h (renamed from contrib/libs/grpc/third_party/upb/upb/decode.int.h)47
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/def.c743
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/def.h119
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/def.hpp50
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/encode.c181
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/encode.h31
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/msg.c210
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/msg.h655
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/msg_internal.h769
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/port_def.inc109
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/port_undef.inc39
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/reflection.c220
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/reflection.h52
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/table.c297
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/table_internal.h (renamed from contrib/libs/grpc/third_party/upb/upb/table.int.h)236
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/text_encode.c42
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/text_encode.h26
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/upb.c75
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/upb.h42
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/upb.hpp24
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/upb.int.h29
-rw-r--r--contrib/libs/grpc/third_party/upb/upb/upb_internal.h58
-rw-r--r--contrib/libs/grpc/tools/codegen/core/.yandex_meta/licenses.list.txt (renamed from contrib/libs/grpc/src/core/lib/gpr/tls_pthread.cc)20
-rw-r--r--contrib/libs/grpc/tools/codegen/core/gen_hpack_tables.cc106
-rw-r--r--contrib/libs/grpc/tools/codegen/core/gen_legal_metadata_characters.cc66
-rw-r--r--contrib/libs/grpc/tools/codegen/core/gen_percent_encoding_tables.cc69
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt43
-rw-r--r--contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt46
-rw-r--r--library/cpp/grpc/client/grpc_client_low.cpp7
1723 files changed, 84993 insertions, 58925 deletions
diff --git a/CMakeLists.darwin.txt b/CMakeLists.darwin.txt
index 54851987f79..cfccc145768 100644
--- a/CMakeLists.darwin.txt
+++ b/CMakeLists.darwin.txt
@@ -296,6 +296,7 @@ add_subdirectory(library/cpp/grpc/client)
add_subdirectory(contrib/libs/grpc)
add_subdirectory(contrib/libs/grpc/grpc)
add_subdirectory(contrib/libs/grpc/src/core/lib)
+add_subdirectory(contrib/libs/grpc/third_party/upb)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/memory)
@@ -331,7 +332,6 @@ add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/utility)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format)
add_subdirectory(contrib/libs/grpc/third_party/address_sorting)
-add_subdirectory(contrib/libs/grpc/third_party/upb)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/hash)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/city)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal)
@@ -339,6 +339,8 @@ add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types/internal)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor)
add_subdirectory(contrib/libs/grpc/grpc++)
+add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set)
+add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler)
add_subdirectory(library/cpp/grpc/server)
add_subdirectory(library/cpp/monlib/dynamic_counters/percentile)
add_subdirectory(library/cpp/grpc/server/actors)
diff --git a/CMakeLists.linux.txt b/CMakeLists.linux.txt
index 6f98980862f..35d27852df6 100644
--- a/CMakeLists.linux.txt
+++ b/CMakeLists.linux.txt
@@ -376,6 +376,7 @@ add_subdirectory(library/cpp/grpc/client)
add_subdirectory(contrib/libs/grpc)
add_subdirectory(contrib/libs/grpc/grpc)
add_subdirectory(contrib/libs/grpc/src/core/lib)
+add_subdirectory(contrib/libs/grpc/third_party/upb)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/memory)
@@ -411,7 +412,6 @@ add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/utility)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/strings/internal/str_format)
add_subdirectory(contrib/libs/grpc/third_party/address_sorting)
-add_subdirectory(contrib/libs/grpc/third_party/upb)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/hash)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/city)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/hash/internal)
@@ -419,6 +419,8 @@ add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types/bad_variant_
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/types/internal)
add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/status/statusor)
add_subdirectory(contrib/libs/grpc/grpc++)
+add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set)
+add_subdirectory(contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler)
add_subdirectory(library/cpp/grpc/server)
add_subdirectory(library/cpp/monlib/dynamic_counters/percentile)
add_subdirectory(library/cpp/grpc/server/actors)
diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource
index 8abe0170e15..89ee65e8397 100644
--- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource
+++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_cpp/ya.make.resource
@@ -1,9 +1,9 @@
IF (OS_DARWIN AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898023714)
+ SET(SANDBOX_RESOURCE_ID 2902832647)
ELSEIF (OS_LINUX AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898025327)
+ SET(SANDBOX_RESOURCE_ID 2902835940)
ELSEIF (OS_WINDOWS AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898022024)
+ SET(SANDBOX_RESOURCE_ID 2902828700)
ELSE()
SET(SANDBOX_RESOURCE_ID)
ENDIF()
diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource
index 0d95e998977..8ac377edbd2 100644
--- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource
+++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.resource
@@ -1,9 +1,9 @@
IF (OS_DARWIN AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898175468)
+ SET(SANDBOX_RESOURCE_ID 2902802812)
ELSEIF (OS_LINUX AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898177354)
+ SET(SANDBOX_RESOURCE_ID 2902804276)
ELSEIF (OS_WINDOWS AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898173964)
+ SET(SANDBOX_RESOURCE_ID 2902799048)
ELSE()
SET(SANDBOX_RESOURCE_ID)
ENDIF()
diff --git a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource
index 01eb6e70bda..411f508ca22 100644
--- a/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource
+++ b/build/prebuilt/contrib/tools/protoc/plugins/grpc_python/ya.make.resource
@@ -1,9 +1,9 @@
IF (OS_DARWIN AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898131002)
+ SET(SANDBOX_RESOURCE_ID 2902884360)
ELSEIF (OS_LINUX AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898133387)
+ SET(SANDBOX_RESOURCE_ID 2902886926)
ELSEIF (OS_WINDOWS AND ARCH_X86_64)
- SET(SANDBOX_RESOURCE_ID 2898129557)
+ SET(SANDBOX_RESOURCE_ID 2902881750)
ELSE()
SET(SANDBOX_RESOURCE_ID)
ENDIF()
diff --git a/contrib/libs/grpc/.yandex_meta/devtools.copyrights.report b/contrib/libs/grpc/.yandex_meta/devtools.copyrights.report
index b4648543440..055427d9722 100644
--- a/contrib/libs/grpc/.yandex_meta/devtools.copyrights.report
+++ b/contrib/libs/grpc/.yandex_meta/devtools.copyrights.report
@@ -41,7 +41,7 @@ BELONGS src/proto/grpc/status/ya.make
src/proto/grpc/status/status.proto [1:1]
KEEP COPYRIGHT_SERVICE_LABEL 06745079442081a41390888905fc6bdb
-BELONGS src/core/lib/ya.make test/cpp/end2end/ya.make ya.make
+BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make ya.make
License text:
// Copyright 2021 gRPC authors.
Scancode info:
@@ -49,24 +49,179 @@ BELONGS src/core/lib/ya.make test/cpp/end2end/ya.make ya.make
Score : 100.00
Match type : COPYRIGHT
Files with this license:
+ include/grpcpp/create_channel_binder.h [1:1]
include/grpcpp/ext/admin_services.h [3:3]
+ include/grpcpp/security/authorization_policy_provider.h [1:1]
+ include/grpcpp/security/binder_credentials.h [1:1]
+ include/grpcpp/security/binder_security_policy.h [1:1]
+ include/grpcpp/security/tls_certificate_verifier.h [2:2]
+ include/grpcpp/test/client_context_test_peer.h [3:3]
+ src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc [1:1]
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc [2:2]
+ src/core/ext/filters/client_channel/retry_filter.h [2:2]
+ src/core/ext/filters/client_idle/idle_filter_state.cc [1:1]
+ src/core/ext/filters/client_idle/idle_filter_state.h [1:1]
src/core/ext/filters/fault_injection/fault_injection_filter.cc [2:2]
src/core/ext/filters/fault_injection/fault_injection_filter.h [2:2]
src/core/ext/filters/fault_injection/service_config_parser.cc [2:2]
src/core/ext/filters/fault_injection/service_config_parser.h [2:2]
+ src/core/ext/filters/server_config_selector/server_config_selector.cc [2:2]
+ src/core/ext/filters/server_config_selector/server_config_selector.h [2:2]
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.cc [3:3]
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.h [3:3]
+ src/core/ext/transport/binder/client/binder_connector.cc [1:1]
+ src/core/ext/transport/binder/client/binder_connector.h [1:1]
+ src/core/ext/transport/binder/client/channel_create.cc [1:1]
+ src/core/ext/transport/binder/client/channel_create_impl.cc [1:1]
+ src/core/ext/transport/binder/client/channel_create_impl.h [1:1]
+ src/core/ext/transport/binder/client/connection_id_generator.cc [1:1]
+ src/core/ext/transport/binder/client/connection_id_generator.h [1:1]
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc [1:1]
+ src/core/ext/transport/binder/client/endpoint_binder_pool.h [1:1]
+ src/core/ext/transport/binder/client/jni_utils.cc [1:1]
+ src/core/ext/transport/binder/client/jni_utils.h [1:1]
+ src/core/ext/transport/binder/client/security_policy_setting.cc [1:1]
+ src/core/ext/transport/binder/client/security_policy_setting.h [1:1]
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc [1:1]
+ src/core/ext/transport/binder/server/binder_server.cc [1:1]
+ src/core/ext/transport/binder/server/binder_server.h [1:1]
+ src/core/ext/transport/binder/server/binder_server_credentials.cc [1:1]
+ src/core/ext/transport/binder/transport/binder_stream.h [1:1]
+ src/core/ext/transport/binder/transport/binder_transport.cc [1:1]
+ src/core/ext/transport/binder/transport/binder_transport.h [1:1]
+ src/core/ext/transport/binder/utils/ndk_binder.cc [1:1]
+ src/core/ext/transport/binder/utils/ndk_binder.h [1:1]
+ src/core/ext/transport/binder/utils/transport_stream_receiver.h [1:1]
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc [1:1]
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h [1:1]
+ src/core/ext/transport/binder/wire_format/binder.h [1:1]
+ src/core/ext/transport/binder/wire_format/binder_android.cc [1:1]
+ src/core/ext/transport/binder/wire_format/binder_android.h [1:1]
+ src/core/ext/transport/binder/wire_format/binder_constants.cc [1:1]
+ src/core/ext/transport/binder/wire_format/binder_constants.h [1:1]
+ src/core/ext/transport/binder/wire_format/transaction.cc [1:1]
+ src/core/ext/transport/binder/wire_format/transaction.h [1:1]
+ src/core/ext/transport/binder/wire_format/wire_reader.h [1:1]
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc [1:1]
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.h [1:1]
+ src/core/ext/transport/binder/wire_format/wire_writer.cc [1:1]
+ src/core/ext/transport/binder/wire_format/wire_writer.h [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_constants.h [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_index.h [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.h [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_utils.cc [1:1]
+ src/core/ext/transport/chttp2/transport/hpack_utils.h [1:1]
+ src/core/ext/transport/chttp2/transport/popularity_count.h [1:1]
+ src/core/ext/xds/xds_channel_stack_modifier.cc [3:3]
+ src/core/ext/xds/xds_channel_stack_modifier.h [3:3]
src/core/ext/xds/xds_http_fault_filter.cc [2:2]
src/core/ext/xds/xds_http_fault_filter.h [2:2]
src/core/ext/xds/xds_http_filters.cc [2:2]
src/core/ext/xds/xds_http_filters.h [2:2]
+ src/core/ext/xds/xds_routing.cc [3:3]
+ src/core/ext/xds/xds_routing.h [3:3]
+ src/core/lib/avl/avl.h [1:1]
+ src/core/lib/channel/call_tracer.h [3:3]
+ src/core/lib/channel/channel_args_preconditioning.cc [1:1]
+ src/core/lib/channel/channel_args_preconditioning.h [1:1]
+ src/core/lib/config/core_configuration.cc [1:1]
+ src/core/lib/config/core_configuration.h [1:1]
+ src/core/lib/event_engine/memory_allocator.cc [1:1]
+ src/core/lib/gprpp/bitset.h [1:1]
+ src/core/lib/gprpp/capture.h [1:1]
+ src/core/lib/gprpp/chunked_vector.h [1:1]
+ src/core/lib/gprpp/construct_destruct.h [1:1]
+ src/core/lib/gprpp/cpp_impl_of.h [1:1]
+ src/core/lib/gprpp/match.h [1:1]
+ src/core/lib/gprpp/overload.h [1:1]
+ src/core/lib/gprpp/table.h [1:1]
src/core/lib/matchers/matchers.cc [1:1]
src/core/lib/matchers/matchers.h [1:1]
+ src/core/lib/promise/activity.cc [1:1]
+ src/core/lib/promise/activity.h [1:1]
+ src/core/lib/promise/arena_promise.h [1:1]
+ src/core/lib/promise/context.h [1:1]
+ src/core/lib/promise/detail/basic_join.h [1:1]
+ src/core/lib/promise/detail/basic_seq.h [1:1]
+ src/core/lib/promise/detail/promise_factory.h [1:1]
+ src/core/lib/promise/detail/promise_like.h [1:1]
+ src/core/lib/promise/detail/status.h [1:1]
+ src/core/lib/promise/detail/switch.h [2:2]
+ src/core/lib/promise/exec_ctx_wakeup_scheduler.h [1:1]
+ src/core/lib/promise/for_each.h [1:1]
+ src/core/lib/promise/if.h [1:1]
+ src/core/lib/promise/intra_activity_waiter.h [1:1]
+ src/core/lib/promise/join.h [1:1]
+ src/core/lib/promise/latch.h [1:1]
+ src/core/lib/promise/loop.h [1:1]
+ src/core/lib/promise/map.h [1:1]
+ src/core/lib/promise/observable.h [1:1]
+ src/core/lib/promise/pipe.h [1:1]
+ src/core/lib/promise/poll.h [1:1]
+ src/core/lib/promise/promise.h [1:1]
+ src/core/lib/promise/race.h [1:1]
+ src/core/lib/promise/seq.h [1:1]
+ src/core/lib/promise/try_join.h [1:1]
+ src/core/lib/promise/try_seq.h [1:1]
+ src/core/lib/promise/wait_set.h [1:1]
+ src/core/lib/resource_quota/api.cc [1:1]
+ src/core/lib/resource_quota/api.h [1:1]
+ src/core/lib/resource_quota/memory_quota.cc [1:1]
+ src/core/lib/resource_quota/memory_quota.h [1:1]
+ src/core/lib/resource_quota/resource_quota.cc [1:1]
+ src/core/lib/resource_quota/resource_quota.h [1:1]
+ src/core/lib/resource_quota/thread_quota.cc [1:1]
+ src/core/lib/resource_quota/thread_quota.h [1:1]
+ src/core/lib/resource_quota/trace.cc [1:1]
+ src/core/lib/resource_quota/trace.h [1:1]
+ src/core/lib/security/authorization/authorization_engine.h [1:1]
+ src/core/lib/security/authorization/authorization_policy_provider.h [1:1]
+ src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc [1:1]
+ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc [1:1]
+ src/core/lib/security/authorization/evaluate_args.cc [1:1]
+ src/core/lib/security/authorization/evaluate_args.h [1:1]
+ src/core/lib/security/authorization/grpc_authorization_engine.h [1:1]
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.h [1:1]
+ src/core/lib/security/authorization/matchers.h [1:1]
src/core/lib/security/authorization/rbac_policy.h [1:1]
src/core/lib/security/authorization/rbac_translator.h [1:1]
+ src/core/lib/security/authorization/sdk_server_authz_filter.cc [1:1]
+ src/core/lib/security/authorization/sdk_server_authz_filter.h [1:1]
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc [2:2]
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h [2:2]
+ src/core/lib/slice/slice.h [1:1]
+ src/core/lib/slice/slice_refcount.cc [1:1]
+ src/core/lib/slice/slice_refcount.h [1:1]
+ src/core/lib/slice/slice_refcount_base.h [1:1]
+ src/core/lib/slice/slice_split.cc [1:1]
+ src/core/lib/surface/builtins.cc [1:1]
+ src/core/lib/surface/builtins.h [1:1]
+ src/core/lib/transport/parsed_metadata.cc [1:1]
+ src/core/lib/transport/parsed_metadata.h [1:1]
+ src/cpp/common/tls_certificate_verifier.cc [2:2]
+ test/core/util/build.cc [1:1]
+ test/core/util/build.h [1:1]
+ test/core/util/evaluate_args_test_util.h [1:1]
+ test/core/util/mock_authorization_endpoint.h [1:1]
test/cpp/end2end/admin_services_end2end_test.cc [3:3]
+ test/cpp/end2end/sdk_authz_end2end_test.cc [1:1]
+ test/cpp/util/tls_test_utils.cc [2:2]
+ test/cpp/util/tls_test_utils.h [2:2]
+
+KEEP COPYRIGHT_SERVICE_LABEL 0e7dfde444a19e176393b344aaa268da
+BELONGS ya.make
+ License text:
+ // Copyright 2016 The gRPC Authors
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ src/proto/grpc/reflection/v1/reflection.proto [1:1]
KEEP COPYRIGHT_SERVICE_LABEL 0f2ee97b72f8652f2f1b888d86348121
-BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/duplicate/ya.make src/proto/grpc/testing/ya.make src/python/grpcio/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_tests/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make ya.make
+BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/duplicate/ya.make src/proto/grpc/testing/ya.make src/python/grpcio/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_tests/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make tools/codegen/core/ya.make ya.make
License text:
* Copyright 2015 gRPC authors.
Scancode info:
@@ -196,15 +351,15 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/compiler/ruby_generator_string-inl.h [3:3]
src/compiler/schema_interface.h [3:3]
src/core/ext/filters/census/grpc_context.cc [3:3]
- src/core/ext/filters/client_channel/channel_connectivity.cc [3:3]
+ src/core/ext/filters/client_channel/channel_connectivity.cc [2:2]
src/core/ext/filters/client_channel/client_channel.cc [2:2]
- src/core/ext/filters/client_channel/client_channel.h [3:3]
+ src/core/ext/filters/client_channel/client_channel.h [2:2]
src/core/ext/filters/client_channel/client_channel_factory.cc [3:3]
- src/core/ext/filters/client_channel/client_channel_factory.h [3:3]
+ src/core/ext/filters/client_channel/client_channel_factory.h [2:2]
src/core/ext/filters/client_channel/client_channel_plugin.cc [3:3]
- src/core/ext/filters/client_channel/connector.h [3:3]
+ src/core/ext/filters/client_channel/connector.h [2:2]
src/core/ext/filters/client_channel/lb_policy.cc [3:3]
- src/core/ext/filters/client_channel/lb_policy.h [3:3]
+ src/core/ext/filters/client_channel/lb_policy.h [2:2]
src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc [3:3]
src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc [3:3]
src/core/ext/filters/client_channel/lb_policy/subchannel_list.h [3:3]
@@ -218,22 +373,23 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/ext/filters/client_channel/resolver_factory.h [3:3]
src/core/ext/filters/client_channel/resolver_registry.cc [3:3]
src/core/ext/filters/client_channel/resolver_registry.h [3:3]
- src/core/ext/filters/client_channel/service_config.cc [2:2]
- src/core/ext/filters/client_channel/service_config_parser.cc [2:2]
- src/core/ext/filters/client_channel/subchannel.cc [3:3]
- src/core/ext/filters/client_channel/subchannel.h [3:3]
+ src/core/ext/filters/client_channel/retry_filter.cc [2:2]
+ src/core/ext/filters/client_channel/subchannel.cc [2:2]
+ src/core/ext/filters/client_channel/subchannel.h [2:2]
src/core/ext/filters/http/client/http_client_filter.cc [2:2]
src/core/ext/filters/http/client/http_client_filter.h [2:2]
src/core/ext/filters/http/message_compress/message_compress_filter.cc [3:3]
src/core/ext/filters/http/message_compress/message_compress_filter.h [3:3]
src/core/ext/filters/http/server/http_server_filter.cc [3:3]
src/core/ext/filters/http/server/http_server_filter.h [3:3]
+ src/core/ext/service_config/service_config.cc [2:2]
+ src/core/ext/service_config/service_config_parser.cc [2:2]
src/core/ext/transport/chttp2/alpn/alpn.cc [3:3]
src/core/ext/transport/chttp2/alpn/alpn.h [3:3]
src/core/ext/transport/chttp2/client/chttp2_connector.cc [3:3]
src/core/ext/transport/chttp2/client/chttp2_connector.h [3:3]
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc [3:3]
- src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc [3:3]
+ src/core/ext/transport/chttp2/client/insecure/channel_create.cc [2:2]
+ src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc [2:2]
src/core/ext/transport/chttp2/server/chttp2_server.cc [3:3]
src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc [3:3]
src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc [3:3]
@@ -258,12 +414,10 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/ext/transport/chttp2/transport/hpack_encoder.h [3:3]
src/core/ext/transport/chttp2/transport/hpack_parser.cc [3:3]
src/core/ext/transport/chttp2/transport/hpack_parser.h [3:3]
- src/core/ext/transport/chttp2/transport/hpack_table.cc [3:3]
- src/core/ext/transport/chttp2/transport/hpack_table.h [3:3]
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc [3:3]
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.h [3:3]
src/core/ext/transport/chttp2/transport/huffsyms.cc [3:3]
src/core/ext/transport/chttp2/transport/huffsyms.h [3:3]
- src/core/ext/transport/chttp2/transport/incoming_metadata.cc [3:3]
- src/core/ext/transport/chttp2/transport/incoming_metadata.h [3:3]
src/core/ext/transport/chttp2/transport/internal.h [3:3]
src/core/ext/transport/chttp2/transport/parsing.cc [3:3]
src/core/ext/transport/chttp2/transport/stream_lists.cc [3:3]
@@ -272,8 +426,8 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/ext/transport/chttp2/transport/varint.cc [3:3]
src/core/ext/transport/chttp2/transport/varint.h [3:3]
src/core/ext/transport/chttp2/transport/writing.cc [3:3]
- src/core/lib/avl/avl.cc [3:3]
- src/core/lib/avl/avl.h [3:3]
+ src/core/lib/address_utils/parse_address.h [3:3]
+ src/core/lib/address_utils/sockaddr_utils.h [3:3]
src/core/lib/channel/channel_args.cc [3:3]
src/core/lib/channel/channel_args.h [3:3]
src/core/lib/channel/channel_stack.cc [3:3]
@@ -321,10 +475,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/lib/gpr/time_precise.h [3:3]
src/core/lib/gpr/time_windows.cc [3:3]
src/core/lib/gpr/tls.h [3:3]
- src/core/lib/gpr/tls_gcc.h [3:3]
- src/core/lib/gpr/tls_msvc.h [3:3]
- src/core/lib/gpr/tls_pthread.cc [3:3]
- src/core/lib/gpr/tls_pthread.h [3:3]
src/core/lib/gpr/tmpfile.h [3:3]
src/core/lib/gpr/tmpfile_msys.cc [3:3]
src/core/lib/gpr/tmpfile_posix.cc [3:3]
@@ -368,7 +518,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/lib/iomgr/is_epollexclusive_available.h [3:3]
src/core/lib/iomgr/load_file.cc [3:3]
src/core/lib/iomgr/load_file.h [3:3]
- src/core/lib/iomgr/parse_address.h [3:3]
src/core/lib/iomgr/polling_entity.h [3:3]
src/core/lib/iomgr/pollset.h [3:3]
src/core/lib/iomgr/pollset_set.h [3:3]
@@ -381,7 +530,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/lib/iomgr/resolve_address_windows.cc [3:3]
src/core/lib/iomgr/sockaddr.h [3:3]
src/core/lib/iomgr/sockaddr_posix.h [3:3]
- src/core/lib/iomgr/sockaddr_utils.h [3:3]
src/core/lib/iomgr/sockaddr_windows.h [3:3]
src/core/lib/iomgr/socket_mutator.cc [3:3]
src/core/lib/iomgr/socket_mutator.h [3:3]
@@ -409,8 +557,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/lib/iomgr/timer_generic.cc [3:3]
src/core/lib/iomgr/timer_heap.cc [3:3]
src/core/lib/iomgr/timer_heap.h [3:3]
- src/core/lib/iomgr/udp_server.cc [3:3]
- src/core/lib/iomgr/udp_server.h [3:3]
src/core/lib/iomgr/wakeup_fd_eventfd.cc [3:3]
src/core/lib/iomgr/wakeup_fd_nospecial.cc [3:3]
src/core/lib/iomgr/wakeup_fd_pipe.cc [3:3]
@@ -452,9 +598,13 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
src/core/lib/slice/b64.cc [3:3]
src/core/lib/slice/b64.h [3:3]
src/core/lib/slice/slice.cc [3:3]
+ src/core/lib/slice/slice_api.cc [3:3]
src/core/lib/slice/slice_buffer.cc [3:3]
+ src/core/lib/slice/slice_split.h [3:3]
src/core/lib/slice/slice_string_helpers.cc [3:3]
src/core/lib/slice/slice_string_helpers.h [3:3]
+ src/core/lib/slice/static_slice.cc [2:2]
+ src/core/lib/slice/static_slice.h [2:2]
src/core/lib/surface/api_trace.cc [3:3]
src/core/lib/surface/api_trace.h [3:3]
src/core/lib/surface/byte_buffer.cc [3:3]
@@ -691,8 +841,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/dupli
test/cpp/util/test_config_cc.cc [3:3]
test/cpp/util/time_test.cc [3:3]
tools/codegen/core/gen_hpack_tables.cc [3:3]
- tools/codegen/core/gen_legal_metadata_characters.cc [3:3]
- tools/codegen/core/gen_percent_encoding_tables.cc [3:3]
KEEP COPYRIGHT_SERVICE_LABEL 1393ed0d9a5e8e3a97f2447521ecb0a6
BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.make src/python/grpcio/ya.make src/python/grpcio_tests/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make ya.make
@@ -822,22 +970,22 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.ma
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc [2:2]
src/core/ext/filters/client_channel/local_subchannel_pool.cc [3:3]
src/core/ext/filters/client_channel/local_subchannel_pool.h [3:3]
- src/core/ext/filters/client_channel/resolver_result_parsing.cc [3:3]
- src/core/ext/filters/client_channel/resolver_result_parsing.h [3:3]
+ src/core/ext/filters/client_channel/resolver_result_parsing.cc [2:2]
+ src/core/ext/filters/client_channel/resolver_result_parsing.h [2:2]
+ src/core/ext/filters/client_channel/retry_service_config.cc [2:2]
+ src/core/ext/filters/client_channel/retry_service_config.h [2:2]
src/core/ext/filters/client_channel/server_address.cc [3:3]
src/core/ext/filters/client_channel/server_address.h [3:3]
src/core/ext/filters/client_channel/subchannel_pool_interface.cc [3:3]
src/core/ext/filters/client_channel/subchannel_pool_interface.h [3:3]
src/core/ext/filters/http/client_authority_filter.cc [3:3]
src/core/ext/filters/http/client_authority_filter.h [3:3]
- src/core/ext/transport/chttp2/client/authority.cc [3:3]
- src/core/ext/transport/chttp2/client/authority.h [3:3]
src/core/ext/transport/chttp2/transport/chttp2_transport.cc [2:2]
src/core/ext/transport/chttp2/transport/context_list.cc [3:3]
src/core/ext/transport/chttp2/transport/context_list.h [3:3]
- src/core/ext/xds/xds_api.cc [3:3]
+ src/core/ext/xds/xds_api.cc [2:2]
src/core/ext/xds/xds_api.h [3:3]
- src/core/ext/xds/xds_client.cc [3:3]
+ src/core/ext/xds/xds_client.cc [2:2]
src/core/ext/xds/xds_client_stats.cc [3:3]
src/core/ext/xds/xds_client_stats.h [3:3]
src/core/lib/channel/channelz.h [3:3]
@@ -855,7 +1003,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.ma
src/core/lib/iomgr/internal_errqueue.h [3:3]
src/core/lib/iomgr/iomgr_custom.cc [3:3]
src/core/lib/iomgr/iomgr_internal.cc [3:3]
- src/core/lib/iomgr/iomgr_uv.cc [3:3]
src/core/lib/iomgr/pollset.cc [3:3]
src/core/lib/iomgr/pollset_custom.cc [3:3]
src/core/lib/iomgr/pollset_custom.h [3:3]
@@ -865,7 +1012,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.ma
src/core/lib/iomgr/resolve_address.cc [3:3]
src/core/lib/iomgr/resolve_address_custom.cc [3:3]
src/core/lib/iomgr/resolve_address_custom.h [3:3]
- src/core/lib/iomgr/sockaddr_custom.h [3:3]
src/core/lib/iomgr/tcp_client.cc [3:3]
src/core/lib/iomgr/tcp_client_cfstream.cc [4:4]
src/core/lib/iomgr/tcp_client_custom.cc [3:3]
@@ -996,8 +1142,8 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.ma
src/python/grpcio_tests/tests/unit/_version_test.py [1:1]
test/core/util/fuzzer_util.cc [3:3]
test/core/util/fuzzer_util.h [3:3]
- test/core/util/test_lb_policies.cc [3:3]
- test/core/util/test_lb_policies.h [3:3]
+ test/core/util/test_lb_policies.cc [2:2]
+ test/core/util/test_lb_policies.h [2:2]
test/cpp/end2end/channelz_service_test.cc [3:3]
test/cpp/end2end/client_callback_end2end_test.cc [3:3]
test/cpp/end2end/client_interceptors_end2end_test.cc [3:3]
@@ -1013,6 +1159,43 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/testing/ya.ma
test/cpp/util/channel_trace_proto_helper.cc [3:3]
test/cpp/util/channel_trace_proto_helper.h [3:3]
+KEEP COPYRIGHT_SERVICE_LABEL 14562f2a7eb107a8f822700bf0293d8d
+BELONGS third_party/upb/ya.make
+ License text:
+ Copyright (c) 2009-2021, Google LLC
+ All rights reserved.
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ third_party/upb/LICENSE [2:3]
+ third_party/upb/upb/decode.c [2:3]
+ third_party/upb/upb/decode.h [2:3]
+ third_party/upb/upb/decode_fast.c [2:3]
+ third_party/upb/upb/decode_fast.h [2:3]
+ third_party/upb/upb/decode_internal.h [2:3]
+ third_party/upb/upb/def.c [2:3]
+ third_party/upb/upb/def.h [2:3]
+ third_party/upb/upb/def.hpp [1:2]
+ third_party/upb/upb/encode.c [2:3]
+ third_party/upb/upb/encode.h [2:3]
+ third_party/upb/upb/msg.c [2:3]
+ third_party/upb/upb/msg.h [2:3]
+ third_party/upb/upb/msg_internal.h [2:3]
+ third_party/upb/upb/port_def.inc [2:3]
+ third_party/upb/upb/port_undef.inc [2:3]
+ third_party/upb/upb/reflection.c [2:3]
+ third_party/upb/upb/reflection.h [2:3]
+ third_party/upb/upb/table.c [2:3]
+ third_party/upb/upb/table_internal.h [2:3]
+ third_party/upb/upb/text_encode.c [2:3]
+ third_party/upb/upb/text_encode.h [2:3]
+ third_party/upb/upb/upb.c [2:3]
+ third_party/upb/upb/upb.h [2:3]
+ third_party/upb/upb/upb.hpp [1:2]
+ third_party/upb/upb/upb_internal.h [2:3]
+
KEEP COPYRIGHT_SERVICE_LABEL 1ad5a8379223f39b4124906a5bd2437d
BELONGS src/python/grpcio/ya.make src/python/grpcio_tests/ya.make
License text:
@@ -1030,13 +1213,12 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_tests/ya.make
KEEP COPYRIGHT_SERVICE_LABEL 1c0b49517f30a005a1f30fc39200d3ee
BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make src/python/grpcio_tests/ya.make test/cpp/end2end/ya.make ya.make
License text:
- \# Copyright 2019 gRPC authors.
+ * Copyright 2019 gRPC authors.
Scancode info:
Original SPDX id: COPYRIGHT_SERVICE_LABEL
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- BUILD.gn [8:8]
include/grpcpp/impl/codegen/async_stream.h [3:3]
include/grpcpp/impl/codegen/client_callback.h [3:3]
include/grpcpp/impl/codegen/delegating_channel.h [3:3]
@@ -1061,7 +1243,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc [2:2]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h [2:2]
src/core/ext/filters/client_channel/lb_policy/xds/cds.cc [2:2]
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc [3:3]
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc [2:2]
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h [3:3]
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc [3:3]
@@ -1082,9 +1263,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/lib/iomgr/executor/mpmcqueue.h [3:3]
src/core/lib/iomgr/executor/threadpool.cc [3:3]
src/core/lib/iomgr/executor/threadpool.h [3:3]
- src/core/lib/iomgr/poller/eventmanager_interface.h [3:3]
- src/core/lib/iomgr/poller/eventmanager_libuv.cc [3:3]
- src/core/lib/iomgr/poller/eventmanager_libuv.h [3:3]
src/core/lib/iomgr/work_serializer.cc [3:3]
src/core/lib/iomgr/work_serializer.h [3:3]
src/core/lib/security/security_connector/ssl_utils_config.cc [3:3]
@@ -1094,8 +1272,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/cpp/common/alts_context.cc [3:3]
src/cpp/common/alts_util.cc [3:3]
src/cpp/common/tls_credentials_options.cc [3:3]
- src/cpp/common/tls_credentials_options_util.cc [3:3]
- src/cpp/common/tls_credentials_options_util.h [3:3]
src/cpp/common/validate_service_config.cc [3:3]
src/cpp/server/external_connection_acceptor_impl.cc [3:3]
src/cpp/server/external_connection_acceptor_impl.h [3:3]
@@ -1108,13 +1284,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/python/grpcio/grpc/_cython/_cygrpc/aio/channel.pyx.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi [1:1]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi [1:1]
@@ -1154,6 +1323,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/ext/filters/client_channel/dynamic_filters.h [2:2]
src/core/ext/filters/client_channel/lb_policy/address_filtering.cc [2:2]
src/core/ext/filters/client_channel/lb_policy/address_filtering.h [2:2]
+ src/core/ext/filters/client_channel/lb_policy/rls/rls.cc [2:2]
src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h [2:2]
src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc [2:2]
src/core/ext/filters/http/message_compress/message_decompress_filter.cc [3:3]
@@ -1169,7 +1339,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/ext/xds/xds_certificate_provider.h [3:3]
src/core/ext/xds/xds_server_config_fetcher.cc [3:3]
src/core/lib/gpr/sync_abseil.cc [3:3]
- src/core/lib/gpr/tls_stdcpp.h [3:3]
src/core/lib/gprpp/dual_ref_counted.h [2:2]
src/core/lib/gprpp/examine_stack.cc [3:3]
src/core/lib/gprpp/examine_stack.h [3:3]
@@ -1181,8 +1350,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/lib/iomgr/ev_apple.h [3:3]
src/core/lib/json/json_util.cc [3:3]
src/core/lib/json/json_util.h [3:3]
- src/core/lib/security/authorization/authorization_engine.h [2:2]
- src/core/lib/security/authorization/evaluate_args.h [3:3]
+ src/core/lib/security/authorization/cel_authorization_engine.h [2:2]
src/core/lib/security/authorization/mock_cel/activation.h [1:1]
src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h [1:1]
src/core/lib/security/authorization/mock_cel/cel_expression.h [1:1]
@@ -1210,8 +1378,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/core/lib/security/credentials/xds/xds_credentials.h [3:3]
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc [3:3]
src/core/lib/security/security_connector/insecure/insecure_security_connector.h [3:3]
- src/core/lib/transport/authority_override.cc [2:2]
- src/core/lib/transport/authority_override.h [2:2]
src/cpp/client/xds_credentials.cc [3:3]
src/cpp/common/tls_certificate_provider.cc [2:2]
src/cpp/server/xds_server_credentials.cc [3:3]
@@ -1219,14 +1385,23 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/python/grpcio/ya.make sr
src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py [1:1]
src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py [1:1]
src/python/grpcio_tests/tests_aio/unit/_metadata_test.py [1:1]
- test/core/util/eval_args_mock_endpoint.cc [1:1]
- test/core/util/eval_args_mock_endpoint.h [1:1]
test/core/util/resolve_localhost_ip46.cc [3:3]
test/core/util/resolve_localhost_ip46.h [3:3]
test/core/util/tls_utils.cc [2:2]
test/core/util/tls_utils.h [2:2]
test/cpp/end2end/context_allocator_end2end_test.cc [3:3]
- test/cpp/end2end/xds_credentials_end2end_test.cc [3:3]
+ test/cpp/end2end/rls_end2end_test.cc [2:2]
+
+KEEP COPYRIGHT_SERVICE_LABEL 24f793f95f5c432d60ec3ef10b0e1a07
+BELONGS ya.make
+ License text:
+ Copyright 2016, Google Inc.
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ LICENSE [208:208]
KEEP COPYRIGHT_SERVICE_LABEL 2738b84693d58ad3ff70e7cfefe0c3de
BELONGS src/python/grpcio_tests/ya.make
@@ -1257,11 +1432,13 @@ BELONGS src/core/lib/ya.make
Score : 100.00
Match type : COPYRIGHT
Files with this license:
+ src/core/lib/gprpp/status_helper.cc [3:3]
+ src/core/lib/gprpp/status_helper.h [3:3]
src/core/lib/gprpp/time_util.cc [2:2]
src/core/lib/gprpp/time_util.h [2:2]
KEEP COPYRIGHT_SERVICE_LABEL 3f8e6ecc96f8543539ce4b548cdc9afb
-BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio_tests/ya.make ya.make
+BELONGS src/core/lib/ya.make src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/grpcio_tests/ya.make ya.make
License text:
// Copyright 2021 The gRPC Authors
Scancode info:
@@ -1269,11 +1446,53 @@ BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio_tests/ya.make ya.ma
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- src/proto/grpc/auth/v1/authz_policy.proto [1:1]
+ include/grpc/event_engine/endpoint_config.h [1:1]
+ include/grpc/event_engine/event_engine.h [1:1]
+ include/grpc/event_engine/internal/memory_allocator_impl.h [1:1]
+ include/grpc/event_engine/memory_allocator.h [1:1]
+ include/grpc/event_engine/memory_request.h [1:1]
+ include/grpc/event_engine/port.h [1:1]
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc [1:1]
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc [1:1]
+ src/core/lib/event_engine/channel_args_endpoint_config.cc [1:1]
+ src/core/lib/event_engine/channel_args_endpoint_config.h [1:1]
+ src/core/lib/event_engine/event_engine.cc [1:1]
+ src/core/lib/event_engine/event_engine_factory.cc [1:1]
+ src/core/lib/event_engine/event_engine_factory.h [1:1]
+ src/core/lib/event_engine/sockaddr.cc [1:1]
+ src/core/lib/event_engine/sockaddr.h [1:1]
+ src/core/lib/iomgr/endpoint_pair_event_engine.cc [1:1]
+ src/core/lib/iomgr/event_engine/closure.cc [1:1]
+ src/core/lib/iomgr/event_engine/closure.h [1:1]
+ src/core/lib/iomgr/event_engine/endpoint.cc [1:1]
+ src/core/lib/iomgr/event_engine/endpoint.h [1:1]
+ src/core/lib/iomgr/event_engine/iomgr.cc [1:1]
+ src/core/lib/iomgr/event_engine/pollset.cc [1:1]
+ src/core/lib/iomgr/event_engine/pollset.h [1:1]
+ src/core/lib/iomgr/event_engine/promise.h [1:1]
+ src/core/lib/iomgr/event_engine/resolved_address_internal.cc [1:1]
+ src/core/lib/iomgr/event_engine/resolved_address_internal.h [1:1]
+ src/core/lib/iomgr/event_engine/resolver.cc [1:1]
+ src/core/lib/iomgr/event_engine/tcp.cc [1:1]
+ src/core/lib/iomgr/event_engine/timer.cc [1:1]
src/proto/grpc/testing/xds/v3/config_dump.proto [1:1]
src/proto/grpc/testing/xds/v3/csds.proto [1:1]
+ src/proto/grpc/testing/xds/v3/extension.proto [1:1]
src/proto/grpc/testing/xds/v3/router.proto [1:1]
+ src/python/grpcio/grpc/_cython/_cygrpc/csds.pyx.pxi [1:1]
+ src/python/grpcio_admin/grpc_admin/__init__.py [1:1]
+ src/python/grpcio_admin/grpc_version.py [1:1]
+ src/python/grpcio_admin/setup.py [1:1]
+ src/python/grpcio_csds/grpc_csds/__init__.py [1:1]
+ src/python/grpcio_csds/grpc_version.py [1:1]
+ src/python/grpcio_csds/setup.py [1:1]
+ src/python/grpcio_tests/tests/admin/test_admin.py [1:1]
+ src/python/grpcio_tests/tests/csds/test_csds.py [1:1]
src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py [1:1]
+ src/python/grpcio_tests/tests_gevent/__init__.py [1:1]
+ src/python/grpcio_tests/tests_gevent/unit/__init__.py [1:1]
+ src/python/grpcio_tests/tests_gevent/unit/_test_server.py [1:1]
+ src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py [1:1]
KEEP COPYRIGHT_SERVICE_LABEL 47856a1da8680a4ba503954f87b9eb2c
BELONGS test/core/util/ya.make
@@ -1383,7 +1602,7 @@ BELONGS src/proto/grpc/channelz/ya.make src/python/grpcio/ya.make src/python/grp
src/python/grpcio_tests/tests/status/_grpc_status_test.py [1:1]
KEEP COPYRIGHT_SERVICE_LABEL 8183794cfdcd444d086a2c63a36d9beb
-BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_status/ya.make src/python/grpcio_tests/ya.make
+BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_status/ya.make src/python/grpcio_tests/ya.make ya.make
License text:
// Copyright 2020 The gRPC Authors
Scancode info:
@@ -1391,6 +1610,8 @@ BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/
Score : 100.00
Match type : COPYRIGHT
Files with this license:
+ src/proto/grpc/lookup/v1/rls.proto [1:1]
+ src/proto/grpc/lookup/v1/rls_config.proto [1:1]
src/proto/grpc/testing/xds/v3/address.proto [1:1]
src/proto/grpc/testing/xds/v3/ads.proto [1:1]
src/proto/grpc/testing/xds/v3/aggregate_cluster.proto [1:1]
@@ -1452,7 +1673,7 @@ BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/
src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py [1:1]
KEEP COPYRIGHT_SERVICE_LABEL 90fc8bbf7a57ec743af147a4496a5eb2
-BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/grpcio_tests/ya.make test/cpp/end2end/ya.make ya.make
+BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/grpcio_tests/ya.make test/cpp/end2end/ya.make
License text:
// Copyright 2019 The gRPC Authors
Scancode info:
@@ -1460,13 +1681,11 @@ BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- src/proto/grpc/http_over_grpc/http_over_grpc.proto [1:1]
src/proto/grpc/testing/xds/ads_for_test.proto [1:1]
src/proto/grpc/testing/xds/cds_for_test.proto [1:1]
src/proto/grpc/testing/xds/eds_for_test.proto [1:1]
src/proto/grpc/testing/xds/lds_rds_for_test.proto [1:1]
src/proto/grpc/testing/xds/lrs_for_test.proto [1:1]
- src/proto/grpc/testing/xds/orca_load_report_for_test.proto [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi [1:1]
src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi [1:1]
@@ -1490,35 +1709,6 @@ BELONGS src/proto/grpc/testing/xds/ya.make src/python/grpcio/ya.make src/python/
src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py [1:1]
test/cpp/end2end/cfstream_test.cc [3:3]
-KEEP COPYRIGHT_SERVICE_LABEL 915a58fad04e1b9efec32a9b5cde7ce6
-BELONGS third_party/upb/ya.make
-FILE_INCLUDE LICENSE found in files: third_party/upb/third_party/wyhash/wyhash.h at line 3
-FILE_INCLUDE third_party/address_sorting/LICENSE found in files: third_party/upb/third_party/wyhash/wyhash.h at line 3
-FILE_INCLUDE third_party/upb/LICENSE found in files: third_party/upb/third_party/wyhash/wyhash.h at line 3
-FILE_INCLUDE third_party/upb/third_party/wyhash/LICENSE found in files: third_party/upb/third_party/wyhash/wyhash.h at line 3
- License text:
- /* Copyright 2020 王一 Wang Yi <godspeed_china@yeah.net>
- This is free and unencumbered software released into the public domain. http://unlicense.org/
- See github.com/wangyi-fudan/wyhash/ LICENSE
- Scancode info:
- Original SPDX id: COPYRIGHT_SERVICE_LABEL
- Score : 100.00
- Match type : COPYRIGHT
- Files with this license:
- third_party/upb/third_party/wyhash/wyhash.h [1:3]
-
-KEEP COPYRIGHT_SERVICE_LABEL b2cd4508342480479b8c05479802ed26
-BELONGS third_party/upb/ya.make
- License text:
- Copyright (c) 2009-2011, Google Inc.
- All rights reserved.
- Scancode info:
- Original SPDX id: COPYRIGHT_SERVICE_LABEL
- Score : 100.00
- Match type : COPYRIGHT
- Files with this license:
- third_party/upb/LICENSE [2:3]
-
KEEP COPYRIGHT_SERVICE_LABEL c822b8e4a7bf3b1525b6d5673145a917
BELONGS src/python/grpcio_tests/ya.make
License text:
@@ -1599,10 +1789,6 @@ BELONGS src/core/lib/ya.make src/proto/grpc/core/ya.make src/proto/grpc/testing/
src/core/ext/filters/http/http_filters_plugin.cc [3:3]
src/core/ext/filters/max_age/max_age_filter.cc [3:3]
src/core/ext/filters/max_age/max_age_filter.h [2:2]
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc [2:2]
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h [2:2]
- src/core/ext/filters/workarounds/workaround_utils.cc [2:2]
- src/core/ext/filters/workarounds/workaround_utils.h [2:2]
src/core/ext/transport/chttp2/transport/flow_control.cc [3:3]
src/core/ext/transport/chttp2/transport/flow_control.h [3:3]
src/core/ext/transport/chttp2/transport/http2_settings.cc [2:2]
@@ -1628,11 +1814,10 @@ BELONGS src/core/lib/ya.make src/proto/grpc/core/ya.make src/proto/grpc/testing/
src/core/lib/debug/stats.h [3:3]
src/core/lib/debug/stats_data.cc [2:2]
src/core/lib/debug/stats_data.h [2:2]
- src/core/lib/gpr/arena.h [3:3]
src/core/lib/gpr/atm.cc [3:3]
src/core/lib/gprpp/arena.cc [3:3]
src/core/lib/gprpp/arena.h [3:3]
- src/core/lib/gprpp/atomic.h [3:3]
+ src/core/lib/gprpp/atomic_utils.h [3:3]
src/core/lib/gprpp/debug_location.h [3:3]
src/core/lib/gprpp/fork.cc [3:3]
src/core/lib/gprpp/fork.h [3:3]
@@ -1730,9 +1915,9 @@ BELONGS src/core/lib/ya.make src/proto/grpc/core/ya.make src/proto/grpc/testing/
test/core/util/fuzzer_one_entry_runner.sh [5:5]
test/core/util/port_isolated_runtime_environment.cc [3:3]
test/core/util/run_with_poller.sh [2:2]
+ test/cpp/end2end/counted_service.h [2:2]
test/cpp/end2end/exception_test.cc [3:3]
- test/cpp/end2end/grpclb_end2end_test.cc [3:3]
- test/cpp/end2end/xds_end2end_test.cc [3:3]
+ test/cpp/end2end/grpclb_end2end_test.cc [2:2]
test/cpp/util/error_details_test.cc [3:3]
KEEP COPYRIGHT_SERVICE_LABEL d1f37f63030e0e8933bd29b33aedaaa6
@@ -1756,6 +1941,7 @@ BELONGS src/python/grpcio_tests/ya.make
Match type : COPYRIGHT
Files with this license:
src/python/grpcio_tests/tests/unit/_xds_credentials_test.py [1:1]
+ src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py [1:1]
KEEP COPYRIGHT_SERVICE_LABEL f053023fe408f1896a456d1d28958df9
BELONGS src/proto/grpc/health/v1/ya.make ya.make
@@ -1812,7 +1998,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/reflection/v1
src/core/ext/filters/client_channel/http_connect_handshaker.h [3:3]
src/core/ext/filters/client_channel/http_proxy.cc [3:3]
src/core/ext/filters/client_channel/http_proxy.h [3:3]
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc [3:3]
+ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc [2:2]
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc [3:3]
src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h [3:3]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h [3:3]
@@ -1820,23 +2006,24 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/reflection/v1
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc [3:3]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc [3:3]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h [3:3]
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc [3:3]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc [3:3]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc [3:3]
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc [2:2]
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h [2:2]
- src/core/ext/filters/client_channel/service_config.h [2:2]
- src/core/ext/filters/client_channel/service_config_call_data.h [2:2]
- src/core/ext/filters/client_channel/service_config_parser.h [2:2]
src/core/ext/filters/deadline/deadline_filter.cc [2:2]
src/core/ext/filters/deadline/deadline_filter.h [2:2]
src/core/ext/filters/message_size/message_size_filter.cc [2:2]
src/core/ext/filters/message_size/message_size_filter.h [2:2]
+ src/core/ext/service_config/service_config.h [2:2]
+ src/core/ext/service_config/service_config_call_data.h [2:2]
+ src/core/ext/service_config/service_config_parser.h [2:2]
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc [3:3]
src/core/ext/transport/chttp2/server/chttp2_server.h [3:3]
src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc [3:3]
src/core/ext/transport/chttp2/transport/bin_decoder.cc [3:3]
src/core/ext/transport/chttp2/transport/bin_decoder.h [3:3]
+ src/core/lib/address_utils/parse_address.cc [3:3]
+ src/core/lib/address_utils/sockaddr_utils.cc [3:3]
src/core/lib/backoff/backoff.cc [3:3]
src/core/lib/backoff/backoff.h [3:3]
src/core/lib/channel/channel_stack_builder.cc [3:3]
@@ -1854,27 +2041,17 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/reflection/v1
src/core/lib/iomgr/combiner.cc [3:3]
src/core/lib/iomgr/combiner.h [3:3]
src/core/lib/iomgr/endpoint_pair_posix.cc [3:3]
- src/core/lib/iomgr/endpoint_pair_uv.cc [3:3]
src/core/lib/iomgr/error.cc [3:3]
src/core/lib/iomgr/error.h [3:3]
src/core/lib/iomgr/error_internal.h [3:3]
src/core/lib/iomgr/ev_poll_posix.cc [3:3]
src/core/lib/iomgr/grpc_if_nametoindex_posix.cc [3:3]
src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc [3:3]
- src/core/lib/iomgr/parse_address.cc [3:3]
src/core/lib/iomgr/polling_entity.cc [3:3]
src/core/lib/iomgr/pollset_set_custom.cc [3:3]
- src/core/lib/iomgr/pollset_uv.cc [3:3]
- src/core/lib/iomgr/pollset_uv.h [3:3]
src/core/lib/iomgr/port.h [3:3]
- src/core/lib/iomgr/resource_quota.cc [3:3]
- src/core/lib/iomgr/resource_quota.h [3:3]
- src/core/lib/iomgr/sockaddr_utils.cc [3:3]
- src/core/lib/iomgr/socket_utils_uv.cc [3:3]
src/core/lib/iomgr/socket_utils_windows.cc [3:3]
- src/core/lib/iomgr/tcp_uv.cc [3:3]
src/core/lib/iomgr/timer_generic.h [3:3]
- src/core/lib/iomgr/timer_uv.cc [3:3]
src/core/lib/iomgr/unix_sockets_posix.cc [3:3]
src/core/lib/iomgr/unix_sockets_posix.h [3:3]
src/core/lib/iomgr/unix_sockets_posix_noop.cc [3:3]
@@ -1923,7 +2100,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/reflection/v1
src/cpp/server/server_posix.cc [3:3]
src/cpp/thread_manager/thread_manager.cc [3:3]
src/cpp/thread_manager/thread_manager.h [3:3]
- src/proto/grpc/binary_log/v1alpha/log.proto [1:1]
src/proto/grpc/reflection/v1alpha/reflection.proto [1:1]
src/proto/grpc/testing/compiler_test.proto [1:1]
src/proto/grpc/testing/proto2/empty2.proto [2:2]
@@ -1997,8 +2173,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/reflection/v1
test/core/util/passthru_endpoint.cc [3:3]
test/core/util/passthru_endpoint.h [3:3]
test/core/util/subprocess_windows.cc [3:3]
- test/core/util/trickle_endpoint.cc [3:3]
- test/core/util/trickle_endpoint.h [3:3]
test/cpp/end2end/client_lb_end2end_test.cc [3:3]
test/cpp/end2end/filter_end2end_test.cc [3:3]
test/cpp/end2end/health_service_end2end_test.cc [3:3]
diff --git a/contrib/libs/grpc/.yandex_meta/devtools.licenses.report b/contrib/libs/grpc/.yandex_meta/devtools.licenses.report
index 3d36b8a602c..ace9249d09a 100644
--- a/contrib/libs/grpc/.yandex_meta/devtools.licenses.report
+++ b/contrib/libs/grpc/.yandex_meta/devtools.licenses.report
@@ -29,20 +29,6 @@
# FILE_INCLUDE - include all file data into licenses text file
# =======================
-SKIP LicenseRef-scancode-generic-cla 084c06118a7b53437fd2eaf3372fb53c
-BELONGS third_party/upb/ya.make
- # contributors license agreement
- License text:
- Please sign the [Google Contributor License Agreement
- (CLA)](https://cla.developers.google.com/)
- Scancode info:
- Original SPDX id: LicenseRef-scancode-generic-cla
- Score : 22.00
- Match type : NOTICE
- Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/generic-cla.LICENSE
- Files with this license:
- third_party/upb/CONTRIBUTING.md [3:4]
-
SKIP Python-2.0 084da548815188967cad816891b84e50
BELONGS src/python/grpcio/ya.make
License text:
@@ -56,36 +42,22 @@ BELONGS src/python/grpcio/ya.make
Files with this license:
src/python/grpcio/grpc/__init__.py [13:14]
-KEEP Unlicense 157675c2c94799a0422fc7f5a9c9f9dd
+KEEP BSD-3-Clause 1074fcc8fed6e87c183fda7df379eff5
BELONGS third_party/upb/ya.make
- License text:
- This is free and unencumbered software released into the public domain. http://unlicense.org/
- Scancode info:
- Original SPDX id: Unlicense
- Score : 100.00
- Match type : NOTICE
- Links : http://unlicense.org/, https://spdx.org/licenses/Unlicense, https://unlicense.org/
- Files with this license:
- third_party/upb/third_party/wyhash/wyhash.h [2:2]
-
-SKIP Apache-2.0 16b70eae00287deabdea5ef1821711a0
-BELONGS ya.make
- License text:
- licenses(["notice"]) # Apache v2
+ Note: matched license text is too long. Read it in the source files.
Scancode info:
- Original SPDX id: Apache-2.0
- Score : 100.00
- Match type : REFERENCE
- Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
+ Original SPDX id: BSD-3-Clause
+ Score : 97.64
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
Files with this license:
- src/core/tsi/test_creds/BUILD [15:15]
+ third_party/upb/upb/msg_internal.h [5:25]
SKIP Apache-2.0 19395e57ad88c62801cecab69fb3a75b
BELONGS src/python/grpcio_tests/ya.make
-FILE_INCLUDE LICENSE found in files: src/python/grpcio_tests/setup.py at line 34
-FILE_INCLUDE third_party/address_sorting/LICENSE found in files: src/python/grpcio_tests/setup.py at line 34
-FILE_INCLUDE third_party/upb/LICENSE found in files: src/python/grpcio_tests/setup.py at line 34
-FILE_INCLUDE third_party/upb/third_party/wyhash/LICENSE found in files: src/python/grpcio_tests/setup.py at line 34
+FILE_INCLUDE LICENSE found in files: src/python/grpcio_tests/setup.py at line 33
+FILE_INCLUDE third_party/address_sorting/LICENSE found in files: src/python/grpcio_tests/setup.py at line 33
+FILE_INCLUDE third_party/upb/LICENSE found in files: src/python/grpcio_tests/setup.py at line 33
License text:
LICENSE = 'Apache License 2.0'
Scancode info:
@@ -94,19 +66,7 @@ FILE_INCLUDE third_party/upb/third_party/wyhash/LICENSE found in files: src/pyth
Match type : REFERENCE
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
- src/python/grpcio_tests/setup.py [34:34]
-
-KEEP Unlicense 1d267ceb3a8d8f75f1be3011ee4cbf53
-BELONGS third_party/upb/ya.make
-FILE_INCLUDE AUTHORS found in files: third_party/upb/third_party/wyhash/LICENSE at line 19
- Note: matched license text is too long. Read it in the source files.
- Scancode info:
- Original SPDX id: Unlicense
- Score : 100.00
- Match type : TEXT
- Links : http://unlicense.org/, https://spdx.org/licenses/Unlicense, https://unlicense.org/
- Files with this license:
- third_party/upb/third_party/wyhash/LICENSE [1:24]
+ src/python/grpcio_tests/setup.py [33:33]
KEEP BSD-3-Clause 26c9318cf95923719e6a1cbb87990e08
BELONGS third_party/address_sorting/ya.make
@@ -140,13 +100,15 @@ BELONGS src/python/grpcio_health_checking/ya.make src/python/grpcio_reflection/y
Match type : REFERENCE
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
+ src/python/grpcio_admin/setup.py [49:49]
+ src/python/grpcio_csds/setup.py [50:50]
src/python/grpcio_health_checking/setup.py [95:95]
src/python/grpcio_reflection/setup.py [91:91]
src/python/grpcio_status/setup.py [93:93]
- src/python/grpcio_testing/setup.py [71:71]
+ src/python/grpcio_testing/setup.py [72:72]
KEEP Apache-2.0 3b0ea1fb66390711cb1f160e05b0e2a4
-BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make ya.make
+BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make tools/codegen/core/ya.make ya.make
Note: matched license text is too long. Read it in the source files.
Scancode info:
Original SPDX id: Apache-2.0
@@ -406,6 +368,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
include/grpcpp/support/time.h [5:15]
include/grpcpp/support/validate_service_config.h [5:15]
include/grpcpp/test/channel_test_peer.h [5:15]
+ include/grpcpp/test/client_context_test_peer.h [5:15]
include/grpcpp/test/default_reactor_test_peer.h [5:15]
include/grpcpp/test/mock_stream.h [5:15]
include/grpcpp/test/server_context_test_spouse.h [5:15]
@@ -443,14 +406,10 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/filters/census/grpc_context.cc [5:15]
src/core/ext/filters/client_channel/backup_poller.cc [5:15]
src/core/ext/filters/client_channel/backup_poller.h [5:15]
- src/core/ext/filters/client_channel/channel_connectivity.cc [5:15]
- src/core/ext/filters/client_channel/client_channel.h [5:15]
src/core/ext/filters/client_channel/client_channel_channelz.cc [5:15]
src/core/ext/filters/client_channel/client_channel_channelz.h [5:15]
src/core/ext/filters/client_channel/client_channel_factory.cc [5:15]
- src/core/ext/filters/client_channel/client_channel_factory.h [5:15]
src/core/ext/filters/client_channel/client_channel_plugin.cc [5:15]
- src/core/ext/filters/client_channel/connector.h [5:15]
src/core/ext/filters/client_channel/global_subchannel_pool.h [5:15]
src/core/ext/filters/client_channel/health/health_check_client.cc [5:15]
src/core/ext/filters/client_channel/health/health_check_client.h [5:15]
@@ -459,10 +418,8 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/filters/client_channel/http_proxy.cc [5:15]
src/core/ext/filters/client_channel/http_proxy.h [5:15]
src/core/ext/filters/client_channel/lb_policy.cc [5:15]
- src/core/ext/filters/client_channel/lb_policy.h [5:15]
src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc [5:15]
src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h [5:15]
- src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc [5:15]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h [5:15]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc [5:15]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h [5:15]
@@ -485,12 +442,10 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/filters/client_channel/resolver.h [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h [5:15]
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h [5:15]
- src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc [5:15]
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h [5:15]
@@ -500,14 +455,10 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/filters/client_channel/resolver_factory.h [5:15]
src/core/ext/filters/client_channel/resolver_registry.cc [5:15]
src/core/ext/filters/client_channel/resolver_registry.h [5:15]
- src/core/ext/filters/client_channel/resolver_result_parsing.cc [5:15]
- src/core/ext/filters/client_channel/resolver_result_parsing.h [5:15]
src/core/ext/filters/client_channel/retry_throttle.cc [5:15]
src/core/ext/filters/client_channel/retry_throttle.h [5:15]
src/core/ext/filters/client_channel/server_address.cc [5:15]
src/core/ext/filters/client_channel/server_address.h [5:15]
- src/core/ext/filters/client_channel/subchannel.cc [5:15]
- src/core/ext/filters/client_channel/subchannel.h [5:15]
src/core/ext/filters/client_channel/subchannel_interface.h [5:15]
src/core/ext/filters/client_channel/subchannel_pool_interface.h [5:15]
src/core/ext/filters/client_idle/client_idle_filter.cc [5:15]
@@ -523,13 +474,9 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/filters/max_age/max_age_filter.cc [5:15]
src/core/ext/transport/chttp2/alpn/alpn.cc [5:15]
src/core/ext/transport/chttp2/alpn/alpn.h [5:15]
- src/core/ext/transport/chttp2/client/authority.cc [5:15]
- src/core/ext/transport/chttp2/client/authority.h [5:15]
src/core/ext/transport/chttp2/client/chttp2_connector.cc [5:15]
src/core/ext/transport/chttp2/client/chttp2_connector.h [5:15]
- src/core/ext/transport/chttp2/client/insecure/channel_create.cc [5:15]
src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc [5:15]
- src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc [5:15]
src/core/ext/transport/chttp2/server/chttp2_server.cc [5:15]
src/core/ext/transport/chttp2/server/chttp2_server.h [5:15]
src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc [5:15]
@@ -562,14 +509,12 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/transport/chttp2/transport/hpack_encoder.h [5:15]
src/core/ext/transport/chttp2/transport/hpack_parser.cc [5:15]
src/core/ext/transport/chttp2/transport/hpack_parser.h [5:15]
- src/core/ext/transport/chttp2/transport/hpack_table.cc [5:15]
- src/core/ext/transport/chttp2/transport/hpack_table.h [5:15]
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.cc [5:15]
+ src/core/ext/transport/chttp2/transport/hpack_parser_table.h [5:15]
src/core/ext/transport/chttp2/transport/http2_settings.cc [4:14]
src/core/ext/transport/chttp2/transport/http2_settings.h [4:14]
src/core/ext/transport/chttp2/transport/huffsyms.cc [5:15]
src/core/ext/transport/chttp2/transport/huffsyms.h [5:15]
- src/core/ext/transport/chttp2/transport/incoming_metadata.cc [5:15]
- src/core/ext/transport/chttp2/transport/incoming_metadata.h [5:15]
src/core/ext/transport/chttp2/transport/internal.h [5:15]
src/core/ext/transport/chttp2/transport/parsing.cc [5:15]
src/core/ext/transport/chttp2/transport/stream_lists.cc [5:15]
@@ -581,13 +526,13 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/ext/transport/inproc/inproc_plugin.cc [5:15]
src/core/ext/transport/inproc/inproc_transport.cc [5:15]
src/core/ext/transport/inproc/inproc_transport.h [5:15]
- src/core/ext/xds/xds_api.cc [5:15]
src/core/ext/xds/xds_api.h [5:15]
- src/core/ext/xds/xds_client.cc [5:15]
src/core/ext/xds/xds_client_stats.cc [5:15]
src/core/ext/xds/xds_client_stats.h [5:15]
- src/core/lib/avl/avl.cc [5:15]
- src/core/lib/avl/avl.h [5:15]
+ src/core/lib/address_utils/parse_address.cc [5:15]
+ src/core/lib/address_utils/parse_address.h [5:15]
+ src/core/lib/address_utils/sockaddr_utils.cc [5:15]
+ src/core/lib/address_utils/sockaddr_utils.h [5:15]
src/core/lib/backoff/backoff.cc [5:15]
src/core/lib/backoff/backoff.h [5:15]
src/core/lib/channel/channel_args.cc [5:15]
@@ -634,7 +579,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/debug/trace.h [5:15]
src/core/lib/gpr/alloc.cc [5:15]
src/core/lib/gpr/alloc.h [5:15]
- src/core/lib/gpr/arena.h [5:15]
src/core/lib/gpr/atm.cc [5:15]
src/core/lib/gpr/cpu_iphone.cc [5:15]
src/core/lib/gpr/cpu_linux.cc [5:15]
@@ -668,11 +612,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/gpr/time_precise.h [5:15]
src/core/lib/gpr/time_windows.cc [5:15]
src/core/lib/gpr/tls.h [5:15]
- src/core/lib/gpr/tls_gcc.h [5:15]
- src/core/lib/gpr/tls_msvc.h [5:15]
- src/core/lib/gpr/tls_pthread.cc [5:15]
- src/core/lib/gpr/tls_pthread.h [5:15]
- src/core/lib/gpr/tls_stdcpp.h [5:15]
src/core/lib/gpr/tmpfile.h [5:15]
src/core/lib/gpr/tmpfile_msys.cc [5:15]
src/core/lib/gpr/tmpfile_posix.cc [5:15]
@@ -681,7 +620,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/gpr/wrap_memcpy.cc [5:15]
src/core/lib/gprpp/arena.cc [5:15]
src/core/lib/gprpp/arena.h [5:15]
- src/core/lib/gprpp/atomic.h [5:15]
+ src/core/lib/gprpp/atomic_utils.h [5:15]
src/core/lib/gprpp/debug_location.h [5:15]
src/core/lib/gprpp/examine_stack.cc [5:15]
src/core/lib/gprpp/examine_stack.h [5:15]
@@ -730,7 +669,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/endpoint_cfstream.h [5:15]
src/core/lib/iomgr/endpoint_pair.h [5:15]
src/core/lib/iomgr/endpoint_pair_posix.cc [5:15]
- src/core/lib/iomgr/endpoint_pair_uv.cc [5:15]
src/core/lib/iomgr/endpoint_pair_windows.cc [5:15]
src/core/lib/iomgr/error.cc [5:15]
src/core/lib/iomgr/error.h [5:15]
@@ -777,7 +715,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/iomgr_internal.h [5:15]
src/core/lib/iomgr/iomgr_posix.cc [5:15]
src/core/lib/iomgr/iomgr_posix_cfstream.cc [5:15]
- src/core/lib/iomgr/iomgr_uv.cc [5:15]
src/core/lib/iomgr/iomgr_windows.cc [5:15]
src/core/lib/iomgr/is_epollexclusive_available.cc [5:15]
src/core/lib/iomgr/is_epollexclusive_available.h [5:15]
@@ -786,11 +723,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/lockfree_event.cc [5:15]
src/core/lib/iomgr/lockfree_event.h [5:15]
src/core/lib/iomgr/nameser.h [5:15]
- src/core/lib/iomgr/parse_address.cc [5:15]
- src/core/lib/iomgr/parse_address.h [5:15]
- src/core/lib/iomgr/poller/eventmanager_interface.h [5:15]
- src/core/lib/iomgr/poller/eventmanager_libuv.cc [5:15]
- src/core/lib/iomgr/poller/eventmanager_libuv.h [5:15]
src/core/lib/iomgr/polling_entity.cc [5:15]
src/core/lib/iomgr/polling_entity.h [5:15]
src/core/lib/iomgr/pollset.cc [5:15]
@@ -803,8 +735,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/pollset_set_custom.h [5:15]
src/core/lib/iomgr/pollset_set_windows.cc [5:15]
src/core/lib/iomgr/pollset_set_windows.h [5:15]
- src/core/lib/iomgr/pollset_uv.cc [5:15]
- src/core/lib/iomgr/pollset_uv.h [5:15]
src/core/lib/iomgr/pollset_windows.cc [5:15]
src/core/lib/iomgr/pollset_windows.h [5:15]
src/core/lib/iomgr/port.h [5:15]
@@ -815,13 +745,8 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/resolve_address_custom.h [5:15]
src/core/lib/iomgr/resolve_address_posix.cc [5:15]
src/core/lib/iomgr/resolve_address_windows.cc [5:15]
- src/core/lib/iomgr/resource_quota.cc [5:15]
- src/core/lib/iomgr/resource_quota.h [5:15]
src/core/lib/iomgr/sockaddr.h [5:15]
- src/core/lib/iomgr/sockaddr_custom.h [5:15]
src/core/lib/iomgr/sockaddr_posix.h [5:15]
- src/core/lib/iomgr/sockaddr_utils.cc [5:15]
- src/core/lib/iomgr/sockaddr_utils.h [5:15]
src/core/lib/iomgr/sockaddr_windows.h [5:15]
src/core/lib/iomgr/socket_factory_posix.cc [5:15]
src/core/lib/iomgr/socket_factory_posix.h [5:15]
@@ -832,7 +757,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/socket_utils_linux.cc [5:15]
src/core/lib/iomgr/socket_utils_posix.cc [5:15]
src/core/lib/iomgr/socket_utils_posix.h [5:15]
- src/core/lib/iomgr/socket_utils_uv.cc [5:15]
src/core/lib/iomgr/socket_utils_windows.cc [5:15]
src/core/lib/iomgr/socket_windows.cc [5:15]
src/core/lib/iomgr/socket_windows.h [5:15]
@@ -857,7 +781,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc [5:15]
src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc [5:15]
src/core/lib/iomgr/tcp_server_windows.cc [5:15]
- src/core/lib/iomgr/tcp_uv.cc [5:15]
src/core/lib/iomgr/tcp_windows.cc [5:15]
src/core/lib/iomgr/tcp_windows.h [5:15]
src/core/lib/iomgr/time_averaged_stats.cc [5:15]
@@ -872,9 +795,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/iomgr/timer_heap.h [5:15]
src/core/lib/iomgr/timer_manager.cc [5:15]
src/core/lib/iomgr/timer_manager.h [5:15]
- src/core/lib/iomgr/timer_uv.cc [5:15]
- src/core/lib/iomgr/udp_server.cc [5:15]
- src/core/lib/iomgr/udp_server.h [5:15]
src/core/lib/iomgr/unix_sockets_posix.cc [5:15]
src/core/lib/iomgr/unix_sockets_posix.h [5:15]
src/core/lib/iomgr/unix_sockets_posix_noop.cc [5:15]
@@ -892,6 +812,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/profiling/basic_timers.cc [5:15]
src/core/lib/profiling/stap_timers.cc [5:15]
src/core/lib/profiling/timers.h [5:15]
+ src/core/lib/promise/detail/switch.h [4:14]
src/core/lib/security/context/security_context.cc [5:15]
src/core/lib/security/context/security_context.h [5:15]
src/core/lib/security/credentials/alts/alts_credentials.cc [5:15]
@@ -971,12 +892,16 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/core/lib/slice/percent_encoding.cc [5:15]
src/core/lib/slice/percent_encoding.h [5:15]
src/core/lib/slice/slice.cc [5:15]
+ src/core/lib/slice/slice_api.cc [5:15]
src/core/lib/slice/slice_buffer.cc [5:15]
src/core/lib/slice/slice_intern.cc [5:15]
src/core/lib/slice/slice_internal.h [5:15]
+ src/core/lib/slice/slice_split.h [5:15]
src/core/lib/slice/slice_string_helpers.cc [5:15]
src/core/lib/slice/slice_string_helpers.h [5:15]
src/core/lib/slice/slice_utils.h [5:15]
+ src/core/lib/slice/static_slice.cc [4:14]
+ src/core/lib/slice/static_slice.h [4:14]
src/core/lib/surface/api_trace.cc [5:15]
src/core/lib/surface/api_trace.h [5:15]
src/core/lib/surface/byte_buffer.cc [5:15]
@@ -1124,8 +1049,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
src/cpp/common/secure_channel_arguments.cc [5:15]
src/cpp/common/secure_create_auth_context.cc [5:15]
src/cpp/common/tls_credentials_options.cc [5:15]
- src/cpp/common/tls_credentials_options_util.cc [5:15]
- src/cpp/common/tls_credentials_options_util.h [5:15]
src/cpp/common/validate_service_config.cc [5:15]
src/cpp/common/version_cc.cc [5:15]
src/cpp/ext/proto_server_reflection.cc [5:15]
@@ -1208,14 +1131,10 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
test/core/util/subprocess_windows.cc [5:15]
test/core/util/test_config.cc [5:15]
test/core/util/test_config.h [5:15]
- test/core/util/test_lb_policies.cc [5:15]
- test/core/util/test_lb_policies.h [5:15]
test/core/util/test_tcp_server.cc [5:15]
test/core/util/test_tcp_server.h [5:15]
test/core/util/tracer_util.cc [5:15]
test/core/util/tracer_util.h [5:15]
- test/core/util/trickle_endpoint.cc [5:15]
- test/core/util/trickle_endpoint.h [5:15]
test/cpp/end2end/async_end2end_test.cc [5:15]
test/cpp/end2end/cfstream_test.cc [5:15]
test/cpp/end2end/channelz_service_test.cc [5:15]
@@ -1231,7 +1150,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
test/cpp/end2end/filter_end2end_test.cc [5:15]
test/cpp/end2end/flaky_network_test.cc [5:15]
test/cpp/end2end/generic_end2end_test.cc [5:15]
- test/cpp/end2end/grpclb_end2end_test.cc [5:15]
test/cpp/end2end/health_service_end2end_test.cc [5:15]
test/cpp/end2end/hybrid_end2end_test.cc [5:15]
test/cpp/end2end/interceptors_util.cc [5:15]
@@ -1257,7 +1175,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
test/cpp/end2end/test_service_impl.h [5:15]
test/cpp/end2end/thread_stress_test.cc [5:15]
test/cpp/end2end/time_change_test.cc [5:15]
- test/cpp/end2end/xds_end2end_test.cc [5:15]
test/cpp/util/byte_buffer_proto_helper.cc [5:15]
test/cpp/util/byte_buffer_proto_helper.h [5:15]
test/cpp/util/byte_buffer_test.cc [5:15]
@@ -1298,11 +1215,9 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make test/core/util/ya.make test/
test/cpp/util/test_credentials_provider.h [5:15]
test/cpp/util/time_test.cc [5:15]
tools/codegen/core/gen_hpack_tables.cc [5:15]
- tools/codegen/core/gen_legal_metadata_characters.cc [5:15]
- tools/codegen/core/gen_percent_encoding_tables.cc [5:15]
KEEP Apache-2.0 4248d6c827c367ff9f1b5e59ca41408e
-BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.make src/proto/grpc/core/ya.make src/proto/grpc/health/v1/ya.make src/proto/grpc/reflection/v1alpha/ya.make src/proto/grpc/status/ya.make src/proto/grpc/testing/duplicate/ya.make src/proto/grpc/testing/xds/ya.make src/proto/grpc/testing/ya.make test/core/util/ya.make test/cpp/end2end/ya.make ya.make
+BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.make src/proto/grpc/core/ya.make src/proto/grpc/health/v1/ya.make src/proto/grpc/reflection/v1alpha/ya.make src/proto/grpc/status/ya.make src/proto/grpc/testing/duplicate/ya.make src/proto/grpc/testing/xds/ya.make src/proto/grpc/testing/ya.make test/core/util/ya.make test/cpp/end2end/ya.make test/cpp/util/ya.make ya.make
Note: matched license text is too long. Read it in the source files.
Scancode info:
Original SPDX id: Apache-2.0
@@ -1310,26 +1225,44 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
Match type : NOTICE
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
+ include/grpc/event_engine/endpoint_config.h [3:13]
+ include/grpc/event_engine/event_engine.h [3:13]
+ include/grpc/event_engine/internal/memory_allocator_impl.h [3:13]
+ include/grpc/event_engine/memory_allocator.h [3:13]
+ include/grpc/event_engine/memory_request.h [3:13]
+ include/grpc/event_engine/port.h [3:13]
+ include/grpcpp/create_channel_binder.h [3:13]
include/grpcpp/ext/admin_services.h [5:15]
+ include/grpcpp/security/authorization_policy_provider.h [3:13]
+ include/grpcpp/security/binder_credentials.h [3:13]
+ include/grpcpp/security/binder_security_policy.h [3:13]
include/grpcpp/security/tls_certificate_provider.h [4:14]
+ include/grpcpp/security/tls_certificate_verifier.h [4:14]
include/grpcpp/xds_server_builder.h [5:15]
src/core/ext/filters/client_channel/backend_metric.cc [4:14]
src/core/ext/filters/client_channel/backend_metric.h [4:14]
+ src/core/ext/filters/client_channel/channel_connectivity.cc [4:14]
src/core/ext/filters/client_channel/client_channel.cc [4:14]
+ src/core/ext/filters/client_channel/client_channel.h [4:14]
+ src/core/ext/filters/client_channel/client_channel_factory.h [4:14]
src/core/ext/filters/client_channel/config_selector.cc [4:14]
src/core/ext/filters/client_channel/config_selector.h [4:14]
+ src/core/ext/filters/client_channel/connector.h [4:14]
src/core/ext/filters/client_channel/dynamic_filters.cc [4:14]
src/core/ext/filters/client_channel/dynamic_filters.h [4:14]
src/core/ext/filters/client_channel/global_subchannel_pool.cc [5:15]
+ src/core/ext/filters/client_channel/lb_policy.h [4:14]
src/core/ext/filters/client_channel/lb_policy/address_filtering.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/address_filtering.h [4:14]
src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h [4:14]
+ src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h [4:14]
src/core/ext/filters/client_channel/lb_policy/priority/priority.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h [4:14]
+ src/core/ext/filters/client_channel/lb_policy/rls/rls.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/xds/cds.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/xds/xds.h [4:14]
@@ -1338,18 +1271,26 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc [4:14]
src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc [4:14]
src/core/ext/filters/client_channel/local_subchannel_pool.cc [5:15]
+ src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc [3:13]
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc [3:13]
+ src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc [3:13]
src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc [4:14]
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc [4:14]
src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h [4:14]
src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc [4:14]
src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h [4:14]
- src/core/ext/filters/client_channel/service_config.cc [4:14]
- src/core/ext/filters/client_channel/service_config.h [4:14]
- src/core/ext/filters/client_channel/service_config_call_data.h [4:14]
+ src/core/ext/filters/client_channel/resolver_result_parsing.cc [4:14]
+ src/core/ext/filters/client_channel/resolver_result_parsing.h [4:14]
+ src/core/ext/filters/client_channel/retry_filter.cc [4:14]
+ src/core/ext/filters/client_channel/retry_filter.h [4:14]
+ src/core/ext/filters/client_channel/retry_service_config.cc [4:14]
+ src/core/ext/filters/client_channel/retry_service_config.h [4:14]
src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc [4:14]
- src/core/ext/filters/client_channel/service_config_parser.cc [4:14]
- src/core/ext/filters/client_channel/service_config_parser.h [4:14]
+ src/core/ext/filters/client_channel/subchannel.cc [4:14]
+ src/core/ext/filters/client_channel/subchannel.h [4:14]
src/core/ext/filters/client_channel/subchannel_pool_interface.cc [5:15]
+ src/core/ext/filters/client_idle/idle_filter_state.cc [3:13]
+ src/core/ext/filters/client_idle/idle_filter_state.h [3:13]
src/core/ext/filters/deadline/deadline_filter.cc [4:14]
src/core/ext/filters/deadline/deadline_filter.h [4:14]
src/core/ext/filters/fault_injection/fault_injection_filter.cc [4:14]
@@ -1361,11 +1302,62 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/core/ext/filters/max_age/max_age_filter.h [4:14]
src/core/ext/filters/message_size/message_size_filter.cc [4:14]
src/core/ext/filters/message_size/message_size_filter.h [4:14]
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc [4:14]
- src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h [4:14]
- src/core/ext/filters/workarounds/workaround_utils.cc [4:14]
- src/core/ext/filters/workarounds/workaround_utils.h [4:14]
+ src/core/ext/filters/server_config_selector/server_config_selector.cc [4:14]
+ src/core/ext/filters/server_config_selector/server_config_selector.h [4:14]
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.cc [5:15]
+ src/core/ext/filters/server_config_selector/server_config_selector_filter.h [5:15]
+ src/core/ext/service_config/service_config.cc [4:14]
+ src/core/ext/service_config/service_config.h [4:14]
+ src/core/ext/service_config/service_config_call_data.h [4:14]
+ src/core/ext/service_config/service_config_parser.cc [4:14]
+ src/core/ext/service_config/service_config_parser.h [4:14]
+ src/core/ext/transport/binder/client/binder_connector.cc [3:13]
+ src/core/ext/transport/binder/client/binder_connector.h [3:13]
+ src/core/ext/transport/binder/client/channel_create.cc [3:13]
+ src/core/ext/transport/binder/client/channel_create_impl.cc [3:13]
+ src/core/ext/transport/binder/client/channel_create_impl.h [3:13]
+ src/core/ext/transport/binder/client/connection_id_generator.cc [3:13]
+ src/core/ext/transport/binder/client/connection_id_generator.h [3:13]
+ src/core/ext/transport/binder/client/endpoint_binder_pool.cc [3:13]
+ src/core/ext/transport/binder/client/endpoint_binder_pool.h [3:13]
+ src/core/ext/transport/binder/client/jni_utils.cc [3:13]
+ src/core/ext/transport/binder/client/jni_utils.h [3:13]
+ src/core/ext/transport/binder/client/security_policy_setting.cc [3:13]
+ src/core/ext/transport/binder/client/security_policy_setting.h [3:13]
+ src/core/ext/transport/binder/security_policy/binder_security_policy.cc [3:13]
+ src/core/ext/transport/binder/server/binder_server.cc [3:13]
+ src/core/ext/transport/binder/server/binder_server.h [3:13]
+ src/core/ext/transport/binder/server/binder_server_credentials.cc [3:13]
+ src/core/ext/transport/binder/transport/binder_stream.h [3:13]
+ src/core/ext/transport/binder/transport/binder_transport.cc [3:13]
+ src/core/ext/transport/binder/transport/binder_transport.h [3:13]
+ src/core/ext/transport/binder/utils/ndk_binder.cc [3:13]
+ src/core/ext/transport/binder/utils/ndk_binder.h [3:13]
+ src/core/ext/transport/binder/utils/transport_stream_receiver.h [3:13]
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc [3:13]
+ src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h [3:13]
+ src/core/ext/transport/binder/wire_format/binder.h [3:13]
+ src/core/ext/transport/binder/wire_format/binder_android.cc [3:13]
+ src/core/ext/transport/binder/wire_format/binder_android.h [3:13]
+ src/core/ext/transport/binder/wire_format/binder_constants.cc [3:13]
+ src/core/ext/transport/binder/wire_format/binder_constants.h [3:13]
+ src/core/ext/transport/binder/wire_format/transaction.cc [3:13]
+ src/core/ext/transport/binder/wire_format/transaction.h [3:13]
+ src/core/ext/transport/binder/wire_format/wire_reader.h [3:13]
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.cc [3:13]
+ src/core/ext/transport/binder/wire_format/wire_reader_impl.h [3:13]
+ src/core/ext/transport/binder/wire_format/wire_writer.cc [3:13]
+ src/core/ext/transport/binder/wire_format/wire_writer.h [3:13]
+ src/core/ext/transport/chttp2/client/insecure/channel_create.cc [4:14]
+ src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc [4:14]
src/core/ext/transport/chttp2/transport/chttp2_transport.cc [4:14]
+ src/core/ext/transport/chttp2/transport/hpack_constants.h [3:13]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_index.h [3:13]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc [3:13]
+ src/core/ext/transport/chttp2/transport/hpack_encoder_table.h [3:13]
+ src/core/ext/transport/chttp2/transport/hpack_utils.cc [3:13]
+ src/core/ext/transport/chttp2/transport/hpack_utils.h [3:13]
+ src/core/ext/transport/chttp2/transport/popularity_count.h [3:13]
src/core/ext/xds/certificate_provider_factory.h [5:15]
src/core/ext/xds/certificate_provider_registry.cc [5:15]
src/core/ext/xds/certificate_provider_registry.h [5:15]
@@ -1373,29 +1365,117 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/core/ext/xds/certificate_provider_store.h [5:15]
src/core/ext/xds/file_watcher_certificate_provider_factory.cc [5:15]
src/core/ext/xds/file_watcher_certificate_provider_factory.h [5:15]
+ src/core/ext/xds/xds_api.cc [4:14]
src/core/ext/xds/xds_bootstrap.cc [4:14]
src/core/ext/xds/xds_bootstrap.h [4:14]
src/core/ext/xds/xds_certificate_provider.cc [5:15]
src/core/ext/xds/xds_certificate_provider.h [5:15]
src/core/ext/xds/xds_channel_args.h [4:14]
+ src/core/ext/xds/xds_channel_stack_modifier.cc [5:15]
+ src/core/ext/xds/xds_channel_stack_modifier.h [5:15]
+ src/core/ext/xds/xds_client.cc [4:14]
src/core/ext/xds/xds_client.h [4:14]
src/core/ext/xds/xds_http_fault_filter.cc [4:14]
src/core/ext/xds/xds_http_fault_filter.h [4:14]
src/core/ext/xds/xds_http_filters.cc [4:14]
src/core/ext/xds/xds_http_filters.h [4:14]
+ src/core/ext/xds/xds_routing.cc [5:15]
+ src/core/ext/xds/xds_routing.h [5:15]
src/core/ext/xds/xds_server_config_fetcher.cc [5:15]
+ src/core/lib/avl/avl.h [3:13]
+ src/core/lib/channel/call_tracer.h [5:15]
+ src/core/lib/channel/channel_args_preconditioning.cc [3:13]
+ src/core/lib/channel/channel_args_preconditioning.h [3:13]
+ src/core/lib/config/core_configuration.cc [3:13]
+ src/core/lib/config/core_configuration.h [3:13]
+ src/core/lib/event_engine/channel_args_endpoint_config.cc [3:13]
+ src/core/lib/event_engine/channel_args_endpoint_config.h [3:13]
+ src/core/lib/event_engine/event_engine.cc [3:13]
+ src/core/lib/event_engine/event_engine_factory.cc [3:13]
+ src/core/lib/event_engine/event_engine_factory.h [3:13]
+ src/core/lib/event_engine/memory_allocator.cc [3:13]
+ src/core/lib/event_engine/sockaddr.cc [3:13]
+ src/core/lib/event_engine/sockaddr.h [3:13]
+ src/core/lib/gprpp/bitset.h [3:13]
+ src/core/lib/gprpp/capture.h [3:13]
+ src/core/lib/gprpp/chunked_vector.h [3:13]
+ src/core/lib/gprpp/construct_destruct.h [3:13]
+ src/core/lib/gprpp/cpp_impl_of.h [3:13]
src/core/lib/gprpp/dual_ref_counted.h [4:14]
+ src/core/lib/gprpp/match.h [3:13]
+ src/core/lib/gprpp/overload.h [3:13]
src/core/lib/gprpp/stat.h [4:14]
src/core/lib/gprpp/stat_posix.cc [4:14]
src/core/lib/gprpp/stat_windows.cc [4:14]
+ src/core/lib/gprpp/status_helper.cc [5:15]
+ src/core/lib/gprpp/status_helper.h [5:15]
+ src/core/lib/gprpp/table.h [3:13]
src/core/lib/gprpp/time_util.cc [4:14]
src/core/lib/gprpp/time_util.h [4:14]
+ src/core/lib/iomgr/endpoint_pair_event_engine.cc [3:13]
+ src/core/lib/iomgr/event_engine/closure.cc [3:13]
+ src/core/lib/iomgr/event_engine/closure.h [3:13]
+ src/core/lib/iomgr/event_engine/endpoint.cc [3:13]
+ src/core/lib/iomgr/event_engine/endpoint.h [3:13]
+ src/core/lib/iomgr/event_engine/iomgr.cc [3:13]
+ src/core/lib/iomgr/event_engine/pollset.cc [3:13]
+ src/core/lib/iomgr/event_engine/pollset.h [3:13]
+ src/core/lib/iomgr/event_engine/promise.h [3:13]
+ src/core/lib/iomgr/event_engine/resolved_address_internal.cc [3:13]
+ src/core/lib/iomgr/event_engine/resolved_address_internal.h [3:13]
+ src/core/lib/iomgr/event_engine/resolver.cc [3:13]
+ src/core/lib/iomgr/event_engine/tcp.cc [3:13]
+ src/core/lib/iomgr/event_engine/timer.cc [3:13]
src/core/lib/json/json_util.cc [5:15]
src/core/lib/json/json_util.h [5:15]
src/core/lib/matchers/matchers.cc [3:13]
src/core/lib/matchers/matchers.h [3:13]
- src/core/lib/security/authorization/authorization_engine.h [4:14]
- src/core/lib/security/authorization/evaluate_args.h [5:15]
+ src/core/lib/promise/activity.cc [3:13]
+ src/core/lib/promise/activity.h [3:13]
+ src/core/lib/promise/arena_promise.h [3:13]
+ src/core/lib/promise/context.h [3:13]
+ src/core/lib/promise/detail/basic_join.h [3:13]
+ src/core/lib/promise/detail/basic_seq.h [3:13]
+ src/core/lib/promise/detail/promise_factory.h [3:13]
+ src/core/lib/promise/detail/promise_like.h [3:13]
+ src/core/lib/promise/detail/status.h [3:13]
+ src/core/lib/promise/exec_ctx_wakeup_scheduler.h [3:13]
+ src/core/lib/promise/for_each.h [3:13]
+ src/core/lib/promise/if.h [3:13]
+ src/core/lib/promise/intra_activity_waiter.h [3:13]
+ src/core/lib/promise/join.h [3:13]
+ src/core/lib/promise/latch.h [3:13]
+ src/core/lib/promise/loop.h [3:13]
+ src/core/lib/promise/map.h [3:13]
+ src/core/lib/promise/observable.h [3:13]
+ src/core/lib/promise/pipe.h [3:13]
+ src/core/lib/promise/poll.h [3:13]
+ src/core/lib/promise/promise.h [3:13]
+ src/core/lib/promise/race.h [3:13]
+ src/core/lib/promise/seq.h [3:13]
+ src/core/lib/promise/try_join.h [3:13]
+ src/core/lib/promise/try_seq.h [3:13]
+ src/core/lib/promise/wait_set.h [3:13]
+ src/core/lib/resource_quota/api.cc [3:13]
+ src/core/lib/resource_quota/api.h [3:13]
+ src/core/lib/resource_quota/memory_quota.cc [3:13]
+ src/core/lib/resource_quota/memory_quota.h [3:13]
+ src/core/lib/resource_quota/resource_quota.cc [3:13]
+ src/core/lib/resource_quota/resource_quota.h [3:13]
+ src/core/lib/resource_quota/thread_quota.cc [3:13]
+ src/core/lib/resource_quota/thread_quota.h [3:13]
+ src/core/lib/resource_quota/trace.cc [3:13]
+ src/core/lib/resource_quota/trace.h [3:13]
+ src/core/lib/security/authorization/authorization_engine.h [3:13]
+ src/core/lib/security/authorization/authorization_policy_provider.h [3:13]
+ src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc [3:13]
+ src/core/lib/security/authorization/authorization_policy_provider_vtable.cc [3:13]
+ src/core/lib/security/authorization/cel_authorization_engine.h [4:14]
+ src/core/lib/security/authorization/evaluate_args.cc [3:13]
+ src/core/lib/security/authorization/evaluate_args.h [3:13]
+ src/core/lib/security/authorization/grpc_authorization_engine.h [3:13]
+ src/core/lib/security/authorization/grpc_authorization_policy_provider.h [3:13]
+ src/core/lib/security/authorization/matchers.h [3:13]
src/core/lib/security/authorization/mock_cel/activation.h [3:13]
src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h [3:13]
src/core/lib/security/authorization/mock_cel/cel_expression.h [3:13]
@@ -1404,6 +1484,8 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/core/lib/security/authorization/mock_cel/flat_expr_builder.h [3:13]
src/core/lib/security/authorization/rbac_policy.h [3:13]
src/core/lib/security/authorization/rbac_translator.h [3:13]
+ src/core/lib/security/authorization/sdk_server_authz_filter.cc [3:13]
+ src/core/lib/security/authorization/sdk_server_authz_filter.h [3:13]
src/core/lib/security/credentials/external/aws_external_account_credentials.cc [4:14]
src/core/lib/security/credentials/external/aws_external_account_credentials.h [4:14]
src/core/lib/security/credentials/external/aws_request_signer.cc [4:14]
@@ -1419,33 +1501,43 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h [4:14]
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc [4:14]
src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h [4:14]
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc [4:14]
+ src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h [4:14]
src/core/lib/security/credentials/tls/tls_utils.cc [5:15]
src/core/lib/security/credentials/tls/tls_utils.h [5:15]
src/core/lib/security/credentials/xds/xds_credentials.cc [5:15]
src/core/lib/security/credentials/xds/xds_credentials.h [5:15]
src/core/lib/security/security_connector/insecure/insecure_security_connector.cc [5:15]
src/core/lib/security/security_connector/insecure/insecure_security_connector.h [5:15]
+ src/core/lib/slice/slice.h [3:13]
+ src/core/lib/slice/slice_refcount.cc [3:13]
+ src/core/lib/slice/slice_refcount.h [3:13]
+ src/core/lib/slice/slice_refcount_base.h [3:13]
+ src/core/lib/slice/slice_split.cc [3:13]
+ src/core/lib/surface/builtins.cc [3:13]
+ src/core/lib/surface/builtins.h [3:13]
src/core/lib/surface/server.cc [4:14]
src/core/lib/surface/server.h [4:14]
- src/core/lib/transport/authority_override.cc [4:14]
- src/core/lib/transport/authority_override.h [4:14]
+ src/core/lib/transport/parsed_metadata.cc [3:13]
+ src/core/lib/transport/parsed_metadata.h [3:13]
src/core/tsi/alts/handshaker/proto/altscontext.proto [3:13]
src/core/tsi/alts/handshaker/proto/handshaker.proto [3:13]
src/core/tsi/alts/handshaker/proto/transport_security_common.proto [3:13]
src/cpp/client/xds_credentials.cc [5:15]
src/cpp/common/tls_certificate_provider.cc [4:14]
+ src/cpp/common/tls_certificate_verifier.cc [4:14]
src/cpp/server/xds_server_credentials.cc [5:15]
- src/proto/grpc/auth/v1/authz_policy.proto [3:13]
- src/proto/grpc/binary_log/v1alpha/log.proto [3:13]
src/proto/grpc/channelz/channelz.proto [3:13]
src/proto/grpc/core/stats.proto [3:13]
src/proto/grpc/gcp/altscontext.proto [3:13]
src/proto/grpc/gcp/handshaker.proto [3:13]
src/proto/grpc/gcp/transport_security_common.proto [3:13]
src/proto/grpc/health/v1/health.proto [3:13]
- src/proto/grpc/http_over_grpc/http_over_grpc.proto [3:13]
src/proto/grpc/lb/v1/load_balancer.proto [3:13]
src/proto/grpc/lb/v1/load_reporter.proto [3:13]
+ src/proto/grpc/lookup/v1/rls.proto [3:13]
+ src/proto/grpc/lookup/v1/rls_config.proto [3:13]
+ src/proto/grpc/reflection/v1/reflection.proto [3:13]
src/proto/grpc/reflection/v1alpha/reflection.proto [3:13]
src/proto/grpc/status/status.proto [3:13]
src/proto/grpc/testing/benchmark_service.proto [3:13]
@@ -1472,7 +1564,6 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/proto/grpc/testing/xds/eds_for_test.proto [3:13]
src/proto/grpc/testing/xds/lds_rds_for_test.proto [3:13]
src/proto/grpc/testing/xds/lrs_for_test.proto [3:13]
- src/proto/grpc/testing/xds/orca_load_report_for_test.proto [3:13]
src/proto/grpc/testing/xds/v3/address.proto [3:13]
src/proto/grpc/testing/xds/v3/ads.proto [3:13]
src/proto/grpc/testing/xds/v3/aggregate_cluster.proto [3:13]
@@ -1483,6 +1574,7 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/proto/grpc/testing/xds/v3/csds.proto [3:13]
src/proto/grpc/testing/xds/v3/discovery.proto [3:13]
src/proto/grpc/testing/xds/v3/endpoint.proto [3:13]
+ src/proto/grpc/testing/xds/v3/extension.proto [3:13]
src/proto/grpc/testing/xds/v3/fault.proto [3:13]
src/proto/grpc/testing/xds/v3/fault_common.proto [3:13]
src/proto/grpc/testing/xds/v3/http_connection_manager.proto [3:13]
@@ -1499,25 +1591,37 @@ BELONGS src/core/lib/ya.make src/cpp/common/ya.make src/proto/grpc/channelz/ya.m
src/proto/grpc/testing/xds/v3/string.proto [3:13]
src/proto/grpc/testing/xds/v3/tls.proto [3:13]
src/proto/math/math.proto [4:14]
- test/core/util/eval_args_mock_endpoint.cc [3:13]
- test/core/util/eval_args_mock_endpoint.h [3:13]
+ test/core/util/build.cc [3:13]
+ test/core/util/build.h [3:13]
+ test/core/util/evaluate_args_test_util.h [3:13]
+ test/core/util/mock_authorization_endpoint.h [3:13]
test/core/util/resolve_localhost_ip46.cc [5:15]
test/core/util/resolve_localhost_ip46.h [5:15]
+ test/core/util/test_lb_policies.cc [4:14]
+ test/core/util/test_lb_policies.h [4:14]
test/core/util/tls_utils.cc [4:14]
test/core/util/tls_utils.h [4:14]
test/cpp/end2end/admin_services_end2end_test.cc [5:15]
- test/cpp/end2end/xds_credentials_end2end_test.cc [5:15]
+ test/cpp/end2end/counted_service.h [4:14]
+ test/cpp/end2end/grpclb_end2end_test.cc [4:14]
+ test/cpp/end2end/rls_end2end_test.cc [4:14]
+ test/cpp/end2end/sdk_authz_end2end_test.cc [3:13]
+ test/cpp/util/tls_test_utils.cc [4:14]
+ test/cpp/util/tls_test_utils.h [4:14]
-KEEP BSD-3-Clause 54930dd58069144c1215a9b35218104a
-BELONGS third_party/upb/ya.make
- Note: matched license text is too long. Read it in the source files.
+SKIP LicenseRef-scancode-warranty-disclaimer 44b7fb52fd3cfdfe8a017148dd5f2443
+BELONGS ya.make
+ # not a license
+ License text:
+ // attached to the channel creds, but there should also be a "use at
+ // your own risk" option to get the channel creds without stripping
Scancode info:
- Original SPDX id: BSD-3-Clause
- Score : 97.04
+ Original SPDX id: LicenseRef-scancode-warranty-disclaimer
+ Score : 100.00
Match type : TEXT
- Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/warranty-disclaimer.LICENSE
Files with this license:
- third_party/upb/LICENSE [5:26]
+ src/core/ext/filters/client_channel/lb_policy.h [284:285]
SKIP Python-2.0 5749a3f68d211a0dbd91f414c9769695
BELONGS src/python/grpcio/ya.make
@@ -1532,17 +1636,17 @@ BELONGS src/python/grpcio/ya.make
Files with this license:
src/python/grpcio/grpc/experimental/gevent.py [13:14]
-KEEP Public-Domain 5768fb73f20365b980a417d7c63f5c72
+SKIP LicenseRef-scancode-generic-cla 5d780ffa423067f23c6a123ae33e7c18
BELONGS third_party/upb/ya.make
License text:
- This is free and unencumbered software released into the public domain. http://unlicense.org/
+ \## Contributor License Agreement
Scancode info:
- Original SPDX id: LicenseRef-scancode-public-domain
- Score : 100.00
- Match type : TEXT
- Links : http://www.linfo.org/publicdomain.html, https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/public-domain.LICENSE
+ Original SPDX id: LicenseRef-scancode-generic-cla
+ Score : 16.00
+ Match type : NOTICE
+ Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/generic-cla.LICENSE
Files with this license:
- third_party/upb/third_party/wyhash/wyhash.h [2:2]
+ third_party/upb/CONTRIBUTING.md [15:15]
SKIP LicenseRef-scancode-generic-cla 60c79976a6f1daa58457b943cb911512
BELONGS ya.make
@@ -1557,6 +1661,18 @@ BELONGS ya.make
Files with this license:
CONTRIBUTING.md [16:17]
+KEEP MPL-2.0 6a24ea705a1b0d1e288b7a36cbfec9ea
+BELONGS ya.make
+ License text:
+ Mozilla Public License, v. 2.0
+ Scancode info:
+ Original SPDX id: MPL-2.0
+ Score : 100.00
+ Match type : REFERENCE
+ Links : http://mpl.mozilla.org/2012/01/03/announcing-mpl-2-0/, http://www.mozilla.com/MPL/2.0/, https://spdx.org/licenses/MPL-2.0
+ Files with this license:
+ LICENSE [238:238]
+
KEEP Apache-2.0 86a0725dcd00b87b9929258039db566c
BELONGS ya.make
Note: matched license text is too long. Read it in the source files.
@@ -1580,6 +1696,20 @@ BELONGS ya.make
Files with this license:
CONTRIBUTING.md [91:91]
+KEEP MPL-2.0 8cf713b6953fdd90a1c0b2dda10bcc6d
+BELONGS ya.make
+ License text:
+ This Source Code Form is subject to the terms of the Mozilla Public License,
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ obtain one at https://mozilla.org/MPL/2.0/.
+ Scancode info:
+ Original SPDX id: MPL-2.0
+ Score : 100.00
+ Match type : NOTICE
+ Links : http://mpl.mozilla.org/2012/01/03/announcing-mpl-2-0/, http://www.mozilla.com/MPL/2.0/, https://spdx.org/licenses/MPL-2.0
+ Files with this license:
+ LICENSE [240:242]
+
KEEP Apache-2.0 920b2f581700b4aa528093ed0d2f5a5b
BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_reflection/ya.make src/python/grpcio_status/ya.make src/python/grpcio_tests/ya.make test/core/util/ya.make ya.make
Note: matched license text is too long. Read it in the source files.
@@ -1589,7 +1719,6 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
Match type : NOTICE
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
- BUILD.gn [10:20]
src/core/tsi/test_creds/BUILD [3:13]
src/python/grpcio/_parallel_compile_patch.py [3:13]
src/python/grpcio/_spawn_patch.py [3:13]
@@ -1614,13 +1743,6 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pxd.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi [3:13]
- src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pxd.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/aio/rpc_status.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi [3:13]
@@ -1636,6 +1758,7 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/credentials.pxd.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi [3:13]
+ src/python/grpcio/grpc/_cython/_cygrpc/csds.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/event.pxd.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/event.pyx.pxi [3:13]
src/python/grpcio/grpc/_cython/_cygrpc/fork_posix.pxd.pxi [3:13]
@@ -1718,6 +1841,9 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio/grpc_core_dependencies.py [3:13]
src/python/grpcio/grpc_version.py [3:13]
src/python/grpcio/support.py [3:13]
+ src/python/grpcio_admin/grpc_admin/__init__.py [3:13]
+ src/python/grpcio_admin/grpc_version.py [3:13]
+ src/python/grpcio_admin/setup.py [3:13]
src/python/grpcio_channelz/channelz_commands.py [3:13]
src/python/grpcio_channelz/grpc_channelz/__init__.py [3:13]
src/python/grpcio_channelz/grpc_channelz/v1/__init__.py [3:13]
@@ -1726,6 +1852,9 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio_channelz/grpc_channelz/v1/channelz.py [3:13]
src/python/grpcio_channelz/grpc_version.py [3:13]
src/python/grpcio_channelz/setup.py [3:13]
+ src/python/grpcio_csds/grpc_csds/__init__.py [3:13]
+ src/python/grpcio_csds/grpc_version.py [3:13]
+ src/python/grpcio_csds/setup.py [3:13]
src/python/grpcio_health_checking/grpc_health/__init__.py [3:13]
src/python/grpcio_health_checking/grpc_health/v1/__init__.py [3:13]
src/python/grpcio_health_checking/grpc_health/v1/_async.py [3:13]
@@ -1777,9 +1906,11 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio_tests/tests/_runner.py [3:13]
src/python/grpcio_tests/tests/_sanity/__init__.py [3:13]
src/python/grpcio_tests/tests/_sanity/_sanity_test.py [3:13]
+ src/python/grpcio_tests/tests/admin/test_admin.py [3:13]
src/python/grpcio_tests/tests/bazel_namespace_package_hack.py [3:13]
src/python/grpcio_tests/tests/channelz/__init__.py [3:13]
src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py [3:13]
+ src/python/grpcio_tests/tests/csds/test_csds.py [3:13]
src/python/grpcio_tests/tests/fork/__init__.py [3:13]
src/python/grpcio_tests/tests/fork/_fork_interop_test.py [3:13]
src/python/grpcio_tests/tests/fork/client.py [3:13]
@@ -1948,8 +2079,13 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
src/python/grpcio_tests/tests_aio/unit/timeout_test.py [3:13]
src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py [3:13]
src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py [3:13]
+ src/python/grpcio_tests/tests_gevent/__init__.py [3:13]
+ src/python/grpcio_tests/tests_gevent/unit/__init__.py [3:13]
+ src/python/grpcio_tests/tests_gevent/unit/_test_server.py [3:13]
+ src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py [3:13]
src/python/grpcio_tests/tests_py3_only/__init__.py [3:13]
src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py [3:13]
+ src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py [3:13]
src/python/grpcio_tests/tests_py3_only/unit/__init__.py [3:13]
src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py [3:13]
src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py [3:13]
@@ -1957,6 +2093,19 @@ BELONGS src/python/grpcio/ya.make src/python/grpcio_channelz/ya.make src/python/
test/core/util/grpc_fuzzer.bzl [3:13]
test/core/util/run_with_poller.sh [4:14]
+SKIP LicenseRef-scancode-generic-cla 979d7de2e3ff119ee2c22c7efbec766d
+BELONGS third_party/upb/ya.make
+ License text:
+ Contributions to this project must be accompanied by a Contributor License
+ Agreement. You (or your employer) retain the copyright to your contribution;
+ Scancode info:
+ Original SPDX id: LicenseRef-scancode-generic-cla
+ Score : 16.00
+ Match type : NOTICE
+ Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/generic-cla.LICENSE
+ Files with this license:
+ third_party/upb/CONTRIBUTING.md [17:18]
+
KEEP BSD-3-Clause 9f9f74951499b982d601e33ab0c03bed
BELONGS third_party/address_sorting/ya.make
Note: matched license text is too long. Read it in the source files.
@@ -1985,7 +2134,7 @@ BELONGS src/python/grpcio_channelz/ya.make
src/python/grpcio_channelz/setup.py [92:92]
KEEP Apache-2.0 ac31f6a0b836e647d840630a3723a387
-BELONGS src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_reflection/ya.make src/python/grpcio_status/ya.make
+BELONGS src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.make src/python/grpcio_reflection/ya.make src/python/grpcio_status/ya.make ya.make
License text:
'License :: OSI Approved :: Apache Software License',
Scancode info:
@@ -1994,7 +2143,108 @@ BELONGS src/python/grpcio_channelz/ya.make src/python/grpcio_health_checking/ya.
Match type : TAG
Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0
Files with this license:
- src/python/grpcio_channelz/setup.py [59:59]
- src/python/grpcio_health_checking/setup.py [58:58]
- src/python/grpcio_reflection/setup.py [59:59]
- src/python/grpcio_status/setup.py [58:58]
+ src/python/grpcio_admin/setup.py [34:34]
+ src/python/grpcio_channelz/setup.py [58:58]
+ src/python/grpcio_csds/setup.py [34:34]
+ src/python/grpcio_health_checking/setup.py [57:57]
+ src/python/grpcio_reflection/setup.py [58:58]
+ src/python/grpcio_status/setup.py [57:57]
+
+KEEP BSD-3-Clause add163b149a20e4f3cd8c4cc3e9d0ccd
+BELONGS third_party/upb/ya.make
+ Note: matched license text is too long. Read it in the source files.
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 97.64
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ third_party/upb/upb/def.hpp [4:24]
+ third_party/upb/upb/upb.hpp [4:24]
+
+KEEP BSD-3-Clause bf460a928b270e23d6623d4db9286950
+BELONGS ya.make
+ Note: matched license text is too long. Read it in the source files.
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 100.00
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ LICENSE [210:234]
+
+KEEP Python-2.0 e9022919a04d4f5ef8123bee0fe8df07
+BELONGS ya.make
+ License text:
+ \# limitations under the License.
+ """gRPC Python's Admin interface."""
+ Scancode info:
+ Original SPDX id: Python-2.0
+ Score : 66.67
+ Match type : TAG
+ Links : http://docs.python.org/license.html, http://spdx.org/licenses/Python-2.0, https://spdx.org/licenses/Python-2.0
+ Files with this license:
+ src/python/grpcio_admin/grpc_admin/__init__.py [13:14]
+
+KEEP BSD-3-Clause ecc97a1dce30b0ce4682e454b0ca278f
+BELONGS third_party/upb/ya.make
+ Note: matched license text is too long. Read it in the source files.
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 96.55
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ third_party/upb/LICENSE [5:26]
+
+KEEP BSD-3-Clause efdacd288befe1a76f28537587b3936a
+BELONGS ya.make
+ License text:
+ limitations under the License.
+ -----------------------------------------------------------
+ BSD 3-Clause License
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 100.00
+ Match type : TAG
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ LICENSE [202:206]
+
+KEEP BSD-3-Clause AND BSD-3-Clause fde36bbb770be6f9bbc06c49635a8e3a
+BELONGS third_party/upb/ya.make
+ Note: matched license text is too long. Read it in the source files.
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 97.64
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ third_party/upb/upb/decode.c [5:25]
+ third_party/upb/upb/decode.h [5:25]
+ third_party/upb/upb/decode_internal.h [5:25]
+ third_party/upb/upb/def.c [5:25]
+ third_party/upb/upb/def.h [5:25]
+ third_party/upb/upb/encode.c [5:25]
+ third_party/upb/upb/encode.h [5:25]
+ third_party/upb/upb/msg.c [5:25]
+ third_party/upb/upb/msg.h [5:25]
+ third_party/upb/upb/port_def.inc [5:25]
+ third_party/upb/upb/port_undef.inc [5:25]
+ third_party/upb/upb/reflection.c [5:25]
+ third_party/upb/upb/reflection.h [5:25]
+ third_party/upb/upb/table.c [5:25]
+ third_party/upb/upb/table_internal.h [5:25]
+ third_party/upb/upb/text_encode.c [5:25]
+ third_party/upb/upb/text_encode.h [5:25]
+ third_party/upb/upb/upb.c [5:25]
+ third_party/upb/upb/upb.h [5:25]
+ third_party/upb/upb/upb_internal.h [5:25]
+ Scancode info:
+ Original SPDX id: BSD-3-Clause
+ Score : 98.09
+ Match type : TEXT
+ Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
+ Files with this license:
+ third_party/upb/upb/decode_fast.c [5:25]
+ third_party/upb/upb/decode_fast.h [5:25]
diff --git a/contrib/libs/grpc/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/.yandex_meta/licenses.list.txt
index 30d6bd22e33..5fdb008b503 100644
--- a/contrib/libs/grpc/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/.yandex_meta/licenses.list.txt
@@ -201,11 +201,16 @@
See the License for the specific language governing permissions and
limitations under the License.
+
====================Apache-2.0====================
license='Apache License 2.0',
====================Apache-2.0====================
+ 'License :: OSI Approved :: Apache Software License',
+
+
+====================Apache-2.0====================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -260,6 +265,42 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+====================BSD-3-Clause====================
+ limitations under the License.
+
+-----------------------------------------------------------
+
+BSD 3-Clause License
+
+
+====================BSD-3-Clause====================
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+
====================COPYRIGHT====================
* Copyright 2015 gRPC authors.
@@ -281,11 +322,11 @@ limitations under the License.
====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
+ * Copyright 2019 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+ * Copyright 2020 gRPC authors.
====================COPYRIGHT====================
@@ -293,11 +334,15 @@ limitations under the License.
====================COPYRIGHT====================
+// Copyright 2016 The gRPC Authors
+
+
+====================COPYRIGHT====================
// Copyright 2018 The gRPC Authors
====================COPYRIGHT====================
-// Copyright 2019 The gRPC Authors
+// Copyright 2020 The gRPC Authors
====================COPYRIGHT====================
@@ -310,3 +355,21 @@ limitations under the License.
====================COPYRIGHT====================
Copyright 2014 gRPC authors.
+
+
+====================COPYRIGHT====================
+Copyright 2016, Google Inc.
+
+
+====================MPL-2.0====================
+Mozilla Public License, v. 2.0
+
+
+====================MPL-2.0====================
+This Source Code Form is subject to the terms of the Mozilla Public License,
+v. 2.0. If a copy of the MPL was not distributed with this file, You can
+obtain one at https://mozilla.org/MPL/2.0/.
+
+====================Python-2.0====================
+# limitations under the License.
+"""gRPC Python's Admin interface."""
diff --git a/contrib/libs/grpc/BUILD.gn b/contrib/libs/grpc/BUILD.gn
deleted file mode 100644
index 802ac1db346..00000000000
--- a/contrib/libs/grpc/BUILD.gn
+++ /dev/null
@@ -1,1616 +0,0 @@
-# GRPC Fuchsia GN build file
-
-# This file has been automatically generated from a template file.
-# Please look at the templates directory instead.
-# This file can be regenerated from the template by running
-# tools/buildgen/generate_projects.sh
-
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-config("grpc_config") {
- include_dirs = [
- ".",
- "include/",
- ]
- defines = [
- "GRPC_USE_PROTO_LITE",
- "GPR_SUPPORT_CHANNELS_FROM_FD",
- "PB_FIELD_16BIT",
- ]
-}
-
-
-
- source_set("address_sorting") {
- sources = [
- "third_party/address_sorting/address_sorting.c",
- "third_party/address_sorting/address_sorting_internal.h",
- "third_party/address_sorting/address_sorting_posix.c",
- "third_party/address_sorting/address_sorting_windows.c",
- "third_party/address_sorting/include/address_sorting/address_sorting.h",
- ]
- deps = [
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- include_dirs = [
- "third_party/address_sorting/include",
- ]
- }
-
-
-
- source_set("gpr") {
- sources = [
- "include/grpc/impl/codegen/atm.h",
- "include/grpc/impl/codegen/atm_gcc_atomic.h",
- "include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_windows.h",
- "include/grpc/impl/codegen/byte_buffer.h",
- "include/grpc/impl/codegen/byte_buffer_reader.h",
- "include/grpc/impl/codegen/compression_types.h",
- "include/grpc/impl/codegen/connectivity_state.h",
- "include/grpc/impl/codegen/fork.h",
- "include/grpc/impl/codegen/gpr_slice.h",
- "include/grpc/impl/codegen/gpr_types.h",
- "include/grpc/impl/codegen/grpc_types.h",
- "include/grpc/impl/codegen/log.h",
- "include/grpc/impl/codegen/port_platform.h",
- "include/grpc/impl/codegen/propagation_bits.h",
- "include/grpc/impl/codegen/slice.h",
- "include/grpc/impl/codegen/status.h",
- "include/grpc/impl/codegen/sync.h",
- "include/grpc/impl/codegen/sync_abseil.h",
- "include/grpc/impl/codegen/sync_custom.h",
- "include/grpc/impl/codegen/sync_generic.h",
- "include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_windows.h",
- "include/grpc/support/alloc.h",
- "include/grpc/support/atm.h",
- "include/grpc/support/atm_gcc_atomic.h",
- "include/grpc/support/atm_gcc_sync.h",
- "include/grpc/support/atm_windows.h",
- "include/grpc/support/cpu.h",
- "include/grpc/support/log.h",
- "include/grpc/support/log_windows.h",
- "include/grpc/support/port_platform.h",
- "include/grpc/support/string_util.h",
- "include/grpc/support/sync.h",
- "include/grpc/support/sync_abseil.h",
- "include/grpc/support/sync_custom.h",
- "include/grpc/support/sync_generic.h",
- "include/grpc/support/sync_posix.h",
- "include/grpc/support/sync_windows.h",
- "include/grpc/support/thd_id.h",
- "include/grpc/support/time.h",
- "src/core/lib/gpr/alloc.cc",
- "src/core/lib/gpr/alloc.h",
- "src/core/lib/gpr/arena.h",
- "src/core/lib/gpr/atm.cc",
- "src/core/lib/gpr/cpu_iphone.cc",
- "src/core/lib/gpr/cpu_linux.cc",
- "src/core/lib/gpr/cpu_posix.cc",
- "src/core/lib/gpr/cpu_windows.cc",
- "src/core/lib/gpr/env.h",
- "src/core/lib/gpr/env_linux.cc",
- "src/core/lib/gpr/env_posix.cc",
- "src/core/lib/gpr/env_windows.cc",
- "src/core/lib/gpr/log.cc",
- "src/core/lib/gpr/log_android.cc",
- "src/core/lib/gpr/log_linux.cc",
- "src/core/lib/gpr/log_posix.cc",
- "src/core/lib/gpr/log_windows.cc",
- "src/core/lib/gpr/murmur_hash.cc",
- "src/core/lib/gpr/murmur_hash.h",
- "src/core/lib/gpr/spinlock.h",
- "src/core/lib/gpr/string.cc",
- "src/core/lib/gpr/string.h",
- "src/core/lib/gpr/string_posix.cc",
- "src/core/lib/gpr/string_util_windows.cc",
- "src/core/lib/gpr/string_windows.cc",
- "src/core/lib/gpr/string_windows.h",
- "src/core/lib/gpr/sync.cc",
- "src/core/lib/gpr/sync_abseil.cc",
- "src/core/lib/gpr/sync_posix.cc",
- "src/core/lib/gpr/sync_windows.cc",
- "src/core/lib/gpr/time.cc",
- "src/core/lib/gpr/time_posix.cc",
- "src/core/lib/gpr/time_precise.cc",
- "src/core/lib/gpr/time_precise.h",
- "src/core/lib/gpr/time_windows.cc",
- "src/core/lib/gpr/tls.h",
- "src/core/lib/gpr/tls_gcc.h",
- "src/core/lib/gpr/tls_msvc.h",
- "src/core/lib/gpr/tls_pthread.cc",
- "src/core/lib/gpr/tls_pthread.h",
- "src/core/lib/gpr/tls_stdcpp.h",
- "src/core/lib/gpr/tmpfile.h",
- "src/core/lib/gpr/tmpfile_msys.cc",
- "src/core/lib/gpr/tmpfile_posix.cc",
- "src/core/lib/gpr/tmpfile_windows.cc",
- "src/core/lib/gpr/useful.h",
- "src/core/lib/gpr/wrap_memcpy.cc",
- "src/core/lib/gprpp/arena.cc",
- "src/core/lib/gprpp/arena.h",
- "src/core/lib/gprpp/atomic.h",
- "src/core/lib/gprpp/examine_stack.cc",
- "src/core/lib/gprpp/examine_stack.h",
- "src/core/lib/gprpp/fork.cc",
- "src/core/lib/gprpp/fork.h",
- "src/core/lib/gprpp/global_config.h",
- "src/core/lib/gprpp/global_config_custom.h",
- "src/core/lib/gprpp/global_config_env.cc",
- "src/core/lib/gprpp/global_config_env.h",
- "src/core/lib/gprpp/global_config_generic.h",
- "src/core/lib/gprpp/host_port.cc",
- "src/core/lib/gprpp/host_port.h",
- "src/core/lib/gprpp/manual_constructor.h",
- "src/core/lib/gprpp/memory.h",
- "src/core/lib/gprpp/mpscq.cc",
- "src/core/lib/gprpp/mpscq.h",
- "src/core/lib/gprpp/stat.h",
- "src/core/lib/gprpp/stat_posix.cc",
- "src/core/lib/gprpp/stat_windows.cc",
- "src/core/lib/gprpp/sync.h",
- "src/core/lib/gprpp/thd.h",
- "src/core/lib/gprpp/thd_posix.cc",
- "src/core/lib/gprpp/thd_windows.cc",
- "src/core/lib/gprpp/time_util.cc",
- "src/core/lib/gprpp/time_util.h",
- "src/core/lib/profiling/basic_timers.cc",
- "src/core/lib/profiling/stap_timers.cc",
- "src/core/lib/profiling/timers.h",
- ]
- deps = [
- ":y_absl/base:base",
- ":y_absl/memory:memory",
- ":y_absl/status:status",
- ":y_absl/strings:str_format",
- ":y_absl/strings:strings",
- ":y_absl/synchronization:synchronization",
- ":y_absl/time:time",
- ":y_absl/types:optional",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
-
-
- source_set("grpc") {
- sources = [
- "include/grpc/byte_buffer.h",
- "include/grpc/byte_buffer_reader.h",
- "include/grpc/census.h",
- "include/grpc/compression.h",
- "include/grpc/fork.h",
- "include/grpc/grpc.h",
- "include/grpc/grpc_posix.h",
- "include/grpc/grpc_security.h",
- "include/grpc/grpc_security_constants.h",
- "include/grpc/load_reporting.h",
- "include/grpc/slice.h",
- "include/grpc/slice_buffer.h",
- "include/grpc/status.h",
- "include/grpc/support/workaround_list.h",
- "src/core/ext/filters/census/grpc_context.cc",
- "src/core/ext/filters/client_channel/backend_metric.cc",
- "src/core/ext/filters/client_channel/backend_metric.h",
- "src/core/ext/filters/client_channel/backup_poller.cc",
- "src/core/ext/filters/client_channel/backup_poller.h",
- "src/core/ext/filters/client_channel/channel_connectivity.cc",
- "src/core/ext/filters/client_channel/client_channel.cc",
- "src/core/ext/filters/client_channel/client_channel.h",
- "src/core/ext/filters/client_channel/client_channel_channelz.cc",
- "src/core/ext/filters/client_channel/client_channel_channelz.h",
- "src/core/ext/filters/client_channel/client_channel_factory.cc",
- "src/core/ext/filters/client_channel/client_channel_factory.h",
- "src/core/ext/filters/client_channel/client_channel_plugin.cc",
- "src/core/ext/filters/client_channel/config_selector.cc",
- "src/core/ext/filters/client_channel/config_selector.h",
- "src/core/ext/filters/client_channel/connector.h",
- "src/core/ext/filters/client_channel/dynamic_filters.cc",
- "src/core/ext/filters/client_channel/dynamic_filters.h",
- "src/core/ext/filters/client_channel/global_subchannel_pool.cc",
- "src/core/ext/filters/client_channel/global_subchannel_pool.h",
- "src/core/ext/filters/client_channel/health/health_check_client.cc",
- "src/core/ext/filters/client_channel/health/health_check_client.h",
- "src/core/ext/filters/client_channel/http_connect_handshaker.cc",
- "src/core/ext/filters/client_channel/http_connect_handshaker.h",
- "src/core/ext/filters/client_channel/http_proxy.cc",
- "src/core/ext/filters/client_channel/http_proxy.h",
- "src/core/ext/filters/client_channel/lb_policy.cc",
- "src/core/ext/filters/client_channel/lb_policy.h",
- "src/core/ext/filters/client_channel/lb_policy/address_filtering.cc",
- "src/core/ext/filters/client_channel/lb_policy/address_filtering.h",
- "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc",
- "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc",
- "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h",
- "src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc",
- "src/core/ext/filters/client_channel/lb_policy/priority/priority.cc",
- "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc",
- "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h",
- "src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc",
- "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h",
- "src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/cds.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds.h",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc",
- "src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc",
- "src/core/ext/filters/client_channel/lb_policy_factory.h",
- "src/core/ext/filters/client_channel/lb_policy_registry.cc",
- "src/core/ext/filters/client_channel/lb_policy_registry.h",
- "src/core/ext/filters/client_channel/local_subchannel_pool.cc",
- "src/core/ext/filters/client_channel/local_subchannel_pool.h",
- "src/core/ext/filters/client_channel/proxy_mapper.h",
- "src/core/ext/filters/client_channel/proxy_mapper_registry.cc",
- "src/core/ext/filters/client_channel/proxy_mapper_registry.h",
- "src/core/ext/filters/client_channel/resolver.cc",
- "src/core/ext/filters/client_channel/resolver.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc",
- "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc",
- "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc",
- "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h",
- "src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h",
- "src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc",
- "src/core/ext/filters/client_channel/resolver/xds/xds_resolver.h",
- "src/core/ext/filters/client_channel/resolver_factory.h",
- "src/core/ext/filters/client_channel/resolver_registry.cc",
- "src/core/ext/filters/client_channel/resolver_registry.h",
- "src/core/ext/filters/client_channel/resolver_result_parsing.cc",
- "src/core/ext/filters/client_channel/resolver_result_parsing.h",
- "src/core/ext/filters/client_channel/retry_throttle.cc",
- "src/core/ext/filters/client_channel/retry_throttle.h",
- "src/core/ext/filters/client_channel/server_address.cc",
- "src/core/ext/filters/client_channel/server_address.h",
- "src/core/ext/filters/client_channel/service_config.cc",
- "src/core/ext/filters/client_channel/service_config.h",
- "src/core/ext/filters/client_channel/service_config_call_data.h",
- "src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc",
- "src/core/ext/filters/client_channel/service_config_parser.cc",
- "src/core/ext/filters/client_channel/service_config_parser.h",
- "src/core/ext/filters/client_channel/subchannel.cc",
- "src/core/ext/filters/client_channel/subchannel.h",
- "src/core/ext/filters/client_channel/subchannel_interface.h",
- "src/core/ext/filters/client_channel/subchannel_pool_interface.cc",
- "src/core/ext/filters/client_channel/subchannel_pool_interface.h",
- "src/core/ext/filters/client_idle/client_idle_filter.cc",
- "src/core/ext/filters/deadline/deadline_filter.cc",
- "src/core/ext/filters/deadline/deadline_filter.h",
- "src/core/ext/filters/fault_injection/fault_injection_filter.cc",
- "src/core/ext/filters/fault_injection/fault_injection_filter.h",
- "src/core/ext/filters/fault_injection/service_config_parser.cc",
- "src/core/ext/filters/fault_injection/service_config_parser.h",
- "src/core/ext/filters/http/client/http_client_filter.cc",
- "src/core/ext/filters/http/client/http_client_filter.h",
- "src/core/ext/filters/http/client_authority_filter.cc",
- "src/core/ext/filters/http/client_authority_filter.h",
- "src/core/ext/filters/http/http_filters_plugin.cc",
- "src/core/ext/filters/http/message_compress/message_compress_filter.cc",
- "src/core/ext/filters/http/message_compress/message_compress_filter.h",
- "src/core/ext/filters/http/message_compress/message_decompress_filter.cc",
- "src/core/ext/filters/http/message_compress/message_decompress_filter.h",
- "src/core/ext/filters/http/server/http_server_filter.cc",
- "src/core/ext/filters/http/server/http_server_filter.h",
- "src/core/ext/filters/max_age/max_age_filter.cc",
- "src/core/ext/filters/max_age/max_age_filter.h",
- "src/core/ext/filters/message_size/message_size_filter.cc",
- "src/core/ext/filters/message_size/message_size_filter.h",
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc",
- "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h",
- "src/core/ext/filters/workarounds/workaround_utils.cc",
- "src/core/ext/filters/workarounds/workaround_utils.h",
- "src/core/ext/transport/chttp2/alpn/alpn.cc",
- "src/core/ext/transport/chttp2/alpn/alpn.h",
- "src/core/ext/transport/chttp2/client/authority.cc",
- "src/core/ext/transport/chttp2/client/authority.h",
- "src/core/ext/transport/chttp2/client/chttp2_connector.cc",
- "src/core/ext/transport/chttp2/client/chttp2_connector.h",
- "src/core/ext/transport/chttp2/client/insecure/channel_create.cc",
- "src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc",
- "src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc",
- "src/core/ext/transport/chttp2/server/chttp2_server.cc",
- "src/core/ext/transport/chttp2/server/chttp2_server.h",
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc",
- "src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc",
- "src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc",
- "src/core/ext/transport/chttp2/transport/bin_decoder.cc",
- "src/core/ext/transport/chttp2/transport/bin_decoder.h",
- "src/core/ext/transport/chttp2/transport/bin_encoder.cc",
- "src/core/ext/transport/chttp2/transport/bin_encoder.h",
- "src/core/ext/transport/chttp2/transport/chttp2_plugin.cc",
- "src/core/ext/transport/chttp2/transport/chttp2_transport.cc",
- "src/core/ext/transport/chttp2/transport/chttp2_transport.h",
- "src/core/ext/transport/chttp2/transport/context_list.cc",
- "src/core/ext/transport/chttp2/transport/context_list.h",
- "src/core/ext/transport/chttp2/transport/flow_control.cc",
- "src/core/ext/transport/chttp2/transport/flow_control.h",
- "src/core/ext/transport/chttp2/transport/frame.h",
- "src/core/ext/transport/chttp2/transport/frame_data.cc",
- "src/core/ext/transport/chttp2/transport/frame_data.h",
- "src/core/ext/transport/chttp2/transport/frame_goaway.cc",
- "src/core/ext/transport/chttp2/transport/frame_goaway.h",
- "src/core/ext/transport/chttp2/transport/frame_ping.cc",
- "src/core/ext/transport/chttp2/transport/frame_ping.h",
- "src/core/ext/transport/chttp2/transport/frame_rst_stream.cc",
- "src/core/ext/transport/chttp2/transport/frame_rst_stream.h",
- "src/core/ext/transport/chttp2/transport/frame_settings.cc",
- "src/core/ext/transport/chttp2/transport/frame_settings.h",
- "src/core/ext/transport/chttp2/transport/frame_window_update.cc",
- "src/core/ext/transport/chttp2/transport/frame_window_update.h",
- "src/core/ext/transport/chttp2/transport/hpack_encoder.cc",
- "src/core/ext/transport/chttp2/transport/hpack_encoder.h",
- "src/core/ext/transport/chttp2/transport/hpack_parser.cc",
- "src/core/ext/transport/chttp2/transport/hpack_parser.h",
- "src/core/ext/transport/chttp2/transport/hpack_table.cc",
- "src/core/ext/transport/chttp2/transport/hpack_table.h",
- "src/core/ext/transport/chttp2/transport/http2_settings.cc",
- "src/core/ext/transport/chttp2/transport/http2_settings.h",
- "src/core/ext/transport/chttp2/transport/huffsyms.cc",
- "src/core/ext/transport/chttp2/transport/huffsyms.h",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.cc",
- "src/core/ext/transport/chttp2/transport/incoming_metadata.h",
- "src/core/ext/transport/chttp2/transport/internal.h",
- "src/core/ext/transport/chttp2/transport/parsing.cc",
- "src/core/ext/transport/chttp2/transport/stream_lists.cc",
- "src/core/ext/transport/chttp2/transport/stream_map.cc",
- "src/core/ext/transport/chttp2/transport/stream_map.h",
- "src/core/ext/transport/chttp2/transport/varint.cc",
- "src/core/ext/transport/chttp2/transport/varint.h",
- "src/core/ext/transport/chttp2/transport/writing.cc",
- "src/core/ext/transport/inproc/inproc_plugin.cc",
- "src/core/ext/transport/inproc/inproc_transport.cc",
- "src/core/ext/transport/inproc/inproc_transport.h",
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c",
- "src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h",
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c",
- "src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.c",
- "src/core/ext/upb-generated/envoy/annotations/resource.upb.h",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c",
- "src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c",
- "src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c",
- "src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h",
- "src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c",
- "src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c",
- "src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c",
- "src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h",
- "src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c",
- "src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c",
- "src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h",
- "src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c",
- "src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h",
- "src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c",
- "src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
- "src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c",
- "src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c",
- "src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h",
- "src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c",
- "src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c",
- "src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h",
- "src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c",
- "src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h",
- "src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c",
- "src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h",
- "src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c",
- "src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c",
- "src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h",
- "src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c",
- "src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h",
- "src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c",
- "src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c",
- "src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h",
- "src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c",
- "src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h",
- "src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c",
- "src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/http.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/http.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/percent.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/percent.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/range.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/range.upb.h",
- "src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c",
- "src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h",
- "src/core/ext/upb-generated/google/api/annotations.upb.c",
- "src/core/ext/upb-generated/google/api/annotations.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c",
- "src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h",
- "src/core/ext/upb-generated/google/api/http.upb.c",
- "src/core/ext/upb-generated/google/api/http.upb.h",
- "src/core/ext/upb-generated/google/protobuf/any.upb.c",
- "src/core/ext/upb-generated/google/protobuf/any.upb.h",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.c",
- "src/core/ext/upb-generated/google/protobuf/duration.upb.h",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.c",
- "src/core/ext/upb-generated/google/protobuf/empty.upb.h",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.c",
- "src/core/ext/upb-generated/google/protobuf/struct.upb.h",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.c",
- "src/core/ext/upb-generated/google/protobuf/timestamp.upb.h",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.c",
- "src/core/ext/upb-generated/google/protobuf/wrappers.upb.h",
- "src/core/ext/upb-generated/google/rpc/status.upb.c",
- "src/core/ext/upb-generated/google/rpc/status.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h",
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c",
- "src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/migrate.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/migrate.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/security.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/security.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/status.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/status.upb.h",
- "src/core/ext/upb-generated/udpa/annotations/versioning.upb.c",
- "src/core/ext/upb-generated/udpa/annotations/versioning.upb.h",
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
- "src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c",
- "src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h",
- "src/core/ext/upb-generated/validate/validate.upb.c",
- "src/core/ext/upb-generated/validate/validate.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/authority.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/context_params.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c",
- "src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h",
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.h",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c",
- "src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/api/http.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c",
- "src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h",
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c",
- "src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h",
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.c",
- "src/core/ext/upbdefs-generated/validate/validate.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.h",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c",
- "src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.h",
- "src/core/ext/xds/certificate_provider_factory.h",
- "src/core/ext/xds/certificate_provider_registry.cc",
- "src/core/ext/xds/certificate_provider_registry.h",
- "src/core/ext/xds/certificate_provider_store.cc",
- "src/core/ext/xds/certificate_provider_store.h",
- "src/core/ext/xds/file_watcher_certificate_provider_factory.cc",
- "src/core/ext/xds/file_watcher_certificate_provider_factory.h",
- "src/core/ext/xds/xds_api.cc",
- "src/core/ext/xds/xds_api.h",
- "src/core/ext/xds/xds_bootstrap.cc",
- "src/core/ext/xds/xds_bootstrap.h",
- "src/core/ext/xds/xds_certificate_provider.cc",
- "src/core/ext/xds/xds_certificate_provider.h",
- "src/core/ext/xds/xds_channel_args.h",
- "src/core/ext/xds/xds_client.cc",
- "src/core/ext/xds/xds_client.h",
- "src/core/ext/xds/xds_client_stats.cc",
- "src/core/ext/xds/xds_client_stats.h",
- "src/core/ext/xds/xds_http_fault_filter.cc",
- "src/core/ext/xds/xds_http_fault_filter.h",
- "src/core/ext/xds/xds_http_filters.cc",
- "src/core/ext/xds/xds_http_filters.h",
- "src/core/ext/xds/xds_server_config_fetcher.cc",
- "src/core/lib/avl/avl.cc",
- "src/core/lib/avl/avl.h",
- "src/core/lib/backoff/backoff.cc",
- "src/core/lib/backoff/backoff.h",
- "src/core/lib/channel/channel_args.cc",
- "src/core/lib/channel/channel_args.h",
- "src/core/lib/channel/channel_stack.cc",
- "src/core/lib/channel/channel_stack.h",
- "src/core/lib/channel/channel_stack_builder.cc",
- "src/core/lib/channel/channel_stack_builder.h",
- "src/core/lib/channel/channel_trace.cc",
- "src/core/lib/channel/channel_trace.h",
- "src/core/lib/channel/channelz.cc",
- "src/core/lib/channel/channelz.h",
- "src/core/lib/channel/channelz_registry.cc",
- "src/core/lib/channel/channelz_registry.h",
- "src/core/lib/channel/connected_channel.cc",
- "src/core/lib/channel/connected_channel.h",
- "src/core/lib/channel/context.h",
- "src/core/lib/channel/handshaker.cc",
- "src/core/lib/channel/handshaker.h",
- "src/core/lib/channel/handshaker_factory.h",
- "src/core/lib/channel/handshaker_registry.cc",
- "src/core/lib/channel/handshaker_registry.h",
- "src/core/lib/channel/status_util.cc",
- "src/core/lib/channel/status_util.h",
- "src/core/lib/compression/algorithm_metadata.h",
- "src/core/lib/compression/compression.cc",
- "src/core/lib/compression/compression_args.cc",
- "src/core/lib/compression/compression_args.h",
- "src/core/lib/compression/compression_internal.cc",
- "src/core/lib/compression/compression_internal.h",
- "src/core/lib/compression/message_compress.cc",
- "src/core/lib/compression/message_compress.h",
- "src/core/lib/compression/stream_compression.cc",
- "src/core/lib/compression/stream_compression.h",
- "src/core/lib/compression/stream_compression_gzip.cc",
- "src/core/lib/compression/stream_compression_gzip.h",
- "src/core/lib/compression/stream_compression_identity.cc",
- "src/core/lib/compression/stream_compression_identity.h",
- "src/core/lib/debug/stats.cc",
- "src/core/lib/debug/stats.h",
- "src/core/lib/debug/stats_data.cc",
- "src/core/lib/debug/stats_data.h",
- "src/core/lib/debug/trace.cc",
- "src/core/lib/debug/trace.h",
- "src/core/lib/gprpp/atomic.h",
- "src/core/lib/gprpp/debug_location.h",
- "src/core/lib/gprpp/dual_ref_counted.h",
- "src/core/lib/gprpp/orphanable.h",
- "src/core/lib/gprpp/ref_counted.h",
- "src/core/lib/gprpp/ref_counted_ptr.h",
- "src/core/lib/http/format_request.cc",
- "src/core/lib/http/format_request.h",
- "src/core/lib/http/httpcli.cc",
- "src/core/lib/http/httpcli.h",
- "src/core/lib/http/httpcli_security_connector.cc",
- "src/core/lib/http/parser.cc",
- "src/core/lib/http/parser.h",
- "src/core/lib/iomgr/block_annotate.h",
- "src/core/lib/iomgr/buffer_list.cc",
- "src/core/lib/iomgr/buffer_list.h",
- "src/core/lib/iomgr/call_combiner.cc",
- "src/core/lib/iomgr/call_combiner.h",
- "src/core/lib/iomgr/cfstream_handle.cc",
- "src/core/lib/iomgr/cfstream_handle.h",
- "src/core/lib/iomgr/closure.h",
- "src/core/lib/iomgr/combiner.cc",
- "src/core/lib/iomgr/combiner.h",
- "src/core/lib/iomgr/dualstack_socket_posix.cc",
- "src/core/lib/iomgr/dynamic_annotations.h",
- "src/core/lib/iomgr/endpoint.cc",
- "src/core/lib/iomgr/endpoint.h",
- "src/core/lib/iomgr/endpoint_cfstream.cc",
- "src/core/lib/iomgr/endpoint_cfstream.h",
- "src/core/lib/iomgr/endpoint_pair.h",
- "src/core/lib/iomgr/endpoint_pair_posix.cc",
- "src/core/lib/iomgr/endpoint_pair_uv.cc",
- "src/core/lib/iomgr/endpoint_pair_windows.cc",
- "src/core/lib/iomgr/error.cc",
- "src/core/lib/iomgr/error.h",
- "src/core/lib/iomgr/error_cfstream.cc",
- "src/core/lib/iomgr/error_cfstream.h",
- "src/core/lib/iomgr/error_internal.h",
- "src/core/lib/iomgr/ev_apple.cc",
- "src/core/lib/iomgr/ev_apple.h",
- "src/core/lib/iomgr/ev_epoll1_linux.cc",
- "src/core/lib/iomgr/ev_epoll1_linux.h",
- "src/core/lib/iomgr/ev_epollex_linux.cc",
- "src/core/lib/iomgr/ev_epollex_linux.h",
- "src/core/lib/iomgr/ev_poll_posix.cc",
- "src/core/lib/iomgr/ev_poll_posix.h",
- "src/core/lib/iomgr/ev_posix.cc",
- "src/core/lib/iomgr/ev_posix.h",
- "src/core/lib/iomgr/ev_windows.cc",
- "src/core/lib/iomgr/exec_ctx.cc",
- "src/core/lib/iomgr/exec_ctx.h",
- "src/core/lib/iomgr/executor.cc",
- "src/core/lib/iomgr/executor.h",
- "src/core/lib/iomgr/executor/mpmcqueue.cc",
- "src/core/lib/iomgr/executor/mpmcqueue.h",
- "src/core/lib/iomgr/executor/threadpool.cc",
- "src/core/lib/iomgr/executor/threadpool.h",
- "src/core/lib/iomgr/fork_posix.cc",
- "src/core/lib/iomgr/fork_windows.cc",
- "src/core/lib/iomgr/gethostname.h",
- "src/core/lib/iomgr/gethostname_fallback.cc",
- "src/core/lib/iomgr/gethostname_host_name_max.cc",
- "src/core/lib/iomgr/gethostname_sysconf.cc",
- "src/core/lib/iomgr/grpc_if_nametoindex.h",
- "src/core/lib/iomgr/grpc_if_nametoindex_posix.cc",
- "src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc",
- "src/core/lib/iomgr/internal_errqueue.cc",
- "src/core/lib/iomgr/internal_errqueue.h",
- "src/core/lib/iomgr/iocp_windows.cc",
- "src/core/lib/iomgr/iocp_windows.h",
- "src/core/lib/iomgr/iomgr.cc",
- "src/core/lib/iomgr/iomgr.h",
- "src/core/lib/iomgr/iomgr_custom.cc",
- "src/core/lib/iomgr/iomgr_custom.h",
- "src/core/lib/iomgr/iomgr_internal.cc",
- "src/core/lib/iomgr/iomgr_internal.h",
- "src/core/lib/iomgr/iomgr_posix.cc",
- "src/core/lib/iomgr/iomgr_posix_cfstream.cc",
- "src/core/lib/iomgr/iomgr_uv.cc",
- "src/core/lib/iomgr/iomgr_windows.cc",
- "src/core/lib/iomgr/is_epollexclusive_available.cc",
- "src/core/lib/iomgr/is_epollexclusive_available.h",
- "src/core/lib/iomgr/load_file.cc",
- "src/core/lib/iomgr/load_file.h",
- "src/core/lib/iomgr/lockfree_event.cc",
- "src/core/lib/iomgr/lockfree_event.h",
- "src/core/lib/iomgr/nameser.h",
- "src/core/lib/iomgr/parse_address.cc",
- "src/core/lib/iomgr/parse_address.h",
- "src/core/lib/iomgr/poller/eventmanager_libuv.cc",
- "src/core/lib/iomgr/poller/eventmanager_libuv.h",
- "src/core/lib/iomgr/polling_entity.cc",
- "src/core/lib/iomgr/polling_entity.h",
- "src/core/lib/iomgr/pollset.cc",
- "src/core/lib/iomgr/pollset.h",
- "src/core/lib/iomgr/pollset_custom.cc",
- "src/core/lib/iomgr/pollset_custom.h",
- "src/core/lib/iomgr/pollset_set.cc",
- "src/core/lib/iomgr/pollset_set.h",
- "src/core/lib/iomgr/pollset_set_custom.cc",
- "src/core/lib/iomgr/pollset_set_custom.h",
- "src/core/lib/iomgr/pollset_set_windows.cc",
- "src/core/lib/iomgr/pollset_set_windows.h",
- "src/core/lib/iomgr/pollset_uv.cc",
- "src/core/lib/iomgr/pollset_uv.h",
- "src/core/lib/iomgr/pollset_windows.cc",
- "src/core/lib/iomgr/pollset_windows.h",
- "src/core/lib/iomgr/port.h",
- "src/core/lib/iomgr/python_util.h",
- "src/core/lib/iomgr/resolve_address.cc",
- "src/core/lib/iomgr/resolve_address.h",
- "src/core/lib/iomgr/resolve_address_custom.cc",
- "src/core/lib/iomgr/resolve_address_custom.h",
- "src/core/lib/iomgr/resolve_address_posix.cc",
- "src/core/lib/iomgr/resolve_address_windows.cc",
- "src/core/lib/iomgr/resource_quota.cc",
- "src/core/lib/iomgr/resource_quota.h",
- "src/core/lib/iomgr/sockaddr.h",
- "src/core/lib/iomgr/sockaddr_custom.h",
- "src/core/lib/iomgr/sockaddr_posix.h",
- "src/core/lib/iomgr/sockaddr_utils.cc",
- "src/core/lib/iomgr/sockaddr_utils.h",
- "src/core/lib/iomgr/sockaddr_windows.h",
- "src/core/lib/iomgr/socket_factory_posix.cc",
- "src/core/lib/iomgr/socket_factory_posix.h",
- "src/core/lib/iomgr/socket_mutator.cc",
- "src/core/lib/iomgr/socket_mutator.h",
- "src/core/lib/iomgr/socket_utils.h",
- "src/core/lib/iomgr/socket_utils_common_posix.cc",
- "src/core/lib/iomgr/socket_utils_linux.cc",
- "src/core/lib/iomgr/socket_utils_posix.cc",
- "src/core/lib/iomgr/socket_utils_posix.h",
- "src/core/lib/iomgr/socket_utils_uv.cc",
- "src/core/lib/iomgr/socket_utils_windows.cc",
- "src/core/lib/iomgr/socket_windows.cc",
- "src/core/lib/iomgr/socket_windows.h",
- "src/core/lib/iomgr/sys_epoll_wrapper.h",
- "src/core/lib/iomgr/tcp_client.cc",
- "src/core/lib/iomgr/tcp_client.h",
- "src/core/lib/iomgr/tcp_client_cfstream.cc",
- "src/core/lib/iomgr/tcp_client_custom.cc",
- "src/core/lib/iomgr/tcp_client_posix.cc",
- "src/core/lib/iomgr/tcp_client_posix.h",
- "src/core/lib/iomgr/tcp_client_windows.cc",
- "src/core/lib/iomgr/tcp_custom.cc",
- "src/core/lib/iomgr/tcp_custom.h",
- "src/core/lib/iomgr/tcp_posix.cc",
- "src/core/lib/iomgr/tcp_posix.h",
- "src/core/lib/iomgr/tcp_server.cc",
- "src/core/lib/iomgr/tcp_server.h",
- "src/core/lib/iomgr/tcp_server_custom.cc",
- "src/core/lib/iomgr/tcp_server_posix.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix.h",
- "src/core/lib/iomgr/tcp_server_utils_posix_common.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc",
- "src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc",
- "src/core/lib/iomgr/tcp_server_windows.cc",
- "src/core/lib/iomgr/tcp_uv.cc",
- "src/core/lib/iomgr/tcp_windows.cc",
- "src/core/lib/iomgr/tcp_windows.h",
- "src/core/lib/iomgr/time_averaged_stats.cc",
- "src/core/lib/iomgr/time_averaged_stats.h",
- "src/core/lib/iomgr/timer.cc",
- "src/core/lib/iomgr/timer.h",
- "src/core/lib/iomgr/timer_custom.cc",
- "src/core/lib/iomgr/timer_custom.h",
- "src/core/lib/iomgr/timer_generic.cc",
- "src/core/lib/iomgr/timer_generic.h",
- "src/core/lib/iomgr/timer_heap.cc",
- "src/core/lib/iomgr/timer_heap.h",
- "src/core/lib/iomgr/timer_manager.cc",
- "src/core/lib/iomgr/timer_manager.h",
- "src/core/lib/iomgr/timer_uv.cc",
- "src/core/lib/iomgr/udp_server.cc",
- "src/core/lib/iomgr/udp_server.h",
- "src/core/lib/iomgr/unix_sockets_posix.cc",
- "src/core/lib/iomgr/unix_sockets_posix.h",
- "src/core/lib/iomgr/unix_sockets_posix_noop.cc",
- "src/core/lib/iomgr/wakeup_fd_eventfd.cc",
- "src/core/lib/iomgr/wakeup_fd_nospecial.cc",
- "src/core/lib/iomgr/wakeup_fd_pipe.cc",
- "src/core/lib/iomgr/wakeup_fd_pipe.h",
- "src/core/lib/iomgr/wakeup_fd_posix.cc",
- "src/core/lib/iomgr/wakeup_fd_posix.h",
- "src/core/lib/iomgr/work_serializer.cc",
- "src/core/lib/iomgr/work_serializer.h",
- "src/core/lib/json/json.h",
- "src/core/lib/json/json_reader.cc",
- "src/core/lib/json/json_util.cc",
- "src/core/lib/json/json_util.h",
- "src/core/lib/json/json_writer.cc",
- "src/core/lib/matchers/matchers.cc",
- "src/core/lib/matchers/matchers.h",
- "src/core/lib/security/context/security_context.cc",
- "src/core/lib/security/context/security_context.h",
- "src/core/lib/security/credentials/alts/alts_credentials.cc",
- "src/core/lib/security/credentials/alts/alts_credentials.h",
- "src/core/lib/security/credentials/alts/check_gcp_environment.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment.h",
- "src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc",
- "src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_client_options.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.cc",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_options.h",
- "src/core/lib/security/credentials/alts/grpc_alts_credentials_server_options.cc",
- "src/core/lib/security/credentials/composite/composite_credentials.cc",
- "src/core/lib/security/credentials/composite/composite_credentials.h",
- "src/core/lib/security/credentials/credentials.cc",
- "src/core/lib/security/credentials/credentials.h",
- "src/core/lib/security/credentials/credentials_metadata.cc",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/aws_external_account_credentials.h",
- "src/core/lib/security/credentials/external/aws_request_signer.cc",
- "src/core/lib/security/credentials/external/aws_request_signer.h",
- "src/core/lib/security/credentials/external/external_account_credentials.cc",
- "src/core/lib/security/credentials/external/external_account_credentials.h",
- "src/core/lib/security/credentials/external/file_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/file_external_account_credentials.h",
- "src/core/lib/security/credentials/external/url_external_account_credentials.cc",
- "src/core/lib/security/credentials/external/url_external_account_credentials.h",
- "src/core/lib/security/credentials/fake/fake_credentials.cc",
- "src/core/lib/security/credentials/fake/fake_credentials.h",
- "src/core/lib/security/credentials/google_default/credentials_generic.cc",
- "src/core/lib/security/credentials/google_default/google_default_credentials.cc",
- "src/core/lib/security/credentials/google_default/google_default_credentials.h",
- "src/core/lib/security/credentials/iam/iam_credentials.cc",
- "src/core/lib/security/credentials/iam/iam_credentials.h",
- "src/core/lib/security/credentials/insecure/insecure_credentials.cc",
- "src/core/lib/security/credentials/jwt/json_token.cc",
- "src/core/lib/security/credentials/jwt/json_token.h",
- "src/core/lib/security/credentials/jwt/jwt_credentials.cc",
- "src/core/lib/security/credentials/jwt/jwt_credentials.h",
- "src/core/lib/security/credentials/jwt/jwt_verifier.cc",
- "src/core/lib/security/credentials/jwt/jwt_verifier.h",
- "src/core/lib/security/credentials/local/local_credentials.cc",
- "src/core/lib/security/credentials/local/local_credentials.h",
- "src/core/lib/security/credentials/oauth2/oauth2_credentials.cc",
- "src/core/lib/security/credentials/oauth2/oauth2_credentials.h",
- "src/core/lib/security/credentials/plugin/plugin_credentials.cc",
- "src/core/lib/security/credentials/plugin/plugin_credentials.h",
- "src/core/lib/security/credentials/ssl/ssl_credentials.cc",
- "src/core/lib/security/credentials/ssl/ssl_credentials.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h",
- "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc",
- "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h",
- "src/core/lib/security/credentials/tls/tls_credentials.cc",
- "src/core/lib/security/credentials/tls/tls_credentials.h",
- "src/core/lib/security/credentials/tls/tls_utils.cc",
- "src/core/lib/security/credentials/tls/tls_utils.h",
- "src/core/lib/security/credentials/xds/xds_credentials.cc",
- "src/core/lib/security/credentials/xds/xds_credentials.h",
- "src/core/lib/security/security_connector/alts/alts_security_connector.cc",
- "src/core/lib/security/security_connector/alts/alts_security_connector.h",
- "src/core/lib/security/security_connector/fake/fake_security_connector.cc",
- "src/core/lib/security/security_connector/fake/fake_security_connector.h",
- "src/core/lib/security/security_connector/insecure/insecure_security_connector.cc",
- "src/core/lib/security/security_connector/insecure/insecure_security_connector.h",
- "src/core/lib/security/security_connector/load_system_roots.h",
- "src/core/lib/security/security_connector/load_system_roots_fallback.cc",
- "src/core/lib/security/security_connector/load_system_roots_linux.cc",
- "src/core/lib/security/security_connector/load_system_roots_linux.h",
- "src/core/lib/security/security_connector/local/local_security_connector.cc",
- "src/core/lib/security/security_connector/local/local_security_connector.h",
- "src/core/lib/security/security_connector/security_connector.cc",
- "src/core/lib/security/security_connector/security_connector.h",
- "src/core/lib/security/security_connector/ssl/ssl_security_connector.cc",
- "src/core/lib/security/security_connector/ssl/ssl_security_connector.h",
- "src/core/lib/security/security_connector/ssl_utils.cc",
- "src/core/lib/security/security_connector/ssl_utils.h",
- "src/core/lib/security/security_connector/ssl_utils_config.cc",
- "src/core/lib/security/security_connector/ssl_utils_config.h",
- "src/core/lib/security/security_connector/tls/tls_security_connector.cc",
- "src/core/lib/security/security_connector/tls/tls_security_connector.h",
- "src/core/lib/security/transport/auth_filters.h",
- "src/core/lib/security/transport/client_auth_filter.cc",
- "src/core/lib/security/transport/secure_endpoint.cc",
- "src/core/lib/security/transport/secure_endpoint.h",
- "src/core/lib/security/transport/security_handshaker.cc",
- "src/core/lib/security/transport/security_handshaker.h",
- "src/core/lib/security/transport/server_auth_filter.cc",
- "src/core/lib/security/transport/tsi_error.cc",
- "src/core/lib/security/transport/tsi_error.h",
- "src/core/lib/security/util/json_util.cc",
- "src/core/lib/security/util/json_util.h",
- "src/core/lib/slice/b64.cc",
- "src/core/lib/slice/b64.h",
- "src/core/lib/slice/percent_encoding.cc",
- "src/core/lib/slice/percent_encoding.h",
- "src/core/lib/slice/slice.cc",
- "src/core/lib/slice/slice_buffer.cc",
- "src/core/lib/slice/slice_intern.cc",
- "src/core/lib/slice/slice_internal.h",
- "src/core/lib/slice/slice_string_helpers.cc",
- "src/core/lib/slice/slice_string_helpers.h",
- "src/core/lib/slice/slice_utils.h",
- "src/core/lib/surface/api_trace.cc",
- "src/core/lib/surface/api_trace.h",
- "src/core/lib/surface/byte_buffer.cc",
- "src/core/lib/surface/byte_buffer_reader.cc",
- "src/core/lib/surface/call.cc",
- "src/core/lib/surface/call.h",
- "src/core/lib/surface/call_details.cc",
- "src/core/lib/surface/call_log_batch.cc",
- "src/core/lib/surface/call_test_only.h",
- "src/core/lib/surface/channel.cc",
- "src/core/lib/surface/channel.h",
- "src/core/lib/surface/channel_init.cc",
- "src/core/lib/surface/channel_init.h",
- "src/core/lib/surface/channel_ping.cc",
- "src/core/lib/surface/channel_stack_type.cc",
- "src/core/lib/surface/channel_stack_type.h",
- "src/core/lib/surface/completion_queue.cc",
- "src/core/lib/surface/completion_queue.h",
- "src/core/lib/surface/completion_queue_factory.cc",
- "src/core/lib/surface/completion_queue_factory.h",
- "src/core/lib/surface/event_string.cc",
- "src/core/lib/surface/event_string.h",
- "src/core/lib/surface/init.cc",
- "src/core/lib/surface/init.h",
- "src/core/lib/surface/init_secure.cc",
- "src/core/lib/surface/lame_client.cc",
- "src/core/lib/surface/lame_client.h",
- "src/core/lib/surface/metadata_array.cc",
- "src/core/lib/surface/server.cc",
- "src/core/lib/surface/server.h",
- "src/core/lib/surface/validate_metadata.cc",
- "src/core/lib/surface/validate_metadata.h",
- "src/core/lib/surface/version.cc",
- "src/core/lib/transport/authority_override.cc",
- "src/core/lib/transport/authority_override.h",
- "src/core/lib/transport/bdp_estimator.cc",
- "src/core/lib/transport/bdp_estimator.h",
- "src/core/lib/transport/byte_stream.cc",
- "src/core/lib/transport/byte_stream.h",
- "src/core/lib/transport/connectivity_state.cc",
- "src/core/lib/transport/connectivity_state.h",
- "src/core/lib/transport/error_utils.cc",
- "src/core/lib/transport/error_utils.h",
- "src/core/lib/transport/http2_errors.h",
- "src/core/lib/transport/metadata.cc",
- "src/core/lib/transport/metadata.h",
- "src/core/lib/transport/metadata_batch.cc",
- "src/core/lib/transport/metadata_batch.h",
- "src/core/lib/transport/pid_controller.cc",
- "src/core/lib/transport/pid_controller.h",
- "src/core/lib/transport/static_metadata.cc",
- "src/core/lib/transport/static_metadata.h",
- "src/core/lib/transport/status_conversion.cc",
- "src/core/lib/transport/status_conversion.h",
- "src/core/lib/transport/status_metadata.cc",
- "src/core/lib/transport/status_metadata.h",
- "src/core/lib/transport/timeout_encoding.cc",
- "src/core/lib/transport/timeout_encoding.h",
- "src/core/lib/transport/transport.cc",
- "src/core/lib/transport/transport.h",
- "src/core/lib/transport/transport_impl.h",
- "src/core/lib/transport/transport_op_string.cc",
- "src/core/lib/uri/uri_parser.cc",
- "src/core/lib/uri/uri_parser.h",
- "src/core/plugin_registry/grpc_plugin_registry.cc",
- "src/core/tsi/alts/crypt/aes_gcm.cc",
- "src/core/tsi/alts/crypt/gsec.cc",
- "src/core/tsi/alts/crypt/gsec.h",
- "src/core/tsi/alts/frame_protector/alts_counter.cc",
- "src/core/tsi/alts/frame_protector/alts_counter.h",
- "src/core/tsi/alts/frame_protector/alts_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_crypter.h",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.cc",
- "src/core/tsi/alts/frame_protector/alts_frame_protector.h",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.cc",
- "src/core/tsi/alts/frame_protector/alts_record_protocol_crypter_common.h",
- "src/core/tsi/alts/frame_protector/alts_seal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/alts_unseal_privacy_integrity_crypter.cc",
- "src/core/tsi/alts/frame_protector/frame_handler.cc",
- "src/core/tsi/alts/frame_protector/frame_handler.h",
- "src/core/tsi/alts/handshaker/alts_handshaker_client.cc",
- "src/core/tsi/alts/handshaker/alts_handshaker_client.h",
- "src/core/tsi/alts/handshaker/alts_shared_resource.cc",
- "src/core/tsi/alts/handshaker/alts_shared_resource.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h",
- "src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.cc",
- "src/core/tsi/alts/handshaker/alts_tsi_utils.h",
- "src/core/tsi/alts/handshaker/transport_security_common_api.cc",
- "src/core/tsi/alts/handshaker/transport_security_common_api.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_privacy_integrity_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc",
- "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h",
- "src/core/tsi/fake_transport_security.cc",
- "src/core/tsi/fake_transport_security.h",
- "src/core/tsi/local_transport_security.cc",
- "src/core/tsi/local_transport_security.h",
- "src/core/tsi/ssl/session_cache/ssl_session.h",
- "src/core/tsi/ssl/session_cache/ssl_session_boringssl.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.cc",
- "src/core/tsi/ssl/session_cache/ssl_session_cache.h",
- "src/core/tsi/ssl/session_cache/ssl_session_openssl.cc",
- "src/core/tsi/ssl_transport_security.cc",
- "src/core/tsi/ssl_transport_security.h",
- "src/core/tsi/ssl_types.h",
- "src/core/tsi/transport_security.cc",
- "src/core/tsi/transport_security.h",
- "src/core/tsi/transport_security_grpc.cc",
- "src/core/tsi/transport_security_grpc.h",
- "src/core/tsi/transport_security_interface.h",
- "third_party/xxhash/xxhash.h",
- ]
- deps = [
- "//third_party/zlib",
- ":y_absl/container:flat_hash_map",
- ":y_absl/container:inlined_vector",
- ":y_absl/functional:bind_front",
- ":y_absl/status:statusor",
- ":gpr",
- "//third_party/boringssl",
- ":address_sorting",
- ":upb",
- "//third_party/cares",
- ":address_sorting",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- include_dirs = [
- "third_party/cares",
- "third_party/address_sorting/include",
- ]
- }
-
-
-
- source_set("grpc++") {
- sources = [
- "include/grpc++/alarm.h",
- "include/grpc++/channel.h",
- "include/grpc++/client_context.h",
- "include/grpc++/completion_queue.h",
- "include/grpc++/create_channel.h",
- "include/grpc++/create_channel_posix.h",
- "include/grpc++/ext/health_check_service_server_builder_option.h",
- "include/grpc++/generic/async_generic_service.h",
- "include/grpc++/generic/generic_stub.h",
- "include/grpc++/grpc++.h",
- "include/grpc++/health_check_service_interface.h",
- "include/grpc++/impl/call.h",
- "include/grpc++/impl/channel_argument_option.h",
- "include/grpc++/impl/client_unary_call.h",
- "include/grpc++/impl/codegen/async_stream.h",
- "include/grpc++/impl/codegen/async_unary_call.h",
- "include/grpc++/impl/codegen/byte_buffer.h",
- "include/grpc++/impl/codegen/call.h",
- "include/grpc++/impl/codegen/call_hook.h",
- "include/grpc++/impl/codegen/channel_interface.h",
- "include/grpc++/impl/codegen/client_context.h",
- "include/grpc++/impl/codegen/client_unary_call.h",
- "include/grpc++/impl/codegen/completion_queue.h",
- "include/grpc++/impl/codegen/completion_queue_tag.h",
- "include/grpc++/impl/codegen/config.h",
- "include/grpc++/impl/codegen/config_protobuf.h",
- "include/grpc++/impl/codegen/core_codegen.h",
- "include/grpc++/impl/codegen/core_codegen_interface.h",
- "include/grpc++/impl/codegen/create_auth_context.h",
- "include/grpc++/impl/codegen/grpc_library.h",
- "include/grpc++/impl/codegen/metadata_map.h",
- "include/grpc++/impl/codegen/method_handler_impl.h",
- "include/grpc++/impl/codegen/proto_utils.h",
- "include/grpc++/impl/codegen/rpc_method.h",
- "include/grpc++/impl/codegen/rpc_service_method.h",
- "include/grpc++/impl/codegen/security/auth_context.h",
- "include/grpc++/impl/codegen/serialization_traits.h",
- "include/grpc++/impl/codegen/server_context.h",
- "include/grpc++/impl/codegen/server_interface.h",
- "include/grpc++/impl/codegen/service_type.h",
- "include/grpc++/impl/codegen/slice.h",
- "include/grpc++/impl/codegen/status.h",
- "include/grpc++/impl/codegen/status_code_enum.h",
- "include/grpc++/impl/codegen/string_ref.h",
- "include/grpc++/impl/codegen/stub_options.h",
- "include/grpc++/impl/codegen/sync_stream.h",
- "include/grpc++/impl/codegen/time.h",
- "include/grpc++/impl/grpc_library.h",
- "include/grpc++/impl/method_handler_impl.h",
- "include/grpc++/impl/rpc_method.h",
- "include/grpc++/impl/rpc_service_method.h",
- "include/grpc++/impl/serialization_traits.h",
- "include/grpc++/impl/server_builder_option.h",
- "include/grpc++/impl/server_builder_plugin.h",
- "include/grpc++/impl/server_initializer.h",
- "include/grpc++/impl/service_type.h",
- "include/grpc++/resource_quota.h",
- "include/grpc++/security/auth_context.h",
- "include/grpc++/security/auth_metadata_processor.h",
- "include/grpc++/security/credentials.h",
- "include/grpc++/security/server_credentials.h",
- "include/grpc++/server.h",
- "include/grpc++/server_builder.h",
- "include/grpc++/server_context.h",
- "include/grpc++/server_posix.h",
- "include/grpc++/support/async_stream.h",
- "include/grpc++/support/async_unary_call.h",
- "include/grpc++/support/byte_buffer.h",
- "include/grpc++/support/channel_arguments.h",
- "include/grpc++/support/config.h",
- "include/grpc++/support/slice.h",
- "include/grpc++/support/status.h",
- "include/grpc++/support/status_code_enum.h",
- "include/grpc++/support/string_ref.h",
- "include/grpc++/support/stub_options.h",
- "include/grpc++/support/sync_stream.h",
- "include/grpc++/support/time.h",
- "include/grpcpp/alarm.h",
- "include/grpcpp/channel.h",
- "include/grpcpp/client_context.h",
- "include/grpcpp/completion_queue.h",
- "include/grpcpp/create_channel.h",
- "include/grpcpp/create_channel_posix.h",
- "include/grpcpp/ext/health_check_service_server_builder_option.h",
- "include/grpcpp/generic/async_generic_service.h",
- "include/grpcpp/generic/generic_stub.h",
- "include/grpcpp/grpcpp.h",
- "include/grpcpp/health_check_service_interface.h",
- "include/grpcpp/impl/call.h",
- "include/grpcpp/impl/channel_argument_option.h",
- "include/grpcpp/impl/client_unary_call.h",
- "include/grpcpp/impl/codegen/async_generic_service.h",
- "include/grpcpp/impl/codegen/async_stream.h",
- "include/grpcpp/impl/codegen/async_unary_call.h",
- "include/grpcpp/impl/codegen/byte_buffer.h",
- "include/grpcpp/impl/codegen/call.h",
- "include/grpcpp/impl/codegen/call_hook.h",
- "include/grpcpp/impl/codegen/call_op_set.h",
- "include/grpcpp/impl/codegen/call_op_set_interface.h",
- "include/grpcpp/impl/codegen/callback_common.h",
- "include/grpcpp/impl/codegen/channel_interface.h",
- "include/grpcpp/impl/codegen/client_callback.h",
- "include/grpcpp/impl/codegen/client_context.h",
- "include/grpcpp/impl/codegen/client_interceptor.h",
- "include/grpcpp/impl/codegen/client_unary_call.h",
- "include/grpcpp/impl/codegen/completion_queue.h",
- "include/grpcpp/impl/codegen/completion_queue_tag.h",
- "include/grpcpp/impl/codegen/config.h",
- "include/grpcpp/impl/codegen/config_protobuf.h",
- "include/grpcpp/impl/codegen/core_codegen.h",
- "include/grpcpp/impl/codegen/core_codegen_interface.h",
- "include/grpcpp/impl/codegen/create_auth_context.h",
- "include/grpcpp/impl/codegen/delegating_channel.h",
- "include/grpcpp/impl/codegen/grpc_library.h",
- "include/grpcpp/impl/codegen/intercepted_channel.h",
- "include/grpcpp/impl/codegen/interceptor.h",
- "include/grpcpp/impl/codegen/interceptor_common.h",
- "include/grpcpp/impl/codegen/message_allocator.h",
- "include/grpcpp/impl/codegen/metadata_map.h",
- "include/grpcpp/impl/codegen/method_handler.h",
- "include/grpcpp/impl/codegen/method_handler_impl.h",
- "include/grpcpp/impl/codegen/proto_buffer_reader.h",
- "include/grpcpp/impl/codegen/proto_buffer_writer.h",
- "include/grpcpp/impl/codegen/proto_utils.h",
- "include/grpcpp/impl/codegen/rpc_method.h",
- "include/grpcpp/impl/codegen/rpc_service_method.h",
- "include/grpcpp/impl/codegen/security/auth_context.h",
- "include/grpcpp/impl/codegen/serialization_traits.h",
- "include/grpcpp/impl/codegen/server_callback.h",
- "include/grpcpp/impl/codegen/server_callback_handlers.h",
- "include/grpcpp/impl/codegen/server_context.h",
- "include/grpcpp/impl/codegen/server_interceptor.h",
- "include/grpcpp/impl/codegen/server_interface.h",
- "include/grpcpp/impl/codegen/service_type.h",
- "include/grpcpp/impl/codegen/slice.h",
- "include/grpcpp/impl/codegen/status.h",
- "include/grpcpp/impl/codegen/status_code_enum.h",
- "include/grpcpp/impl/codegen/string_ref.h",
- "include/grpcpp/impl/codegen/stub_options.h",
- "include/grpcpp/impl/codegen/sync.h",
- "include/grpcpp/impl/codegen/sync_stream.h",
- "include/grpcpp/impl/codegen/time.h",
- "include/grpcpp/impl/grpc_library.h",
- "include/grpcpp/impl/method_handler_impl.h",
- "include/grpcpp/impl/rpc_method.h",
- "include/grpcpp/impl/rpc_service_method.h",
- "include/grpcpp/impl/serialization_traits.h",
- "include/grpcpp/impl/server_builder_option.h",
- "include/grpcpp/impl/server_builder_plugin.h",
- "include/grpcpp/impl/server_initializer.h",
- "include/grpcpp/impl/service_type.h",
- "include/grpcpp/resource_quota.h",
- "include/grpcpp/security/auth_context.h",
- "include/grpcpp/security/auth_metadata_processor.h",
- "include/grpcpp/security/credentials.h",
- "include/grpcpp/security/server_credentials.h",
- "include/grpcpp/security/tls_certificate_provider.h",
- "include/grpcpp/security/tls_credentials_options.h",
- "include/grpcpp/server.h",
- "include/grpcpp/server_builder.h",
- "include/grpcpp/server_context.h",
- "include/grpcpp/server_posix.h",
- "include/grpcpp/support/async_stream.h",
- "include/grpcpp/support/async_unary_call.h",
- "include/grpcpp/support/byte_buffer.h",
- "include/grpcpp/support/channel_arguments.h",
- "include/grpcpp/support/client_callback.h",
- "include/grpcpp/support/client_interceptor.h",
- "include/grpcpp/support/config.h",
- "include/grpcpp/support/interceptor.h",
- "include/grpcpp/support/message_allocator.h",
- "include/grpcpp/support/method_handler.h",
- "include/grpcpp/support/proto_buffer_reader.h",
- "include/grpcpp/support/proto_buffer_writer.h",
- "include/grpcpp/support/server_callback.h",
- "include/grpcpp/support/server_interceptor.h",
- "include/grpcpp/support/slice.h",
- "include/grpcpp/support/status.h",
- "include/grpcpp/support/status_code_enum.h",
- "include/grpcpp/support/string_ref.h",
- "include/grpcpp/support/stub_options.h",
- "include/grpcpp/support/sync_stream.h",
- "include/grpcpp/support/time.h",
- "include/grpcpp/support/validate_service_config.h",
- "include/grpcpp/xds_server_builder.h",
- "src/cpp/client/channel_cc.cc",
- "src/cpp/client/client_callback.cc",
- "src/cpp/client/client_context.cc",
- "src/cpp/client/client_interceptor.cc",
- "src/cpp/client/create_channel.cc",
- "src/cpp/client/create_channel_internal.cc",
- "src/cpp/client/create_channel_internal.h",
- "src/cpp/client/create_channel_posix.cc",
- "src/cpp/client/credentials_cc.cc",
- "src/cpp/client/insecure_credentials.cc",
- "src/cpp/client/secure_credentials.cc",
- "src/cpp/client/secure_credentials.h",
- "src/cpp/client/xds_credentials.cc",
- "src/cpp/codegen/codegen_init.cc",
- "src/cpp/common/alarm.cc",
- "src/cpp/common/auth_property_iterator.cc",
- "src/cpp/common/channel_arguments.cc",
- "src/cpp/common/channel_filter.cc",
- "src/cpp/common/channel_filter.h",
- "src/cpp/common/completion_queue_cc.cc",
- "src/cpp/common/core_codegen.cc",
- "src/cpp/common/resource_quota_cc.cc",
- "src/cpp/common/rpc_method.cc",
- "src/cpp/common/secure_auth_context.cc",
- "src/cpp/common/secure_auth_context.h",
- "src/cpp/common/secure_channel_arguments.cc",
- "src/cpp/common/secure_create_auth_context.cc",
- "src/cpp/common/tls_certificate_provider.cc",
- "src/cpp/common/tls_credentials_options.cc",
- "src/cpp/common/tls_credentials_options_util.cc",
- "src/cpp/common/tls_credentials_options_util.h",
- "src/cpp/common/validate_service_config.cc",
- "src/cpp/common/version_cc.cc",
- "src/cpp/server/async_generic_service.cc",
- "src/cpp/server/channel_argument_option.cc",
- "src/cpp/server/create_default_thread_pool.cc",
- "src/cpp/server/dynamic_thread_pool.cc",
- "src/cpp/server/dynamic_thread_pool.h",
- "src/cpp/server/external_connection_acceptor_impl.cc",
- "src/cpp/server/external_connection_acceptor_impl.h",
- "src/cpp/server/health/default_health_check_service.cc",
- "src/cpp/server/health/default_health_check_service.h",
- "src/cpp/server/health/health_check_service.cc",
- "src/cpp/server/health/health_check_service_server_builder_option.cc",
- "src/cpp/server/insecure_server_credentials.cc",
- "src/cpp/server/secure_server_credentials.cc",
- "src/cpp/server/secure_server_credentials.h",
- "src/cpp/server/server_builder.cc",
- "src/cpp/server/server_callback.cc",
- "src/cpp/server/server_cc.cc",
- "src/cpp/server/server_context.cc",
- "src/cpp/server/server_credentials.cc",
- "src/cpp/server/server_posix.cc",
- "src/cpp/server/thread_pool_interface.h",
- "src/cpp/server/xds_server_credentials.cc",
- "src/cpp/thread_manager/thread_manager.cc",
- "src/cpp/thread_manager/thread_manager.h",
- "src/cpp/util/byte_buffer_cc.cc",
- "src/cpp/util/status.cc",
- "src/cpp/util/string_ref.cc",
- "src/cpp/util/time_cc.cc",
- ]
- deps = [
- "//third_party/protobuf:protobuf_lite",
- ":grpc",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
- # Only compile the plugin for the host architecture.
- if (current_toolchain == host_toolchain) {
-
-
- source_set("grpc_plugin_support") {
- sources = [
- "include/grpc++/impl/codegen/config_protobuf.h",
- "include/grpcpp/impl/codegen/config_protobuf.h",
- "src/compiler/config.h",
- "src/compiler/config_protobuf.h",
- "src/compiler/cpp_generator.cc",
- "src/compiler/cpp_generator.h",
- "src/compiler/cpp_generator_helpers.h",
- "src/compiler/cpp_plugin.h",
- "src/compiler/csharp_generator.cc",
- "src/compiler/csharp_generator.h",
- "src/compiler/csharp_generator_helpers.h",
- "src/compiler/generator_helpers.h",
- "src/compiler/node_generator.cc",
- "src/compiler/node_generator.h",
- "src/compiler/node_generator_helpers.h",
- "src/compiler/objective_c_generator.cc",
- "src/compiler/objective_c_generator.h",
- "src/compiler/objective_c_generator_helpers.h",
- "src/compiler/php_generator.cc",
- "src/compiler/php_generator.h",
- "src/compiler/php_generator_helpers.h",
- "src/compiler/protobuf_plugin.h",
- "src/compiler/python_generator.cc",
- "src/compiler/python_generator.h",
- "src/compiler/python_generator_helpers.h",
- "src/compiler/python_private_generator.h",
- "src/compiler/schema_interface.h",
- ]
- deps = [
- "//third_party/protobuf:protoc_lib",
- ]
-
- public_configs = [
- ":grpc_config",
- ]
- }
-
- }
- # Only compile the plugin for the host architecture.
- if (current_toolchain == host_toolchain) {
-
- executable("grpc_cpp_plugin") {
- sources = [
- "src/compiler/cpp_plugin.cc",
- ]
- deps = [
- "//third_party/protobuf:protoc_lib",
- ":grpc_plugin_support",
- ]
-
- configs += [
- "//third_party/protobuf:protobuf_config",
- ]
- public_configs = [ ":grpc_config" ]
- }
-
- }
-
-
diff --git a/contrib/libs/grpc/BUILDING.md b/contrib/libs/grpc/BUILDING.md
index 4a69c3b779f..80dadc64fc9 100644
--- a/contrib/libs/grpc/BUILDING.md
+++ b/contrib/libs/grpc/BUILDING.md
@@ -20,7 +20,7 @@ If you plan to build using CMake
If you are a contributor and plan to build and run tests, install the following as well:
```sh
$ # clang and LLVM C++ lib is only required for sanitizer builds
- $ [sudo] apt-get install clang-5.0 libc++-dev
+ $ [sudo] apt-get install clang libc++-dev
```
## MacOS
@@ -269,10 +269,10 @@ $ make
### A note on `protoc`
-By default gRPC uses [protocol buffers](https://github.com/google/protobuf),
+By default gRPC uses [protocol buffers](https://github.com/protocolbuffers/protobuf),
you will need the `protoc` compiler to generate stub server and client code.
-If you compile gRPC from source, as described below, the Makefile will
+If you compile gRPC from source, as described above, the Makefile will
automatically try compiling the `protoc` in third_party if you cloned the
repository recursively and it detects that you do not already have 'protoc' compiler
installed.
diff --git a/contrib/libs/grpc/CONCEPTS.md b/contrib/libs/grpc/CONCEPTS.md
index 034d58e4275..c85974ed877 100644
--- a/contrib/libs/grpc/CONCEPTS.md
+++ b/contrib/libs/grpc/CONCEPTS.md
@@ -14,7 +14,7 @@ of methods). From this description, gRPC will generate client and server side in
in any of the supported languages. The server implements
the service interface, which can be remotely invoked by the client interface.
-By default, gRPC uses [Protocol Buffers](https://github.com/google/protobuf) as the
+By default, gRPC uses [Protocol Buffers](https://github.com/protocolbuffers/protobuf) as the
Interface Definition Language (IDL) for describing both the service interface
and the structure of the payload messages. It is possible to use other
alternatives if desired.
@@ -54,10 +54,11 @@ clients and servers. A concrete embedding over HTTP/2 completes the picture by
fleshing out the details of each of the required operations.
## Abstract gRPC protocol
-A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
+A gRPC call comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. A client signals end of its message stream by means of an underlying lower level protocol. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`).
## Implementation over HTTP/2
-The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers).
+The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers). A client signals end of its message stream by setting `END_STREAM` flag on the last DATA frame.
+For a detailed description see [doc/PROTOCOL-HTTP2.md](doc/PROTOCOL-HTTP2.md).
## Flow Control
gRPC uses the flow control mechanism in HTTP/2. This enables fine-grained control of memory used for buffering in-flight messages.
diff --git a/contrib/libs/grpc/LICENSE b/contrib/libs/grpc/LICENSE
index d6456956733..74ec4aa7d93 100644
--- a/contrib/libs/grpc/LICENSE
+++ b/contrib/libs/grpc/LICENSE
@@ -200,3 +200,43 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+-----------------------------------------------------------
+
+BSD 3-Clause License
+
+Copyright 2016, Google Inc.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+contributors may be used to endorse or promote products derived from this
+software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+-----------------------------------------------------------
+
+Mozilla Public License, v. 2.0
+
+This Source Code Form is subject to the terms of the Mozilla Public License,
+v. 2.0. If a copy of the MPL was not distributed with this file, You can
+obtain one at https://mozilla.org/MPL/2.0/.
diff --git a/contrib/libs/grpc/MAINTAINERS.md b/contrib/libs/grpc/MAINTAINERS.md
index f338c6b193e..6f6c8a5fa34 100644
--- a/contrib/libs/grpc/MAINTAINERS.md
+++ b/contrib/libs/grpc/MAINTAINERS.md
@@ -13,6 +13,7 @@ for general contribution guidelines.
- [arjunroy](https://github.com/arjunroy), Google LLC
- [AspirinSJL](https://github.com/AspirinSJL), Google LLC
- [bogdandrutu](https://github.com/bogdandrutu), Google LLC
+- [ctiller](https://github.com/ctiller), Google LLC
- [daniel-j-born](https://github.com/daniel-j-born), Google LLC
- [dapengzhang0](https://github.com/dapengzhang0), Google LLC
- [dfawley](https://github.com/dfawley), Google LLC
@@ -64,7 +65,6 @@ for general contribution guidelines.
## Emeritus Maintainers (in alphabetical order)
- [adelez](https://github.com/adelez), Google LLC
- [billfeng327](https://github.com/billfeng327), Google LLC
-- [ctiller](https://github.com/ctiller), Google LLC
- [dgquintas](https://github.com/dgquintas), Google LLC
- [fengli79](https://github.com/fengli79), Google LLC
- [jcanizales](https://github.com/jcanizales), Google LLC
diff --git a/contrib/libs/grpc/README.md b/contrib/libs/grpc/README.md
index a392de0e7e0..85a9d7b5783 100644
--- a/contrib/libs/grpc/README.md
+++ b/contrib/libs/grpc/README.md
@@ -54,7 +54,7 @@ Sometimes things go wrong. Please check out the [Troubleshooting guide](TROUBLES
# Performance
-See the [Performance dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584) for performance numbers of master branch daily builds.
+See the [Performance dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5180705743044608) for performance numbers of master branch daily builds.
# Concepts
diff --git a/contrib/libs/grpc/grpc++/CMakeLists.txt b/contrib/libs/grpc/grpc++/CMakeLists.txt
index 018a0ab3f4b..15621a68add 100644
--- a/contrib/libs/grpc/grpc++/CMakeLists.txt
+++ b/contrib/libs/grpc/grpc++/CMakeLists.txt
@@ -30,10 +30,33 @@ target_link_libraries(libs-grpc-grpc++ PUBLIC
grpc-third_party-address_sorting
grpc-third_party-upb
OpenSSL::OpenSSL
+ ycontainer-internal-raw_hash_set
+ yabseil-cpp-tstring-y_absl-hash
+ yabseil-cpp-tstring-y_absl-status
+ yabsl-status-statusor
yabseil-cpp-tstring-y_absl-strings
yabseil-cpp-tstring-y_absl-synchronization
+ yabseil-cpp-tstring-y_absl-time
)
target_sources(libs-grpc-grpc++ PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/client/channel_cc.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/client/client_callback.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/client/client_context.cc
@@ -58,8 +81,8 @@ target_sources(libs-grpc-grpc++ PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/tls_certificate_verifier.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/common/version_cc.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
diff --git a/contrib/libs/grpc/grpc/CMakeLists.txt b/contrib/libs/grpc/grpc/CMakeLists.txt
index bfbec612738..b0048065fc8 100644
--- a/contrib/libs/grpc/grpc/CMakeLists.txt
+++ b/contrib/libs/grpc/grpc/CMakeLists.txt
@@ -80,6 +80,7 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
@@ -90,12 +91,13 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/local_subchannel_pool.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/proxy_mapper_registry.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc
@@ -106,14 +108,15 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -125,10 +128,11 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/service_config/service_config.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/service_config/service_config_parser.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -150,11 +154,12 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/http2_settings.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/huffsyms.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_map.cc
@@ -182,14 +187,17 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
@@ -216,6 +224,7 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -232,34 +241,37 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
@@ -280,14 +292,17 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
@@ -313,6 +328,7 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
@@ -341,28 +357,33 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_routing.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/avl/avl.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/address_utils/parse_address.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/backoff/backoff.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/channel/channel_stack.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
@@ -379,9 +400,15 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/compression/stream_compression.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/config/core_configuration.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/debug/stats.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/debug/stats_data.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/debug/trace.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/event_engine/event_engine.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/event_engine/memory_allocator.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/http/format_request.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/http/httpcli.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
@@ -393,8 +420,8 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/error.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
@@ -404,6 +431,14 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/ev_windows.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/iomgr.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolver.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/tcp.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/event_engine/timer.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -422,33 +457,26 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/iomgr_uv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_set.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_uv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/socket_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_client.cc
@@ -465,7 +493,6 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/time_averaged_stats.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/timer.cc
@@ -473,8 +500,6 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/timer_uv.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -486,6 +511,15 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/json/json_util.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/json/json_writer.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/matchers/matchers.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/promise/activity.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/resource_quota/api.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/resource_quota/trace.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/context/security_context.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/alts/alts_credentials.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment.cc
@@ -517,6 +551,7 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
@@ -542,10 +577,15 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/b64.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_api.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_intern.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_refcount.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_split.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/slice/static_slice.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/api_trace.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/builtins.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/byte_buffer.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/call.cc
@@ -565,13 +605,13 @@ target_sources(libs-grpc-grpc PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/server.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/surface/version.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/authority_override.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/byte_stream.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/metadata.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/pid_controller.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/transport/status_conversion.cc
diff --git a/contrib/libs/grpc/include/grpc/byte_buffer.h b/contrib/libs/grpc/include/grpc/byte_buffer.h
index ee740f47944..fff33cb8608 100644
--- a/contrib/libs/grpc/include/grpc/byte_buffer.h
+++ b/contrib/libs/grpc/include/grpc/byte_buffer.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer.h>
+#include <grpc/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpc/slice_buffer.h>
#endif /* GRPC_BYTE_BUFFER_H */
diff --git a/contrib/libs/grpc/include/grpc/byte_buffer_reader.h b/contrib/libs/grpc/include/grpc/byte_buffer_reader.h
index 15e06cad7c1..763dd780d0d 100644
--- a/contrib/libs/grpc/include/grpc/byte_buffer_reader.h
+++ b/contrib/libs/grpc/include/grpc/byte_buffer_reader.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/byte_buffer_reader.h>
+#include <grpc/impl/codegen/byte_buffer_reader.h> // IWYU pragma: export
#endif /* GRPC_BYTE_BUFFER_READER_H */
diff --git a/contrib/libs/grpc/include/grpc/event_engine/README.md b/contrib/libs/grpc/include/grpc/event_engine/README.md
new file mode 100644
index 00000000000..b2d4fef83b3
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/README.md
@@ -0,0 +1,38 @@
+# gRPC EventEngine
+
+An EventEngine handles all cross-platform I/O, task execution, and DNS
+resolution for gRPC. A default, cross-platform implementation is provided with
+gRPC, but part of the intent here is to provide an interface for external
+integrators to bring their own functionality. This allows for integration with
+external event loops, siloing I/O and task execution between channels or
+servers, and other custom integrations that were previously unsupported.
+
+*WARNING*: This is experimental code and is subject to change.
+
+## High level expectations of an EventEngine implementation
+
+### Provide their own I/O threads
+EventEngines are expected to internally create whatever threads are required to
+perform I/O and execute callbacks. For example, an EventEngine implementation
+may want to spawn separate thread pools for polling and callback execution.
+
+### Provisioning data buffers via Slice allocation
+At a high level, gRPC provides a `ResourceQuota` system that allows gRPC to
+reclaim memory and degrade gracefully when memory reaches application-defined
+thresholds. To enable this feature, the memory allocation of read/write buffers
+within an EventEngine must be acquired in the form of Slices from
+SliceAllocators. This is covered more fully in the gRFC and code.
+
+### Documentating expectations around callback execution
+Some callbacks may be expensive to run. EventEngines should decide on and
+document whether callback execution might block polling operations. This way,
+application developers can plan accordingly (e.g., run their expensive callbacks
+on a separate thread if necessary).
+
+### Handling concurrent usage
+Assume that gRPC may use an EventEngine concurrently across multiple threads.
+
+## TODO: documentation
+
+* Example usage
+* Link to gRFC
diff --git a/contrib/libs/grpc/include/grpc/event_engine/endpoint_config.h b/contrib/libs/grpc/include/grpc/event_engine/endpoint_config.h
new file mode 100644
index 00000000000..f8a07893750
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/endpoint_config.h
@@ -0,0 +1,43 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+#define GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+
+#include "y_absl/strings/string_view.h"
+#include "y_absl/types/variant.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Collection of parameters used to configure client and server endpoints. The
+/// \a EndpointConfig maps string-valued keys to values of type int,
+/// string_view, or void pointer. Each EventEngine implementation should
+/// document its set of supported configuration options.
+class EndpointConfig {
+ public:
+ virtual ~EndpointConfig() = default;
+ using Setting = y_absl::variant<y_absl::monostate, int, y_absl::string_view, void*>;
+ /// Returns the Setting for a specified key, or \a y_absl::monostate if there is
+ /// no such entry. Caller does not take ownership of the resulting value.
+ virtual Setting Get(y_absl::string_view key) const = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_ENDPOINT_CONFIG_H
diff --git a/contrib/libs/grpc/include/grpc/event_engine/event_engine.h b/contrib/libs/grpc/include/grpc/event_engine/event_engine.h
new file mode 100644
index 00000000000..113c736d53d
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/event_engine.h
@@ -0,0 +1,399 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_EVENT_ENGINE_H
+#define GRPC_EVENT_ENGINE_EVENT_ENGINE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <vector>
+
+#include "y_absl/status/status.h"
+#include "y_absl/status/statusor.h"
+#include "y_absl/time/time.h"
+
+#include <grpc/event_engine/endpoint_config.h>
+#include <grpc/event_engine/memory_allocator.h>
+#include <grpc/event_engine/port.h>
+
+// TODO(hork): Define the Endpoint::Write metrics collection system
+namespace grpc_event_engine {
+namespace experimental {
+
+////////////////////////////////////////////////////////////////////////////////
+/// The EventEngine encapsulates all platform-specific behaviors related to low
+/// level network I/O, timers, asynchronous execution, and DNS resolution.
+///
+/// This interface allows developers to provide their own event management and
+/// network stacks. Motivating uses cases for supporting custom EventEngines
+/// include the ability to hook into external event loops, and using different
+/// EventEngine instances for each channel to better insulate network I/O and
+/// callback processing from other channels.
+///
+/// A default cross-platform EventEngine instance is provided by gRPC.
+///
+/// LIFESPAN AND OWNERSHIP
+///
+/// gRPC takes shared ownership of EventEngines via std::shared_ptrs to ensure
+/// that the engines remain available until they are no longer needed. Depending
+/// on the use case, engines may live until gRPC is shut down.
+///
+/// EXAMPLE USAGE (Not yet implemented)
+///
+/// Custom EventEngines can be specified per channel, and allow configuration
+/// for both clients and servers. To set a custom EventEngine for a client
+/// channel, you can do something like the following:
+///
+/// ChannelArguments args;
+/// std::shared_ptr<EventEngine> engine = std::make_shared<MyEngine>(...);
+/// args.SetEventEngine(engine);
+/// MyAppClient client(grpc::CreateCustomChannel(
+/// "localhost:50051", grpc::InsecureChannelCredentials(), args));
+///
+/// A gRPC server can use a custom EventEngine by calling the
+/// ServerBuilder::SetEventEngine method:
+///
+/// ServerBuilder builder;
+/// std::shared_ptr<EventEngine> engine = std::make_shared<MyEngine>(...);
+/// builder.SetEventEngine(engine);
+/// std::unique_ptr<Server> server(builder.BuildAndStart());
+/// server->Wait();
+///
+////////////////////////////////////////////////////////////////////////////////
+class EventEngine {
+ public:
+ /// A custom closure type for EventEngine task execution.
+ ///
+ /// Throughout the EventEngine API, \a Closure ownership is retained by the
+ /// caller - the EventEngine will never delete a Closure, and upon
+ /// cancellation, the EventEngine will simply forget the Closure exists. The
+ /// caller is responsible for all necessary cleanup.
+ class Closure {
+ public:
+ Closure() = default;
+ // Closure's are an interface, and thus non-copyable.
+ Closure(const Closure&) = delete;
+ Closure& operator=(const Closure&) = delete;
+ // Polymorphic type => virtual destructor
+ virtual ~Closure() = default;
+ // Run the contained code.
+ virtual void Run() = 0;
+ };
+ /// Represents a scheduled task.
+ ///
+ /// \a TaskHandles are returned by \a Run* methods, and can be given to the
+ /// \a Cancel method.
+ struct TaskHandle {
+ intptr_t keys[2];
+ };
+ /// A handle to a cancellable connection attempt.
+ ///
+ /// Returned by \a Connect, and can be passed to \a CancelConnect.
+ struct ConnectionHandle {
+ intptr_t keys[2];
+ };
+ /// Thin wrapper around a platform-specific sockaddr type. A sockaddr struct
+ /// exists on all platforms that gRPC supports.
+ ///
+ /// Platforms are expected to provide definitions for:
+ /// * sockaddr
+ /// * sockaddr_in
+ /// * sockaddr_in6
+ class ResolvedAddress {
+ public:
+ static constexpr socklen_t MAX_SIZE_BYTES = 128;
+
+ ResolvedAddress(const sockaddr* address, socklen_t size);
+ ResolvedAddress() = default;
+ ResolvedAddress(const ResolvedAddress&) = default;
+ const struct sockaddr* address() const;
+ socklen_t size() const;
+
+ private:
+ char address_[MAX_SIZE_BYTES];
+ socklen_t size_ = 0;
+ };
+
+ /// One end of a connection between a gRPC client and server. Endpoints are
+ /// created when connections are established, and Endpoint operations are
+ /// gRPC's primary means of communication.
+ ///
+ /// Endpoints must use the provided MemoryAllocator for all data buffer memory
+ /// allocations. gRPC allows applications to set memory constraints per
+ /// Channel or Server, and the implementation depends on all dynamic memory
+ /// allocation being handled by the quota system.
+ class Endpoint {
+ public:
+ /// Shuts down all connections and invokes all pending read or write
+ /// callbacks with an error status.
+ virtual ~Endpoint() = default;
+ /// Reads data from the Endpoint.
+ ///
+ /// When data is available on the connection, that data is moved into the
+ /// \a buffer, and the \a on_read callback is called. The caller must ensure
+ /// that the callback has access to the buffer when executed later.
+ /// Ownership of the buffer is not transferred. Valid slices *may* be placed
+ /// into the buffer even if the callback is invoked with a non-OK Status.
+ ///
+ /// There can be at most one outstanding read per Endpoint at any given
+ /// time. An outstanding read is one in which the \a on_read callback has
+ /// not yet been executed for some previous call to \a Read. If an attempt
+ /// is made to call \a Read while a previous read is still outstanding, the
+ /// \a EventEngine must abort.
+ ///
+ /// For failed read operations, implementations should pass the appropriate
+ /// statuses to \a on_read. For example, callbacks might expect to receive
+ /// CANCELLED on endpoint shutdown.
+ virtual void Read(std::function<void(y_absl::Status)> on_read,
+ SliceBuffer* buffer) = 0;
+ /// Writes data out on the connection.
+ ///
+ /// \a on_writable is called when the connection is ready for more data. The
+ /// Slices within the \a data buffer may be mutated at will by the Endpoint
+ /// until \a on_writable is called. The \a data SliceBuffer will remain
+ /// valid after calling \a Write, but its state is otherwise undefined. All
+ /// bytes in \a data must have been written before calling \a on_writable
+ /// unless an error has occurred.
+ ///
+ /// There can be at most one outstanding write per Endpoint at any given
+ /// time. An outstanding write is one in which the \a on_writable callback
+ /// has not yet been executed for some previous call to \a Write. If an
+ /// attempt is made to call \a Write while a previous write is still
+ /// outstanding, the \a EventEngine must abort.
+ ///
+ /// For failed write operations, implementations should pass the appropriate
+ /// statuses to \a on_writable. For example, callbacks might expect to
+ /// receive CANCELLED on endpoint shutdown.
+ virtual void Write(std::function<void(y_absl::Status)> on_writable,
+ SliceBuffer* data) = 0;
+ /// Returns an address in the format described in DNSResolver. The returned
+ /// values are expected to remain valid for the life of the Endpoint.
+ virtual const ResolvedAddress& GetPeerAddress() const = 0;
+ virtual const ResolvedAddress& GetLocalAddress() const = 0;
+ };
+
+ /// Called when a new connection is established.
+ ///
+ /// If the connection attempt was not successful, implementations should pass
+ /// the appropriate statuses to this callback. For example, callbacks might
+ /// expect to receive DEADLINE_EXCEEDED statuses when appropriate, or
+ /// CANCELLED statuses on EventEngine shutdown.
+ using OnConnectCallback =
+ std::function<void(y_absl::StatusOr<std::unique_ptr<Endpoint>>)>;
+
+ /// Listens for incoming connection requests from gRPC clients and initiates
+ /// request processing once connections are established.
+ class Listener {
+ public:
+ /// Called when the listener has accepted a new client connection.
+ using AcceptCallback = std::function<void(
+ std::unique_ptr<Endpoint>, MemoryAllocator memory_allocator)>;
+ virtual ~Listener() = default;
+ /// Bind an address/port to this Listener.
+ ///
+ /// It is expected that multiple addresses/ports can be bound to this
+ /// Listener before Listener::Start has been called. Returns either the
+ /// bound port or an appropriate error status.
+ virtual y_absl::StatusOr<int> Bind(const ResolvedAddress& addr) = 0;
+ virtual y_absl::Status Start() = 0;
+ };
+
+ /// Factory method to create a network listener / server.
+ ///
+ /// Once a \a Listener is created and started, the \a on_accept callback will
+ /// be called once asynchronously for each established connection. This method
+ /// may return a non-OK status immediately if an error was encountered in any
+ /// synchronous steps required to create the Listener. In this case,
+ /// \a on_shutdown will never be called.
+ ///
+ /// If this method returns a Listener, then \a on_shutdown will be invoked
+ /// exactly once, when the Listener is shut down. The status passed to it will
+ /// indicate if there was a problem during shutdown.
+ ///
+ /// The provided \a MemoryAllocatorFactory is used to create \a
+ /// MemoryAllocators for Endpoint construction.
+ virtual y_absl::StatusOr<std::unique_ptr<Listener>> CreateListener(
+ Listener::AcceptCallback on_accept,
+ std::function<void(y_absl::Status)> on_shutdown,
+ const EndpointConfig& config,
+ std::unique_ptr<MemoryAllocatorFactory> memory_allocator_factory) = 0;
+ /// Creates a client network connection to a remote network listener.
+ ///
+ /// Even in the event of an error, it is expected that the \a on_connect
+ /// callback will be asynchronously executed exactly once by the EventEngine.
+ /// A connection attempt can be cancelled using the \a CancelConnect method.
+ ///
+ /// Implementation Note: it is important that the \a memory_allocator be used
+ /// for all read/write buffer allocations in the EventEngine implementation.
+ /// This allows gRPC's \a ResourceQuota system to monitor and control memory
+ /// usage with graceful degradation mechanisms. Please see the \a
+ /// MemoryAllocator API for more information.
+ virtual ConnectionHandle Connect(OnConnectCallback on_connect,
+ const ResolvedAddress& addr,
+ const EndpointConfig& args,
+ MemoryAllocator memory_allocator,
+ y_absl::Time deadline) = 0;
+
+ /// Request cancellation of a connection attempt.
+ ///
+ /// If the associated connection has already been completed, it will not be
+ /// cancelled, and this method will return false.
+ ///
+ /// If the associated connection has not been completed, it will be cancelled,
+ /// and this method will return true. The \a OnConnectCallback will not be
+ /// called.
+ virtual bool CancelConnect(ConnectionHandle handle) = 0;
+ /// Provides asynchronous resolution.
+ class DNSResolver {
+ public:
+ /// Task handle for DNS Resolution requests.
+ struct LookupTaskHandle {
+ intptr_t key[2];
+ };
+ /// DNS SRV record type.
+ struct SRVRecord {
+ TString host;
+ int port = 0;
+ int priority = 0;
+ int weight = 0;
+ };
+ /// Called with the collection of sockaddrs that were resolved from a given
+ /// target address.
+ using LookupHostnameCallback =
+ std::function<void(y_absl::StatusOr<std::vector<ResolvedAddress>>)>;
+ /// Called with a collection of SRV records.
+ using LookupSRVCallback =
+ std::function<void(y_absl::StatusOr<std::vector<SRVRecord>>)>;
+ /// Called with the result of a TXT record lookup
+ using LookupTXTCallback = std::function<void(y_absl::StatusOr<TString>)>;
+
+ virtual ~DNSResolver() = default;
+
+ /// Asynchronously resolve an address.
+ ///
+ /// \a default_port may be a non-numeric named service port, and will only
+ /// be used if \a address does not already contain a port component.
+ ///
+ /// When the lookup is complete, the \a on_resolve callback will be invoked
+ /// with a status indicating the success or failure of the lookup.
+ /// Implementations should pass the appropriate statuses to the callback.
+ /// For example, callbacks might expect to receive DEADLINE_EXCEEDED or
+ /// NOT_FOUND.
+ ///
+ /// If cancelled, \a on_resolve will not be executed.
+ virtual LookupTaskHandle LookupHostname(LookupHostnameCallback on_resolve,
+ y_absl::string_view address,
+ y_absl::string_view default_port,
+ y_absl::Time deadline) = 0;
+ /// Asynchronously perform an SRV record lookup.
+ ///
+ /// \a on_resolve has the same meaning and expectations as \a
+ /// LookupHostname's \a on_resolve callback.
+ virtual LookupTaskHandle LookupSRV(LookupSRVCallback on_resolve,
+ y_absl::string_view name,
+ y_absl::Time deadline) = 0;
+ /// Asynchronously perform a TXT record lookup.
+ ///
+ /// \a on_resolve has the same meaning and expectations as \a
+ /// LookupHostname's \a on_resolve callback.
+ virtual LookupTaskHandle LookupTXT(LookupTXTCallback on_resolve,
+ y_absl::string_view name,
+ y_absl::Time deadline) = 0;
+ /// Cancel an asynchronous lookup operation.
+ ///
+ /// This shares the same semantics with \a EventEngine::Cancel: successfully
+ /// cancelled lookups will not have their callbacks executed, and this
+ /// method returns true.
+ virtual bool CancelLookup(LookupTaskHandle handle) = 0;
+ };
+
+ /// At time of destruction, the EventEngine must have no active
+ /// responsibilities. EventEngine users (applications) are responsible for
+ /// cancelling all tasks and DNS lookups, shutting down listeners and
+ /// endpoints, prior to EventEngine destruction. If there are any outstanding
+ /// tasks, any running listeners, etc. at time of EventEngine destruction,
+ /// that is an invalid use of the API, and it will result in undefined
+ /// behavior.
+ virtual ~EventEngine() = default;
+
+ // TODO(nnoble): consider whether we can remove this method before we
+ // de-experimentalize this API.
+ virtual bool IsWorkerThread() = 0;
+
+ /// Creates and returns an instance of a DNSResolver.
+ virtual std::unique_ptr<DNSResolver> GetDNSResolver() = 0;
+
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. The \a closure will
+ /// not be deleted after it has been run, ownership remains with the caller.
+ virtual void Run(Closure* closure) = 0;
+ /// Asynchronously executes a task as soon as possible.
+ ///
+ /// \a Closures scheduled with \a Run cannot be cancelled. Unlike the
+ /// overloaded \a Closure alternative, the std::function version's \a closure
+ /// will be deleted by the EventEngine after the closure has been run.
+ ///
+ /// This version of \a Run may be less performant than the \a Closure version
+ /// in some scenarios. This overload is useful in situations where performance
+ /// is not a critical concern.
+ virtual void Run(std::function<void()> closure) = 0;
+ /// Synonymous with scheduling an alarm to run at time \a when.
+ ///
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run, nor will it be deleted. Ownership remains with the caller.
+ virtual TaskHandle RunAt(y_absl::Time when, Closure* closure) = 0;
+ /// Synonymous with scheduling an alarm to run at time \a when.
+ ///
+ /// The \a closure will execute when time \a when arrives unless it has been
+ /// cancelled via the \a Cancel method. If cancelled, the closure will not be
+ /// run. Unilke the overloaded \a Closure alternative, the std::function
+ /// version's \a closure will be deleted by the EventEngine after the closure
+ /// has been run, or upon cancellation.
+ ///
+ /// This version of \a RunAt may be less performant than the \a Closure
+ /// version in some scenarios. This overload is useful in situations where
+ /// performance is not a critical concern.
+ virtual TaskHandle RunAt(y_absl::Time when, std::function<void()> closure) = 0;
+ /// Request cancellation of a task.
+ ///
+ /// If the associated closure has already been scheduled to run, it will not
+ /// be cancelled, and this function will return false.
+ ///
+ /// If the associated callback has not been scheduled to run, it will be
+ /// cancelled, and the associated std::function or \a Closure* will not be
+ /// executed. In this case, Cancel will return true.
+ virtual bool Cancel(TaskHandle handle) = 0;
+};
+
+/// Replace gRPC's default EventEngine factory
+///
+/// Applications may call \a SetDefaultEventEngineFactory at any time to replace
+/// the default factory used within gRPC. EventEngines will be created when
+/// necessary, when they are otherwise not provided by the application.
+///
+/// To be certain that none of the gRPC-provided built-in EventEngines are
+/// created, applications must set a custom EventEngine factory method *before*
+/// grpc is initialized.
+void SetDefaultEventEngineFactory(
+ const std::function<std::unique_ptr<EventEngine>()>* factory);
+
+/// Create an EventEngine using the default factory
+std::unique_ptr<EventEngine> CreateEventEngine();
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_EVENT_ENGINE_H
diff --git a/contrib/libs/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h b/contrib/libs/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h
new file mode 100644
index 00000000000..e0ca2f5ea75
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/internal/memory_allocator_impl.h
@@ -0,0 +1,68 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+#define GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/memory_request.h>
+#include <grpc/slice.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace internal {
+
+/// Underlying memory allocation interface.
+/// This is an internal interface, not intended to be used by users.
+/// Its interface is subject to change at any time.
+class MemoryAllocatorImpl
+ : public std::enable_shared_from_this<MemoryAllocatorImpl> {
+ public:
+ MemoryAllocatorImpl() {}
+ virtual ~MemoryAllocatorImpl() {}
+
+ MemoryAllocatorImpl(const MemoryAllocatorImpl&) = delete;
+ MemoryAllocatorImpl& operator=(const MemoryAllocatorImpl&) = delete;
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ /// If MemoryRequest is invalid, this function will abort.
+ /// If MemoryRequest is valid, this function is infallible, and will always
+ /// succeed at reserving the some number of bytes between request.min() and
+ /// request.max() inclusively.
+ virtual size_t Reserve(MemoryRequest request) = 0;
+
+ /// Release some bytes that were previously reserved.
+ /// If more bytes are released than were reserved, we will have undefined
+ /// behavior.
+ virtual void Release(size_t n) = 0;
+
+ /// Shutdown this allocator.
+ /// Further usage of Reserve() is undefined behavior.
+ virtual void Shutdown() = 0;
+};
+
+} // namespace internal
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_INTERNAL_MEMORY_ALLOCATOR_IMPL_H
diff --git a/contrib/libs/grpc/include/grpc/event_engine/memory_allocator.h b/contrib/libs/grpc/include/grpc/event_engine/memory_allocator.h
new file mode 100644
index 00000000000..0f6c68d7ae6
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/memory_allocator.h
@@ -0,0 +1,226 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+#define GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
+
+#include <grpc/impl/codegen/port_platform.h>
+
+#include <stdlib.h> // for abort()
+
+#include <algorithm>
+#include <memory>
+#include <type_traits>
+#include <vector>
+
+#include <grpc/event_engine/internal/memory_allocator_impl.h>
+#include <grpc/slice.h>
+
+// forward-declaring an internal struct, not used publicly.
+struct grpc_slice_buffer;
+
+namespace grpc_event_engine {
+namespace experimental {
+
+// TODO(nnoble): needs implementation
+class SliceBuffer {
+ public:
+ SliceBuffer() { abort(); }
+ explicit SliceBuffer(grpc_slice_buffer*) { abort(); }
+
+ grpc_slice_buffer* RawSliceBuffer() { return slice_buffer_; }
+
+ private:
+ grpc_slice_buffer* slice_buffer_;
+};
+
+// Tracks memory allocated by one system.
+// Is effectively a thin wrapper/smart pointer for a MemoryAllocatorImpl,
+// providing a convenient and stable API.
+class MemoryAllocator {
+ public:
+ /// Construct a MemoryAllocator given an internal::MemoryAllocatorImpl
+ /// implementation. The constructed MemoryAllocator will call
+ /// MemoryAllocatorImpl::Shutdown() upon destruction.
+ explicit MemoryAllocator(
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator)
+ : allocator_(std::move(allocator)) {}
+ // Construct an invalid MemoryAllocator.
+ MemoryAllocator() : allocator_(nullptr) {}
+ ~MemoryAllocator() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ }
+
+ MemoryAllocator(const MemoryAllocator&) = delete;
+ MemoryAllocator& operator=(const MemoryAllocator&) = delete;
+
+ MemoryAllocator(MemoryAllocator&&) = default;
+ MemoryAllocator& operator=(MemoryAllocator&&) = default;
+
+ /// Drop the underlying allocator and make this an empty object.
+ /// The object will not be usable after this call unless it's a valid
+ /// allocator is moved into it.
+ void Reset() {
+ if (allocator_ != nullptr) allocator_->Shutdown();
+ allocator_.reset();
+ }
+
+ /// Reserve bytes from the quota.
+ /// If we enter overcommit, reclamation will begin concurrently.
+ /// Returns the number of bytes reserved.
+ size_t Reserve(MemoryRequest request) { return allocator_->Reserve(request); }
+
+ /// Release some bytes that were previously reserved.
+ void Release(size_t n) { return allocator_->Release(n); }
+
+ //
+ // The remainder of this type are helper functions implemented in terms of
+ // Reserve/Release.
+ //
+
+ /// An automatic releasing reservation of memory.
+ class Reservation {
+ public:
+ Reservation() = default;
+ Reservation(const Reservation&) = delete;
+ Reservation& operator=(const Reservation&) = delete;
+ Reservation(Reservation&&) = default;
+ Reservation& operator=(Reservation&&) = default;
+ ~Reservation() {
+ if (allocator_ != nullptr) allocator_->Release(size_);
+ }
+
+ private:
+ friend class MemoryAllocator;
+ Reservation(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ size_t size)
+ : allocator_(std::move(allocator)), size_(size) {}
+
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ size_t size_ = 0;
+ };
+
+ /// Reserve bytes from the quota and automatically release them when
+ /// Reservation is destroyed.
+ Reservation MakeReservation(MemoryRequest request) {
+ return Reservation(allocator_, Reserve(request));
+ }
+
+ /// Allocate a new object of type T, with constructor arguments.
+ /// The returned type is wrapped, and upon destruction the reserved memory
+ /// will be released to the allocator automatically. As such, T must have a
+ /// virtual destructor so we can insert the necessary hook.
+ template <typename T, typename... Args>
+ typename std::enable_if<std::has_virtual_destructor<T>::value, T*>::type New(
+ Args&&... args) {
+ // Wrap T such that when it's destroyed, we can release memory back to the
+ // allocator.
+ class Wrapper final : public T {
+ public:
+ explicit Wrapper(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ Args&&... args)
+ : T(std::forward<Args>(args)...), allocator_(std::move(allocator)) {}
+ ~Wrapper() override { allocator_->Release(sizeof(*this)); }
+
+ private:
+ const std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ };
+ Reserve(sizeof(Wrapper));
+ return new Wrapper(allocator_, std::forward<Args>(args)...);
+ }
+
+ /// Construct a unique_ptr immediately.
+ template <typename T, typename... Args>
+ std::unique_ptr<T> MakeUnique(Args&&... args) {
+ return std::unique_ptr<T>(New<T>(std::forward<Args>(args)...));
+ }
+
+ /// Allocate a slice, using MemoryRequest to size the number of returned
+ /// bytes. For a variable length request, check the returned slice length to
+ /// verify how much memory was allocated. Takes care of reserving memory for
+ /// any relevant control structures also.
+ grpc_slice MakeSlice(MemoryRequest request);
+
+ /// A C++ allocator for containers of T.
+ template <typename T>
+ class Container {
+ public:
+ using value_type = T;
+
+ /// Construct the allocator: \a underlying_allocator is borrowed, and must
+ /// outlive this object.
+ explicit Container(MemoryAllocator* underlying_allocator)
+ : underlying_allocator_(underlying_allocator) {}
+ template <typename U>
+ explicit Container(const Container<U>& other)
+ : underlying_allocator_(other.underlying_allocator()) {}
+
+ MemoryAllocator* underlying_allocator() const {
+ return underlying_allocator_;
+ }
+
+ T* allocate(size_t n) {
+ underlying_allocator_->Reserve(n * sizeof(T));
+ return static_cast<T*>(::operator new(n * sizeof(T)));
+ }
+ void deallocate(T* p, size_t n) {
+ ::operator delete(p);
+ underlying_allocator_->Release(n * sizeof(T));
+ }
+
+ private:
+ MemoryAllocator* underlying_allocator_;
+ };
+
+ protected:
+ /// Return a pointer to the underlying implementation.
+ /// Note that the interface of said implementation is unstable and likely to
+ /// change at any time.
+ internal::MemoryAllocatorImpl* get_internal_impl_ptr() {
+ return allocator_.get();
+ }
+
+ const internal::MemoryAllocatorImpl* get_internal_impl_ptr() const {
+ return allocator_.get();
+ }
+
+ private:
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+};
+
+// Wrapper type around std::vector to make initialization against a
+// MemoryAllocator based container allocator easy.
+template <typename T>
+class Vector : public std::vector<T, MemoryAllocator::Container<T>> {
+ public:
+ explicit Vector(MemoryAllocator* allocator)
+ : std::vector<T, MemoryAllocator::Container<T>>(
+ MemoryAllocator::Container<T>(allocator)) {}
+};
+
+class MemoryAllocatorFactory {
+ public:
+ virtual ~MemoryAllocatorFactory() = default;
+ /// On Endpoint creation, call \a CreateMemoryAllocator to create a new
+ /// allocator for the endpoint.
+ /// \a name is used to label the memory allocator in debug logs.
+ /// Typically we'll want to:
+ /// auto allocator = factory->CreateMemoryAllocator(peer_address_string);
+ /// auto* endpoint = allocator->New<MyEndpoint>(std::move(allocator), ...);
+ virtual MemoryAllocator CreateMemoryAllocator(y_absl::string_view name) = 0;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_ALLOCATOR_H
diff --git a/contrib/libs/grpc/include/grpc/event_engine/memory_request.h b/contrib/libs/grpc/include/grpc/event_engine/memory_request.h
new file mode 100644
index 00000000000..9f796fee424
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/memory_request.h
@@ -0,0 +1,57 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+#define GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "y_absl/strings/string_view.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Reservation request - how much memory do we want to allocate?
+class MemoryRequest {
+ public:
+ /// Request a fixed amount of memory.
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ MemoryRequest(size_t n) : min_(n), max_(n) {}
+ /// Request a range of memory.
+ /// Requires: \a min <= \a max.
+ /// Requires: \a max <= max_size()
+ MemoryRequest(size_t min, size_t max) : min_(min), max_(max) {}
+
+ /// Maximum allowable request size - hard coded to 1GB.
+ static constexpr size_t max_allowed_size() { return 1024 * 1024 * 1024; }
+
+ /// Increase the size by \a amount.
+ /// Undefined behavior if min() + amount or max() + amount overflows.
+ MemoryRequest Increase(size_t amount) const {
+ return MemoryRequest(min_ + amount, max_ + amount);
+ }
+
+ size_t min() const { return min_; }
+ size_t max() const { return max_; }
+
+ private:
+ size_t min_;
+ size_t max_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_EVENT_ENGINE_MEMORY_REQUEST_H
diff --git a/contrib/libs/grpc/include/grpc/event_engine/port.h b/contrib/libs/grpc/include/grpc/event_engine/port.h
new file mode 100644
index 00000000000..942458646a2
--- /dev/null
+++ b/contrib/libs/grpc/include/grpc/event_engine/port.h
@@ -0,0 +1,39 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_EVENT_ENGINE_PORT_H
+#define GRPC_EVENT_ENGINE_PORT_H
+
+#include <grpc/support/port_platform.h>
+
+// Platform-specific sockaddr includes
+#if defined(GPR_ANDROID) || defined(GPR_LINUX) || defined(GPR_APPLE) || \
+ defined(GPR_FREEBSD) || defined(GPR_OPENBSD) || defined(GPR_SOLARIS) || \
+ defined(GPR_AIX) || defined(GPR_NACL) || defined(GPR_FUCHSIA) || \
+ defined(GRPC_POSIX_SOCKET)
+#define GRPC_EVENT_ENGINE_POSIX
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#elif defined(GPR_WINDOWS)
+#include <winsock2.h>
+#include <ws2tcpip.h>
+// must be included after the above
+#include <mswsock.h>
+#else
+#error UNKNOWN PLATFORM
+#endif
+
+#endif // GRPC_EVENT_ENGINE_PORT_H
diff --git a/contrib/libs/grpc/include/grpc/fork.h b/contrib/libs/grpc/include/grpc/fork.h
index 26f9df9871b..f52cb50246a 100644
--- a/contrib/libs/grpc/include/grpc/fork.h
+++ b/contrib/libs/grpc/include/grpc/fork.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/fork.h>
+#include <grpc/impl/codegen/fork.h> // IWYU pragma: export
#endif /* GRPC_FORK_H */
diff --git a/contrib/libs/grpc/include/grpc/grpc.h b/contrib/libs/grpc/include/grpc/grpc.h
index 5a518cdbc43..c494049f72b 100644
--- a/contrib/libs/grpc/include/grpc/grpc.h
+++ b/contrib/libs/grpc/include/grpc/grpc.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
+#include <stddef.h>
#include <grpc/byte_buffer.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/propagation_bits.h>
#include <grpc/slice.h>
+#include <grpc/status.h>
#include <grpc/support/time.h>
-#include <stddef.h>
#ifdef __cplusplus
extern "C" {
@@ -118,8 +118,7 @@ GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_pluck(
of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING.
This function is experimental. */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
- void* reserved);
+ grpc_completion_queue_functor* shutdown_callback, void* reserved);
/** Create a completion queue */
GRPCAPI grpc_completion_queue* grpc_completion_queue_create(
@@ -344,6 +343,10 @@ GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call* call,
const char* description,
void* reserved);
+/* Returns whether or not the call's receive message operation failed because of
+ * an error (as opposed to a graceful end-of-stream) */
+GRPCAPI int grpc_call_failed_before_recv_message(const grpc_call* c);
+
/** Ref a call.
THREAD SAFETY: grpc_call_ref is thread-compatible */
GRPCAPI void grpc_call_ref(grpc_call* call);
@@ -414,12 +417,18 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server* server,
grpc_completion_queue* cq,
void* reserved);
+// More members might be added in later, so users should take care to memset
+// this to 0 before using it.
+typedef struct {
+ grpc_status_code code;
+ const char* error_message;
+} grpc_serving_status_update;
+
// There might be more methods added later, so users should take care to memset
// this to 0 before using it.
typedef struct {
- void (*on_serving_status_change)(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message);
+ void (*on_serving_status_update)(void* user_data, const char* uri,
+ grpc_serving_status_update update);
void* user_data;
} grpc_server_xds_status_notifier;
@@ -427,7 +436,7 @@ typedef struct grpc_server_config_fetcher grpc_server_config_fetcher;
/** EXPERIMENTAL. Creates an xDS config fetcher. */
GRPCAPI grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create(
- grpc_server_xds_status_notifier notifier);
+ grpc_server_xds_status_notifier notifier, const grpc_channel_args* args);
/** EXPERIMENTAL. Destroys a config fetcher. */
GRPCAPI void grpc_server_config_fetcher_destroy(
@@ -558,6 +567,14 @@ GRPCAPI char* grpc_channelz_get_subchannel(intptr_t subchannel_id);
is allocated and must be freed by the application. */
GRPCAPI char* grpc_channelz_get_socket(intptr_t socket_id);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Fetch a vtable for grpc_channel_arg that points to
+ * grpc_authorization_policy_provider.
+ */
+GRPCAPI const grpc_arg_pointer_vtable*
+grpc_authorization_policy_provider_arg_vtable(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/contrib/libs/grpc/include/grpc/grpc_posix.h b/contrib/libs/grpc/include/grpc/grpc_posix.h
index fbce5e13c11..4f1c8f5487c 100644
--- a/contrib/libs/grpc/include/grpc/grpc_posix.h
+++ b/contrib/libs/grpc/include/grpc/grpc_posix.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
#include <stddef.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -48,6 +48,9 @@ GRPCAPI grpc_channel* grpc_insecure_channel_create_from_fd(
grpc_server_register_completion_queue API).
The 'reserved' pointer MUST be NULL.
+
+ TODO(hork): add channel_args to this API to allow endpoints and transports
+ created in this function to participate in the resource quota feature.
*/
GRPCAPI void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
void* reserved, int fd);
diff --git a/contrib/libs/grpc/include/grpc/grpc_security.h b/contrib/libs/grpc/include/grpc/grpc_security.h
index b5dafe1bae6..48f5afe08cf 100644
--- a/contrib/libs/grpc/include/grpc/grpc_security.h
+++ b/contrib/libs/grpc/include/grpc/grpc_security.h
@@ -747,61 +747,62 @@ GRPCAPI grpc_server_credentials* grpc_local_server_credentials_create(
/** --- TLS channel/server credentials ---
* It is used for experimental purpose for now and subject to change. */
-/** Struct for indicating errors. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_error_details grpc_tls_error_details;
-
-/** Config for TLS server authorization check. It is used for
- * experimental purpose for now and subject to change. */
-typedef struct grpc_tls_server_authorization_check_config
- grpc_tls_server_authorization_check_config;
-
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that can be specified by callers to configure underlying TLS
- * behaviors. It is used for experimental purpose for now and subject to change.
+ * behaviors.
*/
typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct provides ways to gain credential data that will be used in the TLS
- * handshake. It is used for experimental purpose for now and subject to change.
+ * handshake.
*/
typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* A struct that stores the credential data presented to the peer in handshake
- * to show local identity. It is used for experimental purpose for now and
- * subject to change.
+ * to show local identity.
*/
typedef struct grpc_tls_identity_pairs grpc_tls_identity_pairs;
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_identity_pairs that stores a list of identity credential
- * data, including identity private key and identity certificate chain. It is
- * used for experimental purpose for now and subject to change.
+ * data, including identity private key and identity certificate chain.
*/
GRPCAPI grpc_tls_identity_pairs* grpc_tls_identity_pairs_create();
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Adds a identity private key and a identity certificate chain to
* grpc_tls_identity_pairs. This function will make an internal copy of
- * |private_key| and |cert_chain|. It is used for experimental purpose for now
- * and subject to change.
+ * |private_key| and |cert_chain|.
*/
GRPCAPI void grpc_tls_identity_pairs_add_pair(grpc_tls_identity_pairs* pairs,
const char* private_key,
const char* cert_chain);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Destroys a grpc_tls_identity_pairs object. If this object is passed to a
* provider initiation function, the ownership is transferred so this function
* doesn't need to be called. Otherwise the creator of the
- * grpc_tls_identity_pairs object is responsible for its destruction. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_identity_pairs object is responsible for its destruction.
*/
GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will load credential data from
* static string during initialization. This provider will always return the
* same cert data for all cert names.
@@ -809,13 +810,14 @@ GRPCAPI void grpc_tls_identity_pairs_destroy(grpc_tls_identity_pairs* pairs);
* corresponding credential data is not needed.
* This function will make a copy of |root_certificate|.
* The ownership of |pem_key_cert_pairs| is transferred.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_static_data_create(
const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a grpc_tls_certificate_provider that will watch the credential
* changes on the file system. This provider will always return the up-to-date
* cert data for all the cert names callers set through
@@ -833,7 +835,6 @@ grpc_tls_certificate_provider_static_data_create(
* - refresh_interval_sec is the refreshing interval that we will check the
* files for updates.
* It does not take ownership of parameters.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_certificate_provider*
grpc_tls_certificate_provider_file_watcher_create(
@@ -841,49 +842,34 @@ grpc_tls_certificate_provider_file_watcher_create(
const char* root_cert_path, unsigned int refresh_interval_sec);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Releases a grpc_tls_certificate_provider object. The creator of the
- * grpc_tls_certificate_provider object is responsible for its release. It is
- * used for experimental purpose for now and subject to change.
+ * grpc_tls_certificate_provider object is responsible for its release.
*/
GRPCAPI void grpc_tls_certificate_provider_release(
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates an grpc_tls_credentials_options.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI grpc_tls_credentials_options* grpc_tls_credentials_options_create(void);
/**
- * Sets the options of whether to request and verify client certs. This should
- * be called only on the server side. It is used for experimental purpose for
- * now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
- grpc_tls_credentials_options* options,
- grpc_ssl_client_certificate_request_type type);
-
-/**
- * Sets the options of whether to choose certain checks, e.g. certificate check,
- * hostname check, etc. This should be called only on the client side. If
- * |server_verification_option| is not GRPC_TLS_SERVER_VERIFICATION, use of a
- * custom authorization check (grpc_tls_server_authorization_check_config) is
- * mandatory. It is used for experimental purpose for now and subject to change.
- */
-GRPCAPI void grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option);
-
-/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the credential provider in the options.
* The |options| will implicitly take a new ref to the |provider|.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
grpc_tls_credentials_options* options,
grpc_tls_certificate_provider* provider);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the root certificates with
* name |root_cert_name|.
* If this is not set on the client side, we will use the root certificates
@@ -892,151 +878,296 @@ GRPCAPI void grpc_tls_credentials_options_set_certificate_provider(
* If this is not set on the server side, we will not watch any root certificate
* updates, and assume no root certificates needed for the server(single-side
* TLS). Default root certs on the server side is not supported.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_root_certs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the root certificates being watched.
* If not set, We will use a default empty string as the root certificate name.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_set_root_cert_name(
grpc_tls_credentials_options* options, const char* root_cert_name);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* If set, gRPC stack will keep watching the identity key-cert pairs
* with name |identity_cert_name|.
* This is required on the server side, and optional on the client side.
- * It is used for experimental purpose for now and subject to change.
*/
GRPCAPI void grpc_tls_credentials_options_watch_identity_key_cert_pairs(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Sets the name of the identity certificates being watched.
* If not set, We will use a default empty string as the identity certificate
- * name. It is used for experimental purpose for now and subject to change.
+ * name.
*/
GRPCAPI void grpc_tls_credentials_options_set_identity_cert_name(
grpc_tls_credentials_options* options, const char* identity_cert_name);
/**
- * Sets the configuration for a custom authorization check performed at the end
- * of the handshake. The |options| will implicitly take a new ref to the
- * |config|.
- * It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to request and/or verify client certs. This shall
+ * only be called on the server side.
*/
-GRPCAPI void grpc_tls_credentials_options_set_server_authorization_check_config(
+GRPCAPI void grpc_tls_credentials_options_set_cert_request_type(
grpc_tls_credentials_options* options,
- grpc_tls_server_authorization_check_config* config);
-
-/** --- TLS server authorization check config. ---
- * It is used for experimental purpose for now and subject to change. */
-
-typedef struct grpc_tls_server_authorization_check_arg
- grpc_tls_server_authorization_check_arg;
-
-/** callback function provided by gRPC used to handle the result of server
- authorization check. It is used when schedule API is implemented
- asynchronously, and serves to bring the control back to gRPC C core. It is
- used for experimental purpose for now and subject to change. */
-typedef void (*grpc_tls_on_server_authorization_check_done_cb)(
- grpc_tls_server_authorization_check_arg* arg);
-
-/** A struct containing all information necessary to schedule/cancel a server
- authorization check request.
- - cb and cb_user_data represent a gRPC-provided callback and an argument
- passed to it.
- - success will store the result of server authorization check. That is,
- if success returns a non-zero value, it means the authorization check
- passes and if returning zero, it means the check fails.
- - target_name is the name of an endpoint the channel is connecting to.
- - peer_cert represents a complete certificate chain including both
- signing and leaf certificates.
- - \a subject_alternative_names is an array of size
- \a subject_alternative_names_size consisting of pointers to strings.
- - status and error_details contain information
- about errors occurred when a server authorization check request is
- scheduled/cancelled.
- - config is a pointer to the unique
- grpc_tls_server_authorization_check_config instance that this argument
- corresponds to.
- - context is a pointer to a wrapped language implementation of this
- grpc_tls_server_authorization_check_arg instance.
- - destroy_context is a pointer to a caller-provided method that cleans
- up any data associated with the context pointer.
- It is used for experimental purpose for now and subject to change.
-*/
-struct grpc_tls_server_authorization_check_arg {
- grpc_tls_on_server_authorization_check_done_cb cb;
- void* cb_user_data;
- int success;
+ grpc_ssl_client_certificate_request_type type);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to verify server certs on the client side.
+ * Passing in a non-zero value indicates verifying the certs.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_verify_server_cert(
+ grpc_tls_credentials_options* options, int verify_server_cert);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The read-only request information exposed in a verification call.
+ * Callers should not directly manage the ownership of it. We will make sure it
+ * is always available inside verify() or cancel() call, and will destroy the
+ * object at the end of custom verification.
+ */
+typedef struct grpc_tls_custom_verification_check_request {
+ /* The target name of the server when the client initiates the connection. */
+ /* This field will be nullptr if on the server side. */
const char* target_name;
- const char* peer_cert;
- const char* peer_cert_full_chain;
- char** subject_alternative_names;
- size_t subject_alternative_names_size;
- grpc_status_code status;
- grpc_tls_error_details* error_details;
- grpc_tls_server_authorization_check_config* config;
- void* context;
- void (*destroy_context)(void* ctx);
-};
-
-/** Create a grpc_tls_server_authorization_check_config instance.
- - config_user_data is config-specific, read-only user data
- that works for all channels created with a credential using the config.
- - schedule is a pointer to an application-provided callback used to invoke
- server authorization check API. The implementation of this method has to
- be non-blocking, but can be performed synchronously or asynchronously.
- 1)If processing occurs synchronously, it populates arg->result,
- arg->status, and arg->error_details and returns zero.
- 2) If processing occurs asynchronously, it returns a non-zero value. The
- application then invokes arg->cb when processing is completed. Note that
- arg->cb cannot be invoked before schedule API returns.
- - cancel is a pointer to an application-provided callback used to cancel a
- server authorization check request scheduled via an asynchronous schedule
- API. arg is used to pinpoint an exact check request to be cancelled. The
- operation may not have any effect if the request has already been
- processed.
- - destruct is a pointer to an application-provided callback used to clean up
- any data associated with the config.
- It is used for experimental purpose for now and subject to change.
-*/
-GRPCAPI grpc_tls_server_authorization_check_config*
-grpc_tls_server_authorization_check_config_create(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data));
+ /* The information contained in the certificate chain sent from the peer. */
+ struct peer_info {
+ /* The Common Name field on the peer leaf certificate. */
+ const char* common_name;
+ /* The list of Subject Alternative Names on the peer leaf certificate. */
+ struct san_names {
+ char** uri_names;
+ size_t uri_names_size;
+ char** dns_names;
+ size_t dns_names_size;
+ char** email_names;
+ size_t email_names_size;
+ char** ip_names;
+ size_t ip_names_size;
+ } san_names;
+ /* The raw peer leaf certificate. */
+ const char* peer_cert;
+ /* The raw peer certificate chain. Note that it is not always guaranteed to
+ * get the peer full chain. For more, please refer to
+ * GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME defined in file
+ * grpc_security_constants.h.
+ * TODO(ZhenLian): Consider fixing this in the future. */
+ const char* peer_cert_full_chain;
+ } peer_info;
+} grpc_tls_custom_verification_check_request;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A callback function provided by gRPC as a parameter of the |verify| function
+ * in grpc_tls_certificate_verifier_external. If |verify| is expected to be run
+ * asynchronously, the implementer of |verify| will need to invoke this callback
+ * with |callback_arg| and proper verification status at the end to bring the
+ * control back to gRPC C core.
+ */
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * The internal verifier type that will be used inside core.
+ */
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * A struct containing all the necessary functions a custom external verifier
+ * needs to implement to be able to be converted to an internal verifier.
+ */
+typedef struct grpc_tls_certificate_verifier_external {
+ void* user_data;
+ /**
+ * A function pointer containing the verification logic that will be
+ * performed after the TLS handshake is done. It could be processed
+ * synchronously or asynchronously.
+ * - If expected to be processed synchronously, the implementer should
+ * populate the verification result through |sync_status| and
+ * |sync_error_details|, and then return true.
+ * - If expected to be processed asynchronously, the implementer should return
+ * false immediately, and then in the asynchronous thread invoke |callback|
+ * with the verification result. The implementer MUST NOT invoke the async
+ * |callback| in the same thread before |verify| returns, otherwise it can
+ * lead to deadlocks.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer.
+ * callback: the callback that the function implementer needs to invoke, if
+ * return a non-zero value. It is usually invoked when the
+ * asynchronous verification is done, and serves to bring the
+ * control back to gRPC.
+ * callback_arg: A pointer to the internal ExternalVerifier instance. This is
+ * mainly used as an argument in |callback|, if want to invoke
+ * |callback| in async mode.
+ * sync_status: indicates if a connection should be allowed. This should only
+ * be used if the verification check is done synchronously.
+ * sync_error_details: the error generated while verifying a connection. This
+ * should only be used if the verification check is done
+ * synchronously. the implementation must allocate the
+ * error string via gpr_malloc() or gpr_strdup().
+ * return: return 0 if |verify| is expected to be executed asynchronously,
+ * otherwise return a non-zero value.
+ */
+ int (*verify)(void* user_data,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+ /**
+ * A function pointer that cleans up the caller-specified resources when the
+ * verifier is still running but the whole connection got cancelled. This
+ * could happen when the verifier is doing some async operations, and the
+ * whole handshaker object got destroyed because of connection time limit is
+ * reached, or any other reasons. In such cases, function implementers might
+ * want to be notified, and properly clean up some resources.
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ * request: request information exposed to the function implementer. It will
+ * be the same request object that was passed to verify(), and it
+ * tells the cancel() which request to cancel.
+ */
+ void (*cancel)(void* user_data,
+ grpc_tls_custom_verification_check_request* request);
+ /**
+ * A function pointer that does some additional destruction work when the
+ * verifier is destroyed. This is used when the caller wants to associate some
+ * objects to the lifetime of external_verifier, and destroy them when
+ * external_verifier got destructed. For example, in C++, the class containing
+ * user-specified callback functions should not be destroyed before
+ * external_verifier, since external_verifier will invoke them while being
+ * used.
+ * Note that the caller MUST delete the grpc_tls_certificate_verifier_external
+ * object itself in this function, otherwise it will cause memory leaks. That
+ * also means the user_data has to carries at least a self pointer, for the
+ * callers to later delete it in destruct().
+ *
+ * user_data: any argument that is passed in the user_data of
+ * grpc_tls_certificate_verifier_external during construction time
+ * can be retrieved later here.
+ */
+ void (*destruct)(void* user_data);
+} grpc_tls_certificate_verifier_external;
/**
- * Releases a grpc_tls_server_authorization_check_config object. The creator of
- * the grpc_tls_server_authorization_check_config object is responsible for its
- * release. It is used for experimental purpose for now and subject to change.
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Converts an external verifier to an internal verifier.
+ * Note that we will not take the ownership of the external_verifier. Callers
+ * will need to delete external_verifier in its own destruct function.
*/
-GRPCAPI void grpc_tls_server_authorization_check_config_release(
- grpc_tls_server_authorization_check_config* config);
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Factory function for an internal verifier that will do the default hostname
+ * check.
+ */
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_host_name_create();
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Releases a grpc_tls_certificate_verifier object. The creator of the
+ * grpc_tls_certificate_verifier object is responsible for its release.
+ */
+void grpc_tls_certificate_verifier_release(
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the verifier in options. The |options| will implicitly take a new ref to
+ * the |verifier|. If not set on the client side, we will verify server's
+ * certificates, and check the default hostname. If not set on the server side,
+ * we will verify client's certificates.
+ */
+void grpc_tls_credentials_options_set_certificate_verifier(
+ grpc_tls_credentials_options* options,
+ grpc_tls_certificate_verifier* verifier);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Sets the options of whether to check the hostname of the peer on a per-call
+ * basis. This is usually used in a combination with virtual hosting at the
+ * client side, where each individual call on a channel can have a different
+ * host associated with it.
+ * This check is intended to verify that the host specified for the individual
+ * call is covered by the cert that the peer presented.
+ * The default is a non-zero value, which indicates performing such checks.
+ */
+GRPCAPI void grpc_tls_credentials_options_set_check_call_host(
+ grpc_tls_credentials_options* options, int check_call_host);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the verification logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
+ * If |grpc_tls_certificate_verifier_verify| returns true, inspect the
+ * verification result through request->status and request->error_details.
+ * Otherwise, inspect through the parameter of |callback|.
+ */
+int grpc_tls_certificate_verifier_verify(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
+ * Performs the cancellation logic of an internal verifier.
+ * This is typically used when composing the internal verifiers as part of the
+ * custom verification.
+ */
+void grpc_tls_certificate_verifier_cancel(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request);
+
+/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS channel credential object based on the
* grpc_tls_credentials_options specified by callers. The
* grpc_channel_credentials will take the ownership of the |options|. The
- * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY. It
- * is used for experimental purpose for now and subject to change.
+ * security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.
*/
grpc_channel_credentials* grpc_tls_credentials_create(
grpc_tls_credentials_options* options);
/**
+ * EXPERIMENTAL API - Subject to change
+ *
* Creates a TLS server credential object based on the
* grpc_tls_credentials_options specified by callers. The
- * grpc_server_credentials will take the ownership of the |options|. It
- * is used for experimental purpose for now and subject to change.
+ * grpc_server_credentials will take the ownership of the |options|.
*/
grpc_server_credentials* grpc_tls_server_credentials_create(
grpc_tls_credentials_options* options);
@@ -1085,6 +1216,56 @@ GRPCAPI grpc_channel_credentials* grpc_xds_credentials_create(
GRPCAPI grpc_server_credentials* grpc_xds_server_credentials_create(
grpc_server_credentials* fallback_credentials);
+/**
+ * EXPERIMENTAL - Subject to change.
+ * An opaque type that is responsible for providing authorization policies to
+ * gRPC.
+ */
+typedef struct grpc_authorization_policy_provider
+ grpc_authorization_policy_provider;
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider using SDK authorization policy
+ * from static string.
+ * - authz_policy is the input SDK authorization policy.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_static_data_create(
+ const char* authz_policy, grpc_status_code* code,
+ const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Creates a grpc_authorization_policy_provider by watching for SDK
+ * authorization policy changes in filesystem.
+ * - authz_policy is the file path of SDK authorization policy.
+ * - refresh_interval_sec is the amount of time the internal thread would wait
+ * before checking for file updates.
+ * - code is the error status code on failure. On success, it equals
+ * GRPC_STATUS_OK.
+ * - error_details contains details about the error if any. If the
+ * initialization is successful, it will be null. Caller must use gpr_free to
+ * destroy this string.
+ */
+GRPCAPI grpc_authorization_policy_provider*
+grpc_authorization_policy_provider_file_watcher_create(
+ const char* authz_policy_path, unsigned int refresh_interval_sec,
+ grpc_status_code* code, const char** error_details);
+
+/**
+ * EXPERIMENTAL - Subject to change.
+ * Releases grpc_authorization_policy_provider object. The creator of
+ * grpc_authorization_policy_provider is responsible for its release.
+ */
+GRPCAPI void grpc_authorization_policy_provider_release(
+ grpc_authorization_policy_provider* provider);
+
#ifdef __cplusplus
}
#endif
diff --git a/contrib/libs/grpc/include/grpc/grpc_security_constants.h b/contrib/libs/grpc/include/grpc/grpc_security_constants.h
index a62f76753b9..505037ed204 100644
--- a/contrib/libs/grpc/include/grpc/grpc_security_constants.h
+++ b/contrib/libs/grpc/include/grpc/grpc_security_constants.h
@@ -25,14 +25,31 @@ extern "C" {
#define GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME "transport_security_type"
#define GRPC_SSL_TRANSPORT_SECURITY_TYPE "ssl"
+#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
#define GRPC_X509_CN_PROPERTY_NAME "x509_common_name"
+#define GRPC_X509_SUBJECT_PROPERTY_NAME "x509_subject"
#define GRPC_X509_SAN_PROPERTY_NAME "x509_subject_alternative_name"
#define GRPC_X509_PEM_CERT_PROPERTY_NAME "x509_pem_cert"
+// Please note that internally, we just faithfully pass whatever value we got by
+// calling SSL_get_peer_cert_chain() in OpenSSL/BoringSSL. This will mean in
+// OpenSSL, the following conditions might apply:
+// 1. On the client side, this property returns the full certificate chain. On
+// the server side, this property will return the certificate chain without the
+// leaf certificate. Application can use GRPC_X509_PEM_CERT_PROPERTY_NAME to
+// get the peer leaf certificate.
+// 2. If the session is resumed, this property could be empty for OpenSSL (but
+// not for BoringSSL).
+// For more, please refer to the official OpenSSL manual:
+// https://www.openssl.org/docs/man1.1.0/man3/SSL_get_peer_cert_chain.html.
#define GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME "x509_pem_cert_chain"
#define GRPC_SSL_SESSION_REUSED_PROPERTY "ssl_session_reused"
#define GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME "security_level"
+#define GRPC_PEER_DNS_PROPERTY_NAME "peer_dns"
#define GRPC_PEER_SPIFFE_ID_PROPERTY_NAME "peer_spiffe_id"
+#define GRPC_PEER_URI_PROPERTY_NAME "peer_uri"
+#define GRPC_PEER_EMAIL_PROPERTY_NAME "peer_email"
+#define GRPC_PEER_IP_PROPERTY_NAME "peer_ip"
/** Environment variable that points to the default SSL roots file. This file
must be a PEM encoded file with all the roots such as the one that can be
@@ -119,20 +136,6 @@ typedef enum {
GRPC_SECURITY_MAX = GRPC_PRIVACY_AND_INTEGRITY,
} grpc_security_level;
-typedef enum {
- /** Default option: performs server certificate verification and hostname
- verification. */
- GRPC_TLS_SERVER_VERIFICATION,
- /** Performs server certificate verification, but skips hostname verification
- Client is responsible for verifying server's identity via
- server authorization check callback. */
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION,
- /** Skips both server certificate and hostname verification.
- Client is responsible for verifying server's identity and
- server's certificate via server authorization check callback. */
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION
-} grpc_tls_server_verification_option;
-
/**
* Type of local connections for which local channel/server credentials will be
* applied. It supports UDS and local TCP connections.
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/atm.h b/contrib/libs/grpc/include/grpc/impl/codegen/atm.h
index 00d83f0604f..606369a25fc 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/atm.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/atm.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_H
#define GRPC_IMPL_CODEGEN_ATM_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** This interface provides atomic operations and barriers.
It is internal to gpr support code and should not be used outside it.
@@ -70,11 +72,11 @@
#include <grpc/impl/codegen/port_platform.h>
#if defined(GPR_GCC_ATOMIC)
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#elif defined(GPR_GCC_SYNC)
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS_ATOMIC)
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#else
#error could not determine platform for atm
#endif
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h b/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
index 58797085482..05d6e42cecd 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_atomic.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_ATOMIC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* atm_platform.h for gcc and gcc-like compilers with the
__atomic_* interface. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_sync.h b/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
index 728c3d5412f..bdc7a172bc8 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/atm_gcc_sync.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
#define GRPC_IMPL_CODEGEN_ATM_GCC_SYNC_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/* variant of atm_platform.h for gcc and gcc-like compiers with __sync_*
interface */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/atm_windows.h b/contrib/libs/grpc/include/grpc/impl/codegen/atm_windows.h
index 36c76ab6721..816c9a9c643 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/atm_windows.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/atm_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
#define GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/atm.h>
+
/** Win32 variant of atm_platform.h */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer.h b/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer.h
index 04137292ff6..eeec56c1db0 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_H
+// IWYU pragma: private, include <grpc/byte_buffer.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer_reader.h b/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
index e06e19558a1..35b8ee70c6a 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/byte_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
#define GRPC_IMPL_CODEGEN_BYTE_BUFFER_READER_H
+// IWYU pragma: private, include <grpc/byte_buffer_reader.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/compression_types.h b/contrib/libs/grpc/include/grpc/impl/codegen/compression_types.h
index f778b005b9b..129310eae8d 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/compression_types.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/compression_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
#define GRPC_IMPL_CODEGEN_COMPRESSION_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/connectivity_state.h b/contrib/libs/grpc/include/grpc/impl/codegen/connectivity_state.h
index b70dbef3564..52084da4cd8 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/connectivity_state.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/connectivity_state.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
#define GRPC_IMPL_CODEGEN_CONNECTIVITY_STATE_H
+// IWYU pragma: private
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/fork.h b/contrib/libs/grpc/include/grpc/impl/codegen/fork.h
index 555df3490f0..6818b530154 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/fork.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/fork.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_FORK_H
#define GRPC_IMPL_CODEGEN_FORK_H
+// IWYU pragma: private, include <grpc/fork.h>
+
/**
* gRPC applications should call this before calling fork(). There should be no
* active gRPC function calls between calling grpc_prefork() and
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/gpr_slice.h b/contrib/libs/grpc/include/grpc/impl/codegen/gpr_slice.h
index 89fa72d5fc9..8782ba3f8da 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/gpr_slice.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/gpr_slice.h
@@ -18,6 +18,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_SLICE_H
#define GRPC_IMPL_CODEGEN_GPR_SLICE_H
+// IWYU pragma: private
+
/** WARNING: Please do not use this header. This was added as a temporary
* measure to not break some of the external projects that depend on
* gpr_slice_* functions. We are actively working on moving all the
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/gpr_types.h b/contrib/libs/grpc/include/grpc/impl/codegen/gpr_types.h
index 6daf3398619..415bf7a9da1 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/gpr_types.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/gpr_types.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_GPR_TYPES_H
#define GRPC_IMPL_CODEGEN_GPR_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/grpc_types.h b/contrib/libs/grpc/include/grpc/impl/codegen/grpc_types.h
index d67a9e97458..97ca3e4c2c4 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/grpc_types.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/grpc_types.h
@@ -19,15 +19,17 @@
#ifndef GRPC_IMPL_CODEGEN_GRPC_TYPES_H
#define GRPC_IMPL_CODEGEN_GRPC_TYPES_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
+#include <stddef.h>
+
#include <grpc/impl/codegen/compression_types.h>
#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/impl/codegen/slice.h>
#include <grpc/impl/codegen/status.h>
-#include <stddef.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -55,9 +57,6 @@ typedef struct grpc_byte_buffer {
* asynchronous actions. */
typedef struct grpc_completion_queue grpc_completion_queue;
-/** An alarm associated with a completion queue. */
-typedef struct grpc_alarm grpc_alarm;
-
/** The Channel interface allows creation of Call objects. */
typedef struct grpc_channel grpc_channel;
@@ -353,6 +352,17 @@ typedef struct {
/* Timeout in milliseconds to use for calls to the grpclb load balancer.
If 0 or unset, the balancer calls will have no deadline. */
#define GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS "grpc.grpclb_call_timeout_ms"
+/* Specifies the xDS bootstrap config as a JSON string.
+ FOR TESTING PURPOSES ONLY -- DO NOT USE IN PRODUCTION.
+ This option allows controlling the bootstrap configuration on a
+ per-channel basis, which is useful in tests. However, this results
+ in having a separate xDS client instance per channel rather than
+ using the global instance, which is not the intended way to use xDS.
+ Currently, this will (a) add unnecessary load on the xDS server and
+ (b) break use of CSDS, and there may be additional side effects in
+ the future. */
+#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG \
+ "grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config"
/* Timeout in milliseconds to wait for the serverlist from the grpclb load
balancer before using fallback backend addresses from the resolver.
If 0, enter fallback mode immediately. Default value is 10000. */
@@ -373,12 +383,26 @@ typedef struct {
Defaults to "blend". In the current implementation "blend" is equivalent to
"latency". */
#define GRPC_ARG_OPTIMIZATION_TARGET "grpc.optimization_target"
-/** If set to zero, disables retry behavior. Otherwise, transparent retries
- are enabled for all RPCs, and configurable retries are enabled when they
- are configured via the service config. For details, see:
+/** Enables retry functionality. Defaults to true. When enabled,
+ configurable retries are enabled when they are configured via the
+ service config. For details, see:
https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ NOTE: Transparent retries are not yet implemented. When they are
+ implemented, they will also be enabled by this arg.
+ NOTE: Hedging functionality is not yet implemented, so those
+ fields in the service config will currently be ignored. See
+ also the GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING arg below.
*/
#define GRPC_ARG_ENABLE_RETRIES "grpc.enable_retries"
+/** Enables hedging functionality, as described in:
+ https://github.com/grpc/proposal/blob/master/A6-client-retries.md
+ Default is currently false, since this functionality is not yet
+ fully implemented.
+ NOTE: This channel arg is experimental and will eventually be removed.
+ Once hedging functionality has been implemented and proves stable,
+ this arg will be removed, and the hedging functionality will
+ be enabled via the GRPC_ARG_ENABLE_RETRIES arg above. */
+#define GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING "grpc.experimental.enable_hedging"
/** Per-RPC retry buffer size, in bytes. Default is 256 KiB. */
#define GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE "grpc.per_rpc_retry_buffer_size"
/** Channel arg that carries the bridged objective c object for custom metrics
@@ -417,6 +441,10 @@ typedef struct {
#define GRPC_ARG_CHANNEL_POOL_DOMAIN "grpc.channel_pooling_domain"
/** gRPC Objective-C channel pooling id. */
#define GRPC_ARG_CHANNEL_ID "grpc.channel_id"
+/** Channel argument for grpc_authorization_policy_provider. If present, enables
+ gRPC authorization check. */
+#define GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER \
+ "grpc.authorization_policy_provider"
/** \} */
/** Result of a grpc call. If the caller satisfies the prerequisites of a
@@ -480,6 +508,7 @@ typedef enum grpc_call_error {
(GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_THROUGH)
/** Initial metadata flags */
+/** These flags are to be passed to the `grpc_op::flags` field */
/** Signal that the call is idempotent */
#define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u)
/** Signal that the call should not return UNAVAILABLE before it has started */
@@ -507,8 +536,6 @@ typedef struct grpc_metadata {
grpc_slice key;
grpc_slice value;
- uint32_t flags;
-
/** The following fields are reserved for grpc internal use.
There is no need to initialize them, and they will be set to garbage
during calls to grpc. */
@@ -731,21 +758,20 @@ typedef enum {
/** Events are popped out by calling grpc_completion_queue_pluck() API ONLY*/
GRPC_CQ_PLUCK,
- /** EXPERIMENTAL: Events trigger a callback specified as the tag */
+ /** Events trigger a callback specified as the tag */
GRPC_CQ_CALLBACK
} grpc_cq_completion_type;
-/** EXPERIMENTAL: Specifies an interface class to be used as a tag
- for callback-based completion queues. This can be used directly,
- as the first element of a struct in C, or as a base class in C++.
- Its "run" value should be assigned to some non-member function, such as
- a static method. */
-typedef struct grpc_experimental_completion_queue_functor {
+/** Specifies an interface class to be used as a tag for callback-based
+ * completion queues. This can be used directly, as the first element of a
+ * struct in C, or as a base class in C++. Its "run" value should be assigned to
+ * some non-member function, such as a static method. */
+typedef struct grpc_completion_queue_functor {
/** The run member specifies a function that will be called when this
tag is extracted from the completion queue. Its arguments will be a
pointer to this functor and a boolean that indicates whether the
operation succeeded (non-zero) or failed (zero) */
- void (*functor_run)(struct grpc_experimental_completion_queue_functor*, int);
+ void (*functor_run)(struct grpc_completion_queue_functor*, int);
/** The inlineable member specifies whether this functor can be run inline.
This should only be used for trivial internally-defined functors. */
@@ -753,10 +779,8 @@ typedef struct grpc_experimental_completion_queue_functor {
/** The following fields are not API. They are meant for internal use. */
int internal_success;
- struct grpc_experimental_completion_queue_functor* internal_next;
-} grpc_experimental_completion_queue_functor;
-
-/* The upgrade to version 2 is currently experimental. */
+ struct grpc_completion_queue_functor* internal_next;
+} grpc_completion_queue_functor;
#define GRPC_CQ_CURRENT_VERSION 2
#define GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE 2
@@ -771,10 +795,10 @@ typedef struct grpc_completion_queue_attributes {
/* END OF VERSION 1 CQ ATTRIBUTES */
- /* EXPERIMENTAL: START OF VERSION 2 CQ ATTRIBUTES */
+ /* START OF VERSION 2 CQ ATTRIBUTES */
/** When creating a callbackable CQ, pass in a functor to get invoked when
* shutdown is complete */
- grpc_experimental_completion_queue_functor* cq_shutdown_cb;
+ grpc_completion_queue_functor* cq_shutdown_cb;
/* END OF VERSION 2 CQ ATTRIBUTES */
} grpc_completion_queue_attributes;
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/log.h b/contrib/libs/grpc/include/grpc/impl/codegen/log.h
index 9dd3a518347..1d5d2da200d 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/log.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/log.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_LOG_H
#define GRPC_IMPL_CODEGEN_LOG_H
+// IWYU pragma: private, include <grpc/support/log.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stdarg.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/port_platform.h b/contrib/libs/grpc/include/grpc/impl/codegen/port_platform.h
index cd0310d88ca..f68b16463f2 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/port_platform.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/port_platform.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
#define GRPC_IMPL_CODEGEN_PORT_PLATFORM_H
+// IWYU pragma: private, include <grpc/support/port_platform.h>
+
/*
* Define GPR_BACKWARDS_COMPATIBILITY_MODE to try harder to be ABI
* compatible with older platforms (currently only on Linux)
@@ -27,6 +29,13 @@
* - some syscalls to be made directly
*/
+// [[deprecated]] attribute is only available since C++14
+#if __cplusplus >= 201402L
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif // __cplusplus >= 201402L
+
/*
* Defines GPR_ABSEIL_SYNC to use synchronization features from Abseil
*/
@@ -39,6 +48,11 @@
#endif
#endif // GPR_ABSEIL_SYNC
+/*
+ * Defines GRPC_ERROR_IS_ABSEIL_STATUS to use y_absl::Status for grpc_error_handle
+ */
+// #define GRPC_ERROR_IS_ABSEIL_STATUS 1
+
/* Get windows.h included everywhere (we need it) */
#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
#ifndef WIN32_LEAN_AND_MEAN
@@ -109,10 +123,18 @@
#else
#define GPR_WINDOWS_ATOMIC 1
#endif
-#define GPR_STDCPP_TLS 1
#elif defined(ANDROID) || defined(__ANDROID__)
#define GPR_PLATFORM_STRING "android"
#define GPR_ANDROID 1
+#ifndef __ANDROID_API__
+#error "__ANDROID_API__ must be defined for Android builds."
+#endif
+#if __ANDROID_API__ < 21
+#error "Requires Android API v21 and above"
+#endif
+#if (__ANDROID_API__) >= 23
+#define GPR_SUPPORT_BINDER_TRANSPORT 1
+#endif
// TODO(apolcyn): re-evaluate support for c-ares
// on android after upgrading our c-ares dependency.
// See https://github.com/grpc/grpc/issues/18038.
@@ -124,7 +146,6 @@
#endif /* _LP64 */
#define GPR_CPU_POSIX 1
#define GPR_GCC_SYNC 1
-#define GPR_STDCPP_TLS 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
#define GPR_POSIX_STAT 1
@@ -150,7 +171,6 @@
#include <features.h>
#define GPR_CPU_LINUX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_STDCPP_TLS 1
#define GPR_LINUX 1
#define GPR_LINUX_LOG
#define GPR_SUPPORT_CHANNELS_FROM_FD 1
@@ -170,7 +190,14 @@
#endif /* _LP64 */
#ifdef __GLIBC__
#define GPR_POSIX_CRASH_HANDLER 1
+#ifdef __GLIBC_PREREQ
+#if __GLIBC_PREREQ(2, 12)
#define GPR_LINUX_PTHREAD_NAME 1
+#endif
+#else
+// musl libc & others
+#define GPR_LINUX_PTHREAD_NAME 1
+#endif
#include <linux/version.h>
#else /* musl libc */
#define GPR_MUSL_LIBC_COMPAT 1
@@ -178,7 +205,6 @@
#elif defined(__ASYLO__)
#define GPR_ARCH_64 1
#define GPR_CPU_POSIX 1
-#define GPR_GCC_TLS 1
#define GPR_PLATFORM_STRING "asylo"
#define GPR_GCC_SYNC 1
#define GPR_POSIX_SYNC 1
@@ -212,12 +238,7 @@
#define GPR_CPU_POSIX 1
#define GPR_POSIX_CRASH_HANDLER 1
#endif
-#ifdef __has_feature
-#if __has_feature(cxx_thread_local)
-#define GPR_STDCPP_TLS 1
-#endif
-#endif
-#ifndef GPR_STDCPP_TLS
+#if !(defined(__has_feature) && __has_feature(cxx_thread_local))
#define GPR_PTHREAD_TLS 1
#endif
#define GPR_APPLE 1
@@ -248,7 +269,6 @@
#define GPR_FREEBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -273,7 +293,6 @@
#define GPR_OPENBSD 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -295,7 +314,6 @@
#define GPR_SOLARIS 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -319,7 +337,6 @@
#define GPR_AIX 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -349,7 +366,6 @@
#define GPR_NACL 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_GCC_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_ENV 1
#define GPR_POSIX_TMPFILE 1
@@ -376,7 +392,6 @@
#define GPR_MUSL_LIBC_COMPAT 1
#define GPR_CPU_POSIX 1
#define GPR_GCC_ATOMIC 1
-#define GPR_PTHREAD_TLS 1
#define GPR_POSIX_LOG 1
#define GPR_POSIX_SYNC 1
#define GPR_POSIX_ENV 1
@@ -493,12 +508,6 @@ typedef unsigned __int64 uint64_t;
#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
#endif
-#if defined(GPR_MSVC_TLS) + defined(GPR_GCC_TLS) + defined(GPR_PTHREAD_TLS) + \
- defined(GPR_STDCPP_TLS) + defined(GPR_CUSTOM_TLS) != \
- 1
-#error Must define exactly one of GPR_MSVC_TLS, GPR_GCC_TLS, GPR_PTHREAD_TLS, GPR_STDCPP_TLS, GPR_CUSTOM_TLS
-#endif
-
/* maximum alignment needed for any type on this platform, rounded up to a
power of two */
#define GPR_MAX_ALIGNMENT 16
@@ -561,6 +570,14 @@ typedef unsigned __int64 uint64_t;
#define CENSUSAPI GRPCAPI
#endif
+#ifndef GPR_HAS_CPP_ATTRIBUTE
+#ifdef __has_cpp_attribute
+#define GPR_HAS_CPP_ATTRIBUTE(a) __has_cpp_attribute(a)
+#else
+#define GPR_HAS_CPP_ATTRIBUTE(a) 0
+#endif
+#endif /* GPR_HAS_CPP_ATTRIBUTE */
+
#ifndef GPR_HAS_ATTRIBUTE
#ifdef __has_attribute
#define GPR_HAS_ATTRIBUTE(a) __has_attribute(a)
@@ -586,6 +603,22 @@ typedef unsigned __int64 uint64_t;
#endif
#endif /* GPR_ATTRIBUTE_NOINLINE */
+#ifndef GPR_NO_UNIQUE_ADDRESS
+#if GPR_HAS_CPP_ATTRIBUTE(no_unique_address)
+#define GPR_NO_UNIQUE_ADDRESS [[no_unique_address]]
+#else
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif /* GPR_NO_UNIQUE_ADDRESS */
+
+#ifndef GRPC_DEPRECATED
+#if GPR_HAS_CPP_ATTRIBUTE(deprecated)
+#define GRPC_DEPRECATED(reason) [[deprecated(reason)]]
+#else
+#define GRPC_DEPRECATED(reason)
+#endif
+#endif /* GRPC_DEPRECATED */
+
#ifndef GPR_ATTRIBUTE_WEAK
/* Attribute weak is broken on LLVM/windows:
* https://bugs.llvm.org/show_bug.cgi?id=37598 */
@@ -659,4 +692,32 @@ typedef unsigned __int64 uint64_t;
#define __STDC_FORMAT_MACROS
#endif
+/* Selectively enable EventEngine on specific platforms. This default can be
+ * overridden using the GRPC_USE_EVENT_ENGINE compiler flag.
+ */
+#ifndef GRPC_USE_EVENT_ENGINE
+/* Not enabled by default on any platforms yet. (2021.06) */
+#elif GRPC_USE_EVENT_ENGINE == 0
+/* Building with `-DGRPC_USE_EVENT_ENGINE=0` will override the default. */
+#undef GRPC_USE_EVENT_ENGINE
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#undef GPR_SUPPORT_CHANNELS_FROM_FD
+#define GRPC_ARES 0
+#endif /* GRPC_USE_EVENT_ENGINE */
+
+#define GRPC_CALLBACK_API_NONEXPERIMENTAL
+
+/* clang 11 with msan miscompiles destruction of [[no_unique_address]] members
+ * of zero size - for a repro see:
+ * test/core/compiler_bugs/miscompile_with_no_unique_address_test.cc
+ */
+#ifdef __clang__
+#if __clang__ && __clang_major__ <= 11 && __has_feature(memory_sanitizer)
+#undef GPR_NO_UNIQUE_ADDRESS
+#define GPR_NO_UNIQUE_ADDRESS
+#endif
+#endif
+
#endif /* GRPC_IMPL_CODEGEN_PORT_PLATFORM_H */
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/propagation_bits.h b/contrib/libs/grpc/include/grpc/impl/codegen/propagation_bits.h
index 824bdbd8c9b..d7020998d94 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/propagation_bits.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/propagation_bits.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
#define GRPC_IMPL_CODEGEN_PROPAGATION_BITS_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/slice.h b/contrib/libs/grpc/include/grpc/impl/codegen/slice.h
index 3567b1e88b3..4412058104e 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/slice.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/slice.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SLICE_H
#define GRPC_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpc/slice.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <stddef.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/status.h b/contrib/libs/grpc/include/grpc/impl/codegen/status.h
index dec3b8f340e..2b18f6d952c 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/status.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_STATUS_H
#define GRPC_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpc/status.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync.h
index 49e3194748f..1b30ea7551d 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_H
#define GRPC_IMPL_CODEGEN_SYNC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/** Synchronization primitives for GPR.
The type gpr_mu provides a non-reentrant mutex (lock).
@@ -44,16 +47,16 @@ extern "C" {
/* Platform-specific type declarations of gpr_mu and gpr_cv. */
#include <grpc/impl/codegen/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#if defined(GPR_CUSTOM_SYNC)
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#elif defined(GPR_ABSEIL_SYNC)
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#elif defined(GPR_POSIX_SYNC)
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#elif defined(GPR_WINDOWS)
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#else
#error Unable to determine platform for sync
#endif
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync_abseil.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync_abseil.h
index 38dfab32737..92b31697fd0 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync_abseil.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync_abseil.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
#define GRPC_IMPL_CODEGEN_SYNC_ABSEIL_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync_custom.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync_custom.h
index 69b1bf6cd19..ec0d6728e87 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync_custom.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync_custom.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
#define GRPC_IMPL_CODEGEN_SYNC_CUSTOM_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/sync_generic.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync_generic.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync_generic.h
index eabdc513f48..a79b9c648b2 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync_generic.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync_generic.h
@@ -18,6 +18,9 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
#define GRPC_IMPL_CODEGEN_SYNC_GENERIC_H
+
+// IWYU pragma: private, include <grpc/support/sync.h>
+
/* Generic type definitions for gpr_sync. */
#include <grpc/impl/codegen/port_platform.h>
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync_posix.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync_posix.h
index 2aec3a3f8d6..f5cf482c71c 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync_posix.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync_posix.h
@@ -19,12 +19,14 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_POSIX_H
#define GRPC_IMPL_CODEGEN_SYNC_POSIX_H
-#include <grpc/impl/codegen/port_platform.h>
+// IWYU pragma: private, include <grpc/support/sync.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/port_platform.h>
#include <pthread.h>
+#include <grpc/impl/codegen/sync_generic.h>
+
#ifdef GRPC_ASAN_ENABLED
/* The member |leak_checker| is used to check whether there is a memory leak
* caused by upper layer logic that's missing the |gpr_xx_destroy| call
diff --git a/contrib/libs/grpc/include/grpc/impl/codegen/sync_windows.h b/contrib/libs/grpc/include/grpc/impl/codegen/sync_windows.h
index f2ff83b303d..2bee03b653f 100644
--- a/contrib/libs/grpc/include/grpc/impl/codegen/sync_windows.h
+++ b/contrib/libs/grpc/include/grpc/impl/codegen/sync_windows.h
@@ -19,6 +19,8 @@
#ifndef GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
#define GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
+// IWYU pragma: private, include <grpc/support/sync.h>
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_WINDOWS
diff --git a/contrib/libs/grpc/include/grpc/module.modulemap b/contrib/libs/grpc/include/grpc/module.modulemap
index 06c1e977361..40606e5601d 100644
--- a/contrib/libs/grpc/include/grpc/module.modulemap
+++ b/contrib/libs/grpc/include/grpc/module.modulemap
@@ -2,6 +2,15 @@
framework module grpc {
umbrella header "grpc.h"
+header "byte_buffer.h"
+ header "byte_buffer_reader.h"
+ header "census.h"
+ header "compression.h"
+ header "fork.h"
+ header "grpc.h"
+ header "grpc_posix.h"
+ header "grpc_security.h"
+ header "grpc_security_constants.h"
header "impl/codegen/atm.h"
header "impl/codegen/byte_buffer.h"
header "impl/codegen/byte_buffer_reader.h"
@@ -19,6 +28,10 @@ framework module grpc {
header "impl/codegen/sync.h"
header "impl/codegen/sync_abseil.h"
header "impl/codegen/sync_generic.h"
+ header "load_reporting.h"
+ header "slice.h"
+ header "slice_buffer.h"
+ header "status.h"
header "support/alloc.h"
header "support/atm.h"
header "support/cpu.h"
@@ -31,22 +44,9 @@ framework module grpc {
header "support/sync_generic.h"
header "support/thd_id.h"
header "support/time.h"
- header "byte_buffer.h"
- header "byte_buffer_reader.h"
- header "census.h"
- header "compression.h"
- header "fork.h"
- header "grpc.h"
- header "grpc_posix.h"
- header "grpc_security.h"
- header "grpc_security_constants.h"
- header "load_reporting.h"
- header "slice.h"
- header "slice_buffer.h"
- header "status.h"
header "support/workaround_list.h"
- textual header "impl/codegen/atm_gcc_atomic.h"
+textual header "impl/codegen/atm_gcc_atomic.h"
textual header "impl/codegen/atm_gcc_sync.h"
textual header "impl/codegen/atm_windows.h"
textual header "impl/codegen/sync_custom.h"
diff --git a/contrib/libs/grpc/include/grpc/slice.h b/contrib/libs/grpc/include/grpc/slice.h
index 51fc62b44df..65d20878831 100644
--- a/contrib/libs/grpc/include/grpc/slice.h
+++ b/contrib/libs/grpc/include/grpc/slice.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/slice.h>
+#include <grpc/impl/codegen/slice.h> // IWYU pragma: export
#include <grpc/support/sync.h>
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/include/grpc/status.h b/contrib/libs/grpc/include/grpc/status.h
index ecb9668bbb8..6763264e6b1 100644
--- a/contrib/libs/grpc/include/grpc/status.h
+++ b/contrib/libs/grpc/include/grpc/status.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/status.h>
+#include <grpc/impl/codegen/status.h> // IWYU pragma: export
#endif /* GRPC_STATUS_H */
diff --git a/contrib/libs/grpc/include/grpc/support/atm.h b/contrib/libs/grpc/include/grpc/support/atm.h
index 073b0a6fcf1..fbfcee3bb6f 100644
--- a/contrib/libs/grpc/include/grpc/support/atm.h
+++ b/contrib/libs/grpc/include/grpc/support/atm.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm.h>
+#include <grpc/impl/codegen/atm.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_H */
diff --git a/contrib/libs/grpc/include/grpc/support/atm_gcc_atomic.h b/contrib/libs/grpc/include/grpc/support/atm_gcc_atomic.h
index ae603db497a..8226349f254 100644
--- a/contrib/libs/grpc/include/grpc/support/atm_gcc_atomic.h
+++ b/contrib/libs/grpc/include/grpc/support/atm_gcc_atomic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_atomic.h>
+#include <grpc/impl/codegen/atm_gcc_atomic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_ATOMIC_H */
diff --git a/contrib/libs/grpc/include/grpc/support/atm_gcc_sync.h b/contrib/libs/grpc/include/grpc/support/atm_gcc_sync.h
index 6f51fdb1aa1..500a9f14d5e 100644
--- a/contrib/libs/grpc/include/grpc/support/atm_gcc_sync.h
+++ b/contrib/libs/grpc/include/grpc/support/atm_gcc_sync.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_gcc_sync.h>
+#include <grpc/impl/codegen/atm_gcc_sync.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_GCC_SYNC_H */
diff --git a/contrib/libs/grpc/include/grpc/support/atm_windows.h b/contrib/libs/grpc/include/grpc/support/atm_windows.h
index 36955e4dae0..b85d7f747db 100644
--- a/contrib/libs/grpc/include/grpc/support/atm_windows.h
+++ b/contrib/libs/grpc/include/grpc/support/atm_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/atm_windows.h>
+#include <grpc/impl/codegen/atm_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_ATM_WINDOWS_H */
diff --git a/contrib/libs/grpc/include/grpc/support/log.h b/contrib/libs/grpc/include/grpc/support/log.h
index 8d8742b95d6..7af557d0611 100644
--- a/contrib/libs/grpc/include/grpc/support/log.h
+++ b/contrib/libs/grpc/include/grpc/support/log.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
+#include <grpc/impl/codegen/log.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_LOG_H */
diff --git a/contrib/libs/grpc/include/grpc/support/port_platform.h b/contrib/libs/grpc/include/grpc/support/port_platform.h
index 26025dcd9dd..fced02a9657 100644
--- a/contrib/libs/grpc/include/grpc/support/port_platform.h
+++ b/contrib/libs/grpc/include/grpc/support/port_platform.h
@@ -19,6 +19,6 @@
#ifndef GRPC_SUPPORT_PORT_PLATFORM_H
#define GRPC_SUPPORT_PORT_PLATFORM_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/impl/codegen/port_platform.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_PORT_PLATFORM_H */
diff --git a/contrib/libs/grpc/include/grpc/support/sync.h b/contrib/libs/grpc/include/grpc/support/sync.h
index f617322f00c..b1f5b786855 100644
--- a/contrib/libs/grpc/include/grpc/support/sync.h
+++ b/contrib/libs/grpc/include/grpc/support/sync.h
@@ -22,7 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/impl/codegen/gpr_types.h> /* for gpr_timespec */
-#include <grpc/impl/codegen/sync.h>
+#include <grpc/impl/codegen/sync.h> // IWYU pragma: export
#ifdef __cplusplus
extern "C" {
diff --git a/contrib/libs/grpc/include/grpc/support/sync_abseil.h b/contrib/libs/grpc/include/grpc/support/sync_abseil.h
index 3ee73489786..d6ad969273e 100644
--- a/contrib/libs/grpc/include/grpc/support/sync_abseil.h
+++ b/contrib/libs/grpc/include/grpc/support/sync_abseil.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_abseil.h>
+#include <grpc/impl/codegen/sync_abseil.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_ABSEIL_H */
diff --git a/contrib/libs/grpc/include/grpc/support/sync_custom.h b/contrib/libs/grpc/include/grpc/support/sync_custom.h
index 27cf0e0578d..de7e2200d60 100644
--- a/contrib/libs/grpc/include/grpc/support/sync_custom.h
+++ b/contrib/libs/grpc/include/grpc/support/sync_custom.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_custom.h>
+#include <grpc/impl/codegen/sync_custom.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_CUSTOM_H */
diff --git a/contrib/libs/grpc/include/grpc/support/sync_generic.h b/contrib/libs/grpc/include/grpc/support/sync_generic.h
index 93028c4af05..d1d9fd7e54f 100644
--- a/contrib/libs/grpc/include/grpc/support/sync_generic.h
+++ b/contrib/libs/grpc/include/grpc/support/sync_generic.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_generic.h>
+#include <grpc/impl/codegen/sync_generic.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_GENERIC_H */
diff --git a/contrib/libs/grpc/include/grpc/support/sync_posix.h b/contrib/libs/grpc/include/grpc/support/sync_posix.h
index 3dce7ee48cc..b971cd10f4c 100644
--- a/contrib/libs/grpc/include/grpc/support/sync_posix.h
+++ b/contrib/libs/grpc/include/grpc/support/sync_posix.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_posix.h>
+#include <grpc/impl/codegen/sync_posix.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_POSIX_H */
diff --git a/contrib/libs/grpc/include/grpc/support/sync_windows.h b/contrib/libs/grpc/include/grpc/support/sync_windows.h
index a493c864220..3ee4a6ffa1b 100644
--- a/contrib/libs/grpc/include/grpc/support/sync_windows.h
+++ b/contrib/libs/grpc/include/grpc/support/sync_windows.h
@@ -21,6 +21,6 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/sync_windows.h>
+#include <grpc/impl/codegen/sync_windows.h> // IWYU pragma: export
#endif /* GRPC_SUPPORT_SYNC_WINDOWS_H */
diff --git a/contrib/libs/grpc/include/grpc/support/time.h b/contrib/libs/grpc/include/grpc/support/time.h
index 44aead5eea3..a193dbc8711 100644
--- a/contrib/libs/grpc/include/grpc/support/time.h
+++ b/contrib/libs/grpc/include/grpc/support/time.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/gpr_types.h>
-
#include <stddef.h>
#include <time.h>
+#include <grpc/impl/codegen/gpr_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/contrib/libs/grpc/include/grpcpp/alarm.h b/contrib/libs/grpc/include/grpcpp/alarm.h
index 6723e136c4f..7d0b4bee54c 100644
--- a/contrib/libs/grpc/include/grpcpp/alarm.h
+++ b/contrib/libs/grpc/include/grpcpp/alarm.h
@@ -81,7 +81,6 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
/// has already fired has no effect.
void Cancel();
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Set an alarm to invoke callback \a f. The argument to the callback
/// states whether the alarm expired at \a deadline (true) or was cancelled
/// (false)
@@ -89,32 +88,6 @@ class Alarm : private ::grpc::GrpcLibraryCodegen {
void Set(const T& deadline, std::function<void(bool)> f) {
SetInternal(::grpc::TimePoint<T>(deadline).raw_time(), std::move(f));
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of Alarm when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(Alarm* alarm) : alarm_(alarm) {}
-
- /// Set an alarm to invoke callback \a f. The argument to the callback
- /// states whether the alarm expired at \a deadline (true) or was cancelled
- /// (false)
- template <typename T>
- void Set(const T& deadline, std::function<void(bool)> f) {
- alarm_->SetInternal(::grpc::TimePoint<T>(deadline).raw_time(),
- std::move(f));
- }
-
- private:
- Alarm* alarm_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
void SetInternal(::grpc::CompletionQueue* cq, gpr_timespec deadline,
diff --git a/contrib/libs/grpc/include/grpcpp/channel.h b/contrib/libs/grpc/include/grpcpp/channel.h
index 6383698a31d..38decec3778 100644
--- a/contrib/libs/grpc/include/grpcpp/channel.h
+++ b/contrib/libs/grpc/include/grpcpp/channel.h
@@ -114,7 +114,7 @@ class Channel final : public ::grpc::ChannelInterface,
// with this channel (if any). It is set on the first call to CallbackCQ().
// It is _not owned_ by the channel; ownership belongs with its internal
// shutdown callback tag (invoked when the CQ is fully shutdown).
- ::grpc::CompletionQueue* callback_cq_ = nullptr;
+ std::atomic<CompletionQueue*> callback_cq_{nullptr};
std::vector<
std::unique_ptr<::grpc::experimental::ClientInterceptorFactoryInterface>>
diff --git a/contrib/libs/grpc/include/grpcpp/client_context.h b/contrib/libs/grpc/include/grpcpp/client_context.h
index 1994fcc6bc8..74a91e26421 100644
--- a/contrib/libs/grpc/include/grpcpp/client_context.h
+++ b/contrib/libs/grpc/include/grpcpp/client_context.h
@@ -34,6 +34,6 @@
#ifndef GRPCPP_CLIENT_CONTEXT_H
#define GRPCPP_CLIENT_CONTEXT_H
-#include <grpcpp/impl/codegen/client_context.h>
+#include <grpcpp/impl/codegen/client_context.h> // IWYU pragma: export
#endif // GRPCPP_CLIENT_CONTEXT_H
diff --git a/contrib/libs/grpc/include/grpcpp/completion_queue.h b/contrib/libs/grpc/include/grpcpp/completion_queue.h
index 123b277f5f0..42637b59272 100644
--- a/contrib/libs/grpc/include/grpcpp/completion_queue.h
+++ b/contrib/libs/grpc/include/grpcpp/completion_queue.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_COMPLETION_QUEUE_H
#define GRPCPP_COMPLETION_QUEUE_H
-#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/completion_queue.h> // IWYU pragma: export
#endif // GRPCPP_COMPLETION_QUEUE_H
diff --git a/contrib/libs/grpc/include/grpcpp/create_channel_binder.h b/contrib/libs/grpc/include/grpcpp/create_channel_binder.h
new file mode 100644
index 00000000000..6d6dfb22d6c
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/create_channel_binder.h
@@ -0,0 +1,86 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPCPP_CREATE_CHANNEL_BINDER_H
+#define GRPCPP_CREATE_CHANNEL_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_ANDROID
+
+#error #include <jni.h>
+
+#include <memory>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpcpp/channel.h>
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/support/channel_arguments.h>
+
+namespace grpc {
+namespace experimental {
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void* jni_env, jobject context, y_absl::string_view package_name,
+ y_absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+/// EXPERIMENTAL Create a new \a Channel based on binder transport. The package
+/// name and class name will be used identify the specific application component
+/// to connect to.
+///
+/// \param jni_env Pointer to a JNIEnv structure
+/// \param context The context that we will use to invoke \a bindService See
+/// https://developer.android.com/reference/android/content/Context#bindService(android.content.Intent,%20android.content.ServiceConnection,%20int)
+/// for detail.
+/// \param package_name Package name of the component to be connected to
+/// \param class_name Class name of the component to be connected to
+/// \param security_policy Used for checking if remote component is allowed to
+/// connect
+/// \param args Options for channel creation.
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void* jni_env_void, jobject application, y_absl::string_view package_name,
+ y_absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ const ChannelArguments& args);
+
+/// EXPERIMENTAL Finds internal binder transport Java code. To create channels
+/// in threads created in native code, it is required to call this function
+/// once beforehand in a thread that is not created in native code.
+/// See
+/// https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
+/// for details of this limitation.
+/// Returns true when the initialization is successful.
+bool InitializeBinderChannelJavaClass(void* jni_env_void);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif
+
+#endif // GRPCPP_CREATE_CHANNEL_BINDER_H
diff --git a/contrib/libs/grpc/include/grpcpp/create_channel_posix.h b/contrib/libs/grpc/include/grpcpp/create_channel_posix.h
index 899d8e66587..a57b4deeb12 100644
--- a/contrib/libs/grpc/include/grpcpp/create_channel_posix.h
+++ b/contrib/libs/grpc/include/grpcpp/create_channel_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_CREATE_CHANNEL_POSIX_H
#define GRPCPP_CREATE_CHANNEL_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/channel.h>
#include <grpcpp/support/channel_arguments.h>
diff --git a/contrib/libs/grpc/include/grpcpp/generic/async_generic_service.h b/contrib/libs/grpc/include/grpcpp/generic/async_generic_service.h
index 2c67edc5170..01c79428e26 100644
--- a/contrib/libs/grpc/include/grpcpp/generic/async_generic_service.h
+++ b/contrib/libs/grpc/include/grpcpp/generic/async_generic_service.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
-#include <grpcpp/impl/codegen/async_generic_service.h>
+#include <grpcpp/impl/codegen/async_generic_service.h> // IWYU pragma: export
#endif // GRPCPP_GENERIC_ASYNC_GENERIC_SERVICE_H
diff --git a/contrib/libs/grpc/include/grpcpp/generic/generic_stub.h b/contrib/libs/grpc/include/grpcpp/generic/generic_stub.h
index 6789cefb9cd..1f88438a2f8 100644
--- a/contrib/libs/grpc/include/grpcpp/generic/generic_stub.h
+++ b/contrib/libs/grpc/include/grpcpp/generic/generic_stub.h
@@ -22,6 +22,7 @@
#include <functional>
#include <grpcpp/client_context.h>
+#include <grpcpp/impl/codegen/stub_options.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
@@ -53,7 +54,8 @@ class TemplatedGenericStub final {
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
PrepareCall(ClientContext* context, const TString& method,
::grpc::CompletionQueue* cq) {
- return CallInternal(channel_.get(), context, method, cq, false, nullptr);
+ return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
+ false, nullptr);
}
/// Setup a unary call to a named method \a method using \a context, and don't
@@ -67,6 +69,7 @@ class TemplatedGenericStub final {
internal::ClientAsyncResponseReaderHelper::Create<ResponseType>(
channel_.get(), cq,
grpc::internal::RpcMethod(method.c_str(),
+ /*suffix_for_stats=*/nullptr,
grpc::internal::RpcMethod::NORMAL_RPC),
context, request));
}
@@ -80,16 +83,17 @@ class TemplatedGenericStub final {
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>> Call(
ClientContext* context, const TString& method,
::grpc::CompletionQueue* cq, void* tag) {
- return CallInternal(channel_.get(), context, method, cq, true, tag);
+ return CallInternal(channel_.get(), context, method, /*options=*/{}, cq,
+ true, tag);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Setup and start a unary call to a named method \a method using
/// \a context and specifying the \a request and \a response buffers.
void UnaryCall(ClientContext* context, const TString& method,
- const RequestType* request, ResponseType* response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response,
std::function<void(grpc::Status)> on_completion) {
- UnaryCallInternal(context, method, request, response,
+ UnaryCallInternal(context, method, options, request, response,
std::move(on_completion));
}
@@ -98,112 +102,69 @@ class TemplatedGenericStub final {
/// Like any other reactor-based RPC, it will not be activated until
/// StartCall is invoked on its reactor.
void PrepareUnaryCall(ClientContext* context, const TString& method,
- const RequestType* request, ResponseType* response,
- ClientUnaryReactor* reactor) {
- PrepareUnaryCallInternal(context, method, request, response, reactor);
+ StubOptions options, const RequestType* request,
+ ResponseType* response, ClientUnaryReactor* reactor) {
+ PrepareUnaryCallInternal(context, method, options, request, response,
+ reactor);
}
/// Setup a call to a named method \a method using \a context and tied to
/// \a reactor . Like any other bidi streaming RPC, it will not be activated
/// until StartCall is invoked on its reactor.
void PrepareBidiStreamingCall(
- ClientContext* context, const TString& method,
+ ClientContext* context, const TString& method, StubOptions options,
ClientBidiReactor<RequestType, ResponseType>* reactor) {
- PrepareBidiStreamingCallInternal(context, method, reactor);
+ PrepareBidiStreamingCallInternal(context, method, options, reactor);
}
-#endif
-
- /// NOTE: class experimental_type is not part of the public API of this class
- /// TODO(vjpai): Move these contents to the public API of GenericStub when
- /// they are no longer experimental
- class experimental_type {
- public:
- explicit experimental_type(TemplatedGenericStub* stub) : stub_(stub) {}
-
- /// Setup and start a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- void UnaryCall(ClientContext* context, const TString& method,
- const RequestType* request, ResponseType* response,
- std::function<void(grpc::Status)> on_completion) {
- stub_->UnaryCallInternal(context, method, request, response,
- std::move(on_completion));
- }
-
- /// Setup a unary call to a named method \a method using
- /// \a context and specifying the \a request and \a response buffers.
- /// Like any other reactor-based RPC, it will not be activated until
- /// StartCall is invoked on its reactor.
- void PrepareUnaryCall(ClientContext* context, const TString& method,
- const RequestType* request, ResponseType* response,
- ClientUnaryReactor* reactor) {
- stub_->PrepareUnaryCallInternal(context, method, request, response,
- reactor);
- }
-
- /// Setup a call to a named method \a method using \a context and tied to
- /// \a reactor . Like any other bidi streaming RPC, it will not be activated
- /// until StartCall is invoked on its reactor.
- void PrepareBidiStreamingCall(
- ClientContext* context, const TString& method,
- ClientBidiReactor<RequestType, ResponseType>* reactor) {
- stub_->PrepareBidiStreamingCallInternal(context, method, reactor);
- }
-
- private:
- TemplatedGenericStub* stub_;
- };
-
- /// NOTE: The function experimental() is not stable public API. It is a view
- /// to the experimental components of this class. It may be changed or removed
- /// at any time.
- experimental_type experimental() { return experimental_type(this); }
private:
std::shared_ptr<grpc::ChannelInterface> channel_;
void UnaryCallInternal(ClientContext* context, const TString& method,
- const RequestType* request, ResponseType* response,
+ StubOptions options, const RequestType* request,
+ ResponseType* response,
std::function<void(grpc::Status)> on_completion) {
internal::CallbackUnaryCall(
channel_.get(),
- grpc::internal::RpcMethod(method.c_str(),
+ grpc::internal::RpcMethod(method.c_str(), options.suffix_for_stats(),
grpc::internal::RpcMethod::NORMAL_RPC),
context, request, response, std::move(on_completion));
}
void PrepareUnaryCallInternal(ClientContext* context,
- const TString& method,
+ const TString& method, StubOptions options,
const RequestType* request,
ResponseType* response,
ClientUnaryReactor* reactor) {
internal::ClientCallbackUnaryFactory::Create<RequestType, ResponseType>(
channel_.get(),
- grpc::internal::RpcMethod(method.c_str(),
+ grpc::internal::RpcMethod(method.c_str(), options.suffix_for_stats(),
grpc::internal::RpcMethod::NORMAL_RPC),
context, request, response, reactor);
}
void PrepareBidiStreamingCallInternal(
- ClientContext* context, const TString& method,
+ ClientContext* context, const TString& method, StubOptions options,
ClientBidiReactor<RequestType, ResponseType>* reactor) {
internal::ClientCallbackReaderWriterFactory<RequestType, ResponseType>::
Create(channel_.get(),
grpc::internal::RpcMethod(
- method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING),
+ method.c_str(), options.suffix_for_stats(),
+ grpc::internal::RpcMethod::BIDI_STREAMING),
context, reactor);
}
std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>
CallInternal(grpc::ChannelInterface* channel, ClientContext* context,
- const TString& method, ::grpc::CompletionQueue* cq,
- bool start, void* tag) {
+ const TString& method, StubOptions options,
+ ::grpc::CompletionQueue* cq, bool start, void* tag) {
return std::unique_ptr<ClientAsyncReaderWriter<RequestType, ResponseType>>(
internal::ClientAsyncReaderWriterFactory<RequestType, ResponseType>::
- Create(
- channel, cq,
- grpc::internal::RpcMethod(
- method.c_str(), grpc::internal::RpcMethod::BIDI_STREAMING),
- context, start, tag));
+ Create(channel, cq,
+ grpc::internal::RpcMethod(
+ method.c_str(), options.suffix_for_stats(),
+ grpc::internal::RpcMethod::BIDI_STREAMING),
+ context, start, tag));
}
};
diff --git a/contrib/libs/grpc/include/grpcpp/grpcpp.h b/contrib/libs/grpc/include/grpcpp/grpcpp.h
index d37258cf3b0..fbc161bec10 100644
--- a/contrib/libs/grpc/include/grpcpp/grpcpp.h
+++ b/contrib/libs/grpc/include/grpcpp/grpcpp.h
@@ -49,7 +49,6 @@
// headers are not private for grpcpp.h and are part of its interface.
// IWYU pragma: begin_exports
#include <grpc/grpc.h>
-
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/call.h b/contrib/libs/grpc/include/grpcpp/impl/call.h
index a6b13126934..97d8fdfc7cf 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/call.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CALL_H
#define GRPCPP_IMPL_CALL_H
-#include <grpcpp/impl/codegen/call.h>
+#include <grpcpp/impl/codegen/call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CALL_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/client_unary_call.h b/contrib/libs/grpc/include/grpcpp/impl/client_unary_call.h
index 378482c5403..7ecf3548f20 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/client_unary_call.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/client_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CLIENT_UNARY_CALL_H
-#include <grpcpp/impl/codegen/client_unary_call.h>
+#include <grpcpp/impl/codegen/client_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_CLIENT_UNARY_CALL_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h
index a812b086a2a..6499f63f683 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_generic_service.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
+// IWYU pragma: private, include <grpcpp/generic/async_generic_service.h>
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpcpp/impl/codegen/async_stream.h>
@@ -79,10 +81,6 @@ class AsyncGenericService final {
grpc::Server* server_;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
-
/// \a ServerGenericBidiReactor is the reactor class for bidi streaming RPCs
/// invoked on a CallbackGenericService. It is just a ServerBidi reactor with
/// ByteBuffer arguments.
@@ -134,9 +132,6 @@ class CallbackGenericService {
grpc::Server* server_{nullptr};
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_ASYNC_GENERIC_SERVICE_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h
index aaee93df933..db5b3747a26 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/async_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h
index 7cb7cc6f16e..d7a3b57314a 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/async_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_ASYNC_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/support/async_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h
index 2c015f2266f..d94ac3bc7ba 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/byte_buffer.h
@@ -19,16 +19,17 @@
#ifndef GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
#define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H
-#include <grpc/impl/codegen/byte_buffer.h>
+// IWYU pragma: private, include <grpcpp/support/byte_buffer.h>
+
+#include <vector>
+#include <grpc/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/serialization_traits.h>
#include <grpcpp/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/status.h>
-#include <vector>
-
namespace grpc {
class ServerInterface;
@@ -114,6 +115,13 @@ class ByteBuffer final {
return *this;
}
+ // If this ByteBuffer's representation is a single flat slice, returns a
+ // slice referencing that array.
+ Status TrySingleSlice(Slice* slice) const;
+
+ /// Dump (read) the buffer contents into \a slics.
+ Status DumpToSingleSlice(Slice* slice) const;
+
/// Dump (read) the buffer contents into \a slices.
Status Dump(std::vector<Slice>* slices) const;
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h
index b2292862157..96d0de53e3b 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_H
#define GRPCPP_IMPL_CODEGEN_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/call.h>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call_hook.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_hook.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_hook.h
index 4f7d370c4f7..8c4278e7dc1 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_hook.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_hook.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
#define GRPCPP_IMPL_CODEGEN_CALL_HOOK_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h
index 6df16a1125c..5ad0a74d83b 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set.h
@@ -23,6 +23,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_H
+// IWYU pragma: private
+
#include <cstring>
#include <map>
#include <memory>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
index 3b74566a6d3..a8eed9f6193 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/call_op_set_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CALL_OP_SET_INTERFACE_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/completion_queue_tag.h>
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/callback_common.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/callback_common.h
index 612b820066b..f0ce27ae8fe 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/callback_common.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/callback_common.h
@@ -23,6 +23,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
#define GRPCPP_IMPL_CODEGEN_CALLBACK_COMMON_H
+// IWYU pragma: private
+
#include <functional>
#include <grpc/impl/codegen/grpc_types.h>
@@ -70,8 +72,7 @@ Reactor* CatchingReactorGetter(Func&& func, Args&&... args) {
// constructed and then fired at exactly one point. There is no expectation
// that they can be reused without reconstruction.
-class CallbackWithStatusTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithStatusTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -112,8 +113,7 @@ class CallbackWithStatusTag
CompletionQueueTag* ops_;
Status status_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithStatusTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
@@ -138,8 +138,7 @@ class CallbackWithStatusTag
/// CallbackWithSuccessTag can be reused multiple times, and will be used in
/// this fashion for streaming operations. As a result, it shouldn't clear
/// anything up until its destructor
-class CallbackWithSuccessTag
- : public grpc_experimental_completion_queue_functor {
+class CallbackWithSuccessTag : public grpc_completion_queue_functor {
public:
// always allocated against a call arena, no memory free required
static void operator delete(void* /*ptr*/, std::size_t size) {
@@ -202,8 +201,7 @@ class CallbackWithSuccessTag
std::function<void(bool)> func_;
CompletionQueueTag* ops_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackWithSuccessTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h
index 7f03fb0345b..09e67ae45d8 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/channel_interface.h
@@ -23,6 +23,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CHANNEL_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/status.h>
@@ -160,7 +162,6 @@ class ChannelInterface {
return internal::Call();
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// channel. If the return value is nullptr, this channel doesn't support
// callback operations.
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h
index a73d525003e..ca65f6f4140 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_callback.h
@@ -17,6 +17,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
+
+// IWYU pragma: private, include <grpcpp/support/client_callback.h>
+
#include <atomic>
#include <functional>
@@ -130,6 +133,15 @@ class ClientReactor {
/// heavyweight and the cost of the virtual call is not much in comparison.
/// This function may be removed or devirtualized in the future.
virtual void InternalScheduleOnDone(::grpc::Status s);
+
+ /// InternalTrailersOnly is not part of the API and is not meant to be
+ /// overridden. It is virtual to allow successful builds for certain bazel
+ /// build users that only want to depend on gRPC codegen headers and not the
+ /// full library (although this is not a generally-supported option). Although
+ /// the virtual call is slower than a direct call, this function is
+ /// heavyweight and the cost of the virtual call is not much in comparison.
+ /// This function may be removed or devirtualized in the future.
+ virtual bool InternalTrailersOnly(const grpc_call* call) const;
};
} // namespace internal
@@ -594,7 +606,8 @@ class ClientCallbackReaderWriterImpl
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -737,7 +750,8 @@ class ClientCallbackReaderImpl : public ClientCallbackReader<Response> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -995,7 +1009,8 @@ class ClientCallbackWriterImpl : public ClientCallbackWriter<Request> {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish(/*from_reaction=*/true);
},
&start_ops_, /*can_inline=*/false);
@@ -1121,7 +1136,8 @@ class ClientCallbackUnaryImpl final : public ClientCallbackUnary {
start_tag_.Set(
call_.call(),
[this](bool ok) {
- reactor_->OnReadInitialMetadataDone(ok);
+ reactor_->OnReadInitialMetadataDone(
+ ok && !reactor_->InternalTrailersOnly(call_.call()));
MaybeFinish();
},
&start_ops_, /*can_inline=*/false);
@@ -1213,32 +1229,5 @@ class ClientCallbackUnaryFactory {
};
} // namespace internal
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-template <class Response>
-using ClientCallbackReader = ::grpc::ClientCallbackReader<Response>;
-
-template <class Request>
-using ClientCallbackWriter = ::grpc::ClientCallbackWriter<Request>;
-
-template <class Request, class Response>
-using ClientCallbackReaderWriter =
- ::grpc::ClientCallbackReaderWriter<Request, Response>;
-
-template <class Response>
-using ClientReadReactor = ::grpc::ClientReadReactor<Response>;
-
-template <class Request>
-using ClientWriteReactor = ::grpc::ClientWriteReactor<Request>;
-
-template <class Request, class Response>
-using ClientBidiReactor = ::grpc::ClientBidiReactor<Request, Response>;
-
-typedef ::grpc::ClientUnaryReactor ClientUnaryReactor;
-
-} // namespace experimental
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_CLIENT_CALLBACK_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h
index 82b93587a87..d8204fafde7 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_context.h
@@ -34,6 +34,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/client_context.h>
+
#include <map>
#include <memory>
#include <util/generic/string.h>
@@ -92,6 +94,7 @@ class ClientAsyncResponseReader;
namespace testing {
class InteropClientContextInspector;
+class ClientContextTestPeer;
} // namespace testing
namespace internal {
@@ -205,7 +208,7 @@ class ClientContext {
/// \return A newly constructed \a ClientContext instance based on \a
/// server_context, with traits propagated (copied) according to \a options.
static std::unique_ptr<ClientContext> FromServerContext(
- const grpc::ServerContext& server_context,
+ const grpc::ServerContextBase& server_context,
PropagationOptions options = PropagationOptions());
static std::unique_ptr<ClientContext> FromCallbackServerContext(
const grpc::CallbackServerContext& server_context,
@@ -223,11 +226,16 @@ class ClientContext {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ \endverbatim
+ **/
void AddMetadata(const TString& meta_key, const TString& meta_value);
/// Return a collection of initial metadata key-value pairs. Note that keys
@@ -423,6 +431,7 @@ class ClientContext {
ClientContext& operator=(const ClientContext&);
friend class ::grpc::testing::InteropClientContextInspector;
+ friend class ::grpc::testing::ClientContextTestPeer;
friend class ::grpc::internal::CallOpClientRecvStatus;
friend class ::grpc::internal::CallOpRecvInitialMetadata;
friend class ::grpc::Channel;
@@ -464,12 +473,13 @@ class ClientContext {
const std::shared_ptr<::grpc::Channel>& channel);
grpc::experimental::ClientRpcInfo* set_client_rpc_info(
- const char* method, grpc::internal::RpcMethod::RpcType type,
- grpc::ChannelInterface* channel,
+ const char* method, const char* suffix_for_stats,
+ grpc::internal::RpcMethod::RpcType type, grpc::ChannelInterface* channel,
const std::vector<std::unique_ptr<
grpc::experimental::ClientInterceptorFactoryInterface>>& creators,
size_t interceptor_pos) {
- rpc_info_ = grpc::experimental::ClientRpcInfo(this, type, method, channel);
+ rpc_info_ = grpc::experimental::ClientRpcInfo(this, type, method,
+ suffix_for_stats, channel);
rpc_info_.RegisterInterceptors(creators, interceptor_pos);
return &rpc_info_;
}
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_interceptor.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_interceptor.h
index 78be1f7597e..f3560b5ad21 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/client_interceptor.h>
+
#include <memory>
#include <vector>
@@ -87,6 +89,10 @@ class ClientRpcInfo {
/// Return the fully-specified method name
const char* method() const { return method_; }
+ /// Return an identifying suffix for the client stub, or nullptr if one wasn't
+ /// specified.
+ const char* suffix_for_stats() const { return suffix_for_stats_; }
+
/// Return a pointer to the channel on which the RPC is being sent
ChannelInterface* channel() { return channel_; }
@@ -116,10 +122,12 @@ class ClientRpcInfo {
// Constructor will only be called from ClientContext
ClientRpcInfo(grpc::ClientContext* ctx, internal::RpcMethod::RpcType type,
- const char* method, grpc::ChannelInterface* channel)
+ const char* method, const char* suffix_for_stats,
+ grpc::ChannelInterface* channel)
: ctx_(ctx),
type_(static_cast<Type>(type)),
method_(method),
+ suffix_for_stats_(suffix_for_stats),
channel_(channel) {}
// Move assignment should only be used by ClientContext
@@ -162,6 +170,7 @@ class ClientRpcInfo {
// TODO(yashykt): make type_ const once move-assignment is deleted
Type type_{Type::UNKNOWN};
const char* method_ = nullptr;
+ const char* suffix_for_stats_ = nullptr;
grpc::ChannelInterface* channel_ = nullptr;
std::vector<std::unique_ptr<experimental::Interceptor>> interceptors_;
bool hijacked_ = false;
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h
index d41ea1ad2d4..bad60a23bc9 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/client_unary_call.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
#define GRPCPP_IMPL_CODEGEN_CLIENT_UNARY_CALL_H
+// IWYU pragma: private, include <grpcpp/impl/client_unary_call.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
#include <grpcpp/impl/codegen/channel_interface.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h
index d23e0e2bb3c..ef0c7f14985 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue.h
@@ -32,6 +32,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_H
+// IWYU pragma: private, include <grpcpp/completion_queue.h>
+
#include <list>
#include <grpc/impl/codegen/atm.h>
@@ -175,9 +177,14 @@ class CompletionQueue : private ::grpc::GrpcLibraryCodegen {
/// \return true if got an event, false if the queue is fully drained and
/// shut down.
bool Next(void** tag, bool* ok) {
+ // Check return type == GOT_EVENT... cases:
+ // SHUTDOWN - queue has been shutdown, return false.
+ // TIMEOUT - we passed infinity time => queue has been shutdown, return
+ // false.
+ // GOT_EVENT - we actually got an event, return true.
return (AsyncNextInternal(tag, ok,
::grpc::g_core_codegen_interface->gpr_inf_future(
- GPR_CLOCK_REALTIME)) != SHUTDOWN);
+ GPR_CLOCK_REALTIME)) == GOT_EVENT);
}
/// Read from the queue, blocking up to \a deadline (or the queue's shutdown).
@@ -443,7 +450,7 @@ class ServerCompletionQueue : public CompletionQueue {
/// \param shutdown_cb is the shutdown callback used for CALLBACK api queues
ServerCompletionQueue(grpc_cq_completion_type completion_type,
grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_cb)
+ grpc_completion_queue_functor* shutdown_cb)
: CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, completion_type, polling_type,
shutdown_cb}),
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
index 304386a9ecc..9af470b7502 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/completion_queue_tag.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
#define GRPCPP_IMPL_CODEGEN_COMPLETION_QUEUE_TAG_H
+// IWYU pragma: private
+
namespace grpc {
namespace internal {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
index d1776685516..85350b6776e 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/config.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_H
+// IWYU pragma: private, include <grpcpp/support/config.h>
+
#include <util/generic/string.h>
/// The following macros are deprecated and appear only for users
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/config_protobuf.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/config_protobuf.h
index 49db4c5dc31..da874c58eb6 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/config_protobuf.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/config_protobuf.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
#define GRPCPP_IMPL_CODEGEN_CONFIG_PROTOBUF_H
+// IWYU pragma: private
+
#define GRPC_OPEN_SOURCE_PROTO
#ifndef GRPC_CUSTOM_MESSAGE
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen.h
index df2a03cd259..e0440ffe3b1 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_H
+// IWYU pragma: private
+
// This file should be compiled as part of grpcpp.
#include <grpc/byte_buffer.h>
@@ -70,6 +72,7 @@ class CoreCodegen final : public CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) override;
+ int grpc_call_failed_before_recv_message(const grpc_call* c) override;
void grpc_call_ref(grpc_call* call) override;
void grpc_call_unref(grpc_call* call) override;
void* grpc_call_arena_alloc(grpc_call* call, size_t length) override;
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
index c08cf6c683d..0b23bf46e63 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/core_codegen_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_CORE_CODEGEN_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/byte_buffer.h>
#include <grpc/impl/codegen/byte_buffer_reader.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -111,6 +113,7 @@ class CoreCodegenInterface {
grpc_status_code status,
const char* description,
void* reserved) = 0;
+ virtual int grpc_call_failed_before_recv_message(const grpc_call* c) = 0;
virtual void grpc_call_ref(grpc_call* call) = 0;
virtual void grpc_call_unref(grpc_call* call) = 0;
virtual void* grpc_call_arena_alloc(grpc_call* call, size_t length) = 0;
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/create_auth_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/create_auth_context.h
index cb6095c3a5a..817988f3aa2 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/create_auth_context.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/create_auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_CREATE_AUTH_CONTEXT_H
+// IWYU pragma: private
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/delegating_channel.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/delegating_channel.h
index 0479567b864..f4f6794b420 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/delegating_channel.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/delegating_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_DELEGATING_CHANNEL_H
+// IWYU pragma: private
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/grpc_library.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/grpc_library.h
index 660d6d0abdc..9f83a7f938c 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/grpc_library.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/grpc_library.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
#define GRPCPP_IMPL_CODEGEN_GRPC_LIBRARY_H
+// IWYU pragma: private, include <grpcpp/impl/grpc_library.h>
+
#include <grpcpp/impl/codegen/core_codegen_interface.h>
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
index e3a4c8e7680..d3df6caa045 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/intercepted_channel.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/channel_interface.h>
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor.h
index d0afa03a178..0818d5c5343 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/interceptor.h>
+
#include <memory>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor_common.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor_common.h
index 72d8009ded4..46a5d1ac6ba 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor_common.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/interceptor_common.h
@@ -23,17 +23,18 @@
#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
#define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
+// IWYU pragma: private
+
#include <array>
#include <functional>
+#include <grpc/impl/codegen/grpc_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set_interface.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
#include <grpcpp/impl/codegen/intercepted_channel.h>
#include <grpcpp/impl/codegen/server_interceptor.h>
-#include <grpc/impl/codegen/grpc_types.h>
-
namespace grpc {
namespace internal {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/message_allocator.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/message_allocator.h
index 4048ea11974..440c7f1d232 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/message_allocator.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/message_allocator.h
@@ -19,10 +19,9 @@
#ifndef GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
#define GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
+// IWYU pragma: private, include <grpcpp/support/message_allocator.h>
+
namespace grpc {
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
// NOTE: This is an API for advanced users who need custom allocators.
// Per rpc struct for the allocator. This is the interface to return to user.
@@ -69,25 +68,6 @@ class MessageAllocator {
virtual MessageHolder<RequestT, ResponseT>* AllocateMessages() = 0;
};
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-
-using ::grpc::RpcAllocatorState;
-
-template <typename RequestT, typename ResponseT>
-using MessageHolder = ::grpc::MessageHolder<RequestT, ResponseT>;
-
-template <typename RequestT, typename ResponseT>
-using MessageAllocator = ::grpc::MessageAllocator<RequestT, ResponseT>;
-
-} // namespace experimental
-#endif
-
} // namespace grpc
#endif // GRPCPP_IMPL_CODEGEN_MESSAGE_ALLOCATOR_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/metadata_map.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/metadata_map.h
index 03afc0781a2..430d6b67444 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/metadata_map.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/metadata_map.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
#define GRPCPP_IMPL_CODEGEN_METADATA_MAP_H
+// IWYU pragma: private
+
#include <map>
#include <grpc/impl/codegen/log.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h
index 756f4aae751..090d672ae2d 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_H
+// IWYU pragma: private, include <grpcpp/support/method_handler.h>
+
#include <grpcpp/impl/codegen/byte_buffer.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -357,9 +359,12 @@ class SplitServerStreamingHandler
template <::grpc::StatusCode code>
class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
public:
+ explicit ErrorMethodHandler(const TString& message) : message_(message) {}
+
template <class T>
- static void FillOps(::grpc::ServerContextBase* context, T* ops) {
- ::grpc::Status status(code, "");
+ static void FillOps(::grpc::ServerContextBase* context,
+ const TString& message, T* ops) {
+ ::grpc::Status status(code, message);
if (!context->sent_initial_metadata_) {
ops->SendInitialMetadata(&context->initial_metadata_,
context->initial_metadata_flags());
@@ -375,7 +380,7 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
::grpc::internal::CallOpSet<::grpc::internal::CallOpSendInitialMetadata,
::grpc::internal::CallOpServerSendStatus>
ops;
- FillOps(param.server_context, &ops);
+ FillOps(param.server_context, message_, &ops);
param.call->PerformOps(&ops);
param.call->cq()->Pluck(&ops);
}
@@ -388,6 +393,9 @@ class ErrorMethodHandler : public ::grpc::internal::MethodHandler {
}
return nullptr;
}
+
+ private:
+ const TString message_;
};
typedef ErrorMethodHandler<::grpc::StatusCode::UNIMPLEMENTED>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler_impl.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
index cc88a135ca2..3f1d573ba5f 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/method_handler_impl.h
@@ -19,4 +19,6 @@
#ifndef GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
#define GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
+// IWYU pragma: private
+
#endif // GRPCPP_IMPL_CODEGEN_METHOD_HANDLER_IMPL_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
index d25b79a4027..d3baa2cd29d 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_reader.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_reader.h>
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
index cd9d70c5a56..204620bb014 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_buffer_writer.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_WRITER_H
+// IWYU pragma: private, include <grpcpp/support/proto_buffer_writer.h>
+
#include <type_traits>
#include <grpc/impl/codegen/grpc_types.h>
@@ -116,6 +118,13 @@ class ProtoBufferWriter : public ::grpc::protobuf::io::ZeroCopyOutputStream {
/// (only used in the last buffer). \a count must be less than or equal too
/// the last buffer returned from next.
void BackUp(int count) override {
+ // count == 0 is invoked by ZeroCopyOutputStream users indicating that any
+ // potential buffer obtained through a previous call to Next() is final.
+ // ZeroCopyOutputStream implementations such as streaming output can use
+ // these calls to flush any temporary buffer and flush the output. The logic
+ // below is not robust against count == 0 invocations, so directly return.
+ if (count == 0) return;
+
/// 1. Remove the partially-used last slice from the slice buffer
/// 2. Split it into the needed (if any) and unneeded part
/// 3. Add the needed part back to the slice buffer
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_utils.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_utils.h
index 7f5c6e9a99d..4f6d87415a1 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_utils.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/proto_utils.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
#define GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H
+// IWYU pragma: private
+
#include <type_traits>
#include <grpc/impl/codegen/byte_buffer_reader.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_method.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_method.h
index 394a29b8374..83dedda42cb 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_method.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_method.h>
+
#include <memory>
#include <grpcpp/impl/codegen/channel_interface.h>
@@ -36,21 +38,40 @@ class RpcMethod {
};
RpcMethod(const char* name, RpcType type)
- : name_(name), method_type_(type), channel_tag_(nullptr) {}
+ : name_(name),
+ suffix_for_stats_(nullptr),
+ method_type_(type),
+ channel_tag_(nullptr) {}
+
+ RpcMethod(const char* name, const char* suffix_for_stats, RpcType type)
+ : name_(name),
+ suffix_for_stats_(suffix_for_stats),
+ method_type_(type),
+ channel_tag_(nullptr) {}
RpcMethod(const char* name, RpcType type,
const std::shared_ptr<ChannelInterface>& channel)
: name_(name),
+ suffix_for_stats_(nullptr),
+ method_type_(type),
+ channel_tag_(channel->RegisterMethod(name)) {}
+
+ RpcMethod(const char* name, const char* suffix_for_stats, RpcType type,
+ const std::shared_ptr<ChannelInterface>& channel)
+ : name_(name),
+ suffix_for_stats_(suffix_for_stats),
method_type_(type),
channel_tag_(channel->RegisterMethod(name)) {}
const char* name() const { return name_; }
+ const char* suffix_for_stats() const { return suffix_for_stats_; }
RpcType method_type() const { return method_type_; }
void SetMethodType(RpcType type) { method_type_ = type; }
void* channel_tag() const { return channel_tag_; }
private:
const char* const name_;
+ const char* const suffix_for_stats_;
RpcType method_type_;
void* const channel_tag_;
};
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
index 4fcc2112435..f34cc8b17c4 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/rpc_service_method.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_CODEGEN_RPC_SERVICE_METHOD_H
+// IWYU pragma: private, include <grpcpp/impl/rpc_service_method.h>
+
#include <climits>
#include <functional>
#include <map>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/security/auth_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/security/auth_context.h
index e2b04356526..3079fecbc4f 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/security/auth_context.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/security/auth_context.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SECURITY_AUTH_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/security/auth_context.h>
+
#include <iterator>
#include <vector>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/serialization_traits.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/serialization_traits.h
index 8f792232909..3148dffc806 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/serialization_traits.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/serialization_traits.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_CODEGEN_SERIALIZATION_TRAITS_H
+// IWYU pragma: private, include <grpcpp/impl/serialization_traits.h>
+
namespace grpc {
/// Defines how to serialize and deserialize some type.
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h
index 701ef561a34..fb6bdbccac7 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_H
+// IWYU pragma: private, include <grpcpp/support/server_callback.h>
+
#include <atomic>
#include <functional>
#include <type_traits>
@@ -158,8 +160,7 @@ class ServerCallbackCall {
};
template <class Request, class Response>
-class DefaultMessageHolder
- : public ::grpc::experimental::MessageHolder<Request, Response> {
+class DefaultMessageHolder : public MessageHolder<Request, Response> {
public:
DefaultMessageHolder() {
this->set_request(&request_obj_);
@@ -784,20 +785,13 @@ using UnimplementedBidiReactor =
} // namespace internal
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
+// TODO(vjpai): Remove namespace experimental when last known users are migrated
+// off.
namespace experimental {
-template <class Request>
-using ServerReadReactor = ::grpc::ServerReadReactor<Request>;
-
-template <class Response>
-using ServerWriteReactor = ::grpc::ServerWriteReactor<Response>;
-
template <class Request, class Response>
using ServerBidiReactor = ::grpc::ServerBidiReactor<Request, Response>;
-using ServerUnaryReactor = ::grpc::ServerUnaryReactor;
-
} // namespace experimental
} // namespace grpc
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
index 76e655a9b3a..8713d3eb30a 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_callback_handlers.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CALLBACK_HANDLERS_H
+// IWYU pragma: private
+
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
@@ -37,17 +39,16 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
: get_reactor_(std::move(get_reactor)) {}
void SetMessageAllocator(
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator) {
+ MessageAllocator<RequestType, ResponseType>* allocator) {
allocator_ = allocator;
}
void RunHandler(const HandlerParameter& param) final {
// Arena allocate a controller structure (that includes request/response)
::grpc::g_core_codegen_interface->grpc_call_ref(param.call->call());
- auto* allocator_state = static_cast<
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*>(
- param.internal_data);
+ auto* allocator_state =
+ static_cast<MessageHolder<RequestType, ResponseType>*>(
+ param.internal_data);
auto* call = new (::grpc::g_core_codegen_interface->grpc_call_arena_alloc(
param.call->call(), sizeof(ServerCallbackUnaryImpl)))
@@ -82,8 +83,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
::grpc::ByteBuffer buf;
buf.set_buffer(req);
RequestType* request = nullptr;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state = nullptr;
+ MessageHolder<RequestType, ResponseType>* allocator_state;
if (allocator_ != nullptr) {
allocator_state = allocator_->AllocateMessages();
} else {
@@ -100,8 +100,6 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
if (status->ok()) {
return request;
}
- // Clean up on deserialization failure.
- allocator_state->Release();
return nullptr;
}
@@ -109,8 +107,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
std::function<ServerUnaryReactor*(::grpc::CallbackServerContext*,
const RequestType*, ResponseType*)>
get_reactor_;
- ::grpc::experimental::MessageAllocator<RequestType, ResponseType>*
- allocator_ = nullptr;
+ MessageAllocator<RequestType, ResponseType>* allocator_ = nullptr;
class ServerCallbackUnaryImpl : public ServerCallbackUnary {
public:
@@ -181,8 +178,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
ServerCallbackUnaryImpl(
::grpc::CallbackServerContext* ctx, ::grpc::internal::Call* call,
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>*
- allocator_state,
+ MessageHolder<RequestType, ResponseType>* allocator_state,
std::function<void()> call_requester)
: ctx_(ctx),
call_(*call),
@@ -233,8 +229,7 @@ class CallbackUnaryHandler : public ::grpc::internal::MethodHandler {
::grpc::CallbackServerContext* const ctx_;
::grpc::internal::Call call_;
- ::grpc::experimental::MessageHolder<RequestType, ResponseType>* const
- allocator_state_;
+ MessageHolder<RequestType, ResponseType>* const allocator_state_;
std::function<void()> call_requester_;
// reactor_ can always be loaded/stored with relaxed memory ordering because
// its value is only set once, independently of other data in the object,
@@ -384,6 +379,9 @@ class CallbackClientStreamingHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
@@ -831,6 +829,9 @@ class CallbackBidiHandler : public ::grpc::internal::MethodHandler {
read_tag_.Set(
call_.call(),
[this, reactor](bool ok) {
+ if (GPR_UNLIKELY(!ok)) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
reactor->OnReadDone(ok);
this->MaybeDone(/*inlineable_ondone=*/true);
},
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h
index a73155e59fd..b92bf178649 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_context.h
@@ -19,6 +19,10 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
#define GRPCPP_IMPL_CODEGEN_SERVER_CONTEXT_H
+// IWYU pragma: private, include <grpcpp/server_context.h>
+
+#include <grpc/impl/codegen/port_platform.h>
+
#include <atomic>
#include <cassert>
#include <map>
@@ -26,8 +30,6 @@
#include <type_traits>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/impl/codegen/compression_types.h>
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/call_op_set.h>
@@ -63,6 +65,8 @@ class ServerReader;
template <class W>
class ServerWriter;
+extern CoreCodegenInterface* g_core_codegen_interface;
+
namespace internal {
template <class ServiceType, class RequestType, class ResponseType>
class BidiStreamingHandler;
@@ -101,22 +105,8 @@ class GenericServerContext;
class Server;
class ServerInterface;
class ContextAllocator;
-
-// TODO(vjpai): Remove namespace experimental when de-experimentalized fully.
-namespace experimental {
-
-typedef ::grpc::ServerContextBase ServerContextBase;
-typedef ::grpc::CallbackServerContext CallbackServerContext;
-
-} // namespace experimental
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class GenericCallbackServerContext;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
+
namespace internal {
class Call;
} // namespace internal
@@ -127,7 +117,7 @@ class ServerContextTestSpouse;
class DefaultReactorTestPeer;
} // namespace testing
-/// Base class of ServerContext. Experimental until callback API is final.
+/// Base class of ServerContext.
class ServerContextBase {
public:
virtual ~ServerContextBase();
@@ -154,11 +144,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddInitialMetadata(const TString& key, const TString& value);
/// Add the (\a key, \a value) pair to the initial metadata
@@ -175,11 +169,15 @@ class ServerContextBase {
/// must end in "-bin".
///
/// Metadata must conform to the following format:
- /// Custom-Metadata -> Binary-Header / ASCII-Header
- /// Binary-Header -> {Header-Name "-bin" } {binary value}
- /// ASCII-Header -> Header-Name ASCII-Value
- /// Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
- /// ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ /**
+ \verbatim
+ Custom-Metadata -> Binary-Header / ASCII-Header
+ Binary-Header -> {Header-Name "-bin" } {binary value}
+ ASCII-Header -> Header-Name ASCII-Value
+ Header-Name -> 1*( %x30-39 / %x61-7A / "_" / "-" / ".") ; 0-9 a-z _ - .
+ ASCII-Value -> 1*( %x20-%x7E ) ; space and printable ASCII
+ \endverbatim
+ **/
void AddTrailingMetadata(const TString& key, const TString& value);
/// Return whether this RPC failed before the server could provide its status
@@ -299,10 +297,7 @@ class ServerContextBase {
/// NOTE: This is an API for advanced users who need custom allocators.
/// Get and maybe mutate the allocator state associated with the current RPC.
/// Currently only applicable for callback unary RPC methods.
- /// WARNING: This is experimental API and could be changed or removed.
- ::grpc::experimental::RpcAllocatorState* GetRpcAllocatorState() {
- return message_allocator_state_;
- }
+ RpcAllocatorState* GetRpcAllocatorState() { return message_allocator_state_; }
/// Get a library-owned default unary reactor for use in minimal reaction
/// cases. This supports typical unary RPC usage of providing a response and
@@ -318,8 +313,6 @@ class ServerContextBase {
///
/// This method should not be called more than once or called after return
/// from the method handler.
- ///
- /// WARNING: This is experimental API and could be changed or removed.
::grpc::ServerUnaryReactor* DefaultReactor() {
// Short-circuit the case where a default reactor was already set up by
// the TestPeer.
@@ -394,11 +387,7 @@ class ServerContextBase {
friend class ::grpc::internal::FinishOnlyReactor;
friend class ::grpc::ClientContext;
friend class ::grpc::GenericServerContext;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
friend class ::grpc::GenericCallbackServerContext;
-#else
- friend class ::grpc::experimental::GenericCallbackServerContext;
-#endif
/// Prevent copying.
ServerContextBase(const ServerContextBase&);
@@ -429,11 +418,17 @@ class ServerContextBase {
return rpc_info_;
}
- void set_message_allocator_state(
- ::grpc::experimental::RpcAllocatorState* allocator_state) {
+ void set_message_allocator_state(RpcAllocatorState* allocator_state) {
message_allocator_state_ = allocator_state;
}
+ void MaybeMarkCancelledOnRead() {
+ if (g_core_codegen_interface->grpc_call_failed_before_recv_message(
+ call_.call)) {
+ marked_cancelled_.store(true, std::memory_order_release);
+ }
+ }
+
struct CallWrapper {
~CallWrapper();
@@ -469,7 +464,7 @@ class ServerContextBase {
bool has_pending_ops_ = false;
::grpc::experimental::ServerRpcInfo* rpc_info_ = nullptr;
- ::grpc::experimental::RpcAllocatorState* message_allocator_state_ = nullptr;
+ RpcAllocatorState* message_allocator_state_ = nullptr;
ContextAllocator* context_allocator_ = nullptr;
class Reactor : public ::grpc::ServerUnaryReactor {
@@ -524,6 +519,9 @@ class ServerContextBase {
typename std::aligned_storage<sizeof(Reactor), alignof(Reactor)>::type
default_reactor_;
std::atomic_bool default_reactor_used_{false};
+
+ std::atomic_bool marked_cancelled_{false};
+
std::unique_ptr<TestServerCallbackUnary> test_unary_;
};
@@ -633,24 +631,13 @@ class ContextAllocator {
virtual CallbackServerContext* NewCallbackServerContext() { return nullptr; }
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual experimental::GenericCallbackServerContext*
- NewGenericCallbackServerContext() {
- return nullptr;
- }
-#else
virtual GenericCallbackServerContext* NewGenericCallbackServerContext() {
return nullptr;
}
-#endif
virtual void Release(CallbackServerContext*) {}
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- virtual void Release(experimental::GenericCallbackServerContext*) {}
-#else
virtual void Release(GenericCallbackServerContext*) {}
-#endif
};
} // namespace grpc
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interceptor.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interceptor.h
index 7598e72a40e..3a8fd52acba 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interceptor.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERCEPTOR_H
+// IWYU pragma: private, include <grpcpp/support/server_interceptor.h>
+
#include <atomic>
#include <vector>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h
index 7fb50388268..e23b95c224b 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/server_interface.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
#define GRPCPP_IMPL_CODEGEN_SERVER_INTERFACE_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -50,13 +52,7 @@ namespace internal {
class ServerAsyncStreamingInterface;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
class ServerInterceptorFactoryInterface;
@@ -130,35 +126,12 @@ class ServerInterface : public internal::CallHook {
/// service. The service must exist for the lifetime of the Server instance.
virtual void RegisterAsyncGenericService(AsyncGenericService* service) = 0;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback generic service. This call does not take ownership of
/// the service. The service must exist for the lifetime of the Server
/// instance. May not be abstract since this is a post-1.0 API addition.
virtual void RegisterCallbackGenericService(CallbackGenericService*
/*service*/) {}
-#else
- /// NOTE: class experimental_registration_interface is not part of the public
- /// API of this class
- /// TODO(vjpai): Move these contents to public API when no longer experimental
- class experimental_registration_interface {
- public:
- virtual ~experimental_registration_interface() {}
- /// May not be abstract since this is a post-1.0 API addition
- virtual void RegisterCallbackGenericService(
- experimental::CallbackGenericService* /*service*/) {}
- virtual void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> /*context_allocator*/) {}
- };
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time. May not be abstract since this is a
- /// post-1.0 API addition
- virtual experimental_registration_interface* experimental_registration() {
- return nullptr;
- }
-#endif
/// Tries to bind \a server to the given \a addr.
///
@@ -383,7 +356,6 @@ class ServerInterface : public internal::CallHook {
return nullptr;
}
- // EXPERIMENTAL
// A method to get the callbackable completion queue associated with this
// server. If the return value is nullptr, this server doesn't support
// callback operations.
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h
index 57ca9f09447..182570ef2f8 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/service_type.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
#define GRPCPP_IMPL_CODEGEN_SERVICE_TYPE_H
+// IWYU pragma: private, include <grpcpp/impl/service_type.h>
+
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
@@ -99,29 +101,6 @@ class Service {
}
protected:
- // TODO(vjpai): Promote experimental contents once callback API is accepted
- class experimental_type {
- public:
- explicit experimental_type(Service* service) : service_(service) {}
-
- void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- service_->MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return service_->GetHandlerInternal(index);
- }
-
- private:
- Service* service_;
- };
-
- experimental_type experimental() { return experimental_type(this); }
-
template <class Message>
void RequestAsyncUnary(int index, ::grpc::ServerContext* context,
Message* request,
@@ -216,23 +195,7 @@ class Service {
methods_[idx]->SetMethodType(internal::RpcMethod::BIDI_STREAMING);
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
void MarkMethodCallback(int index, internal::MethodHandler* handler) {
- MarkMethodCallbackInternal(index, handler);
- }
-
- void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
- MarkMethodRawCallbackInternal(index, handler);
- }
-
- internal::MethodHandler* GetHandler(int index) {
- return GetHandlerInternal(index);
- }
-#endif
- private:
- // TODO(vjpai): migrate the Internal functions to mainline functions once
- // callback API is fully de-experimental
- void MarkMethodCallbackInternal(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -245,8 +208,7 @@ class Service {
internal::RpcServiceMethod::ApiType::CALL_BACK);
}
- void MarkMethodRawCallbackInternal(int index,
- internal::MethodHandler* handler) {
+ void MarkMethodRawCallback(int index, internal::MethodHandler* handler) {
// This does not have to be a hard error, however no one has approached us
// with a use case yet. Please file an issue if you believe you have one.
size_t idx = static_cast<size_t>(index);
@@ -259,11 +221,12 @@ class Service {
internal::RpcServiceMethod::ApiType::RAW_CALL_BACK);
}
- internal::MethodHandler* GetHandlerInternal(int index) {
+ internal::MethodHandler* GetHandler(int index) {
size_t idx = static_cast<size_t>(index);
return methods_[idx]->handler();
}
+ private:
friend class Server;
friend class ServerInterface;
ServerInterface* server_;
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/slice.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/slice.h
index 0b9752ccff8..3de44c8f90f 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/slice.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/slice.h
@@ -19,12 +19,13 @@
#ifndef GRPCPP_IMPL_CODEGEN_SLICE_H
#define GRPCPP_IMPL_CODEGEN_SLICE_H
+// IWYU pragma: private, include <grpcpp/support/slice.h>
+
+#include <grpc/impl/codegen/slice.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen_interface.h>
#include <grpcpp/impl/codegen/string_ref.h>
-#include <grpc/impl/codegen/slice.h>
-
namespace grpc {
/// A wrapper around \a grpc_slice.
@@ -74,6 +75,11 @@ class Slice final {
Slice(const Slice& other)
: slice_(g_core_codegen_interface->grpc_slice_ref(other.slice_)) {}
+ /// Move constructor, steals a reference.
+ Slice(Slice&& other) noexcept : slice_(other.slice_) {
+ other.slice_ = g_core_codegen_interface->grpc_empty_slice();
+ }
+
/// Assignment, reference count is unchanged.
Slice& operator=(Slice other) {
std::swap(slice_, other.slice_);
@@ -107,6 +113,12 @@ class Slice final {
/// Raw pointer to the end (one byte \em past the last element) of the slice.
const uint8_t* end() const { return GRPC_SLICE_END_PTR(slice_); }
+ /// Returns a substring of the `slice` as another slice.
+ Slice sub(size_t begin, size_t end) const {
+ return Slice(g_core_codegen_interface->grpc_slice_sub(slice_, begin, end),
+ STEAL_REF);
+ }
+
/// Raw C slice. Caller needs to call grpc_slice_unref when done.
grpc_slice c_slice() const {
return g_core_codegen_interface->grpc_slice_ref(slice_);
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/status.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/status.h
index a5ad6f32fef..358f2bb7f98 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/status.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/status.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_H
#define GRPCPP_IMPL_CODEGEN_STATUS_H
+// IWYU pragma: private, include <grpcpp/support/status.h>
+
#include <grpc/impl/codegen/status.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/status_code_enum.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/status_code_enum.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/status_code_enum.h
index bdd7ead6add..36ea24fdfdf 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/status_code_enum.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/status_code_enum.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
#define GRPCPP_IMPL_CODEGEN_STATUS_CODE_ENUM_H
+// IWYU pragma: private, include <grpcpp/support/status_code_enum.h>
+
namespace grpc {
enum StatusCode {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/string_ref.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/string_ref.h
index a13533eca5a..f0bb76ea5ce 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/string_ref.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/string_ref.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_STRING_REF_H
#define GRPCPP_IMPL_CODEGEN_STRING_REF_H
+// IWYU pragma: private, include <grpcpp/support/string_ref.h>
+
#include <string.h>
#include <algorithm>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/stub_options.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/stub_options.h
index a56695a8f82..efa1e38ee02 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/stub_options.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/stub_options.h
@@ -19,10 +19,25 @@
#ifndef GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
#define GRPCPP_IMPL_CODEGEN_STUB_OPTIONS_H
+// IWYU pragma: private, include <grpcpp/support/stub_options.h>
+
namespace grpc {
/// Useful interface for generated stubs
-class StubOptions {};
+class StubOptions {
+ public:
+ StubOptions() = default;
+ explicit StubOptions(const char* suffix_for_stats)
+ : suffix_for_stats_(suffix_for_stats) {}
+
+ void set_suffix_for_stats(const char* suffix_for_stats) {
+ suffix_for_stats_ = suffix_for_stats;
+ }
+ const char* suffix_for_stats() const { return suffix_for_stats_; }
+
+ private:
+ const char* suffix_for_stats_ = nullptr;
+};
} // namespace grpc
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync.h
index bf89a0e39a2..e3954cc731b 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync.h
@@ -19,6 +19,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_H
#define GRPCPP_IMPL_CODEGEN_SYNC_H
+// IWYU pragma: private
+
#include <grpc/impl/codegen/port_platform.h>
#ifdef GPR_HAS_PTHREAD_H
@@ -27,13 +29,12 @@
#include <mutex>
+#include "y_absl/synchronization/mutex.h"
+
#include <grpc/impl/codegen/log.h>
#include <grpc/impl/codegen/sync.h>
-
#include <grpcpp/impl/codegen/core_codegen_interface.h>
-#include "y_absl/synchronization/mutex.h"
-
// The core library is not accessible in C++ codegen headers, and vice versa.
// Thus, we need to have duplicate headers with similar functionality.
// Make sure any change to this file is also reflected in
@@ -46,7 +47,7 @@
namespace grpc {
namespace internal {
-#ifdef GRPCPP_ABSEIL_SYNC
+#ifdef GPR_ABSEIL_SYNC
using Mutex = y_absl::Mutex;
using MutexLock = y_absl::MutexLock;
@@ -141,9 +142,10 @@ class CondVar {
gpr_cv cv_;
};
-#endif // GRPCPP_ABSEIL_SYNC
+#endif // GPR_ABSEIL_SYNC
template <typename Predicate>
+GRPC_DEPRECATED("incompatible with thread safety analysis")
static void WaitUntil(CondVar* cv, Mutex* mu, Predicate pred) {
while (!pred()) {
cv->Wait(mu);
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h
index 408f42f280d..1ce3acdaf74 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/sync_stream.h
@@ -18,6 +18,8 @@
#ifndef GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
#define GRPCPP_IMPL_CODEGEN_SYNC_STREAM_H
+// IWYU pragma: private, include <grpcpp/support/sync_stream.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_context.h>
@@ -607,7 +609,11 @@ class ServerReader final : public ServerReaderInterface<R> {
::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
private:
@@ -734,7 +740,11 @@ class ServerReaderWriterBody final {
::grpc::internal::CallOpSet<::grpc::internal::CallOpRecvMessage<R>> ops;
ops.RecvMessage(msg);
call_->PerformOps(&ops);
- return call_->cq()->Pluck(&ops) && ops.got_message;
+ bool ok = call_->cq()->Pluck(&ops) && ops.got_message;
+ if (!ok) {
+ ctx_->MaybeMarkCancelledOnRead();
+ }
+ return ok;
}
bool Write(const W& msg, ::grpc::WriteOptions options) {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/codegen/time.h b/contrib/libs/grpc/include/grpcpp/impl/codegen/time.h
index 88cf12fd829..41bf69f3764 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/codegen/time.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/codegen/time.h
@@ -23,6 +23,8 @@
#pragma GCC system_header
#endif
+// IWYU pragma: private, include <grpcpp/support/time.h>
+
#include <chrono>
#include <grpc/impl/codegen/grpc_types.h>
diff --git a/contrib/libs/grpc/include/grpcpp/impl/grpc_library.h b/contrib/libs/grpc/include/grpcpp/impl/grpc_library.h
index 3711c098790..0afca8e46fe 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/grpc_library.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/grpc_library.h
@@ -24,7 +24,7 @@
#include <grpc/grpc.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/core_codegen.h>
-#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/grpc_library.h> // IWYU pragma: export
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/impl/rpc_method.h b/contrib/libs/grpc/include/grpcpp/impl/rpc_method.h
index 5da70416718..aeef8b778cf 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/rpc_method.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/rpc_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_METHOD_H
#define GRPCPP_IMPL_RPC_METHOD_H
-#include <grpcpp/impl/codegen/rpc_method.h>
+#include <grpcpp/impl/codegen/rpc_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_METHOD_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/rpc_service_method.h b/contrib/libs/grpc/include/grpcpp/impl/rpc_service_method.h
index ef70a3a1008..86cb2dc5a73 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/rpc_service_method.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/rpc_service_method.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_RPC_SERVICE_METHOD_H
#define GRPCPP_IMPL_RPC_SERVICE_METHOD_H
-#include <grpcpp/impl/codegen/rpc_service_method.h>
+#include <grpcpp/impl/codegen/rpc_service_method.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_RPC_SERVICE_METHOD_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/serialization_traits.h b/contrib/libs/grpc/include/grpcpp/impl/serialization_traits.h
index 95194fbd894..6da8b4dfcc7 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/serialization_traits.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/serialization_traits.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERIALIZATION_TRAITS_H
#define GRPCPP_IMPL_SERIALIZATION_TRAITS_H
-#include <grpcpp/impl/codegen/serialization_traits.h>
+#include <grpcpp/impl/codegen/serialization_traits.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERIALIZATION_TRAITS_H
diff --git a/contrib/libs/grpc/include/grpcpp/impl/service_type.h b/contrib/libs/grpc/include/grpcpp/impl/service_type.h
index 250bc8cd56d..de45c4266a7 100644
--- a/contrib/libs/grpc/include/grpcpp/impl/service_type.h
+++ b/contrib/libs/grpc/include/grpcpp/impl/service_type.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_IMPL_SERVICE_TYPE_H
#define GRPCPP_IMPL_SERVICE_TYPE_H
-#include <grpcpp/impl/codegen/service_type.h>
+#include <grpcpp/impl/codegen/service_type.h> // IWYU pragma: export
#endif // GRPCPP_IMPL_SERVICE_TYPE_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/alts_context.h b/contrib/libs/grpc/include/grpcpp/security/alts_context.h
index cd1f640a76a..125d25310f6 100644
--- a/contrib/libs/grpc/include/grpcpp/security/alts_context.h
+++ b/contrib/libs/grpc/include/grpcpp/security/alts_context.h
@@ -19,12 +19,12 @@
#ifndef GRPCPP_SECURITY_ALTS_CONTEXT_H
#define GRPCPP_SECURITY_ALTS_CONTEXT_H
-#include <grpc/grpc_security_constants.h>
-#include <grpcpp/security/auth_context.h>
-
#include <map>
#include <memory>
+#include <grpc/grpc_security_constants.h>
+#include <grpcpp/security/auth_context.h>
+
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/security/alts_util.h b/contrib/libs/grpc/include/grpcpp/security/alts_util.h
index b8f935ad95e..25322e31ce1 100644
--- a/contrib/libs/grpc/include/grpcpp/security/alts_util.h
+++ b/contrib/libs/grpc/include/grpcpp/security/alts_util.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SECURITY_ALTS_UTIL_H
#define GRPCPP_SECURITY_ALTS_UTIL_H
+#include <memory>
+
#include <grpc/grpc_security_constants.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/security/alts_context.h>
#include <grpcpp/security/auth_context.h>
-#include <memory>
-
struct grpc_gcp_AltsContext;
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/security/auth_context.h b/contrib/libs/grpc/include/grpcpp/security/auth_context.h
index 7a6f2cb718b..17784508e2e 100644
--- a/contrib/libs/grpc/include/grpcpp/security/auth_context.h
+++ b/contrib/libs/grpc/include/grpcpp/security/auth_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SECURITY_AUTH_CONTEXT_H
#define GRPCPP_SECURITY_AUTH_CONTEXT_H
-#include <grpcpp/impl/codegen/security/auth_context.h>
+#include <grpcpp/impl/codegen/security/auth_context.h> // IWYU pragma: export
#endif // GRPCPP_SECURITY_AUTH_CONTEXT_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/authorization_policy_provider.h b/contrib/libs/grpc/include/grpcpp/security/authorization_policy_provider.h
new file mode 100644
index 00000000000..1d18f700caf
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/security/authorization_policy_provider.h
@@ -0,0 +1,92 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <memory>
+
+#include <grpc/status.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+
+// TODO(yihuazhang): remove the forward declarations here and include
+// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
+typedef struct grpc_authorization_policy_provider
+ grpc_authorization_policy_provider;
+
+namespace grpc {
+namespace experimental {
+
+// Wrapper around C-core grpc_authorization_policy_provider. Internally, it
+// handles creating and updating authorization engine objects, using SDK
+// authorization policy.
+class AuthorizationPolicyProviderInterface {
+ public:
+ virtual ~AuthorizationPolicyProviderInterface() = default;
+ virtual grpc_authorization_policy_provider* c_provider() = 0;
+};
+
+// Implementation obtains authorization policy from static string. This provider
+// will always return the same authorization engines.
+class StaticDataAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<StaticDataAuthorizationPolicyProvider> Create(
+ const TString& authz_policy, grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // StaticDataAuthorizationPolicyProvider.
+ explicit StaticDataAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~StaticDataAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+// Implementation obtains authorization policy by watching for changes in
+// filesystem.
+class FileWatcherAuthorizationPolicyProvider
+ : public AuthorizationPolicyProviderInterface {
+ public:
+ static std::shared_ptr<FileWatcherAuthorizationPolicyProvider> Create(
+ const TString& authz_policy_path, unsigned int refresh_interval_sec,
+ grpc::Status* status);
+
+ // Use factory method "Create" to create an instance of
+ // FileWatcherAuthorizationPolicyProvider.
+ explicit FileWatcherAuthorizationPolicyProvider(
+ grpc_authorization_policy_provider* provider)
+ : c_provider_(provider) {}
+
+ ~FileWatcherAuthorizationPolicyProvider() override;
+
+ grpc_authorization_policy_provider* c_provider() override {
+ return c_provider_;
+ }
+
+ private:
+ grpc_authorization_policy_provider* c_provider_ = nullptr;
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/binder_credentials.h b/contrib/libs/grpc/include/grpcpp/security/binder_credentials.h
new file mode 100644
index 00000000000..f511837ef2e
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/security/binder_credentials.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+#define GRPCPP_SECURITY_BINDER_CREDENTIALS_H
+
+#include <memory>
+
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/security/server_credentials.h>
+
+namespace grpc {
+
+class ChannelCredentials;
+
+namespace experimental {
+
+/// EXPERIMENTAL Builds Binder ServerCredentials.
+///
+/// This should be used along with `binder:` URI scheme. The path in the URI can
+/// later be used to access the server's endpoint binder.
+/// Note that calling \a ServerBuilder::AddListeningPort() with Binder
+/// ServerCredentials in a non-supported environment will make the subsequent
+/// call to \a ServerBuilder::BuildAndStart() return a null pointer.
+std::shared_ptr<grpc::ServerCredentials> BinderServerCredentials(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_CREDENTIALS_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/binder_security_policy.h b/contrib/libs/grpc/include/grpcpp/security/binder_security_policy.h
new file mode 100644
index 00000000000..9b825e759b1
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/security/binder_security_policy.h
@@ -0,0 +1,58 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+#define GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
+
+#include <memory>
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+// EXPERIMENTAL Determinines if a connection is allowed to be
+// established on Android. See https://source.android.com/security/app-sandbox
+// for more info about UID.
+class SecurityPolicy {
+ public:
+ virtual ~SecurityPolicy() = default;
+ // Returns true if the UID is authorized to connect.
+ // Must return the same value for the same inputs so callers can safely cache
+ // the result.
+ virtual bool IsAuthorized(int uid) = 0;
+};
+
+// EXPERIMENTAL Allows all connection. Anything on the Android device will be
+// able to connect, use with caution!
+class UntrustedSecurityPolicy : public SecurityPolicy {
+ public:
+ UntrustedSecurityPolicy();
+ ~UntrustedSecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+// EXPERIMENTAL Only allows the connections from processes with the same UID. In
+// most cases this means "from the same APK".
+class InternalOnlySecurityPolicy : public SecurityPolicy {
+ public:
+ InternalOnlySecurityPolicy();
+ ~InternalOnlySecurityPolicy() override;
+ bool IsAuthorized(int uid) override;
+};
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_BINDER_SECURITY_POLICY_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/credentials.h b/contrib/libs/grpc/include/grpcpp/security/credentials.h
index fded203821d..d6fb5a42bea 100644
--- a/contrib/libs/grpc/include/grpcpp/security/credentials.h
+++ b/contrib/libs/grpc/include/grpcpp/security/credentials.h
@@ -59,11 +59,17 @@ std::shared_ptr<grpc::Channel> CreateCustomChannelWithInterceptors(
std::unique_ptr<grpc::experimental::ClientInterceptorFactoryInterface>>
interceptor_creators);
-/// Builds XDS Credentials.
+GRPC_DEPRECATED(
+ "Use grpc::XdsCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
std::shared_ptr<ChannelCredentials> XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
} // namespace experimental
+/// Builds XDS Credentials.
+std::shared_ptr<ChannelCredentials> XdsCredentials(
+ const std::shared_ptr<ChannelCredentials>& fallback_creds);
+
/// A channel credentials object encapsulates all the state needed by a client
/// to authenticate with a server for a given channel.
/// It can make various assertions, e.g., about the client’s identity, role
@@ -84,7 +90,7 @@ class ChannelCredentials : private grpc::GrpcLibraryCodegen {
// AsSecureCredentials(). Once we are able to remove insecure builds from gRPC
// (and also internal dependencies on the indirect method of creating a
// channel through credentials), we would be able to remove this.
- friend std::shared_ptr<ChannelCredentials> grpc::experimental::XdsCredentials(
+ friend std::shared_ptr<ChannelCredentials> grpc::XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds);
virtual SecureChannelCredentials* AsSecureCredentials() = 0;
diff --git a/contrib/libs/grpc/include/grpcpp/security/server_credentials.h b/contrib/libs/grpc/include/grpcpp/security/server_credentials.h
index 290b410c1ce..d402cd62a79 100644
--- a/contrib/libs/grpc/include/grpcpp/security/server_credentials.h
+++ b/contrib/libs/grpc/include/grpcpp/security/server_credentials.h
@@ -60,10 +60,16 @@ struct SslServerCredentialsOptions {
grpc_ssl_client_certificate_request_type client_certificate_request;
};
-namespace experimental {
/// Builds Xds ServerCredentials given fallback credentials
std::shared_ptr<ServerCredentials> XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
+
+namespace experimental {
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerCredentials instead. The experimental version will be "
+ "deleted after the 1.41 release.")
+std::shared_ptr<ServerCredentials> XdsServerCredentials(
+ const std::shared_ptr<ServerCredentials>& fallback_credentials);
} // namespace experimental
/// Wrapper around \a grpc_server_credentials, a way to authenticate a server.
@@ -83,8 +89,7 @@ class ServerCredentials : private grpc::GrpcLibraryCodegen {
// We need this friend declaration for access to Insecure() and
// AsSecureServerCredentials(). When these two functions are no longer
// necessary, this friend declaration can be removed too.
- friend std::shared_ptr<ServerCredentials>
- grpc::experimental::XdsServerCredentials(
+ friend std::shared_ptr<ServerCredentials> grpc::XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials);
/// Tries to bind \a server to the given \a addr (eg, localhost:1234,
diff --git a/contrib/libs/grpc/include/grpcpp/security/tls_certificate_provider.h b/contrib/libs/grpc/include/grpcpp/security/tls_certificate_provider.h
index 12c60452d22..80bc668d8a5 100644
--- a/contrib/libs/grpc/include/grpcpp/security/tls_certificate_provider.h
+++ b/contrib/libs/grpc/include/grpcpp/security/tls_certificate_provider.h
@@ -17,15 +17,15 @@
#ifndef GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
#define GRPCPP_SECURITY_TLS_CERTIFICATE_PROVIDER_H
+#include <memory>
+#include <vector>
+
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/grpc_library.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
// TODO(yihuazhang): remove the forward declaration here and include
// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
diff --git a/contrib/libs/grpc/include/grpcpp/security/tls_certificate_verifier.h b/contrib/libs/grpc/include/grpcpp/security/tls_certificate_verifier.h
new file mode 100644
index 00000000000..63f285ece44
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/security/tls_certificate_verifier.h
@@ -0,0 +1,225 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+#define GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include <grpc/grpc_security_constants.h>
+#include <grpc/status.h>
+#include <grpc/support/log.h>
+#include <grpcpp/impl/codegen/grpc_library.h>
+#include <grpcpp/impl/codegen/sync.h>
+#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/support/config.h>
+#include <grpcpp/support/string_ref.h>
+
+// TODO(yihuazhang): remove the forward declaration here and include
+// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
+typedef struct grpc_tls_custom_verification_check_request
+ grpc_tls_custom_verification_check_request;
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
+typedef struct grpc_tls_certificate_verifier_external
+ grpc_tls_certificate_verifier_external;
+typedef void (*grpc_tls_on_custom_verification_check_done_cb)(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+extern "C" grpc_tls_certificate_verifier*
+grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier);
+
+namespace grpc {
+namespace experimental {
+
+// Contains the verification-related information associated with a connection
+// request. Users should not directly create or destroy this request object, but
+// shall interact with it through CertificateVerifier's Verify() and Cancel().
+class TlsCustomVerificationCheckRequest {
+ public:
+ explicit TlsCustomVerificationCheckRequest(
+ grpc_tls_custom_verification_check_request* request);
+ ~TlsCustomVerificationCheckRequest() {}
+
+ grpc::string_ref target_name() const;
+ grpc::string_ref peer_cert() const;
+ grpc::string_ref peer_cert_full_chain() const;
+ grpc::string_ref common_name() const;
+ std::vector<grpc::string_ref> uri_names() const;
+ std::vector<grpc::string_ref> dns_names() const;
+ std::vector<grpc::string_ref> email_names() const;
+ std::vector<grpc::string_ref> ip_names() const;
+
+ grpc_tls_custom_verification_check_request* c_request() { return c_request_; }
+
+ private:
+ grpc_tls_custom_verification_check_request* c_request_ = nullptr;
+};
+
+// The base class of all internal verifier implementations, and the ultimate
+// class that all external verifiers will eventually be transformed into.
+// To implement a custom verifier, do not extend this class; instead,
+// implement a subclass of ExternalCertificateVerifier. Note that custom
+// verifier implementations can compose their functionality with existing
+// implementations of this interface, such as HostnameVerifier, by delegating
+// to an instance of that class.
+class CertificateVerifier {
+ public:
+ explicit CertificateVerifier(grpc_tls_certificate_verifier* v);
+
+ ~CertificateVerifier();
+
+ // Verifies a connection request, based on the logic specified in an internal
+ // verifier. The check on each internal verifier could be either synchronous
+ // or asynchronous, and we will need to use return value to know.
+ //
+ // request: the verification information associated with this request
+ // callback: This will only take effect if the verifier is asynchronous.
+ // The function that gRPC will invoke when the verifier has already
+ // completed its asynchronous check. Callers can use this function
+ // to perform any additional checks. The input parameter of the
+ // std::function indicates the status of the verifier check.
+ // sync_status: This will only be useful if the verifier is synchronous.
+ // The status of the verifier as it has already done it's
+ // synchronous check.
+ // return: return true if executed synchronously, otherwise return false
+ bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status);
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending.
+ //
+ // request: the verification information associated with this request
+ void Cancel(TlsCustomVerificationCheckRequest* request);
+
+ // Gets the core verifier used internally.
+ grpc_tls_certificate_verifier* c_verifier() { return verifier_; }
+
+ private:
+ static void AsyncCheckDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details);
+
+ grpc_tls_certificate_verifier* verifier_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*,
+ std::function<void(grpc::Status)>>
+ request_map_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// The base class of all external, user-specified verifiers. Users should
+// inherit this class to implement a custom verifier.
+// Note that while implementing the custom verifier that extends this class, it
+// is possible to compose an existing ExternalCertificateVerifier or
+// CertificateVerifier, inside the Verify() and Cancel() function of the new
+// custom verifier.
+class ExternalCertificateVerifier {
+ public:
+ // A factory method for creating a |CertificateVerifier| from this class. All
+ // the user-implemented verifiers should use this function to be converted to
+ // verifiers compatible with |TlsCredentialsOptions|.
+ // The resulting CertificateVerifier takes ownership of the newly instantiated
+ // Subclass.
+ template <typename Subclass, typename... Args>
+ static std::shared_ptr<CertificateVerifier> Create(Args&&... args) {
+ grpc::internal::GrpcLibraryInitializer g_gli_initializer;
+ g_gli_initializer.summon();
+ auto* external_verifier = new Subclass(std::forward<Args>(args)...);
+ return std::make_shared<CertificateVerifier>(
+ grpc_tls_certificate_verifier_external_create(
+ external_verifier->base_));
+ }
+
+ // The verification logic that will be performed after the TLS handshake
+ // completes. Implementers can choose to do their checks synchronously or
+ // asynchronously.
+ //
+ // request: the verification information associated with this request
+ // callback: This should only be used if your check is done asynchronously.
+ // When the asynchronous work is done, invoke this callback function
+ // with the proper status, indicating the success or the failure of
+ // the check. The implementer MUST NOT invoke this |callback| in the
+ // same thread before Verify() returns, otherwise it can lead to
+ // deadlocks.
+ // sync_status: This should only be used if your check is done synchronously.
+ // Modifies this value to indicate the success or the failure of
+ // the check.
+ // return: return true if your check is done synchronously, otherwise return
+ // false
+ virtual bool Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) = 0;
+
+ // Cancels a verification request previously started via Verify().
+ // Used when the connection attempt times out or is cancelled while an async
+ // verification request is pending. The implementation should abort whatever
+ // async operation it is waiting for and quickly invoke the callback that was
+ // passed to Verify() with a status indicating the cancellation.
+ //
+ // request: the verification information associated with this request
+ virtual void Cancel(TlsCustomVerificationCheckRequest* request) = 0;
+
+ protected:
+ ExternalCertificateVerifier();
+
+ virtual ~ExternalCertificateVerifier();
+
+ private:
+ struct AsyncRequestState {
+ AsyncRequestState(grpc_tls_on_custom_verification_check_done_cb cb,
+ void* arg,
+ grpc_tls_custom_verification_check_request* request)
+ : callback(cb), callback_arg(arg), cpp_request(request) {}
+
+ grpc_tls_on_custom_verification_check_done_cb callback;
+ void* callback_arg;
+ TlsCustomVerificationCheckRequest cpp_request;
+ };
+
+ static int VerifyInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+
+ static void CancelInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request);
+
+ static void DestructInCoreExternalVerifier(void* user_data);
+
+ // TODO(yihuazhang): after the insecure build is removed, make this an object
+ // member instead of a pointer.
+ grpc_tls_certificate_verifier_external* base_ = nullptr;
+ grpc::internal::Mutex mu_;
+ std::map<grpc_tls_custom_verification_check_request*, AsyncRequestState>
+ request_map_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+class HostNameCertificateVerifier : public CertificateVerifier {
+ public:
+ HostNameCertificateVerifier();
+};
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GRPCPP_SECURITY_TLS_CERTIFICATE_VERIFIER_H
diff --git a/contrib/libs/grpc/include/grpcpp/security/tls_credentials_options.h b/contrib/libs/grpc/include/grpcpp/security/tls_credentials_options.h
index b849ec2e6bd..471e23be0ac 100644
--- a/contrib/libs/grpc/include/grpcpp/security/tls_credentials_options.h
+++ b/contrib/libs/grpc/include/grpcpp/security/tls_credentials_options.h
@@ -19,15 +19,16 @@
#ifndef GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
#define GRPCPP_SECURITY_TLS_CREDENTIALS_OPTIONS_H
+#include <memory>
+#include <vector>
+
#include <grpc/grpc_security_constants.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpcpp/security/tls_certificate_provider.h>
+#include <grpcpp/security/tls_certificate_verifier.h>
#include <grpcpp/support/config.h>
-#include <memory>
-#include <vector>
-
// TODO(yihuazhang): remove the forward declaration here and include
// <grpc/grpc_security.h> directly once the insecure builds are cleaned up.
typedef struct grpc_tls_server_authorization_check_arg
@@ -36,116 +37,11 @@ typedef struct grpc_tls_server_authorization_check_config
grpc_tls_server_authorization_check_config;
typedef struct grpc_tls_credentials_options grpc_tls_credentials_options;
typedef struct grpc_tls_certificate_provider grpc_tls_certificate_provider;
+typedef struct grpc_tls_certificate_verifier grpc_tls_certificate_verifier;
namespace grpc {
namespace experimental {
-/** TLS server authorization check arguments, wraps
- * grpc_tls_server_authorization_check_arg. It is used for experimental
- * purposes for now and it is subject to change.
- *
- * The server authorization check arg contains all the info necessary to
- * schedule/cancel a server authorization check request. The callback function
- * must be called after finishing the schedule operation. See the description
- * of the grpc_tls_server_authorization_check_arg struct in grpc_security.h for
- * more details. **/
-class TlsServerAuthorizationCheckArg {
- public:
- /** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed
- * to the constructor. One must remember to free any memory allocated to the
- * C arg after using the setter functions below. **/
- explicit TlsServerAuthorizationCheckArg(
- grpc_tls_server_authorization_check_arg* arg);
- ~TlsServerAuthorizationCheckArg();
-
- /** Getters for member fields. **/
- void* cb_user_data() const;
- int success() const;
- TString target_name() const;
- TString peer_cert() const;
- TString peer_cert_full_chain() const;
- grpc_status_code status() const;
- TString error_details() const;
-
- /** Setters for member fields. **/
- void set_cb_user_data(void* cb_user_data);
- void set_success(int success);
- void set_target_name(const TString& target_name);
- void set_peer_cert(const TString& peer_cert);
- void set_peer_cert_full_chain(const TString& peer_cert_full_chain);
- void set_status(grpc_status_code status);
- void set_error_details(const TString& error_details);
-
- /** Calls the C arg's callback function. **/
- void OnServerAuthorizationCheckDoneCallback();
-
- private:
- grpc_tls_server_authorization_check_arg* c_arg_;
-};
-
-/** An interface that the application derives and uses to instantiate a
- * TlsServerAuthorizationCheckConfig instance. Refer to the definition of the
- * grpc_tls_server_authorization_check_config in grpc_tls_credentials_options.h
- * for more details on the expectations of the member functions of the
- * interface.
- * **/
-struct TlsServerAuthorizationCheckInterface {
- virtual ~TlsServerAuthorizationCheckInterface() = default;
- /** A callback that invokes the server authorization check. **/
- virtual int Schedule(TlsServerAuthorizationCheckArg* arg) = 0;
- /** A callback that cancels a server authorization check request. **/
- virtual void Cancel(TlsServerAuthorizationCheckArg* /* arg */) {}
-};
-
-/** TLS server authorization check config, wraps
- * grps_tls_server_authorization_check_config. It is used for experimental
- * purposes for now and it is subject to change. **/
-class TlsServerAuthorizationCheckConfig {
- public:
- explicit TlsServerAuthorizationCheckConfig(
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface);
- ~TlsServerAuthorizationCheckConfig();
-
- int Schedule(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return 1;
- }
- return server_authorization_check_interface_->Schedule(arg);
- }
-
- void Cancel(TlsServerAuthorizationCheckArg* arg) const {
- if (server_authorization_check_interface_ == nullptr) {
- gpr_log(GPR_ERROR, "server authorization check interface is nullptr");
- if (arg != nullptr) {
- arg->set_status(GRPC_STATUS_NOT_FOUND);
- arg->set_error_details(
- "the interface of the server authorization check config is "
- "nullptr");
- }
- return;
- }
- server_authorization_check_interface_->Cancel(arg);
- }
-
- /** Returns C struct for the server authorization check config. **/
- grpc_tls_server_authorization_check_config* c_config() const {
- return c_config_;
- }
-
- private:
- grpc_tls_server_authorization_check_config* c_config_;
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface_;
-};
-
// Base class of configurable options specified by users to configure their
// certain security features supported in TLS. It is used for experimental
// purposes for now and it is subject to change.
@@ -187,6 +83,19 @@ class TlsCredentialsOptions {
//
// @param identity_cert_name the name of identity key-cert pairs being set.
void set_identity_cert_name(const TString& identity_cert_name);
+ // Sets the certificate verifier used to perform post-handshake peer identity
+ // checks.
+ void set_certificate_verifier(
+ std::shared_ptr<CertificateVerifier> certificate_verifier);
+ // Sets the options of whether to check the hostname of the peer on a per-call
+ // basis. This is usually used in a combination with virtual hosting at the
+ // client side, where each individual call on a channel can have a different
+ // host associated with it.
+ // This check is intended to verify that the host specified for the individual
+ // call is covered by the cert that the peer presented.
+ // We will perform such checks by default. This should be disabled if
+ // verifiers other than the host name verifier is used.
+ void set_check_call_host(bool check_call_host);
// ----- Getters for member fields ----
// Get the internal c options. This function shall be used only internally.
@@ -196,6 +105,7 @@ class TlsCredentialsOptions {
private:
std::shared_ptr<CertificateProviderInterface> certificate_provider_;
+ std::shared_ptr<CertificateVerifier> certificate_verifier_;
grpc_tls_credentials_options* c_credentials_options_ = nullptr;
};
@@ -207,14 +117,9 @@ class TlsCredentialsOptions {
// It is used for experimental purposes for now and it is subject to change.
class TlsChannelCredentialsOptions final : public TlsCredentialsOptions {
public:
- // Sets the option to verify the server.
- // The default is GRPC_TLS_SERVER_VERIFICATION.
- void set_server_verification_option(
- grpc_tls_server_verification_option server_verification_option);
- // Sets the custom authorization config.
- void set_server_authorization_check_config(
- std::shared_ptr<TlsServerAuthorizationCheckConfig>
- authorization_check_config);
+ // Sets the decision of whether to do a crypto check on the server certs.
+ // The default is true.
+ void set_verify_server_certs(bool verify_server_certs);
private:
};
diff --git a/contrib/libs/grpc/include/grpcpp/server.h b/contrib/libs/grpc/include/grpcpp/server.h
index 06e6e80e5b6..379a465ee39 100644
--- a/contrib/libs/grpc/include/grpcpp/server.h
+++ b/contrib/libs/grpc/include/grpcpp/server.h
@@ -23,12 +23,12 @@
#pragma GCC system_header
#endif
+#include <grpc/impl/codegen/port_platform.h>
+
#include <list>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/atm.h>
#include <grpcpp/channel.h>
@@ -241,7 +241,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// service. The service must exist for the lifetime of the Server instance.
void RegisterAsyncGenericService(AsyncGenericService* service) override;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
/// Register a callback-based generic service. This call does not take
/// ownership of theservice. The service must exist for the lifetime of the
/// Server instance.
@@ -252,41 +251,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
context_allocator_ = std::move(context_allocator);
}
-#else
- /// NOTE: class experimental_registration_type is not part of the public API
- /// of this class
- /// TODO(vjpai): Move these contents to the public API of Server when
- /// they are no longer experimental
- class experimental_registration_type final
- : public experimental_registration_interface {
- public:
- explicit experimental_registration_type(Server* server) : server_(server) {}
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) override {
- server_->RegisterCallbackGenericService(service);
- }
-
- void RegisterContextAllocator(
- std::unique_ptr<ContextAllocator> context_allocator) override {
- server_->context_allocator_ = std::move(context_allocator);
- }
-
- private:
- Server* server_;
- };
-
- /// TODO(vjpai): Mark this override when experimental type above is deleted
- void RegisterCallbackGenericService(
- experimental::CallbackGenericService* service);
-
- /// NOTE: The function experimental_registration() is not stable public API.
- /// It is a view to the experimental components of this class. It may be
- /// changed or removed at any time.
- experimental_registration_interface* experimental_registration() override {
- return &experimental_registration_;
- }
-#endif
-
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) override;
@@ -331,12 +295,6 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// the \a sync_server_cqs)
std::vector<std::unique_ptr<SyncRequestThreadManager>> sync_req_mgrs_;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- // For registering experimental callback generic service; remove when that
- // method longer experimental
- experimental_registration_type experimental_registration_{this};
-#endif
-
// Server status
internal::Mutex mu_;
bool started_;
@@ -368,11 +326,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// When appropriate, use a default callback generic service to handle
// unimplemented methods
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
std::unique_ptr<CallbackGenericService> unimplemented_service_;
-#else
- std::unique_ptr<experimental::CallbackGenericService> unimplemented_service_;
-#endif
// A special handler for resource exhausted in sync case
std::unique_ptr<internal::MethodHandler> resource_exhausted_handler_;
@@ -384,7 +338,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// with this server (if any). It is set on the first call to CallbackCQ().
// It is _not owned_ by the server; ownership belongs with its internal
// shutdown callback tag (invoked when the CQ is fully shutdown).
- CompletionQueue* callback_cq_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ std::atomic<CompletionQueue*> callback_cq_{nullptr};
// List of CQs passed in by user that must be Shutdown only after Server is
// Shutdown. Even though this is only used with NDEBUG, instantiate it in all
diff --git a/contrib/libs/grpc/include/grpcpp/server_builder.h b/contrib/libs/grpc/include/grpcpp/server_builder.h
index 109514facd3..7146484274f 100644
--- a/contrib/libs/grpc/include/grpcpp/server_builder.h
+++ b/contrib/libs/grpc/include/grpcpp/server_builder.h
@@ -19,13 +19,13 @@
#ifndef GRPCPP_SERVER_BUILDER_H
#define GRPCPP_SERVER_BUILDER_H
+#include <grpc/impl/codegen/port_platform.h>
+
#include <climits>
#include <map>
#include <memory>
#include <vector>
-#include <grpc/impl/codegen/port_platform.h>
-
#include <grpc/compression.h>
#include <grpc/support/cpu.h>
#include <grpc/support/workaround_list.h>
@@ -33,6 +33,7 @@
#include <grpcpp/impl/codegen/server_interceptor.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
+#include <grpcpp/security/authorization_policy_provider.h>
#include <grpcpp/server.h>
#include <grpcpp/support/config.h>
@@ -55,13 +56,7 @@ namespace internal {
class ExternalConnectionAcceptorImpl;
} // namespace internal
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-namespace experimental {
-#endif
class CallbackGenericService;
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-} // namespace experimental
-#endif
namespace experimental {
// EXPERIMENTAL API:
@@ -121,8 +116,8 @@ class ServerBuilder {
/// \param addr_uri The address to try to bind to the server in URI form. If
/// the scheme name is omitted, "dns:///" is assumed. To bind to any address,
/// please use IPv6 any, i.e., [::]:<port>, which also accepts IPv4
- /// connections. Valid values include dns:///localhost:1234, /
- /// 192.168.1.1:31416, dns:///[::1]:27182, etc.).
+ /// connections. Valid values include dns:///localhost:1234,
+ /// 192.168.1.1:31416, dns:///[::1]:27182, etc.
/// \param creds The credentials associated with the server.
/// \param[out] selected_port If not `nullptr`, gets populated with the port
/// number bound to the \a grpc::Server for the corresponding endpoint after
@@ -269,20 +264,6 @@ class ServerBuilder {
builder_->interceptor_creators_ = std::move(interceptor_creators);
}
- /// Set the allocator for creating and releasing callback server context.
- /// Takes the owndership of the allocator.
- ServerBuilder& SetContextAllocator(
- std::unique_ptr<grpc::ContextAllocator> context_allocator);
-
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
- /// Register a generic service that uses the callback API.
- /// Matches requests with any :authority
- /// This is mostly useful for writing generic gRPC Proxies where the exact
- /// serialization format is unknown
- ServerBuilder& RegisterCallbackGenericService(
- grpc::experimental::CallbackGenericService* service);
-#endif
-
enum class ExternalConnectionType {
FROM_FD = 0 // in the form of a file descriptor
};
@@ -295,18 +276,27 @@ class ServerBuilder {
AddExternalConnectionAcceptor(ExternalConnectionType type,
std::shared_ptr<ServerCredentials> creds);
+ /// Sets server authorization policy provider in
+ /// GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER channel argument.
+ void SetAuthorizationPolicyProvider(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider);
+
private:
ServerBuilder* builder_;
};
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
+ /// Set the allocator for creating and releasing callback server context.
+ /// Takes the owndership of the allocator.
+ ServerBuilder& SetContextAllocator(
+ std::unique_ptr<grpc::ContextAllocator> context_allocator);
+
/// Register a generic service that uses the callback API.
/// Matches requests with any :authority
/// This is mostly useful for writing generic gRPC Proxies where the exact
/// serialization format is unknown
ServerBuilder& RegisterCallbackGenericService(
grpc::CallbackGenericService* service);
-#endif
/// NOTE: The function experimental() is not stable public API. It is a view
/// to the experimental components of this class. It may be changed or removed
@@ -357,6 +347,9 @@ class ServerBuilder {
server_config_fetcher_ = server_config_fetcher;
}
+ /// Experimental API, subject to change.
+ virtual ChannelArguments BuildChannelArgs();
+
private:
friend class ::grpc::testing::ServerBuilderPluginTest;
@@ -395,12 +388,7 @@ class ServerBuilder {
grpc_resource_quota* resource_quota_;
grpc::AsyncGenericService* generic_service_{nullptr};
std::unique_ptr<ContextAllocator> context_allocator_;
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
grpc::CallbackGenericService* callback_generic_service_{nullptr};
-#else
- grpc::experimental::CallbackGenericService* callback_generic_service_{
- nullptr};
-#endif
struct {
bool is_set;
@@ -417,6 +405,8 @@ class ServerBuilder {
std::vector<std::shared_ptr<grpc::internal::ExternalConnectionAcceptorImpl>>
acceptors_;
grpc_server_config_fetcher* server_config_fetcher_ = nullptr;
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ authorization_provider_;
};
} // namespace grpc
diff --git a/contrib/libs/grpc/include/grpcpp/server_context.h b/contrib/libs/grpc/include/grpcpp/server_context.h
index 45f26149941..ed6bd66d06b 100644
--- a/contrib/libs/grpc/include/grpcpp/server_context.h
+++ b/contrib/libs/grpc/include/grpcpp/server_context.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SERVER_CONTEXT_H
#define GRPCPP_SERVER_CONTEXT_H
-#include <grpcpp/impl/codegen/server_context.h>
+#include <grpcpp/impl/codegen/server_context.h> // IWYU pragma: export
#endif // GRPCPP_SERVER_CONTEXT_H
diff --git a/contrib/libs/grpc/include/grpcpp/server_posix.h b/contrib/libs/grpc/include/grpcpp/server_posix.h
index ef3ee01a5c6..2e938624d2a 100644
--- a/contrib/libs/grpc/include/grpcpp/server_posix.h
+++ b/contrib/libs/grpc/include/grpcpp/server_posix.h
@@ -19,9 +19,10 @@
#ifndef GRPCPP_SERVER_POSIX_H
#define GRPCPP_SERVER_POSIX_H
+#include <grpc/support/port_platform.h>
+
#include <memory>
-#include <grpc/support/port_platform.h>
#include <grpcpp/server.h>
namespace grpc {
diff --git a/contrib/libs/grpc/include/grpcpp/support/async_stream.h b/contrib/libs/grpc/include/grpcpp/support/async_stream.h
index ff9e4556793..5f717014170 100644
--- a/contrib/libs/grpc/include/grpcpp/support/async_stream.h
+++ b/contrib/libs/grpc/include/grpcpp/support/async_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_STREAM_H
#define GRPCPP_SUPPORT_ASYNC_STREAM_H
-#include <grpcpp/impl/codegen/async_stream.h>
+#include <grpcpp/impl/codegen/async_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_STREAM_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/async_unary_call.h b/contrib/libs/grpc/include/grpcpp/support/async_unary_call.h
index 2e5181c5570..02071e48c58 100644
--- a/contrib/libs/grpc/include/grpcpp/support/async_unary_call.h
+++ b/contrib/libs/grpc/include/grpcpp/support/async_unary_call.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
#define GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
-#include <grpcpp/impl/codegen/async_unary_call.h>
+#include <grpcpp/impl/codegen/async_unary_call.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_ASYNC_UNARY_CALL_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/byte_buffer.h b/contrib/libs/grpc/include/grpcpp/support/byte_buffer.h
index 53aeff19f77..6f566e76da1 100644
--- a/contrib/libs/grpc/include/grpcpp/support/byte_buffer.h
+++ b/contrib/libs/grpc/include/grpcpp/support/byte_buffer.h
@@ -22,7 +22,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
-#include <grpcpp/impl/codegen/byte_buffer.h>
+#include <grpcpp/impl/codegen/byte_buffer.h> // IWYU pragma: export
#include <grpcpp/impl/serialization_traits.h>
#include <grpcpp/support/config.h>
#include <grpcpp/support/slice.h>
diff --git a/contrib/libs/grpc/include/grpcpp/support/channel_arguments.h b/contrib/libs/grpc/include/grpcpp/support/channel_arguments.h
index 0ddc463cebd..a09180de45a 100644
--- a/contrib/libs/grpc/include/grpcpp/support/channel_arguments.h
+++ b/contrib/libs/grpc/include/grpcpp/support/channel_arguments.h
@@ -74,13 +74,7 @@ class ChannelArguments {
/// the resolver.
void SetGrpclbFallbackTimeout(int fallback_timeout);
- /// For client channel's, the socket mutator operates on
- /// "channel" sockets. For server's, the socket mutator operates
- /// only on "listen" sockets.
- /// TODO(apolcyn): allow socket mutators to also operate
- /// on server "channel" sockets, and adjust the socket mutator
- /// object to be more speficic about which type of socket
- /// it should operate on.
+ /// Set a mutator for the underlying socket.
void SetSocketMutator(grpc_socket_mutator* mutator);
/// Set the string to prepend to the user agent.
diff --git a/contrib/libs/grpc/include/grpcpp/support/client_callback.h b/contrib/libs/grpc/include/grpcpp/support/client_callback.h
index 063fdc4f859..c15bca0dbe8 100644
--- a/contrib/libs/grpc/include/grpcpp/support/client_callback.h
+++ b/contrib/libs/grpc/include/grpcpp/support/client_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_CALLBACK_H
#define GRPCPP_SUPPORT_CLIENT_CALLBACK_H
-#include <grpcpp/impl/codegen/client_callback.h>
+#include <grpcpp/impl/codegen/client_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_CALLBACK_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/client_interceptor.h b/contrib/libs/grpc/include/grpcpp/support/client_interceptor.h
index 50810e3fe3c..552cab4c706 100644
--- a/contrib/libs/grpc/include/grpcpp/support/client_interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/support/client_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/client_interceptor.h>
+#include <grpcpp/impl/codegen/client_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CLIENT_INTERCEPTOR_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/config.h b/contrib/libs/grpc/include/grpcpp/support/config.h
index 16bdab64275..f2632f26403 100644
--- a/contrib/libs/grpc/include/grpcpp/support/config.h
+++ b/contrib/libs/grpc/include/grpcpp/support/config.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_CONFIG_H
#define GRPCPP_SUPPORT_CONFIG_H
-#include <grpcpp/impl/codegen/config.h>
+#include <grpcpp/impl/codegen/config.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_CONFIG_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/interceptor.h b/contrib/libs/grpc/include/grpcpp/support/interceptor.h
index 7ff79516bae..d4f2ea180ec 100644
--- a/contrib/libs/grpc/include/grpcpp/support/interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/support/interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_INTERCEPTOR_H
#define GRPCPP_SUPPORT_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/interceptor.h>
+#include <grpcpp/impl/codegen/interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_INTERCEPTOR_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/message_allocator.h b/contrib/libs/grpc/include/grpcpp/support/message_allocator.h
index 20ce072b901..22a963f3afe 100644
--- a/contrib/libs/grpc/include/grpcpp/support/message_allocator.h
+++ b/contrib/libs/grpc/include/grpcpp/support/message_allocator.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
#define GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
-#include <grpcpp/impl/codegen/message_allocator.h>
+#include <grpcpp/impl/codegen/message_allocator.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_MESSAGE_ALLOCATOR_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/method_handler.h b/contrib/libs/grpc/include/grpcpp/support/method_handler.h
index 038e76c8af8..0b97a7af030 100644
--- a/contrib/libs/grpc/include/grpcpp/support/method_handler.h
+++ b/contrib/libs/grpc/include/grpcpp/support/method_handler.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_METHOD_HANDLER_H
#define GRPCPP_SUPPORT_METHOD_HANDLER_H
-#include <grpcpp/impl/codegen/method_handler.h>
+#include <grpcpp/impl/codegen/method_handler.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_METHOD_HANDLER_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/proto_buffer_reader.h b/contrib/libs/grpc/include/grpcpp/support/proto_buffer_reader.h
index 4cdb65d531b..07e523ed74b 100644
--- a/contrib/libs/grpc/include/grpcpp/support/proto_buffer_reader.h
+++ b/contrib/libs/grpc/include/grpcpp/support/proto_buffer_reader.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
-#include <grpcpp/impl/codegen/proto_buffer_reader.h>
+#include <grpcpp/impl/codegen/proto_buffer_reader.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_READER_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/proto_buffer_writer.h b/contrib/libs/grpc/include/grpcpp/support/proto_buffer_writer.h
index 01cf29c457e..589deb82e35 100644
--- a/contrib/libs/grpc/include/grpcpp/support/proto_buffer_writer.h
+++ b/contrib/libs/grpc/include/grpcpp/support/proto_buffer_writer.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
#define GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
-#include <grpcpp/impl/codegen/proto_buffer_writer.h>
+#include <grpcpp/impl/codegen/proto_buffer_writer.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_PROTO_BUFFER_WRITER_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/server_callback.h b/contrib/libs/grpc/include/grpcpp/support/server_callback.h
index b0aeeb53c5d..1ffdce53d9e 100644
--- a/contrib/libs/grpc/include/grpcpp/support/server_callback.h
+++ b/contrib/libs/grpc/include/grpcpp/support/server_callback.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_CALLBACK_H
#define GRPCPP_SUPPORT_SERVER_CALLBACK_H
-#include <grpcpp/impl/codegen/server_callback.h>
+#include <grpcpp/impl/codegen/server_callback.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_CALLBACK_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/server_interceptor.h b/contrib/libs/grpc/include/grpcpp/support/server_interceptor.h
index b0a6229b667..ad9c7a18693 100644
--- a/contrib/libs/grpc/include/grpcpp/support/server_interceptor.h
+++ b/contrib/libs/grpc/include/grpcpp/support/server_interceptor.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
#define GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
-#include <grpcpp/impl/codegen/server_interceptor.h>
+#include <grpcpp/impl/codegen/server_interceptor.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SERVER_INTERCEPTOR_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/slice.h b/contrib/libs/grpc/include/grpcpp/support/slice.h
index eaeb29a40b2..2434983f596 100644
--- a/contrib/libs/grpc/include/grpcpp/support/slice.h
+++ b/contrib/libs/grpc/include/grpcpp/support/slice.h
@@ -20,7 +20,7 @@
#define GRPCPP_SUPPORT_SLICE_H
#include <grpc/slice.h>
-#include <grpcpp/impl/codegen/slice.h>
+#include <grpcpp/impl/codegen/slice.h> // IWYU pragma: export
#include <grpcpp/support/config.h>
#endif // GRPCPP_SUPPORT_SLICE_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/status.h b/contrib/libs/grpc/include/grpcpp/support/status.h
index 91b629f1676..e46b46d16f9 100644
--- a/contrib/libs/grpc/include/grpcpp/support/status.h
+++ b/contrib/libs/grpc/include/grpcpp/support/status.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_H
#define GRPCPP_SUPPORT_STATUS_H
-#include <grpcpp/impl/codegen/status.h>
+#include <grpcpp/impl/codegen/status.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/status_code_enum.h b/contrib/libs/grpc/include/grpcpp/support/status_code_enum.h
index bfb47f39c0a..eac697f45a1 100644
--- a/contrib/libs/grpc/include/grpcpp/support/status_code_enum.h
+++ b/contrib/libs/grpc/include/grpcpp/support/status_code_enum.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
#define GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
-#include <grpcpp/impl/codegen/status_code_enum.h>
+#include <grpcpp/impl/codegen/status_code_enum.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STATUS_CODE_ENUM_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/string_ref.h b/contrib/libs/grpc/include/grpcpp/support/string_ref.h
index 0e0d3d4389e..6cf82bedf67 100644
--- a/contrib/libs/grpc/include/grpcpp/support/string_ref.h
+++ b/contrib/libs/grpc/include/grpcpp/support/string_ref.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STRING_REF_H
#define GRPCPP_SUPPORT_STRING_REF_H
-#include <grpcpp/impl/codegen/string_ref.h>
+#include <grpcpp/impl/codegen/string_ref.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STRING_REF_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/stub_options.h b/contrib/libs/grpc/include/grpcpp/support/stub_options.h
index e9700ea4928..ffe1ad77ea1 100644
--- a/contrib/libs/grpc/include/grpcpp/support/stub_options.h
+++ b/contrib/libs/grpc/include/grpcpp/support/stub_options.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_STUB_OPTIONS_H
#define GRPCPP_SUPPORT_STUB_OPTIONS_H
-#include <grpcpp/impl/codegen/stub_options.h>
+#include <grpcpp/impl/codegen/stub_options.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_STUB_OPTIONS_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/sync_stream.h b/contrib/libs/grpc/include/grpcpp/support/sync_stream.h
index ea60b6da6b9..78a348de752 100644
--- a/contrib/libs/grpc/include/grpcpp/support/sync_stream.h
+++ b/contrib/libs/grpc/include/grpcpp/support/sync_stream.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_SYNC_STREAM_H
#define GRPCPP_SUPPORT_SYNC_STREAM_H
-#include <grpcpp/impl/codegen/sync_stream.h>
+#include <grpcpp/impl/codegen/sync_stream.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_SYNC_STREAM_H
diff --git a/contrib/libs/grpc/include/grpcpp/support/time.h b/contrib/libs/grpc/include/grpcpp/support/time.h
index c7408ff27d1..b5e07b68f22 100644
--- a/contrib/libs/grpc/include/grpcpp/support/time.h
+++ b/contrib/libs/grpc/include/grpcpp/support/time.h
@@ -19,6 +19,6 @@
#ifndef GRPCPP_SUPPORT_TIME_H
#define GRPCPP_SUPPORT_TIME_H
-#include <grpcpp/impl/codegen/time.h>
+#include <grpcpp/impl/codegen/time.h> // IWYU pragma: export
#endif // GRPCPP_SUPPORT_TIME_H
diff --git a/contrib/libs/grpc/include/grpcpp/test/client_context_test_peer.h b/contrib/libs/grpc/include/grpcpp/test/client_context_test_peer.h
new file mode 100644
index 00000000000..0afc32c0e83
--- /dev/null
+++ b/contrib/libs/grpc/include/grpcpp/test/client_context_test_peer.h
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+#define GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
+
+#include <map>
+
+#include <grpcpp/client_context.h>
+
+namespace grpc {
+namespace testing {
+
+/// A test-only class to access private members and methods of ClientContext.
+class ClientContextTestPeer {
+ public:
+ explicit ClientContextTestPeer(ClientContext* const ctx) : ctx_(ctx) {}
+
+ /// Inject metadata to the ClientContext for the test. The test peer
+ /// must be alive when a ClientContext::GetServerInitialMetadata is called.
+ void AddServerInitialMetadata(const TString& key,
+ const TString& value) {
+ server_initial_metadata_storage_.insert(
+ std::pair<TString, TString>(key, value));
+ ctx_->initial_metadata_received_ = true;
+ ctx_->recv_initial_metadata_.map()->clear();
+ for (const auto& item : server_initial_metadata_storage_) {
+ ctx_->recv_initial_metadata_.map()->insert(
+ std::pair<grpc::string_ref, grpc::string_ref>(
+ item.first.c_str(),
+ grpc::string_ref(item.second.data(), item.second.size())));
+ }
+ }
+
+ std::multimap<TString, TString> GetSendInitialMetadata() const {
+ return ctx_->send_initial_metadata_;
+ }
+
+ private:
+ ClientContext* const ctx_; // not owned
+ std::multimap<TString, TString> server_initial_metadata_storage_;
+};
+
+} // namespace testing
+} // namespace grpc
+
+#endif // GRPCPP_TEST_CLIENT_CONTEXT_TEST_PEER_H
diff --git a/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h b/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h
index a792e6f94ac..4d4ae5c39d3 100644
--- a/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h
+++ b/contrib/libs/grpc/include/grpcpp/test/default_reactor_test_peer.h
@@ -34,22 +34,21 @@ namespace testing {
/// test mode rather than letting it follow the normal paths.
class DefaultReactorTestPeer {
public:
- explicit DefaultReactorTestPeer(experimental::CallbackServerContext* ctx)
- : DefaultReactorTestPeer(ctx, [](::grpc::Status) {}) {}
- DefaultReactorTestPeer(experimental::CallbackServerContext* ctx,
- std::function<void(::grpc::Status)> finish_func)
+ explicit DefaultReactorTestPeer(CallbackServerContext* ctx)
+ : DefaultReactorTestPeer(ctx, [](Status) {}) {}
+ DefaultReactorTestPeer(CallbackServerContext* ctx,
+ std::function<void(Status)> finish_func)
: ctx_(ctx) {
ctx->SetupTestDefaultReactor(std::move(finish_func));
}
- ::grpc::experimental::ServerUnaryReactor* reactor() const {
- return reinterpret_cast<experimental::ServerUnaryReactor*>(
- &ctx_->default_reactor_);
+ ServerUnaryReactor* reactor() const {
+ return reinterpret_cast<ServerUnaryReactor*>(&ctx_->default_reactor_);
}
bool test_status_set() const { return ctx_->test_status_set(); }
Status test_status() const { return ctx_->test_status(); }
private:
- experimental::CallbackServerContext* const ctx_; // not owned
+ CallbackServerContext* const ctx_; // not owned
};
} // namespace testing
diff --git a/contrib/libs/grpc/include/grpcpp/test/mock_stream.h b/contrib/libs/grpc/include/grpcpp/test/mock_stream.h
index e33595d7096..f210b41ac6f 100644
--- a/contrib/libs/grpc/include/grpcpp/test/mock_stream.h
+++ b/contrib/libs/grpc/include/grpcpp/test/mock_stream.h
@@ -22,6 +22,7 @@
#include <stdint.h>
#include <gmock/gmock.h>
+
#include <grpcpp/impl/codegen/call.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
@@ -90,6 +91,8 @@ class MockClientAsyncResponseReader
public:
MockClientAsyncResponseReader() = default;
+ /// ClientAsyncResponseReaderInterface
+ MOCK_METHOD0_T(StartCall, void());
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD3_T(Finish, void(R*, Status*, void*));
};
@@ -100,6 +103,7 @@ class MockClientAsyncReader : public ClientAsyncReaderInterface<R> {
MockClientAsyncReader() = default;
/// ClientAsyncStreamingInterface
+ MOCK_METHOD1_T(StartCall, void(void*));
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
@@ -113,11 +117,13 @@ class MockClientAsyncWriter : public ::grpc::ClientAsyncWriterInterface<W> {
MockClientAsyncWriter() = default;
/// ClientAsyncStreamingInterface
+ MOCK_METHOD1_T(StartCall, void(void*));
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
+ MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
/// ClientAsyncWriterInterface
MOCK_METHOD1_T(WritesDone, void(void*));
@@ -130,11 +136,13 @@ class MockClientAsyncReaderWriter
MockClientAsyncReaderWriter() = default;
/// ClientAsyncStreamingInterface
+ MOCK_METHOD1_T(StartCall, void(void*));
MOCK_METHOD1_T(ReadInitialMetadata, void(void*));
MOCK_METHOD2_T(Finish, void(Status*, void*));
/// AsyncWriterInterface
MOCK_METHOD2_T(Write, void(const W&, void*));
+ MOCK_METHOD3_T(Write, void(const W&, ::grpc::WriteOptions, void*));
/// AsyncReaderInterface
MOCK_METHOD2_T(Read, void(R*, void*));
@@ -143,6 +151,47 @@ class MockClientAsyncReaderWriter
MOCK_METHOD1_T(WritesDone, void(void*));
};
+template <class R>
+class MockServerReader : public ::grpc::ServerReaderInterface<R> {
+ public:
+ MockServerReader() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+};
+
+template <class W>
+class MockServerWriter : public ::grpc::ServerWriterInterface<W> {
+ public:
+ MockServerWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
+template <class W, class R>
+class MockServerReaderWriter : public grpc::ServerReaderWriterInterface<W, R> {
+ public:
+ MockServerReaderWriter() = default;
+
+ /// ServerStreamingInterface
+ MOCK_METHOD0_T(SendInitialMetadata, void());
+
+ /// ReaderInterface
+ MOCK_METHOD1_T(NextMessageSize, bool(uint32_t*));
+ MOCK_METHOD1_T(Read, bool(R*));
+
+ /// WriterInterface
+ MOCK_METHOD2_T(Write, bool(const W&, const WriteOptions));
+};
+
} // namespace testing
} // namespace grpc
diff --git a/contrib/libs/grpc/include/grpcpp/xds_server_builder.h b/contrib/libs/grpc/include/grpcpp/xds_server_builder.h
index c1549179baa..82bc087754f 100644
--- a/contrib/libs/grpc/include/grpcpp/xds_server_builder.h
+++ b/contrib/libs/grpc/include/grpcpp/xds_server_builder.h
@@ -24,17 +24,24 @@
#include <grpcpp/server_builder.h>
namespace grpc {
-namespace experimental {
class XdsServerServingStatusNotifierInterface {
public:
+ struct ServingStatusUpdate {
+ ::grpc::Status status;
+ };
+
virtual ~XdsServerServingStatusNotifierInterface() = default;
// \a uri contains the listening target associated with the notification. Note
// that a single target provided to XdsServerBuilder can get resolved to
- // multiple listening addresses. Status::OK signifies that the server is
- // serving, while a non-OK status signifies that the server is not serving.
- virtual void OnServingStatusChange(TString uri, grpc::Status status) = 0;
+ // multiple listening addresses.
+ // The callback is invoked each time there is an update to the serving status.
+ // The API does not provide any guarantees around duplicate updates.
+ // Status::OK signifies that the server is serving, while a non-OK status
+ // signifies that the server is not serving.
+ virtual void OnServingStatusUpdate(TString uri,
+ ServingStatusUpdate update) = 0;
};
class XdsServerBuilder : public ::grpc::ServerBuilder {
@@ -47,28 +54,41 @@ class XdsServerBuilder : public ::grpc::ServerBuilder {
notifier_ = notifier;
}
- std::unique_ptr<Server> BuildAndStart() override {
+ private:
+ // Called at the beginning of BuildAndStart().
+ ChannelArguments BuildChannelArgs() override {
+ ChannelArguments args = ServerBuilder::BuildChannelArgs();
+ grpc_channel_args c_channel_args = args.c_channel_args();
grpc_server_config_fetcher* fetcher = grpc_server_config_fetcher_xds_create(
- {OnServingStatusChange, notifier_});
- if (fetcher == nullptr) return nullptr;
- set_fetcher(fetcher);
- return ServerBuilder::BuildAndStart();
+ {OnServingStatusUpdate, notifier_}, &c_channel_args);
+ if (fetcher != nullptr) set_fetcher(fetcher);
+ return args;
}
- private:
- static void OnServingStatusChange(void* user_data, const char* uri,
- grpc_status_code code,
- const char* error_message) {
+ static void OnServingStatusUpdate(void* user_data, const char* uri,
+ grpc_serving_status_update update) {
if (user_data == nullptr) return;
XdsServerServingStatusNotifierInterface* notifier =
static_cast<XdsServerServingStatusNotifierInterface*>(user_data);
- notifier->OnServingStatusChange(
- uri, grpc::Status(static_cast<StatusCode>(code), error_message));
+ notifier->OnServingStatusUpdate(
+ uri, {grpc::Status(static_cast<StatusCode>(update.code),
+ update.error_message)});
}
XdsServerServingStatusNotifierInterface* notifier_ = nullptr;
};
+namespace experimental {
+// TODO(yashykt): Delete this after the 1.42 release.
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerServingStatusNotifierInterface instead. The "
+ "experimental version will be deleted after the 1.42 release.")
+typedef grpc::XdsServerServingStatusNotifierInterface
+ XdsServerServingStatusNotifierInterface;
+GRPC_DEPRECATED(
+ "Use grpc::XdsServerBuilder instead. The experimental version will be "
+ "deleted after the 1.42 release.")
+typedef grpc::XdsServerBuilder XdsServerBuilder;
} // namespace experimental
} // namespace grpc
diff --git a/contrib/libs/grpc/src/compiler/config.h b/contrib/libs/grpc/src/compiler/config.h
index 6ccffea5f5e..80ce021962a 100644
--- a/contrib/libs/grpc/src/compiler/config.h
+++ b/contrib/libs/grpc/src/compiler/config.h
@@ -19,10 +19,10 @@
#ifndef SRC_COMPILER_CONFIG_H
#define SRC_COMPILER_CONFIG_H
-#include "src/compiler/config_protobuf.h"
-
#include <util/generic/string.h>
+#include "src/compiler/config_protobuf.h"
+
#ifdef GRPC_CUSTOM_STRING
#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
#endif
diff --git a/contrib/libs/grpc/src/compiler/cpp_generator.cc b/contrib/libs/grpc/src/compiler/cpp_generator.cc
index c093085b4a5..a4d2becbe2f 100644
--- a/contrib/libs/grpc/src/compiler/cpp_generator.cc
+++ b/contrib/libs/grpc/src/compiler/cpp_generator.cc
@@ -16,10 +16,9 @@
*
*/
-#include <map>
-
#include "src/compiler/cpp_generator.h"
+#include <map>
#include <sstream>
#include <util/string/cast.h>
@@ -142,12 +141,8 @@ TString GetHeaderIncludes(grpc_generator::File* file,
PrintIncludes(printer.get(), params.additional_header_includes, false,
"");
}
- // TODO(vjpai): Remove port_platform.h from header list when callback API is
- // fully de-experimentalized since we will no longer be using
- // macros from it.
static const char* headers_strs[] = {
"functional",
- "grpc/impl/codegen/port_platform.h",
"grpcpp/impl/codegen/async_generic_service.h",
"grpcpp/impl/codegen/async_stream.h",
"grpcpp/impl/codegen/async_unary_call.h",
@@ -593,12 +588,12 @@ void PrintHeaderClientMethodCallbackInterfacesStart(
// are pure; even though this is new (post-1.0) API, it can be pure because
// it is an entirely new interface that happens to be scoped within
// StubInterface, not new additions to StubInterface itself
- printer->Print("class experimental_async_interface {\n");
+ printer->Print("class async_interface {\n");
// All methods in this new interface are public. There is no need for private
// "Raw" methods since the callback-based API returns unowned raw pointers
printer->Print(" public:\n");
printer->Indent();
- printer->Print("virtual ~experimental_async_interface() {}\n");
+ printer->Print("virtual ~async_interface() {}\n");
}
void PrintHeaderClientMethodCallbackInterfaces(
@@ -613,55 +608,27 @@ void PrintHeaderClientMethodCallbackInterfaces(
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)>) = 0;\n");
- // TODO(vjpai): Remove experimental versions and macros when callback API is
- // fully de-experimentalized.
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, $Response$* response, "
- "::grpc::ClientUnaryReactor* reactor) = 0;\n"
- "#else\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) = 0;\n"
- "#endif\n");
+ "::grpc::ClientUnaryReactor* reactor) = 0;\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"$Response$* response, "
"::grpc::ClientWriteReactor< $Request$>* "
- "reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
- "::grpc::experimental::ClientWriteReactor< $Request$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) = 0;\n"
- "#endif\n");
+ "reactor) = 0;\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual void $Method$(::grpc::ClientContext* context, "
"::grpc::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) = 0;\n"
- "#else\n"
- "virtual void $Method$(::grpc::ClientContext* context, "
- "::grpc::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) = 0;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) = 0;\n");
}
}
@@ -670,31 +637,30 @@ void PrintHeaderClientMethodCallbackInterfacesEnd(
std::map<TString, TString>* /*vars*/) {
printer->Outdent();
printer->Print("};\n");
+ // TODO: Remove typedef when all uses of experimental_async are migrated off.
printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "typedef class experimental_async_interface async_interface;\n"
- "#endif\n");
+ "typedef class async_interface experimental_async_interface;\n");
// Declare a function to give the async stub contents. It can't be pure
// since this is a new API in StubInterface, but it is meaningless by default
// (since any stub that wants to use it must have its own implementation of
// the callback functions therein), so make the default return value nullptr.
// Intentionally include the word "class" to avoid possible shadowing.
+ // TODO: Remove experimental_async call when possible, replace with nullptr.
printer->Print(
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "async_interface* async() { return experimental_async(); }\n"
- "#endif\n");
+ "virtual class async_interface* async() { return nullptr; }\n");
+
+ // TODO: Remove experimental_async call when possible.
printer->Print(
- "virtual class experimental_async_interface* experimental_async() { "
- "return nullptr; }\n");
+ "class async_interface* experimental_async() { return async(); }\n");
}
void PrintHeaderClientMethodCallbackStart(
grpc_generator::Printer* printer,
std::map<TString, TString>* /*vars*/) {
// This declares the stub entry for the callback-based API.
- printer->Print("class experimental_async final :\n");
- printer->Print(" public StubInterface::experimental_async_interface {\n");
+ printer->Print("class async final :\n");
+ printer->Print(" public StubInterface::async_interface {\n");
printer->Print(" public:\n");
printer->Indent();
}
@@ -711,55 +677,28 @@ void PrintHeaderClientMethodCallback(grpc_generator::Printer* printer,
"void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)>) override;\n");
- printer->Print(
- *vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- "void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, $Response$* response, "
- "::grpc::ClientUnaryReactor* reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) override;\n"
- "#endif\n");
+ printer->Print(*vars,
+ "void $Method$(::grpc::ClientContext* context, "
+ "const $Request$* request, $Response$* response, "
+ "::grpc::ClientUnaryReactor* reactor) override;\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"void $Method$(::grpc::ClientContext* context, "
"$Response$* response, "
"::grpc::ClientWriteReactor< $Request$>* "
- "reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
- "::grpc::experimental::ClientWriteReactor< $Request$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"void $Method$(::grpc::ClientContext* context, "
"const $Request$* request, "
"::grpc::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* "
- "reactor) override;\n"
- "#endif\n");
+ "reactor) override;\n");
} else if (method->BidiStreaming()) {
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"void $Method$(::grpc::ClientContext* context, "
"::grpc::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) override;\n"
- "#else\n"
- "void $Method$(::grpc::ClientContext* context, "
- "::grpc::experimental::ClientBidiReactor< "
- "$Request$,$Response$>* reactor) override;\n"
- "#endif\n");
+ "$Request$,$Response$>* reactor) override;\n");
}
}
@@ -770,7 +709,7 @@ void PrintHeaderClientMethodCallbackEnd(
printer->Print(" private:\n");
printer->Indent();
printer->Print("friend class Stub;\n");
- printer->Print("explicit experimental_async(Stub* stub): stub_(stub) { }\n");
+ printer->Print("explicit async(Stub* stub): stub_(stub) { }\n");
// include a function with a phony use of stub_ to avoid an unused
// private member warning for service with no methods
printer->Print("Stub* stub() { return stub_; }\n");
@@ -779,7 +718,7 @@ void PrintHeaderClientMethodCallbackEnd(
printer->Print("};\n");
printer->Print(
- "class experimental_async_interface* experimental_async() override { "
+ "class async* async() override { "
"return &async_stub_; }\n");
}
@@ -972,18 +911,10 @@ void PrintHeaderServerCallbackMethodsHelper(
" return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
"}\n");
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual ::grpc::ServerUnaryReactor* $Method$(\n"
" ::grpc::CallbackServerContext* /*context*/, "
"const $RealRequest$* /*request*/, "
- "$RealResponse$* /*response*/)\n"
- "#else\n"
- "virtual ::grpc::experimental::ServerUnaryReactor* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/, "
- "$RealResponse$* /*response*/)\n"
- "#endif\n"
+ "$RealResponse$* /*response*/)"
" { return nullptr; }\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
@@ -997,17 +928,10 @@ void PrintHeaderServerCallbackMethodsHelper(
" return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"
"}\n");
printer->Print(*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual ::grpc::ServerReadReactor< "
"$RealRequest$>* $Method$(\n"
" ::grpc::CallbackServerContext* "
- "/*context*/, $RealResponse$* /*response*/)\n"
- "#else\n"
- "virtual ::grpc::experimental::ServerReadReactor< "
- "$RealRequest$>* $Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, $RealResponse$* /*response*/)\n"
- "#endif\n"
+ "/*context*/, $RealResponse$* /*response*/)"
" { return nullptr; }\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
@@ -1022,16 +946,9 @@ void PrintHeaderServerCallbackMethodsHelper(
"}\n");
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual ::grpc::ServerWriteReactor< $RealResponse$>* $Method$(\n"
" ::grpc::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/)\n"
- "#else\n"
- "virtual ::grpc::experimental::ServerWriteReactor< $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* "
- "/*context*/, const $RealRequest$* /*request*/)\n"
- "#endif\n"
+ "/*context*/, const $RealRequest$* /*request*/)"
" { return nullptr; }\n");
} else if (method->BidiStreaming()) {
printer->Print(
@@ -1046,16 +963,9 @@ void PrintHeaderServerCallbackMethodsHelper(
"}\n");
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
"virtual ::grpc::ServerBidiReactor< $RealRequest$, $RealResponse$>* "
"$Method$(\n"
" ::grpc::CallbackServerContext* /*context*/)\n"
- "#else\n"
- "virtual ::grpc::experimental::ServerBidiReactor< "
- "$RealRequest$, $RealResponse$>* "
- "$Method$(\n"
- " ::grpc::experimental::CallbackServerContext* /*context*/)\n"
- "#endif\n"
" { return nullptr; }\n");
}
}
@@ -1071,117 +981,70 @@ void PrintHeaderServerMethodCallback(grpc_generator::Printer* printer,
(*vars)["RealRequest"] = method->input_type_name();
(*vars)["RealResponse"] = method->output_type_name();
printer->Print(*vars, "template <class BaseClass>\n");
- printer->Print(
- *vars,
- "class ExperimentalWithCallbackMethod_$Method$ : public BaseClass {\n");
+ printer->Print(*vars,
+ "class WithCallbackMethod_$Method$ : public BaseClass {\n");
printer->Print(
" private:\n"
" void BaseClassMustBeDerivedFromService(const Service* /*service*/) "
"{}\n");
printer->Print(" public:\n");
printer->Indent();
- printer->Print(*vars, "ExperimentalWithCallbackMethod_$Method$() {\n");
+ printer->Print(*vars, "WithCallbackMethod_$Method$() {\n");
if (method->NoStreaming()) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
+ " ::grpc::Service::MarkMethodCallback($Idx$,\n"
" new ::grpc::internal::CallbackUnaryHandler< "
"$RealRequest$, $RealResponse$>(\n"
" [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " ::grpc::CallbackServerContext* context, "
"const $RealRequest$* "
"request, "
"$RealResponse$* response) { "
"return this->$Method$(context, request, response); }));}\n");
printer->Print(*vars,
"void SetMessageAllocatorFor_$Method$(\n"
- " ::grpc::experimental::MessageAllocator< "
+ " ::grpc::MessageAllocator< "
"$RealRequest$, $RealResponse$>* allocator) {\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
" ::grpc::internal::MethodHandler* const handler = "
"::grpc::Service::GetHandler($Idx$);\n"
- "#else\n"
- " ::grpc::internal::MethodHandler* const handler = "
- "::grpc::Service::experimental().GetHandler($Idx$);\n"
- "#endif\n"
" static_cast<::grpc::internal::CallbackUnaryHandler< "
"$RealRequest$, $RealResponse$>*>(handler)\n"
" ->SetMessageAllocator(allocator);\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
+ " ::grpc::Service::MarkMethodCallback($Idx$,\n"
" new ::grpc::internal::CallbackClientStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
" [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " ::grpc::CallbackServerContext* context, "
"$RealResponse$* "
"response) { "
"return this->$Method$(context, response); }));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
+ " ::grpc::Service::MarkMethodCallback($Idx$,\n"
" new ::grpc::internal::CallbackServerStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
" [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " ::grpc::CallbackServerContext* context, "
"const $RealRequest$* "
"request) { "
"return this->$Method$(context, request); }));\n");
} else if (method->BidiStreaming()) {
- printer->Print(
- *vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodCallback($Idx$,\n"
- " new ::grpc::internal::CallbackBidiHandler< "
- "$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context) "
- "{ return this->$Method$(context); }));\n");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
- "~ExperimentalWithCallbackMethod_$Method$() override {\n"
+ "~WithCallbackMethod_$Method$() override {\n"
" BaseClassMustBeDerivedFromService(this);\n"
"}\n");
PrintHeaderServerCallbackMethodsHelper(printer, method, vars);
@@ -1201,7 +1064,7 @@ void PrintHeaderServerMethodRawCallback(
(*vars)["RealResponse"] = "::grpc::ByteBuffer";
printer->Print(*vars, "template <class BaseClass>\n");
printer->Print(*vars,
- "class ExperimentalWithRawCallbackMethod_$Method$ : public "
+ "class WithRawCallbackMethod_$Method$ : public "
"BaseClass {\n");
printer->Print(
" private:\n"
@@ -1209,93 +1072,51 @@ void PrintHeaderServerMethodRawCallback(
"{}\n");
printer->Print(" public:\n");
printer->Indent();
- printer->Print(*vars, "ExperimentalWithRawCallbackMethod_$Method$() {\n");
+ printer->Print(*vars, "WithRawCallbackMethod_$Method$() {\n");
if (method->NoStreaming()) {
- printer->Print(
- *vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackUnaryHandler< "
- "$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
- "const $RealRequest$* "
- "request, "
- "$RealResponse$* response) { return "
- "this->$Method$(context, request, response); }));\n");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackUnaryHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context, "
+ "const $RealRequest$* "
+ "request, "
+ "$RealResponse$* response) { return "
+ "this->$Method$(context, request, response); }));\n");
} else if (ClientOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
" new ::grpc::internal::CallbackClientStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
" [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " ::grpc::CallbackServerContext* context, "
"$RealResponse$* response) "
"{ return this->$Method$(context, response); }));\n");
} else if (ServerOnlyStreaming(method)) {
printer->Print(
*vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
" new ::grpc::internal::CallbackServerStreamingHandler< "
"$RealRequest$, $RealResponse$>(\n"
" [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context, "
+ " ::grpc::CallbackServerContext* context, "
"const"
"$RealRequest$* request) { return "
"this->$Method$(context, request); }));\n");
} else if (method->BidiStreaming()) {
- printer->Print(
- *vars,
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::Service::\n"
- "#else\n"
- " ::grpc::Service::experimental().\n"
- "#endif\n"
- " MarkMethodRawCallback($Idx$,\n"
- " new ::grpc::internal::CallbackBidiHandler< "
- "$RealRequest$, $RealResponse$>(\n"
- " [this](\n"
- "#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n"
- " ::grpc::CallbackServerContext*\n"
- "#else\n"
- " ::grpc::experimental::CallbackServerContext*\n"
- "#endif\n"
- " context) "
- "{ return this->$Method$(context); }));\n");
+ printer->Print(*vars,
+ " ::grpc::Service::MarkMethodRawCallback($Idx$,\n"
+ " new ::grpc::internal::CallbackBidiHandler< "
+ "$RealRequest$, $RealResponse$>(\n"
+ " [this](\n"
+ " ::grpc::CallbackServerContext* context) "
+ "{ return this->$Method$(context); }));\n");
}
printer->Print(*vars, "}\n");
printer->Print(*vars,
- "~ExperimentalWithRawCallbackMethod_$Method$() override {\n"
+ "~WithRawCallbackMethod_$Method$() override {\n"
" BaseClassMustBeDerivedFromService(this);\n"
"}\n");
PrintHeaderServerCallbackMethodsHelper(printer, method, vars);
@@ -1552,7 +1373,7 @@ void PrintHeaderService(grpc_generator::Printer* printer,
}
PrintHeaderClientMethodCallbackInterfacesEnd(printer, vars);
printer->Outdent();
- printer->Print("private:\n");
+ printer->Print(" private:\n");
printer->Indent();
for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderClientMethodInterfaces(printer, service->method(i).get(), vars,
@@ -1566,7 +1387,8 @@ void PrintHeaderService(grpc_generator::Printer* printer,
printer->Indent();
printer->Print(
"Stub(const std::shared_ptr< ::grpc::ChannelInterface>& "
- "channel);\n");
+ "channel, const ::grpc::StubOptions& options = "
+ "::grpc::StubOptions());\n");
for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderClientMethod(printer, service->method(i).get(), vars, true);
}
@@ -1579,7 +1401,7 @@ void PrintHeaderService(grpc_generator::Printer* printer,
printer->Print("\n private:\n");
printer->Indent();
printer->Print("std::shared_ptr< ::grpc::ChannelInterface> channel_;\n");
- printer->Print("class experimental_async async_stub_{this};\n");
+ printer->Print("class async async_stub_{this};\n");
for (int i = 0; i < service->method_count(); ++i) {
PrintHeaderClientMethod(printer, service->method(i).get(), vars, false);
}
@@ -1632,31 +1454,21 @@ void PrintHeaderService(grpc_generator::Printer* printer,
PrintHeaderServerMethodCallback(printer, service->method(i).get(), vars);
}
- printer->Print("#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL\n");
printer->Print("typedef ");
for (int i = 0; i < service->method_count(); ++i) {
(*vars)["method_name"] = service->method(i)->name();
- printer->Print(*vars, "ExperimentalWithCallbackMethod_$method_name$<");
+ printer->Print(*vars, "WithCallbackMethod_$method_name$<");
}
printer->Print("Service");
for (int i = 0; i < service->method_count(); ++i) {
printer->Print(" >");
}
printer->Print(" CallbackService;\n");
- printer->Print("#endif\n\n");
- printer->Print("typedef ");
-
- for (int i = 0; i < service->method_count(); ++i) {
- (*vars)["method_name"] = service->method(i)->name();
- printer->Print(*vars, "ExperimentalWithCallbackMethod_$method_name$<");
- }
- printer->Print("Service");
- for (int i = 0; i < service->method_count(); ++i) {
- printer->Print(" >");
- }
- printer->Print(" ExperimentalCallbackService;\n");
+ // TODO: Remove following typedef once all uses of ExperimentalCallbackService
+ // are migrated to CallbackService
+ printer->Print("typedef CallbackService ExperimentalCallbackService;\n");
// Server side - Generic
for (int i = 0; i < service->method_count(); ++i) {
@@ -1907,7 +1719,7 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request, response);\n}\n\n");
printer->Print(*vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$("
+ "void $ns$$Service$::Stub::async::$Method$("
"::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
"std::function<void(::grpc::Status)> f) {\n");
@@ -1919,10 +1731,10 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request, response, std::move(f));\n}\n\n");
printer->Print(*vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$("
+ "void $ns$$Service$::Stub::async::$Method$("
"::grpc::ClientContext* context, "
"const $Request$* request, $Response$* response, "
- "::grpc::experimental::ClientUnaryReactor* reactor) {\n");
+ "::grpc::ClientUnaryReactor* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackUnaryFactory::Create"
"< ::grpc::protobuf::MessageLite, "
@@ -1969,12 +1781,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, response);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::"
- "Stub::experimental_async::$Method$(::grpc::ClientContext* context, "
- "$Response$* response, "
- "::grpc::experimental::ClientWriteReactor< $Request$>* reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::"
+ "Stub::async::$Method$(::grpc::ClientContext* context, "
+ "$Response$* response, "
+ "::grpc::ClientWriteReactor< $Request$>* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackWriterFactory< "
"$Request$>::Create("
@@ -2015,12 +1826,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context, request);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$(::grpc::"
- "ClientContext* context, "
- "const $Request$* request, "
- "::grpc::experimental::ClientReadReactor< $Response$>* reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::Stub::async::$Method$(::grpc::"
+ "ClientContext* context, "
+ "const $Request$* request, "
+ "::grpc::ClientReadReactor< $Response$>* reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackReaderFactory< "
"$Response$>::Create("
@@ -2061,12 +1871,11 @@ void PrintSourceClientMethod(grpc_generator::Printer* printer,
"context);\n"
"}\n\n");
- printer->Print(
- *vars,
- "void $ns$$Service$::Stub::experimental_async::$Method$(::grpc::"
- "ClientContext* context, "
- "::grpc::experimental::ClientBidiReactor< $Request$,$Response$>* "
- "reactor) {\n");
+ printer->Print(*vars,
+ "void $ns$$Service$::Stub::async::$Method$(::grpc::"
+ "ClientContext* context, "
+ "::grpc::ClientBidiReactor< $Request$,$Response$>* "
+ "reactor) {\n");
printer->Print(*vars,
" ::grpc::internal::ClientCallbackReaderWriterFactory< "
"$Request$,$Response$>::Create("
@@ -2171,18 +1980,20 @@ void PrintSourceService(grpc_generator::Printer* printer,
printer->Print(*vars, "};\n\n");
}
+ (*vars)["OptionsVariableName"] = service->method_count() ? "options" : "";
printer->Print(*vars,
"std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
"const std::shared_ptr< ::grpc::ChannelInterface>& channel, "
"const ::grpc::StubOptions& options) {\n"
" (void)options;\n"
" std::unique_ptr< $ns$$Service$::Stub> stub(new "
- "$ns$$Service$::Stub(channel));\n"
+ "$ns$$Service$::Stub(channel, options));\n"
" return stub;\n"
"}\n\n");
printer->Print(*vars,
"$ns$$Service$::Stub::Stub(const std::shared_ptr< "
- "::grpc::ChannelInterface>& channel)\n");
+ "::grpc::ChannelInterface>& channel, const "
+ "::grpc::StubOptions& $OptionsVariableName$)\n");
printer->Indent();
printer->Print(": channel_(channel)");
for (int i = 0; i < service->method_count(); ++i) {
@@ -2201,12 +2012,13 @@ void PrintSourceService(grpc_generator::Printer* printer,
} else {
(*vars)["StreamingType"] = "BIDI_STREAMING";
}
- printer->Print(*vars,
- ", rpcmethod_$Method$_("
- "$prefix$$Service$_method_names[$Idx$], "
- "::grpc::internal::RpcMethod::$StreamingType$, "
- "channel"
- ")\n");
+ printer->Print(
+ *vars,
+ ", rpcmethod_$Method$_("
+ "$prefix$$Service$_method_names[$Idx$], options.suffix_for_stats(),"
+ "::grpc::internal::RpcMethod::$StreamingType$, "
+ "channel"
+ ")\n");
}
printer->Print("{}\n\n");
printer->Outdent();
diff --git a/contrib/libs/grpc/src/compiler/cpp_plugin.h b/contrib/libs/grpc/src/compiler/cpp_plugin.h
index 0c289a7395b..d8789dbca2a 100644
--- a/contrib/libs/grpc/src/compiler/cpp_plugin.h
+++ b/contrib/libs/grpc/src/compiler/cpp_plugin.h
@@ -23,7 +23,6 @@
#include <sstream>
#include "src/compiler/config.h"
-
#include "src/compiler/cpp_generator.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/protobuf_plugin.h"
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator.cc b/contrib/libs/grpc/src/compiler/csharp_generator.cc
index 099f03aff08..15d5361a205 100644
--- a/contrib/libs/grpc/src/compiler/csharp_generator.cc
+++ b/contrib/libs/grpc/src/compiler/csharp_generator.cc
@@ -16,13 +16,14 @@
*
*/
+#include "src/compiler/csharp_generator.h"
+
#include <cctype>
#include <map>
#include <sstream>
#include <vector>
#include "src/compiler/config.h"
-#include "src/compiler/csharp_generator.h"
#include "src/compiler/csharp_generator_helpers.h"
using grpc::protobuf::Descriptor;
@@ -38,7 +39,7 @@ namespace grpc_csharp_generator {
namespace {
// This function is a massaged version of
-// https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
+// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc
// Currently, we cannot easily reuse the functionality as
// google/protobuf/compiler/csharp/csharp_doc_comment.h is not a public header.
// TODO(jtattermusch): reuse the functionality from google/protobuf.
@@ -88,6 +89,17 @@ bool GenerateDocCommentBodyImpl(grpc::protobuf::io::Printer* printer,
return true;
}
+void GenerateGeneratedCodeAttribute(grpc::protobuf::io::Printer* printer) {
+ // Mark the code as generated using the [GeneratedCode] attribute.
+ // We don't provide plugin version info in attribute the because:
+ // * the version information is not readily available from the plugin's code.
+ // * it would cause a lot of churn in the pre-generated code
+ // in this repository every time the version is updated.
+ printer->Print(
+ "[global::System.CodeDom.Compiler.GeneratedCode(\"grpc_csharp_plugin\", "
+ "null)]\n");
+}
+
template <typename DescriptorType>
bool GenerateDocCommentBody(grpc::protobuf::io::Printer* printer,
const DescriptorType* descriptor) {
@@ -304,6 +316,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
std::vector<const Descriptor*> used_messages = GetUsedMessages(service);
if (used_messages.size() != 0) {
// Generate static helper methods for serialization/deserialization
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static void __Helper_SerializeMessage("
"global::Google.Protobuf.IMessage message, "
@@ -331,6 +344,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
out->Outdent();
out->Print("}\n\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static class __Helper_MessageCache<T>\n"
"{\n");
@@ -343,6 +357,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
out->Outdent();
out->Print("}\n\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static T __Helper_DeserializeMessage<T>("
"grpc::DeserializationContext context, "
@@ -368,6 +383,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
for (size_t i = 0; i < used_messages.size(); i++) {
const Descriptor* message = used_messages[i];
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static readonly grpc::Marshaller<$type$> $fieldname$ = "
"grpc::Marshallers.Create(__Helper_SerializeMessage, "
@@ -379,6 +395,7 @@ void GenerateMarshallerFields(Printer* out, const ServiceDescriptor* service) {
}
void GenerateStaticMethodField(Printer* out, const MethodDescriptor* method) {
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"static readonly grpc::Method<$request$, $response$> $fieldname$ = new "
"grpc::Method<$request$, $response$>(\n",
@@ -433,6 +450,7 @@ void GenerateServerClass(Printer* out, const ServiceDescriptor* service) {
for (int i = 0; i < service->method_count(); i++) {
const MethodDescriptor* method = service->method(i);
GenerateDocCommentServerMethod(out, method);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request$$response_stream_maybe$, "
@@ -468,6 +486,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <param name=\"channel\">The channel to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
+ GenerateGeneratedCodeAttribute(out);
out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n",
"name", GetClientClassName(service));
out->Print("{\n");
@@ -478,6 +497,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <param name=\"callInvoker\">The callInvoker to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public $name$(grpc::CallInvoker callInvoker) : base(callInvoker)\n",
"name", GetClientClassName(service));
@@ -486,6 +506,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <summary>Protected parameterless constructor to allow creation"
" of test doubles.</summary>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print("protected $name$() : base()\n", "name",
GetClientClassName(service));
out->Print("{\n");
@@ -494,6 +515,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
"/// <summary>Protected constructor to allow creation of configured "
"clients.</summary>\n"
"/// <param name=\"configuration\">The client configuration.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"protected $name$(ClientBaseConfiguration configuration)"
" : base(configuration)\n",
@@ -506,6 +528,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
if (!method->client_streaming() && !method->server_streaming()) {
// unary calls have an extra synchronous stub method
GenerateDocCommentClientMethod(out, method, true, false);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $response$ $methodname$($request$ request, "
"grpc::Metadata "
@@ -528,6 +551,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
// overload taking CallOptions as a param
GenerateDocCommentClientMethod(out, method, true, true);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $response$ $methodname$($request$ request, "
"grpc::CallOptions options)\n",
@@ -549,6 +573,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
method_name += "Async"; // prevent name clash with synchronous method.
}
GenerateDocCommentClientMethod(out, method, false, false);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request_maybe$grpc::Metadata "
@@ -573,6 +598,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
// overload taking CallOptions as a param
GenerateDocCommentClientMethod(out, method, false, true);
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public virtual $returntype$ "
"$methodname$($request_maybe$grpc::CallOptions "
@@ -615,6 +641,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <summary>Creates a new instance of client from given "
"<c>ClientBaseConfiguration</c>.</summary>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"protected override $name$ NewInstance(ClientBaseConfiguration "
"configuration)\n",
@@ -638,6 +665,7 @@ void GenerateBindServiceMethod(Printer* out, const ServiceDescriptor* service) {
out->Print(
"/// <param name=\"serviceImpl\">An object implementing the server-side"
" handling logic.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public static grpc::ServerServiceDefinition BindService($implclass$ "
"serviceImpl)\n",
@@ -679,6 +707,7 @@ void GenerateBindServiceWithBinderMethod(Printer* out,
out->Print(
"/// <param name=\"serviceImpl\">An object implementing the server-side"
" handling logic.</param>\n");
+ GenerateGeneratedCodeAttribute(out);
out->Print(
"public static void BindService(grpc::ServiceBinderBase serviceBinder, "
"$implclass$ "
@@ -709,6 +738,7 @@ void GenerateService(Printer* out, const ServiceDescriptor* service,
bool generate_client, bool generate_server,
bool internal_access) {
GenerateDocCommentBody(out, service);
+
out->Print("$access_level$ static partial class $classname$\n",
"access_level", GetAccessLevel(internal_access), "classname",
GetServiceClassName(service));
diff --git a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h b/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
index a8af7f3ccd1..d1a5b3a2a0f 100644
--- a/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/csharp_generator_helpers.h
@@ -25,9 +25,10 @@
namespace grpc_csharp_generator {
inline bool ServicesFilename(const grpc::protobuf::FileDescriptor* file,
- TString* file_name_or_error) {
- *file_name_or_error =
- grpc_generator::FileNameInUpperCamel(file, false) + "Grpc.cs";
+ const TString& file_suffix,
+ TString& out_file_name_or_error) {
+ out_file_name_or_error =
+ grpc_generator::FileNameInUpperCamel(file, false) + file_suffix;
return true;
}
diff --git a/contrib/libs/grpc/src/compiler/node_generator.cc b/contrib/libs/grpc/src/compiler/node_generator.cc
index 89e4871a660..d890320e8a5 100644
--- a/contrib/libs/grpc/src/compiler/node_generator.cc
+++ b/contrib/libs/grpc/src/compiler/node_generator.cc
@@ -16,11 +16,12 @@
*
*/
+#include "src/compiler/node_generator.h"
+
#include <map>
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
-#include "src/compiler/node_generator.h"
#include "src/compiler/node_generator_helpers.h"
using grpc::protobuf::Descriptor;
diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator.cc b/contrib/libs/grpc/src/compiler/objective_c_generator.cc
index 07826b6a8d8..ec7b90f8a7a 100644
--- a/contrib/libs/grpc/src/compiler/objective_c_generator.cc
+++ b/contrib/libs/grpc/src/compiler/objective_c_generator.cc
@@ -16,16 +16,17 @@
*
*/
+#include "src/compiler/objective_c_generator.h"
+
#include <map>
#include <set>
#include <sstream>
+#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+
#include "src/compiler/config.h"
-#include "src/compiler/objective_c_generator.h"
#include "src/compiler/objective_c_generator_helpers.h"
-#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
-
using ::google::protobuf::compiler::objectivec::ClassName;
using ::grpc::protobuf::FileDescriptor;
using ::grpc::protobuf::MethodDescriptor;
diff --git a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h b/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
index ae296741cec..c8336a3fc93 100644
--- a/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/objective_c_generator_helpers.h
@@ -20,11 +20,12 @@
#define GRPC_INTERNAL_COMPILER_OBJECTIVE_C_GENERATOR_HELPERS_H
#include <map>
-#include "src/compiler/config.h"
-#include "src/compiler/generator_helpers.h"
#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
+#include "src/compiler/config.h"
+#include "src/compiler/generator_helpers.h"
+
namespace grpc_objective_c_generator {
using ::grpc::protobuf::FileDescriptor;
@@ -37,7 +38,7 @@ inline string MessageHeaderName(const FileDescriptor* file) {
inline string ServiceClassName(const ServiceDescriptor* service) {
const FileDescriptor* file = service->file();
- string prefix = file->options().objc_class_prefix();
+ string prefix = google::protobuf::compiler::objectivec::FileClassPrefix(file);
return prefix + service->name();
}
diff --git a/contrib/libs/grpc/src/compiler/php_generator.cc b/contrib/libs/grpc/src/compiler/php_generator.cc
index b35d3f2a02e..a0c1ef9be1d 100644
--- a/contrib/libs/grpc/src/compiler/php_generator.cc
+++ b/contrib/libs/grpc/src/compiler/php_generator.cc
@@ -19,6 +19,7 @@
#include <map>
#include <google/protobuf/compiler/php/php_generator.h>
+
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/php_generator_helpers.h"
@@ -131,34 +132,177 @@ void PrintMethod(const MethodDescriptor* method, Printer* out) {
out->Print("}\n\n");
}
-// Prints out the service descriptor object
-void PrintService(const ServiceDescriptor* service,
- const TString& class_suffix, Printer* out) {
+void PrintServerMethod(const MethodDescriptor* method, Printer* out) {
map<TString, TString> vars;
+ const Descriptor* input_type = method->input_type();
+ const Descriptor* output_type = method->output_type();
+ vars["service_name"] = method->service()->full_name();
+ vars["method_name"] = method->name();
+ vars["input_type_id"] =
+ MessageIdentifierName(GeneratedClassName(input_type), input_type->file());
+ vars["output_type_id"] = MessageIdentifierName(
+ GeneratedClassName(output_type), output_type->file());
+
out->Print("/**\n");
- out->Print(GetPHPComments(service, " *").c_str());
- out->Print(" */\n");
- vars["name"] = GetPHPServiceClassname(service, class_suffix);
- out->Print(vars, "class $name$ extends \\Grpc\\BaseStub {\n\n");
+ out->Print(GetPHPComments(method, " *").c_str());
+
+ const char* method_template;
+ if (method->client_streaming() && method->server_streaming()) {
+ method_template =
+ " * @param \\Grpc\\ServerCallReader $$reader read client request data "
+ "of \\$input_type_id$\n"
+ " * @param \\Grpc\\ServerCallWriter $$writer write response data of "
+ "\\$output_type_id$\n"
+ " * @param \\Grpc\\ServerContext $$context server request context\n"
+ " * @return void\n"
+ " */\n"
+ "public function $method_name$(\n"
+ " \\Grpc\\ServerCallReader $$reader,\n"
+ " \\Grpc\\ServerCallWriter $$writer,\n"
+ " \\Grpc\\ServerContext $$context\n"
+ "): void {\n"
+ " $$context->setStatus(\\Grpc\\Status::unimplemented());\n"
+ " $$writer->finish();\n"
+ "}\n\n";
+ } else if (method->client_streaming()) {
+ method_template =
+ " * @param \\Grpc\\ServerCallReader $$reader read client request data "
+ "of \\$input_type_id$\n"
+ " * @param \\Grpc\\ServerContext $$context server request context\n"
+ " * @return \\$output_type_id$ for response data, null if if error "
+ "occured\n"
+ " * initial metadata (if any) and status (if not ok) should be set "
+ "to $$context\n"
+ " */\n"
+ "public function $method_name$(\n"
+ " \\Grpc\\ServerCallReader $$reader,\n"
+ " \\Grpc\\ServerContext $$context\n"
+ "): ?\\$output_type_id$ {\n"
+ " $$context->setStatus(\\Grpc\\Status::unimplemented());\n"
+ " return null;\n"
+ "}\n\n";
+ } else if (method->server_streaming()) {
+ method_template =
+ " * @param \\$input_type_id$ $$request client request\n"
+ " * @param \\Grpc\\ServerCallWriter $$writer write response data of "
+ "\\$output_type_id$\n"
+ " * @param \\Grpc\\ServerContext $$context server request context\n"
+ " * @return void\n"
+ " */\n"
+ "public function $method_name$(\n"
+ " \\$input_type_id$ $$request,\n"
+ " \\Grpc\\ServerCallWriter $$writer,\n"
+ " \\Grpc\\ServerContext $$context\n"
+ "): void {\n"
+ " $$context->setStatus(\\Grpc\\Status::unimplemented());\n"
+ " $$writer->finish();\n"
+ "}\n\n";
+ } else {
+ method_template =
+ " * @param \\$input_type_id$ $$request client request\n"
+ " * @param \\Grpc\\ServerContext $$context server request context\n"
+ " * @return \\$output_type_id$ for response data, null if if error "
+ "occured\n"
+ " * initial metadata (if any) and status (if not ok) should be set "
+ "to $$context\n"
+ " */\n"
+ "public function $method_name$(\n"
+ " \\$input_type_id$ $$request,\n"
+ " \\Grpc\\ServerContext $$context\n"
+ "): ?\\$output_type_id$ {\n"
+ " $$context->setStatus(\\Grpc\\Status::unimplemented());\n"
+ " return null;\n"
+ "}\n\n";
+ }
+ out->Print(vars, method_template);
+}
+
+void PrintServerMethodDescriptors(const ServiceDescriptor* service,
+ Printer* out) {
+ map<TString, TString> vars;
+ vars["service_name"] = service->full_name();
+
+ out->Print(
+ "/**\n"
+ " * Get the method descriptors of the service for server registration\n"
+ " *\n"
+ " * @return array of \\Grpc\\MethodDescriptor for the service methods\n"
+ " */\n"
+ "public final function getMethodDescriptors(): array\n{\n");
out->Indent();
out->Indent();
- out->Print(
- "/**\n * @param string $$hostname hostname\n"
- " * @param array $$opts channel options\n"
- " * @param \\Grpc\\Channel $$channel (optional) re-use channel "
- "object\n */\n"
- "public function __construct($$hostname, $$opts, "
- "$$channel = null) {\n");
+ out->Print("return [\n");
out->Indent();
out->Indent();
- out->Print("parent::__construct($$hostname, $$opts, $$channel);\n");
+ for (int i = 0; i < service->method_count(); i++) {
+ auto method = service->method(i);
+ auto input_type = method->input_type();
+ vars["method_name"] = method->name();
+ vars["input_type_id"] = MessageIdentifierName(
+ GeneratedClassName(input_type), input_type->file());
+ if (method->client_streaming() && method->server_streaming()) {
+ vars["call_type"] = "BIDI_STREAMING_CALL";
+ } else if (method->client_streaming()) {
+ vars["call_type"] = "CLIENT_STREAMING_CALL";
+ } else if (method->server_streaming()) {
+ vars["call_type"] = "SERVER_STREAMING_CALL";
+ } else {
+ vars["call_type"] = "UNARY_CALL";
+ }
+ out->Print(
+ vars,
+ "'/$service_name$/$method_name$' => new \\Grpc\\MethodDescriptor(\n"
+ " $$this,\n"
+ " '$method_name$',\n"
+ " '\\$input_type_id$',\n"
+ " \\Grpc\\MethodDescriptor::$call_type$\n"
+ "),\n");
+ }
+ out->Outdent();
+ out->Outdent();
+ out->Print("];\n");
out->Outdent();
out->Outdent();
out->Print("}\n\n");
+}
+
+// Prints out the service descriptor object
+void PrintService(const ServiceDescriptor* service,
+ const TString& class_suffix, bool is_server,
+ Printer* out) {
+ map<TString, TString> vars;
+ out->Print("/**\n");
+ out->Print(GetPHPComments(service, " *").c_str());
+ out->Print(" */\n");
+ vars["name"] = GetPHPServiceClassname(service, class_suffix, is_server);
+ vars["extends"] = is_server ? "" : "extends \\Grpc\\BaseStub ";
+ out->Print(vars, "class $name$ $extends${\n\n");
+ out->Indent();
+ out->Indent();
+ if (!is_server) {
+ out->Print(
+ "/**\n * @param string $$hostname hostname\n"
+ " * @param array $$opts channel options\n"
+ " * @param \\Grpc\\Channel $$channel (optional) re-use channel object\n"
+ " */\n"
+ "public function __construct($$hostname, $$opts, "
+ "$$channel = null) {\n");
+ out->Indent();
+ out->Indent();
+ out->Print("parent::__construct($$hostname, $$opts, $$channel);\n");
+ out->Outdent();
+ out->Outdent();
+ out->Print("}\n\n");
+ }
for (int i = 0; i < service->method_count(); i++) {
- TString method_name =
- grpc_generator::LowercaseFirstLetter(service->method(i)->name());
- PrintMethod(service->method(i), out);
+ if (is_server) {
+ PrintServerMethod(service->method(i), out);
+ } else {
+ PrintMethod(service->method(i), out);
+ }
+ }
+ if (is_server) {
+ PrintServerMethodDescriptors(service, out);
}
out->Outdent();
out->Outdent();
@@ -168,7 +312,7 @@ void PrintService(const ServiceDescriptor* service,
TString GenerateFile(const FileDescriptor* file,
const ServiceDescriptor* service,
- const TString& class_suffix) {
+ const TString& class_suffix, bool is_server) {
TString output;
{
StringOutputStream output_stream(&output);
@@ -188,7 +332,7 @@ TString GenerateFile(const FileDescriptor* file,
vars["package"] = php_namespace;
out.Print(vars, "namespace $package$;\n\n");
- PrintService(service, class_suffix, &out);
+ PrintService(service, class_suffix, is_server, &out);
}
return output;
}
diff --git a/contrib/libs/grpc/src/compiler/php_generator_helpers.h b/contrib/libs/grpc/src/compiler/php_generator_helpers.h
index 70a31eaf75e..93479e20a28 100644
--- a/contrib/libs/grpc/src/compiler/php_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/php_generator_helpers.h
@@ -28,8 +28,10 @@ namespace grpc_php_generator {
inline TString GetPHPServiceClassname(
const grpc::protobuf::ServiceDescriptor* service,
- const TString& class_suffix) {
- return service->name() + (class_suffix == "" ? "Client" : class_suffix);
+ const TString& class_suffix, bool is_server) {
+ return service->name() +
+ (class_suffix == "" ? (is_server ? "" : "Client") : class_suffix) +
+ (is_server ? "Stub" : "");
}
// ReplaceAll replaces all instances of search with replace in s.
@@ -46,7 +48,7 @@ inline TString ReplaceAll(TString s, const TString& search,
inline TString GetPHPServiceFilename(
const grpc::protobuf::FileDescriptor* file,
const grpc::protobuf::ServiceDescriptor* service,
- const TString& class_suffix) {
+ const TString& class_suffix, bool is_server) {
std::ostringstream oss;
if (file->options().has_php_namespace()) {
oss << ReplaceAll(file->options().php_namespace(), "\\", "/");
@@ -58,8 +60,8 @@ inline TString GetPHPServiceFilename(
<< grpc_generator::CapitalizeFirstLetter(tokens[i]);
}
}
- return oss.str() + "/" + GetPHPServiceClassname(service, class_suffix) +
- ".php";
+ return oss.str() + "/" +
+ GetPHPServiceClassname(service, class_suffix, is_server) + ".php";
}
// Get leading or trailing comments in a string. Comment lines start with "// ".
diff --git a/contrib/libs/grpc/src/compiler/protobuf_plugin.h b/contrib/libs/grpc/src/compiler/protobuf_plugin.h
index ef844ea0551..8e6b77a6e11 100644
--- a/contrib/libs/grpc/src/compiler/protobuf_plugin.h
+++ b/contrib/libs/grpc/src/compiler/protobuf_plugin.h
@@ -19,14 +19,14 @@
#ifndef GRPC_INTERNAL_COMPILER_PROTOBUF_PLUGIN_H
#define GRPC_INTERNAL_COMPILER_PROTOBUF_PLUGIN_H
+#include <vector>
+
#include "src/compiler/config.h"
#include "src/compiler/cpp_generator_helpers.h"
#include "src/compiler/python_generator_helpers.h"
#include "src/compiler/python_private_generator.h"
#include "src/compiler/schema_interface.h"
-#include <vector>
-
// Get leading or trailing comments in a string.
template <typename DescriptorType>
inline TString GetCommentsHelper(const DescriptorType* desc, bool leading,
diff --git a/contrib/libs/grpc/src/compiler/python_generator.cc b/contrib/libs/grpc/src/compiler/python_generator.cc
index d083d19f0b3..b8ce31ca72e 100644
--- a/contrib/libs/grpc/src/compiler/python_generator.cc
+++ b/contrib/libs/grpc/src/compiler/python_generator.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/compiler/python_generator.h"
+
#include <algorithm>
#include <cassert>
#include <cctype>
@@ -33,7 +35,6 @@
#include "src/compiler/config.h"
#include "src/compiler/generator_helpers.h"
#include "src/compiler/protobuf_plugin.h"
-#include "src/compiler/python_generator.h"
#include "src/compiler/python_generator_helpers.h"
#include "src/compiler/python_private_generator.h"
diff --git a/contrib/libs/grpc/src/compiler/python_generator.h b/contrib/libs/grpc/src/compiler/python_generator.h
index bcde0a5e358..6d33969ba53 100644
--- a/contrib/libs/grpc/src/compiler/python_generator.h
+++ b/contrib/libs/grpc/src/compiler/python_generator.h
@@ -34,7 +34,7 @@ struct GeneratorConfiguration {
TString grpc_package_root;
// TODO(https://github.com/grpc/grpc/issues/8622): Drop this.
TString beta_package_root;
- // TODO(https://github.com/google/protobuf/issues/888): Drop this.
+ // TODO(https://github.com/protocolbuffers/protobuf/issues/888): Drop this.
TString import_prefix;
std::vector<TString> prefixes_to_filter;
};
diff --git a/contrib/libs/grpc/src/compiler/python_generator_helpers.h b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
index b68ef915ef1..9138add02bf 100644
--- a/contrib/libs/grpc/src/compiler/python_generator_helpers.h
+++ b/contrib/libs/grpc/src/compiler/python_generator_helpers.h
@@ -61,7 +61,7 @@ static TString StripModulePrefixes(
return raw_module_name;
}
-// TODO(https://github.com/google/protobuf/issues/888):
+// TODO(https://github.com/protocolbuffers/protobuf/issues/888):
// Export `ModuleName` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
TString ModuleName(const TString& filename,
@@ -74,7 +74,7 @@ TString ModuleName(const TString& filename,
prefixes_to_filter);
}
-// TODO(https://github.com/google/protobuf/issues/888):
+// TODO(https://github.com/protocolbuffers/protobuf/issues/888):
// Export `ModuleAlias` from protobuf's
// `src/google/protobuf/compiler/python/python_generator.cc` file.
TString ModuleAlias(const TString& filename,
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator.cc b/contrib/libs/grpc/src/compiler/ruby_generator.cc
index 0fba63735c8..f5b9e9db870 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator.cc
+++ b/contrib/libs/grpc/src/compiler/ruby_generator.cc
@@ -16,12 +16,13 @@
*
*/
+#include "src/compiler/ruby_generator.h"
+
#include <cctype>
#include <map>
#include <vector>
#include "src/compiler/config.h"
-#include "src/compiler/ruby_generator.h"
#include "src/compiler/ruby_generator_helpers-inl.h"
#include "src/compiler/ruby_generator_map-inl.h"
#include "src/compiler/ruby_generator_string-inl.h"
@@ -109,7 +110,7 @@ void PrintService(const ServiceDescriptor* service, Printer* out) {
// ruby generator
// to ensure compatibility (with the exception of int and string type changes).
// See
-// https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
+// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/ruby/ruby_generator.cc#L250
// TODO: keep up to date with protoc code generation, though this behavior isn't
// expected to change
bool IsLower(char ch) { return ch >= 'a' && ch <= 'z'; }
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
index 4c75780b1a3..1221a5a7051 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator_map-inl.h
@@ -19,14 +19,14 @@
#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_MAP_INL_H
-#include "src/compiler/config.h"
-
#include <initializer_list>
#include <iostream>
#include <map>
#include <ostream> // NOLINT
#include <vector>
+#include "src/compiler/config.h"
+
using std::initializer_list;
using std::map;
using std::vector;
diff --git a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
index 956539f392a..0df783023e1 100644
--- a/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
+++ b/contrib/libs/grpc/src/compiler/ruby_generator_string-inl.h
@@ -19,12 +19,12 @@
#ifndef GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H
#define GRPC_INTERNAL_COMPILER_RUBY_GENERATOR_STRING_INL_H
-#include "src/compiler/config.h"
-
#include <algorithm>
#include <sstream>
#include <vector>
+#include "src/compiler/config.h"
+
using std::getline;
using std::transform;
diff --git a/contrib/libs/grpc/src/compiler/schema_interface.h b/contrib/libs/grpc/src/compiler/schema_interface.h
index 60b9d337e8d..361c62ea974 100644
--- a/contrib/libs/grpc/src/compiler/schema_interface.h
+++ b/contrib/libs/grpc/src/compiler/schema_interface.h
@@ -19,12 +19,12 @@
#ifndef GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
#define GRPC_INTERNAL_COMPILER_SCHEMA_INTERFACE_H
-#include "src/compiler/config.h"
-
#include <memory>
#include <util/generic/string.h>
#include <vector>
+#include "src/compiler/config.h"
+
#ifdef GRPC_CUSTOM_STRING
#warning GRPC_CUSTOM_STRING is no longer supported. Please use TString.
#endif
diff --git a/contrib/libs/grpc/src/core/ext/filters/census/grpc_context.cc b/contrib/libs/grpc/src/core/ext/filters/census/grpc_context.cc
index 599a798ddaa..6659f701c27 100644
--- a/contrib/libs/grpc/src/core/ext/filters/census/grpc_context.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/census/grpc_context.cc
@@ -20,6 +20,7 @@
#include <grpc/census.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
index 9743d98fb32..d357567c1a7 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.cc
@@ -19,9 +19,8 @@
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "y_absl/strings/string_view.h"
-
-#include "udpa/data/orca/v1/orca_load_report.upb.h"
#include "upb/upb.hpp"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
namespace grpc_core {
@@ -29,8 +28,8 @@ namespace {
template <typename EntryType>
std::map<y_absl::string_view, double> ParseMap(
- udpa_data_orca_v1_OrcaLoadReport* msg,
- const EntryType* (*entry_func)(const udpa_data_orca_v1_OrcaLoadReport*,
+ xds_data_orca_v3_OrcaLoadReport* msg,
+ const EntryType* (*entry_func)(const xds_data_orca_v3_OrcaLoadReport*,
size_t*),
upb_strview (*key_func)(const EntryType*),
double (*value_func)(const EntryType*), Arena* arena) {
@@ -49,33 +48,31 @@ std::map<y_absl::string_view, double> ParseMap(
} // namespace
-const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
- const grpc_slice& serialized_load_report, Arena* arena) {
+const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena) {
upb::Arena upb_arena;
- udpa_data_orca_v1_OrcaLoadReport* msg =
- udpa_data_orca_v1_OrcaLoadReport_parse(
- reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(serialized_load_report)),
- GRPC_SLICE_LENGTH(serialized_load_report), upb_arena.ptr());
+ xds_data_orca_v3_OrcaLoadReport* msg = xds_data_orca_v3_OrcaLoadReport_parse(
+ reinterpret_cast<const char*>(serialized_load_report.begin()),
+ serialized_load_report.size(), upb_arena.ptr());
if (msg == nullptr) return nullptr;
- LoadBalancingPolicy::BackendMetricData* backend_metric_data =
- arena->New<LoadBalancingPolicy::BackendMetricData>();
+ auto* backend_metric_data = arena->New<
+ LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData>();
backend_metric_data->cpu_utilization =
- udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(msg);
+ xds_data_orca_v3_OrcaLoadReport_cpu_utilization(msg);
backend_metric_data->mem_utilization =
- udpa_data_orca_v1_OrcaLoadReport_mem_utilization(msg);
+ xds_data_orca_v3_OrcaLoadReport_mem_utilization(msg);
backend_metric_data->requests_per_second =
- udpa_data_orca_v1_OrcaLoadReport_rps(msg);
+ xds_data_orca_v3_OrcaLoadReport_rps(msg);
backend_metric_data->request_cost =
- ParseMap<udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_request_cost_next,
- udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key,
- udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value, arena);
+ ParseMap<xds_data_orca_v3_OrcaLoadReport_RequestCostEntry>(
+ msg, xds_data_orca_v3_OrcaLoadReport_request_cost_next,
+ xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_key,
+ xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_value, arena);
backend_metric_data->utilization =
- ParseMap<udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry>(
- msg, udpa_data_orca_v1_OrcaLoadReport_utilization_next,
- udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key,
- udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value, arena);
+ ParseMap<xds_data_orca_v3_OrcaLoadReport_UtilizationEntry>(
+ msg, xds_data_orca_v3_OrcaLoadReport_utilization_next,
+ xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_key,
+ xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_value, arena);
return backend_metric_data;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.h
index d92b76c8d32..64f8ef61570 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backend_metric.h
@@ -23,13 +23,14 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/slice/slice.h"
namespace grpc_core {
// Parses the serialized load report and allocates a BackendMetricData
// object on the arena.
-const LoadBalancingPolicy::BackendMetricData* ParseBackendMetricData(
- const grpc_slice& serialized_load_report, Arena* arena);
+const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
index 1b7708953ab..1332e877dc2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.cc
@@ -28,6 +28,7 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/global_config.h"
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset.h"
@@ -89,7 +90,7 @@ static void backup_poller_shutdown_unref(backup_poller* p) {
}
}
-static void done_poller(void* arg, grpc_error* /*error*/) {
+static void done_poller(void* arg, grpc_error_handle /*error*/) {
backup_poller_shutdown_unref(static_cast<backup_poller*>(arg));
}
@@ -112,7 +113,7 @@ static void g_poller_unref() {
}
}
-static void run_poller(void* arg, grpc_error* error) {
+static void run_poller(void* arg, grpc_error_handle error) {
backup_poller* p = static_cast<backup_poller*>(arg);
if (error != GRPC_ERROR_NONE) {
if (error != GRPC_ERROR_CANCELLED) {
@@ -127,7 +128,7 @@ static void run_poller(void* arg, grpc_error* error) {
backup_poller_shutdown_unref(p);
return;
}
- grpc_error* err =
+ grpc_error_handle err =
grpc_pollset_work(p->pollset, nullptr, grpc_core::ExecCtx::Get()->Now());
gpr_mu_unlock(p->pollset_mu);
GRPC_LOG_IF_ERROR("Run client channel backup poller", err);
@@ -138,7 +139,7 @@ static void run_poller(void* arg, grpc_error* error) {
static void g_poller_init_locked() {
if (g_poller == nullptr) {
- g_poller = static_cast<backup_poller*>(gpr_zalloc(sizeof(backup_poller)));
+ g_poller = grpc_core::Zalloc<backup_poller>();
g_poller->pollset =
static_cast<grpc_pollset*>(gpr_zalloc(grpc_pollset_size()));
g_poller->shutting_down = false;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.h
index b412081b960..ae47353a354 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/backup_poller.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gprpp/global_config.h"
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
index 4ebb976efe5..a75b97462e1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/channel_connectivity.cc
@@ -1,226 +1,212 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/channel.h"
-
-#include <inttypes.h>
-
-#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
+#include "src/core/lib/surface/lame_client.h"
+
+namespace {
+
+bool IsLameChannel(grpc_channel* channel) {
+ grpc_channel_element* elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
+ return elem->filter == &grpc_lame_filter;
+}
+
+} // namespace
grpc_connectivity_state grpc_channel_check_connectivity_state(
grpc_channel* channel, int try_to_connect) {
- /* forward through to the underlying client channel */
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_connectivity_state state;
GRPC_API_TRACE(
"grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2,
(channel, try_to_connect));
- if (GPR_LIKELY(client_channel_elem->filter == &grpc_client_channel_filter)) {
- state = grpc_client_channel_check_connectivity_state(client_channel_elem,
- try_to_connect);
-
- return state;
+ // Forward through to the underlying client channel.
+ grpc_core::ClientChannel* client_channel =
+ grpc_core::ClientChannel::GetFromChannel(channel);
+ if (GPR_UNLIKELY(client_channel == nullptr)) {
+ if (IsLameChannel(channel)) return GRPC_CHANNEL_TRANSIENT_FAILURE;
+ gpr_log(GPR_ERROR,
+ "grpc_channel_check_connectivity_state called on something that is "
+ "not a client channel");
+ return GRPC_CHANNEL_SHUTDOWN;
}
- gpr_log(GPR_ERROR,
- "grpc_channel_check_connectivity_state called on something that is "
- "not a client channel, but '%s'",
- client_channel_elem->filter->name);
+ return client_channel->CheckConnectivityState(try_to_connect);
+}
- return GRPC_CHANNEL_SHUTDOWN;
+int grpc_channel_num_external_connectivity_watchers(grpc_channel* channel) {
+ grpc_core::ClientChannel* client_channel =
+ grpc_core::ClientChannel::GetFromChannel(channel);
+ if (client_channel == nullptr) {
+ if (!IsLameChannel(channel)) {
+ gpr_log(GPR_ERROR,
+ "grpc_channel_num_external_connectivity_watchers called on "
+ "something that is not a client channel");
+ }
+ return 0;
+ }
+ return client_channel->NumExternalConnectivityWatchers();
}
-typedef enum {
- WAITING,
- READY_TO_CALL_BACK,
- CALLING_BACK_AND_FINISHED,
-} callback_phase;
+int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
+ return grpc_core::ClientChannel::GetFromChannel(channel) != nullptr;
+}
+namespace grpc_core {
namespace {
-struct state_watcher {
- gpr_mu mu;
- callback_phase phase;
- grpc_closure on_complete;
- grpc_closure on_timeout;
- grpc_closure watcher_timer_init;
- grpc_timer alarm;
- grpc_connectivity_state state;
- grpc_completion_queue* cq;
- grpc_cq_completion completion_storage;
- grpc_channel* channel;
- grpc_error* error;
- void* tag;
-};
-} // namespace
-static void delete_state_watcher(state_watcher* w) {
- grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
- grpc_channel_get_channel_stack(w->channel));
- if (client_channel_elem->filter == &grpc_client_channel_filter) {
- GRPC_CHANNEL_INTERNAL_UNREF(w->channel, "watch_channel_connectivity");
- } else {
- abort();
+class StateWatcher : public DualRefCounted<StateWatcher> {
+ public:
+ StateWatcher(grpc_channel* channel, grpc_completion_queue* cq, void* tag,
+ grpc_connectivity_state last_observed_state,
+ gpr_timespec deadline)
+ : channel_(channel), cq_(cq), tag_(tag), state_(last_observed_state) {
+ GPR_ASSERT(grpc_cq_begin_op(cq, tag));
+ GRPC_CHANNEL_INTERNAL_REF(channel, "watch_channel_connectivity");
+ GRPC_CLOSURE_INIT(&on_complete_, WatchComplete, this, nullptr);
+ GRPC_CLOSURE_INIT(&on_timeout_, TimeoutComplete, this, nullptr);
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel);
+ if (client_channel == nullptr) {
+ // If the target URI used to create the channel was invalid, channel
+ // stack initialization failed, and that caused us to create a lame
+ // channel. In that case, connectivity state will never change (it
+ // will always be TRANSIENT_FAILURE), so we don't actually start a
+ // watch, but we are hiding that fact from the application.
+ if (IsLameChannel(channel)) {
+ // Ref from object creation is held by timer callback.
+ StartTimer(grpc_timespec_to_millis_round_up(deadline));
+ return;
+ }
+ gpr_log(GPR_ERROR,
+ "grpc_channel_watch_connectivity_state called on "
+ "something that is not a client channel");
+ GPR_ASSERT(false);
+ }
+ // Take an addition ref, so we have two (the first one is from the
+ // creation of this object). One will be held by the timer callback,
+ // the other by the watcher callback.
+ Ref().release();
+ auto* watcher_timer_init_state = new WatcherTimerInitState(
+ this, grpc_timespec_to_millis_round_up(deadline));
+ client_channel->AddExternalConnectivityWatcher(
+ grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &state_,
+ &on_complete_, watcher_timer_init_state->closure());
}
- gpr_mu_destroy(&w->mu);
- gpr_free(w);
-}
-static void finished_completion(void* pw, grpc_cq_completion* /*ignored*/) {
- bool should_delete = false;
- state_watcher* w = static_cast<state_watcher*>(pw);
- gpr_mu_lock(&w->mu);
- switch (w->phase) {
- case WAITING:
- case READY_TO_CALL_BACK:
- GPR_UNREACHABLE_CODE(return );
- case CALLING_BACK_AND_FINISHED:
- should_delete = true;
- break;
+ ~StateWatcher() override {
+ GRPC_CHANNEL_INTERNAL_UNREF(channel_, "watch_channel_connectivity");
}
- gpr_mu_unlock(&w->mu);
- if (should_delete) {
- delete_state_watcher(w);
- }
-}
+ private:
+ // A fire-and-forget object used to delay starting the timer until the
+ // ClientChannel actually starts the watch.
+ class WatcherTimerInitState {
+ public:
+ WatcherTimerInitState(StateWatcher* state_watcher, grpc_millis deadline)
+ : state_watcher_(state_watcher), deadline_(deadline) {
+ GRPC_CLOSURE_INIT(&closure_, WatcherTimerInit, this, nullptr);
+ }
-static void partly_done(state_watcher* w, bool due_to_completion,
- grpc_error* error) {
- bool end_op = false;
- void* end_op_tag = nullptr;
- grpc_error* end_op_error = nullptr;
- grpc_completion_queue* end_op_cq = nullptr;
- grpc_cq_completion* end_op_completion_storage = nullptr;
+ grpc_closure* closure() { return &closure_; }
- if (due_to_completion) {
- grpc_timer_cancel(&w->alarm);
- } else {
- grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
- grpc_channel_get_channel_stack(w->channel));
- grpc_client_channel_watch_connectivity_state(
- client_channel_elem,
- grpc_polling_entity_create_from_pollset(grpc_cq_pollset(w->cq)),
- nullptr, &w->on_complete, nullptr);
- }
+ private:
+ static void WatcherTimerInit(void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<WatcherTimerInitState*>(arg);
+ self->state_watcher_->StartTimer(self->deadline_);
+ delete self;
+ }
+
+ StateWatcher* state_watcher_;
+ grpc_millis deadline_;
+ grpc_closure closure_;
+ };
- gpr_mu_lock(&w->mu);
+ void StartTimer(grpc_millis deadline) {
+ grpc_timer_init(&timer_, deadline, &on_timeout_);
+ }
- if (due_to_completion) {
+ static void WatchComplete(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<StateWatcher*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures)) {
GRPC_LOG_IF_ERROR("watch_completion_error", GRPC_ERROR_REF(error));
}
- GRPC_ERROR_UNREF(error);
- error = GRPC_ERROR_NONE;
- } else {
- if (error == GRPC_ERROR_NONE) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Timed out waiting for connection state change");
- } else if (error == GRPC_ERROR_CANCELLED) {
- error = GRPC_ERROR_NONE;
- }
+ grpc_timer_cancel(&self->timer_);
+ self->Unref();
}
- switch (w->phase) {
- case WAITING:
- GRPC_ERROR_REF(error);
- w->error = error;
- w->phase = READY_TO_CALL_BACK;
- break;
- case READY_TO_CALL_BACK:
- if (error != GRPC_ERROR_NONE) {
- GPR_ASSERT(!due_to_completion);
- GRPC_ERROR_UNREF(w->error);
- GRPC_ERROR_REF(error);
- w->error = error;
- }
- w->phase = CALLING_BACK_AND_FINISHED;
- end_op = true;
- end_op_cq = w->cq;
- end_op_tag = w->tag;
- end_op_error = w->error;
- end_op_completion_storage = &w->completion_storage;
- break;
- case CALLING_BACK_AND_FINISHED:
- GPR_UNREACHABLE_CODE(return );
- break;
- }
- gpr_mu_unlock(&w->mu);
- if (end_op) {
- grpc_cq_end_op(end_op_cq, end_op_tag, end_op_error, finished_completion, w,
- end_op_completion_storage);
+ static void TimeoutComplete(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<StateWatcher*>(arg);
+ self->timer_fired_ = error == GRPC_ERROR_NONE;
+ // If this is a client channel (not a lame channel), cancel the watch.
+ ClientChannel* client_channel =
+ ClientChannel::GetFromChannel(self->channel_);
+ if (client_channel != nullptr) {
+ client_channel->CancelExternalConnectivityWatcher(&self->on_complete_);
+ }
+ self->Unref();
}
- GRPC_ERROR_UNREF(error);
-}
+ // Invoked when both strong refs are released.
+ void Orphan() override {
+ WeakRef().release(); // Take a weak ref until completion is finished.
+ grpc_error_handle error =
+ timer_fired_ ? GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Timed out waiting for connection state change")
+ : GRPC_ERROR_NONE;
+ grpc_cq_end_op(cq_, tag_, error, FinishedCompletion, this,
+ &completion_storage_);
+ }
-static void watch_complete(void* pw, grpc_error* error) {
- partly_done(static_cast<state_watcher*>(pw), true, GRPC_ERROR_REF(error));
-}
+ // Called when the completion is returned to the CQ.
+ static void FinishedCompletion(void* arg, grpc_cq_completion* /*ignored*/) {
+ auto* self = static_cast<StateWatcher*>(arg);
+ self->WeakUnref();
+ }
-static void timeout_complete(void* pw, grpc_error* error) {
- partly_done(static_cast<state_watcher*>(pw), false, GRPC_ERROR_REF(error));
-}
+ grpc_channel* channel_;
+ grpc_completion_queue* cq_;
+ void* tag_;
-int grpc_channel_num_external_connectivity_watchers(grpc_channel* channel) {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
- return grpc_client_channel_num_external_connectivity_watchers(
- client_channel_elem);
-}
+ grpc_connectivity_state state_;
-typedef struct watcher_timer_init_arg {
- state_watcher* w;
- gpr_timespec deadline;
-} watcher_timer_init_arg;
+ grpc_cq_completion completion_storage_;
-static void watcher_timer_init(void* arg, grpc_error* /*error_ignored*/) {
- watcher_timer_init_arg* wa = static_cast<watcher_timer_init_arg*>(arg);
+ grpc_closure on_complete_;
+ grpc_timer timer_;
+ grpc_closure on_timeout_;
- grpc_timer_init(&wa->w->alarm, grpc_timespec_to_millis_round_up(wa->deadline),
- &wa->w->on_timeout);
- gpr_free(wa);
-}
+ bool timer_fired_ = false;
+};
-int grpc_channel_support_connectivity_watcher(grpc_channel* channel) {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
- return client_channel_elem->filter != &grpc_client_channel_filter ? 0 : 1;
-}
+} // namespace
+} // namespace grpc_core
void grpc_channel_watch_connectivity_state(
grpc_channel* channel, grpc_connectivity_state last_observed_state,
gpr_timespec deadline, grpc_completion_queue* cq, void* tag) {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- state_watcher* w = static_cast<state_watcher*>(gpr_malloc(sizeof(*w)));
-
GRPC_API_TRACE(
"grpc_channel_watch_connectivity_state("
"channel=%p, last_observed_state=%d, "
@@ -230,35 +216,5 @@ void grpc_channel_watch_connectivity_state(
7,
(channel, (int)last_observed_state, deadline.tv_sec, deadline.tv_nsec,
(int)deadline.clock_type, cq, tag));
-
- GPR_ASSERT(grpc_cq_begin_op(cq, tag));
-
- gpr_mu_init(&w->mu);
- GRPC_CLOSURE_INIT(&w->on_complete, watch_complete, w,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&w->on_timeout, timeout_complete, w,
- grpc_schedule_on_exec_ctx);
- w->phase = WAITING;
- w->state = last_observed_state;
- w->cq = cq;
- w->tag = tag;
- w->channel = channel;
- w->error = nullptr;
-
- watcher_timer_init_arg* wa = static_cast<watcher_timer_init_arg*>(
- gpr_malloc(sizeof(watcher_timer_init_arg)));
- wa->w = w;
- wa->deadline = deadline;
- GRPC_CLOSURE_INIT(&w->watcher_timer_init, watcher_timer_init, wa,
- grpc_schedule_on_exec_ctx);
-
- if (client_channel_elem->filter == &grpc_client_channel_filter) {
- GRPC_CHANNEL_INTERNAL_REF(channel, "watch_channel_connectivity");
- grpc_client_channel_watch_connectivity_state(
- client_channel_elem,
- grpc_polling_entity_create_from_pollset(grpc_cq_pollset(cq)), &w->state,
- &w->on_complete, &w->watcher_timer_init);
- } else {
- abort();
- }
+ new grpc_core::StateWatcher(channel, cq, tag, last_observed_state, deadline);
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
index 415f87a183a..5433d5cc235 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.cc
@@ -26,19 +26,18 @@
#include <set>
+#include "y_absl/container/inlined_vector.h"
#include "y_absl/strings/numbers.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_join.h"
#include "y_absl/strings/string_view.h"
+#include "y_absl/types/optional.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/types/optional.h"
-
#include "src/core/ext/filters/client_channel/backend_metric.h"
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/ext/filters/client_channel/config_selector.h"
@@ -51,17 +50,16 @@
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
-#include "src/core/ext/filters/client_channel/retry_throttle.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/ext/filters/client_channel/retry_filter.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/deadline/deadline_filter.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/polling_entity.h"
@@ -81,320 +79,26 @@
// Client channel filter
//
-// By default, we buffer 256 KiB per RPC for retries.
-// TODO(roth): Do we have any data to suggest a better value?
-#define DEFAULT_PER_RPC_RETRY_BUFFER_SIZE (256 << 10)
-
-// This value was picked arbitrarily. It can be changed if there is
-// any even moderately compelling reason to do so.
-#define RETRY_BACKOFF_JITTER 0.2
-
-// Max number of batches that can be pending on a call at any given
-// time. This includes one batch for each of the following ops:
-// recv_initial_metadata
-// send_initial_metadata
-// recv_message
-// send_message
-// recv_trailing_metadata
-// send_trailing_metadata
-#define MAX_PENDING_BATCHES 6
-
-// Channel arg containing a pointer to the ChannelData object.
-#define GRPC_ARG_CLIENT_CHANNEL_DATA "grpc.internal.client_channel_data"
-
-// Channel arg containing a pointer to the RetryThrottleData object.
-#define GRPC_ARG_RETRY_THROTTLE_DATA "grpc.internal.retry_throttle_data"
+#define GRPC_ARG_HEALTH_CHECK_SERVICE_NAME \
+ "grpc.internal.health_check_service_name"
namespace grpc_core {
using internal::ClientChannelGlobalParsedConfig;
using internal::ClientChannelMethodParsedConfig;
using internal::ClientChannelServiceConfigParser;
-using internal::ServerRetryThrottleData;
TraceFlag grpc_client_channel_call_trace(false, "client_channel_call");
TraceFlag grpc_client_channel_routing_trace(false, "client_channel_routing");
-namespace {
-
//
-// ChannelData definition
+// ClientChannel::CallData definition
//
-class ChannelData {
+class ClientChannel::CallData {
public:
- class CallData;
- class RetryingCall;
- class LoadBalancedCall;
-
- static grpc_error* Init(grpc_channel_element* elem,
- grpc_channel_element_args* args);
- static void Destroy(grpc_channel_element* elem);
- static void StartTransportOp(grpc_channel_element* elem,
- grpc_transport_op* op);
- static void GetChannelInfo(grpc_channel_element* elem,
- const grpc_channel_info* info);
-
- grpc_connectivity_state CheckConnectivityState(bool try_to_connect);
-
- void AddExternalConnectivityWatcher(grpc_polling_entity pollent,
- grpc_connectivity_state* state,
- grpc_closure* on_complete,
- grpc_closure* watcher_timer_init) {
- new ExternalConnectivityWatcher(this, pollent, state, on_complete,
- watcher_timer_init);
- }
-
- void RemoveExternalConnectivityWatcher(grpc_closure* on_complete,
- bool cancel) {
- ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap(
- this, on_complete, cancel);
- }
-
- int NumExternalConnectivityWatchers() const {
- MutexLock lock(&external_watchers_mu_);
- return static_cast<int>(external_watchers_.size());
- }
-
- void AddConnectivityWatcher(
- grpc_connectivity_state initial_state,
- OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher);
- void RemoveConnectivityWatcher(
- AsyncConnectivityStateWatcherInterface* watcher);
-
- private:
- class DynamicTerminationFilterChannelData;
- class SubchannelWrapper;
- class ClientChannelControlHelper;
- class ConnectivityWatcherAdder;
- class ConnectivityWatcherRemover;
-
- // Represents a pending connectivity callback from an external caller
- // via grpc_client_channel_watch_connectivity_state().
- class ExternalConnectivityWatcher : public ConnectivityStateWatcherInterface {
- public:
- ExternalConnectivityWatcher(ChannelData* chand, grpc_polling_entity pollent,
- grpc_connectivity_state* state,
- grpc_closure* on_complete,
- grpc_closure* watcher_timer_init);
-
- ~ExternalConnectivityWatcher() override;
-
- // Removes the watcher from the external_watchers_ map.
- static void RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
- grpc_closure* on_complete,
- bool cancel);
-
- void Notify(grpc_connectivity_state state,
- const y_absl::Status& /* status */) override;
-
- void Cancel();
-
- private:
- // Adds the watcher to state_tracker_. Consumes the ref that is passed to it
- // from Start().
- void AddWatcherLocked();
- void RemoveWatcherLocked();
-
- ChannelData* chand_;
- grpc_polling_entity pollent_;
- grpc_connectivity_state initial_state_;
- grpc_connectivity_state* state_;
- grpc_closure* on_complete_;
- grpc_closure* watcher_timer_init_;
- Atomic<bool> done_{false};
- };
-
- class ResolverResultHandler : public Resolver::ResultHandler {
- public:
- explicit ResolverResultHandler(ChannelData* chand) : chand_(chand) {
- GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ResolverResultHandler");
- }
-
- ~ResolverResultHandler() override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p: resolver shutdown complete", chand_);
- }
- GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ResolverResultHandler");
- }
-
- void ReturnResult(Resolver::Result result) override {
- chand_->OnResolverResultChangedLocked(std::move(result));
- }
-
- void ReturnError(grpc_error* error) override {
- chand_->OnResolverErrorLocked(error);
- }
-
- private:
- ChannelData* chand_;
- };
-
- struct ResolverQueuedCall {
- grpc_call_element* elem;
- ResolverQueuedCall* next = nullptr;
- };
- struct LbQueuedCall {
- LoadBalancedCall* lb_call;
- LbQueuedCall* next = nullptr;
- };
-
- ChannelData(grpc_channel_element_args* args, grpc_error** error);
- ~ChannelData();
-
- // Note: Does NOT return a new ref.
- grpc_error* disconnect_error() const {
- return disconnect_error_.Load(MemoryOrder::ACQUIRE);
- }
-
- // Note: All methods with "Locked" suffix must be invoked from within
- // work_serializer_.
-
- void OnResolverResultChangedLocked(Resolver::Result result);
- void OnResolverErrorLocked(grpc_error* error);
-
- void CreateOrUpdateLbPolicyLocked(
- RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
- Resolver::Result result);
- OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
- const grpc_channel_args& args);
-
- void UpdateStateAndPickerLocked(
- grpc_connectivity_state state, const y_absl::Status& status,
- const char* reason,
- std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker);
-
- void UpdateServiceConfigInControlPlaneLocked(
- RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name);
-
- void UpdateServiceConfigInDataPlaneLocked();
-
- void CreateResolverLocked();
- void DestroyResolverAndLbPolicyLocked();
-
- grpc_error* DoPingLocked(grpc_transport_op* op);
-
- void StartTransportOpLocked(grpc_transport_op* op);
-
- void TryToConnectLocked();
-
- // These methods all require holding resolution_mu_.
- void AddResolverQueuedCall(ResolverQueuedCall* call,
- grpc_polling_entity* pollent)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_);
- void RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
- grpc_polling_entity* pollent)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_);
-
- // These methods all require holding data_plane_mu_.
- void AddLbQueuedCall(LbQueuedCall* call, grpc_polling_entity* pollent)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
- void RemoveLbQueuedCall(LbQueuedCall* to_remove, grpc_polling_entity* pollent)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
- RefCountedPtr<ConnectedSubchannel> GetConnectedSubchannelInDataPlane(
- SubchannelInterface* subchannel) const
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
-
- //
- // Fields set at construction and never modified.
- //
- const bool deadline_checking_enabled_;
- const bool enable_retries_;
- const size_t per_rpc_retry_buffer_size_;
- grpc_channel_stack* owning_stack_;
- ClientChannelFactory* client_channel_factory_;
- const grpc_channel_args* channel_args_;
- RefCountedPtr<ServiceConfig> default_service_config_;
- TString server_name_;
- UniquePtr<char> target_uri_;
- channelz::ChannelNode* channelz_node_;
-
- //
- // Fields related to name resolution. Guarded by resolution_mu_.
- //
- mutable Mutex resolution_mu_;
- // Linked list of calls queued waiting for resolver result.
- ResolverQueuedCall* resolver_queued_calls_ Y_ABSL_GUARDED_BY(resolution_mu_) =
- nullptr;
- // Data from service config.
- grpc_error* resolver_transient_failure_error_
- Y_ABSL_GUARDED_BY(resolution_mu_) = GRPC_ERROR_NONE;
- bool received_service_config_data_ Y_ABSL_GUARDED_BY(resolution_mu_) = false;
- RefCountedPtr<ServiceConfig> service_config_ Y_ABSL_GUARDED_BY(resolution_mu_);
- RefCountedPtr<ConfigSelector> config_selector_
- Y_ABSL_GUARDED_BY(resolution_mu_);
- RefCountedPtr<DynamicFilters> dynamic_filters_
- Y_ABSL_GUARDED_BY(resolution_mu_);
-
- //
- // Fields used in the data plane. Guarded by data_plane_mu_.
- //
- mutable Mutex data_plane_mu_;
- std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_
- Y_ABSL_GUARDED_BY(data_plane_mu_);
- // Linked list of calls queued waiting for LB pick.
- LbQueuedCall* lb_queued_calls_ Y_ABSL_GUARDED_BY(data_plane_mu_) = nullptr;
-
- //
- // Fields used in the control plane. Guarded by work_serializer.
- //
- std::shared_ptr<WorkSerializer> work_serializer_;
- grpc_pollset_set* interested_parties_;
- ConnectivityStateTracker state_tracker_;
- OrphanablePtr<Resolver> resolver_;
- bool previous_resolution_contained_addresses_ = false;
- RefCountedPtr<ServiceConfig> saved_service_config_;
- RefCountedPtr<ConfigSelector> saved_config_selector_;
- y_absl::optional<TString> health_check_service_name_;
- OrphanablePtr<LoadBalancingPolicy> lb_policy_;
- RefCountedPtr<SubchannelPoolInterface> subchannel_pool_;
- // The number of SubchannelWrapper instances referencing a given Subchannel.
- std::map<Subchannel*, int> subchannel_refcount_map_;
- // The set of SubchannelWrappers that currently exist.
- // No need to hold a ref, since the map is updated in the control-plane
- // work_serializer when the SubchannelWrappers are created and destroyed.
- std::set<SubchannelWrapper*> subchannel_wrappers_;
- // Pending ConnectedSubchannel updates for each SubchannelWrapper.
- // Updates are queued here in the control plane work_serializer and then
- // applied in the data plane mutex when the picker is updated.
- std::map<RefCountedPtr<SubchannelWrapper>, RefCountedPtr<ConnectedSubchannel>>
- pending_subchannel_updates_;
- int keepalive_time_ = -1;
-
- //
- // Fields accessed from both data plane mutex and control plane
- // work_serializer.
- //
- Atomic<grpc_error*> disconnect_error_;
-
- //
- // Fields guarded by a mutex, since they need to be accessed
- // synchronously via get_channel_info().
- //
- Mutex info_mu_;
- UniquePtr<char> info_lb_policy_name_ Y_ABSL_GUARDED_BY(info_mu_);
- UniquePtr<char> info_service_config_json_ Y_ABSL_GUARDED_BY(info_mu_);
-
- //
- // Fields guarded by a mutex, since they need to be accessed
- // synchronously via grpc_channel_num_external_connectivity_watchers().
- //
- mutable Mutex external_watchers_mu_;
- std::map<grpc_closure*, RefCountedPtr<ExternalConnectivityWatcher>>
- external_watchers_ Y_ABSL_GUARDED_BY(external_watchers_mu_);
-};
-
-//
-// ChannelData::CallData definition
-//
-
-class ChannelData::CallData {
- public:
- static grpc_error* Init(grpc_call_element* elem,
- const grpc_call_element_args* args);
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
static void Destroy(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* then_schedule_closure);
@@ -403,23 +107,23 @@ class ChannelData::CallData {
static void SetPollent(grpc_call_element* elem, grpc_polling_entity* pollent);
// Invoked by channel for queued calls when name resolution is completed.
- static void CheckResolution(void* arg, grpc_error* error);
+ static void CheckResolution(void* arg, grpc_error_handle error);
// Helper function for applying the service config to a call while
- // holding ChannelData::resolution_mu_.
+ // holding ClientChannel::resolution_mu_.
// Returns true if the service config has been applied to the call, in which
// case the caller must invoke ResolutionDone() or AsyncResolutionDone()
// with the returned error.
- bool CheckResolutionLocked(grpc_call_element* elem, grpc_error** error)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::resolution_mu_);
+ bool CheckResolutionLocked(grpc_call_element* elem, grpc_error_handle* error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
// Schedules a callback to continue processing the call once
// resolution is complete. The callback will not run until after this
// method returns.
- void AsyncResolutionDone(grpc_call_element* elem, grpc_error* error);
+ void AsyncResolutionDone(grpc_call_element* elem, grpc_error_handle error);
private:
class ResolverQueuedCallCanceller;
- CallData(grpc_call_element* elem, const ChannelData& chand,
+ CallData(grpc_call_element* elem, const ClientChannel& chand,
const grpc_call_element_args& args);
~CallData();
@@ -427,7 +131,8 @@ class ChannelData::CallData {
static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
void PendingBatchesAdd(grpc_call_element* elem,
grpc_transport_stream_op_batch* batch);
- static void FailPendingBatchInCallCombiner(void* arg, grpc_error* error);
+ static void FailPendingBatchInCallCombiner(void* arg,
+ grpc_error_handle error);
// A predicate type and some useful implementations for PendingBatchesFail().
typedef bool (*YieldCallCombinerPredicate)(
const CallCombinerClosureList& closures);
@@ -445,9 +150,10 @@ class ChannelData::CallData {
// If yield_call_combiner_predicate returns true, assumes responsibility for
// yielding the call combiner.
void PendingBatchesFail(
- grpc_call_element* elem, grpc_error* error,
+ grpc_call_element* elem, grpc_error_handle error,
YieldCallCombinerPredicate yield_call_combiner_predicate);
- static void ResumePendingBatchInCallCombiner(void* arg, grpc_error* ignored);
+ static void ResumePendingBatchInCallCombiner(void* arg,
+ grpc_error_handle ignored);
// Resumes all pending batches on lb_call_.
void PendingBatchesResume(grpc_call_element* elem);
@@ -455,24 +161,24 @@ class ChannelData::CallData {
// that the resolver has returned results to the channel.
// If an error is returned, the error indicates the status with which
// the call should be failed.
- grpc_error* ApplyServiceConfigToCallLocked(
+ grpc_error_handle ApplyServiceConfigToCallLocked(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::resolution_mu_);
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
// Invoked when the resolver result is applied to the caller, on both
// success or failure.
- static void ResolutionDone(void* arg, grpc_error* error);
+ static void ResolutionDone(void* arg, grpc_error_handle error);
// Removes the call (if present) from the channel's list of calls queued
// for name resolution.
void MaybeRemoveCallFromResolverQueuedCallsLocked(grpc_call_element* elem)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::resolution_mu_);
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
// Adds the call (if not already present) to the channel's list of
// calls queued for name resolution.
void MaybeAddCallToResolverQueuedCallsLocked(grpc_call_element* elem)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::resolution_mu_);
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::resolution_mu_);
- static void RecvInitialMetadataReadyForConfigSelectorCommitCallback(
- void* arg, grpc_error* error);
- void InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(
+ static void RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
+ void* arg, grpc_error_handle error);
+ void InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
grpc_transport_stream_op_batch* batch);
void CreateDynamicCall(grpc_call_element* elem);
@@ -495,18 +201,20 @@ class ChannelData::CallData {
grpc_polling_entity* pollent_ = nullptr;
- grpc_closure pick_closure_;
+ grpc_closure resolution_done_closure_;
- // Accessed while holding ChannelData::resolution_mu_.
- bool service_config_applied_ = false;
- bool queued_pending_resolver_result_ = false;
- ChannelData::ResolverQueuedCall resolver_queued_call_;
- ResolverQueuedCallCanceller* resolver_call_canceller_ = nullptr;
+ // Accessed while holding ClientChannel::resolution_mu_.
+ bool service_config_applied_ Y_ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) =
+ false;
+ bool queued_pending_resolver_result_
+ Y_ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) = false;
+ ClientChannel::ResolverQueuedCall resolver_queued_call_
+ Y_ABSL_GUARDED_BY(&ClientChannel::resolution_mu_);
+ ResolverQueuedCallCanceller* resolver_call_canceller_
+ Y_ABSL_GUARDED_BY(&ClientChannel::resolution_mu_) = nullptr;
- std::function<void()> on_call_committed_;
-
- grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
- grpc_closure recv_initial_metadata_ready_;
+ grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
+ grpc_closure recv_trailing_metadata_ready_;
RefCountedPtr<DynamicFilters> dynamic_filters_;
RefCountedPtr<DynamicFilters::Call> dynamic_call_;
@@ -519,565 +227,72 @@ class ChannelData::CallData {
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
// Set when we get a cancel_stream op.
- grpc_error* cancel_error_ = GRPC_ERROR_NONE;
-};
-
-//
-// ChannelData::RetryingCall definition
-//
-
-class ChannelData::RetryingCall {
- public:
- RetryingCall(
- ChannelData* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent,
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data,
- const ClientChannelMethodParsedConfig::RetryPolicy* retry_policy);
- ~RetryingCall();
-
- void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
-
- RefCountedPtr<SubchannelCall> subchannel_call() const;
-
- private:
- // State used for starting a retryable batch on a subchannel call.
- // This provides its own grpc_transport_stream_op_batch and other data
- // structures needed to populate the ops in the batch.
- // We allocate one struct on the arena for each attempt at starting a
- // batch on a given subchannel call.
- struct SubchannelCallBatchData {
- // Creates a SubchannelCallBatchData object on the call's arena with the
- // specified refcount. If set_on_complete is true, the batch's
- // on_complete callback will be set to point to on_complete();
- // otherwise, the batch's on_complete callback will be null.
- static SubchannelCallBatchData* Create(RetryingCall* call, int refcount,
- bool set_on_complete);
-
- void Unref() {
- if (gpr_unref(&refs)) Destroy();
- }
-
- SubchannelCallBatchData(RetryingCall* call, int refcount,
- bool set_on_complete);
- // All dtor code must be added in `Destroy()`. This is because we may
- // call closures in `SubchannelCallBatchData` after they are unrefed by
- // `Unref()`, and msan would complain about accessing this class
- // after calling dtor. As a result we cannot call the `dtor` in `Unref()`.
- // TODO(soheil): We should try to call the dtor in `Unref()`.
- ~SubchannelCallBatchData() { Destroy(); }
- void Destroy();
-
- gpr_refcount refs;
- grpc_call_element* elem;
- RetryingCall* call;
- RefCountedPtr<ChannelData::LoadBalancedCall> lb_call;
- // The batch to use in the subchannel call.
- // Its payload field points to SubchannelCallRetryState::batch_payload.
- grpc_transport_stream_op_batch batch;
- // For intercepting on_complete.
- grpc_closure on_complete;
- };
-
- // Retry state associated with a subchannel call.
- // Stored in the parent_data of the subchannel call object.
- struct SubchannelCallRetryState {
- explicit SubchannelCallRetryState(grpc_call_context_element* context)
- : batch_payload(context),
- started_send_initial_metadata(false),
- completed_send_initial_metadata(false),
- started_send_trailing_metadata(false),
- completed_send_trailing_metadata(false),
- started_recv_initial_metadata(false),
- completed_recv_initial_metadata(false),
- started_recv_trailing_metadata(false),
- completed_recv_trailing_metadata(false),
- retry_dispatched(false) {}
-
- // SubchannelCallBatchData.batch.payload points to this.
- grpc_transport_stream_op_batch_payload batch_payload;
- // For send_initial_metadata.
- // Note that we need to make a copy of the initial metadata for each
- // subchannel call instead of just referring to the copy in call_data,
- // because filters in the subchannel stack will probably add entries,
- // so we need to start in a pristine state for each attempt of the call.
- grpc_linked_mdelem* send_initial_metadata_storage;
- grpc_metadata_batch send_initial_metadata;
- // For send_message.
- // TODO(roth): Restructure this to eliminate use of ManualConstructor.
- ManualConstructor<ByteStreamCache::CachingByteStream> send_message;
- // For send_trailing_metadata.
- grpc_linked_mdelem* send_trailing_metadata_storage;
- grpc_metadata_batch send_trailing_metadata;
- // For intercepting recv_initial_metadata.
- grpc_metadata_batch recv_initial_metadata;
- grpc_closure recv_initial_metadata_ready;
- bool trailing_metadata_available = false;
- // For intercepting recv_message.
- grpc_closure recv_message_ready;
- OrphanablePtr<ByteStream> recv_message;
- // For intercepting recv_trailing_metadata.
- grpc_metadata_batch recv_trailing_metadata;
- grpc_transport_stream_stats collect_stats;
- grpc_closure recv_trailing_metadata_ready;
- // These fields indicate which ops have been started and completed on
- // this subchannel call.
- size_t started_send_message_count = 0;
- size_t completed_send_message_count = 0;
- size_t started_recv_message_count = 0;
- size_t completed_recv_message_count = 0;
- bool started_send_initial_metadata : 1;
- bool completed_send_initial_metadata : 1;
- bool started_send_trailing_metadata : 1;
- bool completed_send_trailing_metadata : 1;
- bool started_recv_initial_metadata : 1;
- bool completed_recv_initial_metadata : 1;
- bool started_recv_trailing_metadata : 1;
- bool completed_recv_trailing_metadata : 1;
- // State for callback processing.
- SubchannelCallBatchData* recv_initial_metadata_ready_deferred_batch =
- nullptr;
- grpc_error* recv_initial_metadata_error = GRPC_ERROR_NONE;
- SubchannelCallBatchData* recv_message_ready_deferred_batch = nullptr;
- grpc_error* recv_message_error = GRPC_ERROR_NONE;
- SubchannelCallBatchData* recv_trailing_metadata_internal_batch = nullptr;
- // NOTE: Do not move this next to the metadata bitfields above. That would
- // save space but will also result in a data race because compiler
- // will generate a 2 byte store which overwrites the meta-data
- // fields upon setting this field.
- bool retry_dispatched : 1;
- };
-
- // Pending batches stored in call data.
- struct PendingBatch {
- // The pending batch. If nullptr, this slot is empty.
- grpc_transport_stream_op_batch* batch = nullptr;
- // Indicates whether payload for send ops has been cached in CallData.
- bool send_ops_cached = false;
- };
-
- // Caches data for send ops so that it can be retried later, if not
- // already cached.
- void MaybeCacheSendOpsForBatch(PendingBatch* pending);
- void FreeCachedSendInitialMetadata();
- // Frees cached send_message at index idx.
- void FreeCachedSendMessage(size_t idx);
- void FreeCachedSendTrailingMetadata();
- // Frees cached send ops that have already been completed after
- // committing the call.
- void FreeCachedSendOpDataAfterCommit(SubchannelCallRetryState* retry_state);
- // Frees cached send ops that were completed by the completed batch in
- // batch_data. Used when batches are completed after the call is committed.
- void FreeCachedSendOpDataForCompletedBatch(
- SubchannelCallBatchData* batch_data,
- SubchannelCallRetryState* retry_state);
-
- // Returns the index into pending_batches_ to be used for batch.
- static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
- void PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
- void PendingBatchClear(PendingBatch* pending);
- void MaybeClearPendingBatch(PendingBatch* pending);
- static void FailPendingBatchInCallCombiner(void* arg, grpc_error* error);
- // A predicate type and some useful implementations for PendingBatchesFail().
- typedef bool (*YieldCallCombinerPredicate)(
- const CallCombinerClosureList& closures);
- static bool YieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
- return true;
- }
- static bool NoYieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
- return false;
- }
- static bool YieldCallCombinerIfPendingBatchesFound(
- const CallCombinerClosureList& closures) {
- return closures.size() > 0;
- }
- // Fails all pending batches.
- // If yield_call_combiner_predicate returns true, assumes responsibility for
- // yielding the call combiner.
- void PendingBatchesFail(
- grpc_error* error,
- YieldCallCombinerPredicate yield_call_combiner_predicate);
- static void ResumePendingBatchInCallCombiner(void* arg, grpc_error* ignored);
- // Resumes all pending batches on lb_call_.
- void PendingBatchesResume();
- // Returns a pointer to the first pending batch for which predicate(batch)
- // returns true, or null if not found.
- template <typename Predicate>
- PendingBatch* PendingBatchFind(const char* log_message, Predicate predicate);
-
- // Commits the call so that no further retry attempts will be performed.
- void RetryCommit(SubchannelCallRetryState* retry_state);
- // Starts a retry after appropriate back-off.
- void DoRetry(SubchannelCallRetryState* retry_state,
- grpc_millis server_pushback_ms);
- // Returns true if the call is being retried.
- bool MaybeRetry(SubchannelCallBatchData* batch_data, grpc_status_code status,
- grpc_mdelem* server_pushback_md);
-
- // Invokes recv_initial_metadata_ready for a subchannel batch.
- static void InvokeRecvInitialMetadataCallback(void* arg, grpc_error* error);
- // Intercepts recv_initial_metadata_ready callback for retries.
- // Commits the call and returns the initial metadata up the stack.
- static void RecvInitialMetadataReady(void* arg, grpc_error* error);
-
- // Invokes recv_message_ready for a subchannel batch.
- static void InvokeRecvMessageCallback(void* arg, grpc_error* error);
- // Intercepts recv_message_ready callback for retries.
- // Commits the call and returns the message up the stack.
- static void RecvMessageReady(void* arg, grpc_error* error);
-
- // Sets *status and *server_pushback_md based on md_batch and error.
- // Only sets *server_pushback_md if server_pushback_md != nullptr.
- void GetCallStatus(grpc_metadata_batch* md_batch, grpc_error* error,
- grpc_status_code* status,
- grpc_mdelem** server_pushback_md);
- // Adds recv_trailing_metadata_ready closure to closures.
- void AddClosureForRecvTrailingMetadataReady(
- SubchannelCallBatchData* batch_data, grpc_error* error,
- CallCombinerClosureList* closures);
- // Adds any necessary closures for deferred recv_initial_metadata and
- // recv_message callbacks to closures.
- static void AddClosuresForDeferredRecvCallbacks(
- SubchannelCallBatchData* batch_data,
- SubchannelCallRetryState* retry_state, CallCombinerClosureList* closures);
- // Returns true if any op in the batch was not yet started.
- // Only looks at send ops, since recv ops are always started immediately.
- bool PendingBatchIsUnstarted(PendingBatch* pending,
- SubchannelCallRetryState* retry_state);
- // For any pending batch containing an op that has not yet been started,
- // adds the pending batch's completion closures to closures.
- void AddClosuresToFailUnstartedPendingBatches(
- SubchannelCallRetryState* retry_state, grpc_error* error,
- CallCombinerClosureList* closures);
- // Runs necessary closures upon completion of a call attempt.
- void RunClosuresForCompletedCall(SubchannelCallBatchData* batch_data,
- grpc_error* error);
- // Intercepts recv_trailing_metadata_ready callback for retries.
- // Commits the call and returns the trailing metadata up the stack.
- static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
-
- // Adds the on_complete closure for the pending batch completed in
- // batch_data to closures.
- void AddClosuresForCompletedPendingBatch(SubchannelCallBatchData* batch_data,
- grpc_error* error,
- CallCombinerClosureList* closures);
-
- // If there are any cached ops to replay or pending ops to start on the
- // subchannel call, adds a closure to closures to invoke
- // StartRetriableSubchannelBatches().
- void AddClosuresForReplayOrPendingSendOps(
- SubchannelCallBatchData* batch_data,
- SubchannelCallRetryState* retry_state, CallCombinerClosureList* closures);
-
- // Callback used to intercept on_complete from subchannel calls.
- // Called only when retries are enabled.
- static void OnComplete(void* arg, grpc_error* error);
-
- static void StartBatchInCallCombiner(void* arg, grpc_error* ignored);
- // Adds a closure to closures that will execute batch in the call combiner.
- void AddClosureForSubchannelBatch(grpc_transport_stream_op_batch* batch,
- CallCombinerClosureList* closures);
- // Adds retriable send_initial_metadata op to batch_data.
- void AddRetriableSendInitialMetadataOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Adds retriable send_message op to batch_data.
- void AddRetriableSendMessageOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Adds retriable send_trailing_metadata op to batch_data.
- void AddRetriableSendTrailingMetadataOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Adds retriable recv_initial_metadata op to batch_data.
- void AddRetriableRecvInitialMetadataOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Adds retriable recv_message op to batch_data.
- void AddRetriableRecvMessageOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Adds retriable recv_trailing_metadata op to batch_data.
- void AddRetriableRecvTrailingMetadataOp(SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data);
- // Helper function used to start a recv_trailing_metadata batch. This
- // is used in the case where a recv_initial_metadata or recv_message
- // op fails in a way that we know the call is over but when the application
- // has not yet started its own recv_trailing_metadata op.
- void StartInternalRecvTrailingMetadata();
- // If there are any cached send ops that need to be replayed on the
- // current subchannel call, creates and returns a new subchannel batch
- // to replay those ops. Otherwise, returns nullptr.
- SubchannelCallBatchData* MaybeCreateSubchannelBatchForReplay(
- SubchannelCallRetryState* retry_state);
- // Adds subchannel batches for pending batches to closures.
- void AddSubchannelBatchesForPendingBatches(
- SubchannelCallRetryState* retry_state, CallCombinerClosureList* closures);
- // Constructs and starts whatever subchannel batches are needed on the
- // subchannel call.
- static void StartRetriableSubchannelBatches(void* arg, grpc_error* ignored);
-
- static void CreateLbCall(void* arg, grpc_error* error);
-
- ChannelData* chand_;
- grpc_polling_entity* pollent_;
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
- const ClientChannelMethodParsedConfig::RetryPolicy* retry_policy_ = nullptr;
- BackOff retry_backoff_;
-
- grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
- Arena* arena_;
- grpc_call_stack* owning_call_;
- CallCombiner* call_combiner_;
- grpc_call_context_element* call_context_;
-
- grpc_closure retry_closure_;
-
- RefCountedPtr<ChannelData::LoadBalancedCall> lb_call_;
-
- // Batches are added to this list when received from above.
- // They are removed when we are done handling the batch (i.e., when
- // either we have invoked all of the batch's callbacks or we have
- // passed the batch down to the LB call and are not intercepting any of
- // its callbacks).
- // TODO(roth): Now that the retry code is split out into its own call
- // object, revamp this to work in a cleaner way, since we no longer need
- // for batches to ever wait for name resolution or LB picks.
- PendingBatch pending_batches_[MAX_PENDING_BATCHES];
- bool pending_send_initial_metadata_ : 1;
- bool pending_send_message_ : 1;
- bool pending_send_trailing_metadata_ : 1;
-
- // Set when we get a cancel_stream op.
- grpc_error* cancel_error_ = GRPC_ERROR_NONE;
-
- // Retry state.
- bool enable_retries_ : 1;
- bool retry_committed_ : 1;
- bool last_attempt_got_server_pushback_ : 1;
- int num_attempts_completed_ = 0;
- size_t bytes_buffered_for_retry_ = 0;
- grpc_timer retry_timer_;
-
- // The number of pending retriable subchannel batches containing send ops.
- // We hold a ref to the call stack while this is non-zero, since replay
- // batches may not complete until after all callbacks have been returned
- // to the surface, and we need to make sure that the call is not destroyed
- // until all of these batches have completed.
- // Note that we actually only need to track replay batches, but it's
- // easier to track all batches with send ops.
- int num_pending_retriable_subchannel_send_batches_ = 0;
-
- // Cached data for retrying send ops.
- // send_initial_metadata
- bool seen_send_initial_metadata_ = false;
- grpc_linked_mdelem* send_initial_metadata_storage_ = nullptr;
- grpc_metadata_batch send_initial_metadata_;
- uint32_t send_initial_metadata_flags_;
- gpr_atm* peer_string_;
- // send_message
- // When we get a send_message op, we replace the original byte stream
- // with a CachingByteStream that caches the slices to a local buffer for
- // use in retries.
- // Note: We inline the cache for the first 3 send_message ops and use
- // dynamic allocation after that. This number was essentially picked
- // at random; it could be changed in the future to tune performance.
- y_absl::InlinedVector<ByteStreamCache*, 3> send_messages_;
- // send_trailing_metadata
- bool seen_send_trailing_metadata_ = false;
- grpc_linked_mdelem* send_trailing_metadata_storage_ = nullptr;
- grpc_metadata_batch send_trailing_metadata_;
+ grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
};
//
-// ChannelData::LoadBalancedCall definition
+// Filter vtable
//
-// This object is ref-counted, but it cannot inherit from RefCounted<>,
-// because it is allocated on the arena and can't free its memory when
-// its refcount goes to zero. So instead, it manually implements the
-// same API as RefCounted<>, so that it can be used with RefCountedPtr<>.
-class ChannelData::LoadBalancedCall {
- public:
- static RefCountedPtr<LoadBalancedCall> Create(
- ChannelData* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent, size_t parent_data_size);
-
- LoadBalancedCall(ChannelData* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent);
- ~LoadBalancedCall();
-
- // Interface of RefCounted<>.
- RefCountedPtr<LoadBalancedCall> Ref() GRPC_MUST_USE_RESULT;
- RefCountedPtr<LoadBalancedCall> Ref(const DebugLocation& location,
- const char* reason) GRPC_MUST_USE_RESULT;
- // When refcount drops to 0, destroys itself and the associated call stack,
- // but does NOT free the memory because it's in the call arena.
- void Unref();
- void Unref(const DebugLocation& location, const char* reason);
-
- void* GetParentData();
-
- void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
-
- // Invoked by channel for queued LB picks when the picker is updated.
- static void PickSubchannel(void* arg, grpc_error* error);
- // Helper function for performing an LB pick while holding the data plane
- // mutex. Returns true if the pick is complete, in which case the caller
- // must invoke PickDone() or AsyncPickDone() with the returned error.
- bool PickSubchannelLocked(grpc_error** error)
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::data_plane_mu_);
- // Schedules a callback to process the completed pick. The callback
- // will not run until after this method returns.
- void AsyncPickDone(grpc_error* error);
-
- RefCountedPtr<SubchannelCall> subchannel_call() const {
- return subchannel_call_;
- }
-
- private:
- // Allow RefCountedPtr<> to access IncrementRefCount().
- template <typename T>
- friend class ::grpc_core::RefCountedPtr;
-
- class LbQueuedCallCanceller;
- class Metadata;
- class LbCallState;
-
- // Interface of RefCounted<>.
- void IncrementRefCount();
- void IncrementRefCount(const DebugLocation& location, const char* reason);
-
- // Returns the index into pending_batches_ to be used for batch.
- static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
- void PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
- static void FailPendingBatchInCallCombiner(void* arg, grpc_error* error);
- // A predicate type and some useful implementations for PendingBatchesFail().
- typedef bool (*YieldCallCombinerPredicate)(
- const CallCombinerClosureList& closures);
- static bool YieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
- return true;
- }
- static bool NoYieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
- return false;
- }
- static bool YieldCallCombinerIfPendingBatchesFound(
- const CallCombinerClosureList& closures) {
- return closures.size() > 0;
- }
- // Fails all pending batches.
- // If yield_call_combiner_predicate returns true, assumes responsibility for
- // yielding the call combiner.
- void PendingBatchesFail(
- grpc_error* error,
- YieldCallCombinerPredicate yield_call_combiner_predicate);
- static void ResumePendingBatchInCallCombiner(void* arg, grpc_error* ignored);
- // Resumes all pending batches on subchannel_call_.
- void PendingBatchesResume();
-
- static void RecvTrailingMetadataReadyForLoadBalancingPolicy(
- void* arg, grpc_error* error);
- void InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(
- grpc_transport_stream_op_batch* batch);
-
- void CreateSubchannelCall();
- // Invoked when a pick is completed, on both success or failure.
- static void PickDone(void* arg, grpc_error* error);
- // Removes the call from the channel's list of queued picks if present.
- void MaybeRemoveCallFromLbQueuedCallsLocked()
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::data_plane_mu_);
- // Adds the call to the channel's list of queued picks if not already present.
- void MaybeAddCallToLbQueuedCallsLocked()
- Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ChannelData::data_plane_mu_);
-
- RefCount refs_;
-
- ChannelData* chand_;
-
- // TODO(roth): Instead of duplicating these fields in every filter
- // that uses any one of them, we should store them in the call
- // context. This will save per-call memory overhead.
- grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
- grpc_millis deadline_;
- Arena* arena_;
- grpc_call_stack* owning_call_;
- CallCombiner* call_combiner_;
- grpc_call_context_element* call_context_;
-
- // Set when we get a cancel_stream op.
- grpc_error* cancel_error_ = GRPC_ERROR_NONE;
-
- grpc_polling_entity* pollent_ = nullptr;
-
- grpc_closure pick_closure_;
-
- // Accessed while holding ChannelData::data_plane_mu_.
- ChannelData::LbQueuedCall queued_call_;
- bool queued_pending_lb_pick_ = false;
- const LoadBalancingPolicy::BackendMetricData* backend_metric_data_ = nullptr;
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
- std::function<void(grpc_error*, LoadBalancingPolicy::MetadataInterface*,
- LoadBalancingPolicy::CallState*)>
- lb_recv_trailing_metadata_ready_;
- LbQueuedCallCanceller* lb_call_canceller_ = nullptr;
-
- RefCountedPtr<SubchannelCall> subchannel_call_;
-
- // For intercepting recv_trailing_metadata_ready for the LB policy.
- grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
- grpc_closure recv_trailing_metadata_ready_;
- grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
-
- // Batches are added to this list when received from above.
- // They are removed when we are done handling the batch (i.e., when
- // either we have invoked all of the batch's callbacks or we have
- // passed the batch down to the subchannel call and are not
- // intercepting any of its callbacks).
- grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
+const grpc_channel_filter ClientChannel::kFilterVtable = {
+ ClientChannel::CallData::StartTransportStreamOpBatch,
+ ClientChannel::StartTransportOp,
+ sizeof(ClientChannel::CallData),
+ ClientChannel::CallData::Init,
+ ClientChannel::CallData::SetPollent,
+ ClientChannel::CallData::Destroy,
+ sizeof(ClientChannel),
+ ClientChannel::Init,
+ ClientChannel::Destroy,
+ ClientChannel::GetChannelInfo,
+ "client-channel",
};
//
// dynamic termination filter
//
-// Channel arg pointer vtable for GRPC_ARG_CLIENT_CHANNEL_DATA.
-void* ChannelDataArgCopy(void* p) { return p; }
-void ChannelDataArgDestroy(void* /*p*/) {}
-int ChannelDataArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
-const grpc_arg_pointer_vtable kChannelDataArgPointerVtable = {
- ChannelDataArgCopy, ChannelDataArgDestroy, ChannelDataArgCmp};
-
-// Channel arg pointer vtable for GRPC_ARG_RETRY_THROTTLE_DATA.
-void* RetryThrottleDataArgCopy(void* p) {
- auto* retry_throttle_data = static_cast<ServerRetryThrottleData*>(p);
- retry_throttle_data->Ref().release();
+namespace {
+
+// Channel arg pointer vtable for GRPC_ARG_CLIENT_CHANNEL.
+void* ClientChannelArgCopy(void* p) { return p; }
+void ClientChannelArgDestroy(void* /*p*/) {}
+int ClientChannelArgCmp(void* p, void* q) { return QsortCompare(p, q); }
+const grpc_arg_pointer_vtable kClientChannelArgPointerVtable = {
+ ClientChannelArgCopy, ClientChannelArgDestroy, ClientChannelArgCmp};
+
+// Channel arg pointer vtable for GRPC_ARG_SERVICE_CONFIG_OBJ.
+void* ServiceConfigObjArgCopy(void* p) {
+ auto* service_config = static_cast<ServiceConfig*>(p);
+ service_config->Ref().release();
return p;
}
-void RetryThrottleDataArgDestroy(void* p) {
- auto* retry_throttle_data = static_cast<ServerRetryThrottleData*>(p);
- retry_throttle_data->Unref();
+void ServiceConfigObjArgDestroy(void* p) {
+ auto* service_config = static_cast<ServiceConfig*>(p);
+ service_config->Unref();
}
-int RetryThrottleDataArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
-const grpc_arg_pointer_vtable kRetryThrottleDataArgPointerVtable = {
- RetryThrottleDataArgCopy, RetryThrottleDataArgDestroy,
- RetryThrottleDataArgCmp};
+int ServiceConfigObjArgCmp(void* p, void* q) { return QsortCompare(p, q); }
+const grpc_arg_pointer_vtable kServiceConfigObjArgPointerVtable = {
+ ServiceConfigObjArgCopy, ServiceConfigObjArgDestroy,
+ ServiceConfigObjArgCmp};
-class ChannelData::DynamicTerminationFilterChannelData {
+class DynamicTerminationFilter {
public:
- class DynamicTerminationFilterCallData;
+ class CallData;
- static const grpc_channel_filter kDynamicTerminationFilterVtable;
+ static const grpc_channel_filter kFilterVtable;
- static grpc_error* Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
GPR_ASSERT(args->is_last);
- GPR_ASSERT(elem->filter == &kDynamicTerminationFilterVtable);
- new (elem->channel_data)
- DynamicTerminationFilterChannelData(args->channel_args);
+ GPR_ASSERT(elem->filter == &kFilterVtable);
+ new (elem->channel_data) DynamicTerminationFilter(args->channel_args);
return GRPC_ERROR_NONE;
}
static void Destroy(grpc_channel_element* elem) {
- auto* chand =
- static_cast<DynamicTerminationFilterChannelData*>(elem->channel_data);
- chand->~DynamicTerminationFilterChannelData();
+ auto* chand = static_cast<DynamicTerminationFilter*>(elem->channel_data);
+ chand->~DynamicTerminationFilter();
}
// Will never be called.
@@ -1087,52 +302,30 @@ class ChannelData::DynamicTerminationFilterChannelData {
const grpc_channel_info* /*info*/) {}
private:
- static RefCountedPtr<ServerRetryThrottleData> GetRetryThrottleDataFromArgs(
- const grpc_channel_args* args) {
- auto* retry_throttle_data =
- grpc_channel_args_find_pointer<ServerRetryThrottleData>(
- args, GRPC_ARG_RETRY_THROTTLE_DATA);
- if (retry_throttle_data == nullptr) return nullptr;
- return retry_throttle_data->Ref();
- }
-
- explicit DynamicTerminationFilterChannelData(const grpc_channel_args* args)
- : chand_(grpc_channel_args_find_pointer<ChannelData>(
- args, GRPC_ARG_CLIENT_CHANNEL_DATA)),
- retry_throttle_data_(GetRetryThrottleDataFromArgs(args)) {}
-
- ChannelData* chand_;
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
+ explicit DynamicTerminationFilter(const grpc_channel_args* args)
+ : chand_(grpc_channel_args_find_pointer<ClientChannel>(
+ args, GRPC_ARG_CLIENT_CHANNEL)) {}
+
+ ClientChannel* chand_;
};
-class ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData {
+class DynamicTerminationFilter::CallData {
public:
- static grpc_error* Init(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- new (elem->call_data) DynamicTerminationFilterCallData(*args);
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ new (elem->call_data) CallData(*args);
return GRPC_ERROR_NONE;
}
static void Destroy(grpc_call_element* elem,
const grpc_call_final_info* /*final_info*/,
grpc_closure* then_schedule_closure) {
- auto* calld =
- static_cast<DynamicTerminationFilterCallData*>(elem->call_data);
- auto* chand =
- static_cast<DynamicTerminationFilterChannelData*>(elem->channel_data);
+ auto* calld = static_cast<CallData*>(elem->call_data);
RefCountedPtr<SubchannelCall> subchannel_call;
- if (chand->chand_->enable_retries_) {
- if (GPR_LIKELY(calld->retrying_call_ != nullptr)) {
- subchannel_call = calld->retrying_call_->subchannel_call();
- calld->retrying_call_->~RetryingCall();
- }
- } else {
- if (GPR_LIKELY(calld->lb_call_ != nullptr)) {
- subchannel_call = calld->lb_call_->subchannel_call();
- }
+ if (GPR_LIKELY(calld->lb_call_ != nullptr)) {
+ subchannel_call = calld->lb_call_->subchannel_call();
}
- calld->~DynamicTerminationFilterCallData();
+ calld->~CallData();
if (GPR_LIKELY(subchannel_call != nullptr)) {
subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
} else {
@@ -1143,104 +336,103 @@ class ChannelData::DynamicTerminationFilterChannelData::
static void StartTransportStreamOpBatch(
grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- auto* calld =
- static_cast<DynamicTerminationFilterCallData*>(elem->call_data);
- auto* chand =
- static_cast<DynamicTerminationFilterChannelData*>(elem->channel_data);
- if (chand->chand_->enable_retries_) {
- calld->retrying_call_->StartTransportStreamOpBatch(batch);
- } else {
- calld->lb_call_->StartTransportStreamOpBatch(batch);
- }
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->lb_call_->StartTransportStreamOpBatch(batch);
}
static void SetPollent(grpc_call_element* elem,
grpc_polling_entity* pollent) {
- auto* calld =
- static_cast<DynamicTerminationFilterCallData*>(elem->call_data);
- auto* chand =
- static_cast<DynamicTerminationFilterChannelData*>(elem->channel_data);
- ChannelData* client_channel = chand->chand_;
- grpc_call_element_args args = {
- calld->owning_call_, nullptr,
- calld->call_context_, calld->path_,
- calld->call_start_time_, calld->deadline_,
- calld->arena_, calld->call_combiner_};
- if (client_channel->enable_retries_) {
- // Get retry settings from service config.
- auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
- calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
- GPR_ASSERT(svc_cfg_call_data != nullptr);
- auto* method_config = static_cast<const ClientChannelMethodParsedConfig*>(
- svc_cfg_call_data->GetMethodParsedConfig(
- ClientChannelServiceConfigParser::ParserIndex()));
- // Create retrying call.
- calld->retrying_call_ = calld->arena_->New<ChannelData::RetryingCall>(
- client_channel, args, pollent, chand->retry_throttle_data_,
- method_config == nullptr ? nullptr : method_config->retry_policy());
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p dymamic_termination_calld=%p: create retrying_call=%p",
- client_channel, calld, calld->retrying_call_);
- }
- } else {
- calld->lb_call_ = ChannelData::LoadBalancedCall::Create(client_channel,
- args, pollent, 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p dynamic_termination_calld=%p: create lb_call=%p",
- chand, client_channel, calld->lb_call_.get());
- }
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ auto* chand = static_cast<DynamicTerminationFilter*>(elem->channel_data);
+ ClientChannel* client_channel = chand->chand_;
+ grpc_call_element_args args = {calld->owning_call_, nullptr,
+ calld->call_context_, calld->path_,
+ /*start_time=*/0, calld->deadline_,
+ calld->arena_, calld->call_combiner_};
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ calld->lb_call_ = client_channel->CreateLoadBalancedCall(
+ args, pollent, nullptr,
+ service_config_call_data->call_dispatch_controller(),
+ /*is_transparent_retry=*/false);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p dynamic_termination_calld=%p: create lb_call=%p", chand,
+ client_channel, calld->lb_call_.get());
}
}
private:
- explicit DynamicTerminationFilterCallData(const grpc_call_element_args& args)
+ explicit CallData(const grpc_call_element_args& args)
: path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
deadline_(args.deadline),
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
call_context_(args.context) {}
- ~DynamicTerminationFilterCallData() { grpc_slice_unref_internal(path_); }
+ ~CallData() { grpc_slice_unref_internal(path_); }
grpc_slice path_; // Request path.
- gpr_cycle_counter call_start_time_;
grpc_millis deadline_;
Arena* arena_;
grpc_call_stack* owning_call_;
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
- ChannelData::RetryingCall* retrying_call_ = nullptr;
- RefCountedPtr<LoadBalancedCall> lb_call_;
+ OrphanablePtr<ClientChannel::LoadBalancedCall> lb_call_;
};
-const grpc_channel_filter ChannelData::DynamicTerminationFilterChannelData::
- kDynamicTerminationFilterVtable = {
- ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData::StartTransportStreamOpBatch,
- ChannelData::DynamicTerminationFilterChannelData::StartTransportOp,
- sizeof(ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData),
- ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData::Init,
- ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData::SetPollent,
- ChannelData::DynamicTerminationFilterChannelData::
- DynamicTerminationFilterCallData::Destroy,
- sizeof(ChannelData::DynamicTerminationFilterChannelData),
- ChannelData::DynamicTerminationFilterChannelData::Init,
- ChannelData::DynamicTerminationFilterChannelData::Destroy,
- ChannelData::DynamicTerminationFilterChannelData::GetChannelInfo,
- "dynamic_filter_termination",
+const grpc_channel_filter DynamicTerminationFilter::kFilterVtable = {
+ DynamicTerminationFilter::CallData::StartTransportStreamOpBatch,
+ DynamicTerminationFilter::StartTransportOp,
+ sizeof(DynamicTerminationFilter::CallData),
+ DynamicTerminationFilter::CallData::Init,
+ DynamicTerminationFilter::CallData::SetPollent,
+ DynamicTerminationFilter::CallData::Destroy,
+ sizeof(DynamicTerminationFilter),
+ DynamicTerminationFilter::Init,
+ DynamicTerminationFilter::Destroy,
+ DynamicTerminationFilter::GetChannelInfo,
+ "dynamic_filter_termination",
};
+} // namespace
+
//
-// ChannelData::SubchannelWrapper
+// ClientChannel::ResolverResultHandler
+//
+
+class ClientChannel::ResolverResultHandler : public Resolver::ResultHandler {
+ public:
+ explicit ResolverResultHandler(ClientChannel* chand) : chand_(chand) {
+ GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ResolverResultHandler");
+ }
+
+ ~ResolverResultHandler() override {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p: resolver shutdown complete", chand_);
+ }
+ GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ResolverResultHandler");
+ }
+
+ void ReturnResult(Resolver::Result result) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ chand_->OnResolverResultChangedLocked(std::move(result));
+ }
+
+ void ReturnError(grpc_error_handle error) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ chand_->OnResolverErrorLocked(error);
+ }
+
+ private:
+ ClientChannel* chand_;
+};
+
+//
+// ClientChannel::SubchannelWrapper
//
// This class is a wrapper for Subchannel that hides details of the
@@ -1251,9 +443,9 @@ const grpc_channel_filter ChannelData::DynamicTerminationFilterChannelData::
// underlying subchannel is shared between channels, this wrapper will only
// be used within one channel, so it will always be synchronized by the
// control plane work_serializer.
-class ChannelData::SubchannelWrapper : public SubchannelInterface {
+class ClientChannel::SubchannelWrapper : public SubchannelInterface {
public:
- SubchannelWrapper(ChannelData* chand, RefCountedPtr<Subchannel> subchannel,
+ SubchannelWrapper(ClientChannel* chand, RefCountedPtr<Subchannel> subchannel,
y_absl::optional<TString> health_check_service_name)
: SubchannelInterface(
GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
@@ -1268,15 +460,17 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
chand, this, subchannel_.get());
}
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "SubchannelWrapper");
- auto* subchannel_node = subchannel_->channelz_node();
- if (subchannel_node != nullptr) {
- auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
- if (it == chand_->subchannel_refcount_map_.end()) {
- chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid());
- it = chand_->subchannel_refcount_map_.emplace(subchannel_.get(), 0)
- .first;
+ if (chand_->channelz_node_ != nullptr) {
+ auto* subchannel_node = subchannel_->channelz_node();
+ if (subchannel_node != nullptr) {
+ auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
+ if (it == chand_->subchannel_refcount_map_.end()) {
+ chand_->channelz_node_->AddChildSubchannel(subchannel_node->uuid());
+ it = chand_->subchannel_refcount_map_.emplace(subchannel_.get(), 0)
+ .first;
+ }
+ ++it->second;
}
- ++it->second;
}
chand_->subchannel_wrappers_.insert(this);
}
@@ -1288,31 +482,30 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
chand_, this, subchannel_.get());
}
chand_->subchannel_wrappers_.erase(this);
- auto* subchannel_node = subchannel_->channelz_node();
- if (subchannel_node != nullptr) {
- auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
- GPR_ASSERT(it != chand_->subchannel_refcount_map_.end());
- --it->second;
- if (it->second == 0) {
- chand_->channelz_node_->RemoveChildSubchannel(subchannel_node->uuid());
- chand_->subchannel_refcount_map_.erase(it);
+ if (chand_->channelz_node_ != nullptr) {
+ auto* subchannel_node = subchannel_->channelz_node();
+ if (subchannel_node != nullptr) {
+ auto it = chand_->subchannel_refcount_map_.find(subchannel_.get());
+ GPR_ASSERT(it != chand_->subchannel_refcount_map_.end());
+ --it->second;
+ if (it->second == 0) {
+ chand_->channelz_node_->RemoveChildSubchannel(
+ subchannel_node->uuid());
+ chand_->subchannel_refcount_map_.erase(it);
+ }
}
}
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "SubchannelWrapper");
}
grpc_connectivity_state CheckConnectivityState() override {
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
- grpc_connectivity_state connectivity_state =
- subchannel_->CheckConnectivityState(health_check_service_name_,
- &connected_subchannel);
- MaybeUpdateConnectedSubchannel(std::move(connected_subchannel));
- return connectivity_state;
+ return subchannel_->CheckConnectivityState(health_check_service_name_);
}
void WatchConnectivityState(
grpc_connectivity_state initial_state,
- std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override {
+ std::unique_ptr<ConnectivityStateWatcherInterface> watcher) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
auto& watcher_wrapper = watcher_map_[watcher.get()];
GPR_ASSERT(watcher_wrapper == nullptr);
watcher_wrapper = new WatcherWrapper(std::move(watcher),
@@ -1324,8 +517,8 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
watcher_wrapper));
}
- void CancelConnectivityStateWatch(
- ConnectivityStateWatcherInterface* watcher) override {
+ void CancelConnectivityStateWatch(ConnectivityStateWatcherInterface* watcher)
+ override Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
auto it = watcher_map_.find(watcher);
GPR_ASSERT(it != watcher_map_.end());
subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
@@ -1333,6 +526,10 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
watcher_map_.erase(it);
}
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel() const {
+ return subchannel_->connected_subchannel();
+ }
+
void AttemptToConnect() override { subchannel_->AttemptToConnect(); }
void ResetBackoff() override { subchannel_->ResetBackoff(); }
@@ -1345,54 +542,6 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
subchannel_->ThrottleKeepaliveTime(new_keepalive_time);
}
- void UpdateHealthCheckServiceName(
- y_absl::optional<TString> health_check_service_name) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: subchannel wrapper %p: updating health check service "
- "name from \"%s\" to \"%s\"",
- chand_, this, health_check_service_name_->c_str(),
- health_check_service_name->c_str());
- }
- for (auto& p : watcher_map_) {
- WatcherWrapper*& watcher_wrapper = p.second;
- // Cancel the current watcher and create a new one using the new
- // health check service name.
- // TODO(roth): If there is not already an existing health watch
- // call for the new name, then the watcher will initially report
- // state CONNECTING. If the LB policy is currently reporting
- // state READY, this may cause it to switch to CONNECTING before
- // switching back to READY. This could cause a small delay for
- // RPCs being started on the channel. If/when this becomes a
- // problem, we may be able to handle it by waiting for the new
- // watcher to report READY before we use it to replace the old one.
- WatcherWrapper* replacement = watcher_wrapper->MakeReplacement();
- subchannel_->CancelConnectivityStateWatch(health_check_service_name_,
- watcher_wrapper);
- watcher_wrapper = replacement;
- subchannel_->WatchConnectivityState(
- replacement->last_seen_state(), health_check_service_name,
- RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface>(
- replacement));
- }
- // Save the new health check service name.
- health_check_service_name_ = std::move(health_check_service_name);
- }
-
- // Caller must be holding the control-plane work_serializer.
- ConnectedSubchannel* connected_subchannel() const {
- return connected_subchannel_.get();
- }
-
- // Caller must be holding the data-plane mutex.
- ConnectedSubchannel* connected_subchannel_in_data_plane() const {
- return connected_subchannel_in_data_plane_.get();
- }
- void set_connected_subchannel_in_data_plane(
- RefCountedPtr<ConnectedSubchannel> connected_subchannel) {
- connected_subchannel_in_data_plane_ = std::move(connected_subchannel);
- }
-
private:
// Subchannel and SubchannelInterface have different interfaces for
// their respective ConnectivityStateWatcherInterface classes.
@@ -1422,7 +571,10 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
~WatcherWrapper() override {
auto* parent = parent_.release(); // ref owned by lambda
parent->chand_->work_serializer_->Run(
- [parent]() { parent->Unref(DEBUG_LOCATION, "WatcherWrapper"); },
+ [parent]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
+ parent->Unref(DEBUG_LOCATION, "WatcherWrapper");
+ },
DEBUG_LOCATION);
}
@@ -1435,10 +587,11 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
}
Ref().release(); // ref owned by lambda
parent_->chand_->work_serializer_->Run(
- [this]() {
- ApplyUpdateInControlPlaneWorkSerializer();
- Unref();
- },
+ [this]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
+ ApplyUpdateInControlPlaneWorkSerializer();
+ Unref();
+ },
DEBUG_LOCATION);
}
@@ -1459,7 +612,8 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
grpc_connectivity_state last_seen_state() const { return last_seen_state_; }
private:
- void ApplyUpdateInControlPlaneWorkSerializer() {
+ void ApplyUpdateInControlPlaneWorkSerializer()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(parent_->chand_->work_serializer_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p: processing connectivity change in work serializer "
@@ -1499,8 +653,6 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
// since this callback was scheduled.
if (watcher_ != nullptr) {
last_seen_state_ = state_change.state;
- parent_->MaybeUpdateConnectedSubchannel(
- std::move(state_change.connected_subchannel));
watcher_->OnConnectivityStateChange(state_change.state);
}
}
@@ -1512,28 +664,7 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
WatcherWrapper* replacement_ = nullptr;
};
- void MaybeUpdateConnectedSubchannel(
- RefCountedPtr<ConnectedSubchannel> connected_subchannel) {
- // Update the connected subchannel only if the channel is not shutting
- // down. This is because once the channel is shutting down, we
- // ignore picker updates from the LB policy, which means that
- // UpdateStateAndPickerLocked() will never process the entries
- // in chand_->pending_subchannel_updates_. So we don't want to add
- // entries there that will never be processed, since that would
- // leave dangling refs to the channel and prevent its destruction.
- grpc_error* disconnect_error = chand_->disconnect_error();
- if (disconnect_error != GRPC_ERROR_NONE) return;
- // Not shutting down, so do the update.
- if (connected_subchannel_ != connected_subchannel) {
- connected_subchannel_ = std::move(connected_subchannel);
- // Record the new connected subchannel so that it can be updated
- // in the data plane mutex the next time the picker is updated.
- chand_->pending_subchannel_updates_[Ref(
- DEBUG_LOCATION, "ConnectedSubchannelUpdate")] = connected_subchannel_;
- }
- }
-
- ChannelData* chand_;
+ ClientChannel* chand_;
RefCountedPtr<Subchannel> subchannel_;
y_absl::optional<TString> health_check_service_name_;
// Maps from the address of the watcher passed to us by the LB policy
@@ -1541,19 +672,16 @@ class ChannelData::SubchannelWrapper : public SubchannelInterface {
// subchannel. This is needed so that when the LB policy calls
// CancelConnectivityStateWatch() with its watcher, we know the
// corresponding WrapperWatcher to cancel on the underlying subchannel.
- std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_;
- // To be accessed only in the control plane work_serializer.
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
- // To be accessed only in the data plane mutex.
- RefCountedPtr<ConnectedSubchannel> connected_subchannel_in_data_plane_;
+ std::map<ConnectivityStateWatcherInterface*, WatcherWrapper*> watcher_map_
+ Y_ABSL_GUARDED_BY(&ClientChannel::work_serializer_);
};
//
-// ChannelData::ExternalConnectivityWatcher
+// ClientChannel::ExternalConnectivityWatcher
//
-ChannelData::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
- ChannelData* chand, grpc_polling_entity pollent,
+ClientChannel::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
+ ClientChannel* chand, grpc_polling_entity pollent,
grpc_connectivity_state* state, grpc_closure* on_complete,
grpc_closure* watcher_timer_init)
: chand_(chand),
@@ -1575,22 +703,22 @@ ChannelData::ExternalConnectivityWatcher::ExternalConnectivityWatcher(
}
// Pass the ref from creating the object to Start().
chand_->work_serializer_->Run(
- [this]() {
+ [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
// The ref is passed to AddWatcherLocked().
AddWatcherLocked();
},
DEBUG_LOCATION);
}
-ChannelData::ExternalConnectivityWatcher::~ExternalConnectivityWatcher() {
+ClientChannel::ExternalConnectivityWatcher::~ExternalConnectivityWatcher() {
grpc_polling_entity_del_from_pollset_set(&pollent_,
chand_->interested_parties_);
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
"ExternalConnectivityWatcher");
}
-void ChannelData::ExternalConnectivityWatcher::
- RemoveWatcherFromExternalWatchersMap(ChannelData* chand,
+void ClientChannel::ExternalConnectivityWatcher::
+ RemoveWatcherFromExternalWatchersMap(ClientChannel* chand,
grpc_closure* on_complete,
bool cancel) {
RefCountedPtr<ExternalConnectivityWatcher> watcher;
@@ -1607,15 +735,16 @@ void ChannelData::ExternalConnectivityWatcher::
if (watcher != nullptr && cancel) watcher->Cancel();
}
-void ChannelData::ExternalConnectivityWatcher::Notify(
+void ClientChannel::ExternalConnectivityWatcher::Notify(
grpc_connectivity_state state, const y_absl::Status& /* status */) {
bool done = false;
- if (!done_.CompareExchangeStrong(&done, true, MemoryOrder::RELAXED,
- MemoryOrder::RELAXED)) {
+ if (!done_.compare_exchange_strong(done, true, std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
return; // Already done.
}
// Remove external watcher.
- chand_->RemoveExternalConnectivityWatcher(on_complete_, /*cancel=*/false);
+ ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap(
+ chand_, on_complete_, /*cancel=*/false);
// Report new state to the user.
*state_ = state;
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_NONE);
@@ -1623,97 +752,111 @@ void ChannelData::ExternalConnectivityWatcher::Notify(
// Not needed in state SHUTDOWN, because the tracker will
// automatically remove all watchers in that case.
if (state != GRPC_CHANNEL_SHUTDOWN) {
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run(
+ [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ RemoveWatcherLocked();
+ },
+ DEBUG_LOCATION);
}
}
-void ChannelData::ExternalConnectivityWatcher::Cancel() {
+void ClientChannel::ExternalConnectivityWatcher::Cancel() {
bool done = false;
- if (!done_.CompareExchangeStrong(&done, true, MemoryOrder::RELAXED,
- MemoryOrder::RELAXED)) {
+ if (!done_.compare_exchange_strong(done, true, std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
return; // Already done.
}
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_CANCELLED);
// Hop back into the work_serializer to clean up.
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run(
+ [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ RemoveWatcherLocked();
+ },
+ DEBUG_LOCATION);
}
-void ChannelData::ExternalConnectivityWatcher::AddWatcherLocked() {
+void ClientChannel::ExternalConnectivityWatcher::AddWatcherLocked() {
Closure::Run(DEBUG_LOCATION, watcher_timer_init_, GRPC_ERROR_NONE);
// Add new watcher. Pass the ref of the object from creation to OrphanablePtr.
chand_->state_tracker_.AddWatcher(
initial_state_, OrphanablePtr<ConnectivityStateWatcherInterface>(this));
}
-void ChannelData::ExternalConnectivityWatcher::RemoveWatcherLocked() {
+void ClientChannel::ExternalConnectivityWatcher::RemoveWatcherLocked() {
chand_->state_tracker_.RemoveWatcher(this);
}
//
-// ChannelData::ConnectivityWatcherAdder
+// ClientChannel::ConnectivityWatcherAdder
//
-class ChannelData::ConnectivityWatcherAdder {
+class ClientChannel::ConnectivityWatcherAdder {
public:
ConnectivityWatcherAdder(
- ChannelData* chand, grpc_connectivity_state initial_state,
+ ClientChannel* chand, grpc_connectivity_state initial_state,
OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher)
: chand_(chand),
initial_state_(initial_state),
watcher_(std::move(watcher)) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherAdder");
- chand_->work_serializer_->Run([this]() { AddWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run(
+ [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ AddWatcherLocked();
+ },
+ DEBUG_LOCATION);
}
private:
- void AddWatcherLocked() {
+ void AddWatcherLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
chand_->state_tracker_.AddWatcher(initial_state_, std::move(watcher_));
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_, "ConnectivityWatcherAdder");
delete this;
}
- ChannelData* chand_;
+ ClientChannel* chand_;
grpc_connectivity_state initial_state_;
OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher_;
};
//
-// ChannelData::ConnectivityWatcherRemover
+// ClientChannel::ConnectivityWatcherRemover
//
-class ChannelData::ConnectivityWatcherRemover {
+class ClientChannel::ConnectivityWatcherRemover {
public:
- ConnectivityWatcherRemover(ChannelData* chand,
+ ConnectivityWatcherRemover(ClientChannel* chand,
AsyncConnectivityStateWatcherInterface* watcher)
: chand_(chand), watcher_(watcher) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ConnectivityWatcherRemover");
- chand_->work_serializer_->Run([this]() { RemoveWatcherLocked(); },
- DEBUG_LOCATION);
+ chand_->work_serializer_->Run(
+ [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
+ RemoveWatcherLocked();
+ },
+ DEBUG_LOCATION);
}
private:
- void RemoveWatcherLocked() {
+ void RemoveWatcherLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
chand_->state_tracker_.RemoveWatcher(watcher_);
GRPC_CHANNEL_STACK_UNREF(chand_->owning_stack_,
"ConnectivityWatcherRemover");
delete this;
}
- ChannelData* chand_;
+ ClientChannel* chand_;
AsyncConnectivityStateWatcherInterface* watcher_;
};
//
-// ChannelData::ClientChannelControlHelper
+// ClientChannel::ClientChannelControlHelper
//
-class ChannelData::ClientChannelControlHelper
+class ClientChannel::ClientChannelControlHelper
: public LoadBalancingPolicy::ChannelControlHelper {
public:
- explicit ClientChannelControlHelper(ChannelData* chand) : chand_(chand) {
+ explicit ClientChannelControlHelper(ClientChannel* chand) : chand_(chand) {
GRPC_CHANNEL_STACK_REF(chand_->owning_stack_, "ClientChannelControlHelper");
}
@@ -1723,38 +866,66 @@ class ChannelData::ClientChannelControlHelper
}
RefCountedPtr<SubchannelInterface> CreateSubchannel(
- ServerAddress address, const grpc_channel_args& args) override {
+ ServerAddress address, const grpc_channel_args& args) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return nullptr; // Shutting down.
// Determine health check service name.
- bool inhibit_health_checking = grpc_channel_arg_get_bool(
- grpc_channel_args_find(&args, GRPC_ARG_INHIBIT_HEALTH_CHECKING), false);
y_absl::optional<TString> health_check_service_name;
- if (!inhibit_health_checking) {
- health_check_service_name = chand_->health_check_service_name_;
+ const char* health_check_service_name_arg = grpc_channel_args_find_string(
+ &args, GRPC_ARG_HEALTH_CHECK_SERVICE_NAME);
+ if (health_check_service_name_arg != nullptr) {
+ bool inhibit_health_checking = grpc_channel_args_find_bool(
+ &args, GRPC_ARG_INHIBIT_HEALTH_CHECKING, false);
+ if (!inhibit_health_checking) {
+ health_check_service_name = health_check_service_name_arg;
+ }
}
+ // Construct channel args for subchannel.
// Remove channel args that should not affect subchannel uniqueness.
- static const char* args_to_remove[] = {
+ y_absl::InlinedVector<const char*, 4> args_to_remove = {
+ GRPC_ARG_HEALTH_CHECK_SERVICE_NAME,
GRPC_ARG_INHIBIT_HEALTH_CHECKING,
GRPC_ARG_CHANNELZ_CHANNEL_NODE,
};
// Add channel args needed for the subchannel.
- y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
- Subchannel::CreateSubchannelAddressArg(&address.address()),
+ y_absl::InlinedVector<grpc_arg, 2> args_to_add = {
SubchannelPoolInterface::CreateChannelArg(
chand_->subchannel_pool_.get()),
};
+ // Check if default authority arg is already set.
+ const char* default_authority =
+ grpc_channel_args_find_string(&args, GRPC_ARG_DEFAULT_AUTHORITY);
+ // Add args from subchannel address.
if (address.args() != nullptr) {
for (size_t j = 0; j < address.args()->num_args; ++j) {
- args_to_add.emplace_back(address.args()->args[j]);
+ grpc_arg& arg = address.args()->args[j];
+ if (strcmp(arg.key, GRPC_ARG_DEFAULT_AUTHORITY) == 0) {
+ // Don't add default authority arg from subchannel address if
+ // it's already set at the channel level -- the value from the
+ // application should take precedence over what is set by the
+ // resolver.
+ if (default_authority != nullptr) continue;
+ default_authority = arg.value.string;
+ }
+ args_to_add.emplace_back(arg);
}
}
+ // If we haven't already set the default authority arg, add it from
+ // the channel.
+ if (default_authority == nullptr) {
+ // Remove it, just in case it's actually present but is the wrong type.
+ args_to_remove.push_back(GRPC_ARG_DEFAULT_AUTHORITY);
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>(chand_->default_authority_.c_str())));
+ }
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
- &args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove),
- args_to_add.data(), args_to_add.size());
- gpr_free(args_to_add[0].value.string);
+ &args, args_to_remove.data(), args_to_remove.size(), args_to_add.data(),
+ args_to_add.size());
// Create subchannel.
RefCountedPtr<Subchannel> subchannel =
- chand_->client_channel_factory_->CreateSubchannel(new_args);
+ chand_->client_channel_factory_->CreateSubchannel(address.address(),
+ new_args);
grpc_channel_args_destroy(new_args);
if (subchannel == nullptr) return nullptr;
// Make sure the subchannel has updated keepalive time.
@@ -1766,11 +937,11 @@ class ChannelData::ClientChannelControlHelper
void UpdateState(
grpc_connectivity_state state, const y_absl::Status& status,
- std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) override {
+ std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
- grpc_error* disconnect_error = chand_->disconnect_error();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- const char* extra = disconnect_error == GRPC_ERROR_NONE
+ const char* extra = chand_->disconnect_error_ == GRPC_ERROR_NONE
? ""
: " (ignoring -- channel shutting down)";
gpr_log(GPR_INFO, "chand=%p: update: state=%s status=(%s) picker=%p%s",
@@ -1778,13 +949,14 @@ class ChannelData::ClientChannelControlHelper
picker.get(), extra);
}
// Do update only if not shutting down.
- if (disconnect_error == GRPC_ERROR_NONE) {
+ if (chand_->disconnect_error_ == GRPC_ERROR_NONE) {
chand_->UpdateStateAndPickerLocked(state, status, "helper",
std::move(picker));
}
}
- void RequestReresolution() override {
+ void RequestReresolution() override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: started name re-resolving", chand_);
@@ -1792,8 +964,12 @@ class ChannelData::ClientChannelControlHelper
chand_->resolver_->RequestReresolutionLocked();
}
- void AddTraceEvent(TraceSeverity severity,
- y_absl::string_view message) override {
+ y_absl::string_view GetAuthority() override {
+ return chand_->default_authority_;
+ }
+
+ void AddTraceEvent(TraceSeverity severity, y_absl::string_view message) override
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_) {
if (chand_->resolver_ == nullptr) return; // Shutting down.
if (chand_->channelz_node_ != nullptr) {
chand_->channelz_node_->AddTraceEvent(
@@ -1810,42 +986,40 @@ class ChannelData::ClientChannelControlHelper
return channelz::ChannelTrace::Error;
}
- ChannelData* chand_;
+ ClientChannel* chand_;
};
//
-// ChannelData implementation
+// ClientChannel implementation
//
-grpc_error* ChannelData::Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- GPR_ASSERT(args->is_last);
- GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
- grpc_error* error = GRPC_ERROR_NONE;
- new (elem->channel_data) ChannelData(args, &error);
- return error;
+ClientChannel* ClientChannel::GetFromChannel(grpc_channel* channel) {
+ grpc_channel_element* elem =
+ grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel));
+ if (elem->filter != &kFilterVtable) return nullptr;
+ return static_cast<ClientChannel*>(elem->channel_data);
}
-void ChannelData::Destroy(grpc_channel_element* elem) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->~ChannelData();
+grpc_error_handle ClientChannel::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ GPR_ASSERT(args->is_last);
+ GPR_ASSERT(elem->filter == &kFilterVtable);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ new (elem->channel_data) ClientChannel(args, &error);
+ return error;
}
-bool GetEnableRetries(const grpc_channel_args* args) {
- return grpc_channel_arg_get_bool(
- grpc_channel_args_find(args, GRPC_ARG_ENABLE_RETRIES), true);
+void ClientChannel::Destroy(grpc_channel_element* elem) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
+ chand->~ClientChannel();
}
-size_t GetMaxPerRpcRetryBufferSize(const grpc_channel_args* args) {
- return static_cast<size_t>(grpc_channel_arg_get_integer(
- grpc_channel_args_find(args, GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE),
- {DEFAULT_PER_RPC_RETRY_BUFFER_SIZE, 0, INT_MAX}));
-}
+namespace {
RefCountedPtr<SubchannelPoolInterface> GetSubchannelPool(
const grpc_channel_args* args) {
- const bool use_local_subchannel_pool = grpc_channel_arg_get_bool(
- grpc_channel_args_find(args, GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL), false);
+ const bool use_local_subchannel_pool = grpc_channel_args_find_bool(
+ args, GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, false);
if (use_local_subchannel_pool) {
return MakeRefCounted<LocalSubchannelPool>();
}
@@ -1853,29 +1027,24 @@ RefCountedPtr<SubchannelPoolInterface> GetSubchannelPool(
}
channelz::ChannelNode* GetChannelzNode(const grpc_channel_args* args) {
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (arg != nullptr && arg->type == GRPC_ARG_POINTER) {
- return static_cast<channelz::ChannelNode*>(arg->value.pointer.p);
- }
- return nullptr;
+ return grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
}
-ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
+} // namespace
+
+ClientChannel::ClientChannel(grpc_channel_element_args* args,
+ grpc_error_handle* error)
: deadline_checking_enabled_(
grpc_deadline_checking_enabled(args->channel_args)),
- enable_retries_(GetEnableRetries(args->channel_args)),
- per_rpc_retry_buffer_size_(
- GetMaxPerRpcRetryBufferSize(args->channel_args)),
owning_stack_(args->channel_stack),
client_channel_factory_(
ClientChannelFactory::GetFromChannelArgs(args->channel_args)),
channelz_node_(GetChannelzNode(args->channel_args)),
- work_serializer_(std::make_shared<WorkSerializer>()),
interested_parties_(grpc_pollset_set_create()),
+ work_serializer_(std::make_shared<WorkSerializer>()),
state_tracker_("client_channel", GRPC_CHANNEL_IDLE),
- subchannel_pool_(GetSubchannelPool(args->channel_args)),
- disconnect_error_(GRPC_ERROR_NONE) {
+ subchannel_pool_(GetSubchannelPool(args->channel_args)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: creating client_channel for channel stack %p",
this, owning_stack_);
@@ -1888,19 +1057,10 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
"Missing client channel factory in args for client channel filter");
return;
}
- // Get server name to resolve, using proxy mapper if needed.
- const char* server_uri = grpc_channel_arg_get_string(
- grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVER_URI));
- if (server_uri == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "server URI channel arg missing or wrong type in client channel "
- "filter");
- return;
- }
// Get default service config. If none is specified via the client API,
// we use an empty config.
- const char* service_config_json = grpc_channel_arg_get_string(
- grpc_channel_args_find(args->channel_args, GRPC_ARG_SERVICE_CONFIG));
+ const char* service_config_json = grpc_channel_args_find_string(
+ args->channel_args, GRPC_ARG_SERVICE_CONFIG);
if (service_config_json == nullptr) service_config_json = "{}";
*error = GRPC_ERROR_NONE;
default_service_config_ =
@@ -1909,35 +1069,54 @@ ChannelData::ChannelData(grpc_channel_element_args* args, grpc_error** error)
default_service_config_.reset();
return;
}
- y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
- if (uri.ok() && !uri->path().empty()) {
- server_name_ = TString(y_absl::StripPrefix(uri->path(), "/"));
+ // Get URI to resolve, using proxy mapper if needed.
+ const char* server_uri =
+ grpc_channel_args_find_string(args->channel_args, GRPC_ARG_SERVER_URI);
+ if (server_uri == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "target URI channel arg missing or wrong type in client channel "
+ "filter");
+ return;
}
+ uri_to_resolve_ = server_uri;
char* proxy_name = nullptr;
grpc_channel_args* new_args = nullptr;
ProxyMapperRegistry::MapName(server_uri, args->channel_args, &proxy_name,
&new_args);
- target_uri_.reset(proxy_name != nullptr ? proxy_name
- : gpr_strdup(server_uri));
+ if (proxy_name != nullptr) {
+ uri_to_resolve_ = proxy_name;
+ gpr_free(proxy_name);
+ }
+ // Make sure the URI to resolve is valid, so that we know that
+ // resolver creation will succeed later.
+ if (!ResolverRegistry::IsValidTarget(uri_to_resolve_)) {
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("the target uri is not valid: ", uri_to_resolve_));
+ return;
+ }
// Strip out service config channel arg, so that it doesn't affect
// subchannel uniqueness when the args flow down to that layer.
const char* arg_to_remove = GRPC_ARG_SERVICE_CONFIG;
channel_args_ = grpc_channel_args_copy_and_remove(
new_args != nullptr ? new_args : args->channel_args, &arg_to_remove, 1);
grpc_channel_args_destroy(new_args);
+ // Set initial keepalive time.
keepalive_time_ = grpc_channel_args_find_integer(
channel_args_, GRPC_ARG_KEEPALIVE_TIME_MS,
{-1 /* default value, unset */, 1, INT_MAX});
- if (!ResolverRegistry::IsValidTarget(target_uri_.get())) {
- TString error_message =
- y_absl::StrCat("the target uri is not valid: ", target_uri_.get());
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_message.c_str());
- return;
+ // Set default authority.
+ const char* default_authority =
+ grpc_channel_args_find_string(channel_args_, GRPC_ARG_DEFAULT_AUTHORITY);
+ if (default_authority == nullptr) {
+ default_authority_ = ResolverRegistry::GetDefaultAuthority(server_uri);
+ } else {
+ default_authority_ = default_authority;
}
+ // Success.
*error = GRPC_ERROR_NONE;
}
-ChannelData::~ChannelData() {
+ClientChannel::~ClientChannel() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: destroying channel", this);
}
@@ -1947,9 +1126,22 @@ ChannelData::~ChannelData() {
// Stop backup polling.
grpc_client_channel_stop_backup_polling(interested_parties_);
grpc_pollset_set_destroy(interested_parties_);
- GRPC_ERROR_UNREF(disconnect_error_.Load(MemoryOrder::RELAXED));
+ GRPC_ERROR_UNREF(disconnect_error_);
}
+OrphanablePtr<ClientChannel::LoadBalancedCall>
+ClientChannel::CreateLoadBalancedCall(
+ const grpc_call_element_args& args, grpc_polling_entity* pollent,
+ grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry) {
+ return OrphanablePtr<LoadBalancedCall>(args.arena->New<LoadBalancedCall>(
+ this, args, pollent, on_call_destruction_complete,
+ call_dispatch_controller, is_transparent_retry));
+}
+
+namespace {
+
RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
const Resolver::Result& resolver_result,
const internal::ClientChannelGlobalParsedConfig* parsed_service_config) {
@@ -1963,9 +1155,8 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
if (!parsed_service_config->parsed_deprecated_lb_policy().empty()) {
policy_name = parsed_service_config->parsed_deprecated_lb_policy().c_str();
} else {
- const grpc_arg* channel_arg =
- grpc_channel_args_find(resolver_result.args, GRPC_ARG_LB_POLICY_NAME);
- policy_name = grpc_channel_arg_get_string(channel_arg);
+ policy_name = grpc_channel_args_find_string(resolver_result.args,
+ GRPC_ARG_LB_POLICY_NAME);
}
// Use pick_first if nothing was specified and we didn't select grpclb
// above.
@@ -1974,7 +1165,7 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
Json config_json = Json::Array{Json::Object{
{policy_name, Json::Object{}},
}};
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
auto lb_policy_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
config_json, &parse_error);
// The policy name came from one of three places:
@@ -1994,7 +1185,9 @@ RefCountedPtr<LoadBalancingPolicy::Config> ChooseLbPolicy(
return lb_policy_config;
}
-void ChannelData::OnResolverResultChangedLocked(Resolver::Result result) {
+} // namespace
+
+void ClientChannel::OnResolverResultChangedLocked(Resolver::Result result) {
// Handle race conditions.
if (resolver_ == nullptr) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
@@ -2017,21 +1210,19 @@ void ChannelData::OnResolverResultChangedLocked(Resolver::Result result) {
trace_strings.push_back("Address list became non-empty");
}
previous_resolution_contained_addresses_ = !result.addresses.empty();
- // The result of grpc_error_string() is owned by the error itself.
- // We're storing that string in trace_strings, so we need to make sure
- // that the error lives until we're done with the string.
- grpc_error* service_config_error =
- GRPC_ERROR_REF(result.service_config_error);
- if (service_config_error != GRPC_ERROR_NONE) {
- trace_strings.push_back(grpc_error_string(service_config_error));
+ TString service_config_error_string_storage;
+ if (result.service_config_error != GRPC_ERROR_NONE) {
+ service_config_error_string_storage =
+ grpc_error_std_string(result.service_config_error);
+ trace_strings.push_back(service_config_error_string_storage.c_str());
}
// Choose the service config.
RefCountedPtr<ServiceConfig> service_config;
RefCountedPtr<ConfigSelector> config_selector;
- if (service_config_error != GRPC_ERROR_NONE) {
+ if (result.service_config_error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: resolver returned service config error: %s",
- this, grpc_error_string(service_config_error));
+ this, grpc_error_std_string(result.service_config_error).c_str());
}
// If the service config was invalid, then fallback to the
// previously returned service config.
@@ -2048,7 +1239,7 @@ void ChannelData::OnResolverResultChangedLocked(Resolver::Result result) {
// We received an invalid service config and we don't have a
// previous service config to fall back to. Put the channel into
// TRANSIENT_FAILURE.
- OnResolverErrorLocked(GRPC_ERROR_REF(service_config_error));
+ OnResolverErrorLocked(GRPC_ERROR_REF(result.service_config_error));
trace_strings.push_back("no valid service config");
}
} else if (result.service_config == nullptr) {
@@ -2084,15 +1275,16 @@ void ChannelData::OnResolverResultChangedLocked(Resolver::Result result) {
// If either has changed, apply the global parameters now.
if (service_config_changed || config_selector_changed) {
// Update service config in control plane.
- UpdateServiceConfigInControlPlaneLocked(
- std::move(service_config), std::move(config_selector),
- parsed_service_config, lb_policy_config->name());
+ UpdateServiceConfigInControlPlaneLocked(std::move(service_config),
+ std::move(config_selector),
+ lb_policy_config->name());
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: service config not changed", this);
}
// Create or update LB policy, as needed.
- CreateOrUpdateLbPolicyLocked(std::move(lb_policy_config),
- std::move(result));
+ CreateOrUpdateLbPolicyLocked(
+ std::move(lb_policy_config),
+ parsed_service_config->health_check_service_name(), std::move(result));
if (service_config_changed || config_selector_changed) {
// Start using new service config for calls.
// This needs to happen after the LB policy has been updated, since
@@ -2113,35 +1305,36 @@ void ChannelData::OnResolverResultChangedLocked(Resolver::Result result) {
grpc_slice_from_cpp_string(message));
}
}
- GRPC_ERROR_UNREF(service_config_error);
}
-void ChannelData::OnResolverErrorLocked(grpc_error* error) {
+void ClientChannel::OnResolverErrorLocked(grpc_error_handle error) {
if (resolver_ == nullptr) {
GRPC_ERROR_UNREF(error);
return;
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: resolver transient failure: %s", this,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
// If we already have an LB policy from a previous resolution
// result, then we continue to let it set the connectivity state.
// Otherwise, we go into TRANSIENT_FAILURE.
if (lb_policy_ == nullptr) {
- grpc_error* state_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Resolver transient failure", &error, 1);
+ grpc_error_handle state_error =
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Resolver transient failure", &error, 1);
+ y_absl::Status status = grpc_error_to_absl_status(state_error);
{
MutexLock lock(&resolution_mu_);
// Update resolver transient failure.
GRPC_ERROR_UNREF(resolver_transient_failure_error_);
- resolver_transient_failure_error_ = GRPC_ERROR_REF(state_error);
+ resolver_transient_failure_error_ = state_error;
// Process calls that were queued waiting for the resolver result.
for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
call = call->next) {
grpc_call_element* elem = call->elem;
CallData* calld = static_cast<CallData*>(elem->call_data);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (calld->CheckResolutionLocked(elem, &error)) {
calld->AsyncResolutionDone(elem, error);
}
@@ -2149,27 +1342,33 @@ void ChannelData::OnResolverErrorLocked(grpc_error* error) {
}
// Update connectivity state.
UpdateStateAndPickerLocked(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(state_error),
- "resolver failure",
- y_absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
- state_error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status, "resolver failure",
+ y_absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(status));
}
GRPC_ERROR_UNREF(error);
}
-void ChannelData::CreateOrUpdateLbPolicyLocked(
+void ClientChannel::CreateOrUpdateLbPolicyLocked(
RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
+ const y_absl::optional<TString>& health_check_service_name,
Resolver::Result result) {
// Construct update.
LoadBalancingPolicy::UpdateArgs update_args;
update_args.addresses = std::move(result.addresses);
update_args.config = std::move(lb_policy_config);
+ // Add health check service name to channel args.
+ y_absl::InlinedVector<grpc_arg, 1> args_to_add;
+ if (health_check_service_name.has_value()) {
+ args_to_add.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_HEALTH_CHECK_SERVICE_NAME),
+ const_cast<char*>(health_check_service_name->c_str())));
+ }
// Remove the config selector from channel args so that we're not holding
// unnecessary refs that cause it to be destroyed somewhere other than in the
// WorkSerializer.
- const char* arg_name = GRPC_ARG_CONFIG_SELECTOR;
- update_args.args =
- grpc_channel_args_copy_and_remove(result.args, &arg_name, 1);
+ const char* arg_to_remove = GRPC_ARG_CONFIG_SELECTOR;
+ update_args.args = grpc_channel_args_copy_and_add_and_remove(
+ result.args, &arg_to_remove, 1, args_to_add.data(), args_to_add.size());
// Create policy if needed.
if (lb_policy_ == nullptr) {
lb_policy_ = CreateLbPolicyLocked(*update_args.args);
@@ -2183,7 +1382,7 @@ void ChannelData::CreateOrUpdateLbPolicyLocked(
}
// Creates a new LB policy.
-OrphanablePtr<LoadBalancingPolicy> ChannelData::CreateLbPolicyLocked(
+OrphanablePtr<LoadBalancingPolicy> ClientChannel::CreateLbPolicyLocked(
const grpc_channel_args& args) {
LoadBalancingPolicy::Args lb_policy_args;
lb_policy_args.work_serializer = work_serializer_;
@@ -2202,8 +1401,8 @@ OrphanablePtr<LoadBalancingPolicy> ChannelData::CreateLbPolicyLocked(
return lb_policy;
}
-void ChannelData::AddResolverQueuedCall(ResolverQueuedCall* call,
- grpc_polling_entity* pollent) {
+void ClientChannel::AddResolverQueuedCall(ResolverQueuedCall* call,
+ grpc_polling_entity* pollent) {
// Add call to queued calls list.
call->next = resolver_queued_calls_;
resolver_queued_calls_ = call;
@@ -2212,8 +1411,8 @@ void ChannelData::AddResolverQueuedCall(ResolverQueuedCall* call,
grpc_polling_entity_add_to_pollset_set(pollent, interested_parties_);
}
-void ChannelData::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
- grpc_polling_entity* pollent) {
+void ClientChannel::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
+ grpc_polling_entity* pollent) {
// Remove call's pollent from channel's interested_parties.
grpc_polling_entity_del_from_pollset_set(pollent, interested_parties_);
// Remove from queued calls list.
@@ -2226,11 +1425,9 @@ void ChannelData::RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
}
}
-void ChannelData::UpdateServiceConfigInControlPlaneLocked(
+void ClientChannel::UpdateServiceConfigInControlPlaneLocked(
RefCountedPtr<ServiceConfig> service_config,
- RefCountedPtr<ConfigSelector> config_selector,
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config,
- const char* lb_policy_name) {
+ RefCountedPtr<ConfigSelector> config_selector, const char* lb_policy_name) {
UniquePtr<char> service_config_json(
gpr_strdup(service_config->json_string().c_str()));
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
@@ -2240,17 +1437,6 @@ void ChannelData::UpdateServiceConfigInControlPlaneLocked(
}
// Save service config.
saved_service_config_ = std::move(service_config);
- // Update health check service name if needed.
- if (health_check_service_name_ !=
- parsed_service_config->health_check_service_name()) {
- health_check_service_name_ =
- parsed_service_config->health_check_service_name();
- // Update health check service name used by existing subchannel wrappers.
- for (auto* subchannel_wrapper : subchannel_wrappers_) {
- subchannel_wrapper->UpdateHealthCheckServiceName(
- health_check_service_name_);
- }
- }
// Swap out the data used by GetChannelInfo().
UniquePtr<char> lb_policy_name_owned(gpr_strdup(lb_policy_name));
{
@@ -2266,7 +1452,7 @@ void ChannelData::UpdateServiceConfigInControlPlaneLocked(
}
}
-void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
+void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
// Grab ref to service config.
RefCountedPtr<ServiceConfig> service_config = saved_service_config_;
// Grab ref to config selector. Use default if resolver didn't supply one.
@@ -2279,36 +1465,27 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
config_selector =
MakeRefCounted<DefaultConfigSelector>(saved_service_config_);
}
- // Get retry throttle data from service config.
- const internal::ClientChannelGlobalParsedConfig* parsed_service_config =
- static_cast<const internal::ClientChannelGlobalParsedConfig*>(
- saved_service_config_->GetGlobalParsedConfig(
- internal::ClientChannelServiceConfigParser::ParserIndex()));
- y_absl::optional<internal::ClientChannelGlobalParsedConfig::RetryThrottling>
- retry_throttle_config = parsed_service_config->retry_throttling();
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data;
- if (retry_throttle_config.has_value()) {
- retry_throttle_data = internal::ServerRetryThrottleMap::GetDataForServer(
- server_name_, retry_throttle_config.value().max_milli_tokens,
- retry_throttle_config.value().milli_token_ratio);
- }
+ y_absl::InlinedVector<grpc_arg, 2> args_to_add = {
+ grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_CLIENT_CHANNEL), this,
+ &kClientChannelArgPointerVtable),
+ grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_SERVICE_CONFIG_OBJ), service_config.get(),
+ &kServiceConfigObjArgPointerVtable),
+ };
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
+ channel_args_, args_to_add.data(), args_to_add.size());
+ new_args = config_selector->ModifyChannelArgs(new_args);
+ bool enable_retries =
+ grpc_channel_args_find_bool(new_args, GRPC_ARG_ENABLE_RETRIES, true);
// Construct dynamic filter stack.
std::vector<const grpc_channel_filter*> filters =
config_selector->GetFilters();
- filters.push_back(
- &DynamicTerminationFilterChannelData::kDynamicTerminationFilterVtable);
- y_absl::InlinedVector<grpc_arg, 2> args_to_add;
- args_to_add.push_back(grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_CLIENT_CHANNEL_DATA), this,
- &kChannelDataArgPointerVtable));
- if (retry_throttle_data != nullptr) {
- args_to_add.push_back(grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_RETRY_THROTTLE_DATA),
- retry_throttle_data.get(), &kRetryThrottleDataArgPointerVtable));
+ if (enable_retries) {
+ filters.push_back(&kRetryFilterVtable);
+ } else {
+ filters.push_back(&DynamicTerminationFilter::kFilterVtable);
}
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
- channel_args_, args_to_add.data(), args_to_add.size());
- new_args = config_selector->ModifyChannelArgs(new_args);
RefCountedPtr<DynamicFilters> dynamic_filters =
DynamicFilters::Create(new_args, std::move(filters));
GPR_ASSERT(dynamic_filters != nullptr);
@@ -2317,7 +1494,6 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
//
// We defer unreffing the old values (and deallocating memory) until
// after releasing the lock to keep the critical section small.
- std::set<grpc_call_element*> calls_pending_resolver_result;
{
MutexLock lock(&resolution_mu_);
GRPC_ERROR_UNREF(resolver_transient_failure_error_);
@@ -2331,9 +1507,18 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
// Process calls that were queued waiting for the resolver result.
for (ResolverQueuedCall* call = resolver_queued_calls_; call != nullptr;
call = call->next) {
+ // If there are a lot of queued calls here, resuming them all may cause us
+ // to stay inside C-core for a long period of time. All of that work would
+ // be done using the same ExecCtx instance and therefore the same cached
+ // value of "now". The longer it takes to finish all of this work and exit
+ // from C-core, the more stale the cached value of "now" may become. This
+ // can cause problems whereby (e.g.) we calculate a timer deadline based
+ // on the stale value, which results in the timer firing too early. To
+ // avoid this, we invalidate the cached value for each call we process.
+ ExecCtx::Get()->InvalidateNow();
grpc_call_element* elem = call->elem;
CallData* calld = static_cast<CallData*>(elem->call_data);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (calld->CheckResolutionLocked(elem, &error)) {
calld->AsyncResolutionDone(elem, error);
}
@@ -2343,13 +1528,13 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
// of scope.
}
-void ChannelData::CreateResolverLocked() {
+void ClientChannel::CreateResolverLocked() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: starting name resolution", this);
}
resolver_ = ResolverRegistry::CreateResolver(
- target_uri_.get(), channel_args_, interested_parties_, work_serializer_,
- y_absl::make_unique<ResolverResultHandler>(this));
+ uri_to_resolve_.c_str(), channel_args_, interested_parties_,
+ work_serializer_, y_absl::make_unique<ResolverResultHandler>(this));
// Since the validity of the args was checked when the channel was created,
// CreateResolver() must return a non-null result.
GPR_ASSERT(resolver_ != nullptr);
@@ -2362,7 +1547,7 @@ void ChannelData::CreateResolverLocked() {
}
}
-void ChannelData::DestroyResolverAndLbPolicyLocked() {
+void ClientChannel::DestroyResolverAndLbPolicyLocked() {
if (resolver_ != nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p: shutting down resolver=%p", this,
@@ -2381,7 +1566,7 @@ void ChannelData::DestroyResolverAndLbPolicyLocked() {
}
}
-void ChannelData::UpdateStateAndPickerLocked(
+void ClientChannel::UpdateStateAndPickerLocked(
grpc_connectivity_state state, const y_absl::Status& status,
const char* reason,
std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker) {
@@ -2413,48 +1598,67 @@ void ChannelData::UpdateStateAndPickerLocked(
channelz::ChannelNode::GetChannelConnectivityStateChangeString(
state)));
}
- // Grab data plane lock to do subchannel updates and update the picker.
- //
- // Note that we want to minimize the work done while holding the data
- // plane lock, to keep the critical section small. So, for all of the
- // objects that we might wind up unreffing here, we actually hold onto
- // the refs until after we release the lock, and then unref them at
- // that point. This includes the following:
- // - refs to subchannel wrappers in the keys of pending_subchannel_updates_
- // - ownership of the existing picker in picker_
+ // Grab data plane lock to update the picker.
{
MutexLock lock(&data_plane_mu_);
- // Handle subchannel updates.
- for (auto& p : pending_subchannel_updates_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p: updating subchannel wrapper %p data plane "
- "connected_subchannel to %p",
- this, p.first.get(), p.second.get());
- }
- // Note: We do not remove the entry from pending_subchannel_updates_
- // here, since this would unref the subchannel wrapper; instead,
- // we wait until we've released the lock to clear the map.
- p.first->set_connected_subchannel_in_data_plane(std::move(p.second));
- }
// Swap out the picker.
// Note: Original value will be destroyed after the lock is released.
picker_.swap(picker);
// Re-process queued picks.
for (LbQueuedCall* call = lb_queued_calls_; call != nullptr;
call = call->next) {
- grpc_error* error = GRPC_ERROR_NONE;
+ // If there are a lot of queued calls here, resuming them all may cause us
+ // to stay inside C-core for a long period of time. All of that work would
+ // be done using the same ExecCtx instance and therefore the same cached
+ // value of "now". The longer it takes to finish all of this work and exit
+ // from C-core, the more stale the cached value of "now" may become. This
+ // can cause problems whereby (e.g.) we calculate a timer deadline based
+ // on the stale value, which results in the timer firing too early. To
+ // avoid this, we invalidate the cached value for each call we process.
+ ExecCtx::Get()->InvalidateNow();
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (call->lb_call->PickSubchannelLocked(&error)) {
call->lb_call->AsyncPickDone(error);
}
}
}
- // Clear the pending update map after releasing the lock, to keep the
- // critical section small.
- pending_subchannel_updates_.clear();
}
-grpc_error* ChannelData::DoPingLocked(grpc_transport_op* op) {
+namespace {
+
+// TODO(roth): Remove this in favor of the gprpp Match() function once
+// we can do that without breaking lock annotations.
+template <typename T>
+T HandlePickResult(
+ LoadBalancingPolicy::PickResult* result,
+ std::function<T(LoadBalancingPolicy::PickResult::Complete*)> complete_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Queue*)> queue_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Fail*)> fail_func,
+ std::function<T(LoadBalancingPolicy::PickResult::Drop*)> drop_func) {
+ auto* complete_pick =
+ y_absl::get_if<LoadBalancingPolicy::PickResult::Complete>(&result->result);
+ if (complete_pick != nullptr) {
+ return complete_func(complete_pick);
+ }
+ auto* queue_pick =
+ y_absl::get_if<LoadBalancingPolicy::PickResult::Queue>(&result->result);
+ if (queue_pick != nullptr) {
+ return queue_func(queue_pick);
+ }
+ auto* fail_pick =
+ y_absl::get_if<LoadBalancingPolicy::PickResult::Fail>(&result->result);
+ if (fail_pick != nullptr) {
+ return fail_func(fail_pick);
+ }
+ auto* drop_pick =
+ y_absl::get_if<LoadBalancingPolicy::PickResult::Drop>(&result->result);
+ GPR_ASSERT(drop_pick != nullptr);
+ return drop_func(drop_pick);
+}
+
+} // namespace
+
+grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
if (state_tracker_.state() != GRPC_CHANNEL_READY) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("channel not connected");
}
@@ -2463,24 +1667,34 @@ grpc_error* ChannelData::DoPingLocked(grpc_transport_op* op) {
MutexLock lock(&data_plane_mu_);
result = picker_->Pick(LoadBalancingPolicy::PickArgs());
}
- ConnectedSubchannel* connected_subchannel = nullptr;
- if (result.subchannel != nullptr) {
- SubchannelWrapper* subchannel =
- static_cast<SubchannelWrapper*>(result.subchannel.get());
- connected_subchannel = subchannel->connected_subchannel();
- }
- if (connected_subchannel != nullptr) {
- connected_subchannel->Ping(op->send_ping.on_initiate, op->send_ping.on_ack);
- } else {
- if (result.error == GRPC_ERROR_NONE) {
- result.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "LB policy dropped call on ping");
- }
- }
- return result.error;
+ return HandlePickResult<grpc_error_handle>(
+ &result,
+ // Complete pick.
+ [op](LoadBalancingPolicy::PickResult::Complete* complete_pick)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::work_serializer_) {
+ SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
+ complete_pick->subchannel.get());
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel =
+ subchannel->connected_subchannel();
+ connected_subchannel->Ping(op->send_ping.on_initiate,
+ op->send_ping.on_ack);
+ return GRPC_ERROR_NONE;
+ },
+ // Queue pick.
+ [](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING("LB picker queued call");
+ },
+ // Fail pick.
+ [](LoadBalancingPolicy::PickResult::Fail* fail_pick) {
+ return absl_status_to_grpc_error(fail_pick->status);
+ },
+ // Drop pick.
+ [](LoadBalancingPolicy::PickResult::Drop* drop_pick) {
+ return absl_status_to_grpc_error(drop_pick->status);
+ });
}
-void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
+void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
// Connectivity watch.
if (op->start_connectivity_watch != nullptr) {
state_tracker_.AddWatcher(op->start_connectivity_watch_state,
@@ -2491,7 +1705,7 @@ void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
}
// Ping.
if (op->send_ping.on_initiate != nullptr || op->send_ping.on_ack != nullptr) {
- grpc_error* error = DoPingLocked(op);
+ grpc_error_handle error = DoPingLocked(op);
if (error != GRPC_ERROR_NONE) {
ExecCtx::Run(DEBUG_LOCATION, op->send_ping.on_initiate,
GRPC_ERROR_REF(error));
@@ -2511,14 +1725,14 @@ void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p: disconnect_with_error: %s", this,
- grpc_error_string(op->disconnect_with_error));
+ grpc_error_std_string(op->disconnect_with_error).c_str());
}
DestroyResolverAndLbPolicyLocked();
intptr_t value;
if (grpc_error_get_int(op->disconnect_with_error,
GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE, &value) &&
static_cast<grpc_connectivity_state>(value) == GRPC_CHANNEL_IDLE) {
- if (disconnect_error() == GRPC_ERROR_NONE) {
+ if (disconnect_error_ == GRPC_ERROR_NONE) {
// Enter IDLE state.
UpdateStateAndPickerLocked(GRPC_CHANNEL_IDLE, y_absl::Status(),
"channel entering IDLE", nullptr);
@@ -2526,22 +1740,21 @@ void ChannelData::StartTransportOpLocked(grpc_transport_op* op) {
GRPC_ERROR_UNREF(op->disconnect_with_error);
} else {
// Disconnect.
- GPR_ASSERT(disconnect_error_.Load(MemoryOrder::RELAXED) ==
- GRPC_ERROR_NONE);
- disconnect_error_.Store(op->disconnect_with_error, MemoryOrder::RELEASE);
+ GPR_ASSERT(disconnect_error_ == GRPC_ERROR_NONE);
+ disconnect_error_ = op->disconnect_with_error;
UpdateStateAndPickerLocked(
GRPC_CHANNEL_SHUTDOWN, y_absl::Status(), "shutdown from API",
y_absl::make_unique<LoadBalancingPolicy::TransientFailurePicker>(
- GRPC_ERROR_REF(op->disconnect_with_error)));
+ grpc_error_to_absl_status(op->disconnect_with_error)));
}
}
GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
}
-void ChannelData::StartTransportOp(grpc_channel_element* elem,
- grpc_transport_op* op) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+void ClientChannel::StartTransportOp(grpc_channel_element* elem,
+ grpc_transport_op* op) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
GPR_ASSERT(op->set_accept_stream == false);
// Handle bind_pollset.
if (op->bind_pollset != nullptr) {
@@ -2550,12 +1763,15 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem,
// Pop into control plane work_serializer for remaining ops.
GRPC_CHANNEL_STACK_REF(chand->owning_stack_, "start_transport_op");
chand->work_serializer_->Run(
- [chand, op]() { chand->StartTransportOpLocked(op); }, DEBUG_LOCATION);
+ [chand, op]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
+ chand->StartTransportOpLocked(op);
+ },
+ DEBUG_LOCATION);
}
-void ChannelData::GetChannelInfo(grpc_channel_element* elem,
- const grpc_channel_info* info) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+void ClientChannel::GetChannelInfo(grpc_channel_element* elem,
+ const grpc_channel_info* info) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
MutexLock lock(&chand->info_mu_);
if (info->lb_policy_name != nullptr) {
*info->lb_policy_name = gpr_strdup(chand->info_lb_policy_name_.get());
@@ -2566,8 +1782,8 @@ void ChannelData::GetChannelInfo(grpc_channel_element* elem,
}
}
-void ChannelData::AddLbQueuedCall(LbQueuedCall* call,
- grpc_polling_entity* pollent) {
+void ClientChannel::AddLbQueuedCall(LbQueuedCall* call,
+ grpc_polling_entity* pollent) {
// Add call to queued picks list.
call->next = lb_queued_calls_;
lb_queued_calls_ = call;
@@ -2576,8 +1792,8 @@ void ChannelData::AddLbQueuedCall(LbQueuedCall* call,
grpc_polling_entity_add_to_pollset_set(pollent, interested_parties_);
}
-void ChannelData::RemoveLbQueuedCall(LbQueuedCall* to_remove,
- grpc_polling_entity* pollent) {
+void ClientChannel::RemoveLbQueuedCall(LbQueuedCall* to_remove,
+ grpc_polling_entity* pollent) {
// Remove call's pollent from channel's interested_parties.
grpc_polling_entity_del_from_pollset_set(pollent, interested_parties_);
// Remove from queued picks list.
@@ -2590,18 +1806,7 @@ void ChannelData::RemoveLbQueuedCall(LbQueuedCall* to_remove,
}
}
-RefCountedPtr<ConnectedSubchannel>
-ChannelData::GetConnectedSubchannelInDataPlane(
- SubchannelInterface* subchannel) const {
- SubchannelWrapper* subchannel_wrapper =
- static_cast<SubchannelWrapper*>(subchannel);
- ConnectedSubchannel* connected_subchannel =
- subchannel_wrapper->connected_subchannel_in_data_plane();
- if (connected_subchannel == nullptr) return nullptr;
- return connected_subchannel->Ref();
-}
-
-void ChannelData::TryToConnectLocked() {
+void ClientChannel::TryToConnectLocked() {
if (lb_policy_ != nullptr) {
lb_policy_->ExitIdleLocked();
} else if (resolver_ == nullptr) {
@@ -2610,23 +1815,29 @@ void ChannelData::TryToConnectLocked() {
GRPC_CHANNEL_STACK_UNREF(owning_stack_, "TryToConnect");
}
-grpc_connectivity_state ChannelData::CheckConnectivityState(
+grpc_connectivity_state ClientChannel::CheckConnectivityState(
bool try_to_connect) {
- grpc_connectivity_state out = state_tracker_.state();
+ // state_tracker_ is guarded by work_serializer_, which we're not
+ // holding here. But the one method of state_tracker_ that *is*
+ // thread-safe to call without external synchronization is the state()
+ // method, so we can disable thread-safety analysis for this one read.
+ grpc_connectivity_state out = Y_ABSL_TS_UNCHECKED_READ(state_tracker_).state();
if (out == GRPC_CHANNEL_IDLE && try_to_connect) {
GRPC_CHANNEL_STACK_REF(owning_stack_, "TryToConnect");
- work_serializer_->Run([this]() { TryToConnectLocked(); }, DEBUG_LOCATION);
+ work_serializer_->Run([this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(
+ work_serializer_) { TryToConnectLocked(); },
+ DEBUG_LOCATION);
}
return out;
}
-void ChannelData::AddConnectivityWatcher(
+void ClientChannel::AddConnectivityWatcher(
grpc_connectivity_state initial_state,
OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher) {
new ConnectivityWatcherAdder(this, initial_state, std::move(watcher));
}
-void ChannelData::RemoveConnectivityWatcher(
+void ClientChannel::RemoveConnectivityWatcher(
AsyncConnectivityStateWatcherInterface* watcher) {
new ConnectivityWatcherRemover(this, watcher);
}
@@ -2635,9 +1846,9 @@ void ChannelData::RemoveConnectivityWatcher(
// CallData implementation
//
-ChannelData::CallData::CallData(grpc_call_element* elem,
- const ChannelData& chand,
- const grpc_call_element_args& args)
+ClientChannel::CallData::CallData(grpc_call_element* elem,
+ const ClientChannel& chand,
+ const grpc_call_element_args& args)
: deadline_state_(elem, args,
GPR_LIKELY(chand.deadline_checking_enabled_)
? args.deadline
@@ -2654,7 +1865,7 @@ ChannelData::CallData::CallData(grpc_call_element* elem,
}
}
-ChannelData::CallData::~CallData() {
+ClientChannel::CallData::~CallData() {
grpc_slice_unref_internal(path_);
GRPC_ERROR_UNREF(cancel_error_);
// Make sure there are no remaining pending batches.
@@ -2663,16 +1874,16 @@ ChannelData::CallData::~CallData() {
}
}
-grpc_error* ChannelData::CallData::Init(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+grpc_error_handle ClientChannel::CallData::Init(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
new (elem->call_data) CallData(elem, *chand, *args);
return GRPC_ERROR_NONE;
}
-void ChannelData::CallData::Destroy(grpc_call_element* elem,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* then_schedule_closure) {
+void ClientChannel::CallData::Destroy(
+ grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
+ grpc_closure* then_schedule_closure) {
CallData* calld = static_cast<CallData*>(elem->call_data);
RefCountedPtr<DynamicFilters::Call> dynamic_call =
std::move(calld->dynamic_call_);
@@ -2685,23 +1896,40 @@ void ChannelData::CallData::Destroy(grpc_call_element* elem,
}
}
-void ChannelData::CallData::StartTransportStreamOpBatch(
+void ClientChannel::CallData::StartTransportStreamOpBatch(
grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
GPR_TIMER_SCOPE("cc_start_transport_stream_op_batch", 0);
CallData* calld = static_cast<CallData*>(elem->call_data);
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
if (GPR_LIKELY(chand->deadline_checking_enabled_)) {
grpc_deadline_state_client_start_transport_stream_op_batch(elem, batch);
}
- // Intercept recv_initial_metadata for config selector on-committed callback.
- if (batch->recv_initial_metadata) {
- calld->InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(batch);
+ // Intercept recv_trailing_metadata to call CallDispatchController::Commit(),
+ // in case we wind up failing the call before we get down to the retry
+ // or LB call layer.
+ if (batch->recv_trailing_metadata) {
+ calld->InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
+ batch);
}
+ // If we already have a dynamic call, pass the batch down to it.
+ // Note that once we have done so, we do not need to acquire the channel's
+ // resolution mutex, which is more efficient (especially for streaming calls).
+ if (calld->dynamic_call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on dynamic_call=%p",
+ chand, calld, calld->dynamic_call_.get());
+ }
+ calld->dynamic_call_->StartTransportStreamOpBatch(batch);
+ return;
+ }
+ // We do not yet have a dynamic call.
+ //
// If we've previously been cancelled, immediately fail any new batches.
if (GPR_UNLIKELY(calld->cancel_error_ != GRPC_ERROR_NONE)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: failing batch with error: %s",
- chand, calld, grpc_error_string(calld->cancel_error_));
+ chand, calld,
+ grpc_error_std_string(calld->cancel_error_).c_str());
}
// Note: This will release the call combiner.
grpc_transport_stream_op_batch_finish_with_failure(
@@ -2720,37 +1948,18 @@ void ChannelData::CallData::StartTransportStreamOpBatch(
GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: recording cancel_error=%s", chand,
- calld, grpc_error_string(calld->cancel_error_));
- }
- // If we do not have a dynamic call (i.e., name resolution has not
- // yet completed), fail all pending batches. Otherwise, send the
- // cancellation down to the dynamic call.
- if (calld->dynamic_call_ == nullptr) {
- calld->PendingBatchesFail(elem, GRPC_ERROR_REF(calld->cancel_error_),
- NoYieldCallCombiner);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
- } else {
- // Note: This will release the call combiner.
- calld->dynamic_call_->StartTransportStreamOpBatch(batch);
+ calld, grpc_error_std_string(calld->cancel_error_).c_str());
}
+ // Fail all pending batches.
+ calld->PendingBatchesFail(elem, GRPC_ERROR_REF(calld->cancel_error_),
+ NoYieldCallCombiner);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(calld->cancel_error_), calld->call_combiner_);
return;
}
// Add the batch to the pending list.
calld->PendingBatchesAdd(elem, batch);
- // Check if we've already created a dynamic call.
- // Note that once we have done so, we do not need to acquire the channel's
- // resolution mutex, which is more efficient (especially for streaming calls).
- if (calld->dynamic_call_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on dynamic_call=%p",
- chand, calld, calld->dynamic_call_.get());
- }
- calld->PendingBatchesResume(elem);
- return;
- }
- // We do not yet have a dynamic call.
// For batches containing a send_initial_metadata op, acquire the
// channel's resolution mutex to apply the service config to the call,
// after which we will create a dynamic call.
@@ -2774,8 +1983,8 @@ void ChannelData::CallData::StartTransportStreamOpBatch(
}
}
-void ChannelData::CallData::SetPollent(grpc_call_element* elem,
- grpc_polling_entity* pollent) {
+void ClientChannel::CallData::SetPollent(grpc_call_element* elem,
+ grpc_polling_entity* pollent) {
CallData* calld = static_cast<CallData*>(elem->call_data);
calld->pollent_ = pollent;
}
@@ -2784,10 +1993,11 @@ void ChannelData::CallData::SetPollent(grpc_call_element* elem,
// pending_batches management
//
-size_t ChannelData::CallData::GetBatchIndex(
+size_t ClientChannel::CallData::GetBatchIndex(
grpc_transport_stream_op_batch* batch) {
// Note: It is important the send_initial_metadata be the first entry
- // here, since the code in pick_subchannel_locked() assumes it will be.
+ // here, since the code in ApplyServiceConfigToCallLocked() and
+ // CheckResolutionLocked() assumes it will be.
if (batch->send_initial_metadata) return 0;
if (batch->send_message) return 1;
if (batch->send_trailing_metadata) return 2;
@@ -2798,9 +2008,9 @@ size_t ChannelData::CallData::GetBatchIndex(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::CallData::PendingBatchesAdd(
+void ClientChannel::CallData::PendingBatchesAdd(
grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
const size_t idx = GetBatchIndex(batch);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO,
@@ -2813,8 +2023,8 @@ void ChannelData::CallData::PendingBatchesAdd(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::CallData::FailPendingBatchInCallCombiner(void* arg,
- grpc_error* error) {
+void ClientChannel::CallData::FailPendingBatchInCallCombiner(
+ void* arg, grpc_error_handle error) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
CallData* calld = static_cast<CallData*>(batch->handler_private.extra_arg);
@@ -2824,8 +2034,8 @@ void ChannelData::CallData::FailPendingBatchInCallCombiner(void* arg,
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::CallData::PendingBatchesFail(
- grpc_call_element* elem, grpc_error* error,
+void ClientChannel::CallData::PendingBatchesFail(
+ grpc_call_element* elem, grpc_error_handle error,
YieldCallCombinerPredicate yield_call_combiner_predicate) {
GPR_ASSERT(error != GRPC_ERROR_NONE);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -2835,7 +2045,8 @@ void ChannelData::CallData::PendingBatchesFail(
}
gpr_log(GPR_INFO,
"chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
- elem->channel_data, this, num_batches, grpc_error_string(error));
+ elem->channel_data, this, num_batches,
+ grpc_error_std_string(error).c_str());
}
CallCombinerClosureList closures;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -2859,8 +2070,8 @@ void ChannelData::CallData::PendingBatchesFail(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::CallData::ResumePendingBatchInCallCombiner(
- void* arg, grpc_error* /*ignored*/) {
+void ClientChannel::CallData::ResumePendingBatchInCallCombiner(
+ void* arg, grpc_error_handle /*ignored*/) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
auto* elem =
@@ -2871,8 +2082,8 @@ void ChannelData::CallData::ResumePendingBatchInCallCombiner(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::CallData::PendingBatchesResume(grpc_call_element* elem) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
// Retries not enabled; send down batches as-is.
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
size_t num_batches = 0;
@@ -2892,7 +2103,7 @@ void ChannelData::CallData::PendingBatchesResume(grpc_call_element* elem) {
GRPC_CLOSURE_INIT(&batch->handler_private.closure,
ResumePendingBatchInCallCombiner, batch, nullptr);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "PendingBatchesResume");
+ "resuming pending batch from client channel call");
batch = nullptr;
}
}
@@ -2906,7 +2117,7 @@ void ChannelData::CallData::PendingBatchesResume(grpc_call_element* elem) {
// A class to handle the call combiner cancellation callback for a
// queued pick.
-class ChannelData::CallData::ResolverQueuedCallCanceller {
+class ClientChannel::CallData::ResolverQueuedCallCanceller {
public:
explicit ResolverQueuedCallCanceller(grpc_call_element* elem) : elem_(elem) {
auto* calld = static_cast<CallData*>(elem->call_data);
@@ -2917,9 +2128,9 @@ class ChannelData::CallData::ResolverQueuedCallCanceller {
}
private:
- static void CancelLocked(void* arg, grpc_error* error) {
+ static void CancelLocked(void* arg, grpc_error_handle error) {
auto* self = static_cast<ResolverQueuedCallCanceller*>(arg);
- auto* chand = static_cast<ChannelData*>(self->elem_->channel_data);
+ auto* chand = static_cast<ClientChannel*>(self->elem_->channel_data);
auto* calld = static_cast<CallData*>(self->elem_->call_data);
{
MutexLock lock(&chand->resolution_mu_);
@@ -2927,7 +2138,7 @@ class ChannelData::CallData::ResolverQueuedCallCanceller {
gpr_log(GPR_INFO,
"chand=%p calld=%p: cancelling resolver queued pick: "
"error=%s self=%p calld->resolver_pick_canceller=%p",
- chand, calld, grpc_error_string(error), self,
+ chand, calld, grpc_error_std_string(error).c_str(), self,
calld->resolver_call_canceller_);
}
if (calld->resolver_call_canceller_ == self && error != GRPC_ERROR_NONE) {
@@ -2946,10 +2157,10 @@ class ChannelData::CallData::ResolverQueuedCallCanceller {
grpc_closure closure_;
};
-void ChannelData::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
+void ClientChannel::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
grpc_call_element* elem) {
if (!queued_pending_resolver_result_) return;
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ auto* chand = static_cast<ClientChannel*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: removing from resolver queued picks list",
@@ -2961,10 +2172,10 @@ void ChannelData::CallData::MaybeRemoveCallFromResolverQueuedCallsLocked(
resolver_call_canceller_ = nullptr;
}
-void ChannelData::CallData::MaybeAddCallToResolverQueuedCallsLocked(
+void ClientChannel::CallData::MaybeAddCallToResolverQueuedCallsLocked(
grpc_call_element* elem) {
if (queued_pending_resolver_result_) return;
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ auto* chand = static_cast<ClientChannel*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: adding to resolver queued picks list",
chand, this);
@@ -2976,9 +2187,9 @@ void ChannelData::CallData::MaybeAddCallToResolverQueuedCallsLocked(
resolver_call_canceller_ = new ResolverQueuedCallCanceller(elem);
}
-grpc_error* ChannelData::CallData::ApplyServiceConfigToCallLocked(
+grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p calld=%p: applying service config to call",
chand, this);
@@ -2989,15 +2200,16 @@ grpc_error* ChannelData::CallData::ApplyServiceConfigToCallLocked(
ConfigSelector::CallConfig call_config =
config_selector->GetCallConfig({&path_, initial_metadata, arena_});
if (call_config.error != GRPC_ERROR_NONE) return call_config.error;
- on_call_committed_ = std::move(call_config.on_call_committed);
- // Create a ServiceConfigCallData for the call. This stores a ref to the
- // ServiceConfig and caches the right set of parsed configs to use for
- // the call. The MethodConfig will store itself in the call context,
- // so that it can be accessed by filters in the subchannel, and it
- // will be cleaned up when the call ends.
- auto* service_config_call_data = arena_->New<ServiceConfigCallData>(
- std::move(call_config.service_config), call_config.method_configs,
- std::move(call_config.call_attributes), call_context_);
+ // Create a ClientChannelServiceConfigCallData for the call. This stores
+ // a ref to the ServiceConfig and caches the right set of parsed configs
+ // to use for the call. The ClientChannelServiceConfigCallData will store
+ // itself in the call context, so that it can be accessed by filters
+ // below us in the stack, and it will be cleaned up when the call ends.
+ auto* service_config_call_data =
+ arena_->New<ClientChannelServiceConfigCallData>(
+ std::move(call_config.service_config), call_config.method_configs,
+ std::move(call_config.call_attributes),
+ call_config.call_dispatch_controller, call_context_);
// Apply our own method params to the call.
auto* method_params = static_cast<ClientChannelMethodParsedConfig*>(
service_config_call_data->GetMethodParsedConfig(
@@ -3035,48 +2247,50 @@ grpc_error* ChannelData::CallData::ApplyServiceConfigToCallLocked(
return GRPC_ERROR_NONE;
}
-void ChannelData::CallData::
- RecvInitialMetadataReadyForConfigSelectorCommitCallback(void* arg,
- grpc_error* error) {
+void ClientChannel::CallData::
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback(
+ void* arg, grpc_error_handle error) {
auto* self = static_cast<CallData*>(arg);
- if (self->on_call_committed_ != nullptr) {
- self->on_call_committed_();
- self->on_call_committed_ = nullptr;
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ self->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (service_config_call_data != nullptr) {
+ service_config_call_data->call_dispatch_controller()->Commit();
}
// Chain to original callback.
- Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
+ Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
GRPC_ERROR_REF(error));
}
-// TODO(roth): Consider not intercepting this callback unless we
-// actually need to, if this causes a performance problem.
-void ChannelData::CallData::
- InjectRecvInitialMetadataReadyForConfigSelectorCommitCallback(
+void ClientChannel::CallData::
+ InjectRecvTrailingMetadataReadyForConfigSelectorCommitCallback(
grpc_transport_stream_op_batch* batch) {
- original_recv_initial_metadata_ready_ =
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
- GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_,
- RecvInitialMetadataReadyForConfigSelectorCommitCallback,
+ original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReadyForConfigSelectorCommitCallback,
this, nullptr);
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &recv_initial_metadata_ready_;
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &recv_trailing_metadata_ready_;
}
-void ChannelData::CallData::AsyncResolutionDone(grpc_call_element* elem,
- grpc_error* error) {
- GRPC_CLOSURE_INIT(&pick_closure_, ResolutionDone, elem, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &pick_closure_, error);
+void ClientChannel::CallData::AsyncResolutionDone(grpc_call_element* elem,
+ grpc_error_handle error) {
+ // TODO(roth): Does this callback need to hold a ref to the call stack?
+ GRPC_CLOSURE_INIT(&resolution_done_closure_, ResolutionDone, elem, nullptr);
+ ExecCtx::Run(DEBUG_LOCATION, &resolution_done_closure_, error);
}
-void ChannelData::CallData::ResolutionDone(void* arg, grpc_error* error) {
+void ClientChannel::CallData::ResolutionDone(void* arg,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
CallData* calld = static_cast<CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: error applying config to call: error=%s",
- chand, calld, grpc_error_string(error));
+ chand, calld, grpc_error_std_string(error).c_str());
}
calld->PendingBatchesFail(elem, GRPC_ERROR_REF(error), YieldCallCombiner);
return;
@@ -3084,10 +2298,11 @@ void ChannelData::CallData::ResolutionDone(void* arg, grpc_error* error) {
calld->CreateDynamicCall(elem);
}
-void ChannelData::CallData::CheckResolution(void* arg, grpc_error* error) {
+void ClientChannel::CallData::CheckResolution(void* arg,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
CallData* calld = static_cast<CallData*>(elem->call_data);
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
bool resolution_complete;
{
MutexLock lock(&chand->resolution_mu_);
@@ -3099,9 +2314,9 @@ void ChannelData::CallData::CheckResolution(void* arg, grpc_error* error) {
}
}
-bool ChannelData::CallData::CheckResolutionLocked(grpc_call_element* elem,
- grpc_error** error) {
- ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
+ grpc_error_handle* error) {
+ ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
// If we're still in IDLE, we need to start resolving.
if (GPR_UNLIKELY(chand->CheckConnectivityState(false) == GRPC_CHANNEL_IDLE)) {
// Bounce into the control plane work serializer to start resolving,
@@ -3112,14 +2327,15 @@ bool ChannelData::CallData::CheckResolutionLocked(grpc_call_element* elem,
ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
- auto* chand = static_cast<ChannelData*>(arg);
+ [](void* arg, grpc_error_handle /*error*/) {
+ auto* chand = static_cast<ClientChannel*>(arg);
chand->work_serializer_->Run(
- [chand]() {
- chand->CheckConnectivityState(/*try_to_connect=*/true);
- GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_,
- "CheckResolutionLocked");
- },
+ [chand]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand->work_serializer_) {
+ chand->CheckConnectivityState(/*try_to_connect=*/true);
+ GRPC_CHANNEL_STACK_UNREF(chand->owning_stack_,
+ "CheckResolutionLocked");
+ },
DEBUG_LOCATION);
},
chand, nullptr),
@@ -3137,7 +2353,7 @@ bool ChannelData::CallData::CheckResolutionLocked(grpc_call_element* elem,
if (GPR_UNLIKELY(!chand->received_service_config_data_)) {
// If the resolver returned transient failure before returning the
// first service config, fail any non-wait_for_ready calls.
- grpc_error* resolver_error = chand->resolver_transient_failure_error_;
+ grpc_error_handle resolver_error = chand->resolver_transient_failure_error_;
if (resolver_error != GRPC_ERROR_NONE &&
(send_initial_metadata_flags & GRPC_INITIAL_METADATA_WAIT_FOR_READY) ==
0) {
@@ -3160,8 +2376,8 @@ bool ChannelData::CallData::CheckResolutionLocked(grpc_call_element* elem,
return true;
}
-void ChannelData::CallData::CreateDynamicCall(grpc_call_element* elem) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
+void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
+ auto* chand = static_cast<ClientChannel*>(elem->channel_data);
DynamicFilters::Call::Args args = {std::move(dynamic_filters_),
pollent_,
path_,
@@ -3170,7 +2386,7 @@ void ChannelData::CallData::CreateDynamicCall(grpc_call_element* elem) {
arena_,
call_context_,
call_combiner_};
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
DynamicFilters* channel_stack = args.channel_stack.get();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(
@@ -3183,7 +2399,7 @@ void ChannelData::CallData::CreateDynamicCall(grpc_call_element* elem) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p calld=%p: failed to create dynamic call: error=%s",
- chand, this, grpc_error_string(error));
+ chand, this, grpc_error_std_string(error).c_str());
}
PendingBatchesFail(elem, error, YieldCallCombiner);
return;
@@ -3192,1622 +2408,10 @@ void ChannelData::CallData::CreateDynamicCall(grpc_call_element* elem) {
}
//
-// RetryingCall implementation
-//
-
-// Retry support:
-//
-// In order to support retries, we act as a proxy for stream op batches.
-// When we get a batch from the surface, we add it to our list of pending
-// batches, and we then use those batches to construct separate "child"
-// batches to be started on the subchannel call. When the child batches
-// return, we then decide which pending batches have been completed and
-// schedule their callbacks accordingly. If a subchannel call fails and
-// we want to retry it, we do a new pick and start again, constructing
-// new "child" batches for the new subchannel call.
-//
-// Note that retries are committed when receiving data from the server
-// (except for Trailers-Only responses). However, there may be many
-// send ops started before receiving any data, so we may have already
-// completed some number of send ops (and returned the completions up to
-// the surface) by the time we realize that we need to retry. To deal
-// with this, we cache data for send ops, so that we can replay them on a
-// different subchannel call even after we have completed the original
-// batches.
-//
-// There are two sets of data to maintain:
-// - In call_data (in the parent channel), we maintain a list of pending
-// ops and cached data for send ops.
-// - In the subchannel call, we maintain state to indicate what ops have
-// already been sent down to that call.
-//
-// When constructing the "child" batches, we compare those two sets of
-// data to see which batches need to be sent to the subchannel call.
-
-// TODO(roth): In subsequent PRs:
-// - add support for transparent retries (including initial metadata)
-// - figure out how to record stats in census for retries
-// (census filter is on top of this one)
-// - add census stats for retries
-
-ChannelData::RetryingCall::RetryingCall(
- ChannelData* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent,
- RefCountedPtr<ServerRetryThrottleData> retry_throttle_data,
- const ClientChannelMethodParsedConfig::RetryPolicy* retry_policy)
- : chand_(chand),
- pollent_(pollent),
- retry_throttle_data_(std::move(retry_throttle_data)),
- retry_policy_(retry_policy),
- retry_backoff_(
- BackOff::Options()
- .set_initial_backoff(
- retry_policy_ == nullptr ? 0 : retry_policy_->initial_backoff)
- .set_multiplier(retry_policy_ == nullptr
- ? 0
- : retry_policy_->backoff_multiplier)
- .set_jitter(RETRY_BACKOFF_JITTER)
- .set_max_backoff(
- retry_policy_ == nullptr ? 0 : retry_policy_->max_backoff)),
- path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
- deadline_(args.deadline),
- arena_(args.arena),
- owning_call_(args.call_stack),
- call_combiner_(args.call_combiner),
- call_context_(args.context),
- pending_send_initial_metadata_(false),
- pending_send_message_(false),
- pending_send_trailing_metadata_(false),
- enable_retries_(true),
- retry_committed_(false),
- last_attempt_got_server_pushback_(false) {}
-
-ChannelData::RetryingCall::~RetryingCall() {
- grpc_slice_unref_internal(path_);
- GRPC_ERROR_UNREF(cancel_error_);
- // Make sure there are no remaining pending batches.
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- GPR_ASSERT(pending_batches_[i].batch == nullptr);
- }
-}
-
-void ChannelData::RetryingCall::StartTransportStreamOpBatch(
- grpc_transport_stream_op_batch* batch) {
- // If we've previously been cancelled, immediately fail any new batches.
- if (GPR_UNLIKELY(cancel_error_ != GRPC_ERROR_NONE)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: failing batch with error: %s", chand_,
- this, grpc_error_string(cancel_error_));
- }
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
- return;
- }
- // Handle cancellation.
- if (GPR_UNLIKELY(batch->cancel_stream)) {
- // Stash a copy of cancel_error in our call data, so that we can use
- // it for subsequent operations. This ensures that if the call is
- // cancelled before any batches are passed down (e.g., if the deadline
- // is in the past when the call starts), we can return the right
- // error to the caller when the first batch does get passed down.
- GRPC_ERROR_UNREF(cancel_error_);
- cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: recording cancel_error=%s",
- chand_, this, grpc_error_string(cancel_error_));
- }
- // If we do not have an LB call (i.e., a pick has not yet been started),
- // fail all pending batches. Otherwise, send the cancellation down to the
- // LB call.
- if (lb_call_ == nullptr) {
- // TODO(roth): If there is a pending retry callback, do we need to
- // cancel it here?
- PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
- } else {
- // Note: This will release the call combiner.
- lb_call_->StartTransportStreamOpBatch(batch);
- }
- return;
- }
- // Add the batch to the pending list.
- PendingBatchesAdd(batch);
- // Create LB call if needed.
- // TODO(roth): If we get a new batch from the surface after the
- // initial retry attempt has failed, while the retry timer is pending,
- // we should queue the batch and not try to send it immediately.
- if (lb_call_ == nullptr) {
- // We do not yet have an LB call, so create one.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: creating LB call", chand_,
- this);
- }
- CreateLbCall(this, GRPC_ERROR_NONE);
- return;
- }
- // Send batches to LB call.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: starting batch on lb_call=%p",
- chand_, this, lb_call_.get());
- }
- PendingBatchesResume();
-}
-
-RefCountedPtr<SubchannelCall> ChannelData::RetryingCall::subchannel_call()
- const {
- if (lb_call_ == nullptr) return nullptr;
- return lb_call_->subchannel_call();
-}
-
-//
-// send op data caching
-//
-
-void ChannelData::RetryingCall::MaybeCacheSendOpsForBatch(
- PendingBatch* pending) {
- if (pending->send_ops_cached) return;
- pending->send_ops_cached = true;
- grpc_transport_stream_op_batch* batch = pending->batch;
- // Save a copy of metadata for send_initial_metadata ops.
- if (batch->send_initial_metadata) {
- seen_send_initial_metadata_ = true;
- GPR_ASSERT(send_initial_metadata_storage_ == nullptr);
- grpc_metadata_batch* send_initial_metadata =
- batch->payload->send_initial_metadata.send_initial_metadata;
- send_initial_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) * send_initial_metadata->list.count));
- grpc_metadata_batch_copy(send_initial_metadata, &send_initial_metadata_,
- send_initial_metadata_storage_);
- send_initial_metadata_flags_ =
- batch->payload->send_initial_metadata.send_initial_metadata_flags;
- peer_string_ = batch->payload->send_initial_metadata.peer_string;
- }
- // Set up cache for send_message ops.
- if (batch->send_message) {
- ByteStreamCache* cache = arena_->New<ByteStreamCache>(
- std::move(batch->payload->send_message.send_message));
- send_messages_.push_back(cache);
- }
- // Save metadata batch for send_trailing_metadata ops.
- if (batch->send_trailing_metadata) {
- seen_send_trailing_metadata_ = true;
- GPR_ASSERT(send_trailing_metadata_storage_ == nullptr);
- grpc_metadata_batch* send_trailing_metadata =
- batch->payload->send_trailing_metadata.send_trailing_metadata;
- send_trailing_metadata_storage_ =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) * send_trailing_metadata->list.count));
- grpc_metadata_batch_copy(send_trailing_metadata, &send_trailing_metadata_,
- send_trailing_metadata_storage_);
- }
-}
-
-void ChannelData::RetryingCall::FreeCachedSendInitialMetadata() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: destroying send_initial_metadata",
- chand_, this);
- }
- grpc_metadata_batch_destroy(&send_initial_metadata_);
-}
-
-void ChannelData::RetryingCall::FreeCachedSendMessage(size_t idx) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: destroying send_messages[%" PRIuPTR "]",
- chand_, this, idx);
- }
- send_messages_[idx]->Destroy();
-}
-
-void ChannelData::RetryingCall::FreeCachedSendTrailingMetadata() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand_=%p retrying_call=%p: destroying send_trailing_metadata",
- chand_, this);
- }
- grpc_metadata_batch_destroy(&send_trailing_metadata_);
-}
-
-void ChannelData::RetryingCall::FreeCachedSendOpDataAfterCommit(
- SubchannelCallRetryState* retry_state) {
- if (retry_state->completed_send_initial_metadata) {
- FreeCachedSendInitialMetadata();
- }
- for (size_t i = 0; i < retry_state->completed_send_message_count; ++i) {
- FreeCachedSendMessage(i);
- }
- if (retry_state->completed_send_trailing_metadata) {
- FreeCachedSendTrailingMetadata();
- }
-}
-
-void ChannelData::RetryingCall::FreeCachedSendOpDataForCompletedBatch(
- SubchannelCallBatchData* batch_data,
- SubchannelCallRetryState* retry_state) {
- if (batch_data->batch.send_initial_metadata) {
- FreeCachedSendInitialMetadata();
- }
- if (batch_data->batch.send_message) {
- FreeCachedSendMessage(retry_state->completed_send_message_count - 1);
- }
- if (batch_data->batch.send_trailing_metadata) {
- FreeCachedSendTrailingMetadata();
- }
-}
-
-//
-// pending_batches management
-//
-
-size_t ChannelData::RetryingCall::GetBatchIndex(
- grpc_transport_stream_op_batch* batch) {
- // Note: It is important the send_initial_metadata be the first entry
- // here, since the code in pick_subchannel_locked() assumes it will be.
- if (batch->send_initial_metadata) return 0;
- if (batch->send_message) return 1;
- if (batch->send_trailing_metadata) return 2;
- if (batch->recv_initial_metadata) return 3;
- if (batch->recv_message) return 4;
- if (batch->recv_trailing_metadata) return 5;
- GPR_UNREACHABLE_CODE(return (size_t)-1);
-}
-
-// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::RetryingCall::PendingBatchesAdd(
- grpc_transport_stream_op_batch* batch) {
- const size_t idx = GetBatchIndex(batch);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand_=%p retrying_call=%p: adding pending batch at index %" PRIuPTR,
- chand_, this, idx);
- }
- PendingBatch* pending = &pending_batches_[idx];
- GPR_ASSERT(pending->batch == nullptr);
- pending->batch = batch;
- pending->send_ops_cached = false;
- if (enable_retries_) {
- // Update state in calld about pending batches.
- // Also check if the batch takes us over the retry buffer limit.
- // Note: We don't check the size of trailing metadata here, because
- // gRPC clients do not send trailing metadata.
- if (batch->send_initial_metadata) {
- pending_send_initial_metadata_ = true;
- bytes_buffered_for_retry_ += grpc_metadata_batch_size(
- batch->payload->send_initial_metadata.send_initial_metadata);
- }
- if (batch->send_message) {
- pending_send_message_ = true;
- bytes_buffered_for_retry_ +=
- batch->payload->send_message.send_message->length();
- }
- if (batch->send_trailing_metadata) {
- pending_send_trailing_metadata_ = true;
- }
- if (GPR_UNLIKELY(bytes_buffered_for_retry_ >
- chand_->per_rpc_retry_buffer_size_)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: exceeded retry buffer size, "
- "committing",
- chand_, this);
- }
- SubchannelCallRetryState* retry_state =
- lb_call_ == nullptr ? nullptr
- : static_cast<SubchannelCallRetryState*>(
- lb_call_->GetParentData());
- RetryCommit(retry_state);
- // If we are not going to retry and have not yet started, pretend
- // retries are disabled so that we don't bother with retry overhead.
- if (num_attempts_completed_ == 0) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: disabling retries before first "
- "attempt",
- chand_, this);
- }
- // TODO(roth): Treat this as a commit?
- enable_retries_ = false;
- }
- }
- }
-}
-
-void ChannelData::RetryingCall::PendingBatchClear(PendingBatch* pending) {
- if (enable_retries_) {
- if (pending->batch->send_initial_metadata) {
- pending_send_initial_metadata_ = false;
- }
- if (pending->batch->send_message) {
- pending_send_message_ = false;
- }
- if (pending->batch->send_trailing_metadata) {
- pending_send_trailing_metadata_ = false;
- }
- }
- pending->batch = nullptr;
-}
-
-void ChannelData::RetryingCall::MaybeClearPendingBatch(PendingBatch* pending) {
- grpc_transport_stream_op_batch* batch = pending->batch;
- // We clear the pending batch if all of its callbacks have been
- // scheduled and reset to nullptr.
- if (batch->on_complete == nullptr &&
- (!batch->recv_initial_metadata ||
- batch->payload->recv_initial_metadata.recv_initial_metadata_ready ==
- nullptr) &&
- (!batch->recv_message ||
- batch->payload->recv_message.recv_message_ready == nullptr) &&
- (!batch->recv_trailing_metadata ||
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready ==
- nullptr)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: clearing pending batch",
- chand_, this);
- }
- PendingBatchClear(pending);
- }
-}
-
-// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::RetryingCall::FailPendingBatchInCallCombiner(
- void* arg, grpc_error* error) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- RetryingCall* call =
- static_cast<RetryingCall*>(batch->handler_private.extra_arg);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(error), call->call_combiner_);
-}
-
-// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::RetryingCall::PendingBatchesFail(
- grpc_error* error,
- YieldCallCombinerPredicate yield_call_combiner_predicate) {
- GPR_ASSERT(error != GRPC_ERROR_NONE);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- size_t num_batches = 0;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- if (pending_batches_[i].batch != nullptr) ++num_batches;
- }
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: failing %" PRIuPTR
- " pending batches: %s",
- chand_, this, num_batches, grpc_error_string(error));
- }
- CallCombinerClosureList closures;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- grpc_transport_stream_op_batch* batch = pending->batch;
- if (batch != nullptr) {
- batch->handler_private.extra_arg = this;
- GRPC_CLOSURE_INIT(&batch->handler_private.closure,
- FailPendingBatchInCallCombiner, batch,
- grpc_schedule_on_exec_ctx);
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_REF(error),
- "PendingBatchesFail");
- PendingBatchClear(pending);
- }
- }
- if (yield_call_combiner_predicate(closures)) {
- closures.RunClosures(call_combiner_);
- } else {
- closures.RunClosuresWithoutYielding(call_combiner_);
- }
- GRPC_ERROR_UNREF(error);
-}
-
-// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::RetryingCall::ResumePendingBatchInCallCombiner(
- void* arg, grpc_error* /*ignored*/) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- auto* lb_call = static_cast<ChannelData::LoadBalancedCall*>(
- batch->handler_private.extra_arg);
- // Note: This will release the call combiner.
- lb_call->StartTransportStreamOpBatch(batch);
-}
-
-// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::RetryingCall::PendingBatchesResume() {
- if (enable_retries_) {
- StartRetriableSubchannelBatches(this, GRPC_ERROR_NONE);
- return;
- }
- // Retries not enabled; send down batches as-is.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- size_t num_batches = 0;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- if (pending_batches_[i].batch != nullptr) ++num_batches;
- }
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: starting %" PRIuPTR
- " pending batches on lb_call=%p",
- chand_, this, num_batches, lb_call_.get());
- }
- CallCombinerClosureList closures;
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- grpc_transport_stream_op_batch* batch = pending->batch;
- if (batch != nullptr) {
- batch->handler_private.extra_arg = lb_call_.get();
- GRPC_CLOSURE_INIT(&batch->handler_private.closure,
- ResumePendingBatchInCallCombiner, batch, nullptr);
- closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "PendingBatchesResume");
- PendingBatchClear(pending);
- }
- }
- // Note: This will release the call combiner.
- closures.RunClosures(call_combiner_);
-}
-
-template <typename Predicate>
-ChannelData::RetryingCall::PendingBatch*
-ChannelData::RetryingCall::PendingBatchFind(const char* log_message,
- Predicate predicate) {
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- grpc_transport_stream_op_batch* batch = pending->batch;
- if (batch != nullptr && predicate(batch)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: %s pending batch at index %" PRIuPTR,
- chand_, this, log_message, i);
- }
- return pending;
- }
- }
- return nullptr;
-}
-
-//
-// retry code
-//
-
-void ChannelData::RetryingCall::RetryCommit(
- SubchannelCallRetryState* retry_state) {
- if (retry_committed_) return;
- retry_committed_ = true;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: committing retries", chand_,
- this);
- }
- if (retry_state != nullptr) {
- FreeCachedSendOpDataAfterCommit(retry_state);
- }
-}
-
-void ChannelData::RetryingCall::DoRetry(SubchannelCallRetryState* retry_state,
- grpc_millis server_pushback_ms) {
- GPR_ASSERT(retry_policy_ != nullptr);
- // Reset LB call.
- lb_call_.reset();
- // Compute backoff delay.
- grpc_millis next_attempt_time;
- if (server_pushback_ms >= 0) {
- next_attempt_time = ExecCtx::Get()->Now() + server_pushback_ms;
- last_attempt_got_server_pushback_ = true;
- } else {
- if (num_attempts_completed_ == 1 || last_attempt_got_server_pushback_) {
- last_attempt_got_server_pushback_ = false;
- }
- next_attempt_time = retry_backoff_.NextAttemptTime();
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: retrying failed call in %" PRId64 " ms",
- chand_, this, next_attempt_time - ExecCtx::Get()->Now());
- }
- // Schedule retry after computed delay.
- GRPC_CLOSURE_INIT(&retry_closure_, CreateLbCall, this, nullptr);
- grpc_timer_init(&retry_timer_, next_attempt_time, &retry_closure_);
- // Update bookkeeping.
- if (retry_state != nullptr) retry_state->retry_dispatched = true;
-}
-
-bool ChannelData::RetryingCall::MaybeRetry(SubchannelCallBatchData* batch_data,
- grpc_status_code status,
- grpc_mdelem* server_pushback_md) {
- // Get retry policy.
- if (retry_policy_ == nullptr) return false;
- // If we've already dispatched a retry from this call, return true.
- // This catches the case where the batch has multiple callbacks
- // (i.e., it includes either recv_message or recv_initial_metadata).
- SubchannelCallRetryState* retry_state = nullptr;
- if (batch_data != nullptr) {
- retry_state = static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- if (retry_state->retry_dispatched) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: retry already dispatched",
- chand_, this);
- }
- return true;
- }
- }
- // Check status.
- if (GPR_LIKELY(status == GRPC_STATUS_OK)) {
- if (retry_throttle_data_ != nullptr) {
- retry_throttle_data_->RecordSuccess();
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: call succeeded", chand_,
- this);
- }
- return false;
- }
- // Status is not OK. Check whether the status is retryable.
- if (!retry_policy_->retryable_status_codes.Contains(status)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: status %s not configured as retryable",
- chand_, this, grpc_status_code_to_string(status));
- }
- return false;
- }
- // Record the failure and check whether retries are throttled.
- // Note that it's important for this check to come after the status
- // code check above, since we should only record failures whose statuses
- // match the configured retryable status codes, so that we don't count
- // things like failures due to malformed requests (INVALID_ARGUMENT).
- // Conversely, it's important for this to come before the remaining
- // checks, so that we don't fail to record failures due to other factors.
- if (retry_throttle_data_ != nullptr &&
- !retry_throttle_data_->RecordFailure()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: retries throttled", chand_,
- this);
- }
- return false;
- }
- // Check whether the call is committed.
- if (retry_committed_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: retries already committed",
- chand_, this);
- }
- return false;
- }
- // Check whether we have retries remaining.
- ++num_attempts_completed_;
- if (num_attempts_completed_ >= retry_policy_->max_attempts) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: exceeded %d retry attempts",
- chand_, this, retry_policy_->max_attempts);
- }
- return false;
- }
- // If the call was cancelled from the surface, don't retry.
- if (cancel_error_ != GRPC_ERROR_NONE) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: call cancelled from surface, not "
- "retrying",
- chand_, this);
- }
- return false;
- }
- // Check server push-back.
- grpc_millis server_pushback_ms = -1;
- if (server_pushback_md != nullptr) {
- // If the value is "-1" or any other unparseable string, we do not retry.
- uint32_t ms;
- if (!grpc_parse_slice_to_uint32(GRPC_MDVALUE(*server_pushback_md), &ms)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: not retrying due to server push-back",
- chand_, this);
- }
- return false;
- } else {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: server push-back: retry in %u ms",
- chand_, this, ms);
- }
- server_pushback_ms = static_cast<grpc_millis>(ms);
- }
- }
- DoRetry(retry_state, server_pushback_ms);
- return true;
-}
-
-//
-// ChannelData::RetryingCall::SubchannelCallBatchData
-//
-
-ChannelData::RetryingCall::SubchannelCallBatchData*
-ChannelData::RetryingCall::SubchannelCallBatchData::Create(
- RetryingCall* call, int refcount, bool set_on_complete) {
- return call->arena_->New<SubchannelCallBatchData>(call, refcount,
- set_on_complete);
-}
-
-ChannelData::RetryingCall::SubchannelCallBatchData::SubchannelCallBatchData(
- RetryingCall* call, int refcount, bool set_on_complete)
- : call(call), lb_call(call->lb_call_) {
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(lb_call->GetParentData());
- batch.payload = &retry_state->batch_payload;
- gpr_ref_init(&refs, refcount);
- if (set_on_complete) {
- GRPC_CLOSURE_INIT(&on_complete, ChannelData::RetryingCall::OnComplete, this,
- grpc_schedule_on_exec_ctx);
- batch.on_complete = &on_complete;
- }
- GRPC_CALL_STACK_REF(call->owning_call_, "batch_data");
-}
-
-void ChannelData::RetryingCall::SubchannelCallBatchData::Destroy() {
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(lb_call->GetParentData());
- if (batch.send_initial_metadata) {
- grpc_metadata_batch_destroy(&retry_state->send_initial_metadata);
- }
- if (batch.send_trailing_metadata) {
- grpc_metadata_batch_destroy(&retry_state->send_trailing_metadata);
- }
- if (batch.recv_initial_metadata) {
- grpc_metadata_batch_destroy(&retry_state->recv_initial_metadata);
- }
- if (batch.recv_trailing_metadata) {
- grpc_metadata_batch_destroy(&retry_state->recv_trailing_metadata);
- }
- lb_call.reset();
- GRPC_CALL_STACK_UNREF(call->owning_call_, "batch_data");
-}
-
-//
-// recv_initial_metadata callback handling
-//
-
-void ChannelData::RetryingCall::InvokeRecvInitialMetadataCallback(
- void* arg, grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- // Find pending batch.
- PendingBatch* pending = batch_data->call->PendingBatchFind(
- "invoking recv_initial_metadata_ready for",
- [](grpc_transport_stream_op_batch* batch) {
- return batch->recv_initial_metadata &&
- batch->payload->recv_initial_metadata
- .recv_initial_metadata_ready != nullptr;
- });
- GPR_ASSERT(pending != nullptr);
- // Return metadata.
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- grpc_metadata_batch_move(
- &retry_state->recv_initial_metadata,
- pending->batch->payload->recv_initial_metadata.recv_initial_metadata);
- // Update bookkeeping.
- // Note: Need to do this before invoking the callback, since invoking
- // the callback will result in yielding the call combiner.
- grpc_closure* recv_initial_metadata_ready =
- pending->batch->payload->recv_initial_metadata
- .recv_initial_metadata_ready;
- pending->batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
- nullptr;
- batch_data->call->MaybeClearPendingBatch(pending);
- batch_data->Unref();
- // Invoke callback.
- Closure::Run(DEBUG_LOCATION, recv_initial_metadata_ready,
- GRPC_ERROR_REF(error));
-}
-
-void ChannelData::RetryingCall::RecvInitialMetadataReady(void* arg,
- grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- RetryingCall* call = batch_data->call;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: got recv_initial_metadata_ready, error=%s",
- call->chand_, call, grpc_error_string(error));
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- retry_state->completed_recv_initial_metadata = true;
- // If a retry was already dispatched, then we're not going to use the
- // result of this recv_initial_metadata op, so do nothing.
- if (retry_state->retry_dispatched) {
- GRPC_CALL_COMBINER_STOP(
- call->call_combiner_,
- "recv_initial_metadata_ready after retry dispatched");
- return;
- }
- // If we got an error or a Trailers-Only response and have not yet gotten
- // the recv_trailing_metadata_ready callback, then defer propagating this
- // callback back to the surface. We can evaluate whether to retry when
- // recv_trailing_metadata comes back.
- if (GPR_UNLIKELY((retry_state->trailing_metadata_available ||
- error != GRPC_ERROR_NONE) &&
- !retry_state->completed_recv_trailing_metadata)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: deferring recv_initial_metadata_ready "
- "(Trailers-Only)",
- call->chand_, call);
- }
- retry_state->recv_initial_metadata_ready_deferred_batch = batch_data;
- retry_state->recv_initial_metadata_error = GRPC_ERROR_REF(error);
- if (!retry_state->started_recv_trailing_metadata) {
- // recv_trailing_metadata not yet started by application; start it
- // ourselves to get status.
- call->StartInternalRecvTrailingMetadata();
- } else {
- GRPC_CALL_COMBINER_STOP(
- call->call_combiner_,
- "recv_initial_metadata_ready trailers-only or error");
- }
- return;
- }
- // Received valid initial metadata, so commit the call.
- call->RetryCommit(retry_state);
- // Invoke the callback to return the result to the surface.
- // Manually invoking a callback function; it does not take ownership of error.
- call->InvokeRecvInitialMetadataCallback(batch_data, error);
-}
-
-//
-// recv_message callback handling
-//
-
-void ChannelData::RetryingCall::InvokeRecvMessageCallback(void* arg,
- grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- RetryingCall* call = batch_data->call;
- // Find pending op.
- PendingBatch* pending = call->PendingBatchFind(
- "invoking recv_message_ready for",
- [](grpc_transport_stream_op_batch* batch) {
- return batch->recv_message &&
- batch->payload->recv_message.recv_message_ready != nullptr;
- });
- GPR_ASSERT(pending != nullptr);
- // Return payload.
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- *pending->batch->payload->recv_message.recv_message =
- std::move(retry_state->recv_message);
- // Update bookkeeping.
- // Note: Need to do this before invoking the callback, since invoking
- // the callback will result in yielding the call combiner.
- grpc_closure* recv_message_ready =
- pending->batch->payload->recv_message.recv_message_ready;
- pending->batch->payload->recv_message.recv_message_ready = nullptr;
- call->MaybeClearPendingBatch(pending);
- batch_data->Unref();
- // Invoke callback.
- Closure::Run(DEBUG_LOCATION, recv_message_ready, GRPC_ERROR_REF(error));
-}
-
-void ChannelData::RetryingCall::RecvMessageReady(void* arg, grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- RetryingCall* call = batch_data->call;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: got recv_message_ready, error=%s",
- call->chand_, call, grpc_error_string(error));
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- ++retry_state->completed_recv_message_count;
- // If a retry was already dispatched, then we're not going to use the
- // result of this recv_message op, so do nothing.
- if (retry_state->retry_dispatched) {
- GRPC_CALL_COMBINER_STOP(call->call_combiner_,
- "recv_message_ready after retry dispatched");
- return;
- }
- // If we got an error or the payload was nullptr and we have not yet gotten
- // the recv_trailing_metadata_ready callback, then defer propagating this
- // callback back to the surface. We can evaluate whether to retry when
- // recv_trailing_metadata comes back.
- if (GPR_UNLIKELY(
- (retry_state->recv_message == nullptr || error != GRPC_ERROR_NONE) &&
- !retry_state->completed_recv_trailing_metadata)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: deferring recv_message_ready (nullptr "
- "message and recv_trailing_metadata pending)",
- call->chand_, call);
- }
- retry_state->recv_message_ready_deferred_batch = batch_data;
- retry_state->recv_message_error = GRPC_ERROR_REF(error);
- if (!retry_state->started_recv_trailing_metadata) {
- // recv_trailing_metadata not yet started by application; start it
- // ourselves to get status.
- call->StartInternalRecvTrailingMetadata();
- } else {
- GRPC_CALL_COMBINER_STOP(call->call_combiner_, "recv_message_ready null");
- }
- return;
- }
- // Received a valid message, so commit the call.
- call->RetryCommit(retry_state);
- // Invoke the callback to return the result to the surface.
- // Manually invoking a callback function; it does not take ownership of error.
- call->InvokeRecvMessageCallback(batch_data, error);
-}
-
-//
-// recv_trailing_metadata handling
-//
-
-void ChannelData::RetryingCall::GetCallStatus(
- grpc_metadata_batch* md_batch, grpc_error* error, grpc_status_code* status,
- grpc_mdelem** server_pushback_md) {
- if (error != GRPC_ERROR_NONE) {
- grpc_error_get_status(error, deadline_, status, nullptr, nullptr, nullptr);
- } else {
- GPR_ASSERT(md_batch->idx.named.grpc_status != nullptr);
- *status =
- grpc_get_status_code_from_metadata(md_batch->idx.named.grpc_status->md);
- if (server_pushback_md != nullptr &&
- md_batch->idx.named.grpc_retry_pushback_ms != nullptr) {
- *server_pushback_md = &md_batch->idx.named.grpc_retry_pushback_ms->md;
- }
- }
- GRPC_ERROR_UNREF(error);
-}
-
-void ChannelData::RetryingCall::AddClosureForRecvTrailingMetadataReady(
- SubchannelCallBatchData* batch_data, grpc_error* error,
- CallCombinerClosureList* closures) {
- // Find pending batch.
- PendingBatch* pending = PendingBatchFind(
- "invoking recv_trailing_metadata for",
- [](grpc_transport_stream_op_batch* batch) {
- return batch->recv_trailing_metadata &&
- batch->payload->recv_trailing_metadata
- .recv_trailing_metadata_ready != nullptr;
- });
- // If we generated the recv_trailing_metadata op internally via
- // StartInternalRecvTrailingMetadata(), then there will be no pending batch.
- if (pending == nullptr) {
- GRPC_ERROR_UNREF(error);
- return;
- }
- // Return metadata.
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- grpc_metadata_batch_move(
- &retry_state->recv_trailing_metadata,
- pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata);
- // Add closure.
- closures->Add(pending->batch->payload->recv_trailing_metadata
- .recv_trailing_metadata_ready,
- error, "recv_trailing_metadata_ready for pending batch");
- // Update bookkeeping.
- pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- nullptr;
- MaybeClearPendingBatch(pending);
-}
-
-void ChannelData::RetryingCall::AddClosuresForDeferredRecvCallbacks(
- SubchannelCallBatchData* batch_data, SubchannelCallRetryState* retry_state,
- CallCombinerClosureList* closures) {
- if (batch_data->batch.recv_trailing_metadata) {
- // Add closure for deferred recv_initial_metadata_ready.
- if (GPR_UNLIKELY(retry_state->recv_initial_metadata_ready_deferred_batch !=
- nullptr)) {
- GRPC_CLOSURE_INIT(&retry_state->recv_initial_metadata_ready,
- InvokeRecvInitialMetadataCallback,
- retry_state->recv_initial_metadata_ready_deferred_batch,
- grpc_schedule_on_exec_ctx);
- closures->Add(&retry_state->recv_initial_metadata_ready,
- retry_state->recv_initial_metadata_error,
- "resuming recv_initial_metadata_ready");
- retry_state->recv_initial_metadata_ready_deferred_batch = nullptr;
- }
- // Add closure for deferred recv_message_ready.
- if (GPR_UNLIKELY(retry_state->recv_message_ready_deferred_batch !=
- nullptr)) {
- GRPC_CLOSURE_INIT(&retry_state->recv_message_ready,
- InvokeRecvMessageCallback,
- retry_state->recv_message_ready_deferred_batch,
- grpc_schedule_on_exec_ctx);
- closures->Add(&retry_state->recv_message_ready,
- retry_state->recv_message_error,
- "resuming recv_message_ready");
- retry_state->recv_message_ready_deferred_batch = nullptr;
- }
- }
-}
-
-bool ChannelData::RetryingCall::PendingBatchIsUnstarted(
- PendingBatch* pending, SubchannelCallRetryState* retry_state) {
- if (pending->batch == nullptr || pending->batch->on_complete == nullptr) {
- return false;
- }
- if (pending->batch->send_initial_metadata &&
- !retry_state->started_send_initial_metadata) {
- return true;
- }
- if (pending->batch->send_message &&
- retry_state->started_send_message_count < send_messages_.size()) {
- return true;
- }
- if (pending->batch->send_trailing_metadata &&
- !retry_state->started_send_trailing_metadata) {
- return true;
- }
- return false;
-}
-
-void ChannelData::RetryingCall::AddClosuresToFailUnstartedPendingBatches(
- SubchannelCallRetryState* retry_state, grpc_error* error,
- CallCombinerClosureList* closures) {
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- if (PendingBatchIsUnstarted(pending, retry_state)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: failing unstarted pending batch at "
- "index "
- "%" PRIuPTR,
- chand_, this, i);
- }
- closures->Add(pending->batch->on_complete, GRPC_ERROR_REF(error),
- "failing on_complete for pending batch");
- pending->batch->on_complete = nullptr;
- MaybeClearPendingBatch(pending);
- }
- }
- GRPC_ERROR_UNREF(error);
-}
-
-void ChannelData::RetryingCall::RunClosuresForCompletedCall(
- SubchannelCallBatchData* batch_data, grpc_error* error) {
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- // Construct list of closures to execute.
- CallCombinerClosureList closures;
- // First, add closure for recv_trailing_metadata_ready.
- AddClosureForRecvTrailingMetadataReady(batch_data, GRPC_ERROR_REF(error),
- &closures);
- // If there are deferred recv_initial_metadata_ready or recv_message_ready
- // callbacks, add them to closures.
- AddClosuresForDeferredRecvCallbacks(batch_data, retry_state, &closures);
- // Add closures to fail any pending batches that have not yet been started.
- AddClosuresToFailUnstartedPendingBatches(retry_state, GRPC_ERROR_REF(error),
- &closures);
- // Don't need batch_data anymore.
- batch_data->Unref();
- // Schedule all of the closures identified above.
- // Note: This will release the call combiner.
- closures.RunClosures(call_combiner_);
- GRPC_ERROR_UNREF(error);
-}
-
-void ChannelData::RetryingCall::RecvTrailingMetadataReady(void* arg,
- grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- RetryingCall* call = batch_data->call;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: got recv_trailing_metadata_ready, error=%s",
- call->chand_, call, grpc_error_string(error));
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- retry_state->completed_recv_trailing_metadata = true;
- // Get the call's status and check for server pushback metadata.
- grpc_status_code status = GRPC_STATUS_OK;
- grpc_mdelem* server_pushback_md = nullptr;
- grpc_metadata_batch* md_batch =
- batch_data->batch.payload->recv_trailing_metadata.recv_trailing_metadata;
- call->GetCallStatus(md_batch, GRPC_ERROR_REF(error), &status,
- &server_pushback_md);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: call finished, status=%s",
- call->chand_, call, grpc_status_code_to_string(status));
- }
- // Check if we should retry.
- if (call->MaybeRetry(batch_data, status, server_pushback_md)) {
- // Unref batch_data for deferred recv_initial_metadata_ready or
- // recv_message_ready callbacks, if any.
- if (retry_state->recv_initial_metadata_ready_deferred_batch != nullptr) {
- batch_data->Unref();
- GRPC_ERROR_UNREF(retry_state->recv_initial_metadata_error);
- }
- if (retry_state->recv_message_ready_deferred_batch != nullptr) {
- batch_data->Unref();
- GRPC_ERROR_UNREF(retry_state->recv_message_error);
- }
- batch_data->Unref();
- return;
- }
- // Not retrying, so commit the call.
- call->RetryCommit(retry_state);
- // Run any necessary closures.
- call->RunClosuresForCompletedCall(batch_data, GRPC_ERROR_REF(error));
-}
-
-//
-// on_complete callback handling
-//
-
-void ChannelData::RetryingCall::AddClosuresForCompletedPendingBatch(
- SubchannelCallBatchData* batch_data, grpc_error* error,
- CallCombinerClosureList* closures) {
- PendingBatch* pending = PendingBatchFind(
- "completed", [batch_data](grpc_transport_stream_op_batch* batch) {
- // Match the pending batch with the same set of send ops as the
- // subchannel batch we've just completed.
- return batch->on_complete != nullptr &&
- batch_data->batch.send_initial_metadata ==
- batch->send_initial_metadata &&
- batch_data->batch.send_message == batch->send_message &&
- batch_data->batch.send_trailing_metadata ==
- batch->send_trailing_metadata;
- });
- // If batch_data is a replay batch, then there will be no pending
- // batch to complete.
- if (pending == nullptr) {
- GRPC_ERROR_UNREF(error);
- return;
- }
- // Add closure.
- closures->Add(pending->batch->on_complete, error,
- "on_complete for pending batch");
- pending->batch->on_complete = nullptr;
- MaybeClearPendingBatch(pending);
-}
-
-void ChannelData::RetryingCall::AddClosuresForReplayOrPendingSendOps(
- SubchannelCallBatchData* batch_data, SubchannelCallRetryState* retry_state,
- CallCombinerClosureList* closures) {
- bool have_pending_send_message_ops =
- retry_state->started_send_message_count < send_messages_.size();
- bool have_pending_send_trailing_metadata_op =
- seen_send_trailing_metadata_ &&
- !retry_state->started_send_trailing_metadata;
- if (!have_pending_send_message_ops &&
- !have_pending_send_trailing_metadata_op) {
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- grpc_transport_stream_op_batch* batch = pending->batch;
- if (batch == nullptr || pending->send_ops_cached) continue;
- if (batch->send_message) have_pending_send_message_ops = true;
- if (batch->send_trailing_metadata) {
- have_pending_send_trailing_metadata_op = true;
- }
- }
- }
- if (have_pending_send_message_ops || have_pending_send_trailing_metadata_op) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: starting next batch for pending send "
- "op(s)",
- chand_, this);
- }
- GRPC_CLOSURE_INIT(&batch_data->batch.handler_private.closure,
- StartRetriableSubchannelBatches, this,
- grpc_schedule_on_exec_ctx);
- closures->Add(&batch_data->batch.handler_private.closure, GRPC_ERROR_NONE,
- "starting next batch for send_* op(s)");
- }
-}
-
-void ChannelData::RetryingCall::OnComplete(void* arg, grpc_error* error) {
- SubchannelCallBatchData* batch_data =
- static_cast<SubchannelCallBatchData*>(arg);
- RetryingCall* call = batch_data->call;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: got on_complete, error=%s, batch=%s",
- call->chand_, call, grpc_error_string(error),
- grpc_transport_stream_op_batch_string(&batch_data->batch).c_str());
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(
- batch_data->lb_call->GetParentData());
- // Update bookkeeping in retry_state.
- if (batch_data->batch.send_initial_metadata) {
- retry_state->completed_send_initial_metadata = true;
- }
- if (batch_data->batch.send_message) {
- ++retry_state->completed_send_message_count;
- }
- if (batch_data->batch.send_trailing_metadata) {
- retry_state->completed_send_trailing_metadata = true;
- }
- // If the call is committed, free cached data for send ops that we've just
- // completed.
- if (call->retry_committed_) {
- call->FreeCachedSendOpDataForCompletedBatch(batch_data, retry_state);
- }
- // Construct list of closures to execute.
- CallCombinerClosureList closures;
- // If a retry was already dispatched, that means we saw
- // recv_trailing_metadata before this, so we do nothing here.
- // Otherwise, invoke the callback to return the result to the surface.
- if (!retry_state->retry_dispatched) {
- // Add closure for the completed pending batch, if any.
- call->AddClosuresForCompletedPendingBatch(batch_data, GRPC_ERROR_REF(error),
- &closures);
- // If needed, add a callback to start any replay or pending send ops on
- // the subchannel call.
- if (!retry_state->completed_recv_trailing_metadata) {
- call->AddClosuresForReplayOrPendingSendOps(batch_data, retry_state,
- &closures);
- }
- }
- // Track number of pending subchannel send batches and determine if this
- // was the last one.
- --call->num_pending_retriable_subchannel_send_batches_;
- const bool last_send_batch_complete =
- call->num_pending_retriable_subchannel_send_batches_ == 0;
- // Don't need batch_data anymore.
- batch_data->Unref();
- // Schedule all of the closures identified above.
- // Note: This yeilds the call combiner.
- closures.RunClosures(call->call_combiner_);
- // If this was the last subchannel send batch, unref the call stack.
- if (last_send_batch_complete) {
- GRPC_CALL_STACK_UNREF(call->owning_call_, "subchannel_send_batches");
- }
-}
-
-//
-// subchannel batch construction
+// ClientChannel::LoadBalancedCall::Metadata
//
-void ChannelData::RetryingCall::StartBatchInCallCombiner(
- void* arg, grpc_error* /*ignored*/) {
- grpc_transport_stream_op_batch* batch =
- static_cast<grpc_transport_stream_op_batch*>(arg);
- auto* lb_call = static_cast<ChannelData::LoadBalancedCall*>(
- batch->handler_private.extra_arg);
- // Note: This will release the call combiner.
- lb_call->StartTransportStreamOpBatch(batch);
-}
-
-void ChannelData::RetryingCall::AddClosureForSubchannelBatch(
- grpc_transport_stream_op_batch* batch, CallCombinerClosureList* closures) {
- batch->handler_private.extra_arg = lb_call_.get();
- GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
- batch, grpc_schedule_on_exec_ctx);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: starting subchannel batch: %s", chand_,
- this, grpc_transport_stream_op_batch_string(batch).c_str());
- }
- closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "start_subchannel_batch");
-}
-
-void ChannelData::RetryingCall::AddRetriableSendInitialMetadataOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- // Maps the number of retries to the corresponding metadata value slice.
- const grpc_slice* retry_count_strings[] = {&GRPC_MDSTR_1, &GRPC_MDSTR_2,
- &GRPC_MDSTR_3, &GRPC_MDSTR_4};
- // We need to make a copy of the metadata batch for each attempt, since
- // the filters in the subchannel stack may modify this batch, and we don't
- // want those modifications to be passed forward to subsequent attempts.
- //
- // If we've already completed one or more attempts, add the
- // grpc-retry-attempts header.
- retry_state->send_initial_metadata_storage =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) *
- (send_initial_metadata_.list.count + (num_attempts_completed_ > 0))));
- grpc_metadata_batch_copy(&send_initial_metadata_,
- &retry_state->send_initial_metadata,
- retry_state->send_initial_metadata_storage);
- if (GPR_UNLIKELY(retry_state->send_initial_metadata.idx.named
- .grpc_previous_rpc_attempts != nullptr)) {
- grpc_metadata_batch_remove(&retry_state->send_initial_metadata,
- GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
- }
- if (GPR_UNLIKELY(num_attempts_completed_ > 0)) {
- grpc_mdelem retry_md = grpc_mdelem_create(
- GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS,
- *retry_count_strings[num_attempts_completed_ - 1], nullptr);
- grpc_error* error = grpc_metadata_batch_add_tail(
- &retry_state->send_initial_metadata,
- &retry_state
- ->send_initial_metadata_storage[send_initial_metadata_.list.count],
- retry_md, GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- gpr_log(GPR_ERROR, "error adding retry metadata: %s",
- grpc_error_string(error));
- GPR_ASSERT(false);
- }
- }
- retry_state->started_send_initial_metadata = true;
- batch_data->batch.send_initial_metadata = true;
- batch_data->batch.payload->send_initial_metadata.send_initial_metadata =
- &retry_state->send_initial_metadata;
- batch_data->batch.payload->send_initial_metadata.send_initial_metadata_flags =
- send_initial_metadata_flags_;
- batch_data->batch.payload->send_initial_metadata.peer_string = peer_string_;
-}
-
-void ChannelData::RetryingCall::AddRetriableSendMessageOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: starting calld->send_messages[%" PRIuPTR
- "]",
- chand_, this, retry_state->started_send_message_count);
- }
- ByteStreamCache* cache =
- send_messages_[retry_state->started_send_message_count];
- ++retry_state->started_send_message_count;
- retry_state->send_message.Init(cache);
- batch_data->batch.send_message = true;
- batch_data->batch.payload->send_message.send_message.reset(
- retry_state->send_message.get());
-}
-
-void ChannelData::RetryingCall::AddRetriableSendTrailingMetadataOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- // We need to make a copy of the metadata batch for each attempt, since
- // the filters in the subchannel stack may modify this batch, and we don't
- // want those modifications to be passed forward to subsequent attempts.
- retry_state->send_trailing_metadata_storage =
- static_cast<grpc_linked_mdelem*>(arena_->Alloc(
- sizeof(grpc_linked_mdelem) * send_trailing_metadata_.list.count));
- grpc_metadata_batch_copy(&send_trailing_metadata_,
- &retry_state->send_trailing_metadata,
- retry_state->send_trailing_metadata_storage);
- retry_state->started_send_trailing_metadata = true;
- batch_data->batch.send_trailing_metadata = true;
- batch_data->batch.payload->send_trailing_metadata.send_trailing_metadata =
- &retry_state->send_trailing_metadata;
-}
-
-void ChannelData::RetryingCall::AddRetriableRecvInitialMetadataOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- retry_state->started_recv_initial_metadata = true;
- batch_data->batch.recv_initial_metadata = true;
- grpc_metadata_batch_init(&retry_state->recv_initial_metadata);
- batch_data->batch.payload->recv_initial_metadata.recv_initial_metadata =
- &retry_state->recv_initial_metadata;
- batch_data->batch.payload->recv_initial_metadata.trailing_metadata_available =
- &retry_state->trailing_metadata_available;
- GRPC_CLOSURE_INIT(&retry_state->recv_initial_metadata_ready,
- RecvInitialMetadataReady, batch_data,
- grpc_schedule_on_exec_ctx);
- batch_data->batch.payload->recv_initial_metadata.recv_initial_metadata_ready =
- &retry_state->recv_initial_metadata_ready;
-}
-
-void ChannelData::RetryingCall::AddRetriableRecvMessageOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- ++retry_state->started_recv_message_count;
- batch_data->batch.recv_message = true;
- batch_data->batch.payload->recv_message.recv_message =
- &retry_state->recv_message;
- GRPC_CLOSURE_INIT(&retry_state->recv_message_ready, RecvMessageReady,
- batch_data, grpc_schedule_on_exec_ctx);
- batch_data->batch.payload->recv_message.recv_message_ready =
- &retry_state->recv_message_ready;
-}
-
-void ChannelData::RetryingCall::AddRetriableRecvTrailingMetadataOp(
- SubchannelCallRetryState* retry_state,
- SubchannelCallBatchData* batch_data) {
- retry_state->started_recv_trailing_metadata = true;
- batch_data->batch.recv_trailing_metadata = true;
- grpc_metadata_batch_init(&retry_state->recv_trailing_metadata);
- batch_data->batch.payload->recv_trailing_metadata.recv_trailing_metadata =
- &retry_state->recv_trailing_metadata;
- batch_data->batch.payload->recv_trailing_metadata.collect_stats =
- &retry_state->collect_stats;
- GRPC_CLOSURE_INIT(&retry_state->recv_trailing_metadata_ready,
- RecvTrailingMetadataReady, batch_data,
- grpc_schedule_on_exec_ctx);
- batch_data->batch.payload->recv_trailing_metadata
- .recv_trailing_metadata_ready =
- &retry_state->recv_trailing_metadata_ready;
-}
-
-void ChannelData::RetryingCall::StartInternalRecvTrailingMetadata() {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p retrying_call=%p: call failed but recv_trailing_metadata not "
- "started; starting it internally",
- chand_, this);
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(lb_call_->GetParentData());
- // Create batch_data with 2 refs, since this batch will be unreffed twice:
- // once for the recv_trailing_metadata_ready callback when the subchannel
- // batch returns, and again when we actually get a recv_trailing_metadata
- // op from the surface.
- SubchannelCallBatchData* batch_data =
- SubchannelCallBatchData::Create(this, 2, false /* set_on_complete */);
- AddRetriableRecvTrailingMetadataOp(retry_state, batch_data);
- retry_state->recv_trailing_metadata_internal_batch = batch_data;
- // Note: This will release the call combiner.
- lb_call_->StartTransportStreamOpBatch(&batch_data->batch);
-}
-
-// If there are any cached send ops that need to be replayed on the
-// current subchannel call, creates and returns a new subchannel batch
-// to replay those ops. Otherwise, returns nullptr.
-ChannelData::RetryingCall::SubchannelCallBatchData*
-ChannelData::RetryingCall::MaybeCreateSubchannelBatchForReplay(
- SubchannelCallRetryState* retry_state) {
- SubchannelCallBatchData* replay_batch_data = nullptr;
- // send_initial_metadata.
- if (seen_send_initial_metadata_ &&
- !retry_state->started_send_initial_metadata &&
- !pending_send_initial_metadata_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: replaying previously completed "
- "send_initial_metadata op",
- chand_, this);
- }
- replay_batch_data =
- SubchannelCallBatchData::Create(this, 1, true /* set_on_complete */);
- AddRetriableSendInitialMetadataOp(retry_state, replay_batch_data);
- }
- // send_message.
- // Note that we can only have one send_message op in flight at a time.
- if (retry_state->started_send_message_count < send_messages_.size() &&
- retry_state->started_send_message_count ==
- retry_state->completed_send_message_count &&
- !pending_send_message_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: replaying previously completed "
- "send_message op",
- chand_, this);
- }
- if (replay_batch_data == nullptr) {
- replay_batch_data =
- SubchannelCallBatchData::Create(this, 1, true /* set_on_complete */);
- }
- AddRetriableSendMessageOp(retry_state, replay_batch_data);
- }
- // send_trailing_metadata.
- // Note that we only add this op if we have no more send_message ops
- // to start, since we can't send down any more send_message ops after
- // send_trailing_metadata.
- if (seen_send_trailing_metadata_ &&
- retry_state->started_send_message_count == send_messages_.size() &&
- !retry_state->started_send_trailing_metadata &&
- !pending_send_trailing_metadata_) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: replaying previously completed "
- "send_trailing_metadata op",
- chand_, this);
- }
- if (replay_batch_data == nullptr) {
- replay_batch_data =
- SubchannelCallBatchData::Create(this, 1, true /* set_on_complete */);
- }
- AddRetriableSendTrailingMetadataOp(retry_state, replay_batch_data);
- }
- return replay_batch_data;
-}
-
-void ChannelData::RetryingCall::AddSubchannelBatchesForPendingBatches(
- SubchannelCallRetryState* retry_state, CallCombinerClosureList* closures) {
- for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
- PendingBatch* pending = &pending_batches_[i];
- grpc_transport_stream_op_batch* batch = pending->batch;
- if (batch == nullptr) continue;
- // Skip any batch that either (a) has already been started on this
- // subchannel call or (b) we can't start yet because we're still
- // replaying send ops that need to be completed first.
- // TODO(roth): Note that if any one op in the batch can't be sent
- // yet due to ops that we're replaying, we don't start any of the ops
- // in the batch. This is probably okay, but it could conceivably
- // lead to increased latency in some cases -- e.g., we could delay
- // starting a recv op due to it being in the same batch with a send
- // op. If/when we revamp the callback protocol in
- // transport_stream_op_batch, we may be able to fix this.
- if (batch->send_initial_metadata &&
- retry_state->started_send_initial_metadata) {
- continue;
- }
- if (batch->send_message && retry_state->completed_send_message_count <
- retry_state->started_send_message_count) {
- continue;
- }
- // Note that we only start send_trailing_metadata if we have no more
- // send_message ops to start, since we can't send down any more
- // send_message ops after send_trailing_metadata.
- if (batch->send_trailing_metadata &&
- (retry_state->started_send_message_count + batch->send_message <
- send_messages_.size() ||
- retry_state->started_send_trailing_metadata)) {
- continue;
- }
- if (batch->recv_initial_metadata &&
- retry_state->started_recv_initial_metadata) {
- continue;
- }
- if (batch->recv_message && retry_state->completed_recv_message_count <
- retry_state->started_recv_message_count) {
- continue;
- }
- if (batch->recv_trailing_metadata &&
- retry_state->started_recv_trailing_metadata) {
- // If we previously completed a recv_trailing_metadata op
- // initiated by StartInternalRecvTrailingMetadata(), use the
- // result of that instead of trying to re-start this op.
- if (GPR_UNLIKELY((retry_state->recv_trailing_metadata_internal_batch !=
- nullptr))) {
- // If the batch completed, then trigger the completion callback
- // directly, so that we return the previously returned results to
- // the application. Otherwise, just unref the internally
- // started subchannel batch, since we'll propagate the
- // completion when it completes.
- if (retry_state->completed_recv_trailing_metadata) {
- // Batches containing recv_trailing_metadata always succeed.
- closures->Add(
- &retry_state->recv_trailing_metadata_ready, GRPC_ERROR_NONE,
- "re-executing recv_trailing_metadata_ready to propagate "
- "internally triggered result");
- } else {
- retry_state->recv_trailing_metadata_internal_batch->Unref();
- }
- retry_state->recv_trailing_metadata_internal_batch = nullptr;
- }
- continue;
- }
- // If we're not retrying, just send the batch as-is.
- // TODO(roth): This condition doesn't seem exactly right -- maybe need a
- // notion of "draining" once we've committed and are done replaying?
- if (retry_policy_ == nullptr || retry_committed_) {
- AddClosureForSubchannelBatch(batch, closures);
- PendingBatchClear(pending);
- continue;
- }
- // Create batch with the right number of callbacks.
- const bool has_send_ops = batch->send_initial_metadata ||
- batch->send_message ||
- batch->send_trailing_metadata;
- const int num_callbacks = has_send_ops + batch->recv_initial_metadata +
- batch->recv_message +
- batch->recv_trailing_metadata;
- SubchannelCallBatchData* batch_data = SubchannelCallBatchData::Create(
- this, num_callbacks, has_send_ops /* set_on_complete */);
- // Cache send ops if needed.
- MaybeCacheSendOpsForBatch(pending);
- // send_initial_metadata.
- if (batch->send_initial_metadata) {
- AddRetriableSendInitialMetadataOp(retry_state, batch_data);
- }
- // send_message.
- if (batch->send_message) {
- AddRetriableSendMessageOp(retry_state, batch_data);
- }
- // send_trailing_metadata.
- if (batch->send_trailing_metadata) {
- AddRetriableSendTrailingMetadataOp(retry_state, batch_data);
- }
- // recv_initial_metadata.
- if (batch->recv_initial_metadata) {
- // recv_flags is only used on the server side.
- GPR_ASSERT(batch->payload->recv_initial_metadata.recv_flags == nullptr);
- AddRetriableRecvInitialMetadataOp(retry_state, batch_data);
- }
- // recv_message.
- if (batch->recv_message) {
- AddRetriableRecvMessageOp(retry_state, batch_data);
- }
- // recv_trailing_metadata.
- if (batch->recv_trailing_metadata) {
- AddRetriableRecvTrailingMetadataOp(retry_state, batch_data);
- }
- AddClosureForSubchannelBatch(&batch_data->batch, closures);
- // Track number of pending subchannel send batches.
- // If this is the first one, take a ref to the call stack.
- if (batch->send_initial_metadata || batch->send_message ||
- batch->send_trailing_metadata) {
- if (num_pending_retriable_subchannel_send_batches_ == 0) {
- GRPC_CALL_STACK_REF(owning_call_, "subchannel_send_batches");
- }
- ++num_pending_retriable_subchannel_send_batches_;
- }
- }
-}
-
-void ChannelData::RetryingCall::StartRetriableSubchannelBatches(
- void* arg, grpc_error* /*ignored*/) {
- RetryingCall* call = static_cast<RetryingCall*>(arg);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: constructing retriable batches",
- call->chand_, call);
- }
- SubchannelCallRetryState* retry_state =
- static_cast<SubchannelCallRetryState*>(call->lb_call_->GetParentData());
- // Construct list of closures to execute, one for each pending batch.
- CallCombinerClosureList closures;
- // Replay previously-returned send_* ops if needed.
- SubchannelCallBatchData* replay_batch_data =
- call->MaybeCreateSubchannelBatchForReplay(retry_state);
- if (replay_batch_data != nullptr) {
- call->AddClosureForSubchannelBatch(&replay_batch_data->batch, &closures);
- // Track number of pending subchannel send batches.
- // If this is the first one, take a ref to the call stack.
- if (call->num_pending_retriable_subchannel_send_batches_ == 0) {
- GRPC_CALL_STACK_REF(call->owning_call_, "subchannel_send_batches");
- }
- ++call->num_pending_retriable_subchannel_send_batches_;
- }
- // Now add pending batches.
- call->AddSubchannelBatchesForPendingBatches(retry_state, &closures);
- // Start batches on subchannel call.
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p retrying_call=%p: starting %" PRIuPTR
- " retriable batches on lb_call=%p",
- call->chand_, call, closures.size(), call->lb_call_.get());
- }
- // Note: This will yield the call combiner.
- closures.RunClosures(call->call_combiner_);
-}
-
-void ChannelData::RetryingCall::CreateLbCall(void* arg, grpc_error* /*error*/) {
- auto* call = static_cast<RetryingCall*>(arg);
- const size_t parent_data_size =
- call->enable_retries_ ? sizeof(SubchannelCallRetryState) : 0;
- grpc_call_element_args args = {call->owning_call_, nullptr,
- call->call_context_, call->path_,
- call->call_start_time_, call->deadline_,
- call->arena_, call->call_combiner_};
- call->lb_call_ = ChannelData::LoadBalancedCall::Create(
- call->chand_, args, call->pollent_, parent_data_size);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(GPR_INFO, "chand=%p retrying_call=%p: create lb_call=%p",
- call->chand_, call, call->lb_call_.get());
- }
- if (parent_data_size > 0) {
- new (call->lb_call_->GetParentData())
- SubchannelCallRetryState(call->call_context_);
- }
- call->PendingBatchesResume();
-}
-
-//
-// ChannelData::LoadBalancedCall::Metadata
-//
-
-class ChannelData::LoadBalancedCall::Metadata
+class ClientChannel::LoadBalancedCall::Metadata
: public LoadBalancingPolicy::MetadataInterface {
public:
Metadata(LoadBalancedCall* lb_call, grpc_metadata_batch* batch)
@@ -4819,80 +2423,64 @@ class ChannelData::LoadBalancedCall::Metadata
linked_mdelem->md = grpc_mdelem_from_slices(
ExternallyManagedSlice(key.data(), key.size()),
ExternallyManagedSlice(value.data(), value.size()));
- GPR_ASSERT(grpc_metadata_batch_link_tail(batch_, linked_mdelem) ==
- GRPC_ERROR_NONE);
+ GPR_ASSERT(batch_->LinkTail(linked_mdelem) == GRPC_ERROR_NONE);
}
- iterator begin() const override {
- static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(intptr_t),
- "iterator size too large");
- return iterator(
- this, reinterpret_cast<intptr_t>(MaybeSkipEntry(batch_->list.head)));
- }
- iterator end() const override {
- static_assert(sizeof(grpc_linked_mdelem*) <= sizeof(intptr_t),
- "iterator size too large");
- return iterator(this, 0);
+ std::vector<std::pair<TString, TString>> TestOnlyCopyToVector()
+ override {
+ Encoder encoder;
+ batch_->Encode(&encoder);
+ return encoder.Take();
}
- iterator erase(iterator it) override {
- grpc_linked_mdelem* linked_mdelem =
- reinterpret_cast<grpc_linked_mdelem*>(GetIteratorHandle(it));
- intptr_t handle = reinterpret_cast<intptr_t>(linked_mdelem->next);
- grpc_metadata_batch_remove(batch_, linked_mdelem);
- return iterator(this, handle);
+ y_absl::optional<y_absl::string_view> Lookup(y_absl::string_view key,
+ TString* buffer) const override {
+ return batch_->GetValue(key, buffer);
}
private:
- grpc_linked_mdelem* MaybeSkipEntry(grpc_linked_mdelem* entry) const {
- if (entry != nullptr && batch_->idx.named.path == entry) {
- return entry->next;
+ class Encoder {
+ public:
+ void Encode(grpc_mdelem md) {
+ auto key = StringViewFromSlice(GRPC_MDKEY(md));
+ if (key != ":path") {
+ out_.emplace_back(TString(key),
+ TString(StringViewFromSlice(GRPC_MDVALUE(md))));
+ }
}
- return entry;
- }
- intptr_t IteratorHandleNext(intptr_t handle) const override {
- grpc_linked_mdelem* linked_mdelem =
- reinterpret_cast<grpc_linked_mdelem*>(handle);
- return reinterpret_cast<intptr_t>(MaybeSkipEntry(linked_mdelem->next));
- }
+ template <class Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ auto value_slice = Which::Encode(value);
+ out_.emplace_back(TString(Which::key()),
+ TString(value_slice.as_string_view()));
+ }
- std::pair<y_absl::string_view, y_absl::string_view> IteratorHandleGet(
- intptr_t handle) const override {
- grpc_linked_mdelem* linked_mdelem =
- reinterpret_cast<grpc_linked_mdelem*>(handle);
- return std::make_pair(StringViewFromSlice(GRPC_MDKEY(linked_mdelem->md)),
- StringViewFromSlice(GRPC_MDVALUE(linked_mdelem->md)));
- }
+ void Encode(GrpcTimeoutMetadata, grpc_millis) {}
+
+ std::vector<std::pair<TString, TString>> Take() {
+ return std::move(out_);
+ }
+
+ private:
+ std::vector<std::pair<TString, TString>> out_;
+ };
LoadBalancedCall* lb_call_;
grpc_metadata_batch* batch_;
};
//
-// ChannelData::LoadBalancedCall::LbCallState
+// ClientChannel::LoadBalancedCall::LbCallState
//
-class ChannelData::LoadBalancedCall::LbCallState
+class ClientChannel::LoadBalancedCall::LbCallState
: public LoadBalancingPolicy::CallState {
public:
explicit LbCallState(LoadBalancedCall* lb_call) : lb_call_(lb_call) {}
void* Alloc(size_t size) override { return lb_call_->arena_->Alloc(size); }
- const LoadBalancingPolicy::BackendMetricData* GetBackendMetricData()
- override {
- if (lb_call_->backend_metric_data_ == nullptr) {
- grpc_linked_mdelem* md = lb_call_->recv_trailing_metadata_->idx.named
- .x_endpoint_load_metrics_bin;
- if (md != nullptr) {
- lb_call_->backend_metric_data_ =
- ParseBackendMetricData(GRPC_MDVALUE(md->md), lb_call_->arena_);
- }
- }
- return lb_call_->backend_metric_data_;
- }
-
y_absl::string_view ExperimentalGetCallAttribute(const char* key) override {
auto* service_config_call_data = static_cast<ServiceConfigCallData*>(
lb_call_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
@@ -4907,94 +2495,100 @@ class ChannelData::LoadBalancedCall::LbCallState
};
//
-// LoadBalancedCall
+// ClientChannel::LoadBalancedCall::BackendMetricAccessor
+//
+
+class ClientChannel::LoadBalancedCall::BackendMetricAccessor
+ : public LoadBalancingPolicy::BackendMetricAccessor {
+ public:
+ explicit BackendMetricAccessor(LoadBalancedCall* lb_call)
+ : lb_call_(lb_call) {}
+
+ const BackendMetricData* GetBackendMetricData() override {
+ if (lb_call_->backend_metric_data_ == nullptr) {
+ if (const auto* md = lb_call_->recv_trailing_metadata_->get_pointer(
+ XEndpointLoadMetricsBinMetadata())) {
+ lb_call_->backend_metric_data_ =
+ ParseBackendMetricData(*md, lb_call_->arena_);
+ }
+ }
+ return lb_call_->backend_metric_data_;
+ }
+
+ private:
+ LoadBalancedCall* lb_call_;
+};
+
+//
+// ClientChannel::LoadBalancedCall
//
-RefCountedPtr<ChannelData::LoadBalancedCall>
-ChannelData::LoadBalancedCall::Create(ChannelData* chand,
- const grpc_call_element_args& args,
- grpc_polling_entity* pollent,
- size_t parent_data_size) {
- const size_t alloc_size =
- parent_data_size > 0
- ? (GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(LoadBalancedCall)) +
- parent_data_size)
- : sizeof(LoadBalancedCall);
- auto* lb_call = static_cast<LoadBalancedCall*>(args.arena->Alloc(alloc_size));
- new (lb_call) LoadBalancedCall(chand, args, pollent);
- return lb_call;
+namespace {
+
+CallTracer::CallAttemptTracer* GetCallAttemptTracer(
+ grpc_call_context_element* context, bool is_transparent_retry) {
+ auto* call_tracer =
+ static_cast<CallTracer*>(context[GRPC_CONTEXT_CALL_TRACER].value);
+ if (call_tracer == nullptr) return nullptr;
+ return call_tracer->StartNewAttempt(is_transparent_retry);
}
-ChannelData::LoadBalancedCall::LoadBalancedCall(
- ChannelData* chand, const grpc_call_element_args& args,
- grpc_polling_entity* pollent)
- : refs_(1, GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
- ? "LoadBalancedCall"
- : nullptr),
+} // namespace
+
+ClientChannel::LoadBalancedCall::LoadBalancedCall(
+ ClientChannel* chand, const grpc_call_element_args& args,
+ grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry)
+ : InternallyRefCounted(
+ GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)
+ ? "LoadBalancedCall"
+ : nullptr),
chand_(chand),
path_(grpc_slice_ref_internal(args.path)),
- call_start_time_(args.start_time),
deadline_(args.deadline),
arena_(args.arena),
owning_call_(args.call_stack),
call_combiner_(args.call_combiner),
call_context_(args.context),
- pollent_(pollent) {}
+ pollent_(pollent),
+ on_call_destruction_complete_(on_call_destruction_complete),
+ call_dispatch_controller_(call_dispatch_controller),
+ call_attempt_tracer_(
+ GetCallAttemptTracer(args.context, is_transparent_retry)) {}
-ChannelData::LoadBalancedCall::~LoadBalancedCall() {
+ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
grpc_slice_unref_internal(path_);
GRPC_ERROR_UNREF(cancel_error_);
+ GRPC_ERROR_UNREF(failure_error_);
if (backend_metric_data_ != nullptr) {
- backend_metric_data_
- ->LoadBalancingPolicy::BackendMetricData::~BackendMetricData();
+ backend_metric_data_->LoadBalancingPolicy::BackendMetricAccessor::
+ BackendMetricData::~BackendMetricData();
}
// Make sure there are no remaining pending batches.
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
GPR_ASSERT(pending_batches_[i] == nullptr);
}
-}
-
-RefCountedPtr<ChannelData::LoadBalancedCall>
-ChannelData::LoadBalancedCall::Ref() {
- IncrementRefCount();
- return RefCountedPtr<LoadBalancedCall>(this);
-}
-
-RefCountedPtr<ChannelData::LoadBalancedCall> ChannelData::LoadBalancedCall::Ref(
- const DebugLocation& location, const char* reason) {
- IncrementRefCount(location, reason);
- return RefCountedPtr<LoadBalancedCall>(this);
-}
-
-void ChannelData::LoadBalancedCall::Unref() {
- if (GPR_UNLIKELY(refs_.Unref())) {
- this->~LoadBalancedCall();
+ if (on_call_destruction_complete_ != nullptr) {
+ ExecCtx::Run(DEBUG_LOCATION, on_call_destruction_complete_,
+ GRPC_ERROR_NONE);
}
}
-void ChannelData::LoadBalancedCall::Unref(const DebugLocation& location,
- const char* reason) {
- if (GPR_UNLIKELY(refs_.Unref(location, reason))) {
- this->~LoadBalancedCall();
+void ClientChannel::LoadBalancedCall::Orphan() {
+ // Compute latency and report it to the tracer.
+ if (call_attempt_tracer_ != nullptr) {
+ gpr_timespec latency =
+ gpr_cycle_counter_sub(gpr_get_cycle_counter(), lb_call_start_time_);
+ call_attempt_tracer_->RecordEnd(latency);
}
+ Unref();
}
-void ChannelData::LoadBalancedCall::IncrementRefCount() { refs_.Ref(); }
-
-void ChannelData::LoadBalancedCall::IncrementRefCount(
- const DebugLocation& location, const char* reason) {
- refs_.Ref(location, reason);
-}
-
-void* ChannelData::LoadBalancedCall::GetParentData() {
- return reinterpret_cast<char*>(this) +
- GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(LoadBalancedCall));
-}
-
-size_t ChannelData::LoadBalancedCall::GetBatchIndex(
+size_t ClientChannel::LoadBalancedCall::GetBatchIndex(
grpc_transport_stream_op_batch* batch) {
// Note: It is important the send_initial_metadata be the first entry
- // here, since the code in pick_subchannel_locked() assumes it will be.
+ // here, since the code in PickSubchannelLocked() assumes it will be.
if (batch->send_initial_metadata) return 0;
if (batch->send_message) return 1;
if (batch->send_trailing_metadata) return 2;
@@ -5005,7 +2599,7 @@ size_t ChannelData::LoadBalancedCall::GetBatchIndex(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::LoadBalancedCall::PendingBatchesAdd(
+void ClientChannel::LoadBalancedCall::PendingBatchesAdd(
grpc_transport_stream_op_batch* batch) {
const size_t idx = GetBatchIndex(batch);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@@ -5018,8 +2612,8 @@ void ChannelData::LoadBalancedCall::PendingBatchesAdd(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::LoadBalancedCall::FailPendingBatchInCallCombiner(
- void* arg, grpc_error* error) {
+void ClientChannel::LoadBalancedCall::FailPendingBatchInCallCombiner(
+ void* arg, grpc_error_handle error) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
auto* self = static_cast<LoadBalancedCall*>(batch->handler_private.extra_arg);
@@ -5029,10 +2623,12 @@ void ChannelData::LoadBalancedCall::FailPendingBatchInCallCombiner(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::LoadBalancedCall::PendingBatchesFail(
- grpc_error* error,
+void ClientChannel::LoadBalancedCall::PendingBatchesFail(
+ grpc_error_handle error,
YieldCallCombinerPredicate yield_call_combiner_predicate) {
GPR_ASSERT(error != GRPC_ERROR_NONE);
+ GRPC_ERROR_UNREF(failure_error_);
+ failure_error_ = error;
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
size_t num_batches = 0;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -5040,7 +2636,7 @@ void ChannelData::LoadBalancedCall::PendingBatchesFail(
}
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: failing %" PRIuPTR " pending batches: %s",
- chand_, this, num_batches, grpc_error_string(error));
+ chand_, this, num_batches, grpc_error_std_string(error).c_str());
}
CallCombinerClosureList closures;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -5060,12 +2656,11 @@ void ChannelData::LoadBalancedCall::PendingBatchesFail(
} else {
closures.RunClosuresWithoutYielding(call_combiner_);
}
- GRPC_ERROR_UNREF(error);
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::LoadBalancedCall::ResumePendingBatchInCallCombiner(
- void* arg, grpc_error* /*ignored*/) {
+void ClientChannel::LoadBalancedCall::ResumePendingBatchInCallCombiner(
+ void* arg, grpc_error_handle /*ignored*/) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
SubchannelCall* subchannel_call =
@@ -5075,7 +2670,7 @@ void ChannelData::LoadBalancedCall::ResumePendingBatchInCallCombiner(
}
// This is called via the call combiner, so access to calld is synchronized.
-void ChannelData::LoadBalancedCall::PendingBatchesResume() {
+void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
size_t num_batches = 0;
for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
@@ -5095,7 +2690,7 @@ void ChannelData::LoadBalancedCall::PendingBatchesResume() {
ResumePendingBatchInCallCombiner, batch,
grpc_schedule_on_exec_ctx);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
- "PendingBatchesResume");
+ "resuming pending batch from LB call");
batch = nullptr;
}
}
@@ -5103,17 +2698,86 @@ void ChannelData::LoadBalancedCall::PendingBatchesResume() {
closures.RunClosures(call_combiner_);
}
-void ChannelData::LoadBalancedCall::StartTransportStreamOpBatch(
+void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
grpc_transport_stream_op_batch* batch) {
- // Intercept recv_trailing_metadata_ready for LB callback.
+ // Handle call tracing.
+ if (call_attempt_tracer_ != nullptr) {
+ // Record send ops in tracer.
+ if (batch->cancel_stream) {
+ call_attempt_tracer_->RecordCancel(
+ GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error));
+ }
+ if (batch->send_initial_metadata) {
+ call_attempt_tracer_->RecordSendInitialMetadata(
+ batch->payload->send_initial_metadata.send_initial_metadata,
+ batch->payload->send_initial_metadata.send_initial_metadata_flags);
+ peer_string_ = batch->payload->send_initial_metadata.peer_string;
+ original_send_initial_metadata_on_complete_ = batch->on_complete;
+ GRPC_CLOSURE_INIT(&send_initial_metadata_on_complete_,
+ SendInitialMetadataOnComplete, this, nullptr);
+ batch->on_complete = &send_initial_metadata_on_complete_;
+ }
+ if (batch->send_message) {
+ call_attempt_tracer_->RecordSendMessage(
+ *batch->payload->send_message.send_message);
+ }
+ if (batch->send_trailing_metadata) {
+ call_attempt_tracer_->RecordSendTrailingMetadata(
+ batch->payload->send_trailing_metadata.send_trailing_metadata);
+ }
+ // Intercept recv ops.
+ if (batch->recv_initial_metadata) {
+ recv_initial_metadata_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata;
+ original_recv_initial_metadata_ready_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ this, nullptr);
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &recv_initial_metadata_ready_;
+ }
+ if (batch->recv_message) {
+ recv_message_ = batch->payload->recv_message.recv_message;
+ original_recv_message_ready_ =
+ batch->payload->recv_message.recv_message_ready;
+ GRPC_CLOSURE_INIT(&recv_message_ready_, RecvMessageReady, this, nullptr);
+ batch->payload->recv_message.recv_message_ready = &recv_message_ready_;
+ }
+ }
+ // Intercept recv_trailing_metadata even if there is no call tracer,
+ // since we may need to notify the LB policy about trailing metadata.
if (batch->recv_trailing_metadata) {
- InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(batch);
+ recv_trailing_metadata_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata;
+ transport_stream_stats_ =
+ batch->payload->recv_trailing_metadata.collect_stats;
+ original_recv_trailing_metadata_ready_ =
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_, RecvTrailingMetadataReady,
+ this, nullptr);
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &recv_trailing_metadata_ready_;
+ }
+ // If we've already gotten a subchannel call, pass the batch down to it.
+ // Note that once we have picked a subchannel, we do not need to acquire
+ // the channel's data plane mutex, which is more efficient (especially for
+ // streaming calls).
+ if (subchannel_call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
+ chand_, this, subchannel_call_.get());
+ }
+ subchannel_call_->StartTransportStreamOpBatch(batch);
+ return;
}
+ // We do not yet have a subchannel call.
+ //
// If we've previously been cancelled, immediately fail any new batches.
if (GPR_UNLIKELY(cancel_error_ != GRPC_ERROR_NONE)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: failing batch with error: %s",
- chand_, this, grpc_error_string(cancel_error_));
+ chand_, this, grpc_error_std_string(cancel_error_).c_str());
}
// Note: This will release the call combiner.
grpc_transport_stream_op_batch_finish_with_failure(
@@ -5131,38 +2795,17 @@ void ChannelData::LoadBalancedCall::StartTransportStreamOpBatch(
cancel_error_ = GRPC_ERROR_REF(batch->payload->cancel_stream.cancel_error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: recording cancel_error=%s",
- chand_, this, grpc_error_string(cancel_error_));
- }
- // If we do not have a subchannel call (i.e., a pick has not yet
- // been started), fail all pending batches. Otherwise, send the
- // cancellation down to the subchannel call.
- if (subchannel_call_ == nullptr) {
- PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
- // Note: This will release the call combiner.
- grpc_transport_stream_op_batch_finish_with_failure(
- batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
- } else {
- // Note: This will release the call combiner.
- subchannel_call_->StartTransportStreamOpBatch(batch);
+ chand_, this, grpc_error_std_string(cancel_error_).c_str());
}
+ // Fail all pending batches.
+ PendingBatchesFail(GRPC_ERROR_REF(cancel_error_), NoYieldCallCombiner);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancel_error_), call_combiner_);
return;
}
// Add the batch to the pending list.
PendingBatchesAdd(batch);
- // Check if we've already gotten a subchannel call.
- // Note that once we have picked a subchannel, we do not need to acquire
- // the channel's data plane mutex, which is more efficient (especially for
- // streaming calls).
- if (subchannel_call_ != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
- gpr_log(GPR_INFO,
- "chand=%p lb_call=%p: starting batch on subchannel_call=%p",
- chand_, this, subchannel_call_.get());
- }
- PendingBatchesResume();
- return;
- }
- // We do not yet have a subchannel call.
// For batches containing a send_initial_metadata op, acquire the
// channel's data plane mutex to pick a subchannel.
if (GPR_LIKELY(batch->send_initial_metadata)) {
@@ -5184,73 +2827,113 @@ void ChannelData::LoadBalancedCall::StartTransportStreamOpBatch(
}
}
-void ChannelData::LoadBalancedCall::
- RecvTrailingMetadataReadyForLoadBalancingPolicy(void* arg,
- grpc_error* error) {
+void ClientChannel::LoadBalancedCall::SendInitialMetadataOnComplete(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ self->call_attempt_tracer_->RecordOnDoneSendInitialMetadata(
+ self->peer_string_);
+ Closure::Run(DEBUG_LOCATION,
+ self->original_send_initial_metadata_on_complete_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvInitialMetadataReady(
+ void* arg, grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
- if (self->lb_recv_trailing_metadata_ready_ != nullptr) {
- // Set error if call did not succeed.
- grpc_error* error_for_lb = GRPC_ERROR_NONE;
+ if (error == GRPC_ERROR_NONE) {
+ // recv_initial_metadata_flags is not populated for clients
+ self->call_attempt_tracer_->RecordReceivedInitialMetadata(
+ self->recv_initial_metadata_, 0 /* recv_initial_metadata_flags */);
+ }
+ Closure::Run(DEBUG_LOCATION, self->original_recv_initial_metadata_ready_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvMessageReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ if (*self->recv_message_ != nullptr) {
+ self->call_attempt_tracer_->RecordReceivedMessage(**self->recv_message_);
+ }
+ Closure::Run(DEBUG_LOCATION, self->original_recv_message_ready_,
+ GRPC_ERROR_REF(error));
+}
+
+void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
+ void* arg, grpc_error_handle error) {
+ auto* self = static_cast<LoadBalancedCall*>(arg);
+ // Check if we have a tracer or an LB callback to invoke.
+ if (self->call_attempt_tracer_ != nullptr ||
+ self->lb_subchannel_call_tracker_ != nullptr) {
+ // Get the call's status.
+ y_absl::Status status;
if (error != GRPC_ERROR_NONE) {
- error_for_lb = error;
+ // Get status from error.
+ grpc_status_code code;
+ TString message;
+ grpc_error_get_status(error, self->deadline_, &code, &message,
+ /*http_error=*/nullptr, /*error_string=*/nullptr);
+ status = y_absl::Status(static_cast<y_absl::StatusCode>(code), message);
} else {
- const auto& fields = self->recv_trailing_metadata_->idx.named;
+ // Get status from headers.
+ const auto& md = *self->recv_trailing_metadata_;
+ const auto& fields = md.legacy_index()->named;
GPR_ASSERT(fields.grpc_status != nullptr);
- grpc_status_code status =
+ grpc_status_code code =
grpc_get_status_code_from_metadata(fields.grpc_status->md);
- TString msg;
- if (status != GRPC_STATUS_OK) {
- error_for_lb = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("call failed"),
- GRPC_ERROR_INT_GRPC_STATUS, status);
- if (fields.grpc_message != nullptr) {
- error_for_lb = grpc_error_set_str(
- error_for_lb, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_ref_internal(GRPC_MDVALUE(fields.grpc_message->md)));
+ if (code != GRPC_STATUS_OK) {
+ y_absl::string_view message;
+ if (const auto* grpc_message = md.get_pointer(GrpcMessageMetadata())) {
+ message = grpc_message->as_string_view();
}
+ status = y_absl::Status(static_cast<y_absl::StatusCode>(code), message);
}
}
- // Invoke callback to LB policy.
- Metadata trailing_metadata(self, self->recv_trailing_metadata_);
- LbCallState lb_call_state(self);
- self->lb_recv_trailing_metadata_ready_(error_for_lb, &trailing_metadata,
- &lb_call_state);
- if (error == GRPC_ERROR_NONE) GRPC_ERROR_UNREF(error_for_lb);
+ // If we have a tracer, notify it.
+ if (self->call_attempt_tracer_ != nullptr) {
+ self->call_attempt_tracer_->RecordReceivedTrailingMetadata(
+ status, self->recv_trailing_metadata_,
+ *self->transport_stream_stats_);
+ }
+ // If the LB policy requested a callback for trailing metadata, invoke
+ // the callback.
+ if (self->lb_subchannel_call_tracker_ != nullptr) {
+ Metadata trailing_metadata(self, self->recv_trailing_metadata_);
+ BackendMetricAccessor backend_metric_accessor(self);
+ LoadBalancingPolicy::SubchannelCallTrackerInterface::FinishArgs args = {
+ status, &trailing_metadata, &backend_metric_accessor};
+ self->lb_subchannel_call_tracker_->Finish(args);
+ self->lb_subchannel_call_tracker_.reset();
+ }
}
// Chain to original callback.
+ if (self->failure_error_ != GRPC_ERROR_NONE) {
+ error = self->failure_error_;
+ self->failure_error_ = GRPC_ERROR_NONE;
+ } else {
+ error = GRPC_ERROR_REF(error);
+ }
Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
- GRPC_ERROR_REF(error));
+ error);
}
-// TODO(roth): Consider not intercepting this callback unless we
-// actually need to, if this causes a performance problem.
-void ChannelData::LoadBalancedCall::
- InjectRecvTrailingMetadataReadyForLoadBalancingPolicy(
- grpc_transport_stream_op_batch* batch) {
- recv_trailing_metadata_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata;
- original_recv_trailing_metadata_ready_ =
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
- GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_,
- RecvTrailingMetadataReadyForLoadBalancingPolicy, this,
- grpc_schedule_on_exec_ctx);
- batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
- &recv_trailing_metadata_ready_;
-}
-
-void ChannelData::LoadBalancedCall::CreateSubchannelCall() {
+void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
SubchannelCall::Args call_args = {
- std::move(connected_subchannel_), pollent_, path_, call_start_time_,
+ std::move(connected_subchannel_), pollent_, path_, /*start_time=*/0,
deadline_, arena_,
// TODO(roth): When we implement hedging support, we will probably
// need to use a separate call context for each subchannel call.
call_context_, call_combiner_};
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: create subchannel_call=%p: error=%s", chand_,
- this, subchannel_call_.get(), grpc_error_string(error));
+ this, subchannel_call_.get(), grpc_error_std_string(error).c_str());
+ }
+ if (on_call_destruction_complete_ != nullptr) {
+ subchannel_call_->SetAfterCallStackDestroy(on_call_destruction_complete_);
+ on_call_destruction_complete_ = nullptr;
}
if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
PendingBatchesFail(error, YieldCallCombiner);
@@ -5266,7 +2949,7 @@ void ChannelData::LoadBalancedCall::CreateSubchannelCall() {
// because there may be multiple LB picks happening in parallel.
// Instead, we will probably need to maintain a list in the CallData
// object of pending LB picks to be cancelled when the closure runs.
-class ChannelData::LoadBalancedCall::LbQueuedCallCanceller {
+class ClientChannel::LoadBalancedCall::LbQueuedCallCanceller {
public:
explicit LbQueuedCallCanceller(RefCountedPtr<LoadBalancedCall> lb_call)
: lb_call_(std::move(lb_call)) {
@@ -5276,7 +2959,7 @@ class ChannelData::LoadBalancedCall::LbQueuedCallCanceller {
}
private:
- static void CancelLocked(void* arg, grpc_error* error) {
+ static void CancelLocked(void* arg, grpc_error_handle error) {
auto* self = static_cast<LbQueuedCallCanceller*>(arg);
auto* lb_call = self->lb_call_.get();
auto* chand = lb_call->chand_;
@@ -5286,10 +2969,11 @@ class ChannelData::LoadBalancedCall::LbQueuedCallCanceller {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: cancelling queued pick: "
"error=%s self=%p calld->pick_canceller=%p",
- chand, lb_call, grpc_error_string(error), self,
+ chand, lb_call, grpc_error_std_string(error).c_str(), self,
lb_call->lb_call_canceller_);
}
if (lb_call->lb_call_canceller_ == self && error != GRPC_ERROR_NONE) {
+ lb_call->call_dispatch_controller_->Commit();
// Remove pick from list of queued picks.
lb_call->MaybeRemoveCallFromLbQueuedCallsLocked();
// Fail pending batches on the call.
@@ -5305,7 +2989,7 @@ class ChannelData::LoadBalancedCall::LbQueuedCallCanceller {
grpc_closure closure_;
};
-void ChannelData::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
+void ClientChannel::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
if (!queued_pending_lb_pick_) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: removing from queued picks list",
@@ -5317,7 +3001,7 @@ void ChannelData::LoadBalancedCall::MaybeRemoveCallFromLbQueuedCallsLocked() {
lb_call_canceller_ = nullptr;
}
-void ChannelData::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
+void ClientChannel::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
if (queued_pending_lb_pick_) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO, "chand=%p lb_call=%p: adding to queued picks list",
@@ -5330,40 +3014,30 @@ void ChannelData::LoadBalancedCall::MaybeAddCallToLbQueuedCallsLocked() {
lb_call_canceller_ = new LbQueuedCallCanceller(Ref());
}
-void ChannelData::LoadBalancedCall::AsyncPickDone(grpc_error* error) {
+void ClientChannel::LoadBalancedCall::AsyncPickDone(grpc_error_handle error) {
+ // TODO(roth): Does this callback need to hold a ref to LoadBalancedCall?
GRPC_CLOSURE_INIT(&pick_closure_, PickDone, this, grpc_schedule_on_exec_ctx);
ExecCtx::Run(DEBUG_LOCATION, &pick_closure_, error);
}
-void ChannelData::LoadBalancedCall::PickDone(void* arg, grpc_error* error) {
+void ClientChannel::LoadBalancedCall::PickDone(void* arg,
+ grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
if (error != GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
gpr_log(GPR_INFO,
"chand=%p lb_call=%p: failed to pick subchannel: error=%s",
- self->chand_, self, grpc_error_string(error));
+ self->chand_, self, grpc_error_std_string(error).c_str());
}
self->PendingBatchesFail(GRPC_ERROR_REF(error), YieldCallCombiner);
return;
}
+ self->call_dispatch_controller_->Commit();
self->CreateSubchannelCall();
}
-const char* PickResultTypeName(
- LoadBalancingPolicy::PickResult::ResultType type) {
- switch (type) {
- case LoadBalancingPolicy::PickResult::PICK_COMPLETE:
- return "COMPLETE";
- case LoadBalancingPolicy::PickResult::PICK_QUEUE:
- return "QUEUE";
- case LoadBalancingPolicy::PickResult::PICK_FAILED:
- return "FAILED";
- }
- GPR_UNREACHABLE_CODE(return "UNKNOWN");
-}
-
-void ChannelData::LoadBalancedCall::PickSubchannel(void* arg,
- grpc_error* error) {
+void ClientChannel::LoadBalancedCall::PickSubchannel(void* arg,
+ grpc_error_handle error) {
auto* self = static_cast<LoadBalancedCall*>(arg);
bool pick_complete;
{
@@ -5376,7 +3050,8 @@ void ChannelData::LoadBalancedCall::PickSubchannel(void* arg,
}
}
-bool ChannelData::LoadBalancedCall::PickSubchannelLocked(grpc_error** error) {
+bool ClientChannel::LoadBalancedCall::PickSubchannelLocked(
+ grpc_error_handle* error) {
GPR_ASSERT(connected_subchannel_ == nullptr);
GPR_ASSERT(subchannel_call_ == nullptr);
// Grab initial metadata.
@@ -5394,126 +3069,92 @@ bool ChannelData::LoadBalancedCall::PickSubchannelLocked(grpc_error** error) {
Metadata initial_metadata(this, initial_metadata_batch);
pick_args.initial_metadata = &initial_metadata;
auto result = chand_->picker_->Pick(pick_args);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
- gpr_log(
- GPR_INFO,
- "chand=%p lb_call=%p: LB pick returned %s (subchannel=%p, error=%s)",
- chand_, this, PickResultTypeName(result.type), result.subchannel.get(),
- grpc_error_string(result.error));
- }
- switch (result.type) {
- case LoadBalancingPolicy::PickResult::PICK_FAILED: {
- // If we're shutting down, fail all RPCs.
- grpc_error* disconnect_error = chand_->disconnect_error();
- if (disconnect_error != GRPC_ERROR_NONE) {
- GRPC_ERROR_UNREF(result.error);
- MaybeRemoveCallFromLbQueuedCallsLocked();
- *error = GRPC_ERROR_REF(disconnect_error);
- return true;
- }
- // If wait_for_ready is false, then the error indicates the RPC
- // attempt's final status.
- if ((send_initial_metadata_flags &
- GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
- grpc_error* new_error =
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to pick subchannel", &result.error, 1);
- GRPC_ERROR_UNREF(result.error);
- *error = new_error;
- MaybeRemoveCallFromLbQueuedCallsLocked();
- return true;
- }
- // If wait_for_ready is true, then queue to retry when we get a new
- // picker.
- GRPC_ERROR_UNREF(result.error);
- }
- // Fallthrough
- case LoadBalancingPolicy::PickResult::PICK_QUEUE:
- MaybeAddCallToLbQueuedCallsLocked();
- return false;
- default: // PICK_COMPLETE
- MaybeRemoveCallFromLbQueuedCallsLocked();
- // Handle drops.
- if (GPR_UNLIKELY(result.subchannel == nullptr)) {
- result.error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Call dropped by load balancing policy"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- } else {
- // Grab a ref to the connected subchannel while we're still
- // holding the data plane mutex.
- connected_subchannel_ =
- chand_->GetConnectedSubchannelInDataPlane(result.subchannel.get());
- GPR_ASSERT(connected_subchannel_ != nullptr);
- }
- lb_recv_trailing_metadata_ready_ = result.recv_trailing_metadata_ready;
- *error = result.error;
- return true;
- }
+ return HandlePickResult<bool>(
+ &result,
+ // CompletePick
+ [this](LoadBalancingPolicy::PickResult::Complete* complete_pick)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: LB pick succeeded: subchannel=%p",
+ chand_, this, complete_pick->subchannel.get());
+ }
+ GPR_ASSERT(complete_pick->subchannel != nullptr);
+ // Grab a ref to the connected subchannel while we're still
+ // holding the data plane mutex.
+ SubchannelWrapper* subchannel = static_cast<SubchannelWrapper*>(
+ complete_pick->subchannel.get());
+ connected_subchannel_ = subchannel->connected_subchannel();
+ // If the subchannel has no connected subchannel (e.g., if the
+ // subchannel has moved out of state READY but the LB policy hasn't
+ // yet seen that change and given us a new picker), then just
+ // queue the pick. We'll try again as soon as we get a new picker.
+ if (connected_subchannel_ == nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p lb_call=%p: subchannel returned by LB picker "
+ "has no connected subchannel; queueing pick",
+ chand_, this);
+ }
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ }
+ lb_subchannel_call_tracker_ =
+ std::move(complete_pick->subchannel_call_tracker);
+ if (lb_subchannel_call_tracker_ != nullptr) {
+ lb_subchannel_call_tracker_->Start();
+ }
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ },
+ // QueuePick
+ [this](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick queued", chand_,
+ this);
+ }
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ },
+ // FailPick
+ [this, send_initial_metadata_flags,
+ &error](LoadBalancingPolicy::PickResult::Fail* fail_pick)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick failed: %s",
+ chand_, this, fail_pick->status.ToString().c_str());
+ }
+ // If wait_for_ready is false, then the error indicates the RPC
+ // attempt's final status.
+ if ((send_initial_metadata_flags &
+ GRPC_INITIAL_METADATA_WAIT_FOR_READY) == 0) {
+ grpc_error_handle lb_error =
+ absl_status_to_grpc_error(fail_pick->status);
+ *error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to pick subchannel", &lb_error, 1);
+ GRPC_ERROR_UNREF(lb_error);
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ }
+ // If wait_for_ready is true, then queue to retry when we get a new
+ // picker.
+ MaybeAddCallToLbQueuedCallsLocked();
+ return false;
+ },
+ // DropPick
+ [this, &error](LoadBalancingPolicy::PickResult::Drop* drop_pick)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_routing_trace)) {
+ gpr_log(GPR_INFO, "chand=%p lb_call=%p: LB pick dropped: %s",
+ chand_, this, drop_pick->status.ToString().c_str());
+ }
+ *error =
+ grpc_error_set_int(absl_status_to_grpc_error(drop_pick->status),
+ GRPC_ERROR_INT_LB_POLICY_DROP, 1);
+ MaybeRemoveCallFromLbQueuedCallsLocked();
+ return true;
+ });
}
-} // namespace
} // namespace grpc_core
-
-/*************************************************************************
- * EXPORTED SYMBOLS
- */
-
-using grpc_core::ChannelData;
-
-const grpc_channel_filter grpc_client_channel_filter = {
- ChannelData::CallData::StartTransportStreamOpBatch,
- ChannelData::StartTransportOp,
- sizeof(ChannelData::CallData),
- ChannelData::CallData::Init,
- ChannelData::CallData::SetPollent,
- ChannelData::CallData::Destroy,
- sizeof(ChannelData),
- ChannelData::Init,
- ChannelData::Destroy,
- ChannelData::GetChannelInfo,
- "client-channel",
-};
-
-grpc_connectivity_state grpc_client_channel_check_connectivity_state(
- grpc_channel_element* elem, int try_to_connect) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- return chand->CheckConnectivityState(try_to_connect);
-}
-
-int grpc_client_channel_num_external_connectivity_watchers(
- grpc_channel_element* elem) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- return chand->NumExternalConnectivityWatchers();
-}
-
-void grpc_client_channel_watch_connectivity_state(
- grpc_channel_element* elem, grpc_polling_entity pollent,
- grpc_connectivity_state* state, grpc_closure* on_complete,
- grpc_closure* watcher_timer_init) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- if (state == nullptr) {
- // Handle cancellation.
- GPR_ASSERT(watcher_timer_init == nullptr);
- chand->RemoveExternalConnectivityWatcher(on_complete, /*cancel=*/true);
- return;
- }
- // Handle addition.
- return chand->AddExternalConnectivityWatcher(pollent, state, on_complete,
- watcher_timer_init);
-}
-
-void grpc_client_channel_start_connectivity_watch(
- grpc_channel_element* elem, grpc_connectivity_state initial_state,
- grpc_core::OrphanablePtr<grpc_core::AsyncConnectivityStateWatcherInterface>
- watcher) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->AddConnectivityWatcher(initial_state, std::move(watcher));
-}
-
-void grpc_client_channel_stop_connectivity_watch(
- grpc_channel_element* elem,
- grpc_core::AsyncConnectivityStateWatcherInterface* watcher) {
- auto* chand = static_cast<ChannelData*>(elem->channel_data);
- chand->RemoveConnectivityWatcher(watcher);
-}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
index af011cafcc7..5289ac24bce 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel.h
@@ -1,76 +1,582 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
+#include <map>
+#include <memory>
+#include <set>
+#include <util/generic/string.h>
+
+#include "y_absl/status/status.h"
+#include "y_absl/types/optional.h"
+
+#include <grpc/support/log.h>
+
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
+#include "src/core/ext/filters/client_channel/config_selector.h"
+#include "src/core/ext/filters/client_channel/dynamic_filters.h"
+#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/resolver.h"
-#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
+#include "src/core/ext/filters/client_channel/retry_throttle.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
+#include "src/core/ext/service_config/service_config_parser.h"
+#include "src/core/lib/channel/call_tracer.h"
+#include "src/core/lib/channel/context.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/connectivity_state.h"
+
+//
+// Client channel filter
+//
+
+// A client channel is a channel that begins disconnected, and can connect
+// to some endpoint on demand. If that endpoint disconnects, it will be
+// connected to again later.
+//
+// Calls on a disconnected client channel are queued until a connection is
+// established.
// Channel arg key for server URI string.
#define GRPC_ARG_SERVER_URI "grpc.server_uri"
-/* A client channel is a channel that begins disconnected, and can connect
- to some endpoint on demand. If that endpoint disconnects, it will be
- connected to again later.
+// Channel arg containing a pointer to the ClientChannel object.
+#define GRPC_ARG_CLIENT_CHANNEL "grpc.internal.client_channel"
+
+// Channel arg containing a pointer to the ServiceConfig object.
+#define GRPC_ARG_SERVICE_CONFIG_OBJ "grpc.internal.service_config_obj"
+
+// Max number of batches that can be pending on a call at any given
+// time. This includes one batch for each of the following ops:
+// recv_initial_metadata
+// send_initial_metadata
+// recv_message
+// send_message
+// recv_trailing_metadata
+// send_trailing_metadata
+#define MAX_PENDING_BATCHES 6
+
+namespace grpc_core {
+
+class ClientChannel {
+ public:
+ static const grpc_channel_filter kFilterVtable;
+
+ class LoadBalancedCall;
+
+ // Returns the ClientChannel object from channel, or null if channel
+ // is not a client channel.
+ static ClientChannel* GetFromChannel(grpc_channel* channel);
+
+ grpc_connectivity_state CheckConnectivityState(bool try_to_connect);
+
+ // Starts a one-time connectivity state watch. When the channel's state
+ // becomes different from *state, sets *state to the new state and
+ // schedules on_complete. The watcher_timer_init callback is invoked as
+ // soon as the watch is actually started (i.e., after hopping into the
+ // client channel combiner). I/O will be serviced via pollent.
+ //
+ // This is intended to be used when starting a watch from outside of C-core
+ // via grpc_channel_watch_connectivity_state(). It should not be used
+ // by other callers.
+ void AddExternalConnectivityWatcher(grpc_polling_entity pollent,
+ grpc_connectivity_state* state,
+ grpc_closure* on_complete,
+ grpc_closure* watcher_timer_init) {
+ new ExternalConnectivityWatcher(this, pollent, state, on_complete,
+ watcher_timer_init);
+ }
+
+ // Cancels a pending external watcher previously added by
+ // AddExternalConnectivityWatcher().
+ void CancelExternalConnectivityWatcher(grpc_closure* on_complete) {
+ ExternalConnectivityWatcher::RemoveWatcherFromExternalWatchersMap(
+ this, on_complete, /*cancel=*/true);
+ }
+
+ int NumExternalConnectivityWatchers() const {
+ MutexLock lock(&external_watchers_mu_);
+ return static_cast<int>(external_watchers_.size());
+ }
+
+ // Starts and stops a connectivity watch. The watcher will be initially
+ // notified as soon as the state changes from initial_state and then on
+ // every subsequent state change until either the watch is stopped or
+ // it is notified that the state has changed to SHUTDOWN.
+ //
+ // This is intended to be used when starting watches from code inside of
+ // C-core (e.g., for a nested control plane channel for things like xds).
+ void AddConnectivityWatcher(
+ grpc_connectivity_state initial_state,
+ OrphanablePtr<AsyncConnectivityStateWatcherInterface> watcher);
+ void RemoveConnectivityWatcher(
+ AsyncConnectivityStateWatcherInterface* watcher);
+
+ OrphanablePtr<LoadBalancedCall> CreateLoadBalancedCall(
+ const grpc_call_element_args& args, grpc_polling_entity* pollent,
+ grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry);
+
+ private:
+ class CallData;
+ class ResolverResultHandler;
+ class SubchannelWrapper;
+ class ClientChannelControlHelper;
+ class ConnectivityWatcherAdder;
+ class ConnectivityWatcherRemover;
+
+ // Represents a pending connectivity callback from an external caller
+ // via grpc_client_channel_watch_connectivity_state().
+ class ExternalConnectivityWatcher : public ConnectivityStateWatcherInterface {
+ public:
+ ExternalConnectivityWatcher(ClientChannel* chand,
+ grpc_polling_entity pollent,
+ grpc_connectivity_state* state,
+ grpc_closure* on_complete,
+ grpc_closure* watcher_timer_init);
+
+ ~ExternalConnectivityWatcher() override;
+
+ // Removes the watcher from the external_watchers_ map.
+ static void RemoveWatcherFromExternalWatchersMap(ClientChannel* chand,
+ grpc_closure* on_complete,
+ bool cancel);
+
+ void Notify(grpc_connectivity_state state,
+ const y_absl::Status& /* status */) override;
+
+ void Cancel();
+
+ private:
+ // Adds the watcher to state_tracker_. Consumes the ref that is passed to it
+ // from Start().
+ void AddWatcherLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_);
+ void RemoveWatcherLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(chand_->work_serializer_);
+
+ ClientChannel* chand_;
+ grpc_polling_entity pollent_;
+ grpc_connectivity_state initial_state_;
+ grpc_connectivity_state* state_;
+ grpc_closure* on_complete_;
+ grpc_closure* watcher_timer_init_;
+ std::atomic<bool> done_{false};
+ };
+
+ struct ResolverQueuedCall {
+ grpc_call_element* elem;
+ ResolverQueuedCall* next = nullptr;
+ };
+ struct LbQueuedCall {
+ LoadBalancedCall* lb_call;
+ LbQueuedCall* next = nullptr;
+ };
+
+ ClientChannel(grpc_channel_element_args* args, grpc_error_handle* error);
+ ~ClientChannel();
+
+ // Filter vtable functions.
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
+ static void Destroy(grpc_channel_element* elem);
+ static void StartTransportOp(grpc_channel_element* elem,
+ grpc_transport_op* op);
+ static void GetChannelInfo(grpc_channel_element* elem,
+ const grpc_channel_info* info);
+
+ // Note: All methods with "Locked" suffix must be invoked from within
+ // work_serializer_.
+
+ void OnResolverResultChangedLocked(Resolver::Result result)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ void OnResolverErrorLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+
+ void CreateOrUpdateLbPolicyLocked(
+ RefCountedPtr<LoadBalancingPolicy::Config> lb_policy_config,
+ const y_absl::optional<TString>& health_check_service_name,
+ Resolver::Result result) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ OrphanablePtr<LoadBalancingPolicy> CreateLbPolicyLocked(
+ const grpc_channel_args& args)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+
+ void UpdateStateAndPickerLocked(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ const char* reason,
+ std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+
+ void UpdateServiceConfigInControlPlaneLocked(
+ RefCountedPtr<ServiceConfig> service_config,
+ RefCountedPtr<ConfigSelector> config_selector, const char* lb_policy_name)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+
+ void UpdateServiceConfigInDataPlaneLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
- Calls on a disconnected client channel are queued until a connection is
- established. */
+ void CreateResolverLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+ void DestroyResolverAndLbPolicyLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
-extern const grpc_channel_filter grpc_client_channel_filter;
+ grpc_error_handle DoPingLocked(grpc_transport_op* op)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
-grpc_connectivity_state grpc_client_channel_check_connectivity_state(
- grpc_channel_element* elem, int try_to_connect);
+ void StartTransportOpLocked(grpc_transport_op* op)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
-int grpc_client_channel_num_external_connectivity_watchers(
- grpc_channel_element* elem);
+ void TryToConnectLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_);
+
+ // These methods all require holding resolution_mu_.
+ void AddResolverQueuedCall(ResolverQueuedCall* call,
+ grpc_polling_entity* pollent)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_);
+ void RemoveResolverQueuedCall(ResolverQueuedCall* to_remove,
+ grpc_polling_entity* pollent)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(resolution_mu_);
+
+ // These methods all require holding data_plane_mu_.
+ void AddLbQueuedCall(LbQueuedCall* call, grpc_polling_entity* pollent)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
+ void RemoveLbQueuedCall(LbQueuedCall* to_remove, grpc_polling_entity* pollent)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(data_plane_mu_);
+
+ //
+ // Fields set at construction and never modified.
+ //
+ const bool deadline_checking_enabled_;
+ grpc_channel_stack* owning_stack_;
+ ClientChannelFactory* client_channel_factory_;
+ const grpc_channel_args* channel_args_;
+ RefCountedPtr<ServiceConfig> default_service_config_;
+ TString uri_to_resolve_;
+ TString default_authority_;
+ channelz::ChannelNode* channelz_node_;
+ grpc_pollset_set* interested_parties_;
+
+ //
+ // Fields related to name resolution. Guarded by resolution_mu_.
+ //
+ mutable Mutex resolution_mu_;
+ // Linked list of calls queued waiting for resolver result.
+ ResolverQueuedCall* resolver_queued_calls_ Y_ABSL_GUARDED_BY(resolution_mu_) =
+ nullptr;
+ // Data from service config.
+ grpc_error_handle resolver_transient_failure_error_
+ Y_ABSL_GUARDED_BY(resolution_mu_) = GRPC_ERROR_NONE;
+ bool received_service_config_data_ Y_ABSL_GUARDED_BY(resolution_mu_) = false;
+ RefCountedPtr<ServiceConfig> service_config_ Y_ABSL_GUARDED_BY(resolution_mu_);
+ RefCountedPtr<ConfigSelector> config_selector_
+ Y_ABSL_GUARDED_BY(resolution_mu_);
+ RefCountedPtr<DynamicFilters> dynamic_filters_
+ Y_ABSL_GUARDED_BY(resolution_mu_);
+
+ //
+ // Fields used in the data plane. Guarded by data_plane_mu_.
+ //
+ mutable Mutex data_plane_mu_;
+ std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_
+ Y_ABSL_GUARDED_BY(data_plane_mu_);
+ // Linked list of calls queued waiting for LB pick.
+ LbQueuedCall* lb_queued_calls_ Y_ABSL_GUARDED_BY(data_plane_mu_) = nullptr;
+
+ //
+ // Fields used in the control plane. Guarded by work_serializer.
+ //
+ std::shared_ptr<WorkSerializer> work_serializer_;
+ ConnectivityStateTracker state_tracker_ Y_ABSL_GUARDED_BY(work_serializer_);
+ OrphanablePtr<Resolver> resolver_ Y_ABSL_GUARDED_BY(work_serializer_);
+ bool previous_resolution_contained_addresses_
+ Y_ABSL_GUARDED_BY(work_serializer_) = false;
+ RefCountedPtr<ServiceConfig> saved_service_config_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ RefCountedPtr<ConfigSelector> saved_config_selector_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ OrphanablePtr<LoadBalancingPolicy> lb_policy_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ RefCountedPtr<SubchannelPoolInterface> subchannel_pool_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ // The number of SubchannelWrapper instances referencing a given Subchannel.
+ std::map<Subchannel*, int> subchannel_refcount_map_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ // The set of SubchannelWrappers that currently exist.
+ // No need to hold a ref, since the map is updated in the control-plane
+ // work_serializer when the SubchannelWrappers are created and destroyed.
+ std::set<SubchannelWrapper*> subchannel_wrappers_
+ Y_ABSL_GUARDED_BY(work_serializer_);
+ int keepalive_time_ Y_ABSL_GUARDED_BY(work_serializer_) = -1;
+ grpc_error_handle disconnect_error_ Y_ABSL_GUARDED_BY(work_serializer_) =
+ GRPC_ERROR_NONE;
+
+ //
+ // Fields guarded by a mutex, since they need to be accessed
+ // synchronously via get_channel_info().
+ //
+ Mutex info_mu_;
+ UniquePtr<char> info_lb_policy_name_ Y_ABSL_GUARDED_BY(info_mu_);
+ UniquePtr<char> info_service_config_json_ Y_ABSL_GUARDED_BY(info_mu_);
+
+ //
+ // Fields guarded by a mutex, since they need to be accessed
+ // synchronously via grpc_channel_num_external_connectivity_watchers().
+ //
+ mutable Mutex external_watchers_mu_;
+ std::map<grpc_closure*, RefCountedPtr<ExternalConnectivityWatcher>>
+ external_watchers_ Y_ABSL_GUARDED_BY(external_watchers_mu_);
+};
-// Starts a one-time connectivity state watch. When the channel's state
-// becomes different from *state, sets *state to the new state and
-// schedules on_complete. The watcher_timer_init callback is invoked as
-// soon as the watch is actually started (i.e., after hopping into the
-// client channel combiner). I/O will be serviced via pollent.
//
-// This is intended to be used when starting a watch from outside of C-core
-// via grpc_channel_watch_connectivity_state(). It should not be used
-// by other callers.
-void grpc_client_channel_watch_connectivity_state(
- grpc_channel_element* elem, grpc_polling_entity pollent,
- grpc_connectivity_state* state, grpc_closure* on_complete,
- grpc_closure* watcher_timer_init);
-
-// Starts and stops a connectivity watch. The watcher will be initially
-// notified as soon as the state changes from initial_state and then on
-// every subsequent state change until either the watch is stopped or
-// it is notified that the state has changed to SHUTDOWN.
+// ClientChannel::LoadBalancedCall
//
-// This is intended to be used when starting watches from code inside of
-// C-core (e.g., for a nested control plane channel for things like xds).
-void grpc_client_channel_start_connectivity_watch(
- grpc_channel_element* elem, grpc_connectivity_state initial_state,
- grpc_core::OrphanablePtr<grpc_core::AsyncConnectivityStateWatcherInterface>
- watcher);
-void grpc_client_channel_stop_connectivity_watch(
- grpc_channel_element* elem,
- grpc_core::AsyncConnectivityStateWatcherInterface* watcher);
+
+// TODO(roth): As part of simplifying cancellation in the filter stack,
+// this should no longer need to be ref-counted.
+class ClientChannel::LoadBalancedCall
+ : public InternallyRefCounted<LoadBalancedCall, kUnrefCallDtor> {
+ public:
+ // If on_call_destruction_complete is non-null, then it will be
+ // invoked once the LoadBalancedCall is completely destroyed.
+ // If it is null, then the caller is responsible for checking whether
+ // the LB call has a subchannel call and ensuring that the
+ // on_call_destruction_complete closure passed down from the surface
+ // is not invoked until after the subchannel call stack is destroyed.
+ LoadBalancedCall(
+ ClientChannel* chand, const grpc_call_element_args& args,
+ grpc_polling_entity* pollent, grpc_closure* on_call_destruction_complete,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ bool is_transparent_retry);
+ ~LoadBalancedCall() override;
+
+ void Orphan() override;
+
+ void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
+
+ // Invoked by channel for queued LB picks when the picker is updated.
+ static void PickSubchannel(void* arg, grpc_error_handle error);
+ // Helper function for performing an LB pick while holding the data plane
+ // mutex. Returns true if the pick is complete, in which case the caller
+ // must invoke PickDone() or AsyncPickDone() with the returned error.
+ bool PickSubchannelLocked(grpc_error_handle* error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_);
+ // Schedules a callback to process the completed pick. The callback
+ // will not run until after this method returns.
+ void AsyncPickDone(grpc_error_handle error);
+
+ RefCountedPtr<SubchannelCall> subchannel_call() const {
+ return subchannel_call_;
+ }
+
+ private:
+ class LbQueuedCallCanceller;
+ class Metadata;
+ class LbCallState;
+ class BackendMetricAccessor;
+
+ // Returns the index into pending_batches_ to be used for batch.
+ static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
+ void PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
+ static void FailPendingBatchInCallCombiner(void* arg,
+ grpc_error_handle error);
+ // A predicate type and some useful implementations for PendingBatchesFail().
+ typedef bool (*YieldCallCombinerPredicate)(
+ const CallCombinerClosureList& closures);
+ static bool YieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
+ return true;
+ }
+ static bool NoYieldCallCombiner(const CallCombinerClosureList& /*closures*/) {
+ return false;
+ }
+ static bool YieldCallCombinerIfPendingBatchesFound(
+ const CallCombinerClosureList& closures) {
+ return closures.size() > 0;
+ }
+ // Fails all pending batches.
+ // If yield_call_combiner_predicate returns true, assumes responsibility for
+ // yielding the call combiner.
+ void PendingBatchesFail(
+ grpc_error_handle error,
+ YieldCallCombinerPredicate yield_call_combiner_predicate);
+ static void ResumePendingBatchInCallCombiner(void* arg,
+ grpc_error_handle ignored);
+ // Resumes all pending batches on subchannel_call_.
+ void PendingBatchesResume();
+
+ static void SendInitialMetadataOnComplete(void* arg, grpc_error_handle error);
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+ static void RecvMessageReady(void* arg, grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
+
+ void CreateSubchannelCall();
+ // Invoked when a pick is completed, on both success or failure.
+ static void PickDone(void* arg, grpc_error_handle error);
+ // Removes the call from the channel's list of queued picks if present.
+ void MaybeRemoveCallFromLbQueuedCallsLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_);
+ // Adds the call to the channel's list of queued picks if not already present.
+ void MaybeAddCallToLbQueuedCallsLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ClientChannel::data_plane_mu_);
+
+ ClientChannel* chand_;
+
+ // TODO(roth): Instead of duplicating these fields in every filter
+ // that uses any one of them, we should store them in the call
+ // context. This will save per-call memory overhead.
+ grpc_slice path_; // Request path.
+ grpc_millis deadline_;
+ Arena* arena_;
+ grpc_call_stack* owning_call_;
+ CallCombiner* call_combiner_;
+ grpc_call_context_element* call_context_;
+ grpc_polling_entity* pollent_;
+ grpc_closure* on_call_destruction_complete_;
+ ConfigSelector::CallDispatchController* call_dispatch_controller_;
+
+ CallTracer::CallAttemptTracer* call_attempt_tracer_;
+
+ gpr_cycle_counter lb_call_start_time_ = gpr_get_cycle_counter();
+
+ // Set when we get a cancel_stream op.
+ grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
+
+ // Set when we fail inside the LB call.
+ grpc_error_handle failure_error_ = GRPC_ERROR_NONE;
+
+ grpc_closure pick_closure_;
+
+ // Accessed while holding ClientChannel::data_plane_mu_.
+ ClientChannel::LbQueuedCall queued_call_
+ Y_ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_);
+ bool queued_pending_lb_pick_ Y_ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_) =
+ false;
+ LbQueuedCallCanceller* lb_call_canceller_
+ Y_ABSL_GUARDED_BY(&ClientChannel::data_plane_mu_) = nullptr;
+
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
+ const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ backend_metric_data_ = nullptr;
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ lb_subchannel_call_tracker_;
+
+ RefCountedPtr<SubchannelCall> subchannel_call_;
+
+ // For intercepting send_initial_metadata on_complete.
+ gpr_atm* peer_string_ = nullptr;
+ grpc_closure send_initial_metadata_on_complete_;
+ grpc_closure* original_send_initial_metadata_on_complete_ = nullptr;
+
+ // For intercepting recv_initial_metadata_ready.
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ grpc_closure recv_initial_metadata_ready_;
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+
+ // For intercepting recv_message_ready.
+ OrphanablePtr<ByteStream>* recv_message_ = nullptr;
+ grpc_closure recv_message_ready_;
+ grpc_closure* original_recv_message_ready_ = nullptr;
+
+ // For intercepting recv_trailing_metadata_ready.
+ grpc_metadata_batch* recv_trailing_metadata_ = nullptr;
+ grpc_transport_stream_stats* transport_stream_stats_ = nullptr;
+ grpc_closure recv_trailing_metadata_ready_;
+ grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
+
+ // Batches are added to this list when received from above.
+ // They are removed when we are done handling the batch (i.e., when
+ // either we have invoked all of the batch's callbacks or we have
+ // passed the batch down to the subchannel call and are not
+ // intercepting any of its callbacks).
+ grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
+};
+
+// A sub-class of ServiceConfigCallData used to access the
+// CallDispatchController. Allocated on the arena, stored in the call
+// context, and destroyed when the call is destroyed.
+class ClientChannelServiceConfigCallData : public ServiceConfigCallData {
+ public:
+ ClientChannelServiceConfigCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_configs,
+ ServiceConfigCallData::CallAttributes call_attributes,
+ ConfigSelector::CallDispatchController* call_dispatch_controller,
+ grpc_call_context_element* call_context)
+ : ServiceConfigCallData(std::move(service_config), method_configs,
+ std::move(call_attributes)),
+ call_dispatch_controller_(call_dispatch_controller) {
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
+ call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
+ }
+
+ ConfigSelector::CallDispatchController* call_dispatch_controller() {
+ return &call_dispatch_controller_;
+ }
+
+ private:
+ // A wrapper for the CallDispatchController returned by the ConfigSelector.
+ // Handles the case where the ConfigSelector doees not return any
+ // CallDispatchController.
+ // Also ensures that we call Commit() at most once, which allows the
+ // client channel code to call Commit() when the call is complete in case
+ // it wasn't called earlier, without needing to know whether or not it was.
+ class CallDispatchControllerWrapper
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit CallDispatchControllerWrapper(
+ ConfigSelector::CallDispatchController* call_dispatch_controller)
+ : call_dispatch_controller_(call_dispatch_controller) {}
+
+ bool ShouldRetry() override {
+ if (call_dispatch_controller_ != nullptr) {
+ return call_dispatch_controller_->ShouldRetry();
+ }
+ return true;
+ }
+
+ void Commit() override {
+ if (call_dispatch_controller_ != nullptr && !commit_called_) {
+ call_dispatch_controller_->Commit();
+ commit_called_ = true;
+ }
+ }
+
+ private:
+ ConfigSelector::CallDispatchController* call_dispatch_controller_;
+ bool commit_called_ = false;
+ };
+
+ static void Destroy(void* ptr) {
+ auto* self = static_cast<ClientChannelServiceConfigCallData*>(ptr);
+ self->~ClientChannelServiceConfigCallData();
+ }
+
+ CallDispatchControllerWrapper call_dispatch_controller_;
+};
+
+} // namespace grpc_core
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
index a7799e449aa..6a1c4b53627 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.cc
@@ -18,17 +18,18 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/client_channel_channelz.h"
-#include "src/core/lib/channel/channelz_registry.h"
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/transport/connectivity_state.h"
#include <grpc/support/string_util.h>
#include <util/string/cast.h>
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/lib/channel/channelz_registry.h"
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/connectivity_state.h"
+
namespace grpc_core {
namespace channelz {
@@ -41,7 +42,7 @@ SubchannelNode::SubchannelNode(TString target_address,
SubchannelNode::~SubchannelNode() {}
void SubchannelNode::UpdateConnectivityState(grpc_connectivity_state state) {
- connectivity_state_.Store(state, MemoryOrder::RELAXED);
+ connectivity_state_.store(state, std::memory_order_relaxed);
}
void SubchannelNode::SetChildSocket(RefCountedPtr<SocketNode> socket) {
@@ -52,7 +53,7 @@ void SubchannelNode::SetChildSocket(RefCountedPtr<SocketNode> socket) {
Json SubchannelNode::RenderJson() {
// Create and fill the data child.
grpc_connectivity_state state =
- connectivity_state_.Load(MemoryOrder::RELAXED);
+ connectivity_state_.load(std::memory_order_relaxed);
Json::Object data = {
{"state",
Json::Object{
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
index cc463e26b94..57572ba513a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_channelz.h
@@ -61,9 +61,9 @@ class SubchannelNode : public BaseNode {
void RecordCallSucceeded() { call_counter_.RecordCallSucceeded(); }
private:
- Atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
+ std::atomic<grpc_connectivity_state> connectivity_state_{GRPC_CHANNEL_IDLE};
Mutex socket_mu_;
- RefCountedPtr<SocketNode> child_socket_;
+ RefCountedPtr<SocketNode> child_socket_ Y_ABSL_GUARDED_BY(socket_mu_);
TString target_;
CallCountingHelper call_counter_;
ChannelTrace trace_;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
index c0d853ebe5f..7e234a3e04e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/client_channel_factory.h"
+
#include "src/core/lib/channel/channel_args.h"
// Channel arg key for client channel factory.
@@ -31,7 +32,7 @@ namespace {
void* factory_arg_copy(void* f) { return f; }
void factory_arg_destroy(void* /*f*/) {}
int factory_arg_cmp(void* factory1, void* factory2) {
- return GPR_ICMP(factory1, factory2);
+ return QsortCompare(factory1, factory2);
}
const grpc_arg_pointer_vtable factory_arg_vtable = {
factory_arg_copy, factory_arg_destroy, factory_arg_cmp};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
index 75d74d676b2..0e00edc5afe 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_factory.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
@@ -33,7 +31,7 @@ class ClientChannelFactory {
// Creates a subchannel with the specified args.
virtual RefCountedPtr<Subchannel> CreateSubchannel(
- const grpc_channel_args* args) = 0;
+ const grpc_resolved_address& address, const grpc_channel_args* args) = 0;
// Returns a channel arg containing the specified factory.
static grpc_arg CreateChannelArg(ClientChannelFactory* factory);
@@ -45,4 +43,4 @@ class ClientChannelFactory {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CLIENT_CHANNEL_FACTORY_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
index 5690545cbb7..31a084cd40e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -34,37 +34,40 @@
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/resolver_result_parsing.h"
+#include "src/core/ext/filters/client_channel/retry_service_config.h"
#include "src/core/ext/filters/client_channel/retry_throttle.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
-#include "src/core/lib/surface/channel_init.h"
-
-static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_append_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
+#include "src/core/lib/config/core_configuration.h"
void grpc_client_channel_init(void) {
- grpc_core::ServiceConfigParser::Init();
grpc_core::internal::ClientChannelServiceConfigParser::Register();
+ grpc_core::internal::RetryServiceConfigParser::Register();
grpc_core::LoadBalancingPolicyRegistry::Builder::InitRegistry();
grpc_core::ResolverRegistry::Builder::InitRegistry();
grpc_core::internal::ServerRetryThrottleMap::Init();
grpc_core::ProxyMapperRegistry::Init();
grpc_core::RegisterHttpProxyMapper();
grpc_core::GlobalSubchannelPool::Init();
- grpc_channel_init_register_stage(
- GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_channel_filter));
- grpc_http_connect_register_handshaker_factory();
grpc_client_channel_global_init_backup_polling();
}
void grpc_client_channel_shutdown(void) {
grpc_core::GlobalSubchannelPool::Shutdown();
- grpc_channel_init_shutdown();
grpc_core::ProxyMapperRegistry::Shutdown();
grpc_core::internal::ServerRetryThrottleMap::Shutdown();
grpc_core::ResolverRegistry::Builder::ShutdownRegistry();
grpc_core::LoadBalancingPolicyRegistry::Builder::ShutdownRegistry();
- grpc_core::ServiceConfigParser::Shutdown();
}
+
+namespace grpc_core {
+
+void BuildClientChannelConfiguration(CoreConfiguration::Builder* builder) {
+ RegisterHttpConnectHandshaker(builder);
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](grpc_channel_stack_builder* builder) {
+ return grpc_channel_stack_builder_append_filter(
+ builder, &ClientChannel::kFilterVtable, nullptr, nullptr);
+ });
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
index 0c2a08e5eb1..e741a3e6f23 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.cc
@@ -17,6 +17,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/config_selector.h"
+
#include "src/core/lib/channel/channel_args.h"
namespace grpc_core {
@@ -34,7 +35,7 @@ void ConfigSelectorArgDestroy(void* p) {
config_selector->Unref();
}
-int ConfigSelectorArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int ConfigSelectorArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kChannelArgVtable = {
ConfigSelectorArgCopy, ConfigSelectorArgDestroy, ConfigSelectorArgCmp};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
index 5aa373d942b..9dfd9c66c5f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/config_selector.h
@@ -27,8 +27,9 @@
#include <grpc/grpc.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -44,6 +45,20 @@ namespace grpc_core {
// MethodConfig and provide input to LB policies on a per-call basis.
class ConfigSelector : public RefCounted<ConfigSelector> {
public:
+ // An interface to be used by the channel when dispatching calls.
+ class CallDispatchController {
+ public:
+ virtual ~CallDispatchController() = default;
+
+ // Called by the channel to decide if it should retry the call upon a
+ // failure.
+ virtual bool ShouldRetry() = 0;
+
+ // Called by the channel when no more LB picks will be performed for
+ // the call.
+ virtual void Commit() = 0;
+ };
+
struct GetCallConfigArgs {
grpc_slice* path;
grpc_metadata_batch* initial_metadata;
@@ -52,7 +67,7 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
struct CallConfig {
// Can be set to indicate the call should be failed.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// The per-method parsed configs that will be passed to
// ServiceConfigCallData.
const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
@@ -60,11 +75,9 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
// the call to ensure that method_configs lives long enough.
RefCountedPtr<ServiceConfig> service_config;
// Call attributes that will be accessible to LB policy implementations.
- std::map<const char*, y_absl::string_view> call_attributes;
- // A callback that, if set, will be invoked when the call is
- // committed (i.e., when we know that we will never again need to
- // ask the picker for a subchannel for this call).
- std::function<void()> on_call_committed;
+ ServiceConfigCallData::CallAttributes call_attributes;
+ // Call dispatch controller.
+ CallDispatchController* call_dispatch_controller = nullptr;
};
~ConfigSelector() override = default;
@@ -85,7 +98,6 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
// The channel will call this when the resolver returns a new ConfigSelector
// to determine what set of dynamic filters will be configured.
virtual std::vector<const grpc_channel_filter*> GetFilters() { return {}; }
-
// Modifies channel args to be passed to the dynamic filter stack.
// Takes ownership of argument. Caller takes ownership of result.
virtual grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/connector.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/connector.h
index 256471456e3..3e193be4cd2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/connector.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/connector.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
@@ -35,6 +33,8 @@ namespace grpc_core {
class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
public:
struct Args {
+ // Address to connect to.
+ grpc_resolved_address* address;
// Set of pollsets interested in this connection.
grpc_pollset_set* interested_parties;
// Deadline for connection.
@@ -66,7 +66,7 @@ class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
// Cancels any in-flight connection attempt and shuts down the
// connector.
- virtual void Shutdown(grpc_error* error) = 0;
+ virtual void Shutdown(grpc_error_handle error) = 0;
void Orphan() override {
Shutdown(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Subchannel disconnected"));
@@ -76,4 +76,4 @@ class SubchannelConnector : public InternallyRefCounted<SubchannelConnector> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_CONNECTOR_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
index 1286fcec42c..2956002d166 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.cc
@@ -37,7 +37,7 @@ namespace grpc_core {
// DynamicFilters::Call
//
-DynamicFilters::Call::Call(Args args, grpc_error** error)
+DynamicFilters::Call::Call(Args args, grpc_error_handle* error)
: channel_stack_(std::move(args.channel_stack)) {
grpc_call_stack* call_stack = CALL_TO_CALL_STACK(this);
const grpc_call_element_args call_args = {
@@ -53,8 +53,7 @@ DynamicFilters::Call::Call(Args args, grpc_error** error)
*error = grpc_call_stack_init(channel_stack_->channel_stack_, 1, Destroy,
this, &call_args);
if (GPR_UNLIKELY(*error != GRPC_ERROR_NONE)) {
- const char* error_string = grpc_error_string(*error);
- gpr_log(GPR_ERROR, "error: %s", error_string);
+ gpr_log(GPR_ERROR, "error: %s", grpc_error_std_string(*error).c_str());
return;
}
grpc_call_stack_set_pollset_or_pollset_set(call_stack, args.pollent);
@@ -80,7 +79,7 @@ RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref() {
}
RefCountedPtr<DynamicFilters::Call> DynamicFilters::Call::Ref(
- const grpc_core::DebugLocation& location, const char* reason) {
+ const DebugLocation& location, const char* reason) {
IncrementRefCount(location, reason);
return RefCountedPtr<DynamicFilters::Call>(this);
}
@@ -94,7 +93,7 @@ void DynamicFilters::Call::Unref(const DebugLocation& /*location*/,
GRPC_CALL_STACK_UNREF(CALL_TO_CALL_STACK(this), reason);
}
-void DynamicFilters::Call::Destroy(void* arg, grpc_error* /*error*/) {
+void DynamicFilters::Call::Destroy(void* arg, grpc_error_handle /*error*/) {
DynamicFilters::Call* self = static_cast<DynamicFilters::Call*>(arg);
// Keep some members before destroying the subchannel call.
grpc_closure* after_call_stack_destroy = self->after_call_stack_destroy_;
@@ -113,8 +112,8 @@ void DynamicFilters::Call::IncrementRefCount() {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), "");
}
-void DynamicFilters::Call::IncrementRefCount(
- const grpc_core::DebugLocation& /*location*/, const char* reason) {
+void DynamicFilters::Call::IncrementRefCount(const DebugLocation& /*location*/,
+ const char* reason) {
GRPC_CALL_STACK_REF(CALL_TO_CALL_STACK(this), reason);
}
@@ -124,13 +123,13 @@ void DynamicFilters::Call::IncrementRefCount(
namespace {
-void DestroyChannelStack(void* arg, grpc_error* /*error*/) {
+void DestroyChannelStack(void* arg, grpc_error_handle /*error*/) {
grpc_channel_stack* channel_stack = static_cast<grpc_channel_stack*>(arg);
grpc_channel_stack_destroy(channel_stack);
gpr_free(channel_stack);
}
-std::pair<grpc_channel_stack*, grpc_error*> CreateChannelStack(
+std::pair<grpc_channel_stack*, grpc_error_handle> CreateChannelStack(
const grpc_channel_args* args,
std::vector<const grpc_channel_filter*> filters) {
// Allocate memory for channel stack.
@@ -139,13 +138,13 @@ std::pair<grpc_channel_stack*, grpc_error*> CreateChannelStack(
grpc_channel_stack* channel_stack =
reinterpret_cast<grpc_channel_stack*>(gpr_zalloc(channel_stack_size));
// Initialize stack.
- grpc_error* error = grpc_channel_stack_init(
+ grpc_error_handle error = grpc_channel_stack_init(
/*initial_refs=*/1, DestroyChannelStack, channel_stack, filters.data(),
filters.size(), args, /*optional_transport=*/nullptr, "DynamicFilters",
channel_stack);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error initializing client internal stack: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
grpc_channel_stack_destroy(channel_stack);
gpr_free(channel_stack);
return {nullptr, error};
@@ -163,8 +162,8 @@ RefCountedPtr<DynamicFilters> DynamicFilters::Create(
if (p.second != GRPC_ERROR_NONE) {
// Channel stack creation failed with requested filters.
// Create with lame filter instead.
- grpc_error* error = p.second;
- grpc_arg error_arg = MakeLameClientErrorArg(error);
+ grpc_error_handle error = p.second;
+ grpc_arg error_arg = MakeLameClientErrorArg(&error);
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &error_arg, 1);
GRPC_ERROR_UNREF(error);
@@ -180,12 +179,12 @@ DynamicFilters::~DynamicFilters() {
}
RefCountedPtr<DynamicFilters::Call> DynamicFilters::CreateCall(
- DynamicFilters::Call::Args args, grpc_error** error) {
+ DynamicFilters::Call::Args args, grpc_error_handle* error) {
size_t allocation_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Call)) +
channel_stack_->call_stack_size;
Call* call = static_cast<Call*>(args.arena->Alloc(allocation_size));
new (call) Call(std::move(args), error);
- return call;
+ return RefCountedPtr<DynamicFilters::Call>(call);
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
index bcdc6d3b61d..08a7f4985eb 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/dynamic_filters.h
@@ -46,7 +46,7 @@ class DynamicFilters : public RefCounted<DynamicFilters> {
CallCombiner* call_combiner;
};
- Call(Args args, grpc_error** error);
+ Call(Args args, grpc_error_handle* error);
// Continues processing a transport stream op batch.
void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
@@ -73,7 +73,7 @@ class DynamicFilters : public RefCounted<DynamicFilters> {
void IncrementRefCount();
void IncrementRefCount(const DebugLocation& location, const char* reason);
- static void Destroy(void* arg, grpc_error* error);
+ static void Destroy(void* arg, grpc_error_handle error);
RefCountedPtr<DynamicFilters> channel_stack_;
grpc_closure* after_call_stack_destroy_ = nullptr;
@@ -88,7 +88,7 @@ class DynamicFilters : public RefCounted<DynamicFilters> {
~DynamicFilters() override;
- RefCountedPtr<Call> CreateCall(Call::Args args, grpc_error** error);
+ RefCountedPtr<Call> CreateCall(Call::Args args, grpc_error_handle* error);
private:
grpc_channel_stack* channel_stack_;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
index fac9c25744c..3587df01d85 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/global_subchannel_pool.h
@@ -32,7 +32,6 @@ namespace grpc_core {
// should be only one instance of this class. Init() should be called once at
// the filter initialization time; Shutdown() should be called once at the
// filter shutdown time.
-// TODO(juanlishen): Enable subchannel retention.
class GlobalSubchannelPool final : public SubchannelPoolInterface {
public:
// The ctor and dtor are not intended to use directly.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
index f234c230a89..c6b07bcf92e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/client_channel/health/health_check_client.h"
+
#include <stdint.h>
#include <stdio.h>
-#include "src/core/ext/filters/client_channel/health/health_check_client.h"
-
#include "upb/upb.hpp"
#include "src/core/lib/debug/trace.h"
@@ -157,7 +157,7 @@ void HealthCheckClient::StartRetryTimerLocked() {
grpc_timer_init(&retry_timer_, next_try, &retry_timer_callback_);
}
-void HealthCheckClient::OnRetryTimer(void* arg, grpc_error* error) {
+void HealthCheckClient::OnRetryTimer(void* arg, grpc_error_handle error) {
HealthCheckClient* self = static_cast<HealthCheckClient*>(arg);
{
MutexLock lock(&self->mu_);
@@ -202,7 +202,7 @@ void EncodeRequest(const TString& service_name,
// Returns true if healthy.
// If there was an error parsing the response, sets *error and returns false.
-bool DecodeResponse(grpc_slice_buffer* slice_buffer, grpc_error** error) {
+bool DecodeResponse(grpc_slice_buffer* slice_buffer, grpc_error_handle* error) {
// If message is empty, assume unhealthy.
if (slice_buffer->length == 0) {
*error =
@@ -254,7 +254,11 @@ HealthCheckClient::CallState::CallState(
pollent_(grpc_polling_entity_create_from_pollset_set(interested_parties)),
arena_(Arena::Create(health_check_client_->connected_subchannel_
->GetInitialCallSizeEstimate())),
- payload_(context_) {}
+ payload_(context_),
+ send_initial_metadata_(arena_),
+ send_trailing_metadata_(arena_),
+ recv_initial_metadata_(arena_),
+ recv_trailing_metadata_(arena_) {}
HealthCheckClient::CallState::~CallState() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
@@ -269,11 +273,8 @@ HealthCheckClient::CallState::~CallState() {
// Unset the call combiner cancellation closure. This has the
// effect of scheduling the previously set cancellation closure, if
// any, so that it can release any internal references it may be
- // holding to the call stack. Also flush the closures on exec_ctx so that
- // filters that schedule cancel notification closures on exec_ctx do not
- // need to take a ref of the call stack to guarantee closure liveness.
+ // holding to the call stack.
call_combiner_.SetNotifyOnCancel(nullptr);
- ExecCtx::Get()->Flush();
arena_->Destroy();
}
@@ -293,7 +294,7 @@ void HealthCheckClient::CallState::StartCall() {
context_,
&call_combiner_,
};
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
call_ = SubchannelCall::Create(std::move(args), &error).release();
// Register after-destruction callback.
GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
@@ -304,7 +305,8 @@ void HealthCheckClient::CallState::StartCall() {
gpr_log(GPR_ERROR,
"HealthCheckClient %p CallState %p: error creating health "
"checking call on subchannel (%s); will retry",
- health_check_client_.get(), this, grpc_error_string(error));
+ health_check_client_.get(), this,
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
CallEndedLocked(/*retry=*/true);
return;
@@ -317,7 +319,6 @@ void HealthCheckClient::CallState::StartCall() {
batch_.on_complete = GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this,
grpc_schedule_on_exec_ctx);
// Add send_initial_metadata op.
- grpc_metadata_batch_init(&send_initial_metadata_);
error = grpc_metadata_batch_add_head(
&send_initial_metadata_, &path_metadata_storage_,
grpc_mdelem_from_slices(
@@ -335,12 +336,10 @@ void HealthCheckClient::CallState::StartCall() {
payload_.send_message.send_message.reset(send_message_.get());
batch_.send_message = true;
// Add send_trailing_metadata op.
- grpc_metadata_batch_init(&send_trailing_metadata_);
payload_.send_trailing_metadata.send_trailing_metadata =
&send_trailing_metadata_;
batch_.send_trailing_metadata = true;
// Add recv_initial_metadata op.
- grpc_metadata_batch_init(&recv_initial_metadata_);
payload_.recv_initial_metadata.recv_initial_metadata =
&recv_initial_metadata_;
payload_.recv_initial_metadata.recv_flags = nullptr;
@@ -354,6 +353,7 @@ void HealthCheckClient::CallState::StartCall() {
batch_.recv_initial_metadata = true;
// Add recv_message op.
payload_.recv_message.recv_message = &recv_message_;
+ payload_.recv_message.call_failed_before_recv_message = nullptr;
// recv_message callback takes ref, handled manually.
call_->Ref(DEBUG_LOCATION, "recv_message_ready").release();
payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
@@ -364,7 +364,6 @@ void HealthCheckClient::CallState::StartCall() {
// Initialize recv_trailing_metadata batch.
recv_trailing_metadata_batch_.payload = &payload_;
// Add recv_trailing_metadata op.
- grpc_metadata_batch_init(&recv_trailing_metadata_);
payload_.recv_trailing_metadata.recv_trailing_metadata =
&recv_trailing_metadata_;
payload_.recv_trailing_metadata.collect_stats = &collect_stats_;
@@ -381,7 +380,7 @@ void HealthCheckClient::CallState::StartCall() {
}
void HealthCheckClient::CallState::StartBatchInCallCombiner(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
SubchannelCall* call =
@@ -399,14 +398,14 @@ void HealthCheckClient::CallState::StartBatch(
}
void HealthCheckClient::CallState::AfterCallStackDestruction(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
delete self;
}
-void HealthCheckClient::CallState::OnCancelComplete(void* arg,
- grpc_error* /*error*/) {
+void HealthCheckClient::CallState::OnCancelComplete(
+ void* arg, grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "health_cancel");
@@ -414,7 +413,7 @@ void HealthCheckClient::CallState::OnCancelComplete(void* arg,
}
void HealthCheckClient::CallState::StartCancel(void* arg,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
auto* batch = grpc_make_transport_stream_op(
@@ -426,8 +425,9 @@ void HealthCheckClient::CallState::StartCancel(void* arg,
void HealthCheckClient::CallState::Cancel() {
bool expected = false;
- if (cancelled_.CompareExchangeStrong(&expected, true, MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE)) {
+ if (cancelled_.compare_exchange_strong(expected, true,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
call_->Ref(DEBUG_LOCATION, "cancel").release();
GRPC_CALL_COMBINER_START(
&call_combiner_,
@@ -437,25 +437,26 @@ void HealthCheckClient::CallState::Cancel() {
}
void HealthCheckClient::CallState::OnComplete(void* arg,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "on_complete");
- grpc_metadata_batch_destroy(&self->send_initial_metadata_);
- grpc_metadata_batch_destroy(&self->send_trailing_metadata_);
+ self->send_initial_metadata_.Clear();
+ self->send_trailing_metadata_.Clear();
self->call_->Unref(DEBUG_LOCATION, "on_complete");
}
void HealthCheckClient::CallState::RecvInitialMetadataReady(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_initial_metadata_ready");
- grpc_metadata_batch_destroy(&self->recv_initial_metadata_);
+ self->recv_initial_metadata_.Clear();
self->call_->Unref(DEBUG_LOCATION, "recv_initial_metadata_ready");
}
-void HealthCheckClient::CallState::DoneReadingRecvMessage(grpc_error* error) {
+void HealthCheckClient::CallState::DoneReadingRecvMessage(
+ grpc_error_handle error) {
recv_message_.reset();
if (error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(error);
@@ -467,11 +468,11 @@ void HealthCheckClient::CallState::DoneReadingRecvMessage(grpc_error* error) {
const bool healthy = DecodeResponse(&recv_message_buffer_, &error);
const grpc_connectivity_state state =
healthy ? GRPC_CHANNEL_READY : GRPC_CHANNEL_TRANSIENT_FAILURE;
- const char* reason = error == GRPC_ERROR_NONE && !healthy
- ? "backend unhealthy"
- : grpc_error_string(error);
- health_check_client_->SetHealthStatus(state, reason);
- seen_response_.Store(true, MemoryOrder::RELEASE);
+ health_check_client_->SetHealthStatus(
+ state, error == GRPC_ERROR_NONE && !healthy
+ ? "backend unhealthy"
+ : grpc_error_std_string(error).c_str());
+ seen_response_.store(true, std::memory_order_release);
grpc_slice_buffer_destroy_internal(&recv_message_buffer_);
// Start another recv_message batch.
// This re-uses the ref we're holding.
@@ -479,15 +480,16 @@ void HealthCheckClient::CallState::DoneReadingRecvMessage(grpc_error* error) {
// callbacks from the original batch have completed yet.
recv_message_batch_.payload = &payload_;
payload_.recv_message.recv_message = &recv_message_;
+ payload_.recv_message.call_failed_before_recv_message = nullptr;
payload_.recv_message.recv_message_ready = GRPC_CLOSURE_INIT(
&recv_message_ready_, RecvMessageReady, this, grpc_schedule_on_exec_ctx);
recv_message_batch_.recv_message = true;
StartBatch(&recv_message_batch_);
}
-grpc_error* HealthCheckClient::CallState::PullSliceFromRecvMessage() {
+grpc_error_handle HealthCheckClient::CallState::PullSliceFromRecvMessage() {
grpc_slice slice;
- grpc_error* error = recv_message_->Pull(&slice);
+ grpc_error_handle error = recv_message_->Pull(&slice);
if (error == GRPC_ERROR_NONE) {
grpc_slice_buffer_add(&recv_message_buffer_, slice);
}
@@ -496,7 +498,7 @@ grpc_error* HealthCheckClient::CallState::PullSliceFromRecvMessage() {
void HealthCheckClient::CallState::ContinueReadingRecvMessage() {
while (recv_message_->Next(SIZE_MAX, &recv_message_ready_)) {
- grpc_error* error = PullSliceFromRecvMessage();
+ grpc_error_handle error = PullSliceFromRecvMessage();
if (error != GRPC_ERROR_NONE) {
DoneReadingRecvMessage(error);
return;
@@ -509,7 +511,7 @@ void HealthCheckClient::CallState::ContinueReadingRecvMessage() {
}
void HealthCheckClient::CallState::OnByteStreamNext(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
if (error != GRPC_ERROR_NONE) {
@@ -528,8 +530,8 @@ void HealthCheckClient::CallState::OnByteStreamNext(void* arg,
}
}
-void HealthCheckClient::CallState::RecvMessageReady(void* arg,
- grpc_error* /*error*/) {
+void HealthCheckClient::CallState::RecvMessageReady(
+ void* arg, grpc_error_handle /*error*/) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
GRPC_CALL_COMBINER_STOP(&self->call_combiner_, "recv_message_ready");
@@ -545,7 +547,7 @@ void HealthCheckClient::CallState::RecvMessageReady(void* arg,
}
void HealthCheckClient::CallState::RecvTrailingMetadataReady(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
HealthCheckClient::CallState* self =
static_cast<HealthCheckClient::CallState*>(arg);
GRPC_CALL_COMBINER_STOP(&self->call_combiner_,
@@ -556,9 +558,10 @@ void HealthCheckClient::CallState::RecvTrailingMetadataReady(
grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, &status,
nullptr /* slice */, nullptr /* http_error */,
nullptr /* error_string */);
- } else if (self->recv_trailing_metadata_.idx.named.grpc_status != nullptr) {
+ } else if (self->recv_trailing_metadata_.legacy_index()->named.grpc_status !=
+ nullptr) {
status = grpc_get_status_code_from_metadata(
- self->recv_trailing_metadata_.idx.named.grpc_status->md);
+ self->recv_trailing_metadata_.legacy_index()->named.grpc_status->md);
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_health_check_client_trace)) {
gpr_log(GPR_INFO,
@@ -567,7 +570,7 @@ void HealthCheckClient::CallState::RecvTrailingMetadataReady(
self->health_check_client_.get(), self, status);
}
// Clean up.
- grpc_metadata_batch_destroy(&self->recv_trailing_metadata_);
+ self->recv_trailing_metadata_.Clear();
// For status UNIMPLEMENTED, give up and assume always healthy.
bool retry = true;
if (status == GRPC_STATUS_UNIMPLEMENTED) {
@@ -597,7 +600,7 @@ void HealthCheckClient::CallState::CallEndedLocked(bool retry) {
health_check_client_->call_state_.reset();
if (retry) {
GPR_ASSERT(!health_check_client_->shutting_down_);
- if (seen_response_.Load(MemoryOrder::ACQUIRE)) {
+ if (seen_response_.load(std::memory_order_acquire)) {
// If the call fails after we've gotten a successful response, reset
// the backoff and restart the call immediately.
health_check_client_->retry_backoff_.Reset();
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
index f53e9828d33..d70c02406be 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/health/health_check_client.h
@@ -21,6 +21,8 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
+
#include <grpc/grpc.h>
#include <grpc/support/sync.h>
@@ -28,7 +30,6 @@
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/gprpp/arena.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
@@ -64,36 +65,36 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
void Orphan() override;
- void StartCall();
+ void StartCall() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&HealthCheckClient::mu_);
private:
void Cancel();
void StartBatch(grpc_transport_stream_op_batch* batch);
- static void StartBatchInCallCombiner(void* arg, grpc_error* error);
+ static void StartBatchInCallCombiner(void* arg, grpc_error_handle error);
- // Requires holding health_check_client_->mu_.
- void CallEndedLocked(bool retry);
+ void CallEndedLocked(bool retry)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(health_check_client_->mu_);
- static void OnComplete(void* arg, grpc_error* error);
- static void RecvInitialMetadataReady(void* arg, grpc_error* error);
- static void RecvMessageReady(void* arg, grpc_error* error);
- static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
- static void StartCancel(void* arg, grpc_error* error);
- static void OnCancelComplete(void* arg, grpc_error* error);
+ static void OnComplete(void* arg, grpc_error_handle error);
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+ static void RecvMessageReady(void* arg, grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
+ static void StartCancel(void* arg, grpc_error_handle error);
+ static void OnCancelComplete(void* arg, grpc_error_handle error);
- static void OnByteStreamNext(void* arg, grpc_error* error);
+ static void OnByteStreamNext(void* arg, grpc_error_handle error);
void ContinueReadingRecvMessage();
- grpc_error* PullSliceFromRecvMessage();
- void DoneReadingRecvMessage(grpc_error* error);
+ grpc_error_handle PullSliceFromRecvMessage();
+ void DoneReadingRecvMessage(grpc_error_handle error);
- static void AfterCallStackDestruction(void* arg, grpc_error* error);
+ static void AfterCallStackDestruction(void* arg, grpc_error_handle error);
RefCountedPtr<HealthCheckClient> health_check_client_;
grpc_polling_entity pollent_;
Arena* arena_;
- grpc_core::CallCombiner call_combiner_;
+ CallCombiner call_combiner_;
grpc_call_context_element context_[GRPC_CONTEXT_COUNT] = {};
// The streaming call to the backend. Always non-null.
@@ -126,29 +127,29 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
OrphanablePtr<ByteStream> recv_message_;
grpc_closure recv_message_ready_;
grpc_slice_buffer recv_message_buffer_;
- Atomic<bool> seen_response_{false};
+ std::atomic<bool> seen_response_{false};
+
+ // True if the cancel_stream batch has been started.
+ std::atomic<bool> cancelled_{false};
// recv_trailing_metadata
grpc_metadata_batch recv_trailing_metadata_;
grpc_transport_stream_stats collect_stats_;
grpc_closure recv_trailing_metadata_ready_;
- // True if the cancel_stream batch has been started.
- Atomic<bool> cancelled_{false};
-
// Closure for call stack destruction.
grpc_closure after_call_stack_destruction_;
};
void StartCall();
- void StartCallLocked(); // Requires holding mu_.
+ void StartCallLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- void StartRetryTimerLocked(); // Requires holding mu_.
- static void OnRetryTimer(void* arg, grpc_error* error);
+ void StartRetryTimerLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ static void OnRetryTimer(void* arg, grpc_error_handle error);
void SetHealthStatus(grpc_connectivity_state state, const char* reason);
- void SetHealthStatusLocked(grpc_connectivity_state state,
- const char* reason); // Requires holding mu_.
+ void SetHealthStatusLocked(grpc_connectivity_state state, const char* reason)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
TString service_name_;
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
@@ -156,18 +157,19 @@ class HealthCheckClient : public InternallyRefCounted<HealthCheckClient> {
RefCountedPtr<channelz::SubchannelNode> channelz_node_;
Mutex mu_;
- RefCountedPtr<ConnectivityStateWatcherInterface> watcher_;
- bool shutting_down_ = false;
+ RefCountedPtr<ConnectivityStateWatcherInterface> watcher_
+ Y_ABSL_GUARDED_BY(mu_);
+ bool shutting_down_ Y_ABSL_GUARDED_BY(mu_) = false;
// The data associated with the current health check call. It holds a ref
// to this HealthCheckClient object.
- OrphanablePtr<CallState> call_state_;
+ OrphanablePtr<CallState> call_state_ Y_ABSL_GUARDED_BY(mu_);
// Call retry state.
- BackOff retry_backoff_;
- grpc_timer retry_timer_;
- grpc_closure retry_timer_callback_;
- bool retry_timer_callback_pending_ = false;
+ BackOff retry_backoff_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_timer retry_timer_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_closure retry_timer_callback_ Y_ABSL_GUARDED_BY(mu_);
+ bool retry_timer_callback_pending_ Y_ABSL_GUARDED_BY(mu_) = false;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index 79b4ccf2056..3b963f0fe99 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.cc
@@ -32,7 +32,9 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/http/format_request.h"
@@ -47,7 +49,7 @@ namespace {
class HttpConnectHandshaker : public Handshaker {
public:
HttpConnectHandshaker();
- void Shutdown(grpc_error* why) override;
+ void Shutdown(grpc_error_handle why) override;
void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
HandshakerArgs* args) override;
@@ -55,30 +57,31 @@ class HttpConnectHandshaker : public Handshaker {
private:
~HttpConnectHandshaker() override;
- void CleanupArgsForFailureLocked();
- void HandshakeFailedLocked(grpc_error* error);
- static void OnWriteDone(void* arg, grpc_error* error);
- static void OnReadDone(void* arg, grpc_error* error);
- static void OnWriteDoneScheduler(void* arg, grpc_error* error);
- static void OnReadDoneScheduler(void* arg, grpc_error* error);
+ void CleanupArgsForFailureLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ void HandshakeFailedLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ static void OnWriteDone(void* arg, grpc_error_handle error);
+ static void OnReadDone(void* arg, grpc_error_handle error);
+ static void OnWriteDoneScheduler(void* arg, grpc_error_handle error);
+ static void OnReadDoneScheduler(void* arg, grpc_error_handle error);
Mutex mu_;
- bool is_shutdown_ = false;
+ bool is_shutdown_ Y_ABSL_GUARDED_BY(mu_) = false;
// Endpoint and read buffer to destroy after a shutdown.
- grpc_endpoint* endpoint_to_destroy_ = nullptr;
- grpc_slice_buffer* read_buffer_to_destroy_ = nullptr;
+ grpc_endpoint* endpoint_to_destroy_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ grpc_slice_buffer* read_buffer_to_destroy_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
// State saved while performing the handshake.
HandshakerArgs* args_ = nullptr;
grpc_closure* on_handshake_done_ = nullptr;
// Objects for processing the HTTP CONNECT request and response.
- grpc_slice_buffer write_buffer_;
- grpc_closure request_done_closure_;
- grpc_closure response_read_closure_;
- grpc_http_parser http_parser_;
- grpc_http_response http_response_;
+ grpc_slice_buffer write_buffer_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_closure request_done_closure_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_closure response_read_closure_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_http_parser http_parser_ Y_ABSL_GUARDED_BY(mu_);
+ grpc_http_response http_response_ Y_ABSL_GUARDED_BY(mu_);
};
HttpConnectHandshaker::~HttpConnectHandshaker() {
@@ -107,7 +110,7 @@ void HttpConnectHandshaker::CleanupArgsForFailureLocked() {
// If the handshake failed or we're shutting down, clean up and invoke the
// callback with the error.
-void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error* error) {
+void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) {
// If we were shut down after an endpoint operation succeeded but
// before the endpoint callback was invoked, we need to generate our
@@ -133,18 +136,18 @@ void HttpConnectHandshaker::HandshakeFailedLocked(grpc_error* error) {
// This callback can be invoked inline while already holding onto the mutex. To
// avoid deadlocks, schedule OnWriteDone on ExecCtx.
-void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg, grpc_error* error) {
+void HttpConnectHandshaker::OnWriteDoneScheduler(void* arg,
+ grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_INIT(&handshaker->request_done_closure_,
- &HttpConnectHandshaker::OnWriteDone, handshaker,
- grpc_schedule_on_exec_ctx),
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&handshaker->request_done_closure_,
+ &HttpConnectHandshaker::OnWriteDone,
+ handshaker, grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_REF(error));
}
// Callback invoked when finished writing HTTP CONNECT request.
-void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error* error) {
+void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
ReleasableMutexLock lock(&handshaker->mu_);
if (error != GRPC_ERROR_NONE || handshaker->is_shutdown_) {
@@ -167,18 +170,18 @@ void HttpConnectHandshaker::OnWriteDone(void* arg, grpc_error* error) {
// This callback can be invoked inline while already holding onto the mutex. To
// avoid deadlocks, schedule OnReadDone on ExecCtx.
-void HttpConnectHandshaker::OnReadDoneScheduler(void* arg, grpc_error* error) {
+void HttpConnectHandshaker::OnReadDoneScheduler(void* arg,
+ grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION,
- GRPC_CLOSURE_INIT(&handshaker->response_read_closure_,
- &HttpConnectHandshaker::OnReadDone, handshaker,
- grpc_schedule_on_exec_ctx),
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&handshaker->response_read_closure_,
+ &HttpConnectHandshaker::OnReadDone, handshaker,
+ grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_REF(error));
}
// Callback invoked for reading HTTP CONNECT response.
-void HttpConnectHandshaker::OnReadDone(void* arg, grpc_error* error) {
+void HttpConnectHandshaker::OnReadDone(void* arg, grpc_error_handle error) {
auto* handshaker = static_cast<HttpConnectHandshaker*>(arg);
ReleasableMutexLock lock(&handshaker->mu_);
if (error != GRPC_ERROR_NONE || handshaker->is_shutdown_) {
@@ -243,10 +246,9 @@ void HttpConnectHandshaker::OnReadDone(void* arg, grpc_error* error) {
// Make sure we got a 2xx response.
if (handshaker->http_response_.status < 200 ||
handshaker->http_response_.status >= 300) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("HTTP proxy returned response code ",
- handshaker->http_response_.status)
- .c_str());
+ handshaker->http_response_.status));
handshaker->HandshakeFailedLocked(error);
goto done;
}
@@ -264,7 +266,7 @@ done:
// Public handshaker methods
//
-void HttpConnectHandshaker::Shutdown(grpc_error* why) {
+void HttpConnectHandshaker::Shutdown(grpc_error_handle why) {
{
MutexLock lock(&mu_);
if (!is_shutdown_) {
@@ -379,10 +381,10 @@ class HttpConnectHandshakerFactory : public HandshakerFactory {
} // namespace
-} // namespace grpc_core
-
-void grpc_http_connect_register_handshaker_factory() {
- grpc_core::HandshakerRegistry::RegisterHandshakerFactory(
- true /* at_start */, grpc_core::HANDSHAKER_CLIENT,
- y_absl::make_unique<grpc_core::HttpConnectHandshakerFactory>());
+void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder) {
+ builder->handshaker_registry()->RegisterHandshakerFactory(
+ true /* at_start */, HANDSHAKER_CLIENT,
+ y_absl::make_unique<HttpConnectHandshakerFactory>());
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
index 26c31f2a0ab..d23ce910999 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_connect_handshaker.h
@@ -19,6 +19,10 @@
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/config/core_configuration.h"
+
/// Channel arg indicating the server in HTTP CONNECT request (string).
/// The presence of this arg triggers the use of HTTP CONNECT.
#define GRPC_ARG_HTTP_CONNECT_SERVER "grpc.http_connect_server"
@@ -28,7 +32,11 @@
/// separated by colons.
#define GRPC_ARG_HTTP_CONNECT_HEADERS "grpc.http_connect_headers"
-/// Registers handshaker factory.
-void grpc_http_connect_register_handshaker_factory();
+namespace grpc_core {
+
+// Register the HTTP Connect handshaker into the configuration builder.
+void RegisterHttpConnectHandshaker(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_HTTP_CONNECT_HANDSHAKER_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
index 8658b10b770..3484b664680 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/http_proxy.cc
@@ -36,6 +36,7 @@
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -107,6 +108,17 @@ done:
return proxy_name;
}
+// Adds the default port if target does not contain a port.
+TString MaybeAddDefaultPort(y_absl::string_view target) {
+ y_absl::string_view host;
+ y_absl::string_view port;
+ SplitHostPort(target, &host, &port);
+ if (port.empty()) {
+ return JoinHostPort(host, kDefaultSecurePortInt);
+ }
+ return TString(target);
+}
+
class HttpProxyMapper : public ProxyMapperInterface {
public:
bool MapName(const char* server_uri, const grpc_channel_args* args,
@@ -118,6 +130,7 @@ class HttpProxyMapper : public ProxyMapperInterface {
*name_to_resolve = GetHttpProxyServer(args, &user_cred);
if (*name_to_resolve == nullptr) return false;
char* no_proxy_str = nullptr;
+ TString server_target;
y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
if (!uri.ok() || uri->path().empty()) {
gpr_log(GPR_ERROR,
@@ -173,10 +186,12 @@ class HttpProxyMapper : public ProxyMapperInterface {
if (!use_proxy) goto no_use_proxy;
}
}
+ server_target =
+ MaybeAddDefaultPort(y_absl::StripPrefix(uri->path(), "/")).c_str();
grpc_arg args_to_add[2];
args_to_add[0] = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_HTTP_CONNECT_SERVER),
- const_cast<char*>(y_absl::StripPrefix(uri->path(), "/").data()));
+ const_cast<char*>(server_target.c_str()));
if (user_cred != nullptr) {
/* Use base64 encoding for user credentials as stated in RFC 7617 */
char* encoded_user_cred =
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
index 5470df8e121..44363b4ac97 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.cc
@@ -113,7 +113,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
auto* parent = parent_->Ref().release(); // ref held by lambda.
ExecCtx::Run(DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
+ [](void* arg, grpc_error_handle /*error*/) {
auto* parent = static_cast<LoadBalancingPolicy*>(arg);
parent->work_serializer()->Run(
[parent]() {
@@ -125,21 +125,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
parent, nullptr),
GRPC_ERROR_NONE);
}
- PickResult result;
- result.type = PickResult::PICK_QUEUE;
- return result;
-}
-
-//
-// LoadBalancingPolicy::TransientFailurePicker
-//
-
-LoadBalancingPolicy::PickResult
-LoadBalancingPolicy::TransientFailurePicker::Pick(PickArgs /*args*/) {
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error = GRPC_ERROR_REF(error_);
- return result;
+ return PickResult::Queue();
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
index 10f964a2b49..e88ad554f38 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_H
@@ -26,9 +24,9 @@
#include "y_absl/status/status.h"
#include "y_absl/strings/string_view.h"
+#include "y_absl/types/variant.h"
#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -81,26 +79,6 @@ extern DebugOnlyTraceFlag grpc_trace_lb_policy_refcount;
// interested_parties() hooks from the API.
class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
public:
- // Represents backend metrics reported by the backend to the client.
- struct BackendMetricData {
- /// CPU utilization expressed as a fraction of available CPU resources.
- double cpu_utilization;
- /// Memory utilization expressed as a fraction of available memory
- /// resources.
- double mem_utilization;
- /// Total requests per second being served by the backend. This
- /// should include all services that a backend is responsible for.
- uint64_t requests_per_second;
- /// Application-specific requests cost metrics. Metric names are
- /// determined by the application. Each value is an absolute cost
- /// (e.g. 3487 bytes of storage) associated with the request.
- std::map<y_absl::string_view, double> request_cost;
- /// Application-specific resource utilization metrics. Metric names
- /// are determined by the application. Each value is expressed as a
- /// fraction of total resources available.
- std::map<y_absl::string_view, double> utilization;
- };
-
/// Interface for accessing per-call state.
/// Implemented by the client channel and used by the SubchannelPicker.
class CallState {
@@ -114,13 +92,6 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// for allocations that need to be made on a per-call basis.
virtual void* Alloc(size_t size) = 0;
- /// Returns the backend metric data returned by the server for the call,
- /// or null if no backend metric data was returned.
- // TODO(roth): Move this out of CallState, since it should not be
- // accessible to the picker, only to the recv_trailing_metadata_ready
- // callback. It should instead be in its own interface.
- virtual const BackendMetricData* GetBackendMetricData() = 0;
-
/// EXPERIMENTAL API.
/// Returns the value of the call attribute \a key.
/// Keys are static strings, so an attribute can be accessed by an LB
@@ -133,35 +104,16 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Implemented by the client channel and used by the SubchannelPicker.
class MetadataInterface {
public:
- class iterator
- : public std::iterator<
- std::input_iterator_tag,
- std::pair<y_absl::string_view, y_absl::string_view>, // value_type
- std::ptrdiff_t, // difference_type
- std::pair<y_absl::string_view, y_absl::string_view>*, // pointer
- std::pair<y_absl::string_view, y_absl::string_view>& // reference
- > {
- public:
- iterator(const MetadataInterface* md, intptr_t handle)
- : md_(md), handle_(handle) {}
- iterator& operator++() {
- handle_ = md_->IteratorHandleNext(handle_);
- return *this;
- }
- bool operator==(iterator other) const {
- return md_ == other.md_ && handle_ == other.handle_;
- }
- bool operator!=(iterator other) const { return !(*this == other); }
- value_type operator*() const { return md_->IteratorHandleGet(handle_); }
-
- private:
- friend class MetadataInterface;
- const MetadataInterface* md_;
- intptr_t handle_;
- };
-
virtual ~MetadataInterface() = default;
+ //////////////////////////////////////////////////////////////////////////
+ // TODO(ctiller): DO NOT MAKE THIS A PUBLIC API YET
+ // This needs some API design to ensure we can add/remove/replace metadata
+ // keys... we're deliberately not doing so to save some time whilst
+ // cleaning up the internal metadata representation, but we should add
+ // something back before making this a public API.
+ //////////////////////////////////////////////////////////////////////////
+
/// Adds a key/value pair.
/// Does NOT take ownership of \a key or \a value.
/// Implementations must ensure that the key and value remain alive
@@ -169,23 +121,12 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// CallState::Alloc().
virtual void Add(y_absl::string_view key, y_absl::string_view value) = 0;
- /// Iteration interface.
- virtual iterator begin() const = 0;
- virtual iterator end() const = 0;
+ /// Produce a vector of metadata key/value strings for tests.
+ virtual std::vector<std::pair<TString, TString>>
+ TestOnlyCopyToVector() = 0;
- /// Removes the element pointed to by \a it.
- /// Returns an iterator pointing to the next element.
- virtual iterator erase(iterator it) = 0;
-
- protected:
- intptr_t GetIteratorHandle(const iterator& it) const { return it.handle_; }
-
- private:
- friend class iterator;
-
- virtual intptr_t IteratorHandleNext(intptr_t handle) const = 0;
- virtual std::pair<y_absl::string_view /*key*/, y_absl::string_view /*value */>
- IteratorHandleGet(intptr_t handle) const = 0;
+ virtual y_absl::optional<y_absl::string_view> Lookup(
+ y_absl::string_view key, TString* buffer) const = 0;
};
/// Arguments used when picking a subchannel for a call.
@@ -202,49 +143,116 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
CallState* call_state;
};
+ /// Interface for accessing backend metric data.
+ /// Implemented by the client channel and used by
+ /// SubchannelCallTrackerInterface.
+ class BackendMetricAccessor {
+ public:
+ // Represents backend metrics reported by the backend to the client.
+ struct BackendMetricData {
+ /// CPU utilization expressed as a fraction of available CPU resources.
+ double cpu_utilization;
+ /// Memory utilization expressed as a fraction of available memory
+ /// resources.
+ double mem_utilization;
+ /// Total requests per second being served by the backend. This
+ /// should include all services that a backend is responsible for.
+ uint64_t requests_per_second;
+ /// Application-specific requests cost metrics. Metric names are
+ /// determined by the application. Each value is an absolute cost
+ /// (e.g. 3487 bytes of storage) associated with the request.
+ std::map<y_absl::string_view, double> request_cost;
+ /// Application-specific resource utilization metrics. Metric names
+ /// are determined by the application. Each value is expressed as a
+ /// fraction of total resources available.
+ std::map<y_absl::string_view, double> utilization;
+ };
+
+ virtual ~BackendMetricAccessor() = default;
+
+ /// Returns the backend metric data returned by the server for the call,
+ /// or null if no backend metric data was returned.
+ virtual const BackendMetricData* GetBackendMetricData() = 0;
+ };
+
+ /// Interface for tracking subchannel calls.
+ /// Implemented by LB policy and used by the channel.
+ class SubchannelCallTrackerInterface {
+ public:
+ virtual ~SubchannelCallTrackerInterface() = default;
+
+ /// Called when a subchannel call is started after an LB pick.
+ virtual void Start() = 0;
+
+ /// Called when a subchannel call is completed.
+ /// The metadata may be modified by the implementation. However, the
+ /// implementation does not take ownership, so any data that needs to be
+ /// used after returning must be copied.
+ struct FinishArgs {
+ y_absl::Status status;
+ MetadataInterface* trailing_metadata;
+ BackendMetricAccessor* backend_metric_accessor;
+ };
+ virtual void Finish(FinishArgs args) = 0;
+ };
+
/// The result of picking a subchannel for a call.
struct PickResult {
- enum ResultType {
- /// Pick complete. If \a subchannel is non-null, the client channel
- /// will immediately proceed with the call on that subchannel;
- /// otherwise, it will drop the call.
- PICK_COMPLETE,
- /// Pick cannot be completed until something changes on the control
- /// plane. The client channel will queue the pick and try again the
- /// next time the picker is updated.
- PICK_QUEUE,
- /// Pick failed. If the call is wait_for_ready, the client channel
- /// will wait for the next picker and try again; otherwise, it
- /// will immediately fail the call with the status indicated via
- /// \a error (although the call may be retried if the client channel
- /// is configured to do so).
- PICK_FAILED,
+ /// A successful pick.
+ struct Complete {
+ /// The subchannel to be used for the call. Must be non-null.
+ RefCountedPtr<SubchannelInterface> subchannel;
+
+ /// Optionally set by the LB policy when it wishes to be notified
+ /// about the resulting subchannel call.
+ /// Note that if the pick is abandoned by the channel, this may never
+ /// be used.
+ std::unique_ptr<SubchannelCallTrackerInterface> subchannel_call_tracker;
+
+ explicit Complete(
+ RefCountedPtr<SubchannelInterface> sc,
+ std::unique_ptr<SubchannelCallTrackerInterface> tracker = nullptr)
+ : subchannel(std::move(sc)),
+ subchannel_call_tracker(std::move(tracker)) {}
+ };
+
+ /// Pick cannot be completed until something changes on the control
+ /// plane. The client channel will queue the pick and try again the
+ /// next time the picker is updated.
+ struct Queue {};
+
+ /// Pick failed. If the call is wait_for_ready, the client channel
+ /// will wait for the next picker and try again; otherwise, it
+ /// will immediately fail the call with the status indicated (although
+ /// the call may be retried if the client channel is configured to do so).
+ struct Fail {
+ y_absl::Status status;
+
+ explicit Fail(y_absl::Status s) : status(s) {}
};
- ResultType type;
-
- /// Used only if type is PICK_COMPLETE. Will be set to the selected
- /// subchannel, or nullptr if the LB policy decides to drop the call.
- RefCountedPtr<SubchannelInterface> subchannel;
-
- /// Used only if type is PICK_FAILED.
- /// Error to be set when returning a failure.
- // TODO(roth): Replace this with something similar to grpc::Status,
- // so that we don't expose grpc_error to this API.
- grpc_error* error = GRPC_ERROR_NONE;
-
- /// Used only if type is PICK_COMPLETE.
- /// Callback set by LB policy to be notified of trailing metadata.
- /// If set by LB policy, the client channel will invoke the callback
- /// when trailing metadata is returned.
- /// The metadata may be modified by the callback. However, the callback
- /// does not take ownership, so any data that needs to be used after
- /// returning must be copied.
- /// The call state can be used to obtain backend metric data.
- // TODO(roth): The arguments to this callback should be moved into a
- // struct, so that we can later add new fields without breaking
- // existing implementations.
- std::function<void(grpc_error*, MetadataInterface*, CallState*)>
- recv_trailing_metadata_ready;
+
+ /// Pick will be dropped with the status specified.
+ /// Unlike FailPick, the call will be dropped even if it is
+ /// wait_for_ready, and retries (if configured) will be inhibited.
+ struct Drop {
+ y_absl::Status status;
+
+ explicit Drop(y_absl::Status s) : status(s) {}
+ };
+
+ // A pick result must be one of these types.
+ // Default to Queue, just to allow default construction.
+ y_absl::variant<Complete, Queue, Fail, Drop> result = Queue();
+
+ PickResult() = default;
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Complete complete) : result(std::move(complete)) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Queue queue) : result(queue) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Fail fail) : result(std::move(fail)) {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ PickResult(Drop drop) : result(std::move(drop)) {}
};
/// A subchannel picker is the object used to pick the subchannel to
@@ -271,6 +279,11 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// A proxy object implemented by the client channel and used by the
/// LB policy to communicate with the channel.
+ // TODO(roth): Once insecure builds go away, add methods for accessing
+ // channel creds. By default, that should strip off the call creds
+ // attached to the channel creds, but there should also be a "use at
+ // your own risk" option to get the channel creds without stripping
+ // off the attached call creds.
class ChannelControlHelper {
public:
ChannelControlHelper() = default;
@@ -289,6 +302,9 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
/// Requests that the resolver re-resolve.
virtual void RequestReresolution() = 0;
+ /// Returns the channel authority.
+ virtual y_absl::string_view GetAuthority() = 0;
+
/// Adds a trace message associated with the channel.
enum TraceSeverity { TRACE_INFO, TRACE_WARNING, TRACE_ERROR };
virtual void AddTraceEvent(TraceSeverity severity,
@@ -367,7 +383,7 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
// Note: This must be invoked while holding the work_serializer.
void Orphan() override;
- // A picker that returns PICK_QUEUE for all picks.
+ // A picker that returns PickResult::Queue for all picks.
// Also calls the parent LB policy's ExitIdleLocked() method when the
// first pick is seen.
class QueuePicker : public SubchannelPicker {
@@ -384,16 +400,17 @@ class LoadBalancingPolicy : public InternallyRefCounted<LoadBalancingPolicy> {
bool exit_idle_called_ = false;
};
- // A picker that returns PICK_TRANSIENT_FAILURE for all picks.
+ // A picker that returns PickResult::Fail for all picks.
class TransientFailurePicker : public SubchannelPicker {
public:
- explicit TransientFailurePicker(grpc_error* error) : error_(error) {}
- ~TransientFailurePicker() override { GRPC_ERROR_UNREF(error_); }
+ explicit TransientFailurePicker(y_absl::Status status) : status_(status) {}
- PickResult Pick(PickArgs args) override;
+ PickResult Pick(PickArgs /*args*/) override {
+ return PickResult::Fail(status_);
+ }
private:
- grpc_error* error_;
+ y_absl::Status status_;
};
protected:
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
index 2ffd3ecbc1d..ab8cc7a8e5b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/child_policy_handler.cc
@@ -16,10 +16,10 @@
#include <grpc/support/port_platform.h>
-#include <cstring>
-
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include <cstring>
+
#include "y_absl/strings/str_cat.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
@@ -90,6 +90,10 @@ class ChildPolicyHandler::Helper
parent_->channel_control_helper()->RequestReresolution();
}
+ y_absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override {
if (parent_->shutting_down_) return;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
index c8d1b1d7af8..a3cf12ac7cf 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
@@ -30,8 +30,8 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
-static grpc_error* clr_init_channel_elem(grpc_channel_element* /*elem*/,
- grpc_channel_element_args* /*args*/) {
+static grpc_error_handle clr_init_channel_elem(
+ grpc_channel_element* /*elem*/, grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
@@ -54,7 +54,7 @@ struct call_data {
} // namespace
-static void on_complete_for_send(void* arg, grpc_error* error) {
+static void on_complete_for_send(void* arg, grpc_error_handle error) {
call_data* calld = static_cast<call_data*>(arg);
if (error == GRPC_ERROR_NONE) {
calld->send_initial_metadata_succeeded = true;
@@ -63,7 +63,7 @@ static void on_complete_for_send(void* arg, grpc_error* error) {
GRPC_ERROR_REF(error));
}
-static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
+static void recv_initial_metadata_ready(void* arg, grpc_error_handle error) {
call_data* calld = static_cast<call_data*>(arg);
if (error == GRPC_ERROR_NONE) {
calld->recv_initial_metadata_succeeded = true;
@@ -73,8 +73,8 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
GRPC_ERROR_REF(error));
}
-static grpc_error* clr_init_call_elem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+static grpc_error_handle clr_init_call_elem(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
GPR_ASSERT(args->context != nullptr);
new (elem->call_data) call_data();
return GRPC_ERROR_NONE;
@@ -101,20 +101,15 @@ static void clr_start_transport_stream_op_batch(
// Handle send_initial_metadata.
if (batch->send_initial_metadata) {
// Grab client stats object from metadata.
- grpc_linked_mdelem* client_stats_md =
- batch->payload->send_initial_metadata.send_initial_metadata->list.head;
- for (; client_stats_md != nullptr;
- client_stats_md = client_stats_md->next) {
- if (GRPC_SLICE_START_PTR(GRPC_MDKEY(client_stats_md->md)) ==
- static_cast<const void*>(grpc_core::kGrpcLbClientStatsMetadataKey)) {
- break;
- }
- }
- if (client_stats_md != nullptr) {
+ auto client_stats_md =
+ batch->payload->send_initial_metadata.send_initial_metadata->Remove(
+ grpc_slice_from_static_string(
+ grpc_core::kGrpcLbClientStatsMetadataKey));
+ if (client_stats_md.has_value()) {
grpc_core::GrpcLbClientStats* client_stats =
const_cast<grpc_core::GrpcLbClientStats*>(
reinterpret_cast<const grpc_core::GrpcLbClientStats*>(
- GRPC_SLICE_START_PTR(GRPC_MDVALUE(client_stats_md->md))));
+ GRPC_SLICE_START_PTR(*client_stats_md)));
if (client_stats != nullptr) {
calld->client_stats.reset(client_stats);
// Intercept completion.
@@ -123,10 +118,6 @@ static void clr_start_transport_stream_op_batch(
calld, grpc_schedule_on_exec_ctx);
batch->on_complete = &calld->on_complete_for_send;
}
- // Remove metadata so it doesn't go out on the wire.
- grpc_metadata_batch_remove(
- batch->payload->send_initial_metadata.send_initial_metadata,
- client_stats_md);
}
}
// Intercept completion of recv_initial_metadata.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index dbb2b5af2d9..113d7642524 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2016 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
/// Implementation of the gRPC LB policy.
///
@@ -51,14 +49,9 @@
/// \see https://github.com/grpc/grpc/blob/master/doc/load-balancing.md for the
/// high level design and details.
-// With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
-// using that endpoint. Because of various transitive includes in uv.h,
-// including windows.h on Windows, uv.h must be included before other system
-// headers. Therefore, sockaddr.h must always be included first.
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
#include <inttypes.h>
#include <limits.h>
@@ -69,7 +62,6 @@
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_join.h"
#include "y_absl/strings/strip.h"
-
#include "upb/upb.hpp"
#include <grpc/byte_buffer_reader.h>
@@ -81,7 +73,6 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.h"
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h"
@@ -90,23 +81,25 @@
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/static_metadata.h"
#define GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS 1
@@ -114,9 +107,7 @@
#define GRPC_GRPCLB_RECONNECT_MAX_BACKOFF_SECONDS 120
#define GRPC_GRPCLB_RECONNECT_JITTER 0.2
#define GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS 10000
-
-#define GRPC_ARG_GRPCLB_ADDRESS_LB_TOKEN "grpc.grpclb_address_lb_token"
-#define GRPC_ARG_GRPCLB_ADDRESS_CLIENT_STATS "grpc.grpclb_address_client_stats"
+#define GRPC_GRPCLB_DEFAULT_SUBCHANNEL_DELETION_DELAY_MS 10000
namespace grpc_core {
@@ -186,17 +177,17 @@ class GrpcLb : public LoadBalancingPolicy {
void ScheduleNextClientLoadReportLocked();
void SendClientLoadReportLocked();
- static void MaybeSendClientLoadReport(void* arg, grpc_error* error);
- static void ClientLoadReportDone(void* arg, grpc_error* error);
- static void OnInitialRequestSent(void* arg, grpc_error* error);
- static void OnBalancerMessageReceived(void* arg, grpc_error* error);
- static void OnBalancerStatusReceived(void* arg, grpc_error* error);
+ static void MaybeSendClientLoadReport(void* arg, grpc_error_handle error);
+ static void ClientLoadReportDone(void* arg, grpc_error_handle error);
+ static void OnInitialRequestSent(void* arg, grpc_error_handle error);
+ static void OnBalancerMessageReceived(void* arg, grpc_error_handle error);
+ static void OnBalancerStatusReceived(void* arg, grpc_error_handle error);
- void MaybeSendClientLoadReportLocked(grpc_error* error);
- void ClientLoadReportDoneLocked(grpc_error* error);
+ void MaybeSendClientLoadReportLocked(grpc_error_handle error);
+ void ClientLoadReportDoneLocked(grpc_error_handle error);
void OnInitialRequestSentLocked();
void OnBalancerMessageReceivedLocked();
- void OnBalancerStatusReceivedLocked(grpc_error* error);
+ void OnBalancerStatusReceivedLocked(grpc_error_handle error);
// The owning LB policy.
RefCountedPtr<LoadBalancingPolicy> grpclb_policy_;
@@ -239,16 +230,24 @@ class GrpcLb : public LoadBalancingPolicy {
class SubchannelWrapper : public DelegatingSubchannel {
public:
SubchannelWrapper(RefCountedPtr<SubchannelInterface> subchannel,
- TString lb_token,
+ RefCountedPtr<GrpcLb> lb_policy, TString lb_token,
RefCountedPtr<GrpcLbClientStats> client_stats)
: DelegatingSubchannel(std::move(subchannel)),
+ lb_policy_(std::move(lb_policy)),
lb_token_(std::move(lb_token)),
client_stats_(std::move(client_stats)) {}
+ ~SubchannelWrapper() override {
+ if (!lb_policy_->shutting_down_) {
+ lb_policy_->CacheDeletedSubchannelLocked(wrapped_subchannel());
+ }
+ }
+
const TString& lb_token() const { return lb_token_; }
GrpcLbClientStats* client_stats() const { return client_stats_.get(); }
private:
+ RefCountedPtr<GrpcLb> lb_policy_;
TString lb_token_;
RefCountedPtr<GrpcLbClientStats> client_stats_;
};
@@ -271,7 +270,7 @@ class GrpcLb : public LoadBalancingPolicy {
static_cast<const TokenAndClientStatsAttribute*>(other_base);
int r = lb_token_.compare(other->lb_token_);
if (r != 0) return r;
- return GPR_ICMP(client_stats_.get(), other->client_stats_.get());
+ return QsortCompare(client_stats_.get(), other->client_stats_.get());
}
TString ToString() const override {
@@ -357,6 +356,7 @@ class GrpcLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -410,14 +410,14 @@ class GrpcLb : public LoadBalancingPolicy {
// Methods for dealing with fallback state.
void MaybeEnterFallbackModeAfterStartup();
- static void OnFallbackTimer(void* arg, grpc_error* error);
- void OnFallbackTimerLocked(grpc_error* error);
+ static void OnFallbackTimer(void* arg, grpc_error_handle error);
+ void OnFallbackTimerLocked(grpc_error_handle error);
// Methods for dealing with the balancer call.
void StartBalancerCallLocked();
void StartBalancerCallRetryTimerLocked();
- static void OnBalancerCallRetryTimer(void* arg, grpc_error* error);
- void OnBalancerCallRetryTimerLocked(grpc_error* error);
+ static void OnBalancerCallRetryTimer(void* arg, grpc_error_handle error);
+ void OnBalancerCallRetryTimerLocked(grpc_error_handle error);
// Methods for dealing with the child policy.
grpc_channel_args* CreateChildPolicyArgsLocked(
@@ -426,6 +426,13 @@ class GrpcLb : public LoadBalancingPolicy {
const grpc_channel_args* args);
void CreateOrUpdateChildPolicyLocked();
+ // Subchannel caching.
+ void CacheDeletedSubchannelLocked(
+ RefCountedPtr<SubchannelInterface> subchannel);
+ void StartSubchannelCacheTimerLocked();
+ static void OnSubchannelCacheTimer(void* arg, grpc_error_handle error);
+ void OnSubchannelCacheTimerLocked(grpc_error_handle error);
+
// Who the client is trying to communicate with.
TString server_name_;
// Configurations for the policy.
@@ -452,7 +459,7 @@ class GrpcLb : public LoadBalancingPolicy {
// contains a non-NULL lb_call_.
OrphanablePtr<BalancerCallState> lb_calld_;
// Timeout in milliseconds for the LB call. 0 means no deadline.
- int lb_call_timeout_ms_ = 0;
+ const int lb_call_timeout_ms_ = 0;
// Balancer call retry state.
BackOff lb_call_backoff_;
bool retry_timer_callback_pending_ = false;
@@ -470,7 +477,7 @@ class GrpcLb : public LoadBalancingPolicy {
// State for fallback-at-startup checks.
// Timeout after startup after which we will go into fallback mode if
// we have not received a serverlist from the balancer.
- int fallback_at_startup_timeout_ = 0;
+ const int fallback_at_startup_timeout_ = 0;
bool fallback_at_startup_checks_pending_ = false;
grpc_timer lb_fallback_timer_;
grpc_closure lb_on_fallback_;
@@ -479,6 +486,15 @@ class GrpcLb : public LoadBalancingPolicy {
OrphanablePtr<LoadBalancingPolicy> child_policy_;
// Child policy in state READY.
bool child_policy_ready_ = false;
+
+ // Deleted subchannel caching.
+ const grpc_millis subchannel_cache_interval_ms_;
+ std::map<grpc_millis /*deletion time*/,
+ std::vector<RefCountedPtr<SubchannelInterface>>>
+ cached_subchannels_;
+ grpc_timer subchannel_cache_timer_;
+ grpc_closure on_subchannel_cache_timer_;
+ bool subchannel_cache_timer_pending_ = false;
};
//
@@ -606,7 +622,6 @@ const char* GrpcLb::Serverlist::ShouldDrop() {
//
GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
- PickResult result;
// Check if we should drop the call.
const char* drop_token =
serverlist_ == nullptr ? nullptr : serverlist_->ShouldDrop();
@@ -619,16 +634,16 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
if (client_stats_ != nullptr) {
client_stats_->AddCallDropped(drop_token);
}
- result.type = PickResult::PICK_COMPLETE;
- return result;
+ return PickResult::Drop(
+ y_absl::UnavailableError("drop directed by grpclb balancer"));
}
// Forward pick to child policy.
- result = child_picker_->Pick(args);
+ PickResult result = child_picker_->Pick(args);
// If pick succeeded, add LB token to initial metadata.
- if (result.type == PickResult::PICK_COMPLETE &&
- result.subchannel != nullptr) {
+ auto* complete_pick = y_absl::get_if<PickResult::Complete>(&result.result);
+ if (complete_pick != nullptr) {
const SubchannelWrapper* subchannel_wrapper =
- static_cast<SubchannelWrapper*>(result.subchannel.get());
+ static_cast<SubchannelWrapper*>(complete_pick->subchannel.get());
// Encode client stats object into metadata for use by
// client_load_reporting filter.
GrpcLbClientStats* client_stats = subchannel_wrapper->client_stats();
@@ -654,7 +669,7 @@ GrpcLb::PickResult GrpcLb::Picker::Pick(PickArgs args) {
args.initial_metadata->Add(kGrpcLbLbTokenMetadataKey, lb_token);
}
// Unwrap subchannel to pass up to the channel.
- result.subchannel = subchannel_wrapper->wrapped_subchannel();
+ complete_pick->subchannel = subchannel_wrapper->wrapped_subchannel();
}
return result;
}
@@ -680,7 +695,8 @@ RefCountedPtr<SubchannelInterface> GrpcLb::Helper::CreateSubchannel(
return MakeRefCounted<SubchannelWrapper>(
parent_->channel_control_helper()->CreateSubchannel(std::move(address),
args),
- std::move(lb_token), std::move(client_stats));
+ parent_->Ref(DEBUG_LOCATION, "SubchannelWrapper"), std::move(lb_token),
+ std::move(client_stats));
}
void GrpcLb::Helper::UpdateState(grpc_connectivity_state state,
@@ -736,6 +752,10 @@ void GrpcLb::Helper::RequestReresolution() {
}
}
+y_absl::string_view GrpcLb::Helper::GetAuthority() {
+ return parent_->channel_control_helper()->GetAuthority();
+}
+
void GrpcLb::Helper::AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) {
if (parent_->shutting_down_) return;
@@ -893,6 +913,10 @@ void GrpcLb::BalancerCallState::StartQuery() {
}
void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
const grpc_millis next_client_load_report_time =
ExecCtx::Get()->Now() + client_stats_report_interval_;
GRPC_CLOSURE_INIT(&client_load_report_closure_, MaybeSendClientLoadReport,
@@ -902,17 +926,17 @@ void GrpcLb::BalancerCallState::ScheduleNextClientLoadReportLocked() {
client_load_report_timer_callback_pending_ = true;
}
-void GrpcLb::BalancerCallState::MaybeSendClientLoadReport(void* arg,
- grpc_error* error) {
+void GrpcLb::BalancerCallState::MaybeSendClientLoadReport(
+ void* arg, grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->MaybeSendClientLoadReportLocked(error); },
DEBUG_LOCATION);
}
void GrpcLb::BalancerCallState::MaybeSendClientLoadReportLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
client_load_report_timer_callback_pending_ = false;
if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
Unref(DEBUG_LOCATION, "client_load_report");
@@ -982,15 +1006,16 @@ void GrpcLb::BalancerCallState::SendClientLoadReportLocked() {
}
void GrpcLb::BalancerCallState::ClientLoadReportDone(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->ClientLoadReportDoneLocked(error); },
DEBUG_LOCATION);
}
-void GrpcLb::BalancerCallState::ClientLoadReportDoneLocked(grpc_error* error) {
+void GrpcLb::BalancerCallState::ClientLoadReportDoneLocked(
+ grpc_error_handle error) {
grpc_byte_buffer_destroy(send_message_payload_);
send_message_payload_ = nullptr;
if (error != GRPC_ERROR_NONE || this != grpclb_policy()->lb_calld_.get()) {
@@ -1001,8 +1026,8 @@ void GrpcLb::BalancerCallState::ClientLoadReportDoneLocked(grpc_error* error) {
ScheduleNextClientLoadReportLocked();
}
-void GrpcLb::BalancerCallState::OnInitialRequestSent(void* arg,
- grpc_error* /*error*/) {
+void GrpcLb::BalancerCallState::OnInitialRequestSent(
+ void* arg, grpc_error_handle /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld]() { lb_calld->OnInitialRequestSentLocked(); }, DEBUG_LOCATION);
@@ -1021,7 +1046,7 @@ void GrpcLb::BalancerCallState::OnInitialRequestSentLocked() {
}
void GrpcLb::BalancerCallState::OnBalancerMessageReceived(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld]() { lb_calld->OnBalancerMessageReceivedLocked(); },
@@ -1056,8 +1081,8 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
switch (response.type) {
case response.INITIAL: {
if (response.client_stats_report_interval != 0) {
- client_stats_report_interval_ =
- GPR_MAX(GPR_MS_PER_SEC, response.client_stats_report_interval);
+ client_stats_report_interval_ = std::max(
+ int64_t(GPR_MS_PER_SEC), response.client_stats_report_interval);
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO,
"[grpclb %p] lb_calld=%p: Received initial LB response "
@@ -1183,17 +1208,17 @@ void GrpcLb::BalancerCallState::OnBalancerMessageReceivedLocked() {
}
}
-void GrpcLb::BalancerCallState::OnBalancerStatusReceived(void* arg,
- grpc_error* error) {
+void GrpcLb::BalancerCallState::OnBalancerStatusReceived(
+ void* arg, grpc_error_handle error) {
BalancerCallState* lb_calld = static_cast<BalancerCallState*>(arg);
- GRPC_ERROR_REF(error); // owned by lambda
+ (void)GRPC_ERROR_REF(error); // owned by lambda
lb_calld->grpclb_policy()->work_serializer()->Run(
[lb_calld, error]() { lb_calld->OnBalancerStatusReceivedLocked(error); },
DEBUG_LOCATION);
}
void GrpcLb::BalancerCallState::OnBalancerStatusReceivedLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
GPR_ASSERT(lb_call_ != nullptr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
char* status_details = grpc_slice_to_c_string(lb_call_status_details_);
@@ -1201,7 +1226,7 @@ void GrpcLb::BalancerCallState::OnBalancerStatusReceivedLocked(
"[grpclb %p] lb_calld=%p: Status from LB server received. "
"Status = %d, details = '%s', (lb_call: %p), error '%s'",
grpclb_policy(), this, lb_call_status_, status_details, lb_call_,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
gpr_free(status_details);
}
GRPC_ERROR_UNREF(error);
@@ -1297,8 +1322,7 @@ grpc_channel_args* BuildBalancerChannelArgs(
y_absl::InlinedVector<grpc_arg, 3> args_to_add = {
// The fake resolver response generator, which we use to inject
// address updates into the LB channel.
- grpc_core::FakeResolverResponseGenerator::MakeChannelArg(
- response_generator),
+ FakeResolverResponseGenerator::MakeChannelArg(response_generator),
// A channel arg indicating the target is a grpclb load balancer.
grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER), 1),
@@ -1318,9 +1342,21 @@ grpc_channel_args* BuildBalancerChannelArgs(
// ctor and dtor
//
+TString GetServerNameFromChannelArgs(const grpc_channel_args* args) {
+ const char* server_uri =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri != nullptr);
+ y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
+ GPR_ASSERT(uri.ok() && !uri->path().empty());
+ return TString(y_absl::StripPrefix(uri->path(), "/"));
+}
+
GrpcLb::GrpcLb(Args args)
: LoadBalancingPolicy(std::move(args)),
+ server_name_(GetServerNameFromChannelArgs(args.args)),
response_generator_(MakeRefCounted<FakeResolverResponseGenerator>()),
+ lb_call_timeout_ms_(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS, {0, 0, INT_MAX})),
lb_call_backoff_(
BackOff::Options()
.set_initial_backoff(GRPC_GRPCLB_INITIAL_CONNECT_BACKOFF_SECONDS *
@@ -1328,31 +1364,25 @@ GrpcLb::GrpcLb(Args args)
.set_multiplier(GRPC_GRPCLB_RECONNECT_BACKOFF_MULTIPLIER)
.set_jitter(GRPC_GRPCLB_RECONNECT_JITTER)
.set_max_backoff(GRPC_GRPCLB_RECONNECT_MAX_BACKOFF_SECONDS *
- 1000)) {
- // Closure Initialization
- GRPC_CLOSURE_INIT(&lb_on_fallback_, &GrpcLb::OnFallbackTimer, this,
- grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&lb_on_call_retry_, &GrpcLb::OnBalancerCallRetryTimer, this,
- grpc_schedule_on_exec_ctx);
- // Record server name.
- const grpc_arg* arg = grpc_channel_args_find(args.args, GRPC_ARG_SERVER_URI);
- const char* server_uri = grpc_channel_arg_get_string(arg);
- GPR_ASSERT(server_uri != nullptr);
- y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
- GPR_ASSERT(uri.ok() && !uri->path().empty());
- server_name_ = TString(y_absl::StripPrefix(uri->path(), "/"));
+ 1000)),
+ fallback_at_startup_timeout_(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS,
+ {GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX})),
+ subchannel_cache_interval_ms_(grpc_channel_args_find_integer(
+ args.args, GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS,
+ {GRPC_GRPCLB_DEFAULT_SUBCHANNEL_DELETION_DELAY_MS, 0, INT_MAX})) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
gpr_log(GPR_INFO,
"[grpclb %p] Will use '%s' as the server name for LB request.",
this, server_name_.c_str());
}
- // Record LB call timeout.
- arg = grpc_channel_args_find(args.args, GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS);
- lb_call_timeout_ms_ = grpc_channel_arg_get_integer(arg, {0, 0, INT_MAX});
- // Record fallback-at-startup timeout.
- arg = grpc_channel_args_find(args.args, GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS);
- fallback_at_startup_timeout_ = grpc_channel_arg_get_integer(
- arg, {GRPC_GRPCLB_DEFAULT_FALLBACK_TIMEOUT_MS, 0, INT_MAX});
+ // Closure Initialization
+ GRPC_CLOSURE_INIT(&lb_on_fallback_, &GrpcLb::OnFallbackTimer, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&lb_on_call_retry_, &GrpcLb::OnBalancerCallRetryTimer, this,
+ grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&on_subchannel_cache_timer_, &OnSubchannelCacheTimer, this,
+ nullptr);
}
GrpcLb::~GrpcLb() { grpc_channel_args_destroy(args_); }
@@ -1360,6 +1390,11 @@ GrpcLb::~GrpcLb() { grpc_channel_args_destroy(args_); }
void GrpcLb::ShutdownLocked() {
shutting_down_ = true;
lb_calld_.reset();
+ if (subchannel_cache_timer_pending_) {
+ subchannel_cache_timer_pending_ = false;
+ grpc_timer_cancel(&subchannel_cache_timer_);
+ }
+ cached_subchannels_.clear();
if (retry_timer_callback_pending_) {
grpc_timer_cancel(&lb_call_retry_timer_);
}
@@ -1420,13 +1455,12 @@ void GrpcLb::UpdateLocked(UpdateArgs args) {
// Start watching the channel's connectivity state. If the channel
// goes into state TRANSIENT_FAILURE before the timer fires, we go into
// fallback mode even if the fallback timeout has not elapsed.
- grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
- grpc_channel_get_channel_stack(lb_channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(lb_channel_);
+ GPR_ASSERT(client_channel != nullptr);
// Ref held by callback.
watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "StateWatcher"));
- grpc_client_channel_start_connectivity_watch(
- client_channel_elem, GRPC_CHANNEL_IDLE,
+ client_channel->AddConnectivityWatcher(
+ GRPC_CHANNEL_IDLE,
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
// Start balancer call.
StartBalancerCallLocked();
@@ -1490,10 +1524,9 @@ void GrpcLb::ProcessAddressesAndChannelArgsLocked(
}
void GrpcLb::CancelBalancerChannelConnectivityWatchLocked() {
- grpc_channel_element* client_channel_elem = grpc_channel_stack_last_element(
- grpc_channel_get_channel_stack(lb_channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(lb_channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ client_channel->RemoveConnectivityWatcher(watcher_);
}
//
@@ -1536,9 +1569,9 @@ void GrpcLb::StartBalancerCallRetryTimerLocked() {
grpc_timer_init(&lb_call_retry_timer_, next_try, &lb_on_call_retry_);
}
-void GrpcLb::OnBalancerCallRetryTimer(void* arg, grpc_error* error) {
+void GrpcLb::OnBalancerCallRetryTimer(void* arg, grpc_error_handle error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
grpclb_policy->work_serializer()->Run(
[grpclb_policy, error]() {
grpclb_policy->OnBalancerCallRetryTimerLocked(error);
@@ -1546,7 +1579,7 @@ void GrpcLb::OnBalancerCallRetryTimer(void* arg, grpc_error* error) {
DEBUG_LOCATION);
}
-void GrpcLb::OnBalancerCallRetryTimerLocked(grpc_error* error) {
+void GrpcLb::OnBalancerCallRetryTimerLocked(grpc_error_handle error) {
retry_timer_callback_pending_ = false;
if (!shutting_down_ && error == GRPC_ERROR_NONE && lb_calld_ == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
@@ -1580,15 +1613,15 @@ void GrpcLb::MaybeEnterFallbackModeAfterStartup() {
}
}
-void GrpcLb::OnFallbackTimer(void* arg, grpc_error* error) {
+void GrpcLb::OnFallbackTimer(void* arg, grpc_error_handle error) {
GrpcLb* grpclb_policy = static_cast<GrpcLb*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
grpclb_policy->work_serializer()->Run(
[grpclb_policy, error]() { grpclb_policy->OnFallbackTimerLocked(error); },
DEBUG_LOCATION);
}
-void GrpcLb::OnFallbackTimerLocked(grpc_error* error) {
+void GrpcLb::OnFallbackTimerLocked(grpc_error_handle error) {
// If we receive a serverlist after the timer fires but before this callback
// actually runs, don't fall back.
if (fallback_at_startup_checks_pending_ && !shutting_down_ &&
@@ -1679,6 +1712,57 @@ void GrpcLb::CreateOrUpdateChildPolicyLocked() {
}
//
+// subchannel caching
+//
+
+void GrpcLb::CacheDeletedSubchannelLocked(
+ RefCountedPtr<SubchannelInterface> subchannel) {
+ grpc_millis deletion_time =
+ ExecCtx::Get()->Now() + subchannel_cache_interval_ms_;
+ cached_subchannels_[deletion_time].push_back(std::move(subchannel));
+ if (!subchannel_cache_timer_pending_) {
+ Ref(DEBUG_LOCATION, "OnSubchannelCacheTimer").release();
+ subchannel_cache_timer_pending_ = true;
+ StartSubchannelCacheTimerLocked();
+ }
+}
+
+void GrpcLb::StartSubchannelCacheTimerLocked() {
+ GPR_ASSERT(!cached_subchannels_.empty());
+ grpc_timer_init(&subchannel_cache_timer_, cached_subchannels_.begin()->first,
+ &on_subchannel_cache_timer_);
+}
+
+void GrpcLb::OnSubchannelCacheTimer(void* arg, grpc_error_handle error) {
+ auto* self = static_cast<GrpcLb*>(arg);
+ (void)GRPC_ERROR_REF(error);
+ self->work_serializer()->Run(
+ [self, error]() { self->GrpcLb::OnSubchannelCacheTimerLocked(error); },
+ DEBUG_LOCATION);
+}
+
+void GrpcLb::OnSubchannelCacheTimerLocked(grpc_error_handle error) {
+ if (subchannel_cache_timer_pending_ && error == GRPC_ERROR_NONE) {
+ auto it = cached_subchannels_.begin();
+ if (it != cached_subchannels_.end()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_glb_trace)) {
+ gpr_log(GPR_INFO,
+ "[grpclb %p] removing %" PRIuPTR " subchannels from cache",
+ this, it->second.size());
+ }
+ cached_subchannels_.erase(it);
+ }
+ if (!cached_subchannels_.empty()) {
+ StartSubchannelCacheTimerLocked();
+ return;
+ }
+ subchannel_cache_timer_pending_ = false;
+ }
+ Unref(DEBUG_LOCATION, "OnSubchannelCacheTimer");
+ GRPC_ERROR_UNREF(error);
+}
+
+//
// factory
//
@@ -1692,12 +1776,12 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kGrpclb; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
return MakeRefCounted<GrpcLbConfig>(nullptr, "");
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
Json child_policy_config_json_tmp;
const Json* child_policy_config_json;
TString service_name;
@@ -1720,12 +1804,12 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
} else {
child_policy_config_json = &it->second;
}
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
RefCountedPtr<LoadBalancingPolicy::Config> child_policy_config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
*child_policy_config_json, &parse_error);
if (parse_error != GRPC_ERROR_NONE) {
- std::vector<grpc_error*> child_errors;
+ std::vector<grpc_error_handle> child_errors;
child_errors.push_back(parse_error);
error_list.push_back(
GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
@@ -1748,39 +1832,34 @@ class GrpcLbFactory : public LoadBalancingPolicyFactory {
// Plugin registration
//
-namespace {
-
-// Only add client_load_reporting filter if the grpclb LB policy is used.
-bool maybe_add_client_load_reporting_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- const grpc_arg* channel_arg =
- grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME);
- if (channel_arg != nullptr && channel_arg->type == GRPC_ARG_STRING &&
- strcmp(channel_arg->value.string, "grpclb") == 0) {
- // TODO(roth): When we get around to re-attempting
- // https://github.com/grpc/grpc/pull/16214, we should try to keep
- // this filter at the very top of the subchannel stack, since that
- // will minimize the number of metadata elements that the filter
- // needs to iterate through to find the ClientStats object.
- return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr,
- nullptr);
- }
- return true;
-}
-
-} // namespace
-
void grpc_lb_policy_grpclb_init() {
grpc_core::LoadBalancingPolicyRegistry::Builder::
RegisterLoadBalancingPolicyFactory(
y_absl::make_unique<grpc_core::GrpcLbFactory>());
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_client_load_reporting_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_load_reporting_filter));
}
void grpc_lb_policy_grpclb_shutdown() {}
+
+namespace grpc_core {
+void RegisterGrpcLbLoadReportingFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](grpc_channel_stack_builder* builder) {
+ const grpc_channel_args* args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ const grpc_arg* channel_arg =
+ grpc_channel_args_find(args, GRPC_ARG_LB_POLICY_NAME);
+ if (channel_arg != nullptr && channel_arg->type == GRPC_ARG_STRING &&
+ strcmp(channel_arg->value.string, "grpclb") == 0) {
+ // TODO(roth): When we get around to re-attempting
+ // https://github.com/grpc/grpc/pull/16214, we should try to keep
+ // this filter at the very top of the subchannel stack, since that
+ // will minimize the number of metadata elements that the filter
+ // needs to iterate through to find the ClientStats object.
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &grpc_client_load_reporting_filter, nullptr, nullptr);
+ }
+ return true;
+ });
+}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
index a032b5dbf1d..27e7a3a333f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h
@@ -32,6 +32,10 @@
#define GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER \
"grpc.address_is_backend_from_grpclb_load_balancer"
+// For use in tests.
+#define GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS \
+ "grpc.internal.grpclb_subchannel_cache_interval_ms"
+
namespace grpc_core {
extern const char kGrpcLbClientStatsMetadataKey[];
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
index 0bd587a9323..8168d1568f1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.cc
@@ -42,7 +42,7 @@ int BalancerAddressesArgCmp(void* p, void* q) {
ServerAddressList* address_list1 = static_cast<ServerAddressList*>(p);
ServerAddressList* address_list2 = static_cast<ServerAddressList*>(q);
if (address_list1 == nullptr || address_list2 == nullptr) {
- return GPR_ICMP(address_list1, address_list2);
+ return QsortCompare(address_list1, address_list2);
}
if (address_list1->size() > address_list2->size()) return 1;
if (address_list1->size() < address_list2->size()) return -1;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
index 07c5fd6fe9e..b8b4889ee47 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
-
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
+#include <grpc/grpc.h>
+
namespace grpc_core {
grpc_channel_args* ModifyGrpclbBalancerChannelArgs(grpc_channel_args* args) {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
index da975f0e708..8146d3996e3 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
-
#include <string.h>
#include "y_absl/container/inlined_vector.h"
@@ -30,10 +28,11 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/slice/slice_internal.h"
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
index 7462d55cf24..3df037b7eeb 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc
@@ -22,11 +22,11 @@
#include <string.h>
+#include "y_absl/memory/memory.h"
+
#include <grpc/support/atm.h>
#include <grpc/support/string_util.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/lib/gprpp/sync.h"
namespace grpc_core {
@@ -63,8 +63,7 @@ void GrpcLbClientStats::AddCallDropped(const char* token) {
}
}
// Not found, so add a new entry.
- drop_token_counts_->emplace_back(
- grpc_core::UniquePtr<char>(gpr_strdup(token)), 1);
+ drop_token_counts_->emplace_back(UniquePtr<char>(gpr_strdup(token)), 1);
}
namespace {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
index e5304fda6be..b00c1007b0f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
-
#include "y_absl/container/inlined_vector.h"
+#include <grpc/support/atm.h>
+
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -34,10 +34,10 @@ namespace grpc_core {
class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
public:
struct DropTokenCount {
- grpc_core::UniquePtr<char> token;
+ UniquePtr<char> token;
int64_t count;
- DropTokenCount(grpc_core::UniquePtr<char> token, int64_t count)
+ DropTokenCount(UniquePtr<char> token, int64_t count)
: token(std::move(token)), count(count) {}
};
@@ -66,7 +66,8 @@ class GrpcLbClientStats : public RefCounted<GrpcLbClientStats> {
gpr_atm num_calls_finished_with_client_failed_to_send_ = 0;
gpr_atm num_calls_finished_known_received_ = 0;
Mutex drop_count_mu_; // Guards drop_token_counts_.
- std::unique_ptr<DroppedCallCounts> drop_token_counts_;
+ std::unique_ptr<DroppedCallCounts> drop_token_counts_
+ Y_ABSL_GUARDED_BY(drop_count_mu_);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
index 2ba01c1e835..1d397686301 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h"
-#include "src/core/lib/gpr/useful.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/timestamp.upb.h"
@@ -55,8 +54,8 @@ grpc_slice GrpcLbRequestCreate(const char* lb_service_name, upb_arena* arena) {
grpc_lb_v1_LoadBalanceRequest* req = grpc_lb_v1_LoadBalanceRequest_new(arena);
grpc_lb_v1_InitialLoadBalanceRequest* initial_request =
grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(req, arena);
- size_t name_len =
- GPR_MIN(strlen(lb_service_name), GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH);
+ size_t name_len = std::min(strlen(lb_service_name),
+ size_t(GRPC_GRPCLB_SERVICE_NAME_MAX_LENGTH));
grpc_lb_v1_InitialLoadBalanceRequest_set_name(
initial_request, upb_strview_make(lb_service_name, name_len));
return grpc_grpclb_request_encode(req, arena);
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
index 92bfff4602b..aaf575c9bfc 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
@@ -26,9 +26,9 @@
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
@@ -114,10 +114,7 @@ class PickFirst : public LoadBalancingPolicy {
: subchannel_(std::move(subchannel)) {}
PickResult Pick(PickArgs /*args*/) override {
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- result.subchannel = subchannel_;
- return result;
+ return PickResult::Complete(subchannel_);
}
private:
@@ -197,12 +194,10 @@ void PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked() {
// (If we are idle, then this will happen in ExitIdleLocked() if we
// haven't gotten a non-empty update by the time the application tries
// to start a new call.)
- grpc_error* error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status = y_absl::UnavailableError("Empty update");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
return;
}
// If one of the subchannels in the new list is already in state
@@ -272,7 +267,7 @@ void PickFirst::UpdateLocked(UpdateArgs args) {
const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1);
const grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args.args, &new_arg, 1);
- GPR_SWAP(const grpc_channel_args*, new_args, args.args);
+ std::swap(new_args, args.args);
grpc_channel_args_destroy(new_args);
latest_update_args_ = std::move(args);
// If we are not in idle, start connection attempt immediately.
@@ -314,13 +309,11 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
// Set our state to that of the pending subchannel list.
if (p->subchannel_list_->in_transient_failure()) {
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "selected subchannel failed; switching to pending update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status = y_absl::UnavailableError(
+ "selected subchannel failed; switching to pending update");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
} else {
p->channel_control_helper()->UpdateState(
GRPC_CHANNEL_CONNECTING, y_absl::Status(),
@@ -384,22 +377,36 @@ void PickFirst::PickFirstSubchannelData::ProcessConnectivityChangeLocked(
sd = subchannel_list()->subchannel(next_index);
// If we're tried all subchannels, set state to TRANSIENT_FAILURE.
if (sd->Index() == 0) {
- // Re-resolve if this is the most recent subchannel list.
- if (subchannel_list() == (p->latest_pending_subchannel_list_ != nullptr
- ? p->latest_pending_subchannel_list_.get()
- : p->subchannel_list_.get())) {
- p->channel_control_helper()->RequestReresolution();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
+ gpr_log(GPR_INFO,
+ "Pick First %p subchannel list %p failed to connect to "
+ "all subchannels",
+ p, subchannel_list());
}
subchannel_list()->set_in_transient_failure(true);
- // Only report new state in case 1.
+ // In case 2, swap to the new subchannel list. This means reporting
+ // TRANSIENT_FAILURE and dropping the existing (working) connection,
+ // but we can't ignore what the control plane has told us.
+ if (subchannel_list() == p->latest_pending_subchannel_list_.get()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_pick_first_trace)) {
+ gpr_log(GPR_INFO,
+ "Pick First %p promoting pending subchannel list %p to "
+ "replace %p",
+ p, p->latest_pending_subchannel_list_.get(),
+ p->subchannel_list_.get());
+ }
+ p->subchannel_list_ = std::move(p->latest_pending_subchannel_list_);
+ }
+ // If this is the current subchannel list (either because we were
+ // in case 1 or because we were in case 2 and just promoted it to
+ // be the current list), re-resolve and report new state.
if (subchannel_list() == p->subchannel_list_.get()) {
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "failed to connect to all addresses"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ p->channel_control_helper()->RequestReresolution();
+ y_absl::Status status =
+ y_absl::UnavailableError("failed to connect to all addresses");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
}
}
sd->CheckConnectivityStateAndStartWatchingLocked();
@@ -497,7 +504,7 @@ class PickFirstFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kPickFirst; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
+ const Json& /*json*/, grpc_error_handle* /*error*/) const override {
return MakeRefCounted<PickFirstConfig>();
}
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
index b01fe874333..79739f50997 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc
@@ -162,6 +162,7 @@ class PriorityLb : public LoadBalancingPolicy {
const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -179,10 +180,10 @@ class PriorityLb : public LoadBalancingPolicy {
void StartFailoverTimerLocked();
- static void OnFailoverTimer(void* arg, grpc_error* error);
- void OnFailoverTimerLocked(grpc_error* error);
- static void OnDeactivationTimer(void* arg, grpc_error* error);
- void OnDeactivationTimerLocked(grpc_error* error);
+ static void OnFailoverTimer(void* arg, grpc_error_handle error);
+ void OnFailoverTimerLocked(grpc_error_handle error);
+ static void OnDeactivationTimer(void* arg, grpc_error_handle error);
+ void OnDeactivationTimerLocked(grpc_error_handle error);
RefCountedPtr<PriorityLb> priority_policy_;
const TString name_;
@@ -472,12 +473,10 @@ void PriorityLb::TryNextPriorityLocked(bool report_connecting) {
this);
}
current_child_from_before_update_ = nullptr;
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ready priority"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status = y_absl::UnavailableError("no ready priority");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
}
void PriorityLb::SelectPriorityLocked(uint32_t priority) {
@@ -655,14 +654,15 @@ void PriorityLb::ChildPriority::MaybeCancelFailoverTimerLocked() {
}
}
-void PriorityLb::ChildPriority::OnFailoverTimer(void* arg, grpc_error* error) {
+void PriorityLb::ChildPriority::OnFailoverTimer(void* arg,
+ grpc_error_handle error) {
ChildPriority* self = static_cast<ChildPriority*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
self->priority_policy_->work_serializer()->Run(
[self, error]() { self->OnFailoverTimerLocked(error); }, DEBUG_LOCATION);
}
-void PriorityLb::ChildPriority::OnFailoverTimerLocked(grpc_error* error) {
+void PriorityLb::ChildPriority::OnFailoverTimerLocked(grpc_error_handle error) {
if (error == GRPC_ERROR_NONE && failover_timer_callback_pending_ &&
!priority_policy_->shutting_down_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
@@ -712,15 +712,16 @@ void PriorityLb::ChildPriority::MaybeReactivateLocked() {
}
void PriorityLb::ChildPriority::OnDeactivationTimer(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
ChildPriority* self = static_cast<ChildPriority*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
self->priority_policy_->work_serializer()->Run(
[self, error]() { self->OnDeactivationTimerLocked(error); },
DEBUG_LOCATION);
}
-void PriorityLb::ChildPriority::OnDeactivationTimerLocked(grpc_error* error) {
+void PriorityLb::ChildPriority::OnDeactivationTimerLocked(
+ grpc_error_handle error) {
if (error == GRPC_ERROR_NONE && deactivation_timer_callback_pending_ &&
!priority_policy_->shutting_down_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_priority_trace)) {
@@ -740,14 +741,6 @@ void PriorityLb::ChildPriority::OnDeactivationTimerLocked(grpc_error* error) {
// PriorityLb::ChildPriority::Helper
//
-void PriorityLb::ChildPriority::Helper::RequestReresolution() {
- if (priority_->priority_policy_->shutting_down_) return;
- if (priority_->ignore_reresolution_requests_) {
- return;
- }
- priority_->priority_policy_->channel_control_helper()->RequestReresolution();
-}
-
RefCountedPtr<SubchannelInterface>
PriorityLb::ChildPriority::Helper::CreateSubchannel(
ServerAddress address, const grpc_channel_args& args) {
@@ -764,6 +757,18 @@ void PriorityLb::ChildPriority::Helper::UpdateState(
priority_->OnConnectivityStateUpdateLocked(state, status, std::move(picker));
}
+void PriorityLb::ChildPriority::Helper::RequestReresolution() {
+ if (priority_->priority_policy_->shutting_down_) return;
+ if (priority_->ignore_reresolution_requests_) {
+ return;
+ }
+ priority_->priority_policy_->channel_control_helper()->RequestReresolution();
+}
+
+y_absl::string_view PriorityLb::ChildPriority::Helper::GetAuthority() {
+ return priority_->priority_policy_->channel_control_helper()->GetAuthority();
+}
+
void PriorityLb::ChildPriority::Helper::AddTraceEvent(
TraceSeverity severity, y_absl::string_view message) {
if (priority_->priority_policy_->shutting_down_) return;
@@ -785,7 +790,7 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kPriority; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// priority was mentioned as a policy in the deprecated
@@ -796,7 +801,7 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
"config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// Children.
std::map<TString, PriorityLbConfig::PriorityLbChild> children;
auto it = json.object_value().find("children");
@@ -812,19 +817,17 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
const TString& child_name = p.first;
const Json& element = p.second;
if (element.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("field:children key:", child_name,
- " error:should be type object")
- .c_str()));
+ " error:should be type object")));
} else {
auto it2 = element.object_value().find("config");
if (it2 == element.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("field:children key:", child_name,
- " error:missing 'config' field")
- .c_str()));
+ " error:missing 'config' field")));
} else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
auto config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
it2->second, &parse_error);
bool ignore_resolution_requests = false;
@@ -836,11 +839,10 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
if (it3->second.type() == Json::Type::JSON_TRUE) {
ignore_resolution_requests = true;
} else if (it3->second.type() != Json::Type::JSON_FALSE) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("field:children key:", child_name,
" field:ignore_reresolution_requests:should "
- "be type boolean")
- .c_str()));
+ "be type boolean")));
}
}
if (config == nullptr) {
@@ -872,26 +874,20 @@ class PriorityLbFactory : public LoadBalancingPolicyFactory {
for (size_t i = 0; i < array.size(); ++i) {
const Json& element = array[i];
if (element.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities element:", i,
- " error:should be type string")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:priorities element:", i, " error:should be type string")));
} else if (children.find(element.string_value()) == children.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities element:", i,
- " error:unknown child '", element.string_value(),
- "'")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:priorities element:", i, " error:unknown child '",
+ element.string_value(), "'")));
} else {
priorities.emplace_back(element.string_value());
}
}
if (priorities.size() != children.size()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:priorities error:priorities size (",
- priorities.size(), ") != children size (",
- children.size(), ")")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:priorities error:priorities size (", priorities.size(),
+ ") != children size (", children.size(), ")")));
}
}
if (error_list.empty()) {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
index 921bd2e0078..389548e0275 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
@@ -16,8 +16,741 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "y_absl/strings/numbers.h"
+#include "y_absl/strings/str_cat.h"
+#define XXH_INLINE_ALL
+#include "xxhash.h"
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/static_metadata.h"
+
namespace grpc_core {
const char* kRequestRingHashAttribute = "request_ring_hash";
+TraceFlag grpc_lb_ring_hash_trace(false, "ring_hash_lb");
+
+// Helper Parser method
+void ParseRingHashLbConfig(const Json& json, size_t* min_ring_size,
+ size_t* max_ring_size,
+ std::vector<grpc_error_handle>* error_list) {
+ *min_ring_size = 1024;
+ *max_ring_size = 8388608;
+ if (json.type() != Json::Type::OBJECT) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ring_hash_experimental should be of type object"));
+ return;
+ }
+ const Json::Object& ring_hash = json.object_value();
+ auto ring_hash_it = ring_hash.find("min_ring_size");
+ if (ring_hash_it != ring_hash.end()) {
+ if (ring_hash_it->second.type() != Json::Type::NUMBER) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:min_ring_size error: should be of type number"));
+ } else {
+ *min_ring_size = gpr_parse_nonnegative_int(
+ ring_hash_it->second.string_value().c_str());
+ }
+ }
+ ring_hash_it = ring_hash.find("max_ring_size");
+ if (ring_hash_it != ring_hash.end()) {
+ if (ring_hash_it->second.type() != Json::Type::NUMBER) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:max_ring_size error: should be of type number"));
+ } else {
+ *max_ring_size = gpr_parse_nonnegative_int(
+ ring_hash_it->second.string_value().c_str());
+ }
+ }
+ if (*min_ring_size == 0 || *min_ring_size > 8388608 || *max_ring_size == 0 ||
+ *max_ring_size > 8388608 || *min_ring_size > *max_ring_size) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:max_ring_size and or min_ring_size error: "
+ "values need to be in the range of 1 to 8388608 "
+ "and max_ring_size cannot be smaller than "
+ "min_ring_size"));
+ }
+}
+
+namespace {
+
+constexpr char kRingHash[] = "ring_hash_experimental";
+
+class RingHashLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ RingHashLbConfig(size_t min_ring_size, size_t max_ring_size)
+ : min_ring_size_(min_ring_size), max_ring_size_(max_ring_size) {}
+ const char* name() const override { return kRingHash; }
+ size_t min_ring_size() const { return min_ring_size_; }
+ size_t max_ring_size() const { return max_ring_size_; }
+
+ private:
+ size_t min_ring_size_;
+ size_t max_ring_size_;
+};
+
+//
+// ring_hash LB policy
+//
+class RingHash : public LoadBalancingPolicy {
+ public:
+ explicit RingHash(Args args);
+
+ const char* name() const override { return kRingHash; }
+
+ void UpdateLocked(UpdateArgs args) override;
+ void ResetBackoffLocked() override;
+
+ private:
+ ~RingHash() override;
+
+ // Forward declaration.
+ class RingHashSubchannelList;
+
+ // Data for a particular subchannel in a subchannel list.
+ // This subclass adds the following functionality:
+ // - Tracks the previous connectivity state of the subchannel, so that
+ // we know how many subchannels are in each state.
+ class RingHashSubchannelData
+ : public SubchannelData<RingHashSubchannelList, RingHashSubchannelData> {
+ public:
+ RingHashSubchannelData(
+ SubchannelList<RingHashSubchannelList, RingHashSubchannelData>*
+ subchannel_list,
+ const ServerAddress& address,
+ RefCountedPtr<SubchannelInterface> subchannel)
+ : SubchannelData(subchannel_list, address, std::move(subchannel)),
+ address_(address) {}
+
+ grpc_connectivity_state connectivity_state() const {
+ return last_connectivity_state_;
+ }
+ const ServerAddress& address() const { return address_; }
+
+ bool seen_failure_since_ready() const { return seen_failure_since_ready_; }
+
+ // Performs connectivity state updates that need to be done both when we
+ // first start watching and when a watcher notification is received.
+ void UpdateConnectivityStateLocked(
+ grpc_connectivity_state connectivity_state);
+
+ private:
+ // Performs connectivity state updates that need to be done only
+ // after we have started watching.
+ void ProcessConnectivityChangeLocked(
+ grpc_connectivity_state connectivity_state) override;
+
+ ServerAddress address_;
+ grpc_connectivity_state last_connectivity_state_ = GRPC_CHANNEL_SHUTDOWN;
+ bool seen_failure_since_ready_ = false;
+ };
+
+ // A list of subchannels.
+ class RingHashSubchannelList
+ : public SubchannelList<RingHashSubchannelList, RingHashSubchannelData> {
+ public:
+ RingHashSubchannelList(RingHash* policy, TraceFlag* tracer,
+ ServerAddressList addresses,
+ const grpc_channel_args& args)
+ : SubchannelList(policy, tracer, std::move(addresses),
+ policy->channel_control_helper(), args) {
+ // Need to maintain a ref to the LB policy as long as we maintain
+ // any references to subchannels, since the subchannels'
+ // pollset_sets will include the LB policy's pollset_set.
+ policy->Ref(DEBUG_LOCATION, "subchannel_list").release();
+ }
+
+ ~RingHashSubchannelList() override {
+ RingHash* p = static_cast<RingHash*>(policy());
+ p->Unref(DEBUG_LOCATION, "subchannel_list");
+ }
+
+ // Starts watching the subchannels in this list.
+ void StartWatchingLocked();
+
+ // Updates the counters of subchannels in each state when a
+ // subchannel transitions from old_state to new_state.
+ void UpdateStateCountersLocked(grpc_connectivity_state old_state,
+ grpc_connectivity_state new_state);
+
+ // Updates the RH policy's connectivity state based on the
+ // subchannel list's state counters, creating new picker and new ring.
+ // Furthermore, return a bool indicating whether the aggregated state is
+ // Transient Failure.
+ bool UpdateRingHashConnectivityStateLocked();
+
+ private:
+ size_t num_idle_ = 0;
+ size_t num_ready_ = 0;
+ size_t num_connecting_ = 0;
+ size_t num_transient_failure_ = 0;
+ };
+
+ class Picker : public SubchannelPicker {
+ public:
+ Picker(RefCountedPtr<RingHash> parent,
+ RingHashSubchannelList* subchannel_list);
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ struct RingEntry {
+ uint64_t hash;
+ RefCountedPtr<SubchannelInterface> subchannel;
+ grpc_connectivity_state connectivity_state;
+ };
+
+ // A fire-and-forget class that schedules subchannel connection attempts
+ // on the control plane WorkSerializer.
+ class SubchannelConnectionAttempter : public Orphanable {
+ public:
+ explicit SubchannelConnectionAttempter(
+ RefCountedPtr<RingHash> ring_hash_lb)
+ : ring_hash_lb_(std::move(ring_hash_lb)) {
+ GRPC_CLOSURE_INIT(&closure_, RunInExecCtx, this, nullptr);
+ }
+
+ void AddSubchannel(RefCountedPtr<SubchannelInterface> subchannel) {
+ subchannels_.push_back(std::move(subchannel));
+ }
+
+ void Orphan() override {
+ // Hop into ExecCtx, so that we're not holding the data plane mutex
+ // while we run control-plane code.
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+ }
+
+ private:
+ static void RunInExecCtx(void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<SubchannelConnectionAttempter*>(arg);
+ self->ring_hash_lb_->work_serializer()->Run(
+ [self]() {
+ if (!self->ring_hash_lb_->shutdown_) {
+ for (auto& subchannel : self->subchannels_) {
+ subchannel->AttemptToConnect();
+ }
+ }
+ delete self;
+ },
+ DEBUG_LOCATION);
+ }
+
+ RefCountedPtr<RingHash> ring_hash_lb_;
+ grpc_closure closure_;
+ y_absl::InlinedVector<RefCountedPtr<SubchannelInterface>, 10> subchannels_;
+ };
+
+ RefCountedPtr<RingHash> parent_;
+
+ // A ring of subchannels.
+ std::vector<RingEntry> ring_;
+ };
+
+ void ShutdownLocked() override;
+
+ // Current config from resolver.
+ RefCountedPtr<RingHashLbConfig> config_;
+
+ // list of subchannels.
+ OrphanablePtr<RingHashSubchannelList> subchannel_list_;
+ // indicating if we are shutting down.
+ bool shutdown_ = false;
+};
+
+//
+// RingHash::Picker
+//
+
+RingHash::Picker::Picker(RefCountedPtr<RingHash> parent,
+ RingHashSubchannelList* subchannel_list)
+ : parent_(std::move(parent)) {
+ size_t num_subchannels = subchannel_list->num_subchannels();
+ // Store the weights while finding the sum.
+ struct AddressWeight {
+ TString address;
+ // Default weight is 1 for the cases where a weight is not provided,
+ // each occurrence of the address will be counted a weight value of 1.
+ uint32_t weight = 1;
+ double normalized_weight;
+ };
+ std::vector<AddressWeight> address_weights;
+ size_t sum = 0;
+ address_weights.reserve(num_subchannels);
+ for (size_t i = 0; i < num_subchannels; ++i) {
+ RingHashSubchannelData* sd = subchannel_list->subchannel(i);
+ const ServerAddressWeightAttribute* weight_attribute = static_cast<
+ const ServerAddressWeightAttribute*>(sd->address().GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ AddressWeight address_weight;
+ address_weight.address =
+ grpc_sockaddr_to_string(&sd->address().address(), false);
+ if (weight_attribute != nullptr) {
+ GPR_ASSERT(weight_attribute->weight() != 0);
+ address_weight.weight = weight_attribute->weight();
+ }
+ sum += address_weight.weight;
+ address_weights.push_back(std::move(address_weight));
+ }
+ // Calculating normalized weights and find min and max.
+ double min_normalized_weight = 1.0;
+ double max_normalized_weight = 0.0;
+ for (auto& address : address_weights) {
+ address.normalized_weight = static_cast<double>(address.weight) / sum;
+ min_normalized_weight =
+ std::min(address.normalized_weight, min_normalized_weight);
+ max_normalized_weight =
+ std::max(address.normalized_weight, max_normalized_weight);
+ }
+ // Scale up the number of hashes per host such that the least-weighted host
+ // gets a whole number of hashes on the ring. Other hosts might not end up
+ // with whole numbers, and that's fine (the ring-building algorithm below can
+ // handle this). This preserves the original implementation's behavior: when
+ // weights aren't provided, all hosts should get an equal number of hashes. In
+ // the case where this number exceeds the max_ring_size, it's scaled back down
+ // to fit.
+ const size_t min_ring_size = parent_->config_->min_ring_size();
+ const size_t max_ring_size = parent_->config_->max_ring_size();
+ const double scale = std::min(
+ std::ceil(min_normalized_weight * min_ring_size) / min_normalized_weight,
+ static_cast<double>(max_ring_size));
+ // Reserve memory for the entire ring up front.
+ const uint64_t ring_size = std::ceil(scale);
+ ring_.reserve(ring_size);
+ // Populate the hash ring by walking through the (host, weight) pairs in
+ // normalized_host_weights, and generating (scale * weight) hashes for each
+ // host. Since these aren't necessarily whole numbers, we maintain running
+ // sums -- current_hashes and target_hashes -- which allows us to populate the
+ // ring in a mostly stable way.
+ y_absl::InlinedVector<char, 196> hash_key_buffer;
+ double current_hashes = 0.0;
+ double target_hashes = 0.0;
+ uint64_t min_hashes_per_host = ring_size;
+ uint64_t max_hashes_per_host = 0;
+ for (size_t i = 0; i < num_subchannels; ++i) {
+ const TString& address_string = address_weights[i].address;
+ hash_key_buffer.assign(address_string.begin(), address_string.end());
+ hash_key_buffer.emplace_back('_');
+ auto offset_start = hash_key_buffer.end();
+ target_hashes += scale * address_weights[i].normalized_weight;
+ size_t count = 0;
+ auto current_state =
+ subchannel_list->subchannel(i)->subchannel()->CheckConnectivityState();
+ while (current_hashes < target_hashes) {
+ const TString count_str = y_absl::StrCat(count);
+ hash_key_buffer.insert(offset_start, count_str.begin(), count_str.end());
+ y_absl::string_view hash_key(hash_key_buffer.data(),
+ hash_key_buffer.size());
+ const uint64_t hash = XXH64(hash_key.data(), hash_key.size(), 0);
+ ring_.push_back({hash,
+ subchannel_list->subchannel(i)->subchannel()->Ref(),
+ current_state});
+ ++count;
+ ++current_hashes;
+ hash_key_buffer.erase(offset_start, hash_key_buffer.end());
+ }
+ min_hashes_per_host =
+ std::min(static_cast<uint64_t>(i), min_hashes_per_host);
+ max_hashes_per_host =
+ std::max(static_cast<uint64_t>(i), max_hashes_per_host);
+ }
+ std::sort(ring_.begin(), ring_.end(),
+ [](const RingEntry& lhs, const RingEntry& rhs) -> bool {
+ return lhs.hash < rhs.hash;
+ });
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO,
+ "[RH %p picker %p] created picker from subchannel_list=%p "
+ "with %" PRIuPTR " ring entries",
+ parent_.get(), this, subchannel_list, ring_.size());
+ }
+}
+
+RingHash::PickResult RingHash::Picker::Pick(PickArgs args) {
+ auto hash =
+ args.call_state->ExperimentalGetCallAttribute(kRequestRingHashAttribute);
+ uint64_t h;
+ if (!y_absl::SimpleAtoi(hash, &h)) {
+ return PickResult::Fail(
+ y_absl::InternalError("xds ring hash value is not a number"));
+ }
+ // Ported from https://github.com/RJ/ketama/blob/master/libketama/ketama.c
+ // (ketama_get_server) NOTE: The algorithm depends on using signed integers
+ // for lowp, highp, and first_index. Do not change them!
+ int64_t lowp = 0;
+ int64_t highp = ring_.size();
+ int64_t first_index = 0;
+ while (true) {
+ first_index = (lowp + highp) / 2;
+ if (first_index == static_cast<int64_t>(ring_.size())) {
+ first_index = 0;
+ break;
+ }
+ uint64_t midval = ring_[first_index].hash;
+ uint64_t midval1 = first_index == 0 ? 0 : ring_[first_index - 1].hash;
+ if (h <= midval && h > midval1) {
+ break;
+ }
+ if (midval < h) {
+ lowp = first_index + 1;
+ } else {
+ highp = first_index - 1;
+ }
+ if (lowp > highp) {
+ first_index = 0;
+ break;
+ }
+ }
+ OrphanablePtr<SubchannelConnectionAttempter> subchannel_connection_attempter;
+ auto ScheduleSubchannelConnectionAttempt =
+ [&](RefCountedPtr<SubchannelInterface> subchannel) {
+ if (subchannel_connection_attempter == nullptr) {
+ subchannel_connection_attempter =
+ MakeOrphanable<SubchannelConnectionAttempter>(parent_);
+ }
+ subchannel_connection_attempter->AddSubchannel(std::move(subchannel));
+ };
+ switch (ring_[first_index].connectivity_state) {
+ case GRPC_CHANNEL_READY:
+ return PickResult::Complete(ring_[first_index].subchannel);
+ case GRPC_CHANNEL_IDLE:
+ ScheduleSubchannelConnectionAttempt(ring_[first_index].subchannel);
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case GRPC_CHANNEL_CONNECTING:
+ return PickResult::Queue();
+ default: // GRPC_CHANNEL_TRANSIENT_FAILURE
+ break;
+ }
+ ScheduleSubchannelConnectionAttempt(ring_[first_index].subchannel);
+ // Loop through remaining subchannels to find one in READY.
+ // On the way, we make sure the right set of connection attempts
+ // will happen.
+ bool found_second_subchannel = false;
+ bool found_first_non_failed = false;
+ for (size_t i = 1; i < ring_.size(); ++i) {
+ const RingEntry& entry = ring_[(first_index + i) % ring_.size()];
+ if (entry.subchannel == ring_[first_index].subchannel) {
+ continue;
+ }
+ if (entry.connectivity_state == GRPC_CHANNEL_READY) {
+ return PickResult::Complete(entry.subchannel);
+ }
+ if (!found_second_subchannel) {
+ switch (entry.connectivity_state) {
+ case GRPC_CHANNEL_IDLE:
+ ScheduleSubchannelConnectionAttempt(entry.subchannel);
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case GRPC_CHANNEL_CONNECTING:
+ return PickResult::Queue();
+ default:
+ break;
+ }
+ found_second_subchannel = true;
+ }
+ if (!found_first_non_failed) {
+ if (entry.connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ ScheduleSubchannelConnectionAttempt(entry.subchannel);
+ } else {
+ if (entry.connectivity_state == GRPC_CHANNEL_IDLE) {
+ ScheduleSubchannelConnectionAttempt(entry.subchannel);
+ }
+ found_first_non_failed = true;
+ }
+ }
+ }
+ return PickResult::Fail(y_absl::UnavailableError(
+ "xds ring hash found a subchannel that is in TRANSIENT_FAILURE state"));
+}
+
+//
+// RingHash::RingHashSubchannelList
+//
+
+void RingHash::RingHashSubchannelList::StartWatchingLocked() {
+ if (num_subchannels() == 0) return;
+ // Check current state of each subchannel synchronously.
+ for (size_t i = 0; i < num_subchannels(); ++i) {
+ grpc_connectivity_state state =
+ subchannel(i)->CheckConnectivityStateLocked();
+ subchannel(i)->UpdateConnectivityStateLocked(state);
+ }
+ // Start connectivity watch for each subchannel.
+ for (size_t i = 0; i < num_subchannels(); i++) {
+ if (subchannel(i)->subchannel() != nullptr) {
+ subchannel(i)->StartConnectivityWatchLocked();
+ }
+ }
+ RingHash* p = static_cast<RingHash*>(policy());
+ // Sending up the initial picker while all subchannels are in IDLE state.
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_READY, y_absl::Status(),
+ y_absl::make_unique<Picker>(p->Ref(DEBUG_LOCATION, "RingHashPicker"),
+ this));
+}
+
+void RingHash::RingHashSubchannelList::UpdateStateCountersLocked(
+ grpc_connectivity_state old_state, grpc_connectivity_state new_state) {
+ GPR_ASSERT(new_state != GRPC_CHANNEL_SHUTDOWN);
+ if (old_state == GRPC_CHANNEL_IDLE) {
+ GPR_ASSERT(num_idle_ > 0);
+ --num_idle_;
+ } else if (old_state == GRPC_CHANNEL_READY) {
+ GPR_ASSERT(num_ready_ > 0);
+ --num_ready_;
+ } else if (old_state == GRPC_CHANNEL_CONNECTING) {
+ GPR_ASSERT(num_connecting_ > 0);
+ --num_connecting_;
+ } else if (old_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ GPR_ASSERT(num_transient_failure_ > 0);
+ --num_transient_failure_;
+ }
+ if (new_state == GRPC_CHANNEL_IDLE) {
+ ++num_idle_;
+ } else if (new_state == GRPC_CHANNEL_READY) {
+ ++num_ready_;
+ } else if (new_state == GRPC_CHANNEL_CONNECTING) {
+ ++num_connecting_;
+ } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ ++num_transient_failure_;
+ }
+}
+
+// Sets the RH policy's connectivity state and generates a new picker based
+// on the current subchannel list or requests an re-attempt by returning true..
+bool RingHash::RingHashSubchannelList::UpdateRingHashConnectivityStateLocked() {
+ RingHash* p = static_cast<RingHash*>(policy());
+ // Only set connectivity state if this is the current subchannel list.
+ if (p->subchannel_list_.get() != this) return false;
+ // The overall aggregation rules here are:
+ // 1. If there is at least one subchannel in READY state, report READY.
+ // 2. If there are 2 or more subchannels in TRANSIENT_FAILURE state, report
+ // TRANSIENT_FAILURE.
+ // 3. If there is at least one subchannel in CONNECTING state, report
+ // CONNECTING.
+ // 4. If there is at least one subchannel in IDLE state, report IDLE.
+ // 5. Otherwise, report TRANSIENT_FAILURE.
+ if (num_ready_ > 0) {
+ /* READY */
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_READY, y_absl::Status(),
+ y_absl::make_unique<Picker>(p->Ref(DEBUG_LOCATION, "RingHashPicker"),
+ this));
+ return false;
+ }
+ if (num_connecting_ > 0 && num_transient_failure_ < 2) {
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_CONNECTING, y_absl::Status(),
+ y_absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
+ return false;
+ }
+ if (num_idle_ > 0 && num_transient_failure_ < 2) {
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_IDLE, y_absl::Status(),
+ y_absl::make_unique<Picker>(p->Ref(DEBUG_LOCATION, "RingHashPicker"),
+ this));
+ return false;
+ }
+ y_absl::Status status =
+ y_absl::UnavailableError("connections to backend failing or idle");
+ p->channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
+ return true;
+}
+
+//
+// RingHash::RingHashSubchannelData
+//
+
+void RingHash::RingHashSubchannelData::UpdateConnectivityStateLocked(
+ grpc_connectivity_state connectivity_state) {
+ RingHash* p = static_cast<RingHash*>(subchannel_list()->policy());
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[RR %p] connectivity changed for subchannel %p, subchannel_list %p "
+ "(index %" PRIuPTR " of %" PRIuPTR "): prev_state=%s new_state=%s",
+ p, subchannel(), subchannel_list(), Index(),
+ subchannel_list()->num_subchannels(),
+ ConnectivityStateName(last_connectivity_state_),
+ ConnectivityStateName(connectivity_state));
+ }
+ // Decide what state to report for aggregation purposes.
+ // If we haven't seen a failure since the last time we were in state
+ // READY, then we report the state change as-is. However, once we do see
+ // a failure, we report TRANSIENT_FAILURE and do not report any subsequent
+ // state changes until we go back into state READY.
+ if (!seen_failure_since_ready_) {
+ if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ seen_failure_since_ready_ = true;
+ }
+ subchannel_list()->UpdateStateCountersLocked(last_connectivity_state_,
+ connectivity_state);
+ } else {
+ if (connectivity_state == GRPC_CHANNEL_READY) {
+ seen_failure_since_ready_ = false;
+ subchannel_list()->UpdateStateCountersLocked(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, connectivity_state);
+ }
+ }
+ // Record last seen connectivity state.
+ last_connectivity_state_ = connectivity_state;
+}
+
+void RingHash::RingHashSubchannelData::ProcessConnectivityChangeLocked(
+ grpc_connectivity_state connectivity_state) {
+ RingHash* p = static_cast<RingHash*>(subchannel_list()->policy());
+ GPR_ASSERT(subchannel() != nullptr);
+ // If the new state is TRANSIENT_FAILURE, re-resolve.
+ // Only do this if we've started watching, not at startup time.
+ // Otherwise, if the subchannel was already in state TRANSIENT_FAILURE
+ // when the subchannel list was created, we'd wind up in a constant
+ // loop of re-resolution.
+ // Also attempt to reconnect.
+ if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO,
+ "[RR %p] Subchannel %p has gone into TRANSIENT_FAILURE. "
+ "Requesting re-resolution",
+ p, subchannel());
+ }
+ p->channel_control_helper()->RequestReresolution();
+ }
+ // Update state counters.
+ UpdateConnectivityStateLocked(connectivity_state);
+ // Update the RH policy's connectivity state, creating new picker and new
+ // ring.
+ bool transient_failure =
+ subchannel_list()->UpdateRingHashConnectivityStateLocked();
+ // While the ring_hash policy is reporting TRANSIENT_FAILURE, it will
+ // not be getting any pick requests from the priority policy.
+ // However, because the ring_hash policy does not attempt to
+ // reconnect to subchannels unless it is getting pick requests,
+ // it will need special handling to ensure that it will eventually
+ // recover from TRANSIENT_FAILURE state once the problem is resolved.
+ // Specifically, it will make sure that it is attempting to connect to
+ // at least one subchannel at any given time. After a given subchannel
+ // fails a connection attempt, it will move on to the next subchannel
+ // in the ring. It will keep doing this until one of the subchannels
+ // successfully connects, at which point it will report READY and stop
+ // proactively trying to connect. The policy will remain in
+ // TRANSIENT_FAILURE until at least one subchannel becomes connected,
+ // even if subchannels are in state CONNECTING during that time.
+ if (transient_failure &&
+ connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ size_t next_index = (Index() + 1) % subchannel_list()->num_subchannels();
+ RingHashSubchannelData* next_sd = subchannel_list()->subchannel(next_index);
+ next_sd->subchannel()->AttemptToConnect();
+ }
+}
+
+//
+// RingHash
+//
+
+RingHash::RingHash(Args args) : LoadBalancingPolicy(std::move(args)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Created", this);
+ }
+}
+
+RingHash::~RingHash() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Destroying Ring Hash policy", this);
+ }
+ GPR_ASSERT(subchannel_list_ == nullptr);
+}
+
+void RingHash::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RH %p] Shutting down", this);
+ }
+ shutdown_ = true;
+ subchannel_list_.reset();
+}
+
+void RingHash::ResetBackoffLocked() { subchannel_list_->ResetBackoffLocked(); }
+
+void RingHash::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_ring_hash_trace)) {
+ gpr_log(GPR_INFO, "[RR %p] received update with %" PRIuPTR " addresses",
+ this, args.addresses.size());
+ }
+ config_ = std::move(args.config);
+ // Filter out any address with weight 0.
+ ServerAddressList addresses;
+ addresses.reserve(args.addresses.size());
+ for (ServerAddress& address : args.addresses) {
+ const ServerAddressWeightAttribute* weight_attribute =
+ static_cast<const ServerAddressWeightAttribute*>(address.GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ if (weight_attribute == nullptr || weight_attribute->weight() > 0) {
+ addresses.push_back(std::move(address));
+ }
+ }
+ subchannel_list_ = MakeOrphanable<RingHashSubchannelList>(
+ this, &grpc_lb_ring_hash_trace, std::move(addresses), *args.args);
+ if (subchannel_list_->num_subchannels() == 0) {
+ // If the new list is empty, immediately transition to TRANSIENT_FAILURE.
+ y_absl::Status status = y_absl::UnavailableError("Empty update");
+ channel_control_helper()->UpdateState(
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
+ } else {
+ // Start watching the new list.
+ subchannel_list_->StartWatchingLocked();
+ }
+}
+
+//
+// factory
+//
+
+class RingHashFactory : public LoadBalancingPolicyFactory {
+ public:
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<RingHash>(std::move(args));
+ }
+
+ const char* name() const override { return kRingHash; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error_handle* error) const override {
+ size_t min_ring_size;
+ size_t max_ring_size;
+ std::vector<grpc_error_handle> error_list;
+ ParseRingHashLbConfig(json, &min_ring_size, &max_ring_size, &error_list);
+ if (error_list.empty()) {
+ return MakeRefCounted<RingHashLbConfig>(min_ring_size, max_ring_size);
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "ring_hash_experimental LB policy config", &error_list);
+ return nullptr;
+ }
+ }
+};
+
+} // namespace
+
+void GrpcLbPolicyRingHashInit() {
+ LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<RingHashFactory>());
+}
+
+void GrpcLbPolicyRingHashShutdown() {}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
index dc176c2dc49..f0f86b25239 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h
@@ -19,9 +19,19 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/json/json.h"
+
namespace grpc_core {
extern const char* kRequestRingHashAttribute;
+// Helper Parsing method to parse ring hash policy configs; for example, ring
+// hash size validity.
+void ParseRingHashLbConfig(const Json& json, size_t* min_ring_size,
+ size_t* max_ring_size,
+ std::vector<grpc_error_handle>* error_list);
} // namespace grpc_core
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_RING_HASH_RING_HASH_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
new file mode 100644
index 00000000000..c437c52207c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
@@ -0,0 +1,2502 @@
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// Implementation of the Route Lookup Service (RLS) LB policy
+//
+// The policy queries a route lookup service for the name of the actual service
+// to use. A child policy that recognizes the name as a field of its
+// configuration will take further load balancing action on the request.
+
+#include <grpc/support/port_platform.h>
+
+#include <stdlib.h>
+
+#include <algorithm>
+#include <deque>
+#include <functional>
+#include <list>
+#include <map>
+#include <util/generic/string.h>
+#include <unordered_map>
+#include <utility>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/hash/hash.h"
+#include "y_absl/memory/memory.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/strip.h"
+#include "upb/upb.hpp"
+
+#include <grpc/grpc_security.h>
+#include <grpc/impl/codegen/byte_buffer_reader.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/time.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/lb_policy.h"
+#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/json/json.h"
+#include "src/core/lib/json/json_util.h"
+#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/surface/call.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/uri/uri_parser.h"
+#include "src/proto/grpc/lookup/v1/rls.upb.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_lb_rls_trace(false, "rls_lb");
+
+namespace {
+
+const char* kRls = "rls";
+const char kGrpc[] = "grpc";
+const char* kRlsRequestPath = "/grpc.lookup.v1.RouteLookupService/RouteLookup";
+const char* kFakeTargetFieldValue = "fake_target_field_value";
+const char* kRlsHeaderKey = "X-Google-RLS-Data";
+
+const grpc_millis kDefaultLookupServiceTimeout = 10000;
+const grpc_millis kMaxMaxAge = 5 * 60 * GPR_MS_PER_SEC;
+const grpc_millis kMinExpirationTime = 5 * GPR_MS_PER_SEC;
+const grpc_millis kCacheBackoffInitial = 1 * GPR_MS_PER_SEC;
+const double kCacheBackoffMultiplier = 1.6;
+const double kCacheBackoffJitter = 0.2;
+const grpc_millis kCacheBackoffMax = 120 * GPR_MS_PER_SEC;
+const grpc_millis kDefaultThrottleWindowSize = 30 * GPR_MS_PER_SEC;
+const double kDefaultThrottleRatioForSuccesses = 2.0;
+const int kDefaultThrottlePaddings = 8;
+const grpc_millis kCacheCleanupTimerInterval = 60 * GPR_MS_PER_SEC;
+const int64_t kMaxCacheSizeBytes = 5 * 1024 * 1024;
+
+// Parsed RLS LB policy configuration.
+class RlsLbConfig : public LoadBalancingPolicy::Config {
+ public:
+ struct KeyBuilder {
+ std::map<TString /*key*/, std::vector<TString /*header*/>>
+ header_keys;
+ TString host_key;
+ TString service_key;
+ TString method_key;
+ std::map<TString /*key*/, TString /*value*/> constant_keys;
+ };
+ using KeyBuilderMap = std::unordered_map<TString /*path*/, KeyBuilder>;
+
+ struct RouteLookupConfig {
+ KeyBuilderMap key_builder_map;
+ TString lookup_service;
+ grpc_millis lookup_service_timeout = 0;
+ grpc_millis max_age = 0;
+ grpc_millis stale_age = 0;
+ int64_t cache_size_bytes = 0;
+ TString default_target;
+ };
+
+ RlsLbConfig(RouteLookupConfig route_lookup_config, Json child_policy_config,
+ TString child_policy_config_target_field_name,
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config)
+ : route_lookup_config_(std::move(route_lookup_config)),
+ child_policy_config_(std::move(child_policy_config)),
+ child_policy_config_target_field_name_(
+ std::move(child_policy_config_target_field_name)),
+ default_child_policy_parsed_config_(
+ std::move(default_child_policy_parsed_config)) {}
+
+ const char* name() const override { return kRls; }
+
+ const KeyBuilderMap& key_builder_map() const {
+ return route_lookup_config_.key_builder_map;
+ }
+ const TString& lookup_service() const {
+ return route_lookup_config_.lookup_service;
+ }
+ grpc_millis lookup_service_timeout() const {
+ return route_lookup_config_.lookup_service_timeout;
+ }
+ grpc_millis max_age() const { return route_lookup_config_.max_age; }
+ grpc_millis stale_age() const { return route_lookup_config_.stale_age; }
+ int64_t cache_size_bytes() const {
+ return route_lookup_config_.cache_size_bytes;
+ }
+ const TString& default_target() const {
+ return route_lookup_config_.default_target;
+ }
+ const Json& child_policy_config() const { return child_policy_config_; }
+ const TString& child_policy_config_target_field_name() const {
+ return child_policy_config_target_field_name_;
+ }
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config() const {
+ return default_child_policy_parsed_config_;
+ }
+
+ private:
+ RouteLookupConfig route_lookup_config_;
+ Json child_policy_config_;
+ TString child_policy_config_target_field_name_;
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config_;
+};
+
+// RLS LB policy.
+class RlsLb : public LoadBalancingPolicy {
+ public:
+ explicit RlsLb(Args args);
+
+ const char* name() const override { return kRls; }
+ void UpdateLocked(UpdateArgs args) override;
+ void ExitIdleLocked() override;
+ void ResetBackoffLocked() override;
+
+ private:
+ // Key to access entries in the cache and the request map.
+ struct RequestKey {
+ std::map<TString, TString> key_map;
+
+ bool operator==(const RequestKey& rhs) const {
+ return key_map == rhs.key_map;
+ }
+
+ template <typename H>
+ friend H AbslHashValue(H h, const RequestKey& key) {
+ std::hash<TString> string_hasher;
+ for (auto& kv : key.key_map) {
+ h = H::combine(std::move(h), string_hasher(kv.first),
+ string_hasher(kv.second));
+ }
+ return h;
+ }
+
+ size_t Size() const {
+ size_t size = sizeof(RequestKey);
+ for (auto& kv : key_map) {
+ size += kv.first.length() + kv.second.length();
+ }
+ return size;
+ }
+
+ TString ToString() const {
+ return y_absl::StrCat(
+ "{", y_absl::StrJoin(key_map, ",", y_absl::PairFormatter("=")), "}");
+ }
+ };
+
+ // Data from an RLS response.
+ struct ResponseInfo {
+ y_absl::Status status;
+ std::vector<TString> targets;
+ TString header_data;
+
+ TString ToString() const {
+ return y_absl::StrFormat("{status=%s, targets=[%s], header_data=\"%s\"}",
+ status.ToString(), y_absl::StrJoin(targets, ","),
+ header_data);
+ }
+ };
+
+ // Wraps a child policy for a given RLS target.
+ class ChildPolicyWrapper : public DualRefCounted<ChildPolicyWrapper> {
+ public:
+ ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy, TString target);
+
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override Y_ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ const TString& target() const { return target_; }
+
+ PickResult Pick(PickArgs args) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return picker_->Pick(args);
+ }
+
+ // Updates for the child policy are handled in two phases:
+ // 1. In StartUpdate(), we parse and validate the new child policy
+ // config and store the parsed config.
+ // 2. In MaybeFinishUpdate(), we actually pass the parsed config to the
+ // child policy's UpdateLocked() method.
+ //
+ // The reason we do this is to avoid deadlocks. In StartUpdate(),
+ // if the new config fails to validate, then we need to set
+ // picker_ to an instance that will fail all requests, which
+ // requires holding the lock. However, we cannot call the child
+ // policy's UpdateLocked() method from MaybeFinishUpdate() while
+ // holding the lock, since that would cause a deadlock: the child's
+ // UpdateLocked() will call the helper's UpdateState() method, which
+ // will try to acquire the lock to set picker_. So StartUpdate() is
+ // called while we are still holding the lock, but MaybeFinishUpdate()
+ // is called after releasing it.
+ //
+ // Both methods grab the data they need from the parent object.
+ void StartUpdate() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+ // Does not take ownership of channel_args.
+ void MaybeFinishUpdate() Y_ABSL_LOCKS_EXCLUDED(&RlsLb::mu_);
+
+ void ExitIdleLocked() {
+ if (child_policy_ != nullptr) child_policy_->ExitIdleLocked();
+ }
+
+ void ResetBackoffLocked() {
+ if (child_policy_ != nullptr) child_policy_->ResetBackoffLocked();
+ }
+
+ // Gets the connectivity state of the child policy. Once the child policy
+ // reports TRANSIENT_FAILURE, the function will always return
+ // TRANSIENT_FAILURE state instead of the actual state of the child policy
+ // until the child policy reports another READY state.
+ grpc_connectivity_state connectivity_state() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return connectivity_state_;
+ }
+
+ private:
+ // ChannelControlHelper object that allows the child policy to update state
+ // with the wrapper.
+ class ChildPolicyHelper : public LoadBalancingPolicy::ChannelControlHelper {
+ public:
+ explicit ChildPolicyHelper(WeakRefCountedPtr<ChildPolicyWrapper> wrapper)
+ : wrapper_(std::move(wrapper)) {}
+ ~ChildPolicyHelper() override {
+ wrapper_.reset(DEBUG_LOCATION, "ChildPolicyHelper");
+ }
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override;
+ void UpdateState(grpc_connectivity_state state,
+ const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override;
+ void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override;
+
+ private:
+ WeakRefCountedPtr<ChildPolicyWrapper> wrapper_;
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ TString target_;
+
+ bool is_shutdown_ = false;
+
+ OrphanablePtr<ChildPolicyHandler> child_policy_;
+ RefCountedPtr<LoadBalancingPolicy::Config> pending_config_;
+
+ grpc_connectivity_state connectivity_state_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_CHANNEL_IDLE;
+ std::unique_ptr<LoadBalancingPolicy::SubchannelPicker> picker_
+ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ // A picker that uses the cache and the request map in the LB policy
+ // (synchronized via a mutex) to determine how to route requests.
+ class Picker : public LoadBalancingPolicy::SubchannelPicker {
+ public:
+ explicit Picker(RefCountedPtr<RlsLb> lb_policy);
+ ~Picker() override;
+
+ PickResult Pick(PickArgs args) override;
+
+ private:
+ RefCountedPtr<RlsLb> lb_policy_;
+ RefCountedPtr<RlsLbConfig> config_;
+ RefCountedPtr<ChildPolicyWrapper> default_child_policy_;
+ };
+
+ // An LRU cache with adjustable size.
+ class Cache {
+ public:
+ using Iterator = std::list<RequestKey>::iterator;
+
+ class Entry : public InternallyRefCounted<Entry> {
+ public:
+ Entry(RefCountedPtr<RlsLb> lb_policy, const RequestKey& key);
+
+ // Notify the entry when it's evicted from the cache. Performs shut down.
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override Y_ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ const y_absl::Status& status() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return status_;
+ }
+ grpc_millis backoff_time() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return backoff_time_;
+ }
+ grpc_millis backoff_expiration_time() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return backoff_expiration_time_;
+ }
+ grpc_millis data_expiration_time() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return data_expiration_time_;
+ }
+ const TString& header_data() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return header_data_;
+ }
+ grpc_millis stale_time() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return stale_time_;
+ }
+ grpc_millis min_expiration_time() const
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return min_expiration_time_;
+ }
+
+ std::unique_ptr<BackOff> TakeBackoffState()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return std::move(backoff_state_);
+ }
+
+ // Cache size of entry.
+ size_t Size() const Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Pick subchannel for request based on the entry's state.
+ PickResult Pick(PickArgs args) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // If the cache entry is in backoff state, resets the backoff and, if
+ // applicable, its backoff timer. The method does not update the LB
+ // policy's picker; the caller is responsible for that if necessary.
+ void ResetBackoff() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Check if the entry should be removed by the clean-up timer.
+ bool ShouldRemove() const Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Check if the entry can be evicted from the cache, i.e. the
+ // min_expiration_time_ has passed.
+ bool CanEvict() const Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Updates the entry upon reception of a new RLS response.
+ // Returns a list of child policy wrappers on which FinishUpdate()
+ // needs to be called after releasing the lock.
+ std::vector<ChildPolicyWrapper*> OnRlsResponseLocked(
+ ResponseInfo response, std::unique_ptr<BackOff> backoff_state)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Moves entry to the end of the LRU list.
+ void MarkUsed() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ class BackoffTimer : public InternallyRefCounted<BackoffTimer> {
+ public:
+ BackoffTimer(RefCountedPtr<Entry> entry, grpc_millis backoff_time);
+
+ // Note: We are forced to disable lock analysis here because
+ // Orphan() is called by OrphanablePtr<>, which cannot have lock
+ // annotations for this particular caller.
+ void Orphan() override Y_ABSL_NO_THREAD_SAFETY_ANALYSIS;
+
+ private:
+ static void OnBackoffTimer(void* args, grpc_error_handle error);
+
+ RefCountedPtr<Entry> entry_;
+ bool armed_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) = true;
+ grpc_timer backoff_timer_;
+ grpc_closure backoff_timer_callback_;
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+
+ bool is_shutdown_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) = false;
+
+ // Backoff states
+ y_absl::Status status_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ std::unique_ptr<BackOff> backoff_state_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ grpc_millis backoff_time_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_MILLIS_INF_PAST;
+ grpc_millis backoff_expiration_time_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_MILLIS_INF_PAST;
+ OrphanablePtr<BackoffTimer> backoff_timer_;
+
+ // RLS response states
+ std::vector<RefCountedPtr<ChildPolicyWrapper>> child_policy_wrappers_
+ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ TString header_data_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ grpc_millis data_expiration_time_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_MILLIS_INF_PAST;
+ grpc_millis stale_time_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) =
+ GRPC_MILLIS_INF_PAST;
+
+ grpc_millis min_expiration_time_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ Cache::Iterator lru_iterator_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ explicit Cache(RlsLb* lb_policy);
+
+ // Finds an entry from the cache that corresponds to a key. If an entry is
+ // not found, nullptr is returned. Otherwise, the entry is considered
+ // recently used and its order in the LRU list of the cache is updated.
+ Entry* Find(const RequestKey& key)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Finds an entry from the cache that corresponds to a key. If an entry is
+ // not found, an entry is created, inserted in the cache, and returned to
+ // the caller. Otherwise, the entry found is returned to the caller. The
+ // entry returned to the user is considered recently used and its order in
+ // the LRU list of the cache is updated.
+ Entry* FindOrInsert(const RequestKey& key)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Resizes the cache. If the new cache size is greater than the current size
+ // of the cache, do nothing. Otherwise, evict the oldest entries that
+ // exceed the new size limit of the cache.
+ void Resize(size_t bytes) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Resets backoff of all the cache entries.
+ void ResetAllBackoff() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Shutdown the cache; clean-up and orphan all the stored cache entries.
+ void Shutdown() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ static void OnCleanupTimer(void* arg, grpc_error_handle error);
+
+ // Returns the entry size for a given key.
+ static size_t EntrySizeForKey(const RequestKey& key);
+
+ // Evicts oversized cache elements when the current size is greater than
+ // the specified limit.
+ void MaybeShrinkSize(size_t bytes)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ RlsLb* lb_policy_;
+
+ size_t size_limit_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) = 0;
+ size_t size_ Y_ABSL_GUARDED_BY(&RlsLb::mu_) = 0;
+
+ std::list<RequestKey> lru_list_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ std::unordered_map<RequestKey, OrphanablePtr<Entry>, y_absl::Hash<RequestKey>>
+ map_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ grpc_timer cleanup_timer_;
+ grpc_closure timer_callback_;
+ };
+
+ // Channel for communicating with the RLS server.
+ // Contains throttling logic for RLS requests.
+ class RlsChannel : public InternallyRefCounted<RlsChannel> {
+ public:
+ RlsChannel(RefCountedPtr<RlsLb> lb_policy, const TString& target,
+ const grpc_channel_args* parent_channel_args);
+
+ // Shuts down the channel.
+ void Orphan() override;
+
+ // Starts an RLS call.
+ // If stale_entry is non-null, it points to the entry containing
+ // stale data for the key.
+ void StartRlsCall(const RequestKey& key, Cache::Entry* stale_entry)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Reports the result of an RLS call to the throttle.
+ void ReportResponseLocked(bool response_succeeded)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ // Checks if a proposed RLS call should be throttled.
+ bool ShouldThrottle() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ return throttle_.ShouldThrottle();
+ }
+
+ // Resets the channel's backoff.
+ void ResetBackoff();
+
+ grpc_channel* channel() const { return channel_; }
+
+ private:
+ // Watches the state of the RLS channel. Notifies the LB policy when
+ // the channel was previously in TRANSIENT_FAILURE and then becomes READY.
+ class StateWatcher : public AsyncConnectivityStateWatcherInterface {
+ public:
+ explicit StateWatcher(RefCountedPtr<RlsChannel> rls_channel)
+ : AsyncConnectivityStateWatcherInterface(
+ rls_channel->lb_policy_->work_serializer()),
+ rls_channel_(std::move(rls_channel)) {}
+
+ private:
+ void OnConnectivityStateChange(grpc_connectivity_state new_state,
+ const y_absl::Status& status) override;
+
+ RefCountedPtr<RlsChannel> rls_channel_;
+ bool was_transient_failure_ = false;
+ };
+
+ // Throttle state for RLS requests.
+ class Throttle {
+ public:
+ explicit Throttle(int window_size_seconds = 0,
+ double ratio_for_successes = 0, int paddings = 0);
+
+ bool ShouldThrottle() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ void RegisterResponse(bool success)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_);
+
+ private:
+ grpc_millis window_size_;
+ double ratio_for_successes_;
+ int paddings_;
+
+ // Logged timestamp of requests.
+ std::deque<grpc_millis> requests_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+
+ // Logged timestamp of responses that were successful.
+ std::deque<grpc_millis> successes_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ bool is_shutdown_ = false;
+
+ grpc_channel* channel_ = nullptr;
+ RefCountedPtr<channelz::ChannelNode> parent_channelz_node_;
+ StateWatcher* watcher_ = nullptr;
+ Throttle throttle_ Y_ABSL_GUARDED_BY(&RlsLb::mu_);
+ };
+
+ // A pending RLS request. Instances will be tracked in request_map_.
+ class RlsRequest : public InternallyRefCounted<RlsRequest> {
+ public:
+ // Asynchronously starts a call on rls_channel for key.
+ // Stores backoff_state, which will be transferred to the data cache
+ // if the RLS request fails.
+ RlsRequest(RefCountedPtr<RlsLb> lb_policy, RlsLb::RequestKey key,
+ RefCountedPtr<RlsChannel> rls_channel,
+ std::unique_ptr<BackOff> backoff_state,
+ grpc_lookup_v1_RouteLookupRequest_Reason reason,
+ TString stale_header_data);
+ ~RlsRequest() override;
+
+ // Shuts down the request. If the request is still in flight, it is
+ // cancelled, in which case no response will be added to the cache.
+ void Orphan() override;
+
+ private:
+ // Callback to be invoked to start the call.
+ static void StartCall(void* arg, grpc_error_handle error);
+
+ // Helper for StartCall() that runs within the WorkSerializer.
+ void StartCallLocked();
+
+ // Callback to be invoked when the call is completed.
+ static void OnRlsCallComplete(void* arg, grpc_error_handle error);
+
+ // Call completion callback running on LB policy WorkSerializer.
+ void OnRlsCallCompleteLocked(grpc_error_handle error);
+
+ grpc_byte_buffer* MakeRequestProto();
+ ResponseInfo ParseResponseProto();
+
+ RefCountedPtr<RlsLb> lb_policy_;
+ RlsLb::RequestKey key_;
+ RefCountedPtr<RlsChannel> rls_channel_;
+ std::unique_ptr<BackOff> backoff_state_;
+ grpc_lookup_v1_RouteLookupRequest_Reason reason_;
+ TString stale_header_data_;
+
+ // RLS call state.
+ grpc_millis deadline_;
+ grpc_closure call_start_cb_;
+ grpc_closure call_complete_cb_;
+ grpc_call* call_ = nullptr;
+ grpc_byte_buffer* send_message_ = nullptr;
+ grpc_metadata_array recv_initial_metadata_;
+ grpc_byte_buffer* recv_message_ = nullptr;
+ grpc_metadata_array recv_trailing_metadata_;
+ grpc_status_code status_recv_;
+ grpc_slice status_details_recv_;
+ };
+
+ void ShutdownLocked() override;
+
+ // Returns a new picker to the channel to trigger reprocessing of
+ // pending picks. Schedules the actual picker update on the ExecCtx
+ // to be run later, so it's safe to invoke this while holding the lock.
+ void UpdatePickerAsync();
+ // Hops into work serializer and calls UpdatePickerLocked().
+ static void UpdatePickerCallback(void* arg, grpc_error_handle error);
+ // Updates the picker in the work serializer.
+ void UpdatePickerLocked() Y_ABSL_LOCKS_EXCLUDED(&mu_);
+
+ // The name of the server for the channel.
+ TString server_name_;
+
+ // Mutex to guard LB policy state that is accessed by the picker.
+ Mutex mu_;
+ bool is_shutdown_ Y_ABSL_GUARDED_BY(mu_) = false;
+ Cache cache_ Y_ABSL_GUARDED_BY(mu_);
+ // Maps an RLS request key to an RlsRequest object that represents a pending
+ // RLS request.
+ std::unordered_map<RequestKey, OrphanablePtr<RlsRequest>,
+ y_absl::Hash<RequestKey>>
+ request_map_ Y_ABSL_GUARDED_BY(mu_);
+ // The channel on which RLS requests are sent.
+ // Note that this channel may be swapped out when the RLS policy gets
+ // an update. However, when that happens, any existing entries in
+ // request_map_ will continue to use the previous channel.
+ OrphanablePtr<RlsChannel> rls_channel_ Y_ABSL_GUARDED_BY(mu_);
+
+ // Accessed only from within WorkSerializer.
+ ServerAddressList addresses_;
+ const grpc_channel_args* channel_args_ = nullptr;
+ RefCountedPtr<RlsLbConfig> config_;
+ RefCountedPtr<ChildPolicyWrapper> default_child_policy_;
+ std::map<TString /*target*/, ChildPolicyWrapper*> child_policy_map_;
+};
+
+//
+// RlsLb::ChildPolicyWrapper
+//
+
+RlsLb::ChildPolicyWrapper::ChildPolicyWrapper(RefCountedPtr<RlsLb> lb_policy,
+ TString target)
+ : DualRefCounted<ChildPolicyWrapper>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "ChildPolicyWrapper"
+ : nullptr),
+ lb_policy_(lb_policy),
+ target_(std::move(target)),
+ picker_(y_absl::make_unique<QueuePicker>(std::move(lb_policy))) {
+ lb_policy_->child_policy_map_.emplace(target_, this);
+}
+
+void RlsLb::ChildPolicyWrapper::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] ChildPolicyWrapper=%p [%s]: shutdown",
+ lb_policy_.get(), this, target_.c_str());
+ }
+ is_shutdown_ = true;
+ lb_policy_->child_policy_map_.erase(target_);
+ if (child_policy_ != nullptr) {
+ grpc_pollset_set_del_pollset_set(child_policy_->interested_parties(),
+ lb_policy_->interested_parties());
+ child_policy_.reset();
+ }
+ picker_.reset();
+}
+
+grpc_error_handle InsertOrUpdateChildPolicyField(const TString& field,
+ const TString& value,
+ Json* config) {
+ if (config->type() != Json::Type::ARRAY) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy configuration is not an array");
+ }
+ std::vector<grpc_error_handle> error_list;
+ for (Json& child_json : *config->mutable_array()) {
+ if (child_json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item is not an object"));
+ } else {
+ Json::Object& child = *child_json.mutable_object();
+ if (child.size() != 1) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item contains more than one field"));
+ } else {
+ Json& child_config_json = child.begin()->second;
+ if (child_config_json.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "child policy item config is not an object"));
+ } else {
+ Json::Object& child_config = *child_config_json.mutable_object();
+ child_config[field] = Json(value);
+ }
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("errors when inserting field \"", field,
+ "\" for child policy"),
+ &error_list);
+}
+
+void RlsLb::ChildPolicyWrapper::StartUpdate() {
+ Json child_policy_config = lb_policy_->config_->child_policy_config();
+ grpc_error_handle error = InsertOrUpdateChildPolicyField(
+ lb_policy_->config_->child_policy_config_target_field_name(), target_,
+ &child_policy_config);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s]: validating update, config: %s",
+ lb_policy_.get(), this, target_.c_str(),
+ child_policy_config.Dump().c_str());
+ }
+ pending_config_ = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ child_policy_config, &error);
+ // Returned RLS target fails the validation.
+ if (error != GRPC_ERROR_NONE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s]: config failed to parse: "
+ "%s; config: %s",
+ lb_policy_.get(), this, target_.c_str(),
+ grpc_error_std_string(error).c_str(),
+ child_policy_config.Dump().c_str());
+ }
+ pending_config_.reset();
+ picker_ = y_absl::make_unique<TransientFailurePicker>(
+ grpc_error_to_absl_status(error));
+ GRPC_ERROR_UNREF(error);
+ child_policy_.reset();
+ }
+}
+
+void RlsLb::ChildPolicyWrapper::MaybeFinishUpdate() {
+ // If pending_config_ is not set, that means StartUpdate() failed, so
+ // there's nothing to do here.
+ if (pending_config_ == nullptr) return;
+ // If child policy doesn't yet exist, create it.
+ if (child_policy_ == nullptr) {
+ Args create_args;
+ create_args.work_serializer = lb_policy_->work_serializer();
+ create_args.channel_control_helper = y_absl::make_unique<ChildPolicyHelper>(
+ WeakRef(DEBUG_LOCATION, "ChildPolicyHelper"));
+ create_args.args = lb_policy_->channel_args_;
+ child_policy_ = MakeOrphanable<ChildPolicyHandler>(std::move(create_args),
+ &grpc_lb_rls_trace);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s], created new child policy "
+ "handler %p",
+ lb_policy_.get(), this, target_.c_str(), child_policy_.get());
+ }
+ grpc_pollset_set_add_pollset_set(child_policy_->interested_parties(),
+ lb_policy_->interested_parties());
+ }
+ // Send the child the updated config.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s], updating child policy "
+ "handler %p",
+ lb_policy_.get(), this, target_.c_str(), child_policy_.get());
+ }
+ UpdateArgs update_args;
+ update_args.config = std::move(pending_config_);
+ update_args.addresses = lb_policy_->addresses_;
+ update_args.args = grpc_channel_args_copy(lb_policy_->channel_args_);
+ child_policy_->UpdateLocked(std::move(update_args));
+}
+
+//
+// RlsLb::ChildPolicyWrapper::ChildPolicyHelper
+//
+
+RefCountedPtr<SubchannelInterface>
+RlsLb::ChildPolicyWrapper::ChildPolicyHelper::CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "CreateSubchannel() for %s",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this, address.ToString().c_str());
+ }
+ if (wrapper_->is_shutdown_) return nullptr;
+ return wrapper_->lb_policy_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::UpdateState(
+ grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "UpdateState(state=%s, status=%s, picker=%p)",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this, ConnectivityStateName(state),
+ status.ToString().c_str(), picker.get());
+ }
+ {
+ MutexLock lock(&wrapper_->lb_policy_->mu_);
+ if (wrapper_->is_shutdown_) return;
+ if (wrapper_->connectivity_state_ == GRPC_CHANNEL_TRANSIENT_FAILURE &&
+ state != GRPC_CHANNEL_READY) {
+ return;
+ }
+ wrapper_->connectivity_state_ = state;
+ GPR_DEBUG_ASSERT(picker != nullptr);
+ if (picker != nullptr) {
+ wrapper_->picker_ = std::move(picker);
+ }
+ }
+ wrapper_->lb_policy_->UpdatePickerLocked();
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::RequestReresolution() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] ChildPolicyWrapper=%p [%s] ChildPolicyHelper=%p: "
+ "RequestReresolution",
+ wrapper_->lb_policy_.get(), wrapper_.get(),
+ wrapper_->target_.c_str(), this);
+ }
+ if (wrapper_->is_shutdown_) return;
+ wrapper_->lb_policy_->channel_control_helper()->RequestReresolution();
+}
+
+y_absl::string_view RlsLb::ChildPolicyWrapper::ChildPolicyHelper::GetAuthority() {
+ return wrapper_->lb_policy_->channel_control_helper()->GetAuthority();
+}
+
+void RlsLb::ChildPolicyWrapper::ChildPolicyHelper::AddTraceEvent(
+ TraceSeverity severity, y_absl::string_view message) {
+ if (wrapper_->is_shutdown_) return;
+ wrapper_->lb_policy_->channel_control_helper()->AddTraceEvent(severity,
+ message);
+}
+
+//
+// RlsLb::Picker
+//
+
+// Builds the key to be used for a request based on path and initial_metadata.
+std::map<TString, TString> BuildKeyMap(
+ const RlsLbConfig::KeyBuilderMap& key_builder_map, y_absl::string_view path,
+ const TString& host,
+ const LoadBalancingPolicy::MetadataInterface* initial_metadata) {
+ size_t last_slash_pos = path.npos; // May need this a few times, so cache it.
+ // Find key builder for this path.
+ auto it = key_builder_map.find(TString(path));
+ if (it == key_builder_map.end()) {
+ // Didn't find exact match, try method wildcard.
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ TString service(path.substr(0, last_slash_pos + 1));
+ it = key_builder_map.find(service);
+ if (it == key_builder_map.end()) return {};
+ }
+ const RlsLbConfig::KeyBuilder* key_builder = &it->second;
+ // Construct key map using key builder.
+ std::map<TString, TString> key_map;
+ // Add header keys.
+ for (const auto& p : key_builder->header_keys) {
+ const TString& key = p.first;
+ const std::vector<TString>& header_names = p.second;
+ for (const TString& header_name : header_names) {
+ TString buffer;
+ y_absl::optional<y_absl::string_view> value =
+ initial_metadata->Lookup(header_name, &buffer);
+ if (value.has_value()) {
+ key_map[key] = TString(*value);
+ break;
+ }
+ }
+ }
+ // Add constant keys.
+ key_map.insert(key_builder->constant_keys.begin(),
+ key_builder->constant_keys.end());
+ // Add host key.
+ if (!key_builder->host_key.empty()) {
+ key_map[key_builder->host_key] = host;
+ }
+ // Add service key.
+ if (!key_builder->service_key.empty()) {
+ if (last_slash_pos == path.npos) {
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ }
+ key_map[key_builder->service_key] =
+ TString(path.substr(1, last_slash_pos - 1));
+ }
+ // Add method key.
+ if (!key_builder->method_key.empty()) {
+ if (last_slash_pos == path.npos) {
+ last_slash_pos = path.rfind("/");
+ GPR_DEBUG_ASSERT(last_slash_pos != path.npos);
+ if (GPR_UNLIKELY(last_slash_pos == path.npos)) return {};
+ }
+ key_map[key_builder->method_key] =
+ TString(path.substr(last_slash_pos + 1));
+ }
+ return key_map;
+}
+
+RlsLb::Picker::Picker(RefCountedPtr<RlsLb> lb_policy)
+ : lb_policy_(std::move(lb_policy)), config_(lb_policy_->config_) {
+ if (lb_policy_->default_child_policy_ != nullptr) {
+ default_child_policy_ =
+ lb_policy_->default_child_policy_->Ref(DEBUG_LOCATION, "Picker");
+ }
+}
+
+RlsLb::Picker::~Picker() {
+ // It's not safe to unref the default child policy in the picker,
+ // since that needs to be done in the WorkSerializer.
+ if (default_child_policy_ != nullptr) {
+ auto* default_child_policy = default_child_policy_.release();
+ lb_policy_->work_serializer()->Run(
+ [default_child_policy]() {
+ default_child_policy->Unref(DEBUG_LOCATION, "Picker");
+ },
+ DEBUG_LOCATION);
+ }
+}
+
+LoadBalancingPolicy::PickResult RlsLb::Picker::Pick(PickArgs args) {
+ // Construct key for request.
+ RequestKey key = {BuildKeyMap(config_->key_builder_map(), args.path,
+ lb_policy_->server_name_,
+ args.initial_metadata)};
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: request keys: %s",
+ lb_policy_.get(), this, key.ToString().c_str());
+ }
+ grpc_millis now = ExecCtx::Get()->Now();
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) {
+ return PickResult::Fail(
+ y_absl::UnavailableError("LB policy already shut down"));
+ }
+ // Check if there's a cache entry.
+ Cache::Entry* entry = lb_policy_->cache_.Find(key);
+ // If there is no cache entry, or if the cache entry is not in backoff
+ // and has a stale time in the past, and there is not already a
+ // pending RLS request for this key, then try to start a new RLS request.
+ if ((entry == nullptr ||
+ (entry->stale_time() < now && entry->backoff_time() < now)) &&
+ lb_policy_->request_map_.find(key) == lb_policy_->request_map_.end()) {
+ // Check if requests are being throttled.
+ if (lb_policy_->rls_channel_->ShouldThrottle()) {
+ // Request is throttled.
+ // If there is no non-expired data in the cache, then we use the
+ // default target if set, or else we fail the pick.
+ if (entry == nullptr || entry->data_expiration_time() < now) {
+ if (default_child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call throttled; "
+ "using default target",
+ lb_policy_.get(), this);
+ }
+ return default_child_policy_->Pick(args);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call throttled; failing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Fail(
+ y_absl::UnavailableError("RLS request throttled"));
+ }
+ }
+ // Start the RLS call.
+ lb_policy_->rls_channel_->StartRlsCall(
+ key, (entry == nullptr || entry->data_expiration_time() < now) ? nullptr
+ : entry);
+ }
+ // If the cache entry exists, see if it has usable data.
+ if (entry != nullptr) {
+ // If the entry has non-expired data, use it.
+ if (entry->data_expiration_time() >= now) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: using cache entry %p",
+ lb_policy_.get(), this, entry);
+ }
+ return entry->Pick(args);
+ }
+ // If the entry is in backoff, then use the default target if set,
+ // or else fail the pick.
+ if (entry->backoff_time() >= now) {
+ if (default_child_policy_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call in backoff; using default target",
+ lb_policy_.get(), this);
+ }
+ return default_child_policy_->Pick(args);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] picker=%p: RLS call in backoff; failing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Fail(entry->status());
+ }
+ }
+ // RLS call pending. Queue the pick.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] picker=%p: RLS request pending; queuing pick",
+ lb_policy_.get(), this);
+ }
+ return PickResult::Queue();
+}
+
+//
+// RlsLb::Cache::Entry::BackoffTimer
+//
+
+RlsLb::Cache::Entry::BackoffTimer::BackoffTimer(RefCountedPtr<Entry> entry,
+ grpc_millis backoff_time)
+ : entry_(std::move(entry)) {
+ GRPC_CLOSURE_INIT(&backoff_timer_callback_, OnBackoffTimer, this, nullptr);
+ Ref(DEBUG_LOCATION, "BackoffTimer").release();
+ grpc_timer_init(&backoff_timer_, backoff_time, &backoff_timer_callback_);
+}
+
+void RlsLb::Cache::Entry::BackoffTimer::Orphan() {
+ if (armed_) {
+ armed_ = false;
+ grpc_timer_cancel(&backoff_timer_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::Cache::Entry::BackoffTimer::OnBackoffTimer(
+ void* arg, grpc_error_handle /*error*/) {
+ auto* self = static_cast<BackoffTimer*>(arg);
+ self->entry_->lb_policy_->work_serializer()->Run(
+ [self]() {
+ RefCountedPtr<BackoffTimer> backoff_timer(self);
+ {
+ MutexLock lock(&self->entry_->lb_policy_->mu_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s, armed_=%d: "
+ "backoff timer fired",
+ self->entry_->lb_policy_.get(), self->entry_.get(),
+ self->entry_->is_shutdown_
+ ? "(shut down)"
+ : self->entry_->lru_iterator_->ToString().c_str(),
+ self->armed_);
+ }
+ bool cancelled = !self->armed_;
+ self->armed_ = false;
+ if (cancelled) return;
+ }
+ // The pick was in backoff state and there could be a pick queued if
+ // wait_for_ready is true. We'll update the picker for that case.
+ self->entry_->lb_policy_->UpdatePickerLocked();
+ },
+ DEBUG_LOCATION);
+}
+
+//
+// RlsLb::Cache::Entry
+//
+
+std::unique_ptr<BackOff> MakeCacheEntryBackoff() {
+ return y_absl::make_unique<BackOff>(
+ BackOff::Options()
+ .set_initial_backoff(kCacheBackoffInitial)
+ .set_multiplier(kCacheBackoffMultiplier)
+ .set_jitter(kCacheBackoffJitter)
+ .set_max_backoff(kCacheBackoffMax));
+}
+
+RlsLb::Cache::Entry::Entry(RefCountedPtr<RlsLb> lb_policy,
+ const RequestKey& key)
+ : InternallyRefCounted<Entry>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "CacheEntry" : nullptr),
+ lb_policy_(std::move(lb_policy)),
+ backoff_state_(MakeCacheEntryBackoff()),
+ min_expiration_time_(ExecCtx::Get()->Now() + kMinExpirationTime),
+ lru_iterator_(lb_policy_->cache_.lru_list_.insert(
+ lb_policy_->cache_.lru_list_.end(), key)) {}
+
+void RlsLb::Cache::Entry::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] cache entry=%p %s: cache entry evicted",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str());
+ }
+ is_shutdown_ = true;
+ lb_policy_->cache_.lru_list_.erase(lru_iterator_);
+ lru_iterator_ = lb_policy_->cache_.lru_list_.end(); // Just in case.
+ backoff_state_.reset();
+ if (backoff_timer_ != nullptr) {
+ backoff_timer_.reset();
+ lb_policy_->UpdatePickerAsync();
+ }
+ child_policy_wrappers_.clear();
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+size_t RlsLb::Cache::Entry::Size() const {
+ // lru_iterator_ is not valid once we're shut down.
+ GPR_ASSERT(!is_shutdown_);
+ return lb_policy_->cache_.EntrySizeForKey(*lru_iterator_);
+}
+
+LoadBalancingPolicy::PickResult RlsLb::Cache::Entry::Pick(PickArgs args) {
+ for (const auto& child_policy_wrapper : child_policy_wrappers_) {
+ if (child_policy_wrapper->connectivity_state() ==
+ GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: target %s in state "
+ "TRANSIENT_FAILURE; skipping",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str(),
+ child_policy_wrapper->target().c_str());
+ }
+ continue;
+ }
+ // Child policy not in TRANSIENT_FAILURE, so delegate.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: target %s in state %s; "
+ "delegating",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str(),
+ child_policy_wrapper->target().c_str(),
+ ConnectivityStateName(child_policy_wrapper->connectivity_state()));
+ }
+ // Add header data.
+ if (!header_data_.empty()) {
+ char* copied_header_data =
+ static_cast<char*>(args.call_state->Alloc(header_data_.length() + 1));
+ strcpy(copied_header_data, header_data_.c_str());
+ args.initial_metadata->Add(kRlsHeaderKey, copied_header_data);
+ }
+ return child_policy_wrapper->Pick(args);
+ }
+ // No child policy found.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] cache entry=%p %s: no healthy target found; "
+ "failing pick",
+ lb_policy_.get(), this, lru_iterator_->ToString().c_str());
+ }
+ return PickResult::Fail(
+ y_absl::UnavailableError("all RLS targets unreachable"));
+}
+
+void RlsLb::Cache::Entry::ResetBackoff() {
+ backoff_time_ = GRPC_MILLIS_INF_PAST;
+ backoff_timer_.reset();
+}
+
+bool RlsLb::Cache::Entry::ShouldRemove() const {
+ grpc_millis now = ExecCtx::Get()->Now();
+ return data_expiration_time_ < now && backoff_expiration_time_ < now;
+}
+
+bool RlsLb::Cache::Entry::CanEvict() const {
+ grpc_millis now = ExecCtx::Get()->Now();
+ return min_expiration_time_ < now;
+}
+
+void RlsLb::Cache::Entry::MarkUsed() {
+ auto& lru_list = lb_policy_->cache_.lru_list_;
+ auto new_it = lru_list.insert(lru_list.end(), *lru_iterator_);
+ lru_list.erase(lru_iterator_);
+ lru_iterator_ = new_it;
+}
+
+std::vector<RlsLb::ChildPolicyWrapper*>
+RlsLb::Cache::Entry::OnRlsResponseLocked(
+ ResponseInfo response, std::unique_ptr<BackOff> backoff_state) {
+ // Move the entry to the end of the LRU list.
+ MarkUsed();
+ // If the request failed, store the failed status and update the
+ // backoff state.
+ if (!response.status.ok()) {
+ status_ = response.status;
+ if (backoff_state != nullptr) {
+ backoff_state_ = std::move(backoff_state);
+ } else {
+ backoff_state_ = MakeCacheEntryBackoff();
+ }
+ backoff_time_ = backoff_state_->NextAttemptTime();
+ grpc_millis now = ExecCtx::Get()->Now();
+ backoff_expiration_time_ = now + (backoff_time_ - now) * 2;
+ backoff_timer_ = MakeOrphanable<BackoffTimer>(
+ Ref(DEBUG_LOCATION, "BackoffTimer"), backoff_time_);
+ lb_policy_->UpdatePickerAsync();
+ return {};
+ }
+ // Request succeeded, so store the result.
+ header_data_ = std::move(response.header_data);
+ grpc_millis now = ExecCtx::Get()->Now();
+ data_expiration_time_ = now + lb_policy_->config_->max_age();
+ stale_time_ = now + lb_policy_->config_->stale_age();
+ status_ = y_absl::OkStatus();
+ backoff_state_.reset();
+ backoff_time_ = GRPC_MILLIS_INF_PAST;
+ backoff_expiration_time_ = GRPC_MILLIS_INF_PAST;
+ // Check if we need to update this list of targets.
+ bool targets_changed = [&]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&RlsLb::mu_) {
+ if (child_policy_wrappers_.size() != response.targets.size()) return true;
+ for (size_t i = 0; i < response.targets.size(); ++i) {
+ if (child_policy_wrappers_[i]->target() != response.targets[i]) {
+ return true;
+ }
+ }
+ return false;
+ }();
+ if (!targets_changed) {
+ // Targets didn't change, so we're not updating the list of child
+ // policies. Return a new picker so that any queued requests can be
+ // re-processed.
+ lb_policy_->UpdatePickerAsync();
+ return {};
+ }
+ // Target list changed, so update it.
+ std::set<y_absl::string_view> old_targets;
+ for (RefCountedPtr<ChildPolicyWrapper>& child_policy_wrapper :
+ child_policy_wrappers_) {
+ old_targets.emplace(child_policy_wrapper->target());
+ }
+ bool update_picker = false;
+ std::vector<ChildPolicyWrapper*> child_policies_to_finish_update;
+ std::vector<RefCountedPtr<ChildPolicyWrapper>> new_child_policy_wrappers;
+ new_child_policy_wrappers.reserve(response.targets.size());
+ for (TString& target : response.targets) {
+ auto it = lb_policy_->child_policy_map_.find(target);
+ if (it == lb_policy_->child_policy_map_.end()) {
+ auto new_child = MakeRefCounted<ChildPolicyWrapper>(
+ lb_policy_->Ref(DEBUG_LOCATION, "ChildPolicyWrapper"), target);
+ new_child->StartUpdate();
+ child_policies_to_finish_update.push_back(new_child.get());
+ new_child_policy_wrappers.emplace_back(std::move(new_child));
+ } else {
+ new_child_policy_wrappers.emplace_back(
+ it->second->Ref(DEBUG_LOCATION, "CacheEntry"));
+ // If the target already existed but was not previously used for
+ // this key, then we'll need to update the picker, since we
+ // didn't actually create a new child policy, which would have
+ // triggered an RLS picker update when it returned its first picker.
+ if (old_targets.find(target) == old_targets.end()) {
+ update_picker = true;
+ }
+ }
+ }
+ child_policy_wrappers_ = std::move(new_child_policy_wrappers);
+ if (update_picker) {
+ lb_policy_->UpdatePickerAsync();
+ }
+ return child_policies_to_finish_update;
+}
+
+//
+// RlsLb::Cache
+//
+
+RlsLb::Cache::Cache(RlsLb* lb_policy) : lb_policy_(lb_policy) {
+ grpc_millis now = ExecCtx::Get()->Now();
+ lb_policy_->Ref(DEBUG_LOCATION, "CacheCleanupTimer").release();
+ GRPC_CLOSURE_INIT(&timer_callback_, OnCleanupTimer, this, nullptr);
+ grpc_timer_init(&cleanup_timer_, now + kCacheCleanupTimerInterval,
+ &timer_callback_);
+}
+
+RlsLb::Cache::Entry* RlsLb::Cache::Find(const RequestKey& key) {
+ auto it = map_.find(key);
+ if (it == map_.end()) return nullptr;
+ it->second->MarkUsed();
+ return it->second.get();
+}
+
+RlsLb::Cache::Entry* RlsLb::Cache::FindOrInsert(const RequestKey& key) {
+ auto it = map_.find(key);
+ // If not found, create new entry.
+ if (it == map_.end()) {
+ size_t entry_size = EntrySizeForKey(key);
+ MaybeShrinkSize(size_limit_ - std::min(size_limit_, entry_size));
+ Entry* entry =
+ new Entry(lb_policy_->Ref(DEBUG_LOCATION, "CacheEntry"), key);
+ map_.emplace(key, OrphanablePtr<Entry>(entry));
+ size_ += entry_size;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] key=%s: cache entry added, entry=%p",
+ lb_policy_, key.ToString().c_str(), entry);
+ }
+ return entry;
+ }
+ // Entry found, so use it.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] key=%s: found cache entry %p", lb_policy_,
+ key.ToString().c_str(), it->second.get());
+ }
+ it->second->MarkUsed();
+ return it->second.get();
+}
+
+void RlsLb::Cache::Resize(size_t bytes) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] resizing cache to %" PRIuPTR " bytes",
+ lb_policy_, bytes);
+ }
+ size_limit_ = bytes;
+ MaybeShrinkSize(size_limit_);
+}
+
+void RlsLb::Cache::ResetAllBackoff() {
+ for (auto& p : map_) {
+ p.second->ResetBackoff();
+ }
+ lb_policy_->UpdatePickerAsync();
+}
+
+void RlsLb::Cache::Shutdown() {
+ map_.clear();
+ lru_list_.clear();
+ grpc_timer_cancel(&cleanup_timer_);
+}
+
+void RlsLb::Cache::OnCleanupTimer(void* arg, grpc_error_handle error) {
+ Cache* cache = static_cast<Cache*>(arg);
+ GRPC_ERROR_REF(error);
+ cache->lb_policy_->work_serializer()->Run(
+ [cache, error]() {
+ RefCountedPtr<RlsLb> lb_policy(cache->lb_policy_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] cache cleanup timer fired (%s)",
+ cache->lb_policy_, grpc_error_std_string(error).c_str());
+ }
+ if (error == GRPC_ERROR_CANCELLED) return;
+ MutexLock lock(&lb_policy->mu_);
+ if (lb_policy->is_shutdown_) return;
+ for (auto it = cache->map_.begin(); it != cache->map_.end();) {
+ if (GPR_UNLIKELY(it->second->ShouldRemove() &&
+ it->second->CanEvict())) {
+ cache->size_ -= it->second->Size();
+ it = cache->map_.erase(it);
+ } else {
+ ++it;
+ }
+ }
+ grpc_millis now = ExecCtx::Get()->Now();
+ lb_policy.release();
+ grpc_timer_init(&cache->cleanup_timer_,
+ now + kCacheCleanupTimerInterval,
+ &cache->timer_callback_);
+ },
+ DEBUG_LOCATION);
+}
+
+size_t RlsLb::Cache::EntrySizeForKey(const RequestKey& key) {
+ // Key is stored twice, once in LRU list and again in the cache map.
+ return (key.Size() * 2) + sizeof(Entry);
+}
+
+void RlsLb::Cache::MaybeShrinkSize(size_t bytes) {
+ while (size_ > bytes) {
+ auto lru_it = lru_list_.begin();
+ if (GPR_UNLIKELY(lru_it == lru_list_.end())) break;
+ auto map_it = map_.find(*lru_it);
+ GPR_ASSERT(map_it != map_.end());
+ if (!map_it->second->CanEvict()) break;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] LRU eviction: removing entry %p %s",
+ lb_policy_, map_it->second.get(), lru_it->ToString().c_str());
+ }
+ size_ -= map_it->second->Size();
+ map_.erase(map_it);
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] LRU pass complete: desired size=%" PRIuPTR
+ " size=%" PRIuPTR,
+ lb_policy_, bytes, size_);
+ }
+}
+
+//
+// RlsLb::RlsChannel::StateWatcher
+//
+
+void RlsLb::RlsChannel::StateWatcher::OnConnectivityStateChange(
+ grpc_connectivity_state new_state, const y_absl::Status& status) {
+ auto* lb_policy = rls_channel_->lb_policy_.get();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] RlsChannel=%p StateWatcher=%p: "
+ "state changed to %s (%s)",
+ lb_policy, rls_channel_.get(), this,
+ ConnectivityStateName(new_state), status.ToString().c_str());
+ }
+ if (rls_channel_->is_shutdown_) return;
+ MutexLock lock(&lb_policy->mu_);
+ if (new_state == GRPC_CHANNEL_READY && was_transient_failure_) {
+ was_transient_failure_ = false;
+ // Reset the backoff of all cache entries, so that we don't
+ // double-penalize if an RLS request fails while the channel is
+ // down, since the throttling for the channel being down is handled
+ // at the channel level instead of in the individual cache entries.
+ lb_policy->cache_.ResetAllBackoff();
+ } else if (new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ was_transient_failure_ = true;
+ }
+}
+
+//
+// RlsLb::RlsChannel::Throttle
+//
+
+RlsLb::RlsChannel::Throttle::Throttle(int window_size_seconds,
+ double ratio_for_successes,
+ int paddings) {
+ GPR_DEBUG_ASSERT(window_size_seconds >= 0);
+ GPR_DEBUG_ASSERT(ratio_for_successes >= 0);
+ GPR_DEBUG_ASSERT(paddings >= 0);
+ window_size_ = window_size_seconds == 0 ? window_size_seconds * GPR_MS_PER_SEC
+ : kDefaultThrottleWindowSize;
+ ratio_for_successes_ = ratio_for_successes == 0
+ ? kDefaultThrottleRatioForSuccesses
+ : ratio_for_successes;
+ paddings_ = paddings == 0 ? kDefaultThrottlePaddings : paddings;
+}
+
+bool RlsLb::RlsChannel::Throttle::ShouldThrottle() {
+ grpc_millis now = ExecCtx::Get()->Now();
+ while (!requests_.empty() && now - requests_.front() > window_size_) {
+ requests_.pop_front();
+ }
+ while (!successes_.empty() && now - successes_.front() > window_size_) {
+ successes_.pop_front();
+ }
+ int successes = successes_.size();
+ int requests = requests_.size();
+ bool result = ((rand() % (requests + paddings_)) <
+ static_cast<double>(requests) -
+ static_cast<double>(successes) * ratio_for_successes_);
+ requests_.push_back(now);
+ return result;
+}
+
+void RlsLb::RlsChannel::Throttle::RegisterResponse(bool success) {
+ if (success) {
+ successes_.push_back(ExecCtx::Get()->Now());
+ }
+}
+
+//
+// RlsLb::RlsChannel
+//
+
+RlsLb::RlsChannel::RlsChannel(RefCountedPtr<RlsLb> lb_policy,
+ const TString& target,
+ const grpc_channel_args* parent_channel_args)
+ : InternallyRefCounted<RlsChannel>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsChannel" : nullptr),
+ lb_policy_(std::move(lb_policy)) {
+ // Get channel creds from parent channel.
+ // TODO(roth): Once we eliminate insecure builds, get this via a
+ // method on the helper instead of digging through channel args.
+ grpc_channel_credentials* creds =
+ grpc_channel_credentials_find_in_args(parent_channel_args);
+ // Use the parent channel's authority.
+ TString authority(lb_policy_->channel_control_helper()->GetAuthority());
+ y_absl::InlinedVector<grpc_arg, 3> args = {
+ grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>(authority.c_str())),
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
+ };
+ // Propagate fake security connector expected targets, if any.
+ // (This is ugly, but it seems better than propagating all channel args
+ // from the parent channel by default and then having a giant
+ // exclude list of args to strip out, like we do in grpclb.)
+ const char* fake_security_expected_targets = grpc_channel_args_find_string(
+ parent_channel_args, GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS);
+ if (fake_security_expected_targets != nullptr) {
+ args.push_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS),
+ const_cast<char*>(fake_security_expected_targets)));
+ }
+ grpc_channel_args rls_channel_args = {args.size(), args.data()};
+ channel_ = grpc_secure_channel_create(creds, target.c_str(),
+ &rls_channel_args, nullptr);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p: created channel %p for %s",
+ lb_policy_.get(), this, channel_, target.c_str());
+ }
+ if (channel_ != nullptr) {
+ // Set up channelz linkage.
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(channel_);
+ channelz::ChannelNode* parent_channelz_node =
+ grpc_channel_args_find_pointer<channelz::ChannelNode>(
+ parent_channel_args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
+ if (child_channelz_node != nullptr && parent_channelz_node != nullptr) {
+ parent_channelz_node->AddChildChannel(child_channelz_node->uuid());
+ parent_channelz_node_ = parent_channelz_node->Ref();
+ }
+ // Start connectivity watch.
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "StateWatcher"));
+ client_channel->AddConnectivityWatcher(
+ GRPC_CHANNEL_IDLE,
+ OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
+ }
+}
+
+void RlsLb::RlsChannel::Orphan() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] RlsChannel=%p, channel=%p: shutdown",
+ lb_policy_.get(), this, channel_);
+ }
+ is_shutdown_ = true;
+ if (channel_ != nullptr) {
+ // Remove channelz linkage.
+ if (parent_channelz_node_ != nullptr) {
+ channelz::ChannelNode* child_channelz_node =
+ grpc_channel_get_channelz_node(channel_);
+ GPR_ASSERT(child_channelz_node != nullptr);
+ parent_channelz_node_->RemoveChildChannel(child_channelz_node->uuid());
+ }
+ // Stop connectivity watch.
+ if (watcher_ != nullptr) {
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ client_channel->RemoveConnectivityWatcher(watcher_);
+ watcher_ = nullptr;
+ }
+ grpc_channel_destroy(channel_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::RlsChannel::StartRlsCall(const RequestKey& key,
+ Cache::Entry* stale_entry) {
+ std::unique_ptr<BackOff> backoff_state;
+ grpc_lookup_v1_RouteLookupRequest_Reason reason =
+ grpc_lookup_v1_RouteLookupRequest_REASON_MISS;
+ TString stale_header_data;
+ if (stale_entry != nullptr) {
+ backoff_state = stale_entry->TakeBackoffState();
+ reason = grpc_lookup_v1_RouteLookupRequest_REASON_STALE;
+ stale_header_data = stale_entry->header_data();
+ }
+ lb_policy_->request_map_.emplace(
+ key, MakeOrphanable<RlsRequest>(
+ lb_policy_->Ref(DEBUG_LOCATION, "RlsRequest"), key,
+ lb_policy_->rls_channel_->Ref(DEBUG_LOCATION, "RlsRequest"),
+ std::move(backoff_state), reason, std::move(stale_header_data)));
+}
+
+void RlsLb::RlsChannel::ReportResponseLocked(bool response_succeeded) {
+ throttle_.RegisterResponse(response_succeeded);
+}
+
+void RlsLb::RlsChannel::ResetBackoff() {
+ GPR_DEBUG_ASSERT(channel_ != nullptr);
+ grpc_channel_reset_connect_backoff(channel_);
+}
+
+//
+// RlsLb::RlsRequest
+//
+
+RlsLb::RlsRequest::RlsRequest(RefCountedPtr<RlsLb> lb_policy, RequestKey key,
+ RefCountedPtr<RlsChannel> rls_channel,
+ std::unique_ptr<BackOff> backoff_state,
+ grpc_lookup_v1_RouteLookupRequest_Reason reason,
+ TString stale_header_data)
+ : InternallyRefCounted<RlsRequest>(
+ GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) ? "RlsRequest" : nullptr),
+ lb_policy_(std::move(lb_policy)),
+ key_(std::move(key)),
+ rls_channel_(std::move(rls_channel)),
+ backoff_state_(std::move(backoff_state)),
+ reason_(reason),
+ stale_header_data_(std::move(stale_header_data)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] rls_request=%p: RLS request created for key %s",
+ lb_policy_.get(), this, key_.ToString().c_str());
+ }
+ GRPC_CLOSURE_INIT(&call_complete_cb_, OnRlsCallComplete, this, nullptr);
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_INIT(&call_start_cb_, StartCall,
+ Ref(DEBUG_LOCATION, "StartCall").release(), nullptr),
+ GRPC_ERROR_NONE);
+}
+
+RlsLb::RlsRequest::~RlsRequest() { GPR_ASSERT(call_ == nullptr); }
+
+void RlsLb::RlsRequest::Orphan() {
+ if (call_ != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: cancelling RLS call",
+ lb_policy_.get(), this, key_.ToString().c_str());
+ }
+ grpc_call_cancel_internal(call_);
+ }
+ Unref(DEBUG_LOCATION, "Orphan");
+}
+
+void RlsLb::RlsRequest::StartCall(void* arg, grpc_error_handle /*error*/) {
+ auto* request = static_cast<RlsRequest*>(arg);
+ request->lb_policy_->work_serializer()->Run(
+ [request]() {
+ request->StartCallLocked();
+ request->Unref(DEBUG_LOCATION, "StartCall");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::RlsRequest::StartCallLocked() {
+ {
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) return;
+ }
+ grpc_millis now = ExecCtx::Get()->Now();
+ deadline_ = now + lb_policy_->config_->lookup_service_timeout();
+ grpc_metadata_array_init(&recv_initial_metadata_);
+ grpc_metadata_array_init(&recv_trailing_metadata_);
+ call_ = grpc_channel_create_pollset_set_call(
+ rls_channel_->channel(), nullptr, GRPC_PROPAGATE_DEFAULTS,
+ lb_policy_->interested_parties(),
+ grpc_slice_from_static_string(kRlsRequestPath), nullptr, deadline_,
+ nullptr);
+ grpc_op ops[6];
+ memset(ops, 0, sizeof(ops));
+ grpc_op* op = ops;
+ op->op = GRPC_OP_SEND_INITIAL_METADATA;
+ ++op;
+ op->op = GRPC_OP_SEND_MESSAGE;
+ send_message_ = MakeRequestProto();
+ op->data.send_message.send_message = send_message_;
+ ++op;
+ op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
+ ++op;
+ op->op = GRPC_OP_RECV_INITIAL_METADATA;
+ op->data.recv_initial_metadata.recv_initial_metadata =
+ &recv_initial_metadata_;
+ ++op;
+ op->op = GRPC_OP_RECV_MESSAGE;
+ op->data.recv_message.recv_message = &recv_message_;
+ ++op;
+ op->op = GRPC_OP_RECV_STATUS_ON_CLIENT;
+ op->data.recv_status_on_client.trailing_metadata = &recv_trailing_metadata_;
+ op->data.recv_status_on_client.status = &status_recv_;
+ op->data.recv_status_on_client.status_details = &status_details_recv_;
+ ++op;
+ Ref(DEBUG_LOCATION, "OnRlsCallComplete").release();
+ auto call_error = grpc_call_start_batch_and_execute(
+ call_, ops, static_cast<size_t>(op - ops), &call_complete_cb_);
+ GPR_ASSERT(call_error == GRPC_CALL_OK);
+}
+
+void RlsLb::RlsRequest::OnRlsCallComplete(void* arg, grpc_error_handle error) {
+ auto* request = static_cast<RlsRequest*>(arg);
+ GRPC_ERROR_REF(error);
+ request->lb_policy_->work_serializer()->Run(
+ [request, error]() {
+ request->OnRlsCallCompleteLocked(error);
+ request->Unref(DEBUG_LOCATION, "OnRlsCallComplete");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::RlsRequest::OnRlsCallCompleteLocked(grpc_error_handle error) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ TString status_message(StringViewFromSlice(status_details_recv_));
+ gpr_log(GPR_INFO,
+ "[rlslb %p] rls_request=%p %s, error=%s, status={%d, %s} RLS call "
+ "response received",
+ lb_policy_.get(), this, key_.ToString().c_str(),
+ grpc_error_std_string(error).c_str(), status_recv_,
+ status_message.c_str());
+ }
+ // Parse response.
+ ResponseInfo response;
+ if (error != GRPC_ERROR_NONE) {
+ grpc_status_code code;
+ TString message;
+ grpc_error_get_status(error, deadline_, &code, &message,
+ /*http_error=*/nullptr, /*error_string=*/nullptr);
+ response.status =
+ y_absl::Status(static_cast<y_absl::StatusCode>(code), message);
+ } else if (status_recv_ != GRPC_STATUS_OK) {
+ response.status = y_absl::Status(static_cast<y_absl::StatusCode>(status_recv_),
+ StringViewFromSlice(status_details_recv_));
+ } else {
+ response = ParseResponseProto();
+ }
+ // Clean up call state.
+ grpc_byte_buffer_destroy(send_message_);
+ grpc_byte_buffer_destroy(recv_message_);
+ grpc_metadata_array_destroy(&recv_initial_metadata_);
+ grpc_metadata_array_destroy(&recv_trailing_metadata_);
+ grpc_slice_unref_internal(status_details_recv_);
+ grpc_call_unref(call_);
+ call_ = nullptr;
+ // Return result to cache.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] rls_request=%p %s: response info: %s",
+ lb_policy_.get(), this, key_.ToString().c_str(),
+ response.ToString().c_str());
+ }
+ std::vector<ChildPolicyWrapper*> child_policies_to_finish_update;
+ {
+ MutexLock lock(&lb_policy_->mu_);
+ if (lb_policy_->is_shutdown_) return;
+ rls_channel_->ReportResponseLocked(!response.status.ok());
+ Cache::Entry* cache_entry = lb_policy_->cache_.FindOrInsert(key_);
+ child_policies_to_finish_update = cache_entry->OnRlsResponseLocked(
+ std::move(response), std::move(backoff_state_));
+ lb_policy_->request_map_.erase(key_);
+ }
+ // Now that we've released the lock, finish the update on any newly
+ // created child policies.
+ for (ChildPolicyWrapper* child : child_policies_to_finish_update) {
+ child->MaybeFinishUpdate();
+ }
+}
+
+grpc_byte_buffer* RlsLb::RlsRequest::MakeRequestProto() {
+ upb::Arena arena;
+ grpc_lookup_v1_RouteLookupRequest* req =
+ grpc_lookup_v1_RouteLookupRequest_new(arena.ptr());
+ grpc_lookup_v1_RouteLookupRequest_set_target_type(
+ req, upb_strview_make(kGrpc, sizeof(kGrpc) - 1));
+ for (const auto& kv : key_.key_map) {
+ grpc_lookup_v1_RouteLookupRequest_key_map_set(
+ req, upb_strview_make(kv.first.data(), kv.first.size()),
+ upb_strview_make(kv.second.data(), kv.second.size()), arena.ptr());
+ }
+ grpc_lookup_v1_RouteLookupRequest_set_reason(req, reason_);
+ if (!stale_header_data_.empty()) {
+ grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(
+ req,
+ upb_strview_make(stale_header_data_.data(), stale_header_data_.size()));
+ }
+ size_t len;
+ char* buf =
+ grpc_lookup_v1_RouteLookupRequest_serialize(req, arena.ptr(), &len);
+ grpc_slice send_slice = grpc_slice_from_copied_buffer(buf, len);
+ grpc_byte_buffer* byte_buffer = grpc_raw_byte_buffer_create(&send_slice, 1);
+ grpc_slice_unref_internal(send_slice);
+ return byte_buffer;
+}
+
+RlsLb::ResponseInfo RlsLb::RlsRequest::ParseResponseProto() {
+ ResponseInfo response_info;
+ upb::Arena arena;
+ grpc_byte_buffer_reader bbr;
+ grpc_byte_buffer_reader_init(&bbr, recv_message_);
+ grpc_slice recv_slice = grpc_byte_buffer_reader_readall(&bbr);
+ grpc_byte_buffer_reader_destroy(&bbr);
+ grpc_lookup_v1_RouteLookupResponse* response =
+ grpc_lookup_v1_RouteLookupResponse_parse(
+ reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(recv_slice)),
+ GRPC_SLICE_LENGTH(recv_slice), arena.ptr());
+ grpc_slice_unref_internal(recv_slice);
+ if (response == nullptr) {
+ response_info.status = y_absl::InternalError("cannot parse RLS response");
+ return response_info;
+ }
+ size_t num_targets;
+ const upb_strview* targets_strview =
+ grpc_lookup_v1_RouteLookupResponse_targets(response, &num_targets);
+ if (num_targets == 0) {
+ response_info.status =
+ y_absl::InvalidArgumentError("RLS response has no target entry");
+ return response_info;
+ }
+ response_info.targets.reserve(num_targets);
+ for (size_t i = 0; i < num_targets; ++i) {
+ response_info.targets.emplace_back(targets_strview[i].data,
+ targets_strview[i].size);
+ }
+ upb_strview header_data_strview =
+ grpc_lookup_v1_RouteLookupResponse_header_data(response);
+ response_info.header_data =
+ TString(header_data_strview.data, header_data_strview.size);
+ return response_info;
+}
+
+//
+// RlsLb
+//
+
+TString GetServerUri(const grpc_channel_args* args) {
+ const char* server_uri_str =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri_str != nullptr);
+ y_absl::StatusOr<URI> uri = URI::Parse(server_uri_str);
+ GPR_ASSERT(uri.ok());
+ return TString(y_absl::StripPrefix(uri->path(), "/"));
+}
+
+RlsLb::RlsLb(Args args)
+ : LoadBalancingPolicy(std::move(args)),
+ server_name_(GetServerUri(args.args)),
+ cache_(this) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy created", this);
+ }
+}
+
+void RlsLb::UpdateLocked(UpdateArgs args) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy updated", this);
+ }
+ // Swap out config, addresses, and channel args.
+ RefCountedPtr<RlsLbConfig> old_config = std::move(config_);
+ config_ = std::move(args.config);
+ ServerAddressList old_addresses = std::move(addresses_);
+ addresses_ = std::move(args.addresses);
+ grpc_channel_args_destroy(channel_args_);
+ channel_args_ = grpc_channel_args_copy(args.args);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace) &&
+ (old_config == nullptr ||
+ old_config->child_policy_config() != config_->child_policy_config())) {
+ gpr_log(GPR_INFO, "[rlslb %p] updated child policy config: %s", this,
+ config_->child_policy_config().Dump().c_str());
+ }
+ // Determine whether we need to update all child policies.
+ bool update_child_policies =
+ old_config == nullptr ||
+ old_config->child_policy_config() != config_->child_policy_config() ||
+ old_addresses != addresses_ ||
+ grpc_channel_args_compare(args.args, channel_args_) != 0;
+ // If default target changes, swap out child policy.
+ bool created_default_child = false;
+ if (old_config == nullptr ||
+ config_->default_target() != old_config->default_target()) {
+ if (config_->default_target().empty()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] unsetting default target", this);
+ }
+ default_child_policy_.reset();
+ } else {
+ auto it = child_policy_map_.find(config_->default_target());
+ if (it == child_policy_map_.end()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] creating new default target", this);
+ }
+ default_child_policy_ = MakeRefCounted<ChildPolicyWrapper>(
+ Ref(DEBUG_LOCATION, "ChildPolicyWrapper"),
+ config_->default_target());
+ created_default_child = true;
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO,
+ "[rlslb %p] using existing child for default target", this);
+ }
+ default_child_policy_ =
+ it->second->Ref(DEBUG_LOCATION, "DefaultChildPolicy");
+ }
+ }
+ }
+ // Now grab the lock to swap out the state it guards.
+ {
+ MutexLock lock(&mu_);
+ // Swap out RLS channel if needed.
+ if (old_config == nullptr ||
+ config_->lookup_service() != old_config->lookup_service()) {
+ rls_channel_ =
+ MakeOrphanable<RlsChannel>(Ref(DEBUG_LOCATION, "RlsChannel"),
+ config_->lookup_service(), channel_args_);
+ }
+ // Resize cache if needed.
+ if (old_config == nullptr ||
+ config_->cache_size_bytes() != old_config->cache_size_bytes()) {
+ cache_.Resize(config_->cache_size_bytes());
+ }
+ // Start update of child policies if needed.
+ if (update_child_policies) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] starting child policy updates", this);
+ }
+ for (auto& p : child_policy_map_) {
+ p.second->StartUpdate();
+ }
+ } else if (created_default_child) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] starting default child policy update",
+ this);
+ }
+ default_child_policy_->StartUpdate();
+ }
+ }
+ // Now that we've released the lock, finish update of child policies.
+ if (update_child_policies) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] finishing child policy updates", this);
+ }
+ for (auto& p : child_policy_map_) {
+ p.second->MaybeFinishUpdate();
+ }
+ } else if (created_default_child) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] finishing default child policy update",
+ this);
+ }
+ default_child_policy_->MaybeFinishUpdate();
+ }
+ // In principle, we need to update the picker here only if the config
+ // fields used by the picker have changed. However, it seems fragile
+ // to check individual fields, since the picker logic could change in
+ // the future to use additional config fields, and we might not
+ // remember to update the code here. So for now, we just unconditionally
+ // update the picker here, even though it's probably redundant.
+ UpdatePickerLocked();
+}
+
+void RlsLb::ExitIdleLocked() {
+ MutexLock lock(&mu_);
+ for (auto& child_entry : child_policy_map_) {
+ child_entry.second->ExitIdleLocked();
+ }
+}
+
+void RlsLb::ResetBackoffLocked() {
+ {
+ MutexLock lock(&mu_);
+ rls_channel_->ResetBackoff();
+ cache_.ResetAllBackoff();
+ }
+ for (auto& child : child_policy_map_) {
+ child.second->ResetBackoffLocked();
+ }
+}
+
+void RlsLb::ShutdownLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] policy shutdown", this);
+ }
+ MutexLock lock(&mu_);
+ is_shutdown_ = true;
+ config_.reset(DEBUG_LOCATION, "ShutdownLocked");
+ if (channel_args_ != nullptr) {
+ grpc_channel_args_destroy(channel_args_);
+ }
+ cache_.Shutdown();
+ request_map_.clear();
+ rls_channel_.reset();
+ default_child_policy_.reset();
+}
+
+void RlsLb::UpdatePickerAsync() {
+ // Run via the ExecCtx, since the caller may be holding the lock, and
+ // we don't want to be doing that when we hop into the WorkSerializer,
+ // in case the WorkSerializer callback happens to run inline.
+ ExecCtx::Run(
+ DEBUG_LOCATION,
+ GRPC_CLOSURE_CREATE(UpdatePickerCallback,
+ Ref(DEBUG_LOCATION, "UpdatePickerCallback").release(),
+ grpc_schedule_on_exec_ctx),
+ GRPC_ERROR_NONE);
+}
+
+void RlsLb::UpdatePickerCallback(void* arg, grpc_error_handle /*error*/) {
+ auto* rls_lb = static_cast<RlsLb*>(arg);
+ rls_lb->work_serializer()->Run(
+ [rls_lb]() {
+ RefCountedPtr<RlsLb> lb_policy(rls_lb);
+ lb_policy->UpdatePickerLocked();
+ lb_policy.reset(DEBUG_LOCATION, "UpdatePickerCallback");
+ },
+ DEBUG_LOCATION);
+}
+
+void RlsLb::UpdatePickerLocked() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] updating picker", this);
+ }
+ grpc_connectivity_state state = GRPC_CHANNEL_IDLE;
+ if (!child_policy_map_.empty()) {
+ state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ int num_idle = 0;
+ int num_connecting = 0;
+ {
+ MutexLock lock(&mu_);
+ if (is_shutdown_) return;
+ for (auto& p : child_policy_map_) {
+ grpc_connectivity_state child_state = p.second->connectivity_state();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] target %s in state %s", this,
+ p.second->target().c_str(),
+ ConnectivityStateName(child_state));
+ }
+ if (child_state == GRPC_CHANNEL_READY) {
+ state = GRPC_CHANNEL_READY;
+ break;
+ } else if (child_state == GRPC_CHANNEL_CONNECTING) {
+ ++num_connecting;
+ } else if (child_state == GRPC_CHANNEL_IDLE) {
+ ++num_idle;
+ }
+ }
+ if (state != GRPC_CHANNEL_READY) {
+ if (num_connecting > 0) {
+ state = GRPC_CHANNEL_CONNECTING;
+ } else if (num_idle > 0) {
+ state = GRPC_CHANNEL_IDLE;
+ }
+ }
+ }
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_rls_trace)) {
+ gpr_log(GPR_INFO, "[rlslb %p] reporting state %s", this,
+ ConnectivityStateName(state));
+ }
+ y_absl::Status status;
+ if (state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ status = y_absl::UnavailableError("no children available");
+ }
+ channel_control_helper()->UpdateState(
+ state, status, y_absl::make_unique<Picker>(Ref(DEBUG_LOCATION, "Picker")));
+}
+
+//
+// RlsLbFactory
+//
+
+grpc_error_handle ParseJsonHeaders(size_t idx, const Json& json,
+ TString* key,
+ std::vector<TString>* headers) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:headers index:", idx, " error:type should be OBJECT"));
+ }
+ std::vector<grpc_error_handle> error_list;
+ // requiredMatch must not be present.
+ if (json.object_value().find("requiredMatch") != json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:requiredMatch error:must not be present"));
+ }
+ // Find key.
+ if (ParseJsonObjectField(json.object_value(), "key", key, &error_list) &&
+ key->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:key error:must be non-empty"));
+ }
+ // Find headers.
+ const Json::Array* headers_json = nullptr;
+ ParseJsonObjectField(json.object_value(), "names", &headers_json,
+ &error_list);
+ if (headers_json != nullptr) {
+ if (headers_json->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:names error:list is empty"));
+ } else {
+ size_t name_idx = 0;
+ for (const Json& name_json : *headers_json) {
+ if (name_json.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:names index:", name_idx, " error:type should be STRING")));
+ } else if (name_json.string_value().empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:names index:", name_idx,
+ " error:header name must be non-empty")));
+ } else {
+ headers->push_back(name_json.string_value());
+ }
+ ++name_idx;
+ }
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("field:headers index:", idx), &error_list);
+}
+
+TString ParseJsonMethodName(size_t idx, const Json& json,
+ grpc_error_handle* error) {
+ if (json.type() != Json::Type::OBJECT) {
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:names index:", idx, " error:type should be OBJECT"));
+ return "";
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Find service name.
+ y_absl::string_view service_name;
+ ParseJsonObjectField(json.object_value(), "service", &service_name,
+ &error_list);
+ // Find method name.
+ y_absl::string_view method_name;
+ ParseJsonObjectField(json.object_value(), "method", &method_name, &error_list,
+ /*required=*/false);
+ // Return error, if any.
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("field:names index:", idx), &error_list);
+ // Construct path.
+ return y_absl::StrCat("/", service_name, "/", method_name);
+}
+
+grpc_error_handle ParseGrpcKeybuilder(
+ size_t idx, const Json& json, RlsLbConfig::KeyBuilderMap* key_builder_map) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "field:grpc_keybuilders index:", idx, " error:type should be OBJECT"));
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Parse names.
+ std::set<TString> names;
+ const Json::Array* names_array = nullptr;
+ if (ParseJsonObjectField(json.object_value(), "names", &names_array,
+ &error_list)) {
+ if (names_array->empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:names error:list is empty"));
+ } else {
+ size_t name_idx = 0;
+ for (const Json& name_json : *names_array) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ TString name =
+ ParseJsonMethodName(name_idx++, name_json, &child_error);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(child_error);
+ } else {
+ bool inserted = names.insert(name).second;
+ if (!inserted) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:names error:duplicate entry for ", name)));
+ }
+ }
+ }
+ }
+ }
+ // Helper function to check for duplicate keys.
+ std::set<TString> all_keys;
+ auto duplicate_key_check_func = [&all_keys,
+ &error_list](const TString& key) {
+ auto it = all_keys.find(key);
+ if (it != all_keys.end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("key \"", key, "\" listed multiple times")));
+ } else {
+ all_keys.insert(key);
+ }
+ };
+ // Parse headers.
+ RlsLbConfig::KeyBuilder key_builder;
+ const Json::Array* headers_array = nullptr;
+ ParseJsonObjectField(json.object_value(), "headers", &headers_array,
+ &error_list, /*required=*/false);
+ if (headers_array != nullptr) {
+ size_t header_idx = 0;
+ for (const Json& header_json : *headers_array) {
+ TString key;
+ std::vector<TString> headers;
+ grpc_error_handle child_error =
+ ParseJsonHeaders(header_idx++, header_json, &key, &headers);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(child_error);
+ } else {
+ duplicate_key_check_func(key);
+ key_builder.header_keys.emplace(key, std::move(headers));
+ }
+ }
+ }
+ // Parse extraKeys.
+ const Json::Object* extra_keys = nullptr;
+ ParseJsonObjectField(json.object_value(), "extraKeys", &extra_keys,
+ &error_list, /*required=*/false);
+ if (extra_keys != nullptr) {
+ std::vector<grpc_error_handle> extra_keys_errors;
+ if (ParseJsonObjectField(*extra_keys, "host", &key_builder.host_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.host_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:host error:must be non-empty"));
+ }
+ if (!key_builder.host_key.empty()) {
+ duplicate_key_check_func(key_builder.host_key);
+ }
+ if (ParseJsonObjectField(*extra_keys, "service", &key_builder.service_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.service_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:service error:must be non-empty"));
+ }
+ if (!key_builder.service_key.empty()) {
+ duplicate_key_check_func(key_builder.service_key);
+ }
+ if (ParseJsonObjectField(*extra_keys, "method", &key_builder.method_key,
+ &extra_keys_errors, /*required=*/false) &&
+ key_builder.method_key.empty()) {
+ extra_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:method error:must be non-empty"));
+ }
+ if (!key_builder.method_key.empty()) {
+ duplicate_key_check_func(key_builder.method_key);
+ }
+ if (!extra_keys_errors.empty()) {
+ error_list.push_back(
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:extraKeys", &extra_keys_errors));
+ }
+ }
+ // Parse constantKeys.
+ const Json::Object* constant_keys = nullptr;
+ ParseJsonObjectField(json.object_value(), "constantKeys", &constant_keys,
+ &error_list, /*required=*/false);
+ if (constant_keys != nullptr) {
+ std::vector<grpc_error_handle> constant_keys_errors;
+ for (const auto& p : *constant_keys) {
+ const TString& key = p.first;
+ const Json& value = p.second;
+ if (key.empty()) {
+ constant_keys_errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "error:keys must be non-empty"));
+ }
+ duplicate_key_check_func(key);
+ ExtractJsonString(value, key, &key_builder.constant_keys[key],
+ &constant_keys_errors);
+ }
+ if (!constant_keys_errors.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
+ "field:constantKeys", &constant_keys_errors));
+ }
+ }
+ // Insert key_builder into key_builder_map.
+ for (const TString& name : names) {
+ bool inserted = key_builder_map->emplace(name, key_builder).second;
+ if (!inserted) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:names error:duplicate entry for ", name)));
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("index:", idx), &error_list);
+}
+
+RlsLbConfig::KeyBuilderMap ParseGrpcKeybuilders(
+ const Json::Array& key_builder_list, grpc_error_handle* error) {
+ RlsLbConfig::KeyBuilderMap key_builder_map;
+ if (key_builder_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:grpcKeybuilders error:list is empty");
+ return key_builder_map;
+ }
+ std::vector<grpc_error_handle> error_list;
+ size_t idx = 0;
+ for (const Json& key_builder : key_builder_list) {
+ grpc_error_handle child_error =
+ ParseGrpcKeybuilder(idx++, key_builder, &key_builder_map);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR("field:grpcKeybuilders", &error_list);
+ return key_builder_map;
+}
+
+RlsLbConfig::RouteLookupConfig ParseRouteLookupConfig(
+ const Json::Object& json, grpc_error_handle* error) {
+ std::vector<grpc_error_handle> error_list;
+ RlsLbConfig::RouteLookupConfig route_lookup_config;
+ // Parse grpcKeybuilders.
+ const Json::Array* keybuilder_list = nullptr;
+ ParseJsonObjectField(json, "grpcKeybuilders", &keybuilder_list, &error_list);
+ if (keybuilder_list != nullptr) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ route_lookup_config.key_builder_map =
+ ParseGrpcKeybuilders(*keybuilder_list, &child_error);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ // Parse lookupService.
+ if (ParseJsonObjectField(json, "lookupService",
+ &route_lookup_config.lookup_service, &error_list)) {
+ if (!ResolverRegistry::IsValidTarget(route_lookup_config.lookup_service)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:lookupService error:must be valid gRPC target URI"));
+ }
+ }
+ // Parse lookupServiceTimeout.
+ route_lookup_config.lookup_service_timeout = kDefaultLookupServiceTimeout;
+ ParseJsonObjectFieldAsDuration(json, "lookupServiceTimeout",
+ &route_lookup_config.lookup_service_timeout,
+ &error_list, /*required=*/false);
+ // Parse maxAge.
+ route_lookup_config.max_age = kMaxMaxAge;
+ bool max_age_set = ParseJsonObjectFieldAsDuration(
+ json, "maxAge", &route_lookup_config.max_age, &error_list,
+ /*required=*/false);
+ // Clamp maxAge to the max allowed value.
+ if (route_lookup_config.max_age > kMaxMaxAge) {
+ route_lookup_config.max_age = kMaxMaxAge;
+ }
+ // Parse staleAge.
+ route_lookup_config.stale_age = kMaxMaxAge;
+ bool stale_age_set = ParseJsonObjectFieldAsDuration(
+ json, "staleAge", &route_lookup_config.stale_age, &error_list,
+ /*required=*/false);
+ // If staleAge is set, then maxAge must also be set.
+ if (stale_age_set && !max_age_set) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAge error:must be set if staleAge is set"));
+ }
+ // Ignore staleAge if greater than or equal to maxAge.
+ if (route_lookup_config.stale_age >= route_lookup_config.max_age) {
+ route_lookup_config.stale_age = route_lookup_config.max_age;
+ }
+ // Parse cacheSizeBytes.
+ ParseJsonObjectField(json, "cacheSizeBytes",
+ &route_lookup_config.cache_size_bytes, &error_list);
+ if (route_lookup_config.cache_size_bytes <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:cacheSizeBytes error:must be greater than 0"));
+ }
+ // Clamp cacheSizeBytes to the max allowed value.
+ if (route_lookup_config.cache_size_bytes > kMaxCacheSizeBytes) {
+ route_lookup_config.cache_size_bytes = kMaxCacheSizeBytes;
+ }
+ // Parse defaultTarget.
+ if (ParseJsonObjectField(json, "defaultTarget",
+ &route_lookup_config.default_target, &error_list,
+ /*required=*/false)) {
+ if (route_lookup_config.default_target.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:defaultTarget error:must be non-empty if set"));
+ }
+ }
+ *error =
+ GRPC_ERROR_CREATE_FROM_VECTOR("field:routeLookupConfig", &error_list);
+ return route_lookup_config;
+}
+
+grpc_error_handle ValidateChildPolicyList(
+ const Json& child_policy_list,
+ const TString& child_policy_config_target_field_name,
+ const TString& default_target, Json* child_policy_config,
+ RefCountedPtr<LoadBalancingPolicy::Config>*
+ default_child_policy_parsed_config) {
+ // Add target to each entry in the config proto.
+ *child_policy_config = child_policy_list;
+ TString target =
+ default_target.empty() ? kFakeTargetFieldValue : default_target;
+ grpc_error_handle error = InsertOrUpdateChildPolicyField(
+ child_policy_config_target_field_name, target, child_policy_config);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Parse the config.
+ RefCountedPtr<LoadBalancingPolicy::Config> parsed_config =
+ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ *child_policy_config, &error);
+ if (error != GRPC_ERROR_NONE) return error;
+ // Find the chosen config and return it in JSON form.
+ // We remove all non-selected configs, and in the selected config, we leave
+ // the target field in place, set to the default value. This slightly
+ // optimizes what we need to do later when we update a child policy for a
+ // given target.
+ if (parsed_config != nullptr) {
+ for (Json& config : *(child_policy_config->mutable_array())) {
+ if (config.object_value().begin()->first == parsed_config->name()) {
+ Json save_config = std::move(config);
+ child_policy_config->mutable_array()->clear();
+ child_policy_config->mutable_array()->push_back(std::move(save_config));
+ break;
+ }
+ }
+ }
+ // If default target is set, return the parsed config.
+ if (!default_target.empty()) {
+ *default_child_policy_parsed_config = std::move(parsed_config);
+ }
+ return GRPC_ERROR_NONE;
+}
+
+class RlsLbFactory : public LoadBalancingPolicyFactory {
+ public:
+ const char* name() const override { return kRls; }
+
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<RlsLb>(std::move(args));
+ }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& config, grpc_error_handle* error) const override {
+ std::vector<grpc_error_handle> error_list;
+ // Parse routeLookupConfig.
+ RlsLbConfig::RouteLookupConfig route_lookup_config;
+ const Json::Object* route_lookup_config_json = nullptr;
+ if (ParseJsonObjectField(config.object_value(), "routeLookupConfig",
+ &route_lookup_config_json, &error_list)) {
+ grpc_error_handle child_error = GRPC_ERROR_NONE;
+ route_lookup_config =
+ ParseRouteLookupConfig(*route_lookup_config_json, &child_error);
+ if (child_error != GRPC_ERROR_NONE) error_list.push_back(child_error);
+ }
+ // Parse childPolicyConfigTargetFieldName.
+ TString child_policy_config_target_field_name;
+ if (ParseJsonObjectField(
+ config.object_value(), "childPolicyConfigTargetFieldName",
+ &child_policy_config_target_field_name, &error_list)) {
+ if (child_policy_config_target_field_name.empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicyConfigTargetFieldName error:must be non-empty"));
+ }
+ }
+ // Parse childPolicy.
+ Json child_policy_config;
+ RefCountedPtr<LoadBalancingPolicy::Config>
+ default_child_policy_parsed_config;
+ auto it = config.object_value().find("childPolicy");
+ if (it == config.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicy error:does not exist."));
+ } else if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:childPolicy error:type should be ARRAY"));
+ } else {
+ grpc_error_handle child_error = ValidateChildPolicyList(
+ it->second, child_policy_config_target_field_name,
+ route_lookup_config.default_target, &child_policy_config,
+ &default_child_policy_parsed_config);
+ if (child_error != GRPC_ERROR_NONE) {
+ error_list.push_back(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "field:childPolicy", &child_error, 1));
+ GRPC_ERROR_UNREF(child_error);
+ }
+ }
+ // Return result.
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "errors parsing RLS LB policy config", &error_list);
+ return MakeRefCounted<RlsLbConfig>(
+ std::move(route_lookup_config), std::move(child_policy_config),
+ std::move(child_policy_config_target_field_name),
+ std::move(default_child_policy_parsed_config));
+ }
+};
+
+bool RlsEnabled() {
+ char* value = gpr_getenv("GRPC_EXPERIMENTAL_ENABLE_RLS_LB_POLICY");
+ bool parsed_value;
+ bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
+ gpr_free(value);
+ return parse_succeeded && parsed_value;
+}
+
+} // namespace
+
+void RlsLbPluginInit() {
+ if (!RlsEnabled()) return;
+ LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<RlsLbFactory>());
+}
+
+void RlsLbPluginShutdown() {}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
index ce12a315300..d77aea03990 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc
@@ -34,11 +34,11 @@
#include "src/core/ext/filters/client_channel/lb_policy/subchannel_list.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/static_metadata.h"
@@ -213,10 +213,7 @@ RoundRobin::PickResult RoundRobin::Picker::Pick(PickArgs /*args*/) {
parent_, this, last_picked_index_,
subchannels_[last_picked_index_].get());
}
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- result.subchannel = subchannels_[last_picked_index_];
- return result;
+ return PickResult::Complete(subchannels_[last_picked_index_]);
}
//
@@ -331,20 +328,23 @@ void RoundRobin::RoundRobinSubchannelList::
y_absl::make_unique<QueuePicker>(p->Ref(DEBUG_LOCATION, "QueuePicker")));
} else if (num_transient_failure_ == num_subchannels()) {
/* 3) TRANSIENT_FAILURE */
- grpc_error* error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "connections to all backends failing"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status =
+ y_absl::UnavailableError("connections to all backends failing");
p->channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
}
}
void RoundRobin::RoundRobinSubchannelList::
UpdateRoundRobinStateFromSubchannelStateCountsLocked() {
RoundRobin* p = static_cast<RoundRobin*>(policy());
- if (num_ready_ > 0) {
+ // If we have at least one READY subchannel, then swap to the new list.
+ // Also, if all of the subchannels are in TRANSIENT_FAILURE, then we know
+ // we've tried all of them and failed, so we go ahead and swap over
+ // anyway; this may cause the channel to go from READY to TRANSIENT_FAILURE,
+ // but we are doing what the control plane told us to do.
+ if (num_ready_ > 0 || num_transient_failure_ == num_subchannels()) {
if (p->subchannel_list_.get() != this) {
// Promote this list to p->subchannel_list_.
// This list must be p->latest_pending_subchannel_list_, because
@@ -449,12 +449,10 @@ void RoundRobin::UpdateLocked(UpdateArgs args) {
if (latest_pending_subchannel_list_->num_subchannels() == 0) {
// If the new list is empty, immediately promote the new list to the
// current list and transition to TRANSIENT_FAILURE.
- grpc_error* error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status = y_absl::UnavailableError("Empty update");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
subchannel_list_ = std::move(latest_pending_subchannel_list_);
} else if (subchannel_list_ == nullptr) {
// If there is no current list, immediately promote the new list to
@@ -487,7 +485,7 @@ class RoundRobinFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kRoundRobin; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
+ const Json& /*json*/, grpc_error_handle* /*error*/) const override {
return MakeRefCounted<RoundRobinConfig>();
}
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
index e9dd0886a40..5076b7e848d 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h
@@ -24,23 +24,23 @@
#include <string.h>
#include <util/system/compiler.h> // Y_NO_SANITIZE
-#include <grpc/support/alloc.h>
-
#include "y_absl/container/inlined_vector.h"
+#include <grpc/support/alloc.h>
+
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
// TODO(roth): Should not need the include of subchannel.h here, since
// that implementation should be hidden from the LB policy API.
#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/filters/client_channel/subchannel_interface.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/transport/connectivity_state.h"
// Code for maintaining a list of subchannels within an LB policy.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
index affc0e99392..c96f6b28b7a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc
@@ -150,6 +150,7 @@ class WeightedTargetLb : public LoadBalancingPolicy {
const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -165,8 +166,8 @@ class WeightedTargetLb : public LoadBalancingPolicy {
grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker);
- static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
- void OnDelayedRemovalTimerLocked(grpc_error* error);
+ static void OnDelayedRemovalTimer(void* arg, grpc_error_handle error);
+ void OnDelayedRemovalTimerLocked(grpc_error_handle error);
// The owning LB policy.
RefCountedPtr<WeightedTargetLb> weighted_target_policy_;
@@ -387,12 +388,9 @@ void WeightedTargetLb::UpdateStateLocked() {
y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
break;
default:
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "weighted_target: all children report state TRANSIENT_FAILURE"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- status = grpc_error_to_absl_status(error);
- picker = y_absl::make_unique<TransientFailurePicker>(error);
+ status = y_absl::UnavailableError(
+ "weighted_target: all children report state TRANSIENT_FAILURE");
+ picker = y_absl::make_unique<TransientFailurePicker>(status);
}
channel_control_helper()->UpdateState(connectivity_state, status,
std::move(picker));
@@ -564,17 +562,17 @@ void WeightedTargetLb::WeightedChild::DeactivateLocked() {
&on_delayed_removal_timer_);
}
-void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimer(void* arg,
- grpc_error* error) {
+void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimer(
+ void* arg, grpc_error_handle error) {
WeightedChild* self = static_cast<WeightedChild*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
self->weighted_target_policy_->work_serializer()->Run(
[self, error]() { self->OnDelayedRemovalTimerLocked(error); },
DEBUG_LOCATION);
}
void WeightedTargetLb::WeightedChild::OnDelayedRemovalTimerLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error == GRPC_ERROR_NONE && delayed_removal_timer_callback_pending_ &&
!shutdown_ && weight_ == 0) {
delayed_removal_timer_callback_pending_ = false;
@@ -610,6 +608,11 @@ void WeightedTargetLb::WeightedChild::Helper::RequestReresolution() {
->RequestReresolution();
}
+y_absl::string_view WeightedTargetLb::WeightedChild::Helper::GetAuthority() {
+ return weighted_child_->weighted_target_policy_->channel_control_helper()
+ ->GetAuthority();
+}
+
void WeightedTargetLb::WeightedChild::Helper::AddTraceEvent(
TraceSeverity severity, y_absl::string_view message) {
if (weighted_child_->weighted_target_policy_->shutting_down_) return;
@@ -631,7 +634,7 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kWeightedTarget; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// weighted_target was mentioned as a policy in the deprecated
@@ -642,7 +645,7 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
"config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// Weight map.
WeightedTargetLbConfig::TargetMap target_map;
auto it = json.object_value().find("targets");
@@ -655,17 +658,11 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
} else {
for (const auto& p : it->second.object_value()) {
WeightedTargetLbConfig::ChildConfig child_config;
- std::vector<grpc_error*> child_errors =
+ std::vector<grpc_error_handle> child_errors =
ParseChildConfig(p.second, &child_config);
if (!child_errors.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:targets key:", p.first).c_str());
- for (grpc_error* child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("field:targets key:", p.first), &child_errors));
} else {
target_map[p.first] = std::move(child_config);
}
@@ -680,9 +677,9 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
}
private:
- static std::vector<grpc_error*> ParseChildConfig(
+ static std::vector<grpc_error_handle> ParseChildConfig(
const Json& json, WeightedTargetLbConfig::ChildConfig* child_config) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"value should be of type object"));
@@ -711,13 +708,13 @@ class WeightedTargetLbFactory : public LoadBalancingPolicyFactory {
// Child policy.
it = json.object_value().find("childPolicy");
if (it != json.object_value().end()) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
child_config->config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(it->second,
&parse_error);
if (child_config->config == nullptr) {
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
+ std::vector<grpc_error_handle> child_errors;
child_errors.push_back(parse_error);
error_list.push_back(
GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
index d62fe49cb36..d93feec59be 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
@@ -23,7 +23,6 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/xds/xds_certificate_provider.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/lib/channel/channel_args.h"
@@ -73,35 +72,36 @@ class CdsLb : public LoadBalancingPolicy {
: parent_(std::move(parent)), name_(std::move(name)) {}
void OnClusterChanged(XdsApi::CdsUpdate cluster_data) override {
- new Notifier(parent_, name_, std::move(cluster_data));
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ // TODO(roth): When we move to C++14, capture cluster_data with
+ // std::move().
+ [this, cluster_data]() mutable {
+ parent_->OnClusterChanged(name_, std::move(cluster_data));
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error* error) override {
- new Notifier(parent_, name_, error);
+ void OnError(grpc_error_handle error) override {
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ [this, error]() {
+ parent_->OnError(name_, error);
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // Ref held by lambda
+ parent_->work_serializer()->Run(
+ [this]() {
+ parent_->OnResourceDoesNotExist(name_);
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnResourceDoesNotExist() override { new Notifier(parent_, name_); }
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<CdsLb> parent, TString name,
- XdsApi::CdsUpdate update);
- Notifier(RefCountedPtr<CdsLb> parent, TString name,
- grpc_error* error);
- explicit Notifier(RefCountedPtr<CdsLb> parent, TString name);
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<CdsLb> parent_;
- TString name_;
- grpc_closure closure_;
- XdsApi::CdsUpdate update_;
- Type type_;
- };
-
RefCountedPtr<CdsLb> parent_;
TString name_;
};
@@ -123,6 +123,7 @@ class CdsLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -139,10 +140,10 @@ class CdsLb : public LoadBalancingPolicy {
std::set<TString>* clusters_needed);
void OnClusterChanged(const TString& name,
XdsApi::CdsUpdate cluster_data);
- void OnError(const TString& name, grpc_error* error);
+ void OnError(const TString& name, grpc_error_handle error);
void OnResourceDoesNotExist(const TString& name);
- grpc_error* UpdateXdsCertificateProvider(
+ grpc_error_handle UpdateXdsCertificateProvider(
const TString& cluster_name, const XdsApi::CdsUpdate& cluster_data);
void CancelClusterDataWatch(y_absl::string_view cluster_name,
@@ -175,58 +176,6 @@ class CdsLb : public LoadBalancingPolicy {
};
//
-// CdsLb::ClusterWatcher::Notifier
-//
-
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- TString name,
- XdsApi::CdsUpdate update)
- : parent_(std::move(parent)),
- name_(std::move(name)),
- update_(std::move(update)),
- type_(kUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- TString name, grpc_error* error)
- : parent_(std::move(parent)), name_(std::move(name)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-CdsLb::ClusterWatcher::Notifier::Notifier(RefCountedPtr<CdsLb> parent,
- TString name)
- : parent_(std::move(parent)), name_(std::move(name)), type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void CdsLb::ClusterWatcher::Notifier::RunInExecCtx(void* arg,
- grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->parent_->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void CdsLb::ClusterWatcher::Notifier::RunInWorkSerializer(grpc_error* error) {
- switch (type_) {
- case kUpdate:
- parent_->OnClusterChanged(name_, std::move(update_));
- break;
- case kError:
- parent_->OnError(name_, error);
- break;
- case kDoesNotExist:
- parent_->OnResourceDoesNotExist(name_);
- break;
- };
- delete this;
-}
-
-//
// CdsLb::Helper
//
@@ -259,6 +208,10 @@ void CdsLb::Helper::RequestReresolution() {
parent_->channel_control_helper()->RequestReresolution();
}
+y_absl::string_view CdsLb::Helper::GetAuthority() {
+ return parent_->channel_control_helper()->GetAuthority();
+}
+
void CdsLb::Helper::AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) {
if (parent_->shutting_down_) return;
@@ -346,7 +299,7 @@ void CdsLb::UpdateLocked(UpdateArgs args) {
}
watchers_.clear();
}
- auto watcher = y_absl::make_unique<ClusterWatcher>(Ref(), config_->cluster());
+ auto watcher = MakeRefCounted<ClusterWatcher>(Ref(), config_->cluster());
watchers_[config_->cluster()].watcher = watcher.get();
xds_client_->WatchClusterData(config_->cluster(), std::move(watcher));
}
@@ -367,7 +320,7 @@ bool CdsLb::GenerateDiscoveryMechanismForCluster(
auto& state = watchers_[name];
// Create a new watcher if needed.
if (state.watcher == nullptr) {
- auto watcher = y_absl::make_unique<ClusterWatcher>(Ref(), name);
+ auto watcher = MakeRefCounted<ClusterWatcher>(Ref(), name);
if (GRPC_TRACE_FLAG_ENABLED(grpc_cds_lb_trace)) {
gpr_log(GPR_INFO, "[cdslb %p] starting watch for cluster %s", this,
name.c_str());
@@ -390,26 +343,25 @@ bool CdsLb::GenerateDiscoveryMechanismForCluster(
}
return !missing_cluster;
}
- TString type;
+ Json::Object mechanism = {
+ {"clusterName", name},
+ {"max_concurrent_requests", state.update->max_concurrent_requests},
+ };
switch (state.update->cluster_type) {
case XdsApi::CdsUpdate::ClusterType::EDS:
- type = "EDS";
+ mechanism["type"] = "EDS";
+ if (!state.update->eds_service_name.empty()) {
+ mechanism["edsServiceName"] = state.update->eds_service_name;
+ }
break;
case XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS:
- type = "LOGICAL_DNS";
+ mechanism["type"] = "LOGICAL_DNS";
+ mechanism["dnsHostname"] = state.update->dns_hostname;
break;
default:
GPR_ASSERT(0);
break;
}
- Json::Object mechanism = {
- {"clusterName", name},
- {"max_concurrent_requests", state.update->max_concurrent_requests},
- {"type", std::move(type)},
- };
- if (!state.update->eds_service_name.empty()) {
- mechanism["edsServiceName"] = state.update->eds_service_name;
- }
if (state.update->lrs_load_reporting_server_name.has_value()) {
mechanism["lrsLoadReportingServerName"] =
state.update->lrs_load_reporting_server_name.value();
@@ -434,7 +386,7 @@ void CdsLb::OnClusterChanged(const TString& name,
if (it == watchers_.end()) return;
it->second.update = cluster_data;
// Take care of integration with new certificate code.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
error = UpdateXdsCertificateProvider(name, it->second.update.value());
if (error != GRPC_ERROR_NONE) {
return OnError(name, error);
@@ -450,22 +402,9 @@ void CdsLb::OnClusterChanged(const TString& name,
// Construct config for child policy.
Json::Object xds_lb_policy;
if (cluster_data.lb_policy == "RING_HASH") {
- TString hash_function;
- switch (cluster_data.hash_function) {
- case XdsApi::CdsUpdate::HashFunction::XX_HASH:
- hash_function = "XX_HASH";
- break;
- case XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2:
- hash_function = "MURMUR_HASH_2";
- break;
- default:
- GPR_ASSERT(0);
- break;
- }
xds_lb_policy["RING_HASH"] = Json::Object{
{"min_ring_size", cluster_data.min_ring_size},
{"max_ring_size", cluster_data.max_ring_size},
- {"hash_function", hash_function},
};
} else {
xds_lb_policy["ROUND_ROBIN"] = Json::Object();
@@ -541,19 +480,19 @@ void CdsLb::OnClusterChanged(const TString& name,
}
}
-void CdsLb::OnError(const TString& name, grpc_error* error) {
+void CdsLb::OnError(const TString& name, grpc_error_handle error) {
gpr_log(GPR_ERROR, "[cdslb %p] xds error obtaining data for cluster %s: %s",
- this, name.c_str(), grpc_error_string(error));
+ this, name.c_str(), grpc_error_std_string(error).c_str());
// Go into TRANSIENT_FAILURE if we have not yet created the child
// policy (i.e., we have not yet received data from xds). Otherwise,
// we keep running with the data we had previously.
if (child_policy_ == nullptr) {
+ y_absl::Status status = grpc_error_to_absl_status(error);
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
- } else {
- GRPC_ERROR_UNREF(error);
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
}
+ GRPC_ERROR_UNREF(error);
}
void CdsLb::OnResourceDoesNotExist(const TString& name) {
@@ -561,19 +500,15 @@ void CdsLb::OnResourceDoesNotExist(const TString& name) {
"[cdslb %p] CDS resource for %s does not exist -- reporting "
"TRANSIENT_FAILURE",
this, name.c_str());
- grpc_error* error =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("CDS resource \"", config_->cluster(),
- "\" does not exist")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ y_absl::Status status = y_absl::UnavailableError(
+ y_absl::StrCat("CDS resource \"", config_->cluster(), "\" does not exist"));
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
MaybeDestroyChildPolicyLocked();
}
-grpc_error* CdsLb::UpdateXdsCertificateProvider(
+grpc_error_handle CdsLb::UpdateXdsCertificateProvider(
const TString& cluster_name, const XdsApi::CdsUpdate& cluster_data) {
// Early out if channel is not configured to use xds security.
grpc_channel_credentials* channel_credentials =
@@ -588,21 +523,22 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
}
// Configure root cert.
y_absl::string_view root_provider_instance_name =
- cluster_data.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance.instance_name;
+ cluster_data.common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.instance_name;
y_absl::string_view root_provider_cert_name =
- cluster_data.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance.certificate_name;
+ cluster_data.common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.certificate_name;
RefCountedPtr<XdsCertificateProvider> new_root_provider;
if (!root_provider_instance_name.empty()) {
new_root_provider =
xds_client_->certificate_provider_store()
.CreateOrGetCertificateProvider(root_provider_instance_name);
if (new_root_provider == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Certificate provider instance name: \"",
- root_provider_instance_name, "\" not recognized.")
- .c_str());
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Certificate provider instance name: \"",
+ root_provider_instance_name, "\" not recognized.")),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
}
}
if (root_certificate_provider_ != new_root_provider) {
@@ -626,21 +562,22 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
: root_certificate_provider_->distributor());
// Configure identity cert.
y_absl::string_view identity_provider_instance_name =
- cluster_data.common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name;
+ cluster_data.common_tls_context.tls_certificate_provider_instance
+ .instance_name;
y_absl::string_view identity_provider_cert_name =
- cluster_data.common_tls_context
- .tls_certificate_certificate_provider_instance.certificate_name;
+ cluster_data.common_tls_context.tls_certificate_provider_instance
+ .certificate_name;
RefCountedPtr<XdsCertificateProvider> new_identity_provider;
if (!identity_provider_instance_name.empty()) {
new_identity_provider =
xds_client_->certificate_provider_store()
.CreateOrGetCertificateProvider(identity_provider_instance_name);
if (new_identity_provider == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Certificate provider instance name: \"",
- identity_provider_instance_name, "\" not recognized.")
- .c_str());
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Certificate provider instance name: \"",
+ identity_provider_instance_name, "\" not recognized.")),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
}
}
if (identity_certificate_provider_ != new_identity_provider) {
@@ -664,8 +601,8 @@ grpc_error* CdsLb::UpdateXdsCertificateProvider(
: identity_certificate_provider_->distributor());
// Configure SAN matchers.
const std::vector<StringMatcher>& match_subject_alt_names =
- cluster_data.common_tls_context.combined_validation_context
- .default_validation_context.match_subject_alt_names;
+ cluster_data.common_tls_context.certificate_validation_context
+ .match_subject_alt_names;
xds_certificate_provider_->UpdateSubjectAlternativeNameMatchers(
cluster_name, match_subject_alt_names);
return GRPC_ERROR_NONE;
@@ -693,13 +630,12 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
+ RefCountedPtr<XdsClient> xds_client =
+ XdsClient::GetFromChannelArgs(*args.args);
+ if (xds_client == nullptr) {
gpr_log(GPR_ERROR,
- "cannot get XdsClient to instantiate cds LB policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
+ "XdsClient not present in channel args -- cannot instantiate "
+ "cds LB policy");
return nullptr;
}
return MakeOrphanable<CdsLb>(std::move(xds_client), std::move(args));
@@ -708,7 +644,7 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kCds; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// xds was mentioned as a policy in the deprecated loadBalancingPolicy
@@ -718,7 +654,7 @@ class CdsLbFactory : public LoadBalancingPolicyFactory {
"Please use loadBalancingConfig field of service config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// cluster name.
TString cluster;
auto it = json.object_value().find("cluster");
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
index 2351502c8ce..430f88da924 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h
@@ -24,6 +24,6 @@
// For testing purpose, this channel arg indicating xds_cluster_resolver LB
// policy should use the fake DNS resolver to resolve logical dns cluster.
#define GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR \
- "grpc.internal.xds_logical_dns_cluster_fake_resolver_response_generator"
+ "grpc.TEST_ONLY.xds_logical_dns_cluster_fake_resolver_response_generator"
#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_XDS_XDS_CHANNEL_ARGS_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
index 5bd83bab614..62c64efb446 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_impl.cc
@@ -16,6 +16,8 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
+
#include "y_absl/strings/string_view.h"
#include <grpc/grpc.h>
@@ -56,12 +58,15 @@ class CircuitBreakerCallCounterMap {
explicit CallCounter(Key key) : key_(std::move(key)) {}
~CallCounter() override;
- uint32_t Increment() { return concurrent_requests_.FetchAdd(1); }
- void Decrement() { concurrent_requests_.FetchSub(1); }
+ uint32_t Load() {
+ return concurrent_requests_.load(std::memory_order_seq_cst);
+ }
+ uint32_t Increment() { return concurrent_requests_.fetch_add(1); }
+ void Decrement() { concurrent_requests_.fetch_sub(1); }
private:
Key key_;
- Atomic<uint32_t> concurrent_requests_{0};
+ std::atomic<uint32_t> concurrent_requests_{0};
};
RefCountedPtr<CallCounter> GetOrCreate(const TString& cluster,
@@ -69,7 +74,7 @@ class CircuitBreakerCallCounterMap {
private:
Mutex mu_;
- std::map<Key, CallCounter*> map_;
+ std::map<Key, CallCounter*> map_ Y_ABSL_GUARDED_BY(mu_);
};
CircuitBreakerCallCounterMap* g_call_counter_map = nullptr;
@@ -196,6 +201,8 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
PickResult Pick(PickArgs args) override;
private:
+ class SubchannelCallTracker;
+
RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
uint32_t max_concurrent_requests_;
RefCountedPtr<XdsApi::EdsUpdate::DropConfig> drop_config_;
@@ -217,6 +224,7 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -259,6 +267,71 @@ class XdsClusterImplLb : public LoadBalancingPolicy {
};
//
+// XdsClusterImplLb::Picker::SubchannelCallTracker
+//
+
+class XdsClusterImplLb::Picker::SubchannelCallTracker
+ : public LoadBalancingPolicy::SubchannelCallTrackerInterface {
+ public:
+ SubchannelCallTracker(
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ original_subchannel_call_tracker,
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats,
+ RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter)
+ : original_subchannel_call_tracker_(
+ std::move(original_subchannel_call_tracker)),
+ locality_stats_(std::move(locality_stats)),
+ call_counter_(std::move(call_counter)) {}
+
+ ~SubchannelCallTracker() override {
+ locality_stats_.reset(DEBUG_LOCATION, "SubchannelCallTracker");
+ call_counter_.reset(DEBUG_LOCATION, "SubchannelCallTracker");
+ GPR_DEBUG_ASSERT(!started_);
+ }
+
+ void Start() override {
+ // Increment number of calls in flight.
+ call_counter_->Increment();
+ // Record a call started.
+ if (locality_stats_ != nullptr) {
+ locality_stats_->AddCallStarted();
+ }
+ // Delegate if needed.
+ if (original_subchannel_call_tracker_ != nullptr) {
+ original_subchannel_call_tracker_->Start();
+ }
+#ifndef NDEBUG
+ started_ = true;
+#endif
+ }
+
+ void Finish(FinishArgs args) override {
+ // Delegate if needed.
+ if (original_subchannel_call_tracker_ != nullptr) {
+ original_subchannel_call_tracker_->Finish(args);
+ }
+ // Record call completion for load reporting.
+ if (locality_stats_ != nullptr) {
+ locality_stats_->AddCallFinished(!args.status.ok());
+ }
+ // Decrement number of calls in flight.
+ call_counter_->Decrement();
+#ifndef NDEBUG
+ started_ = false;
+#endif
+ }
+
+ private:
+ std::unique_ptr<LoadBalancingPolicy::SubchannelCallTrackerInterface>
+ original_subchannel_call_tracker_;
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats_;
+ RefCountedPtr<CircuitBreakerCallCounterMap::CallCounter> call_counter_;
+#ifndef NDEBUG
+ bool started_ = false;
+#endif
+};
+
+//
// XdsClusterImplLb::Picker
//
@@ -282,75 +355,48 @@ LoadBalancingPolicy::PickResult XdsClusterImplLb::Picker::Pick(
const TString* drop_category;
if (drop_config_->ShouldDrop(&drop_category)) {
if (drop_stats_ != nullptr) drop_stats_->AddCallDropped(*drop_category);
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- return result;
+ return PickResult::Drop(y_absl::UnavailableError(
+ y_absl::StrCat("EDS-configured drop: ", *drop_category)));
}
- // Handle circuit breaking.
- uint32_t current = call_counter_->Increment();
- // Check and see if we exceeded the max concurrent requests count.
- if (current >= max_concurrent_requests_) {
- call_counter_->Decrement();
+ // Check if we exceeded the max concurrent requests circuit breaking limit.
+ // Note: We check the value here, but we don't actually increment the
+ // counter for the current request until the channel calls the subchannel
+ // call tracker's Start() method. This means that we may wind up
+ // allowing more concurrent requests than the configured limit.
+ if (call_counter_->Load() >= max_concurrent_requests_) {
if (drop_stats_ != nullptr) drop_stats_->AddUncategorizedDrops();
- PickResult result;
- result.type = PickResult::PICK_COMPLETE;
- return result;
+ return PickResult::Drop(y_absl::UnavailableError("circuit breaker drop"));
}
// If we're not dropping the call, we should always have a child picker.
if (picker_ == nullptr) { // Should never happen.
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "xds_cluster_impl picker not given any child picker"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- call_counter_->Decrement();
- return result;
+ return PickResult::Fail(y_absl::InternalError(
+ "xds_cluster_impl picker not given any child picker"));
}
// Not dropping, so delegate to child picker.
PickResult result = picker_->Pick(args);
- if (result.type == result.PICK_COMPLETE && result.subchannel != nullptr) {
- XdsClusterLocalityStats* locality_stats = nullptr;
+ auto* complete_pick = y_absl::get_if<PickResult::Complete>(&result.result);
+ if (complete_pick != nullptr) {
+ RefCountedPtr<XdsClusterLocalityStats> locality_stats;
if (drop_stats_ != nullptr) { // If load reporting is enabled.
auto* subchannel_wrapper =
- static_cast<StatsSubchannelWrapper*>(result.subchannel.get());
+ static_cast<StatsSubchannelWrapper*>(complete_pick->subchannel.get());
// Handle load reporting.
- locality_stats = subchannel_wrapper->locality_stats()->Ref().release();
- // Record a call started.
- locality_stats->AddCallStarted();
+ locality_stats = subchannel_wrapper->locality_stats()->Ref(
+ DEBUG_LOCATION, "SubchannelCallTracker");
// Unwrap subchannel to pass back up the stack.
- result.subchannel = subchannel_wrapper->wrapped_subchannel();
+ complete_pick->subchannel = subchannel_wrapper->wrapped_subchannel();
}
- // Intercept the recv_trailing_metadata op to record call completion.
- auto* call_counter = call_counter_->Ref(DEBUG_LOCATION, "call").release();
- auto original_recv_trailing_metadata_ready =
- result.recv_trailing_metadata_ready;
- result.recv_trailing_metadata_ready =
- // Note: This callback does not run in either the control plane
- // work serializer or in the data plane mutex.
- [locality_stats, original_recv_trailing_metadata_ready, call_counter](
- grpc_error* error, MetadataInterface* metadata,
- CallState* call_state) {
- // Record call completion for load reporting.
- if (locality_stats != nullptr) {
- const bool call_failed = error != GRPC_ERROR_NONE;
- locality_stats->AddCallFinished(call_failed);
- locality_stats->Unref(DEBUG_LOCATION, "LocalityStats+call");
- }
- // Decrement number of calls in flight.
- call_counter->Decrement();
- call_counter->Unref(DEBUG_LOCATION, "call");
- // Invoke the original recv_trailing_metadata_ready callback, if any.
- if (original_recv_trailing_metadata_ready != nullptr) {
- original_recv_trailing_metadata_ready(error, metadata, call_state);
- }
- };
+ // Inject subchannel call tracker to record call completion.
+ complete_pick->subchannel_call_tracker =
+ y_absl::make_unique<SubchannelCallTracker>(
+ std::move(complete_pick->subchannel_call_tracker),
+ std::move(locality_stats),
+ call_counter_->Ref(DEBUG_LOCATION, "SubchannelCallTracker"));
} else {
// TODO(roth): We should ideally also record call failures here in the case
// where a pick fails. This is challenging, because we don't know which
// picks are for wait_for_ready RPCs or how many times we'll return a
// failure for the same wait_for_ready RPC.
- call_counter_->Decrement();
}
return result;
}
@@ -579,6 +625,10 @@ void XdsClusterImplLb::Helper::RequestReresolution() {
xds_cluster_impl_policy_->channel_control_helper()->RequestReresolution();
}
+y_absl::string_view XdsClusterImplLb::Helper::GetAuthority() {
+ return xds_cluster_impl_policy_->channel_control_helper()->GetAuthority();
+}
+
void XdsClusterImplLb::Helper::AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) {
if (xds_cluster_impl_policy_->shutting_down_) return;
@@ -594,14 +644,12 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(
- GPR_ERROR,
- "cannot get XdsClient to instantiate xds_cluster_impl LB policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
+ RefCountedPtr<XdsClient> xds_client =
+ XdsClient::GetFromChannelArgs(*args.args);
+ if (xds_client == nullptr) {
+ gpr_log(GPR_ERROR,
+ "XdsClient not present in channel args -- cannot instantiate "
+ "xds_cluster_impl LB policy");
return nullptr;
}
return MakeOrphanable<XdsClusterImplLb>(std::move(xds_client),
@@ -611,7 +659,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kXdsClusterImpl; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// This policy was configured in the deprecated loadBalancingPolicy
@@ -622,7 +670,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
"config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// Child policy.
RefCountedPtr<LoadBalancingPolicy::Config> child_policy;
auto it = json.object_value().find("childPolicy");
@@ -630,12 +678,12 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:childPolicy error:required field missing"));
} else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
child_policy = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
it->second, &parse_error);
if (child_policy == nullptr) {
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
+ std::vector<grpc_error_handle> child_errors;
child_errors.push_back(parse_error);
error_list.push_back(
GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
@@ -694,7 +742,7 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:dropCategories error:required field missing"));
} else {
- std::vector<grpc_error*> child_errors =
+ std::vector<grpc_error_handle> child_errors =
ParseDropCategories(it->second, drop_config.get());
if (!child_errors.empty()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
@@ -713,9 +761,9 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
private:
- static std::vector<grpc_error*> ParseDropCategories(
+ static std::vector<grpc_error_handle> ParseDropCategories(
const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::ARRAY) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"dropCategories field is not an array"));
@@ -723,11 +771,11 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
}
for (size_t i = 0; i < json.array_value().size(); ++i) {
const Json& entry = json.array_value()[i];
- std::vector<grpc_error*> child_errors =
+ std::vector<grpc_error_handle> child_errors =
ParseDropCategory(entry, drop_config);
if (!child_errors.empty()) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", i).c_str());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("errors parsing index ", i));
for (size_t i = 0; i < child_errors.size(); ++i) {
error = grpc_error_add_child(error, child_errors[i]);
}
@@ -737,9 +785,9 @@ class XdsClusterImplLbFactory : public LoadBalancingPolicyFactory {
return error_list;
}
- static std::vector<grpc_error*> ParseDropCategory(
+ static std::vector<grpc_error_handle> ParseDropCategory(
const Json& json, XdsApi::EdsUpdate::DropConfig* drop_config) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"dropCategories entry is not an object"));
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
index 5e7bbd542e0..3e97b184ddd 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc
@@ -151,6 +151,7 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
const y_absl::Status& status,
std::unique_ptr<SubchannelPicker> picker) override;
void RequestReresolution() override;
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -162,8 +163,8 @@ class XdsClusterManagerLb : public LoadBalancingPolicy {
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicyLocked(
const grpc_channel_args* args);
- static void OnDelayedRemovalTimer(void* arg, grpc_error* error);
- void OnDelayedRemovalTimerLocked(grpc_error* error);
+ static void OnDelayedRemovalTimer(void* arg, grpc_error_handle error);
+ void OnDelayedRemovalTimerLocked(grpc_error_handle error);
// The owning LB policy.
RefCountedPtr<XdsClusterManagerLb> xds_cluster_manager_policy_;
@@ -212,15 +213,8 @@ XdsClusterManagerLb::PickResult XdsClusterManagerLb::ClusterPicker::Pick(
if (it != cluster_map_.end()) {
return it->second->Pick(args);
}
- PickResult result;
- result.type = PickResult::PICK_FAILED;
- result.error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("xds cluster manager picker: unknown cluster \"",
- cluster_name, "\"")
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
- return result;
+ return PickResult::Fail(y_absl::InternalError(y_absl::StrCat(
+ "xds cluster manager picker: unknown cluster \"", cluster_name, "\"")));
}
//
@@ -337,44 +331,29 @@ void XdsClusterManagerLb::UpdateStateLocked() {
gpr_log(GPR_INFO, "[xds_cluster_manager_lb %p] connectivity changed to %s",
this, ConnectivityStateName(connectivity_state));
}
- std::unique_ptr<SubchannelPicker> picker;
- y_absl::Status status;
- switch (connectivity_state) {
- case GRPC_CHANNEL_READY: {
- ClusterPicker::ClusterMap cluster_map;
- for (const auto& p : config_->cluster_map()) {
- const TString& cluster_name = p.first;
- RefCountedPtr<ChildPickerWrapper>& child_picker =
- cluster_map[cluster_name];
- child_picker = children_[cluster_name]->picker_wrapper();
- if (child_picker == nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
- gpr_log(
- GPR_INFO,
+ ClusterPicker::ClusterMap cluster_map;
+ for (const auto& p : config_->cluster_map()) {
+ const TString& cluster_name = p.first;
+ RefCountedPtr<ChildPickerWrapper>& child_picker = cluster_map[cluster_name];
+ child_picker = children_[cluster_name]->picker_wrapper();
+ if (child_picker == nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_cluster_manager_lb_trace)) {
+ gpr_log(GPR_INFO,
"[xds_cluster_manager_lb %p] child %s has not yet returned a "
"picker; creating a QueuePicker.",
this, cluster_name.c_str());
- }
- child_picker = MakeRefCounted<ChildPickerWrapper>(
- cluster_name, y_absl::make_unique<QueuePicker>(
- Ref(DEBUG_LOCATION, "QueuePicker")));
- }
}
- picker = y_absl::make_unique<ClusterPicker>(std::move(cluster_map));
- break;
+ child_picker = MakeRefCounted<ChildPickerWrapper>(
+ cluster_name,
+ y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker")));
}
- case GRPC_CHANNEL_CONNECTING:
- case GRPC_CHANNEL_IDLE:
- picker =
- y_absl::make_unique<QueuePicker>(Ref(DEBUG_LOCATION, "QueuePicker"));
- break;
- default:
- grpc_error* error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "TRANSIENT_FAILURE from XdsClusterManagerLb"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- status = grpc_error_to_absl_status(error);
- picker = y_absl::make_unique<TransientFailurePicker>(error);
+ }
+ std::unique_ptr<SubchannelPicker> picker =
+ y_absl::make_unique<ClusterPicker>(std::move(cluster_map));
+ y_absl::Status status;
+ if (connectivity_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ status = y_absl::Status(y_absl::StatusCode::kUnavailable,
+ "TRANSIENT_FAILURE from XdsClusterManagerLb");
}
channel_control_helper()->UpdateState(connectivity_state, status,
std::move(picker));
@@ -513,16 +492,16 @@ void XdsClusterManagerLb::ClusterChild::DeactivateLocked() {
}
void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimer(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
ClusterChild* self = static_cast<ClusterChild*>(arg);
- GRPC_ERROR_REF(error); // Ref owned by the lambda
+ (void)GRPC_ERROR_REF(error); // Ref owned by the lambda
self->xds_cluster_manager_policy_->work_serializer()->Run(
[self, error]() { self->OnDelayedRemovalTimerLocked(error); },
DEBUG_LOCATION);
}
void XdsClusterManagerLb::ClusterChild::OnDelayedRemovalTimerLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
delayed_removal_timer_callback_pending_ = false;
if (error == GRPC_ERROR_NONE && !shutdown_) {
xds_cluster_manager_policy_->children_.erase(name_);
@@ -592,6 +571,12 @@ void XdsClusterManagerLb::ClusterChild::Helper::RequestReresolution() {
->RequestReresolution();
}
+y_absl::string_view XdsClusterManagerLb::ClusterChild::Helper::GetAuthority() {
+ return xds_cluster_manager_child_->xds_cluster_manager_policy_
+ ->channel_control_helper()
+ ->GetAuthority();
+}
+
void XdsClusterManagerLb::ClusterChild::Helper::AddTraceEvent(
TraceSeverity severity, y_absl::string_view message) {
if (xds_cluster_manager_child_->xds_cluster_manager_policy_->shutting_down_) {
@@ -616,7 +601,7 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kXdsClusterManager; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// xds_cluster_manager was mentioned as a policy in the deprecated
@@ -627,7 +612,7 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
"config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
XdsClusterManagerLbConfig::ClusterMap cluster_map;
std::set<TString /*cluster_name*/> clusters_to_be_used;
auto it = json.object_value().find("children");
@@ -646,17 +631,11 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
continue;
}
RefCountedPtr<LoadBalancingPolicy::Config> child_config;
- std::vector<grpc_error*> child_errors =
+ std::vector<grpc_error_handle> child_errors =
ParseChildConfig(p.second, &child_config);
if (!child_errors.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:children name:", child_name).c_str());
- for (grpc_error* child_error : child_errors) {
- error = grpc_error_add_child(error, child_error);
- }
- error_list.push_back(error);
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("field:children name:", child_name), &child_errors));
} else {
cluster_map[child_name] = std::move(child_config);
clusters_to_be_used.insert(child_name);
@@ -676,10 +655,10 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
}
private:
- static std::vector<grpc_error*> ParseChildConfig(
+ static std::vector<grpc_error_handle> ParseChildConfig(
const Json& json,
RefCountedPtr<LoadBalancingPolicy::Config>* child_config) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"value should be of type object"));
@@ -690,12 +669,12 @@ class XdsClusterManagerLbFactory : public LoadBalancingPolicyFactory {
error_list.push_back(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("did not find childPolicy"));
} else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
*child_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
it->second, &parse_error);
if (*child_config == nullptr) {
GPR_DEBUG_ASSERT(parse_error != GRPC_ERROR_NONE);
- std::vector<grpc_error*> child_errors;
+ std::vector<grpc_error_handle> child_errors;
child_errors.push_back(parse_error);
error_list.push_back(
GRPC_ERROR_CREATE_FROM_VECTOR("field:childPolicy", &child_errors));
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
index 9901884dcea..262de95d315 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc
@@ -28,6 +28,7 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy/address_filtering.h"
#include "src/core/ext/filters/client_channel/lb_policy/child_policy_handler.h"
+#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds.h"
#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
@@ -71,13 +72,16 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
};
DiscoveryMechanismType type;
TString eds_service_name;
+ TString dns_hostname;
bool operator==(const DiscoveryMechanism& other) const {
return (cluster_name == other.cluster_name &&
lrs_load_reporting_server_name ==
other.lrs_load_reporting_server_name &&
max_concurrent_requests == other.max_concurrent_requests &&
- type == other.type && eds_service_name == other.eds_service_name);
+ type == other.type &&
+ eds_service_name == other.eds_service_name &&
+ dns_hostname == other.dns_hostname);
}
};
@@ -101,7 +105,8 @@ class XdsClusterResolverLbConfig : public LoadBalancingPolicy::Config {
// Xds Cluster Resolver LB policy.
class XdsClusterResolverLb : public LoadBalancingPolicy {
public:
- XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client, Args args);
+ XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client, Args args,
+ TString server_name, bool is_xds_uri);
const char* name() const override { return kXdsClusterResolver; }
@@ -130,17 +135,6 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
virtual Json::Array override_child_policy() = 0;
virtual bool disable_reresolution() = 0;
- // Caller must ensure that config_ is set before calling.
- y_absl::string_view GetXdsClusterResolverResourceName() const {
- if (!parent_->is_xds_uri_) return parent_->server_name_;
- if (!parent_->config_->discovery_mechanisms()[index_]
- .eds_service_name.empty()) {
- return parent_->config_->discovery_mechanisms()[index_]
- .eds_service_name;
- }
- return parent_->config_->discovery_mechanisms()[index_].cluster_name;
- }
-
// Returns a pair containing the cluster and eds_service_name
// to use for LRS load reporting. Caller must ensure that config_ is set
// before calling.
@@ -182,41 +176,70 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
discovery_mechanism_.reset(DEBUG_LOCATION, "EndpointWatcher");
}
void OnEndpointChanged(XdsApi::EdsUpdate update) override {
- new Notifier(discovery_mechanism_, std::move(update));
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ // TODO(yashykt): When we move to C++14, capture update with
+ // std::move
+ [this, update]() mutable {
+ OnEndpointChangedHelper(std::move(update));
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error* error) override {
- new Notifier(discovery_mechanism_, error);
+ void OnError(grpc_error_handle error) override {
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ [this, error]() {
+ OnErrorHelper(error);
+ Unref();
+ },
+ DEBUG_LOCATION);
}
void OnResourceDoesNotExist() override {
- new Notifier(discovery_mechanism_);
+ Ref().release(); // ref held by callback
+ discovery_mechanism_->parent()->work_serializer()->Run(
+ [this]() {
+ OnResourceDoesNotExistHelper();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism,
- XdsApi::EdsUpdate update);
- Notifier(RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism,
- grpc_error* error);
- explicit Notifier(
- RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism);
- ~Notifier() { discovery_mechanism_.reset(DEBUG_LOCATION, "Notifier"); }
-
- private:
- enum Type { kUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism_;
- grpc_closure closure_;
- XdsApi::EdsUpdate update_;
- Type type_;
- };
-
+ // Code accessing protected methods of `DiscoveryMechanism` need to be
+ // in methods of this class rather than in lambdas to work around an MSVC
+ // bug.
+ void OnEndpointChangedHelper(XdsApi::EdsUpdate update) {
+ discovery_mechanism_->parent()->OnEndpointChanged(
+ discovery_mechanism_->index(), std::move(update));
+ }
+ void OnErrorHelper(grpc_error_handle error) {
+ discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(),
+ error);
+ }
+ void OnResourceDoesNotExistHelper() {
+ discovery_mechanism_->parent()->OnResourceDoesNotExist(
+ discovery_mechanism_->index());
+ }
RefCountedPtr<EdsDiscoveryMechanism> discovery_mechanism_;
};
+ // This is necessary only because of a bug in msvc where nested class
+ // cannot access protected member in base class.
+ friend class EndpointWatcher;
+
+ y_absl::string_view GetEdsResourceName() const {
+ if (!parent()->is_xds_uri_) return parent()->server_name_;
+ if (!parent()
+ ->config_->discovery_mechanisms()[index()]
+ .eds_service_name.empty()) {
+ return parent()
+ ->config_->discovery_mechanisms()[index()]
+ .eds_service_name;
+ }
+ return parent()->config_->discovery_mechanisms()[index()].cluster_name;
+ }
+
// Note that this is not owned, so this pointer must never be dereferenced.
EndpointWatcher* watcher_ = nullptr;
};
@@ -249,14 +272,16 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
void ReturnResult(Resolver::Result result) override;
- void ReturnError(grpc_error* error) override;
+ void ReturnError(grpc_error_handle error) override;
private:
RefCountedPtr<LogicalDNSDiscoveryMechanism> discovery_mechanism_;
};
- // This is only necessary because of a bug in msvc where nested class cannot
+
+ // This is necessary only because of a bug in msvc where nested class cannot
// access protected member in base class.
friend class ResolverResultHandler;
+
OrphanablePtr<Resolver> resolver_;
};
@@ -291,6 +316,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// This is a no-op, because we get the addresses from the xds
// client, which is a watch-based API.
void RequestReresolution() override {}
+ y_absl::string_view GetAuthority() override;
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override;
@@ -303,7 +329,7 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
void ShutdownLocked() override;
void OnEndpointChanged(size_t index, XdsApi::EdsUpdate update);
- void OnError(size_t index, grpc_error* error);
+ void OnError(size_t index, grpc_error_handle error);
void OnResourceDoesNotExist(size_t index);
void MaybeDestroyChildPolicyLocked();
@@ -317,6 +343,9 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
grpc_channel_args* CreateChildPolicyArgsLocked(
const grpc_channel_args* args_in);
+ // The xds client and endpoint watcher.
+ RefCountedPtr<XdsClient> xds_client_;
+
// Server name from target URI.
TString server_name_;
bool is_xds_uri_;
@@ -328,9 +357,6 @@ class XdsClusterResolverLb : public LoadBalancingPolicy {
// Internal state.
bool shutting_down_ = false;
- // The xds client and endpoint watcher.
- RefCountedPtr<XdsClient> xds_client_;
-
// Vector of discovery mechansism entries in priority order.
std::vector<DiscoveryMechanismEntry> discovery_mechanisms_;
@@ -372,6 +398,10 @@ void XdsClusterResolverLb::Helper::UpdateState(
state, status, std::move(picker));
}
+y_absl::string_view XdsClusterResolverLb::Helper::GetAuthority() {
+ return xds_cluster_resolver_policy_->channel_control_helper()->GetAuthority();
+}
+
void XdsClusterResolverLb::Helper::AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) {
if (xds_cluster_resolver_policy_->shutting_down_) return;
@@ -388,13 +418,12 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::Start() {
gpr_log(GPR_INFO,
"[xds_cluster_resolver_lb %p] eds discovery mechanism %" PRIuPTR
":%p starting xds watch for %s",
- parent(), index(), this,
- TString(GetXdsClusterResolverResourceName()).c_str());
+ parent(), index(), this, TString(GetEdsResourceName()).c_str());
}
- auto watcher = y_absl::make_unique<EndpointWatcher>(
+ auto watcher = MakeRefCounted<EndpointWatcher>(
Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"));
watcher_ = watcher.get();
- parent()->xds_client_->WatchEndpointData(GetXdsClusterResolverResourceName(),
+ parent()->xds_client_->WatchEndpointData(GetEdsResourceName(),
std::move(watcher));
}
@@ -403,80 +432,20 @@ void XdsClusterResolverLb::EdsDiscoveryMechanism::Orphan() {
gpr_log(GPR_INFO,
"[xds_cluster_resolver_lb %p] eds discovery mechanism %" PRIuPTR
":%p cancelling xds watch for %s",
- parent(), index(), this,
- TString(GetXdsClusterResolverResourceName()).c_str());
+ parent(), index(), this, TString(GetEdsResourceName()).c_str());
}
- parent()->xds_client_->CancelEndpointDataWatch(
- GetXdsClusterResolverResourceName(), watcher_);
+ parent()->xds_client_->CancelEndpointDataWatch(GetEdsResourceName(),
+ watcher_);
Unref();
}
//
-// XdsClusterResolverLb::EndpointWatcher::Notifier
-//
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism,
- XdsApi::EdsUpdate update)
- : discovery_mechanism_(std::move(discovery_mechanism)),
- update_(std::move(update)),
- type_(kUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism,
- grpc_error* error)
- : discovery_mechanism_(std::move(discovery_mechanism)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- Notifier(RefCountedPtr<XdsClusterResolverLb::EdsDiscoveryMechanism>
- discovery_mechanism)
- : discovery_mechanism_(std::move(discovery_mechanism)),
- type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- RunInExecCtx(void* arg, grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->discovery_mechanism_->parent()->work_serializer()->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void XdsClusterResolverLb::EdsDiscoveryMechanism::EndpointWatcher::Notifier::
- RunInWorkSerializer(grpc_error* error) {
- switch (type_) {
- case kUpdate:
- discovery_mechanism_->parent()->OnEndpointChanged(
- discovery_mechanism_->index(), std::move(update_));
- break;
- case kError:
- discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(),
- error);
- break;
- case kDoesNotExist:
- discovery_mechanism_->parent()->OnResourceDoesNotExist(
- discovery_mechanism_->index());
- break;
- };
- delete this;
-}
-
-//
// XdsClusterResolverLb::LogicalDNSDiscoveryMechanism
//
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
- TString target = parent()->server_name_;
+ TString target =
+ parent()->config_->discovery_mechanisms()[index()].dns_hostname;
grpc_channel_args* args = nullptr;
FakeResolverResponseGenerator* fake_resolver_response_generator =
grpc_channel_args_find_pointer<FakeResolverResponseGenerator>(
@@ -488,6 +457,7 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::Start() {
fake_resolver_response_generator);
args = grpc_channel_args_copy_and_add(parent()->args_, &new_arg, 1);
} else {
+ target = y_absl::StrCat("dns:", target);
args = grpc_channel_args_copy(parent()->args_);
}
resolver_ = ResolverRegistry::CreateResolver(
@@ -541,7 +511,7 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
}
void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
- ReturnError(grpc_error* error) {
+ ReturnError(grpc_error_handle error) {
discovery_mechanism_->parent()->OnError(discovery_mechanism_->index(), error);
}
@@ -550,36 +520,20 @@ void XdsClusterResolverLb::LogicalDNSDiscoveryMechanism::ResolverResultHandler::
//
XdsClusterResolverLb::XdsClusterResolverLb(RefCountedPtr<XdsClient> xds_client,
- Args args)
- : LoadBalancingPolicy(std::move(args)), xds_client_(std::move(xds_client)) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_cluster_resolver_trace)) {
- gpr_log(GPR_INFO,
- "[xds_cluster_resolver_lb %p] created -- using xds client %p", this,
- xds_client_.get());
- }
- // Record server name.
- const char* server_uri =
- grpc_channel_args_find_string(args.args, GRPC_ARG_SERVER_URI);
- GPR_ASSERT(server_uri != nullptr);
- y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
- GPR_ASSERT(uri.ok() && !uri->path().empty());
- server_name_ = TString(y_absl::StripPrefix(uri->path(), "/"));
- is_xds_uri_ = uri->scheme() == "xds";
+ Args args, TString server_name,
+ bool is_xds_uri)
+ : LoadBalancingPolicy(std::move(args)),
+ xds_client_(std::move(xds_client)),
+ server_name_(std::move(server_name)),
+ is_xds_uri_(is_xds_uri) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_lb_xds_cluster_resolver_trace)) {
gpr_log(GPR_INFO,
- "[xds_cluster_resolver_lb %p] server name from channel "
- "(is_xds_uri=%d): %s",
- this, is_xds_uri_, server_name_.c_str());
+ "[xds_cluster_resolver_lb %p] created -- xds_client=%p, "
+ "server_name=%s, is_xds_uri=%d",
+ this, xds_client_.get(), server_name_.c_str(), is_xds_uri_);
}
// EDS-only flow.
if (!is_xds_uri_) {
- // Setup channelz linkage.
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args.args, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->AddChannelzLinkage(parent_channelz_node);
- }
// Couple polling.
grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
interested_parties());
@@ -603,13 +557,6 @@ void XdsClusterResolverLb::ShutdownLocked() {
MaybeDestroyChildPolicyLocked();
discovery_mechanisms_.clear();
if (!is_xds_uri_) {
- // Remove channelz linkage.
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->RemoveChannelzLinkage(parent_channelz_node);
- }
// Decouple polling.
grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
interested_parties());
@@ -648,14 +595,13 @@ void XdsClusterResolverLb::UpdateLocked(UpdateArgs args) {
DiscoveryMechanismEntry entry;
if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::EDS) {
- entry.discovery_mechanism =
- grpc_core::MakeOrphanable<EdsDiscoveryMechanism>(
- Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"),
- discovery_mechanisms_.size());
+ entry.discovery_mechanism = MakeOrphanable<EdsDiscoveryMechanism>(
+ Ref(DEBUG_LOCATION, "EdsDiscoveryMechanism"),
+ discovery_mechanisms_.size());
} else if (config.type == XdsClusterResolverLbConfig::DiscoveryMechanism::
DiscoveryMechanismType::LOGICAL_DNS) {
entry.discovery_mechanism =
- grpc_core::MakeOrphanable<LogicalDNSDiscoveryMechanism>(
+ MakeOrphanable<LogicalDNSDiscoveryMechanism>(
Ref(DEBUG_LOCATION, "LogicalDNSDiscoveryMechanism"),
discovery_mechanisms_.size());
} else {
@@ -738,11 +684,11 @@ void XdsClusterResolverLb::OnEndpointChanged(size_t index,
UpdatePriorityList(std::move(priority_list));
}
-void XdsClusterResolverLb::OnError(size_t index, grpc_error* error) {
+void XdsClusterResolverLb::OnError(size_t index, grpc_error_handle error) {
gpr_log(GPR_ERROR,
"[xds_cluster_resolver_lb %p] discovery mechanism %" PRIuPTR
" xds watcher reported error: %s",
- this, index, grpc_error_string(error));
+ this, index, grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
if (shutting_down_) return;
if (!discovery_mechanisms_[index].first_update_received) {
@@ -842,6 +788,13 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
std::vector<TString> hierarchical_path = {
priority_child_name, locality_name->AsHumanReadableString()};
for (const auto& endpoint : locality.endpoints) {
+ const ServerAddressWeightAttribute* weight_attribute = static_cast<
+ const ServerAddressWeightAttribute*>(endpoint.GetAttribute(
+ ServerAddressWeightAttribute::kServerAddressWeightAttributeKey));
+ uint32_t weight = locality.lb_weight;
+ if (weight_attribute != nullptr) {
+ weight = locality.lb_weight * weight_attribute->weight();
+ }
addresses.emplace_back(
endpoint
.WithAttribute(kHierarchicalPathAttributeKey,
@@ -849,10 +802,10 @@ ServerAddressList XdsClusterResolverLb::CreateChildPolicyAddressesLocked() {
.WithAttribute(kXdsLocalityNameAttributeKey,
y_absl::make_unique<XdsLocalityAttribute>(
locality_name->Ref()))
- .WithAttribute(ServerAddressWeightAttribute::
- kServerAddressWeightAttributeKey,
- y_absl::make_unique<ServerAddressWeightAttribute>(
- locality.lb_weight)));
+ .WithAttribute(
+ ServerAddressWeightAttribute::
+ kServerAddressWeightAttributeKey,
+ y_absl::make_unique<ServerAddressWeightAttribute>(weight)));
}
}
}
@@ -1010,7 +963,7 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
"[xds_cluster_resolver_lb %p] generated config for child policy: %s",
this, json_str.c_str());
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
RefCountedPtr<LoadBalancingPolicy::Config> config =
LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(json, &error);
if (error != GRPC_ERROR_NONE) {
@@ -1020,16 +973,13 @@ XdsClusterResolverLb::CreateChildPolicyConfigLocked() {
"[xds_cluster_resolver_lb %p] error parsing generated child policy "
"config -- "
"will put channel in TRANSIENT_FAILURE: %s",
- this, grpc_error_string(error));
- error = grpc_error_set_int(
- grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "xds_cluster_resolver LB policy: error "
- "parsing generated child policy config"),
- error),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_INTERNAL);
+ this, grpc_error_std_string(error).c_str());
+ y_absl::Status status = y_absl::InternalError(
+ "xds_cluster_resolver LB policy: error parsing generated child policy "
+ "config");
channel_control_helper()->UpdateState(
- GRPC_CHANNEL_TRANSIENT_FAILURE, grpc_error_to_absl_status(error),
- y_absl::make_unique<TransientFailurePicker>(error));
+ GRPC_CHANNEL_TRANSIENT_FAILURE, status,
+ y_absl::make_unique<TransientFailurePicker>(status));
return nullptr;
}
return config;
@@ -1054,10 +1004,14 @@ void XdsClusterResolverLb::UpdateChildPolicyLocked() {
grpc_channel_args* XdsClusterResolverLb::CreateChildPolicyArgsLocked(
const grpc_channel_args* args) {
- // Inhibit client-side health checking, since the balancer does this for us.
- grpc_arg new_arg = grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1);
- return grpc_channel_args_copy_and_add(args, &new_arg, 1);
+ y_absl::InlinedVector<grpc_arg, 2> new_args = {
+ // Inhibit client-side health checking, since the balancer does this
+ // for us.
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_INHIBIT_HEALTH_CHECKING), 1),
+ };
+ if (!is_xds_uri_) new_args.push_back(xds_client_->MakeChannelArg());
+ return grpc_channel_args_copy_and_add(args, new_args.data(), new_args.size());
}
OrphanablePtr<LoadBalancingPolicy>
@@ -1096,24 +1050,46 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
public:
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- grpc_error* error = GRPC_ERROR_NONE;
- RefCountedPtr<XdsClient> xds_client = XdsClient::GetOrCreate(&error);
- if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR,
- "cannot get XdsClient to instantiate xds_cluster_resolver LB "
- "policy: %s",
- grpc_error_string(error));
- GRPC_ERROR_UNREF(error);
- return nullptr;
+ // Find server name.
+ const char* server_uri =
+ grpc_channel_args_find_string(args.args, GRPC_ARG_SERVER_URI);
+ GPR_ASSERT(server_uri != nullptr);
+ y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
+ GPR_ASSERT(uri.ok() && !uri->path().empty());
+ y_absl::string_view server_name = y_absl::StripPrefix(uri->path(), "/");
+ // Determine if it's an xds URI.
+ bool is_xds_uri =
+ uri->scheme() == "xds" || uri->scheme() == "google-c2p-experimental";
+ // Get XdsClient.
+ RefCountedPtr<XdsClient> xds_client =
+ XdsClient::GetFromChannelArgs(*args.args);
+ if (xds_client == nullptr) {
+ if (!is_xds_uri) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ xds_client = XdsClient::GetOrCreate(args.args, &error);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "cannot get or create XdsClient to instantiate "
+ "xds_cluster_resolver LB policy: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
+ } else {
+ gpr_log(GPR_ERROR,
+ "XdsClient not present in channel args -- cannot instantiate "
+ "xds_cluster_resolver LB policy");
+ return nullptr;
+ }
}
- return MakeOrphanable<XdsClusterResolverChildHandler>(std::move(xds_client),
- std::move(args));
+ return MakeOrphanable<XdsClusterResolverChildHandler>(
+ std::move(xds_client), std::move(args), server_name, is_xds_uri);
}
const char* name() const override { return kXdsClusterResolver; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const override {
+ const Json& json, grpc_error_handle* error) const override {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (json.type() == Json::Type::JSON_NULL) {
// xds_cluster_resolver was mentioned as a policy in the deprecated
@@ -1124,7 +1100,7 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
"Please use loadBalancingConfig field of service config instead.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
std::vector<XdsClusterResolverLbConfig::DiscoveryMechanism>
discovery_mechanisms;
auto it = json.object_value().find("discoveryMechanisms");
@@ -1138,13 +1114,12 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
const Json::Array& array = it->second.array_value();
for (size_t i = 0; i < array.size(); ++i) {
XdsClusterResolverLbConfig::DiscoveryMechanism discovery_mechanism;
- std::vector<grpc_error*> discovery_mechanism_errors =
+ std::vector<grpc_error_handle> discovery_mechanism_errors =
ParseDiscoveryMechanism(array[i], &discovery_mechanism);
if (!discovery_mechanism_errors.empty()) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:discovery_mechanism element: ", i, " error")
- .c_str());
- for (grpc_error* discovery_mechanism_error :
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:discovery_mechanism element: ", i, " error"));
+ for (const grpc_error_handle& discovery_mechanism_error :
discovery_mechanism_errors) {
error = grpc_error_add_child(error, discovery_mechanism_error);
}
@@ -1184,65 +1159,11 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
}
policy_it = policy.find("RING_HASH");
if (policy_it != policy.end()) {
- if (policy_it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:RING_HASH error:type should be object"));
- continue;
- }
- // TODO(donnadionne): Move this to a method in
- // ring_hash_experimental and call it here.
- const Json::Object& ring_hash = policy_it->second.object_value();
xds_lb_policy = array[i];
- size_t min_ring_size = 1024;
- size_t max_ring_size = 8388608;
- auto ring_hash_it = ring_hash.find("min_ring_size");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:min_ring_size missing"));
- } else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:min_ring_size error: should be of "
- "number"));
- } else {
- min_ring_size = gpr_parse_nonnegative_int(
- ring_hash_it->second.string_value().c_str());
- }
- ring_hash_it = ring_hash.find("max_ring_size");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size missing"));
- } else if (ring_hash_it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size error: should be of "
- "number"));
- } else {
- max_ring_size = gpr_parse_nonnegative_int(
- ring_hash_it->second.string_value().c_str());
- }
- if (min_ring_size <= 0 || min_ring_size > 8388608 ||
- max_ring_size <= 0 || max_ring_size > 8388608 ||
- min_ring_size > max_ring_size) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:max_ring_size and or min_ring_size error: "
- "values need to be in the range of 1 to 8388608 "
- "and max_ring_size cannot be smaller than "
- "min_ring_size"));
- }
- ring_hash_it = ring_hash.find("hash_function");
- if (ring_hash_it == ring_hash.end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function missing"));
- } else if (ring_hash_it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function error: should be a "
- "string"));
- } else if (ring_hash_it->second.string_value() != "XX_HASH" &&
- ring_hash_it->second.string_value() != "MURMUR_HASH_2") {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:hash_function error: unsupported "
- "hash_function"));
- }
- break;
+ size_t min_ring_size;
+ size_t max_ring_size;
+ ParseRingHashLbConfig(policy_it->second, &min_ring_size,
+ &max_ring_size, &error_list);
}
}
}
@@ -1259,10 +1180,10 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
}
private:
- static std::vector<grpc_error*> ParseDiscoveryMechanism(
+ static std::vector<grpc_error_handle> ParseDiscoveryMechanism(
const Json& json,
XdsClusterResolverLbConfig::DiscoveryMechanism* discovery_mechanism) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
if (json.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"value should be of type object"));
@@ -1314,35 +1235,46 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
if (it->second.string_value() == "EDS") {
discovery_mechanism->type = XdsClusterResolverLbConfig::
DiscoveryMechanism::DiscoveryMechanismType::EDS;
+ it = json.object_value().find("edsServiceName");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:edsServiceName error:type should be string"));
+ } else {
+ discovery_mechanism->eds_service_name = it->second.string_value();
+ }
+ }
} else if (it->second.string_value() == "LOGICAL_DNS") {
discovery_mechanism->type = XdsClusterResolverLbConfig::
DiscoveryMechanism::DiscoveryMechanismType::LOGICAL_DNS;
+ it = json.object_value().find("dnsHostname");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:dnsHostname error:required field missing"));
+ } else if (it->second.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:dnsHostname error:type should be string"));
+ } else {
+ discovery_mechanism->dns_hostname = it->second.string_value();
+ }
} else {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:type error:invalid type"));
}
}
- // EDS service name.
- it = json.object_value().find("edsServiceName");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:xds_cluster_resolverServiceName error:type should be "
- "string"));
- } else {
- discovery_mechanism->eds_service_name = it->second.string_value();
- }
- }
return error_list;
}
class XdsClusterResolverChildHandler : public ChildPolicyHandler {
public:
XdsClusterResolverChildHandler(RefCountedPtr<XdsClient> xds_client,
- Args args)
+ Args args, y_absl::string_view server_name,
+ bool is_xds_uri)
: ChildPolicyHandler(std::move(args),
&grpc_lb_xds_cluster_resolver_trace),
- xds_client_(std::move(xds_client)) {}
+ xds_client_(std::move(xds_client)),
+ server_name_(server_name),
+ is_xds_uri_(is_xds_uri) {}
bool ConfigChangeRequiresNewPolicyInstance(
LoadBalancingPolicy::Config* old_config,
@@ -1359,11 +1291,14 @@ class XdsClusterResolverLbFactory : public LoadBalancingPolicyFactory {
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
const char* /*name*/, LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args));
+ return MakeOrphanable<XdsClusterResolverLb>(xds_client_, std::move(args),
+ server_name_, is_xds_uri_);
}
private:
RefCountedPtr<XdsClient> xds_client_;
+ TString server_name_;
+ bool is_xds_uri_;
};
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
index 9e4425fa447..d8163cee9e2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_factory.h
@@ -23,6 +23,7 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/json/json.h"
namespace grpc_core {
@@ -39,7 +40,7 @@ class LoadBalancingPolicyFactory {
virtual const char* name() const = 0;
virtual RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error) const = 0;
+ const Json& json, grpc_error_handle* error) const = 0;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
index 463e54a2e6c..259f8dd5725 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.cc
@@ -109,7 +109,7 @@ bool LoadBalancingPolicyRegistry::LoadBalancingPolicyExists(
return false;
}
if (requires_config != nullptr) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Check if the load balancing policy allows an empty config
*requires_config =
factory->ParseLoadBalancingConfig(Json(), &error) == nullptr;
@@ -122,7 +122,7 @@ namespace {
// Returns the JSON node of policy (with both policy name and config content)
// given the JSON node of a LoadBalancingConfig array.
-grpc_error* ParseLoadBalancingConfigHelper(
+grpc_error_handle ParseLoadBalancingConfigHelper(
const Json& lb_config_array, Json::Object::const_iterator* result) {
if (lb_config_array.type() != Json::Type::ARRAY) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("type should be array");
@@ -154,17 +154,15 @@ grpc_error* ParseLoadBalancingConfigHelper(
}
policies_tried.push_back(it->first);
}
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("No known policies in list: ",
- y_absl::StrJoin(policies_tried, " "))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "No known policies in list: ", y_absl::StrJoin(policies_tried, " ")));
}
} // namespace
RefCountedPtr<LoadBalancingPolicy::Config>
-LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(const Json& json,
- grpc_error** error) {
+LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
+ const Json& json, grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
GPR_ASSERT(g_state != nullptr);
Json::Object::const_iterator policy;
@@ -176,9 +174,8 @@ LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(const Json& json,
LoadBalancingPolicyFactory* factory =
g_state->GetLoadBalancingPolicyFactory(policy->first.c_str());
if (factory == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Factory not found for policy \"%s\"", policy->first)
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Factory not found for policy \"%s\"", policy->first));
return nullptr;
}
// Parse load balancing config via factory.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
index 8d2e3e395d5..aba44a8a705 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/lb_policy_registry.h
@@ -57,7 +57,7 @@ class LoadBalancingPolicyRegistry {
/// Returns a parsed object of the load balancing policy to be used from a
/// LoadBalancingConfig array \a json.
static RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& json, grpc_error** error);
+ const Json& json, grpc_error_handle* error);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
index bd556a60c9e..028baa9158a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver.h
@@ -24,7 +24,7 @@
#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/iomgr.h"
@@ -55,7 +55,7 @@ class Resolver : public InternallyRefCounted<Resolver> {
struct Result {
ServerAddressList addresses;
RefCountedPtr<ServiceConfig> service_config;
- grpc_error* service_config_error = GRPC_ERROR_NONE;
+ grpc_error_handle service_config_error = GRPC_ERROR_NONE;
const grpc_channel_args* args = nullptr;
// TODO(roth): Remove everything below once grpc_error and
@@ -81,7 +81,7 @@ class Resolver : public InternallyRefCounted<Resolver> {
/// Returns a transient error to the channel.
/// If the resolver does not set the GRPC_ERROR_INT_GRPC_STATUS
/// attribute on the error, calls will be failed with status UNKNOWN.
- virtual void ReturnError(grpc_error* error) = 0;
+ virtual void ReturnError(grpc_error_handle error) = 0;
// TODO(yashkt): As part of the service config error handling
// changes, add a method to parse the service config JSON string.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md
new file mode 100644
index 00000000000..b60296765d5
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/README.md
@@ -0,0 +1,9 @@
+Support for resolving the scheme used by binder transport implementation.
+
+The URI's authority is required to be empty.
+
+The path is used as the identifiers of endpoint binder objects and the length
+limit of the identifier is the same as unix socket length limit.
+
+The length limit of the path should at least be 100 characters long. This is
+guaranteed by `static_assert` in the implementation.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
new file mode 100644
index 00000000000..151da7be84e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
@@ -0,0 +1,139 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+
+#include <sys/un.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/string.h"
+
+namespace grpc_core {
+namespace {
+
+class BinderResolver : public Resolver {
+ public:
+ BinderResolver(ServerAddressList addresses, ResolverArgs args)
+ : result_handler_(std::move(args.result_handler)),
+ addresses_(std::move(addresses)),
+ channel_args_(grpc_channel_args_copy(args.args)) {}
+
+ ~BinderResolver() override { grpc_channel_args_destroy(channel_args_); };
+
+ void StartLocked() override {
+ Result result;
+ result.addresses = std::move(addresses_);
+ result.args = channel_args_;
+ channel_args_ = nullptr;
+ result_handler_->ReturnResult(std::move(result));
+ }
+
+ void ShutdownLocked() override {}
+
+ private:
+ std::unique_ptr<ResultHandler> result_handler_;
+ ServerAddressList addresses_;
+ const grpc_channel_args* channel_args_ = nullptr;
+};
+
+class BinderResolverFactory : public ResolverFactory {
+ public:
+ bool IsValidUri(const URI& uri) const override {
+ return ParseUri(uri, nullptr);
+ }
+
+ OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
+ ServerAddressList addresses;
+ if (!ParseUri(args.uri, &addresses)) return nullptr;
+ return MakeOrphanable<BinderResolver>(std::move(addresses),
+ std::move(args));
+ }
+
+ const char* scheme() const override { return "binder"; }
+
+ private:
+ static grpc_error_handle BinderAddrPopulate(
+ y_absl::string_view path, grpc_resolved_address* resolved_addr) {
+ path = y_absl::StripPrefix(path, "/");
+ if (path.empty()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING("path is empty");
+ }
+ // Store parsed path in a unix socket so it can be reinterpreted as
+ // sockaddr. An invalid address family (AF_MAX) is set to make sure it won't
+ // be accidentally used.
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
+ struct sockaddr_un* un =
+ reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
+ un->sun_family = AF_MAX;
+ static_assert(sizeof(un->sun_path) >= 101,
+ "unix socket path size is unexpectedly short");
+ if (path.size() + 1 > sizeof(un->sun_path)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat(path, " is too long to be handled"));
+ }
+ // `un` has already be set to zero, no need to append null after the string
+ memcpy(un->sun_path, path.data(), path.size());
+ resolved_addr->len =
+ static_cast<socklen_t>(sizeof(un->sun_family) + path.size() + 1);
+ return GRPC_ERROR_NONE;
+ }
+
+ static bool ParseUri(const URI& uri, ServerAddressList* addresses) {
+ grpc_resolved_address addr;
+ {
+ if (!uri.authority().empty()) {
+ gpr_log(GPR_ERROR, "authority is not supported in binder scheme");
+ return false;
+ }
+ grpc_error_handle error = BinderAddrPopulate(uri.path(), &addr);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return false;
+ }
+ }
+ if (addresses != nullptr) {
+ addresses->emplace_back(addr, nullptr /* args */);
+ }
+ return true;
+ }
+};
+
+} // namespace
+} // namespace grpc_core
+
+void grpc_resolver_binder_init() {
+ grpc_core::ResolverRegistry::Builder::RegisterResolverFactory(
+ y_absl::make_unique<grpc_core::BinderResolverFactory>());
+}
+
+void grpc_resolver_binder_shutdown() {}
+
+#else
+
+void grpc_resolver_binder_init() {}
+
+void grpc_resolver_binder_shutdown() {}
+
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
index 9a488212366..26173d8f31d 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
@@ -24,14 +24,14 @@
#include <stdio.h>
#include <string.h>
+#include <address_sorting/address_sorting.h>
+
#include "y_absl/container/inlined_vector.h"
#include "y_absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include <address_sorting/address_sorting.h>
-
#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
@@ -39,7 +39,7 @@
#include "src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
@@ -60,8 +60,6 @@ namespace grpc_core {
namespace {
-const char kDefaultPort[] = "https";
-
class AresDnsResolver : public Resolver {
public:
explicit AresDnsResolver(ResolverArgs args);
@@ -80,10 +78,10 @@ class AresDnsResolver : public Resolver {
void MaybeStartResolvingLocked();
void StartResolvingLocked();
- static void OnNextResolution(void* arg, grpc_error* error);
- static void OnResolved(void* arg, grpc_error* error);
- void OnNextResolutionLocked(grpc_error* error);
- void OnResolvedLocked(grpc_error* error);
+ static void OnNextResolution(void* arg, grpc_error_handle error);
+ static void OnResolved(void* arg, grpc_error_handle error);
+ void OnNextResolutionLocked(grpc_error_handle error);
+ void OnResolvedLocked(grpc_error_handle error);
/// DNS server to use (if not system default)
TString dns_server_;
@@ -193,18 +191,18 @@ void AresDnsResolver::ShutdownLocked() {
}
}
-void AresDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
+void AresDnsResolver::OnNextResolution(void* arg, grpc_error_handle error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer_->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
}
-void AresDnsResolver::OnNextResolutionLocked(grpc_error* error) {
+void AresDnsResolver::OnNextResolutionLocked(grpc_error_handle error) {
GRPC_CARES_TRACE_LOG(
"resolver:%p re-resolution timer fired. error: %s. shutdown_initiated_: "
"%d",
- this, grpc_error_string(error), shutdown_initiated_);
+ this, grpc_error_std_string(error).c_str(), shutdown_initiated_);
have_next_resolution_timer_ = false;
if (error == GRPC_ERROR_NONE && !shutdown_initiated_) {
if (!resolving_) {
@@ -227,7 +225,7 @@ bool ValueInJsonArray(const Json::Array& array, const char* value) {
}
TString ChooseServiceConfig(char* service_config_choice_json,
- grpc_error** error) {
+ grpc_error_handle* error) {
Json json = Json::Parse(service_config_choice_json, error);
if (*error != GRPC_ERROR_NONE) return "";
if (json.type() != Json::Type::ARRAY) {
@@ -236,7 +234,7 @@ TString ChooseServiceConfig(char* service_config_choice_json,
return "";
}
const Json* service_config = nullptr;
- y_absl::InlinedVector<grpc_error*, 4> error_list;
+ y_absl::InlinedVector<grpc_error_handle, 4> error_list;
for (const Json& choice : json.array_value()) {
if (choice.type() != Json::Type::OBJECT) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -305,17 +303,17 @@ TString ChooseServiceConfig(char* service_config_choice_json,
return service_config->Dump();
}
-void AresDnsResolver::OnResolved(void* arg, grpc_error* error) {
+void AresDnsResolver::OnResolved(void* arg, grpc_error_handle error) {
AresDnsResolver* r = static_cast<AresDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer_->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
}
-void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
+void AresDnsResolver::OnResolvedLocked(grpc_error_handle error) {
GPR_ASSERT(resolving_);
resolving_ = false;
- gpr_free(pending_request_);
+ delete pending_request_;
pending_request_ = nullptr;
if (shutdown_initiated_) {
Unref(DEBUG_LOCATION, "OnResolvedLocked() shutdown");
@@ -354,7 +352,7 @@ void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
backoff_.Reset();
} else {
GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed: %s", this,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
TString error_message =
y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
result_handler_->ReturnError(grpc_error_set_int(
@@ -362,10 +360,14 @@ void AresDnsResolver::OnResolvedLocked(grpc_error* error) {
&error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
// Set retry timer.
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
grpc_millis next_try = backoff_.NextAttemptTime();
grpc_millis timeout = next_try - ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p dns resolution failed (will retry): %s",
- this, grpc_error_string(error));
+ this, grpc_error_std_string(error).c_str());
GPR_ASSERT(!have_next_resolution_timer_);
have_next_resolution_timer_ = true;
// TODO(roth): We currently deal with this ref manually. Once the
@@ -389,13 +391,17 @@ void AresDnsResolver::MaybeStartResolvingLocked() {
// can start the next resolution.
if (have_next_resolution_timer_) return;
if (last_resolution_timestamp_ >= 0) {
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
const grpc_millis earliest_next_resolution =
last_resolution_timestamp_ + min_time_between_resolutions_;
const grpc_millis ms_until_next_resolution =
- earliest_next_resolution - grpc_core::ExecCtx::Get()->Now();
+ earliest_next_resolution - ExecCtx::Get()->Now();
if (ms_until_next_resolution > 0) {
const grpc_millis last_resolution_ago =
- grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_;
+ ExecCtx::Get()->Now() - last_resolution_timestamp_;
GRPC_CARES_TRACE_LOG(
"resolver:%p In cooldown from last resolution (from %" PRId64
" ms ago). Will resolve again in %" PRId64 " ms",
@@ -423,12 +429,12 @@ void AresDnsResolver::StartResolvingLocked() {
resolving_ = true;
service_config_json_ = nullptr;
pending_request_ = grpc_dns_lookup_ares_locked(
- dns_server_.c_str(), name_to_resolve_.c_str(), kDefaultPort,
+ dns_server_.c_str(), name_to_resolve_.c_str(), kDefaultSecurePort,
interested_parties_, &on_resolved_, &addresses_,
enable_srv_queries_ ? &balancer_addresses_ : nullptr,
request_service_config_ ? &service_config_json_ : nullptr,
query_timeout_ms_, work_serializer_);
- last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
+ last_resolution_timestamp_ = ExecCtx::Get()->Now();
GRPC_CARES_TRACE_LOG("resolver:%p Started resolving. pending_request_:%p",
this, pending_request_);
}
@@ -439,7 +445,13 @@ void AresDnsResolver::StartResolvingLocked() {
class AresDnsResolverFactory : public ResolverFactory {
public:
- bool IsValidUri(const URI& /*uri*/) const override { return true; }
+ bool IsValidUri(const URI& uri) const override {
+ if (y_absl::StripPrefix(uri.path(), "/").empty()) {
+ gpr_log(GPR_ERROR, "no server name supplied in dns URI");
+ return false;
+ }
+ return true;
+ }
OrphanablePtr<Resolver> CreateResolver(ResolverArgs args) const override {
return MakeOrphanable<AresDnsResolver>(std::move(args));
@@ -455,7 +467,7 @@ class AresDnsResolverFactory : public ResolverFactory {
extern grpc_address_resolver_vtable* grpc_resolve_address_impl;
static grpc_address_resolver_vtable* default_resolver;
-static grpc_error* blocking_resolve_address_ares(
+static grpc_error_handle blocking_resolve_address_ares(
const char* name, const char* default_port,
grpc_resolved_addresses** addresses) {
return default_resolver->blocking_resolve_address(name, default_port,
@@ -465,19 +477,11 @@ static grpc_error* blocking_resolve_address_ares(
static grpc_address_resolver_vtable ares_resolver = {
grpc_resolve_address_ares, blocking_resolve_address_ares};
-#ifdef GRPC_UV
-/* TODO(murgatroid99): Remove this when we want the cares resolver to be the
- * default when using libuv */
-static bool should_use_ares(const char* resolver_env) {
- return resolver_env != nullptr && gpr_stricmp(resolver_env, "ares") == 0;
-}
-#else /* GRPC_UV */
static bool should_use_ares(const char* resolver_env) {
// TODO(lidiz): Remove the "g_custom_iomgr_enabled" flag once c-ares support
// custom IO managers (e.g. gevent).
return !g_custom_iomgr_enabled && resolver_env != nullptr && (gpr_stricmp(resolver_env, "ares") == 0);
}
-#endif /* GRPC_UV */
static bool g_use_ares_dns_resolver;
@@ -488,7 +492,7 @@ void grpc_resolver_dns_ares_init() {
g_use_ares_dns_resolver = true;
gpr_log(GPR_DEBUG, "Using ares dns resolver");
address_sorting_init();
- grpc_error* error = grpc_ares_init();
+ grpc_error_handle error = grpc_ares_init();
if (error != GRPC_ERROR_NONE) {
GRPC_LOG_IF_ERROR("grpc_ares_init() failed", error);
return;
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
index cc884864862..41b3ae0dba4 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <ares.h>
+
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/work_serializer.h"
@@ -42,7 +43,7 @@ class GrpcPolledFd {
virtual bool IsFdStillReadableLocked() = 0;
/* Called once and only once. Must cause cancellation of any pending
* read/write callbacks. */
- virtual void ShutdownLocked(grpc_error* error) = 0;
+ virtual void ShutdownLocked(grpc_error_handle error) = 0;
/* Get the underlying ares_socket_t that this was created from */
virtual ares_socket_t GetWrappedAresSocketLocked() = 0;
/* A unique name, for logging */
@@ -59,13 +60,13 @@ class GrpcPolledFdFactory {
/* Creates a new wrapped fd for the current platform */
virtual GrpcPolledFd* NewGrpcPolledFdLocked(
ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer) = 0;
+ std::shared_ptr<WorkSerializer> work_serializer) = 0;
/* Optionally configures the ares channel after creation */
virtual void ConfigureAresChannelLocked(ares_channel channel) = 0;
};
std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<grpc_core::WorkSerializer> work_serializer);
+ std::shared_ptr<WorkSerializer> work_serializer);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
new file mode 100644
index 00000000000..45c1464808c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc
@@ -0,0 +1,31 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+#if GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE)
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+
+namespace grpc_core {
+
+std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
+ std::shared_ptr<WorkSerializer> /* work_serializer */) {
+ return nullptr;
+}
+
+} // namespace grpc_core
+
+#endif /* GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE) */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
deleted file mode 100644
index 36d4b24c65c..00000000000
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-#if GRPC_ARES == 1 && defined(GRPC_UV)
-
-#include "y_absl/strings/str_format.h"
-
-#include <ares.h>
-#error #include <uv.h>
-
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/time.h>
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/work_serializer.h"
-
-namespace grpc_core {
-
-void ares_uv_poll_cb(uv_poll_t* handle, int status, int events);
-
-void ares_uv_poll_close_cb(uv_handle_t* handle) { delete handle; }
-
-class GrpcPolledFdLibuv : public GrpcPolledFd {
- public:
- GrpcPolledFdLibuv(ares_socket_t as,
- std::shared_ptr<WorkSerializer> work_serializer)
- : name_(y_absl::StrFormat("c-ares socket: %" PRIdPTR, (intptr_t)as)),
- as_(as),
- work_serializer_(std::move(work_serializer)) {
- handle_ = new uv_poll_t();
- uv_poll_init_socket(uv_default_loop(), handle_, as);
- handle_->data = this;
- }
-
- void RegisterForOnReadableLocked(grpc_closure* read_closure) override {
- GPR_ASSERT(read_closure_ == nullptr);
- GPR_ASSERT((poll_events_ & UV_READABLE) == 0);
- read_closure_ = read_closure;
- poll_events_ |= UV_READABLE;
- uv_poll_start(handle_, poll_events_, ares_uv_poll_cb);
- }
-
- void RegisterForOnWriteableLocked(grpc_closure* write_closure) override {
- GPR_ASSERT(write_closure_ == nullptr);
- GPR_ASSERT((poll_events_ & UV_WRITABLE) == 0);
- write_closure_ = write_closure;
- poll_events_ |= UV_WRITABLE;
- uv_poll_start(handle_, poll_events_, ares_uv_poll_cb);
- }
-
- bool IsFdStillReadableLocked() override {
- /* uv_poll_t is based on poll, which is level triggered. So, if cares
- * leaves some data unread, the event will trigger again. */
- return false;
- }
-
- void ShutdownInternalLocked(grpc_error* error) {
- uv_poll_stop(handle_);
- uv_close(reinterpret_cast<uv_handle_t*>(handle_), ares_uv_poll_close_cb);
- if (read_closure_ != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_,
- GRPC_ERROR_CANCELLED);
- }
- if (write_closure_ != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_,
- GRPC_ERROR_CANCELLED);
- }
- }
-
- void ShutdownLocked(grpc_error* error) override {
- if (grpc_core::ExecCtx::Get() == nullptr) {
- grpc_core::ExecCtx exec_ctx;
- ShutdownInternalLocked(error);
- } else {
- ShutdownInternalLocked(error);
- }
- }
-
- ares_socket_t GetWrappedAresSocketLocked() override { return as_; }
-
- const char* GetName() override { return name_.c_str(); }
-
- // TODO(apolcyn): Data members should be private.
- TString name_;
- ares_socket_t as_;
- uv_poll_t* handle_;
- grpc_closure* read_closure_ = nullptr;
- grpc_closure* write_closure_ = nullptr;
- int poll_events_ = 0;
- std::shared_ptr<WorkSerializer> work_serializer_;
-};
-
-struct AresUvPollCbArg {
- AresUvPollCbArg(uv_poll_t* handle, int status, int events)
- : handle(handle), status(status), events(events) {}
-
- uv_poll_t* handle;
- int status;
- int events;
-};
-
-static void ares_uv_poll_cb_locked(AresUvPollCbArg* arg) {
- std::unique_ptr<AresUvPollCbArg> arg_struct(arg);
- uv_poll_t* handle = arg_struct->handle;
- int status = arg_struct->status;
- int events = arg_struct->events;
- GrpcPolledFdLibuv* polled_fd =
- reinterpret_cast<GrpcPolledFdLibuv*>(handle->data);
- grpc_error* error = GRPC_ERROR_NONE;
- if (status < 0) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("cares polling error");
- error =
- grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(uv_strerror(status)));
- }
- if (events & UV_READABLE) {
- GPR_ASSERT(polled_fd->read_closure_ != nullptr);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, polled_fd->read_closure_, error);
- polled_fd->read_closure_ = nullptr;
- polled_fd->poll_events_ &= ~UV_READABLE;
- }
- if (events & UV_WRITABLE) {
- GPR_ASSERT(polled_fd->write_closure_ != nullptr);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, polled_fd->write_closure_, error);
- polled_fd->write_closure_ = nullptr;
- polled_fd->poll_events_ &= ~UV_WRITABLE;
- }
- uv_poll_start(handle, polled_fd->poll_events_, ares_uv_poll_cb);
-}
-
-void ares_uv_poll_cb(uv_poll_t* handle, int status, int events) {
- grpc_core::ExecCtx exec_ctx;
- GrpcPolledFdLibuv* polled_fd =
- reinterpret_cast<GrpcPolledFdLibuv*>(handle->data);
- AresUvPollCbArg* arg = new AresUvPollCbArg(handle, status, events);
- polled_fd->work_serializer_->Run([arg]() { ares_uv_poll_cb_locked(arg); },
- DEBUG_LOCATION);
-}
-
-class GrpcPolledFdFactoryLibuv : public GrpcPolledFdFactory {
- public:
- GrpcPolledFd* NewGrpcPolledFdLocked(
- ares_socket_t as, grpc_pollset_set* driver_pollset_set,
- std::shared_ptr<WorkSerializer> work_serializer) override {
- return new GrpcPolledFdLibuv(as, std::move(work_serializer));
- }
-
- void ConfigureAresChannelLocked(ares_channel channel) override {}
-};
-
-std::unique_ptr<GrpcPolledFdFactory> NewGrpcPolledFdFactory(
- std::shared_ptr<WorkSerializer> work_serializer) {
- return y_absl::make_unique<GrpcPolledFdFactoryLibuv>();
-}
-
-} // namespace grpc_core
-
-#endif /* GRPC_ARES == 1 && defined(GRPC_UV) */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
index d09d92bb930..5f6ab30d1af 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc
@@ -20,23 +20,24 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_POSIX_SOCKET_ARES_EV_DRIVER)
-#include <ares.h>
#include <string.h>
#include <sys/ioctl.h>
-#include "y_absl/strings/str_cat.h"
+#include <ares.h>
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "y_absl/strings/str_cat.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
namespace grpc_core {
@@ -72,7 +73,7 @@ class GrpcPolledFdPosix : public GrpcPolledFd {
bytes_available > 0;
}
- void ShutdownLocked(grpc_error* error) override {
+ void ShutdownLocked(grpc_error_handle error) override {
grpc_fd_shutdown(fd_, error);
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
index 493107cdc07..ce843af2e01 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
@@ -20,29 +20,30 @@
#include "src/core/lib/iomgr/port.h"
#if GRPC_ARES == 1 && defined(GRPC_WINDOWS_SOCKET_ARES_EV_DRIVER)
-#include "y_absl/strings/str_format.h"
+#include <string.h>
#include <ares.h>
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include <string.h>
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/iocp_windows.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_windows.h"
#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-
/* TODO(apolcyn): remove this hack after fixing upstream.
* Our grpc/c-ares code on Windows uses the ares_set_socket_functions API,
* which uses "struct iovec" type, which on Windows is defined inside of
@@ -131,13 +132,13 @@ class GrpcPolledFdWindows {
grpc_winsocket_destroy(winsocket_);
}
- void ScheduleAndNullReadClosure(grpc_error* error) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
+ void ScheduleAndNullReadClosure(grpc_error_handle error) {
+ ExecCtx::Run(DEBUG_LOCATION, read_closure_, error);
read_closure_ = nullptr;
}
- void ScheduleAndNullWriteClosure(grpc_error* error) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
+ void ScheduleAndNullWriteClosure(grpc_error_handle error) {
+ ExecCtx::Run(DEBUG_LOCATION, write_closure_, error);
write_closure_ = nullptr;
}
@@ -149,8 +150,7 @@ class GrpcPolledFdWindows {
GPR_ASSERT(!read_buf_has_data_);
read_buf_ = GRPC_SLICE_MALLOC(4192);
if (connect_done_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ ContinueRegisterForOnReadableLocked();
} else {
GPR_ASSERT(pending_continue_register_for_on_readable_locked_ == false);
pending_continue_register_for_on_readable_locked_ = true;
@@ -159,7 +159,7 @@ class GrpcPolledFdWindows {
void ContinueRegisterForOnReadableLocked() {
GRPC_CARES_TRACE_LOG(
- "fd:|%s| InnerContinueRegisterForOnReadableLocked "
+ "fd:|%s| ContinueRegisterForOnReadableLocked "
"wsa_connect_error_:%d",
GetName(), wsa_connect_error_);
GPR_ASSERT(connect_done_);
@@ -206,8 +206,7 @@ class GrpcPolledFdWindows {
GPR_ASSERT(write_closure_ == nullptr);
write_closure_ = write_closure;
if (connect_done_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ ContinueRegisterForOnWriteableLocked();
} else {
GPR_ASSERT(pending_continue_register_for_on_writeable_locked_ == false);
pending_continue_register_for_on_writeable_locked_ = true;
@@ -216,7 +215,7 @@ class GrpcPolledFdWindows {
void ContinueRegisterForOnWriteableLocked() {
GRPC_CARES_TRACE_LOG(
- "fd:|%s| InnerContinueRegisterForOnWriteableLocked "
+ "fd:|%s| ContinueRegisterForOnWriteableLocked "
"wsa_connect_error_:%d",
GetName(), wsa_connect_error_);
GPR_ASSERT(connect_done_);
@@ -253,7 +252,7 @@ class GrpcPolledFdWindows {
bool IsFdStillReadableLocked() { return read_buf_has_data_; }
- void ShutdownLocked(grpc_error* error) {
+ void ShutdownLocked(grpc_error_handle error) {
grpc_winsocket_shutdown(winsocket_);
}
@@ -420,10 +419,10 @@ class GrpcPolledFdWindows {
abort();
}
- static void OnTcpConnect(void* arg, grpc_error* error) {
+ static void OnTcpConnect(void* arg, grpc_error_handle error) {
GrpcPolledFdWindows* grpc_polled_fd =
static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
grpc_polled_fd->work_serializer_->Run(
[grpc_polled_fd, error]() {
grpc_polled_fd->OnTcpConnectLocked(error);
@@ -431,12 +430,12 @@ class GrpcPolledFdWindows {
DEBUG_LOCATION);
}
- void OnTcpConnectLocked(grpc_error* error) {
+ void OnTcpConnectLocked(grpc_error_handle error) {
GRPC_CARES_TRACE_LOG(
"fd:%s InnerOnTcpConnectLocked error:|%s| "
"pending_register_for_readable:%d"
" pending_register_for_writeable:%d",
- GetName(), grpc_error_string(error),
+ GetName(), grpc_error_std_string(error).c_str(),
pending_continue_register_for_on_readable_locked_,
pending_continue_register_for_on_writeable_locked_);
GPR_ASSERT(!connect_done_);
@@ -465,12 +464,10 @@ class GrpcPolledFdWindows {
wsa_connect_error_ = WSA_OPERATION_ABORTED;
}
if (pending_continue_register_for_on_readable_locked_) {
- work_serializer_->Run([this]() { ContinueRegisterForOnReadableLocked(); },
- DEBUG_LOCATION);
+ ContinueRegisterForOnReadableLocked();
}
if (pending_continue_register_for_on_writeable_locked_) {
- work_serializer_->Run(
- [this]() { ContinueRegisterForOnWriteableLocked(); }, DEBUG_LOCATION);
+ ContinueRegisterForOnWriteableLocked();
}
GRPC_ERROR_UNREF(error);
}
@@ -576,9 +573,9 @@ class GrpcPolledFdWindows {
return out;
}
- static void OnIocpReadable(void* arg, grpc_error* error) {
+ static void OnIocpReadable(void* arg, grpc_error_handle error) {
GrpcPolledFdWindows* polled_fd = static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
polled_fd->work_serializer_->Run(
[polled_fd, error]() { polled_fd->OnIocpReadableLocked(error); },
DEBUG_LOCATION);
@@ -589,7 +586,7 @@ class GrpcPolledFdWindows {
// c-ares reads from this socket later, but it shouldn't necessarily cancel
// the entire resolution attempt. Doing so will allow the "inject broken
// nameserver list" test to pass on Windows.
- void OnIocpReadableLocked(grpc_error* error) {
+ void OnIocpReadableLocked(grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) {
if (winsocket_->read_info.wsa_error != 0) {
/* WSAEMSGSIZE would be due to receiving more data
@@ -603,7 +600,7 @@ class GrpcPolledFdWindows {
"fd:|%s| OnIocpReadableInner winsocket_->read_info.wsa_error "
"code:|%d| msg:|%s|",
GetName(), winsocket_->read_info.wsa_error,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
}
}
@@ -621,15 +618,15 @@ class GrpcPolledFdWindows {
ScheduleAndNullReadClosure(error);
}
- static void OnIocpWriteable(void* arg, grpc_error* error) {
+ static void OnIocpWriteable(void* arg, grpc_error_handle error) {
GrpcPolledFdWindows* polled_fd = static_cast<GrpcPolledFdWindows*>(arg);
- GRPC_ERROR_REF(error); // error owned by lambda
+ (void)GRPC_ERROR_REF(error); // error owned by lambda
polled_fd->work_serializer_->Run(
[polled_fd, error]() { polled_fd->OnIocpWriteableLocked(error); },
DEBUG_LOCATION);
}
- void OnIocpWriteableLocked(grpc_error* error) {
+ void OnIocpWriteableLocked(grpc_error_handle error) {
GRPC_CARES_TRACE_LOG("OnIocpWriteableInner. fd:|%s|", GetName());
GPR_ASSERT(socket_type_ == SOCK_STREAM);
if (error == GRPC_ERROR_NONE) {
@@ -640,7 +637,7 @@ class GrpcPolledFdWindows {
"fd:|%s| OnIocpWriteableInner. winsocket_->write_info.wsa_error "
"code:|%d| msg:|%s|",
GetName(), winsocket_->write_info.wsa_error,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
}
GPR_ASSERT(tcp_write_state_ == WRITE_PENDING);
@@ -851,7 +848,7 @@ class GrpcPolledFdWindowsWrapper : public GrpcPolledFd {
return wrapped_->IsFdStillReadableLocked();
}
- void ShutdownLocked(grpc_error* error) override {
+ void ShutdownLocked(grpc_error_handle error) override {
wrapped_->ShutdownLocked(error);
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
index 9b742d2d346..f21f27830e7 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
@@ -20,34 +20,33 @@
#if GRPC_ARES == 1
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <string.h>
#include <sys/types.h>
+#include <address_sorting/address_sorting.h>
+#include <ares.h>
+
#include "y_absl/container/inlined_vector.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
-#include <ares.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
-#include <address_sorting/address_sorting.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.h"
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/nameser.h"
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/transport/authority_override.h"
using grpc_core::ServerAddress;
using grpc_core::ServerAddressList;
@@ -57,29 +56,6 @@ grpc_core::TraceFlag grpc_trace_cares_address_sorting(false,
grpc_core::TraceFlag grpc_trace_cares_resolver(false, "cares_resolver");
-typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
-
-struct grpc_ares_request {
- /** indicates the DNS server to use, if specified */
- struct ares_addr_port_node dns_server_addr;
- /** following members are set in grpc_resolve_address_ares_impl */
- /** closure to call when the request completes */
- grpc_closure* on_done;
- /** the pointer to receive the resolved addresses */
- std::unique_ptr<grpc_core::ServerAddressList>* addresses_out;
- /** the pointer to receive the resolved balancer addresses */
- std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses_out;
- /** the pointer to receive the service config in JSON */
- char** service_config_json_out;
- /** the evernt driver used by this request */
- grpc_ares_ev_driver* ev_driver;
- /** number of ongoing queries */
- size_t pending_queries;
-
- /** the errors explaining query failures, appended to in query callbacks */
- grpc_error* error;
-};
-
typedef struct fd_node {
/** the owner of this fd node */
grpc_ares_ev_driver* ev_driver;
@@ -268,11 +244,13 @@ static grpc_millis calculate_next_ares_backup_poll_alarm_ms(
grpc_core::ExecCtx::Get()->Now();
}
-static void on_timeout_locked(grpc_ares_ev_driver* driver, grpc_error* error) {
+static void on_timeout_locked(grpc_ares_ev_driver* driver,
+ grpc_error_handle error) {
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_timeout_locked. driver->shutting_down=%d. "
"err=%s",
- driver->request, driver, driver->shutting_down, grpc_error_string(error));
+ driver->request, driver, driver->shutting_down,
+ grpc_error_std_string(error).c_str());
if (!driver->shutting_down && error == GRPC_ERROR_NONE) {
grpc_ares_ev_driver_shutdown_locked(driver);
}
@@ -280,9 +258,9 @@ static void on_timeout_locked(grpc_ares_ev_driver* driver, grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-static void on_timeout(void* arg, grpc_error* error) {
+static void on_timeout(void* arg, grpc_error_handle error) {
grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
driver->work_serializer->Run(
[driver, error]() { on_timeout_locked(driver, error); }, DEBUG_LOCATION);
}
@@ -290,11 +268,11 @@ static void on_timeout(void* arg, grpc_error* error) {
static void grpc_ares_notify_on_event_locked(grpc_ares_ev_driver* ev_driver);
static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
- grpc_error* error);
+ grpc_error_handle error);
-static void on_ares_backup_poll_alarm(void* arg, grpc_error* error) {
+static void on_ares_backup_poll_alarm(void* arg, grpc_error_handle error) {
grpc_ares_ev_driver* driver = static_cast<grpc_ares_ev_driver*>(arg);
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
driver->work_serializer->Run(
[driver, error]() { on_ares_backup_poll_alarm_locked(driver, error); },
DEBUG_LOCATION);
@@ -309,12 +287,13 @@ static void on_ares_backup_poll_alarm(void* arg, grpc_error* error) {
* For the latter, we use this backup poller. Also see
* https://github.com/grpc/grpc/pull/17688 description for more details. */
static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
- grpc_error* error) {
+ grpc_error_handle error) {
GRPC_CARES_TRACE_LOG(
"request:%p ev_driver=%p on_ares_backup_poll_alarm_locked. "
"driver->shutting_down=%d. "
"err=%s",
- driver->request, driver, driver->shutting_down, grpc_error_string(error));
+ driver->request, driver, driver->shutting_down,
+ grpc_error_std_string(error).c_str());
if (!driver->shutting_down && error == GRPC_ERROR_NONE) {
fd_node* fdn = driver->fds;
while (fdn != nullptr) {
@@ -329,6 +308,10 @@ static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
fdn = fdn->next;
}
if (!driver->shutting_down) {
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ grpc_core::ExecCtx::Get()->InvalidateNow();
grpc_millis next_ares_backup_poll_alarm =
calculate_next_ares_backup_poll_alarm_ms(driver);
grpc_ares_ev_driver_ref(driver);
@@ -345,7 +328,7 @@ static void on_ares_backup_poll_alarm_locked(grpc_ares_ev_driver* driver,
GRPC_ERROR_UNREF(error);
}
-static void on_readable_locked(fd_node* fdn, grpc_error* error) {
+static void on_readable_locked(fd_node* fdn, grpc_error_handle error) {
GPR_ASSERT(fdn->readable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -370,14 +353,14 @@ static void on_readable_locked(fd_node* fdn, grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-static void on_readable(void* arg, grpc_error* error) {
+static void on_readable(void* arg, grpc_error_handle error) {
fd_node* fdn = static_cast<fd_node*>(arg);
- GRPC_ERROR_REF(error); /* ref owned by lambda */
+ (void)GRPC_ERROR_REF(error); /* ref owned by lambda */
fdn->ev_driver->work_serializer->Run(
[fdn, error]() { on_readable_locked(fdn, error); }, DEBUG_LOCATION);
}
-static void on_writable_locked(fd_node* fdn, grpc_error* error) {
+static void on_writable_locked(fd_node* fdn, grpc_error_handle error) {
GPR_ASSERT(fdn->writable_registered);
grpc_ares_ev_driver* ev_driver = fdn->ev_driver;
const ares_socket_t as = fdn->grpc_polled_fd->GetWrappedAresSocketLocked();
@@ -400,9 +383,9 @@ static void on_writable_locked(fd_node* fdn, grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-static void on_writable(void* arg, grpc_error* error) {
+static void on_writable(void* arg, grpc_error_handle error) {
fd_node* fdn = static_cast<fd_node*>(arg);
- GRPC_ERROR_REF(error); /* ref owned by lambda */
+ (void)GRPC_ERROR_REF(error); /* ref owned by lambda */
fdn->ev_driver->work_serializer->Run(
[fdn, error]() { on_writable_locked(fdn, error); }, DEBUG_LOCATION);
}
@@ -516,7 +499,7 @@ static void noop_inject_channel_config(ares_channel /*channel*/) {}
void (*grpc_ares_test_only_inject_config)(ares_channel channel) =
noop_inject_channel_config;
-grpc_error* grpc_ares_ev_driver_create_locked(
+grpc_error_handle grpc_ares_ev_driver_create_locked(
grpc_ares_ev_driver** ev_driver, grpc_pollset_set* pollset_set,
int query_timeout_ms,
std::shared_ptr<grpc_core::WorkSerializer> work_serializer,
@@ -529,10 +512,8 @@ grpc_error* grpc_ares_ev_driver_create_locked(
grpc_ares_test_only_inject_config((*ev_driver)->channel);
GRPC_CARES_TRACE_LOG("request:%p grpc_ares_ev_driver_create_locked", request);
if (status != ARES_SUCCESS) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to init ares channel. C-ares error: ",
- ares_strerror(status))
- .c_str());
+ grpc_error_handle err = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Failed to init ares channel. C-ares error: ", ares_strerror(status)));
gpr_free(*ev_driver);
return err;
}
@@ -665,8 +646,8 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
for (size_t i = 0; hostent->h_addr_list[i] != nullptr; ++i) {
y_absl::InlinedVector<grpc_arg, 1> args_to_add;
if (hr->is_balancer) {
- args_to_add.emplace_back(
- grpc_core::CreateAuthorityOverrideChannelArg(hr->host));
+ args_to_add.emplace_back(grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY), hr->host));
}
grpc_channel_args* args = grpc_channel_args_copy_and_add(
nullptr, args_to_add.data(), args_to_add.size());
@@ -713,7 +694,8 @@ static void on_hostbyname_done_locked(void* arg, int status, int /*timeouts*/,
hr->qtype, hr->host, hr->is_balancer, ares_strerror(status));
GRPC_CARES_TRACE_LOG("request:%p on_hostbyname_done_locked: %s", r,
error_msg.c_str());
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ grpc_error_handle error =
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(std::move(error_msg));
r->error = grpc_error_add_child(error, r->error);
}
destroy_hostbyname_request_locked(hr);
@@ -757,7 +739,8 @@ static void on_srv_query_done_locked(void* arg, int status, int /*timeouts*/,
ares_strerror(status));
GRPC_CARES_TRACE_LOG("request:%p on_srv_query_done_locked: %s", r,
error_msg.c_str());
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
+ grpc_error_handle error =
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(std::move(error_msg));
r->error = grpc_error_add_child(error, r->error);
}
delete q;
@@ -773,7 +756,7 @@ static void on_txt_done_locked(void* arg, int status, int /*timeouts*/,
const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
struct ares_txt_ext* result = nullptr;
struct ares_txt_ext* reply = nullptr;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (status != ARES_SUCCESS) goto fail;
GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked name=%s ARES_SUCCESS", r,
q->name().c_str());
@@ -814,9 +797,9 @@ fail:
TString error_msg =
y_absl::StrFormat("C-ares status is not ARES_SUCCESS qtype=TXT name=%s: %s",
q->name(), ares_strerror(status));
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str());
GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked %s", r,
error_msg.c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(std::move(error_msg));
r->error = grpc_error_add_child(error, r->error);
}
@@ -825,7 +808,7 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
const char* default_port, grpc_pollset_set* interested_parties,
int query_timeout_ms,
std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_ares_hostbyname_request* hr = nullptr;
/* parse name, splitting it into host and port parts */
TString host;
@@ -834,13 +817,13 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
if (host.empty()) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("unparseable host:port"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
} else if (port.empty()) {
if (default_port == nullptr) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
}
port = default_port;
@@ -872,16 +855,14 @@ void grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked(
} else {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("cannot parse authority"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto error_cleanup;
}
int status =
ares_set_servers_ports(r->ev_driver->channel, &r->dns_server_addr);
if (status != ARES_SUCCESS) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("C-ares status is not ARES_SUCCESS: ",
- ares_strerror(status))
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "C-ares status is not ARES_SUCCESS: ", ares_strerror(status)));
goto error_cleanup;
}
}
@@ -1055,15 +1036,12 @@ static grpc_ares_request* grpc_dns_lookup_ares_locked_impl(
std::unique_ptr<grpc_core::ServerAddressList>* balancer_addrs,
char** service_config_json, int query_timeout_ms,
std::shared_ptr<grpc_core::WorkSerializer> work_serializer) {
- grpc_ares_request* r =
- static_cast<grpc_ares_request*>(gpr_zalloc(sizeof(grpc_ares_request)));
+ grpc_ares_request* r = new grpc_ares_request();
r->ev_driver = nullptr;
r->on_done = on_done;
r->addresses_out = addrs;
r->balancer_addresses_out = balancer_addrs;
r->service_config_json_out = service_config_json;
- r->error = GRPC_ERROR_NONE;
- r->pending_queries = 0;
GRPC_CARES_TRACE_LOG(
"request:%p c-ares grpc_dns_lookup_ares_locked_impl name=%s, "
"default_port=%s",
@@ -1116,19 +1094,18 @@ void (*grpc_cancel_ares_request_locked)(grpc_ares_request* r) =
// Windows. Calling them may cause race conditions when other parts of the
// binary calls these functions concurrently.
#ifdef GPR_WINDOWS
-grpc_error* grpc_ares_init(void) {
+grpc_error_handle grpc_ares_init(void) {
int status = ares_library_init(ARES_LIB_INIT_ALL);
if (status != ARES_SUCCESS) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("ares_library_init failed: ", ares_strerror(status))
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("ares_library_init failed: ", ares_strerror(status)));
}
return GRPC_ERROR_NONE;
}
void grpc_ares_cleanup(void) { ares_library_cleanup(); }
#else
-grpc_error* grpc_ares_init(void) { return GRPC_ERROR_NONE; }
+grpc_error_handle grpc_ares_init(void) { return GRPC_ERROR_NONE; }
void grpc_ares_cleanup(void) {}
#endif // GPR_WINDOWS
@@ -1159,8 +1136,8 @@ typedef struct grpc_resolve_address_ares_request {
} grpc_resolve_address_ares_request;
static void on_dns_lookup_done_locked(grpc_resolve_address_ares_request* r,
- grpc_error* error) {
- gpr_free(r->ares_request);
+ grpc_error_handle error) {
+ delete r->ares_request;
grpc_resolved_addresses** resolved_addresses = r->addrs_out;
if (r->addresses == nullptr || r->addresses->empty()) {
*resolved_addresses = nullptr;
@@ -1180,10 +1157,10 @@ static void on_dns_lookup_done_locked(grpc_resolve_address_ares_request* r,
delete r;
}
-static void on_dns_lookup_done(void* arg, grpc_error* error) {
+static void on_dns_lookup_done(void* arg, grpc_error_handle error) {
grpc_resolve_address_ares_request* r =
static_cast<grpc_resolve_address_ares_request*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer->Run([r, error]() { on_dns_lookup_done_locked(r, error); },
DEBUG_LOCATION);
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
index 6c29bb68a47..cfc0e2b60fa 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
@@ -42,7 +42,27 @@ extern grpc_core::TraceFlag grpc_trace_cares_resolver;
} \
} while (0)
-typedef struct grpc_ares_request grpc_ares_request;
+typedef struct grpc_ares_ev_driver grpc_ares_ev_driver;
+
+struct grpc_ares_request {
+ /** indicates the DNS server to use, if specified */
+ struct ares_addr_port_node dns_server_addr;
+ /** following members are set in grpc_resolve_address_ares_impl */
+ /** closure to call when the request completes */
+ grpc_closure* on_done = nullptr;
+ /** the pointer to receive the resolved addresses */
+ std::unique_ptr<grpc_core::ServerAddressList>* addresses_out;
+ /** the pointer to receive the resolved balancer addresses */
+ std::unique_ptr<grpc_core::ServerAddressList>* balancer_addresses_out;
+ /** the pointer to receive the service config in JSON */
+ char** service_config_json_out = nullptr;
+ /** the evernt driver used by this request */
+ grpc_ares_ev_driver* ev_driver = nullptr;
+ /** number of ongoing queries */
+ size_t pending_queries = 0;
+ /** the errors explaining query failures, appended to in query callbacks */
+ grpc_error_handle error = GRPC_ERROR_NONE;
+};
/* Asynchronously resolve \a name. Use \a default_port if a port isn't
designated in \a name, otherwise use the port in \a name. grpc_ares_init()
@@ -76,7 +96,7 @@ extern void (*grpc_cancel_ares_request_locked)(grpc_ares_request* request);
/* Initialize gRPC ares wrapper. Must be called at least once before
grpc_resolve_address_ares(). */
-grpc_error* grpc_ares_init(void);
+grpc_error_handle grpc_ares_init(void);
/* Uninitialized gRPC ares wrapper. If there was more than one previous call to
grpc_ares_init(), this function uninitializes the gRPC ares wrapper only if
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
new file mode 100644
index 00000000000..fdd4e00c553
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc
@@ -0,0 +1,28 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/port.h"
+#if GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE)
+
+#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
+
+bool grpc_ares_query_ipv6() {
+ /* The libuv grpc code currently does not have the code to probe for this,
+ * so we assume for now that IPv6 is always available in contexts where this
+ * code will be used. */
+ return true;
+}
+
+#endif /* GRPC_ARES == 1 && defined(GRPC_USE_EVENT_ENGINE) */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
deleted file mode 100644
index 1d4a90fbd90..00000000000
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-#if GRPC_ARES == 1 && defined(GRPC_UV)
-
-#include <grpc/support/string_util.h>
-
-#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
-
-bool grpc_ares_query_ipv6() {
- /* The libuv grpc code currently does not have the code to probe for this,
- * so we assume for now that IPv6 is always available in contexts where this
- * code will be used. */
- return true;
-}
-
-#endif /* GRPC_ARES == 1 && defined(GRPC_UV) */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
index df11db3624d..f76c6a4a12b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc
@@ -25,8 +25,8 @@
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/socket_windows.h"
bool grpc_ares_query_ipv6() { return grpc_ipv6_loopback_available(); }
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
index 516a1eb1722..455e3f4d23f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <inttypes.h>
+
#include <climits>
#include <cstring>
@@ -48,8 +49,6 @@ namespace grpc_core {
namespace {
-const char kDefaultPort[] = "https";
-
class NativeDnsResolver : public Resolver {
public:
explicit NativeDnsResolver(ResolverArgs args);
@@ -68,10 +67,10 @@ class NativeDnsResolver : public Resolver {
void MaybeStartResolvingLocked();
void StartResolvingLocked();
- static void OnNextResolution(void* arg, grpc_error* error);
- void OnNextResolutionLocked(grpc_error* error);
- static void OnResolved(void* arg, grpc_error* error);
- void OnResolvedLocked(grpc_error* error);
+ static void OnNextResolution(void* arg, grpc_error_handle error);
+ void OnNextResolutionLocked(grpc_error_handle error);
+ static void OnResolved(void* arg, grpc_error_handle error);
+ void OnResolvedLocked(grpc_error_handle error);
/// name to resolve
TString name_to_resolve_;
@@ -148,14 +147,14 @@ void NativeDnsResolver::ShutdownLocked() {
}
}
-void NativeDnsResolver::OnNextResolution(void* arg, grpc_error* error) {
+void NativeDnsResolver::OnNextResolution(void* arg, grpc_error_handle error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // ref owned by lambda
+ (void)GRPC_ERROR_REF(error); // ref owned by lambda
r->work_serializer_->Run([r, error]() { r->OnNextResolutionLocked(error); },
DEBUG_LOCATION);
}
-void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
+void NativeDnsResolver::OnNextResolutionLocked(grpc_error_handle error) {
have_next_resolution_timer_ = false;
if (error == GRPC_ERROR_NONE && !resolving_) {
StartResolvingLocked();
@@ -164,14 +163,14 @@ void NativeDnsResolver::OnNextResolutionLocked(grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-void NativeDnsResolver::OnResolved(void* arg, grpc_error* error) {
+void NativeDnsResolver::OnResolved(void* arg, grpc_error_handle error) {
NativeDnsResolver* r = static_cast<NativeDnsResolver*>(arg);
- GRPC_ERROR_REF(error); // owned by lambda
+ (void)GRPC_ERROR_REF(error); // owned by lambda
r->work_serializer_->Run([r, error]() { r->OnResolvedLocked(error); },
DEBUG_LOCATION);
}
-void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
+void NativeDnsResolver::OnResolvedLocked(grpc_error_handle error) {
GPR_ASSERT(resolving_);
resolving_ = false;
if (shutdown_) {
@@ -197,7 +196,7 @@ void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
backoff_.Reset();
} else {
gpr_log(GPR_INFO, "dns resolution failed (will retry): %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
// Return transient error.
TString error_message =
y_absl::StrCat("DNS resolution failed for service: ", name_to_resolve_);
@@ -206,6 +205,10 @@ void NativeDnsResolver::OnResolvedLocked(grpc_error* error) {
&error, 1),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
// Set up for retry.
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
grpc_millis next_try = backoff_.NextAttemptTime();
grpc_millis timeout = next_try - ExecCtx::Get()->Now();
GPR_ASSERT(!have_next_resolution_timer_);
@@ -232,13 +235,17 @@ void NativeDnsResolver::MaybeStartResolvingLocked() {
// can start the next resolution.
if (have_next_resolution_timer_) return;
if (last_resolution_timestamp_ >= 0) {
+ // InvalidateNow to avoid getting stuck re-initializing this timer
+ // in a loop while draining the currently-held WorkSerializer.
+ // Also see https://github.com/grpc/grpc/issues/26079.
+ ExecCtx::Get()->InvalidateNow();
const grpc_millis earliest_next_resolution =
last_resolution_timestamp_ + min_time_between_resolutions_;
const grpc_millis ms_until_next_resolution =
- earliest_next_resolution - grpc_core::ExecCtx::Get()->Now();
+ earliest_next_resolution - ExecCtx::Get()->Now();
if (ms_until_next_resolution > 0) {
const grpc_millis last_resolution_ago =
- grpc_core::ExecCtx::Get()->Now() - last_resolution_timestamp_;
+ ExecCtx::Get()->Now() - last_resolution_timestamp_;
gpr_log(GPR_DEBUG,
"In cooldown from last resolution (from %" PRId64
" ms ago). Will resolve again in %" PRId64 " ms",
@@ -271,9 +278,9 @@ void NativeDnsResolver::StartResolvingLocked() {
addresses_ = nullptr;
GRPC_CLOSURE_INIT(&on_resolved_, NativeDnsResolver::OnResolved, this,
grpc_schedule_on_exec_ctx);
- grpc_resolve_address(name_to_resolve_.c_str(), kDefaultPort,
+ grpc_resolve_address(name_to_resolve_.c_str(), kDefaultSecurePort,
interested_parties_, &on_resolved_, &addresses_);
- last_resolution_timestamp_ = grpc_core::ExecCtx::Get()->Now();
+ last_resolution_timestamp_ = ExecCtx::Get()->Now();
}
//
@@ -287,6 +294,10 @@ class NativeDnsResolverFactory : public ResolverFactory {
gpr_log(GPR_ERROR, "authority based dns uri's not supported");
return false;
}
+ if (y_absl::StripPrefix(uri.path(), "/").empty()) {
+ gpr_log(GPR_ERROR, "no server name supplied in dns URI");
+ return false;
+ }
return true;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
index 99f3c24dd27..e28490be9e3 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc
@@ -19,6 +19,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
+
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -30,19 +32,17 @@
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/closure.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/iomgr/work_serializer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
-
namespace grpc_core {
// This cannot be in an anonymous namespace, because it is a friend of
@@ -313,48 +313,42 @@ void FakeResolverResponseGenerator::SetFakeResolver(
namespace {
-static void* response_generator_arg_copy(void* p) {
- FakeResolverResponseGenerator* generator =
- static_cast<FakeResolverResponseGenerator*>(p);
- // TODO(roth): We currently deal with this ref manually. Once the
- // new channel args code is converted to C++, find a way to track this ref
- // in a cleaner way.
- RefCountedPtr<FakeResolverResponseGenerator> copy = generator->Ref();
- copy.release();
+void* ResponseGeneratorChannelArgCopy(void* p) {
+ auto* generator = static_cast<FakeResolverResponseGenerator*>(p);
+ generator->Ref().release();
return p;
}
-static void response_generator_arg_destroy(void* p) {
- FakeResolverResponseGenerator* generator =
- static_cast<FakeResolverResponseGenerator*>(p);
+void ResponseGeneratorChannelArgDestroy(void* p) {
+ auto* generator = static_cast<FakeResolverResponseGenerator*>(p);
generator->Unref();
}
-static int response_generator_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
-
-static const grpc_arg_pointer_vtable response_generator_arg_vtable = {
- response_generator_arg_copy, response_generator_arg_destroy,
- response_generator_cmp};
+int ResponseGeneratorChannelArgCmp(void* a, void* b) {
+ return QsortCompare(a, b);
+}
} // namespace
+const grpc_arg_pointer_vtable
+ FakeResolverResponseGenerator::kChannelArgPointerVtable = {
+ ResponseGeneratorChannelArgCopy, ResponseGeneratorChannelArgDestroy,
+ ResponseGeneratorChannelArgCmp};
+
grpc_arg FakeResolverResponseGenerator::MakeChannelArg(
FakeResolverResponseGenerator* generator) {
- grpc_arg arg;
- arg.type = GRPC_ARG_POINTER;
- arg.key = const_cast<char*>(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR);
- arg.value.pointer.p = generator;
- arg.value.pointer.vtable = &response_generator_arg_vtable;
- return arg;
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR), generator,
+ &kChannelArgPointerVtable);
}
RefCountedPtr<FakeResolverResponseGenerator>
FakeResolverResponseGenerator::GetFromArgs(const grpc_channel_args* args) {
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR);
- if (arg == nullptr || arg->type != GRPC_ARG_POINTER) return nullptr;
- return static_cast<FakeResolverResponseGenerator*>(arg->value.pointer.p)
- ->Ref();
+ auto* response_generator =
+ grpc_channel_args_find_pointer<FakeResolverResponseGenerator>(
+ args, GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR);
+ if (response_generator == nullptr) return nullptr;
+ return response_generator->Ref();
}
//
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
index b9ca69df1e0..12718bbe89f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h
@@ -42,6 +42,8 @@ class FakeResolver;
class FakeResolverResponseGenerator
: public RefCounted<FakeResolverResponseGenerator> {
public:
+ static const grpc_arg_pointer_vtable kChannelArgPointerVtable;
+
FakeResolverResponseGenerator();
~FakeResolverResponseGenerator() override;
@@ -69,6 +71,7 @@ class FakeResolverResponseGenerator
void SetFailureOnReresolution();
// Returns a channel arg containing \a generator.
+ // TODO(roth): When we have time, make this a non-static method.
static grpc_arg MakeChannelArg(FakeResolverResponseGenerator* generator);
// Returns the response generator in \a args, or null if not found.
@@ -82,12 +85,11 @@ class FakeResolverResponseGenerator
// Mutex protecting the members below.
Mutex mu_;
- RefCountedPtr<FakeResolver> resolver_;
- Resolver::Result result_;
- bool has_result_ = false;
+ RefCountedPtr<FakeResolver> resolver_ Y_ABSL_GUARDED_BY(mu_);
+ Resolver::Result result_ Y_ABSL_GUARDED_BY(mu_);
+ bool has_result_ Y_ABSL_GUARDED_BY(mu_) = false;
};
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H \
- */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_FAKE_FAKE_RESOLVER_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
index 596619df934..6d69af36e50 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
@@ -16,6 +16,8 @@
#include <grpc/support/port_platform.h>
+#include <random>
+
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/lib/gpr/env.h"
@@ -48,21 +50,21 @@ class GoogleCloud2ProdResolver : public Resolver {
void Orphan() override;
private:
- static void OnHttpRequestDone(void* arg, grpc_error* error);
+ static void OnHttpRequestDone(void* arg, grpc_error_handle error);
// Calls OnDone() if not already called. Releases a ref.
- void MaybeCallOnDone(grpc_error* error);
+ void MaybeCallOnDone(grpc_error_handle error);
// If error is not GRPC_ERROR_NONE, then it's not safe to look at response.
virtual void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response,
- grpc_error* error) = 0;
+ grpc_error_handle error) = 0;
RefCountedPtr<GoogleCloud2ProdResolver> resolver_;
grpc_httpcli_context context_;
grpc_httpcli_response response_;
grpc_closure on_done_;
- Atomic<bool> on_done_called_{false};
+ std::atomic<bool> on_done_called_{false};
};
// A metadata server query to get the zone.
@@ -73,7 +75,8 @@ class GoogleCloud2ProdResolver : public Resolver {
private:
void OnDone(GoogleCloud2ProdResolver* resolver,
- const grpc_http_response* response, grpc_error* error) override;
+ const grpc_http_response* response,
+ grpc_error_handle error) override;
};
// A metadata server query to get the IPv6 address.
@@ -84,7 +87,8 @@ class GoogleCloud2ProdResolver : public Resolver {
private:
void OnDone(GoogleCloud2ProdResolver* resolver,
- const grpc_http_response* response, grpc_error* error) override;
+ const grpc_http_response* response,
+ grpc_error_handle error) override;
};
void ZoneQueryDone(TString zone);
@@ -123,12 +127,10 @@ GoogleCloud2ProdResolver::MetadataQuery::MetadataQuery(
request.http.path = const_cast<char*>(path);
request.http.hdr_count = 1;
request.http.hdrs = &header;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("c2p_resolver");
- grpc_httpcli_get(&context_, pollent, resource_quota, &request,
+ // TODO(ctiller): share the quota from whomever instantiates this!
+ grpc_httpcli_get(&context_, pollent, ResourceQuota::Default(), &request,
ExecCtx::Get()->Now() + 10000, // 10s timeout
&on_done_, &response_);
- grpc_resource_quota_unref_internal(resource_quota);
}
GoogleCloud2ProdResolver::MetadataQuery::~MetadataQuery() {
@@ -143,16 +145,17 @@ void GoogleCloud2ProdResolver::MetadataQuery::Orphan() {
}
void GoogleCloud2ProdResolver::MetadataQuery::OnHttpRequestDone(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
auto* self = static_cast<MetadataQuery*>(arg);
self->MaybeCallOnDone(GRPC_ERROR_REF(error));
}
void GoogleCloud2ProdResolver::MetadataQuery::MaybeCallOnDone(
- grpc_error* error) {
+ grpc_error_handle error) {
bool expected = false;
- if (!on_done_called_.CompareExchangeStrong(
- &expected, true, MemoryOrder::RELAXED, MemoryOrder::RELAXED)) {
+ if (!on_done_called_.compare_exchange_strong(expected, true,
+ std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
// We've already called OnDone(), so just clean up.
GRPC_ERROR_UNREF(error);
Unref();
@@ -180,10 +183,10 @@ GoogleCloud2ProdResolver::ZoneQuery::ZoneQuery(
void GoogleCloud2ProdResolver::ZoneQuery::OnDone(
GoogleCloud2ProdResolver* resolver, const grpc_http_response* response,
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error fetching zone from metadata server: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
TString zone;
if (error == GRPC_ERROR_NONE && response->status == 200) {
@@ -193,7 +196,7 @@ void GoogleCloud2ProdResolver::ZoneQuery::OnDone(
gpr_log(GPR_ERROR, "could not parse zone from metadata server: %s",
TString(body).c_str());
} else {
- zone = TString(body.substr(i));
+ zone = TString(body.substr(i + 1));
}
}
resolver->ZoneQueryDone(std::move(zone));
@@ -213,10 +216,10 @@ GoogleCloud2ProdResolver::IPv6Query::IPv6Query(
void GoogleCloud2ProdResolver::IPv6Query::OnDone(
GoogleCloud2ProdResolver* resolver, const grpc_http_response* response,
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "error fetching IPv6 address from metadata server: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
resolver->IPv6QueryDone(error == GRPC_ERROR_NONE && response->status == 200);
GRPC_ERROR_UNREF(error);
@@ -295,8 +298,11 @@ void GoogleCloud2ProdResolver::IPv6QueryDone(bool ipv6_supported) {
void GoogleCloud2ProdResolver::StartXdsResolver() {
// Construct bootstrap JSON.
+ std::random_device rd;
+ std::mt19937 mt(rd());
+ std::uniform_int_distribution<uint64_t> dist(1, UINT64_MAX);
Json::Object node = {
- {"id", "C2P"},
+ {"id", y_absl::StrCat("C2P-", dist(mt))},
};
if (!zone_->empty()) {
node["locality"] = Json::Object{
@@ -314,7 +320,7 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
const char* server_uri =
override_server != nullptr && strlen(override_server.get()) > 0
? override_server.get()
- : "directpath-trafficdirector.googleapis.com";
+ : "directpath-pa.googleapis.com";
Json bootstrap = Json::Object{
{"xds_servers",
Json::Array{
@@ -356,20 +362,15 @@ class GoogleCloud2ProdResolverFactory : public ResolverFactory {
return MakeOrphanable<GoogleCloud2ProdResolver>(std::move(args));
}
- const char* scheme() const override { return "google-c2p"; }
+ // TODO(roth): Remove experimental suffix once this code is proven stable.
+ const char* scheme() const override { return "google-c2p-experimental"; }
};
} // namespace
void GoogleCloud2ProdResolverInit() {
- // TODO(roth): Remove env var protection once this code is proven stable.
- UniquePtr<char> value(gpr_getenv("GRPC_EXPERIMENTAL_GOOGLE_C2P_RESOLVER"));
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value.get(), &parsed_value);
- if (parse_succeeded && parsed_value) {
- ResolverRegistry::Builder::RegisterResolverFactory(
- y_absl::make_unique<GoogleCloud2ProdResolverFactory>());
- }
+ ResolverRegistry::Builder::RegisterResolverFactory(
+ y_absl::make_unique<GoogleCloud2ProdResolverFactory>());
}
void GoogleCloud2ProdResolverShutdown() {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
index 461cd6d8cdf..ddaf4cedf11 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc
@@ -30,9 +30,9 @@
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/slice/slice_internal.h"
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
index 800bd68537d..fde42114a38 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
@@ -28,12 +28,13 @@
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
+#include "src/core/ext/xds/xds_channel_args.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/ext/xds/xds_routing.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/transport/timeout_encoding.h"
namespace grpc_core {
@@ -73,35 +74,44 @@ class XdsResolver : public Resolver {
void ShutdownLocked() override;
- private:
- class Notifier {
- public:
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::LdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, XdsApi::RdsUpdate update);
- Notifier(RefCountedPtr<XdsResolver> resolver, grpc_error* error);
- explicit Notifier(RefCountedPtr<XdsResolver> resolver);
-
- private:
- enum Type { kLdsUpdate, kRdsUpdate, kError, kDoesNotExist };
-
- static void RunInExecCtx(void* arg, grpc_error* error);
- void RunInWorkSerializer(grpc_error* error);
-
- RefCountedPtr<XdsResolver> resolver_;
- grpc_closure closure_;
- XdsApi::LdsUpdate update_;
- Type type_;
- };
+ void ResetBackoffLocked() override {
+ if (xds_client_ != nullptr) xds_client_->ResetBackoff();
+ }
+ private:
class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
public:
explicit ListenerWatcher(RefCountedPtr<XdsResolver> resolver)
: resolver_(std::move(resolver)) {}
void OnListenerChanged(XdsApi::LdsUpdate listener) override {
- new Notifier(resolver_, std::move(listener));
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ // TODO(yashykt): When we move to C++14, capture listener with
+ // std::move
+ [this, listener]() mutable {
+ resolver_->OnListenerUpdate(std::move(listener));
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnError(grpc_error_handle error) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this, error]() {
+ resolver_->OnError(error);
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this]() {
+ resolver_->OnResourceDoesNotExist();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
private:
RefCountedPtr<XdsResolver> resolver_;
@@ -112,35 +122,105 @@ class XdsResolver : public Resolver {
explicit RouteConfigWatcher(RefCountedPtr<XdsResolver> resolver)
: resolver_(std::move(resolver)) {}
void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) override {
- new Notifier(resolver_, std::move(route_config));
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ // TODO(yashykt): When we move to C++14, capture route_config with
+ // std::move
+ [this, route_config]() mutable {
+ resolver_->OnRouteConfigUpdate(std::move(route_config));
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnError(grpc_error_handle error) override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this, error]() {
+ resolver_->OnError(error);
+ Unref();
+ },
+ DEBUG_LOCATION);
+ }
+ void OnResourceDoesNotExist() override {
+ Ref().release(); // ref held by lambda
+ resolver_->work_serializer_->Run(
+ [this]() {
+ resolver_->OnResourceDoesNotExist();
+ Unref();
+ },
+ DEBUG_LOCATION);
}
- void OnError(grpc_error* error) override { new Notifier(resolver_, error); }
- void OnResourceDoesNotExist() override { new Notifier(resolver_); }
private:
RefCountedPtr<XdsResolver> resolver_;
};
- class ClusterState
- : public RefCounted<ClusterState, PolymorphicRefCount, false> {
+ // An entry in the map of clusters that need to be present in the LB
+ // policy config. The map holds a weak ref. One strong ref is held by
+ // the ConfigSelector, and another is held by each call assigned to
+ // the cluster by the ConfigSelector. The ref for each call is held
+ // until the call is committed. When the strong refs go away, we hop
+ // back into the WorkSerializer to remove the entry from the map.
+ class ClusterState : public DualRefCounted<ClusterState> {
public:
using ClusterStateMap =
- std::map<TString, std::unique_ptr<ClusterState>>;
+ std::map<TString, WeakRefCountedPtr<ClusterState>>;
- ClusterState(const TString& cluster_name,
- ClusterStateMap* cluster_state_map)
- : it_(cluster_state_map
- ->emplace(cluster_name, std::unique_ptr<ClusterState>(this))
+ ClusterState(RefCountedPtr<XdsResolver> resolver,
+ const TString& cluster_name)
+ : resolver_(std::move(resolver)),
+ it_(resolver_->cluster_state_map_.emplace(cluster_name, WeakRef())
.first) {}
+
+ void Orphan() override {
+ auto* resolver = resolver_.release();
+ resolver->work_serializer_->Run(
+ [resolver]() {
+ resolver->MaybeRemoveUnusedClusters();
+ resolver->Unref();
+ },
+ DEBUG_LOCATION);
+ }
+
const TString& cluster() const { return it_->first; }
private:
+ RefCountedPtr<XdsResolver> resolver_;
ClusterStateMap::iterator it_;
};
+ // Call dispatch controller, created for each call handled by the
+ // ConfigSelector. Holds a ref to the ClusterState object until the
+ // call is committed.
+ class XdsCallDispatchController
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit XdsCallDispatchController(
+ RefCountedPtr<ClusterState> cluster_state)
+ : cluster_state_(std::move(cluster_state)) {}
+
+ bool ShouldRetry() override {
+ // TODO(donnadionne): Implement the retry circuit breaker here.
+ return true;
+ }
+
+ void Commit() override {
+ // TODO(donnadionne): If ShouldRetry() was called previously,
+ // decrement the retry circuit breaker counter.
+ cluster_state_.reset();
+ }
+
+ private:
+ // Note: The XdsCallDispatchController object is never actually destroyed,
+ // so do not add any data members that require destruction unless you have
+ // some other way to clean them up.
+ RefCountedPtr<ClusterState> cluster_state_;
+ };
+
class XdsConfigSelector : public ConfigSelector {
public:
- XdsConfigSelector(RefCountedPtr<XdsResolver> resolver, grpc_error** error);
+ XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
+ grpc_error_handle* error);
~XdsConfigSelector() override;
const char* name() const override { return "XdsConfigSelector"; }
@@ -178,25 +258,27 @@ class XdsResolver : public Resolver {
};
using RouteTable = std::vector<Route>;
+ class RouteListIterator;
+
void MaybeAddCluster(const TString& name);
- grpc_error* CreateMethodConfig(
+ grpc_error_handle CreateMethodConfig(
const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight,
+ const XdsApi::Route::RouteAction::ClusterWeight* cluster_weight,
RefCountedPtr<ServiceConfig>* method_config);
RefCountedPtr<XdsResolver> resolver_;
RouteTable route_table_;
std::map<y_absl::string_view, RefCountedPtr<ClusterState>> clusters_;
std::vector<const grpc_channel_filter*> filters_;
- grpc_error* filter_error_ = GRPC_ERROR_NONE;
};
void OnListenerUpdate(XdsApi::LdsUpdate listener);
void OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update);
- void OnError(grpc_error* error);
+ void OnError(grpc_error_handle error);
void OnResourceDoesNotExist();
- grpc_error* CreateServiceConfig(RefCountedPtr<ServiceConfig>* service_config);
+ grpc_error_handle CreateServiceConfig(
+ RefCountedPtr<ServiceConfig>* service_config);
void GenerateResult();
void MaybeRemoveUnusedClusters();
@@ -222,71 +304,6 @@ class XdsResolver : public Resolver {
};
//
-// XdsResolver::Notifier
-//
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- XdsApi::LdsUpdate update)
- : resolver_(std::move(resolver)),
- update_(std::move(update)),
- type_(kLdsUpdate) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- XdsApi::RdsUpdate update)
- : resolver_(std::move(resolver)), type_(kRdsUpdate) {
- update_.http_connection_manager.rds_update = std::move(update);
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver,
- grpc_error* error)
- : resolver_(std::move(resolver)), type_(kError) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, error);
-}
-
-XdsResolver::Notifier::Notifier(RefCountedPtr<XdsResolver> resolver)
- : resolver_(std::move(resolver)), type_(kDoesNotExist) {
- GRPC_CLOSURE_INIT(&closure_, &RunInExecCtx, this, nullptr);
- ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
-}
-
-void XdsResolver::Notifier::RunInExecCtx(void* arg, grpc_error* error) {
- Notifier* self = static_cast<Notifier*>(arg);
- GRPC_ERROR_REF(error);
- self->resolver_->work_serializer_->Run(
- [self, error]() { self->RunInWorkSerializer(error); }, DEBUG_LOCATION);
-}
-
-void XdsResolver::Notifier::RunInWorkSerializer(grpc_error* error) {
- if (resolver_->xds_client_ == nullptr) {
- GRPC_ERROR_UNREF(error);
- delete this;
- return;
- }
- switch (type_) {
- case kLdsUpdate:
- resolver_->OnListenerUpdate(std::move(update_));
- break;
- case kRdsUpdate:
- resolver_->OnRouteConfigUpdate(
- std::move(*update_.http_connection_manager.rds_update));
- break;
- case kError:
- resolver_->OnError(error);
- break;
- case kDoesNotExist:
- resolver_->OnResourceDoesNotExist();
- break;
- };
- delete this;
-}
-
-//
// XdsResolver::XdsConfigSelector::Route
//
@@ -309,12 +326,31 @@ bool XdsResolver::XdsConfigSelector::Route::operator==(
MethodConfigsEqual(method_config.get(), other.method_config.get());
}
+// Implementation of XdsRouting::RouteListIterator for getting the matching
+// route for a request.
+class XdsResolver::XdsConfigSelector::RouteListIterator
+ : public XdsRouting::RouteListIterator {
+ public:
+ explicit RouteListIterator(const RouteTable* route_table)
+ : route_table_(route_table) {}
+
+ size_t Size() const override { return route_table_->size(); }
+
+ const XdsApi::Route::Matchers& GetMatchersForRoute(
+ size_t index) const override {
+ return (*route_table_)[index].route.matchers;
+ }
+
+ private:
+ const RouteTable* route_table_;
+};
+
//
// XdsResolver::XdsConfigSelector
//
XdsResolver::XdsConfigSelector::XdsConfigSelector(
- RefCountedPtr<XdsResolver> resolver, grpc_error** error)
+ RefCountedPtr<XdsResolver> resolver, grpc_error_handle* error)
: resolver_(std::move(resolver)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p",
@@ -338,44 +374,40 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
route_table_.emplace_back();
auto& route_entry = route_table_.back();
route_entry.route = route;
- // If the route doesn't specify a timeout, set its timeout to the global
- // one.
- if (!route.max_stream_duration.has_value()) {
- route_entry.route.max_stream_duration =
- resolver_->current_listener_.http_connection_manager
- .http_max_stream_duration;
- }
- if (route.weighted_clusters.empty()) {
- *error = CreateMethodConfig(route_entry.route, nullptr,
- &route_entry.method_config);
- MaybeAddCluster(route.cluster_name);
- } else {
- uint32_t end = 0;
- for (const auto& weighted_cluster : route_entry.route.weighted_clusters) {
- Route::ClusterWeightState cluster_weight_state;
- *error = CreateMethodConfig(route_entry.route, &weighted_cluster,
- &cluster_weight_state.method_config);
- if (*error != GRPC_ERROR_NONE) return;
- end += weighted_cluster.weight;
- cluster_weight_state.range_end = end;
- cluster_weight_state.cluster = weighted_cluster.name;
- route_entry.weighted_cluster_state.push_back(
- std::move(cluster_weight_state));
- MaybeAddCluster(weighted_cluster.name);
+ auto* route_action =
+ y_absl::get_if<XdsApi::Route::RouteAction>(&route_entry.route.action);
+ if (route_action != nullptr) {
+ // If the route doesn't specify a timeout, set its timeout to the global
+ // one.
+ if (!route_action->max_stream_duration.has_value()) {
+ route_action->max_stream_duration =
+ resolver_->current_listener_.http_connection_manager
+ .http_max_stream_duration;
+ }
+ if (route_action->weighted_clusters.empty()) {
+ *error = CreateMethodConfig(route_entry.route, nullptr,
+ &route_entry.method_config);
+ MaybeAddCluster(route_action->cluster_name);
+ } else {
+ uint32_t end = 0;
+ for (const auto& weighted_cluster : route_action->weighted_clusters) {
+ Route::ClusterWeightState cluster_weight_state;
+ *error = CreateMethodConfig(route_entry.route, &weighted_cluster,
+ &cluster_weight_state.method_config);
+ if (*error != GRPC_ERROR_NONE) return;
+ end += weighted_cluster.weight;
+ cluster_weight_state.range_end = end;
+ cluster_weight_state.cluster = weighted_cluster.name;
+ route_entry.weighted_cluster_state.push_back(
+ std::move(cluster_weight_state));
+ MaybeAddCluster(weighted_cluster.name);
+ }
}
}
}
// Populate filter list.
- bool found_router = false;
for (const auto& http_filter :
resolver_->current_listener_.http_connection_manager.http_filters) {
- // Stop at the router filter. It's a no-op for us, and we ignore
- // anything that may come after it, for compatibility with Envoy.
- if (http_filter.config.config_proto_type_name ==
- kXdsHttpRouterFilterConfigName) {
- found_router = true;
- break;
- }
// Find filter. This is guaranteed to succeed, because it's checked
// at config validation time in the XdsApi code.
const XdsHttpFilterImpl* filter_impl =
@@ -383,16 +415,9 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
http_filter.config.config_proto_type_name);
GPR_ASSERT(filter_impl != nullptr);
// Add C-core filter to list.
- filters_.push_back(filter_impl->channel_filter());
- }
- // For compatibility with Envoy, if the router filter is not
- // configured, we fail all RPCs.
- if (!found_router) {
- filter_error_ =
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "no xDS HTTP router filter configured"),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
- filters_.push_back(&grpc_lame_filter);
+ if (filter_impl->channel_filter() != nullptr) {
+ filters_.push_back(filter_impl->channel_filter());
+ }
}
}
@@ -403,86 +428,79 @@ XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
}
clusters_.clear();
resolver_->MaybeRemoveUnusedClusters();
- GRPC_ERROR_UNREF(filter_error_);
}
-const XdsHttpFilterImpl::FilterConfig* FindFilterConfigOverride(
- const TString& instance_name,
- const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight) {
- // Check ClusterWeight, if any.
- if (cluster_weight != nullptr) {
- auto it = cluster_weight->typed_per_filter_config.find(instance_name);
- if (it != cluster_weight->typed_per_filter_config.end()) return &it->second;
- }
- // Check Route.
- auto it = route.typed_per_filter_config.find(instance_name);
- if (it != route.typed_per_filter_config.end()) return &it->second;
- // Check VirtualHost.
- it = vhost.typed_per_filter_config.find(instance_name);
- if (it != vhost.typed_per_filter_config.end()) return &it->second;
- // Not found.
- return nullptr;
-}
-
-grpc_error* XdsResolver::XdsConfigSelector::CreateMethodConfig(
+grpc_error_handle XdsResolver::XdsConfigSelector::CreateMethodConfig(
const XdsApi::Route& route,
- const XdsApi::Route::ClusterWeight* cluster_weight,
+ const XdsApi::Route::RouteAction::ClusterWeight* cluster_weight,
RefCountedPtr<ServiceConfig>* method_config) {
std::vector<TString> fields;
+ const auto& route_action =
+ y_absl::get<XdsApi::Route::RouteAction>(route.action);
+ // Set retry policy if any.
+ if (route_action.retry_policy.has_value() &&
+ !route_action.retry_policy->retry_on.Empty()) {
+ std::vector<TString> retry_parts;
+ retry_parts.push_back(y_absl::StrFormat(
+ "\"retryPolicy\": {\n"
+ " \"maxAttempts\": %d,\n"
+ " \"initialBackoff\": \"%d.%09ds\",\n"
+ " \"maxBackoff\": \"%d.%09ds\",\n"
+ " \"backoffMultiplier\": 2,\n",
+ route_action.retry_policy->num_retries + 1,
+ route_action.retry_policy->retry_back_off.base_interval.seconds,
+ route_action.retry_policy->retry_back_off.base_interval.nanos,
+ route_action.retry_policy->retry_back_off.max_interval.seconds,
+ route_action.retry_policy->retry_back_off.max_interval.nanos));
+ std::vector<TString> code_parts;
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_CANCELLED)) {
+ code_parts.push_back(" \"CANCELLED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(
+ GRPC_STATUS_DEADLINE_EXCEEDED)) {
+ code_parts.push_back(" \"DEADLINE_EXCEEDED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_INTERNAL)) {
+ code_parts.push_back(" \"INTERNAL\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(
+ GRPC_STATUS_RESOURCE_EXHAUSTED)) {
+ code_parts.push_back(" \"RESOURCE_EXHAUSTED\"");
+ }
+ if (route_action.retry_policy->retry_on.Contains(GRPC_STATUS_UNAVAILABLE)) {
+ code_parts.push_back(" \"UNAVAILABLE\"");
+ }
+ retry_parts.push_back(
+ y_absl::StrFormat(" \"retryableStatusCodes\": [\n %s ]\n",
+ y_absl::StrJoin(code_parts, ",\n")));
+ retry_parts.push_back(y_absl::StrFormat(" }"));
+ fields.emplace_back(y_absl::StrJoin(retry_parts, ""));
+ }
// Set timeout.
- if (route.max_stream_duration.has_value() &&
- (route.max_stream_duration->seconds != 0 ||
- route.max_stream_duration->nanos != 0)) {
- fields.emplace_back(y_absl::StrFormat(" \"timeout\": \"%d.%09ds\"",
- route.max_stream_duration->seconds,
- route.max_stream_duration->nanos));
+ if (route_action.max_stream_duration.has_value() &&
+ (route_action.max_stream_duration->seconds != 0 ||
+ route_action.max_stream_duration->nanos != 0)) {
+ fields.emplace_back(
+ y_absl::StrFormat(" \"timeout\": \"%d.%09ds\"",
+ route_action.max_stream_duration->seconds,
+ route_action.max_stream_duration->nanos));
}
// Handle xDS HTTP filters.
- std::map<TString, std::vector<TString>> per_filter_configs;
- grpc_channel_args* args = grpc_channel_args_copy(resolver_->args_);
- for (const auto& http_filter :
- resolver_->current_listener_.http_connection_manager.http_filters) {
- // Stop at the router filter. It's a no-op for us, and we ignore
- // anything that may come after it, for compatibility with Envoy.
- if (http_filter.config.config_proto_type_name ==
- kXdsHttpRouterFilterConfigName) {
- break;
- }
- // Find filter. This is guaranteed to succeed, because it's checked
- // at config validation time in the XdsApi code.
- const XdsHttpFilterImpl* filter_impl =
- XdsHttpFilterRegistry::GetFilterForType(
- http_filter.config.config_proto_type_name);
- GPR_ASSERT(filter_impl != nullptr);
- // Allow filter to add channel args that may affect service config
- // parsing.
- args = filter_impl->ModifyChannelArgs(args);
- // Find config override, if any.
- const XdsHttpFilterImpl::FilterConfig* config_override =
- FindFilterConfigOverride(http_filter.name,
- resolver_->current_virtual_host_, route,
- cluster_weight);
- // Generate service config for filter.
- auto method_config_field =
- filter_impl->GenerateServiceConfig(http_filter.config, config_override);
- if (!method_config_field.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("failed to generate method config for HTTP filter ",
- http_filter.name, ": ",
- method_config_field.status().ToString())
- .c_str());
- }
- per_filter_configs[method_config_field->service_config_field_name]
- .push_back(method_config_field->element);
- }
- for (const auto& p : per_filter_configs) {
+ XdsRouting::GeneratePerHttpFilterConfigsResult result =
+ XdsRouting::GeneratePerHTTPFilterConfigs(
+ resolver_->current_listener_.http_connection_manager.http_filters,
+ resolver_->current_virtual_host_, route, cluster_weight,
+ grpc_channel_args_copy(resolver_->args_));
+ if (result.error != GRPC_ERROR_NONE) {
+ return result.error;
+ }
+ for (const auto& p : result.per_filter_configs) {
fields.emplace_back(y_absl::StrCat(" \"", p.first, "\": [\n",
y_absl::StrJoin(p.second, ",\n"),
"\n ]"));
}
// Construct service config.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (!fields.empty()) {
TString json = y_absl::StrCat(
"{\n"
@@ -494,28 +512,22 @@ grpc_error* XdsResolver::XdsConfigSelector::CreateMethodConfig(
y_absl::StrJoin(fields, ",\n"),
"\n } ]\n"
"}");
- *method_config = ServiceConfig::Create(args, json.c_str(), &error);
+ *method_config = ServiceConfig::Create(result.args, json.c_str(), &error);
}
- grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(result.args);
return error;
}
grpc_channel_args* XdsResolver::XdsConfigSelector::ModifyChannelArgs(
grpc_channel_args* args) {
- if (filter_error_ == GRPC_ERROR_NONE) return args;
- grpc_arg error_arg = MakeLameClientErrorArg(filter_error_);
- grpc_channel_args* new_args =
- grpc_channel_args_copy_and_add(args, &error_arg, 1);
- grpc_channel_args_destroy(args);
- return new_args;
+ return args;
}
void XdsResolver::XdsConfigSelector::MaybeAddCluster(const TString& name) {
if (clusters_.find(name) == clusters_.end()) {
auto it = resolver_->cluster_state_map_.find(name);
if (it == resolver_->cluster_state_map_.end()) {
- auto new_cluster_state =
- MakeRefCounted<ClusterState>(name, &resolver_->cluster_state_map_);
+ auto new_cluster_state = MakeRefCounted<ClusterState>(resolver_, name);
clusters_[new_cluster_state->cluster()] = std::move(new_cluster_state);
} else {
clusters_[it->second->cluster()] = it->second->Ref();
@@ -523,40 +535,16 @@ void XdsResolver::XdsConfigSelector::MaybeAddCluster(const TString& name) {
}
}
-y_absl::optional<y_absl::string_view> GetHeaderValue(
- grpc_metadata_batch* initial_metadata, y_absl::string_view header_name,
- TString* concatenated_value) {
- // Note: If we ever allow binary headers here, we still need to
- // special-case ignore "grpc-tags-bin" and "grpc-trace-bin", since
- // they are not visible to the LB policy in grpc-go.
- if (y_absl::EndsWith(header_name, "-bin")) {
- return y_absl::nullopt;
- } else if (header_name == "content-type") {
- return "application/grpc";
- }
- return grpc_metadata_batch_get_value(initial_metadata, header_name,
- concatenated_value);
-}
-
-bool HeadersMatch(const std::vector<HeaderMatcher>& header_matchers,
- grpc_metadata_batch* initial_metadata) {
- for (const auto& header_matcher : header_matchers) {
- TString concatenated_value;
- if (!header_matcher.Match(GetHeaderValue(
- initial_metadata, header_matcher.name(), &concatenated_value))) {
- return false;
- }
- }
- return true;
-}
-
y_absl::optional<uint64_t> HeaderHashHelper(
- const XdsApi::Route::HashPolicy& policy,
+ const XdsApi::Route::RouteAction::HashPolicy& policy,
grpc_metadata_batch* initial_metadata) {
- GPR_ASSERT(policy.type == XdsApi::Route::HashPolicy::HEADER);
+ GPR_ASSERT(policy.type == XdsApi::Route::RouteAction::HashPolicy::HEADER);
TString value_buffer;
- y_absl::optional<y_absl::string_view> header_value =
- GetHeaderValue(initial_metadata, policy.header_name, &value_buffer);
+ y_absl::optional<y_absl::string_view> header_value = XdsRouting::GetHeaderValue(
+ initial_metadata, policy.header_name, &value_buffer);
+ if (!header_value.has_value()) {
+ return y_absl::nullopt;
+ }
if (policy.regex != nullptr) {
// If GetHeaderValue() did not already store the value in
// value_buffer, copy it there now, so we can modify it.
@@ -569,136 +557,112 @@ y_absl::optional<uint64_t> HeaderHashHelper(
return XXH64(header_value->data(), header_value->size(), 0);
}
-bool UnderFraction(const uint32_t fraction_per_million) {
- // Generate a random number in [0, 1000000).
- const uint32_t random_number = rand() % 1000000;
- return random_number < fraction_per_million;
-}
-
ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
GetCallConfigArgs args) {
- for (const auto& entry : route_table_) {
- // Path matching.
- if (!entry.route.matchers.path_matcher.Match(
- StringViewFromSlice(*args.path))) {
- continue;
- }
- // Header Matching.
- if (!HeadersMatch(entry.route.matchers.header_matchers,
- args.initial_metadata)) {
- continue;
- }
- // Match fraction check
- if (entry.route.matchers.fraction_per_million.has_value() &&
- !UnderFraction(entry.route.matchers.fraction_per_million.value())) {
- continue;
- }
- // Found a route match
- y_absl::string_view cluster_name;
- RefCountedPtr<ServiceConfig> method_config;
- if (entry.route.weighted_clusters.empty()) {
- cluster_name = entry.route.cluster_name;
- method_config = entry.method_config;
- } else {
- const uint32_t key =
- rand() %
- entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
- .range_end;
- // Find the index in weighted clusters corresponding to key.
- size_t mid = 0;
- size_t start_index = 0;
- size_t end_index = entry.weighted_cluster_state.size() - 1;
- size_t index = 0;
- while (end_index > start_index) {
- mid = (start_index + end_index) / 2;
- if (entry.weighted_cluster_state[mid].range_end > key) {
- end_index = mid;
- } else if (entry.weighted_cluster_state[mid].range_end < key) {
- start_index = mid + 1;
- } else {
- index = mid + 1;
- break;
- }
- }
- if (index == 0) index = start_index;
- GPR_ASSERT(entry.weighted_cluster_state[index].range_end > key);
- cluster_name = entry.weighted_cluster_state[index].cluster;
- method_config = entry.weighted_cluster_state[index].method_config;
- }
- auto it = clusters_.find(cluster_name);
- GPR_ASSERT(it != clusters_.end());
- XdsResolver* resolver =
- static_cast<XdsResolver*>(resolver_->Ref().release());
- ClusterState* cluster_state = it->second->Ref().release();
- // Generate a hash
- y_absl::optional<uint64_t> hash;
- for (const auto& hash_policy : entry.route.hash_policies) {
- y_absl::optional<uint64_t> new_hash;
- switch (hash_policy.type) {
- case XdsApi::Route::HashPolicy::HEADER:
- new_hash = HeaderHashHelper(hash_policy, args.initial_metadata);
- break;
- case XdsApi::Route::HashPolicy::CHANNEL_ID:
- new_hash =
- static_cast<uint64_t>(reinterpret_cast<uintptr_t>(resolver));
- break;
- default:
- GPR_ASSERT(0);
- }
- if (new_hash.has_value()) {
- // Rotating the old value prevents duplicate hash rules from cancelling
- // each other out and preserves all of the entropy
- const uint64_t old_value =
- hash.has_value() ? ((hash.value() << 1) | (hash.value() >> 63)) : 0;
- hash = old_value ^ new_hash.value();
- }
- // If the policy is a terminal policy and a hash has been generated,
- // ignore the rest of the hash policies.
- if (hash_policy.terminal && hash.has_value()) {
+ auto route_index = XdsRouting::GetRouteForRequest(
+ RouteListIterator(&route_table_), StringViewFromSlice(*args.path),
+ args.initial_metadata);
+ if (!route_index.has_value()) {
+ return CallConfig();
+ }
+ auto& entry = route_table_[*route_index];
+ // Found a route match
+ const auto* route_action =
+ y_absl::get_if<XdsApi::Route::RouteAction>(&entry.route.action);
+ if (route_action == nullptr) {
+ CallConfig call_config;
+ call_config.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Matching route has inappropriate action"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+ }
+ y_absl::string_view cluster_name;
+ RefCountedPtr<ServiceConfig> method_config;
+ if (route_action->weighted_clusters.empty()) {
+ cluster_name = route_action->cluster_name;
+ method_config = entry.method_config;
+ } else {
+ const uint32_t key =
+ rand() %
+ entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
+ .range_end;
+ // Find the index in weighted clusters corresponding to key.
+ size_t mid = 0;
+ size_t start_index = 0;
+ size_t end_index = entry.weighted_cluster_state.size() - 1;
+ size_t index = 0;
+ while (end_index > start_index) {
+ mid = (start_index + end_index) / 2;
+ if (entry.weighted_cluster_state[mid].range_end > key) {
+ end_index = mid;
+ } else if (entry.weighted_cluster_state[mid].range_end < key) {
+ start_index = mid + 1;
+ } else {
+ index = mid + 1;
break;
}
}
- if (!hash.has_value()) {
- // If there is no hash, we just choose a random value as a default.
- hash = rand();
+ if (index == 0) index = start_index;
+ GPR_ASSERT(entry.weighted_cluster_state[index].range_end > key);
+ cluster_name = entry.weighted_cluster_state[index].cluster;
+ method_config = entry.weighted_cluster_state[index].method_config;
+ }
+ auto it = clusters_.find(cluster_name);
+ GPR_ASSERT(it != clusters_.end());
+ // Generate a hash.
+ y_absl::optional<uint64_t> hash;
+ for (const auto& hash_policy : route_action->hash_policies) {
+ y_absl::optional<uint64_t> new_hash;
+ switch (hash_policy.type) {
+ case XdsApi::Route::RouteAction::HashPolicy::HEADER:
+ new_hash = HeaderHashHelper(hash_policy, args.initial_metadata);
+ break;
+ case XdsApi::Route::RouteAction::HashPolicy::CHANNEL_ID:
+ new_hash =
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(resolver_.get()));
+ break;
+ default:
+ GPR_ASSERT(0);
+ }
+ if (new_hash.has_value()) {
+ // Rotating the old value prevents duplicate hash rules from cancelling
+ // each other out and preserves all of the entropy
+ const uint64_t old_value =
+ hash.has_value() ? ((hash.value() << 1) | (hash.value() >> 63)) : 0;
+ hash = old_value ^ new_hash.value();
+ }
+ // If the policy is a terminal policy and a hash has been generated,
+ // ignore the rest of the hash policies.
+ if (hash_policy.terminal && hash.has_value()) {
+ break;
}
- CallConfig call_config;
- if (method_config != nullptr) {
- call_config.method_configs =
- method_config->GetMethodParsedConfigVector(grpc_empty_slice());
- call_config.service_config = std::move(method_config);
- }
- call_config.call_attributes[kXdsClusterAttribute] = it->first;
- call_config.call_attributes[kRequestRingHashAttribute] =
- y_absl::StrFormat("%" PRIu64, hash.value());
- call_config.on_call_committed = [resolver, cluster_state]() {
- cluster_state->Unref();
- ExecCtx::Run(
- // TODO(roth): This hop into the ExecCtx is being done to avoid
- // entering the WorkSerializer while holding the client channel data
- // plane mutex, since that can lead to deadlocks. However, we should
- // not have to solve this problem in each individual ConfigSelector
- // implementation. When we have time, we should fix the client channel
- // code to avoid this by not invoking the
- // CallConfig::on_call_committed callback until after it has released
- // the data plane mutex.
- DEBUG_LOCATION,
- GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* /*error*/) {
- auto* resolver = static_cast<XdsResolver*>(arg);
- resolver->work_serializer_->Run(
- [resolver]() {
- resolver->MaybeRemoveUnusedClusters();
- resolver->Unref();
- },
- DEBUG_LOCATION);
- },
- resolver, nullptr),
- GRPC_ERROR_NONE);
- };
- return call_config;
}
- return CallConfig();
+ if (!hash.has_value()) {
+ // If there is no hash, we just choose a random value as a default.
+ // We cannot directly use the result of rand() as the hash value,
+ // since it is a 32-bit number and not a 64-bit number and will
+ // therefore not be evenly distributed.
+ uint32_t upper = rand();
+ uint32_t lower = rand();
+ hash = (static_cast<uint64_t>(upper) << 32) | lower;
+ }
+ CallConfig call_config;
+ if (method_config != nullptr) {
+ call_config.method_configs =
+ method_config->GetMethodParsedConfigVector(grpc_empty_slice());
+ call_config.service_config = std::move(method_config);
+ }
+ call_config.call_attributes[kXdsClusterAttribute] = it->first;
+ TString hash_string = y_absl::StrCat(hash.value());
+ char* hash_value =
+ static_cast<char*>(args.arena->Alloc(hash_string.size() + 1));
+ memcpy(hash_value, hash_string.c_str(), hash_string.size());
+ hash_value[hash_string.size()] = '\0';
+ call_config.call_attributes[kRequestRingHashAttribute] = hash_value;
+ call_config.call_dispatch_controller =
+ args.arena->New<XdsCallDispatchController>(it->second->Ref());
+ return call_config;
}
//
@@ -706,25 +670,19 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
//
void XdsResolver::StartLocked() {
- grpc_error* error = GRPC_ERROR_NONE;
- xds_client_ = XdsClient::GetOrCreate(&error);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ xds_client_ = XdsClient::GetOrCreate(args_, &error);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"Failed to create xds client -- channel will remain in "
"TRANSIENT_FAILURE: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
result_handler_->ReturnError(error);
return;
}
grpc_pollset_set_add_pollset_set(xds_client_->interested_parties(),
interested_parties_);
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->AddChannelzLinkage(parent_channelz_node);
- }
- auto watcher = y_absl::make_unique<ListenerWatcher>(Ref());
+ auto watcher = MakeRefCounted<ListenerWatcher>(Ref());
listener_watcher_ = watcher.get();
xds_client_->WatchListenerData(server_name_, std::move(watcher));
}
@@ -742,12 +700,6 @@ void XdsResolver::ShutdownLocked() {
xds_client_->CancelRouteConfigDataWatch(
server_name_, route_config_watcher_, /*delay_unsubscription=*/false);
}
- channelz::ChannelNode* parent_channelz_node =
- grpc_channel_args_find_pointer<channelz::ChannelNode>(
- args_, GRPC_ARG_CHANNELZ_CHANNEL_NODE);
- if (parent_channelz_node != nullptr) {
- xds_client_->RemoveChannelzLinkage(parent_channelz_node);
- }
grpc_pollset_set_del_pollset_set(xds_client_->interested_parties(),
interested_parties_);
xds_client_.reset();
@@ -758,6 +710,9 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] received updated listener data", this);
}
+ if (xds_client_ == nullptr) {
+ return;
+ }
if (listener.http_connection_manager.route_config_name !=
route_config_name_) {
if (route_config_watcher_ != nullptr) {
@@ -771,7 +726,7 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
std::move(listener.http_connection_manager.route_config_name);
if (!route_config_name_.empty()) {
current_virtual_host_.routes.clear();
- auto watcher = y_absl::make_unique<RouteConfigWatcher>(Ref());
+ auto watcher = MakeRefCounted<RouteConfigWatcher>(Ref());
route_config_watcher_ = watcher.get();
xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
}
@@ -789,31 +744,57 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
}
}
+namespace {
+class VirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
+ public:
+ explicit VirtualHostListIterator(
+ const std::vector<XdsApi::RdsUpdate::VirtualHost>* virtual_hosts)
+ : virtual_hosts_(virtual_hosts) {}
+
+ size_t Size() const override { return virtual_hosts_->size(); }
+
+ const std::vector<TString>& GetDomainsForVirtualHost(
+ size_t index) const override {
+ return (*virtual_hosts_)[index].domains;
+ }
+
+ private:
+ const std::vector<XdsApi::RdsUpdate::VirtualHost>* virtual_hosts_;
+};
+} // namespace
+
void XdsResolver::OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] received updated route config", this);
}
+ if (xds_client_ == nullptr) {
+ return;
+ }
// Find the relevant VirtualHost from the RouteConfiguration.
- XdsApi::RdsUpdate::VirtualHost* vhost =
- rds_update.FindVirtualHostForDomain(server_name_);
- if (vhost == nullptr) {
- OnError(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ auto vhost_index = XdsRouting::FindVirtualHostForDomain(
+ VirtualHostListIterator(&rds_update.virtual_hosts), server_name_);
+ if (!vhost_index.has_value()) {
+ OnError(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("could not find VirtualHost for ", server_name_,
- " in RouteConfiguration")
- .c_str()));
+ " in RouteConfiguration")));
return;
}
// Save the virtual host in the resolver.
- current_virtual_host_ = std::move(*vhost);
+ current_virtual_host_ = std::move(rds_update.virtual_hosts[*vhost_index]);
// Send a new result to the channel.
GenerateResult();
}
-void XdsResolver::OnError(grpc_error* error) {
+void XdsResolver::OnError(grpc_error_handle error) {
gpr_log(GPR_ERROR, "[xds_resolver %p] received error from XdsClient: %s",
- this, grpc_error_string(error));
+ this, grpc_error_std_string(error).c_str());
+ if (xds_client_ == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
Result result;
- result.args = grpc_channel_args_copy(args_);
+ grpc_arg new_arg = xds_client_->MakeChannelArg();
+ result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
result.service_config_error = error;
result_handler_->ReturnResult(std::move(result));
}
@@ -823,6 +804,9 @@ void XdsResolver::OnResourceDoesNotExist() {
"[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
"update and returning empty service config",
this);
+ if (xds_client_ == nullptr) {
+ return;
+ }
current_virtual_host_.routes.clear();
Result result;
result.service_config =
@@ -832,7 +816,7 @@ void XdsResolver::OnResourceDoesNotExist() {
result_handler_->ReturnResult(std::move(result));
}
-grpc_error* XdsResolver::CreateServiceConfig(
+grpc_error_handle XdsResolver::CreateServiceConfig(
RefCountedPtr<ServiceConfig>* service_config) {
std::vector<TString> clusters;
for (const auto& cluster : cluster_state_map_) {
@@ -859,7 +843,7 @@ grpc_error* XdsResolver::CreateServiceConfig(
" ]\n"
"}");
TString json = y_absl::StrJoin(config_parts, "");
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
*service_config = ServiceConfig::Create(args_, json.c_str(), &error);
return error;
}
@@ -868,24 +852,30 @@ void XdsResolver::GenerateResult() {
if (current_virtual_host_.routes.empty()) return;
// First create XdsConfigSelector, which may add new entries to the cluster
// state map, and then CreateServiceConfig for LB policies.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
auto config_selector = MakeRefCounted<XdsConfigSelector>(Ref(), &error);
if (error != GRPC_ERROR_NONE) {
- OnError(error);
+ OnError(grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAVAILABLE));
return;
}
Result result;
error = CreateServiceConfig(&result.service_config);
if (error != GRPC_ERROR_NONE) {
- OnError(error);
+ OnError(grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAVAILABLE));
return;
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] generated service config: %s", this,
result.service_config->json_string().c_str());
}
- grpc_arg new_arg = config_selector->MakeChannelArg();
- result.args = grpc_channel_args_copy_and_add(args_, &new_arg, 1);
+ grpc_arg new_args[] = {
+ xds_client_->MakeChannelArg(),
+ config_selector->MakeChannelArg(),
+ };
+ result.args =
+ grpc_channel_args_copy_and_add(args_, new_args, GPR_ARRAY_SIZE(new_args));
result_handler_->ReturnResult(std::move(result));
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
index a065b4274e5..e06ace31e64 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_factory.h
@@ -36,6 +36,8 @@ namespace grpc_core {
struct ResolverArgs {
/// The parsed URI to resolve.
URI uri;
+ /// The URI string.
+ TString uri_string;
/// Channel args to be included in resolver results.
const grpc_channel_args* args = nullptr;
/// Used to drive I/O in the name resolution process.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
index 6834f5a5f50..0d603e5bfb2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.cc
@@ -73,7 +73,7 @@ class RegistryState {
ResolverFactory* factory =
tmp_uri.ok() ? LookupResolverFactory(tmp_uri->scheme()) : nullptr;
if (factory != nullptr) {
- *uri = *tmp_uri;
+ *uri = std::move(*tmp_uri);
return factory;
}
*canonical_target = y_absl::StrCat(default_prefix_.get(), target);
@@ -81,7 +81,7 @@ class RegistryState {
factory =
tmp_uri2.ok() ? LookupResolverFactory(tmp_uri2->scheme()) : nullptr;
if (factory != nullptr) {
- *uri = *tmp_uri2;
+ *uri = std::move(*tmp_uri2);
return factory;
}
if (!tmp_uri.ok() || !tmp_uri2.ok()) {
@@ -104,10 +104,10 @@ class RegistryState {
// hurting performance (which is unlikely, since these allocations
// only occur at gRPC initialization time).
y_absl::InlinedVector<std::unique_ptr<ResolverFactory>, 10> factories_;
- grpc_core::UniquePtr<char> default_prefix_;
+ UniquePtr<char> default_prefix_;
};
-static RegistryState* g_state = nullptr;
+RegistryState* g_state = nullptr;
} // namespace
@@ -158,18 +158,16 @@ OrphanablePtr<Resolver> ResolverRegistry::CreateResolver(
std::shared_ptr<WorkSerializer> work_serializer,
std::unique_ptr<Resolver::ResultHandler> result_handler) {
GPR_ASSERT(g_state != nullptr);
- TString canonical_target;
ResolverArgs resolver_args;
ResolverFactory* factory = g_state->FindResolverFactory(
- target, &resolver_args.uri, &canonical_target);
+ target, &resolver_args.uri, &resolver_args.uri_string);
+ if (factory == nullptr) return nullptr;
+ if (resolver_args.uri_string.empty()) resolver_args.uri_string = target;
resolver_args.args = args;
resolver_args.pollset_set = pollset_set;
resolver_args.work_serializer = std::move(work_serializer);
resolver_args.result_handler = std::move(result_handler);
- OrphanablePtr<Resolver> resolver =
- factory == nullptr ? nullptr
- : factory->CreateResolver(std::move(resolver_args));
- return resolver;
+ return factory->CreateResolver(std::move(resolver_args));
}
TString ResolverRegistry::GetDefaultAuthority(y_absl::string_view target) {
@@ -183,15 +181,14 @@ TString ResolverRegistry::GetDefaultAuthority(y_absl::string_view target) {
return authority;
}
-grpc_core::UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(
- const char* target) {
+UniquePtr<char> ResolverRegistry::AddDefaultPrefixIfNeeded(const char* target) {
GPR_ASSERT(g_state != nullptr);
URI uri;
TString canonical_target;
g_state->FindResolverFactory(target, &uri, &canonical_target);
- return grpc_core::UniquePtr<char>(canonical_target.empty()
- ? gpr_strdup(target)
- : gpr_strdup(canonical_target.c_str()));
+ return UniquePtr<char>(canonical_target.empty()
+ ? gpr_strdup(target)
+ : gpr_strdup(canonical_target.c_str()));
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
index 1858f0ea641..e46e7181225 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_registry.h
@@ -76,8 +76,7 @@ class ResolverRegistry {
static TString GetDefaultAuthority(y_absl::string_view target);
/// Returns \a target with the default prefix prepended, if needed.
- static grpc_core::UniquePtr<char> AddDefaultPrefixIfNeeded(
- const char* target);
+ static UniquePtr<char> AddDefaultPrefixIfNeeded(const char* target);
/// Returns the resolver factory for \a scheme.
/// Caller does NOT own the return value.
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
index 4dc8af7b6cd..db49ed8a8b0 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.cc
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
@@ -63,200 +61,15 @@ void ClientChannelServiceConfigParser::Register() {
namespace {
-std::unique_ptr<ClientChannelMethodParsedConfig::RetryPolicy> ParseRetryPolicy(
- const Json& json, grpc_error** error) {
- GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- auto retry_policy =
- y_absl::make_unique<ClientChannelMethodParsedConfig::RetryPolicy>();
- if (json.type() != Json::Type::OBJECT) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryPolicy error:should be of type object");
- return nullptr;
- }
- std::vector<grpc_error*> error_list;
- // Parse maxAttempts.
- auto it = json.object_value().find("maxAttempts");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxAttempts error:should be of type number"));
- } else {
- retry_policy->max_attempts =
- gpr_parse_nonnegative_int(it->second.string_value().c_str());
- if (retry_policy->max_attempts <= 1) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxAttempts error:should be at least 2"));
- } else if (retry_policy->max_attempts > MAX_MAX_RETRY_ATTEMPTS) {
- gpr_log(GPR_ERROR,
- "service config: clamped retryPolicy.maxAttempts at %d",
- MAX_MAX_RETRY_ATTEMPTS);
- retry_policy->max_attempts = MAX_MAX_RETRY_ATTEMPTS;
- }
- }
- }
- // Parse initialBackoff.
- if (ParseJsonObjectFieldAsDuration(json.object_value(), "initialBackoff",
- &retry_policy->initial_backoff,
- &error_list) &&
- retry_policy->initial_backoff == 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:initialBackoff error:must be greater than 0"));
- }
- // Parse maxBackoff.
- if (ParseJsonObjectFieldAsDuration(json.object_value(), "maxBackoff",
- &retry_policy->max_backoff, &error_list) &&
- retry_policy->max_backoff == 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:maxBackoff error:should be greater than 0"));
- }
- // Parse backoffMultiplier.
- it = json.object_value().find("backoffMultiplier");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:backoffMultiplier error:should be of type number"));
- } else {
- if (sscanf(it->second.string_value().c_str(), "%f",
- &retry_policy->backoff_multiplier) != 1) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:backoffMultiplier error:failed to parse"));
- } else if (retry_policy->backoff_multiplier <= 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:backoffMultiplier error:should be greater than 0"));
- }
- }
- }
- // Parse retryableStatusCodes.
- it = json.object_value().find("retryableStatusCodes");
- if (it != json.object_value().end()) {
- if (it->second.type() != Json::Type::ARRAY) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:should be of type array"));
- } else {
- for (const Json& element : it->second.array_value()) {
- if (element.type() != Json::Type::STRING) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:status codes should be of type "
- "string"));
- continue;
- }
- grpc_status_code status;
- if (!grpc_status_code_from_string(element.string_value().c_str(),
- &status)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:failed to parse status code"));
- continue;
- }
- retry_policy->retryable_status_codes.Add(status);
- }
- if (retry_policy->retryable_status_codes.Empty()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryableStatusCodes error:should be non-empty"));
- };
- }
- }
- // Make sure required fields are set.
- if (error_list.empty()) {
- if (retry_policy->max_attempts == 0 || retry_policy->initial_backoff == 0 ||
- retry_policy->max_backoff == 0 ||
- retry_policy->backoff_multiplier == 0 ||
- retry_policy->retryable_status_codes.Empty()) {
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryPolicy error:Missing required field(s)");
- return nullptr;
- }
- }
- *error = GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
- return *error == GRPC_ERROR_NONE ? std::move(retry_policy) : nullptr;
-}
-
-grpc_error* ParseRetryThrottling(
- const Json& json,
- ClientChannelGlobalParsedConfig::RetryThrottling* retry_throttling) {
- if (json.type() != Json::Type::OBJECT) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling error:Type should be object");
- }
- std::vector<grpc_error*> error_list;
- // Parse maxTokens.
- auto it = json.object_value().find("maxTokens");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:Not found"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:Type should be "
- "number"));
- } else {
- retry_throttling->max_milli_tokens =
- gpr_parse_nonnegative_int(it->second.string_value().c_str()) * 1000;
- if (retry_throttling->max_milli_tokens <= 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:maxTokens error:should be "
- "greater than zero"));
- }
- }
- // Parse tokenRatio.
- it = json.object_value().find("tokenRatio");
- if (it == json.object_value().end()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Not found"));
- } else if (it->second.type() != Json::Type::NUMBER) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:type should be "
- "number"));
- } else {
- // We support up to 3 decimal digits.
- size_t whole_len = it->second.string_value().size();
- const char* value = it->second.string_value().c_str();
- uint32_t multiplier = 1;
- uint32_t decimal_value = 0;
- const char* decimal_point = strchr(value, '.');
- if (decimal_point != nullptr) {
- whole_len = static_cast<size_t>(decimal_point - value);
- multiplier = 1000;
- size_t decimal_len = strlen(decimal_point + 1);
- if (decimal_len > 3) decimal_len = 3;
- if (!gpr_parse_bytes_to_uint32(decimal_point + 1, decimal_len,
- &decimal_value)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Failed "
- "parsing"));
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
- }
- uint32_t decimal_multiplier = 1;
- for (size_t i = 0; i < (3 - decimal_len); ++i) {
- decimal_multiplier *= 10;
- }
- decimal_value *= decimal_multiplier;
- }
- uint32_t whole_value;
- if (!gpr_parse_bytes_to_uint32(value, whole_len, &whole_value)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:Failed "
- "parsing"));
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
- }
- retry_throttling->milli_token_ratio =
- static_cast<int>((whole_value * multiplier) + decimal_value);
- if (retry_throttling->milli_token_ratio <= 0) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "field:retryThrottling field:tokenRatio error:value should "
- "be greater than 0"));
- }
- }
- return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
-}
-
y_absl::optional<TString> ParseHealthCheckConfig(const Json& field,
- grpc_error** error) {
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
if (field.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:healthCheckConfig error:should be of type object");
return y_absl::nullopt;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
y_absl::optional<TString> service_name;
auto it = field.object_value().find("serviceName");
if (it != field.object_value().end()) {
@@ -276,18 +89,19 @@ y_absl::optional<TString> ParseHealthCheckConfig(const Json& field,
std::unique_ptr<ServiceConfigParser::ParsedConfig>
ClientChannelServiceConfigParser::ParseGlobalParams(
- const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// Parse LB config.
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config;
auto it = json.object_value().find("loadBalancingConfig");
if (it != json.object_value().end()) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
parsed_lb_config = LoadBalancingPolicyRegistry::ParseLoadBalancingConfig(
it->second, &parse_error);
- if (parsed_lb_config == nullptr) {
- std::vector<grpc_error*> lb_errors;
+ if (parse_error != GRPC_ERROR_NONE) {
+ std::vector<grpc_error_handle> lb_errors;
lb_errors.push_back(parse_error);
error_list.push_back(GRPC_ERROR_CREATE_FROM_VECTOR(
"field:loadBalancingConfig", &lb_errors));
@@ -311,32 +125,18 @@ ClientChannelServiceConfigParser::ParseGlobalParams(
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:loadBalancingPolicy error:Unknown lb policy"));
} else if (requires_config) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("field:loadBalancingPolicy error:", lb_policy_name,
" requires a config. Please use loadBalancingConfig "
- "instead.")
- .c_str()));
+ "instead.")));
}
}
}
- // Parse retry throttling.
- y_absl::optional<ClientChannelGlobalParsedConfig::RetryThrottling>
- retry_throttling;
- it = json.object_value().find("retryThrottling");
- if (it != json.object_value().end()) {
- ClientChannelGlobalParsedConfig::RetryThrottling data;
- grpc_error* parsing_error = ParseRetryThrottling(it->second, &data);
- if (parsing_error != GRPC_ERROR_NONE) {
- error_list.push_back(parsing_error);
- } else {
- retry_throttling.emplace(data);
- }
- }
// Parse health check config.
y_absl::optional<TString> health_check_service_name;
it = json.object_value().find("healthCheckConfig");
if (it != json.object_value().end()) {
- grpc_error* parsing_error = GRPC_ERROR_NONE;
+ grpc_error_handle parsing_error = GRPC_ERROR_NONE;
health_check_service_name =
ParseHealthCheckConfig(it->second, &parsing_error);
if (parsing_error != GRPC_ERROR_NONE) {
@@ -348,20 +148,19 @@ ClientChannelServiceConfigParser::ParseGlobalParams(
if (*error == GRPC_ERROR_NONE) {
return y_absl::make_unique<ClientChannelGlobalParsedConfig>(
std::move(parsed_lb_config), std::move(lb_policy_name),
- retry_throttling, std::move(health_check_service_name));
+ std::move(health_check_service_name));
}
return nullptr;
}
std::unique_ptr<ServiceConfigParser::ParsedConfig>
ClientChannelServiceConfigParser::ParsePerMethodParams(
- const grpc_channel_args* /*args*/, const Json& json, grpc_error** error) {
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
- y_absl::optional<bool> wait_for_ready;
- grpc_millis timeout = 0;
- std::unique_ptr<ClientChannelMethodParsedConfig::RetryPolicy> retry_policy;
+ std::vector<grpc_error_handle> error_list;
// Parse waitForReady.
+ y_absl::optional<bool> wait_for_ready;
auto it = json.object_value().find("waitForReady");
if (it != json.object_value().end()) {
if (it->second.type() == Json::Type::JSON_TRUE) {
@@ -374,21 +173,14 @@ ClientChannelServiceConfigParser::ParsePerMethodParams(
}
}
// Parse timeout.
+ grpc_millis timeout = 0;
ParseJsonObjectFieldAsDuration(json.object_value(), "timeout", &timeout,
&error_list, false);
- // Parse retry policy.
- it = json.object_value().find("retryPolicy");
- if (it != json.object_value().end()) {
- grpc_error* error = GRPC_ERROR_NONE;
- retry_policy = ParseRetryPolicy(it->second, &error);
- if (retry_policy == nullptr) {
- error_list.push_back(error);
- }
- }
+ // Return result.
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Client channel parser", &error_list);
if (*error == GRPC_ERROR_NONE) {
- return y_absl::make_unique<ClientChannelMethodParsedConfig>(
- timeout, wait_for_ready, std::move(retry_policy));
+ return y_absl::make_unique<ClientChannelMethodParsedConfig>(timeout,
+ wait_for_ready);
}
return nullptr;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
index f8e3f2992a1..e0f88f0401e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/resolver_result_parsing.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H
@@ -26,8 +24,7 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_factory.h"
#include "src/core/ext/filters/client_channel/resolver.h"
-#include "src/core/ext/filters/client_channel/retry_throttle.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -40,19 +37,12 @@ namespace internal {
class ClientChannelGlobalParsedConfig
: public ServiceConfigParser::ParsedConfig {
public:
- struct RetryThrottling {
- intptr_t max_milli_tokens = 0;
- intptr_t milli_token_ratio = 0;
- };
-
ClientChannelGlobalParsedConfig(
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config,
TString parsed_deprecated_lb_policy,
- const y_absl::optional<RetryThrottling>& retry_throttling,
y_absl::optional<TString> health_check_service_name)
: parsed_lb_config_(std::move(parsed_lb_config)),
parsed_deprecated_lb_policy_(std::move(parsed_deprecated_lb_policy)),
- retry_throttling_(retry_throttling),
health_check_service_name_(std::move(health_check_service_name)) {}
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config() const {
@@ -63,10 +53,6 @@ class ClientChannelGlobalParsedConfig
return parsed_deprecated_lb_policy_;
}
- y_absl::optional<RetryThrottling> retry_throttling() const {
- return retry_throttling_;
- }
-
const y_absl::optional<TString>& health_check_service_name() const {
return health_check_service_name_;
}
@@ -74,49 +60,34 @@ class ClientChannelGlobalParsedConfig
private:
RefCountedPtr<LoadBalancingPolicy::Config> parsed_lb_config_;
TString parsed_deprecated_lb_policy_;
- y_absl::optional<RetryThrottling> retry_throttling_;
y_absl::optional<TString> health_check_service_name_;
};
class ClientChannelMethodParsedConfig
: public ServiceConfigParser::ParsedConfig {
public:
- struct RetryPolicy {
- int max_attempts = 0;
- grpc_millis initial_backoff = 0;
- grpc_millis max_backoff = 0;
- float backoff_multiplier = 0;
- StatusCodeSet retryable_status_codes;
- };
-
ClientChannelMethodParsedConfig(grpc_millis timeout,
- const y_absl::optional<bool>& wait_for_ready,
- std::unique_ptr<RetryPolicy> retry_policy)
- : timeout_(timeout),
- wait_for_ready_(wait_for_ready),
- retry_policy_(std::move(retry_policy)) {}
+ const y_absl::optional<bool>& wait_for_ready)
+ : timeout_(timeout), wait_for_ready_(wait_for_ready) {}
grpc_millis timeout() const { return timeout_; }
y_absl::optional<bool> wait_for_ready() const { return wait_for_ready_; }
- const RetryPolicy* retry_policy() const { return retry_policy_.get(); }
-
private:
grpc_millis timeout_ = 0;
y_absl::optional<bool> wait_for_ready_;
- std::unique_ptr<RetryPolicy> retry_policy_;
};
class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
public:
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
static size_t ParserIndex();
static void Register();
@@ -125,4 +96,4 @@ class ClientChannelServiceConfigParser : public ServiceConfigParser::Parser {
} // namespace internal
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RESOLVER_RESULT_PARSING_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
new file mode 100644
index 00000000000..60d4d49b38b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.cc
@@ -0,0 +1,2573 @@
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/retry_filter.h"
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/status/statusor.h"
+#include "y_absl/strings/strip.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/retry_service_config.h"
+#include "src/core/ext/filters/client_channel/retry_throttle.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
+#include "src/core/lib/backoff/backoff.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/transport/status_metadata.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+//
+// Retry filter
+//
+
+// This filter is intended to be used in the DynamicFilter stack in the
+// client channel, which is situated between the name resolver and the
+// LB policy. Normally, the last filter in the DynamicFilter stack is
+// the DynamicTerminationFilter (see client_channel.cc), which creates a
+// LoadBalancedCall and delegates to it. However, when retries are
+// enabled, this filter is used instead of the DynamicTerminationFilter.
+//
+// In order to support retries, we act as a proxy for stream op batches.
+// When we get a batch from the surface, we add it to our list of pending
+// batches, and we then use those batches to construct separate "child"
+// batches to be started on an LB call. When the child batches return, we
+// then decide which pending batches have been completed and schedule their
+// callbacks accordingly. If a call attempt fails and we want to retry it,
+// we create a new LB call and start again, constructing new "child" batches
+// for the new LB call.
+//
+// Note that retries are committed when receiving data from the server
+// (except for Trailers-Only responses). However, there may be many
+// send ops started before receiving any data, so we may have already
+// completed some number of send ops (and returned the completions up to
+// the surface) by the time we realize that we need to retry. To deal
+// with this, we cache data for send ops, so that we can replay them on a
+// different LB call even after we have completed the original batches.
+//
+// The code is structured as follows:
+// - In CallData (in the parent channel), we maintain a list of pending
+// ops and cached data for send ops.
+// - There is a CallData::CallAttempt object for each retry attempt.
+// This object contains the LB call for that attempt and state to indicate
+// which ops from the CallData object have already been sent down to that
+// LB call.
+// - There is a CallData::CallAttempt::BatchData object for each "child"
+// batch sent on the LB call.
+//
+// When constructing the "child" batches, we compare the state in the
+// CallAttempt object against the state in the CallData object to see
+// which batches need to be sent on the LB call for a given attempt.
+
+// TODO(roth): In subsequent PRs:
+// - add support for transparent retries (including initial metadata)
+// - implement hedging
+
+// By default, we buffer 256 KiB per RPC for retries.
+// TODO(roth): Do we have any data to suggest a better value?
+#define DEFAULT_PER_RPC_RETRY_BUFFER_SIZE (256 << 10)
+
+// This value was picked arbitrarily. It can be changed if there is
+// any even moderately compelling reason to do so.
+#define RETRY_BACKOFF_JITTER 0.2
+
+namespace grpc_core {
+
+namespace {
+
+using internal::RetryGlobalConfig;
+using internal::RetryMethodConfig;
+using internal::RetryServiceConfigParser;
+using internal::ServerRetryThrottleData;
+
+TraceFlag grpc_retry_trace(false, "retry");
+
+//
+// RetryFilter
+//
+
+class RetryFilter {
+ public:
+ class CallData;
+
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ GPR_ASSERT(args->is_last);
+ GPR_ASSERT(elem->filter == &kRetryFilterVtable);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ new (elem->channel_data) RetryFilter(args->channel_args, &error);
+ return error;
+ }
+
+ static void Destroy(grpc_channel_element* elem) {
+ auto* chand = static_cast<RetryFilter*>(elem->channel_data);
+ chand->~RetryFilter();
+ }
+
+ // Will never be called.
+ static void StartTransportOp(grpc_channel_element* /*elem*/,
+ grpc_transport_op* /*op*/) {}
+ static void GetChannelInfo(grpc_channel_element* /*elem*/,
+ const grpc_channel_info* /*info*/) {}
+
+ private:
+ static size_t GetMaxPerRpcRetryBufferSize(const grpc_channel_args* args) {
+ return static_cast<size_t>(grpc_channel_args_find_integer(
+ args, GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE,
+ {DEFAULT_PER_RPC_RETRY_BUFFER_SIZE, 0, INT_MAX}));
+ }
+
+ RetryFilter(const grpc_channel_args* args, grpc_error_handle* error)
+ : client_channel_(grpc_channel_args_find_pointer<ClientChannel>(
+ args, GRPC_ARG_CLIENT_CHANNEL)),
+ per_rpc_retry_buffer_size_(GetMaxPerRpcRetryBufferSize(args)) {
+ // Get retry throttling parameters from service config.
+ auto* service_config = grpc_channel_args_find_pointer<ServiceConfig>(
+ args, GRPC_ARG_SERVICE_CONFIG_OBJ);
+ if (service_config == nullptr) return;
+ const auto* config = static_cast<const RetryGlobalConfig*>(
+ service_config->GetGlobalParsedConfig(
+ RetryServiceConfigParser::ParserIndex()));
+ if (config == nullptr) return;
+ // Get server name from target URI.
+ const char* server_uri =
+ grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
+ if (server_uri == nullptr) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "server URI channel arg missing or wrong type in client channel "
+ "filter");
+ return;
+ }
+ y_absl::StatusOr<URI> uri = URI::Parse(server_uri);
+ if (!uri.ok() || uri->path().empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "could not extract server name from target URI");
+ return;
+ }
+ TString server_name(y_absl::StripPrefix(uri->path(), "/"));
+ // Get throttling config for server_name.
+ retry_throttle_data_ = internal::ServerRetryThrottleMap::GetDataForServer(
+ server_name, config->max_milli_tokens(), config->milli_token_ratio());
+ }
+
+ ClientChannel* client_channel_;
+ size_t per_rpc_retry_buffer_size_;
+ RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
+};
+
+//
+// RetryFilter::CallData
+//
+
+class RetryFilter::CallData {
+ public:
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
+ static void Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* then_schedule_closure);
+ static void StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
+ static void SetPollent(grpc_call_element* elem, grpc_polling_entity* pollent);
+
+ private:
+ class CallStackDestructionBarrier;
+
+ // Pending batches stored in call data.
+ struct PendingBatch {
+ // The pending batch. If nullptr, this slot is empty.
+ grpc_transport_stream_op_batch* batch = nullptr;
+ // Indicates whether payload for send ops has been cached in CallData.
+ bool send_ops_cached = false;
+ };
+
+ // State associated with each call attempt.
+ class CallAttempt : public RefCounted<CallAttempt> {
+ public:
+ explicit CallAttempt(CallData* calld);
+ ~CallAttempt() override;
+
+ bool lb_call_committed() const { return lb_call_committed_; }
+
+ // Constructs and starts whatever batches are needed on this call
+ // attempt.
+ void StartRetriableBatches();
+
+ // Frees cached send ops that have already been completed after
+ // committing the call.
+ void FreeCachedSendOpDataAfterCommit();
+
+ // Cancels the call attempt.
+ void CancelFromSurface(grpc_transport_stream_op_batch* cancel_batch);
+
+ private:
+ // State used for starting a retryable batch on the call attempt's LB call.
+ // This provides its own grpc_transport_stream_op_batch and other data
+ // structures needed to populate the ops in the batch.
+ // We allocate one struct on the arena for each attempt at starting a
+ // batch on a given LB call.
+ class BatchData
+ : public RefCounted<BatchData, PolymorphicRefCount, kUnrefCallDtor> {
+ public:
+ BatchData(RefCountedPtr<CallAttempt> call_attempt, int refcount,
+ bool set_on_complete);
+ ~BatchData() override;
+
+ grpc_transport_stream_op_batch* batch() { return &batch_; }
+
+ // Adds retriable send_initial_metadata op.
+ void AddRetriableSendInitialMetadataOp();
+ // Adds retriable send_message op.
+ void AddRetriableSendMessageOp();
+ // Adds retriable send_trailing_metadata op.
+ void AddRetriableSendTrailingMetadataOp();
+ // Adds retriable recv_initial_metadata op.
+ void AddRetriableRecvInitialMetadataOp();
+ // Adds retriable recv_message op.
+ void AddRetriableRecvMessageOp();
+ // Adds retriable recv_trailing_metadata op.
+ void AddRetriableRecvTrailingMetadataOp();
+ // Adds cancel_stream op.
+ void AddCancelStreamOp(grpc_error_handle error);
+
+ private:
+ // Frees cached send ops that were completed by the completed batch in
+ // batch_data. Used when batches are completed after the call is
+ // committed.
+ void FreeCachedSendOpDataForCompletedBatch();
+
+ // If there is a pending recv_initial_metadata op, adds a closure
+ // to closures for recv_initial_metadata_ready.
+ void MaybeAddClosureForRecvInitialMetadataCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures);
+ // Intercepts recv_initial_metadata_ready callback for retries.
+ // Commits the call and returns the initial metadata up the stack.
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+
+ // If there is a pending recv_message op, adds a closure to closures
+ // for recv_message_ready.
+ void MaybeAddClosureForRecvMessageCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures);
+ // Intercepts recv_message_ready callback for retries.
+ // Commits the call and returns the message up the stack.
+ static void RecvMessageReady(void* arg, grpc_error_handle error);
+
+ // If there is a pending recv_trailing_metadata op, adds a closure to
+ // closures for recv_trailing_metadata_ready.
+ void MaybeAddClosureForRecvTrailingMetadataReady(
+ grpc_error_handle error, CallCombinerClosureList* closures);
+ // Adds any necessary closures for deferred batch completion
+ // callbacks to closures.
+ void AddClosuresForDeferredCompletionCallbacks(
+ CallCombinerClosureList* closures);
+ // For any pending batch containing an op that has not yet been started,
+ // adds the pending batch's completion closures to closures.
+ void AddClosuresToFailUnstartedPendingBatches(
+ grpc_error_handle error, CallCombinerClosureList* closures);
+ // Runs necessary closures upon completion of a call attempt.
+ void RunClosuresForCompletedCall(grpc_error_handle error);
+ // Intercepts recv_trailing_metadata_ready callback for retries.
+ // Commits the call and returns the trailing metadata up the stack.
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
+
+ // Adds the on_complete closure for the pending batch completed in
+ // batch_data to closures.
+ void AddClosuresForCompletedPendingBatch(
+ grpc_error_handle error, CallCombinerClosureList* closures);
+
+ // If there are any cached ops to replay or pending ops to start on the
+ // LB call, adds them to closures.
+ void AddClosuresForReplayOrPendingSendOps(
+ CallCombinerClosureList* closures);
+
+ // Callback used to intercept on_complete from LB calls.
+ static void OnComplete(void* arg, grpc_error_handle error);
+
+ // Callback used to handle on_complete for internally generated
+ // cancel_stream op.
+ static void OnCompleteForCancelOp(void* arg, grpc_error_handle error);
+
+ RefCountedPtr<CallAttempt> call_attempt_;
+ // The batch to use in the LB call.
+ // Its payload field points to CallAttempt::batch_payload_.
+ grpc_transport_stream_op_batch batch_;
+ // For intercepting on_complete.
+ grpc_closure on_complete_;
+ };
+
+ class AttemptDispatchController
+ : public ConfigSelector::CallDispatchController {
+ public:
+ explicit AttemptDispatchController(CallAttempt* call_attempt)
+ : call_attempt_(call_attempt) {}
+
+ // Will never be called.
+ bool ShouldRetry() override { return false; }
+
+ void Commit() override {
+ call_attempt_->lb_call_committed_ = true;
+ auto* calld = call_attempt_->calld_;
+ if (calld->retry_committed_) {
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA]
+ .value);
+ service_config_call_data->call_dispatch_controller()->Commit();
+ }
+ }
+
+ private:
+ CallAttempt* call_attempt_;
+ };
+
+ // Creates a BatchData object on the call's arena with the
+ // specified refcount. If set_on_complete is true, the batch's
+ // on_complete callback will be set to point to on_complete();
+ // otherwise, the batch's on_complete callback will be null.
+ BatchData* CreateBatch(int refcount, bool set_on_complete) {
+ return calld_->arena_->New<BatchData>(Ref(DEBUG_LOCATION, "CreateBatch"),
+ refcount, set_on_complete);
+ }
+
+ // If there are any cached send ops that need to be replayed on this
+ // call attempt, creates and returns a new batch to replay those ops.
+ // Otherwise, returns nullptr.
+ BatchData* MaybeCreateBatchForReplay();
+
+ // Adds a closure to closures that will execute batch in the call combiner.
+ void AddClosureForBatch(grpc_transport_stream_op_batch* batch,
+ const char* reason,
+ CallCombinerClosureList* closures);
+
+ // Helper function used to start a recv_trailing_metadata batch. This
+ // is used in the case where a recv_initial_metadata or recv_message
+ // op fails in a way that we know the call is over but when the application
+ // has not yet started its own recv_trailing_metadata op.
+ void AddBatchForInternalRecvTrailingMetadata(
+ CallCombinerClosureList* closures);
+
+ // Adds a batch to closures to cancel this call attempt.
+ void AddBatchForCancelOp(grpc_error_handle error,
+ CallCombinerClosureList* closures);
+
+ // Adds batches for pending batches to closures.
+ void AddBatchesForPendingBatches(CallCombinerClosureList* closures);
+
+ // Adds whatever batches are needed on this attempt to closures.
+ void AddRetriableBatches(CallCombinerClosureList* closures);
+
+ // Returns true if any send op in the batch was not yet started on this
+ // attempt.
+ bool PendingBatchContainsUnstartedSendOps(PendingBatch* pending);
+
+ // Returns true if there are cached send ops to replay.
+ bool HaveSendOpsToReplay();
+
+ // If our retry state is no longer needed, switch to fast path by moving
+ // our LB call into calld_->committed_call_ and having calld_ drop
+ // its ref to us.
+ void MaybeSwitchToFastPath();
+
+ // Returns true if the call should be retried.
+ // If server_pushback_md is non-null, sets *server_pushback_ms.
+ bool ShouldRetry(y_absl::optional<grpc_status_code> status, bool is_lb_drop,
+ grpc_mdelem* server_pushback_md,
+ grpc_millis* server_pushback_ms);
+
+ // Abandons the call attempt. Unrefs any deferred batches.
+ void Abandon();
+
+ static void OnPerAttemptRecvTimer(void* arg, grpc_error_handle error);
+ static void OnPerAttemptRecvTimerLocked(void* arg, grpc_error_handle error);
+ void MaybeCancelPerAttemptRecvTimer();
+
+ CallData* calld_;
+ AttemptDispatchController attempt_dispatch_controller_;
+ OrphanablePtr<ClientChannel::LoadBalancedCall> lb_call_;
+ bool lb_call_committed_ = false;
+
+ grpc_timer per_attempt_recv_timer_;
+ grpc_closure on_per_attempt_recv_timer_;
+ bool per_attempt_recv_timer_pending_ = false;
+
+ // BatchData.batch.payload points to this.
+ grpc_transport_stream_op_batch_payload batch_payload_;
+ // For send_initial_metadata.
+ grpc_linked_mdelem retry_attempts_metadata_;
+ grpc_metadata_batch send_initial_metadata_{calld_->arena_};
+ // For send_message.
+ // TODO(roth): Restructure this to eliminate use of ManualConstructor.
+ ManualConstructor<ByteStreamCache::CachingByteStream> send_message_;
+ // For send_trailing_metadata.
+ grpc_metadata_batch send_trailing_metadata_{calld_->arena_};
+ // For intercepting recv_initial_metadata.
+ grpc_metadata_batch recv_initial_metadata_{calld_->arena_};
+ grpc_closure recv_initial_metadata_ready_;
+ bool trailing_metadata_available_ = false;
+ // For intercepting recv_message.
+ grpc_closure recv_message_ready_;
+ OrphanablePtr<ByteStream> recv_message_;
+ // For intercepting recv_trailing_metadata.
+ grpc_metadata_batch recv_trailing_metadata_{calld_->arena_};
+ grpc_transport_stream_stats collect_stats_;
+ grpc_closure recv_trailing_metadata_ready_;
+ // These fields indicate which ops have been started and completed on
+ // this call attempt.
+ size_t started_send_message_count_ = 0;
+ size_t completed_send_message_count_ = 0;
+ size_t started_recv_message_count_ = 0;
+ size_t completed_recv_message_count_ = 0;
+ bool started_send_initial_metadata_ : 1;
+ bool completed_send_initial_metadata_ : 1;
+ bool started_send_trailing_metadata_ : 1;
+ bool completed_send_trailing_metadata_ : 1;
+ bool started_recv_initial_metadata_ : 1;
+ bool completed_recv_initial_metadata_ : 1;
+ bool started_recv_trailing_metadata_ : 1;
+ bool completed_recv_trailing_metadata_ : 1;
+ // State for callback processing.
+ RefCountedPtr<BatchData> recv_initial_metadata_ready_deferred_batch_;
+ grpc_error_handle recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ RefCountedPtr<BatchData> recv_message_ready_deferred_batch_;
+ grpc_error_handle recv_message_error_ = GRPC_ERROR_NONE;
+ struct OnCompleteDeferredBatch {
+ OnCompleteDeferredBatch(RefCountedPtr<BatchData> batch,
+ grpc_error_handle error)
+ : batch(std::move(batch)), error(error) {}
+ RefCountedPtr<BatchData> batch;
+ grpc_error_handle error;
+ };
+ // There cannot be more than 3 pending send op batches at a time.
+ y_absl::InlinedVector<OnCompleteDeferredBatch, 3>
+ on_complete_deferred_batches_;
+ RefCountedPtr<BatchData> recv_trailing_metadata_internal_batch_;
+ grpc_error_handle recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ bool seen_recv_trailing_metadata_from_surface_ : 1;
+ // NOTE: Do not move this next to the metadata bitfields above. That would
+ // save space but will also result in a data race because compiler
+ // will generate a 2 byte store which overwrites the meta-data
+ // fields upon setting this field.
+ bool abandoned_ : 1;
+ };
+
+ CallData(RetryFilter* chand, const grpc_call_element_args& args);
+ ~CallData();
+
+ void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
+
+ // Returns the index into pending_batches_ to be used for batch.
+ static size_t GetBatchIndex(grpc_transport_stream_op_batch* batch);
+ PendingBatch* PendingBatchesAdd(grpc_transport_stream_op_batch* batch);
+ void PendingBatchClear(PendingBatch* pending);
+ void MaybeClearPendingBatch(PendingBatch* pending);
+ static void FailPendingBatchInCallCombiner(void* arg,
+ grpc_error_handle error);
+ // Fails all pending batches. Does NOT yield call combiner.
+ void PendingBatchesFail(grpc_error_handle error);
+ // Returns a pointer to the first pending batch for which predicate(batch)
+ // returns true, or null if not found.
+ template <typename Predicate>
+ PendingBatch* PendingBatchFind(const char* log_message, Predicate predicate);
+
+ // Caches data for send ops so that it can be retried later, if not
+ // already cached.
+ void MaybeCacheSendOpsForBatch(PendingBatch* pending);
+ void FreeCachedSendInitialMetadata();
+ // Frees cached send_message at index idx.
+ void FreeCachedSendMessage(size_t idx);
+ void FreeCachedSendTrailingMetadata();
+ void FreeAllCachedSendOpData();
+
+ // Commits the call so that no further retry attempts will be performed.
+ void RetryCommit(CallAttempt* call_attempt);
+
+ // Starts a timer to retry after appropriate back-off.
+ // If server_pushback_ms is -1, retry_backoff_ is used.
+ void StartRetryTimer(grpc_millis server_pushback_ms);
+
+ static void OnRetryTimer(void* arg, grpc_error_handle error);
+ static void OnRetryTimerLocked(void* arg, grpc_error_handle error);
+
+ OrphanablePtr<ClientChannel::LoadBalancedCall> CreateLoadBalancedCall(
+ ConfigSelector::CallDispatchController* call_dispatch_controller);
+
+ void CreateCallAttempt();
+
+ RetryFilter* chand_;
+ grpc_polling_entity* pollent_;
+ RefCountedPtr<ServerRetryThrottleData> retry_throttle_data_;
+ const RetryMethodConfig* retry_policy_ = nullptr;
+ BackOff retry_backoff_;
+
+ grpc_slice path_; // Request path.
+ grpc_millis deadline_;
+ Arena* arena_;
+ grpc_call_stack* owning_call_;
+ CallCombiner* call_combiner_;
+ grpc_call_context_element* call_context_;
+
+ grpc_error_handle cancelled_from_surface_ = GRPC_ERROR_NONE;
+
+ RefCountedPtr<CallStackDestructionBarrier> call_stack_destruction_barrier_;
+
+ // TODO(roth): As part of implementing hedging, we will need to maintain a
+ // list of all pending attempts, so that we can cancel them all if the call
+ // gets cancelled.
+ RefCountedPtr<CallAttempt> call_attempt_;
+
+ // LB call used when we've committed to a call attempt and the retry
+ // state for that attempt is no longer needed. This provides a fast
+ // path for long-running streaming calls that minimizes overhead.
+ OrphanablePtr<ClientChannel::LoadBalancedCall> committed_call_;
+
+ // When are are not yet fully committed to a particular call (i.e.,
+ // either we might still retry or we have committed to the call but
+ // there are still some cached ops to be replayed on the call),
+ // batches received from above will be added to this list, and they
+ // will not be removed until we have invoked their completion callbacks.
+ size_t bytes_buffered_for_retry_ = 0;
+ PendingBatch pending_batches_[MAX_PENDING_BATCHES];
+ bool pending_send_initial_metadata_ : 1;
+ bool pending_send_message_ : 1;
+ bool pending_send_trailing_metadata_ : 1;
+
+ // Retry state.
+ bool retry_committed_ : 1;
+ bool retry_timer_pending_ : 1;
+ int num_attempts_completed_ = 0;
+ grpc_timer retry_timer_;
+ grpc_closure retry_closure_;
+
+ // Cached data for retrying send ops.
+ // send_initial_metadata
+ bool seen_send_initial_metadata_ = false;
+ grpc_metadata_batch send_initial_metadata_{arena_};
+ uint32_t send_initial_metadata_flags_;
+ // TODO(roth): As part of implementing hedging, we'll probably need to
+ // have the LB call set a value in CallAttempt and then propagate it
+ // from CallAttempt to the parent call when we commit. Otherwise, we
+ // may leave this with a value for a peer other than the one we
+ // actually commit to. Alternatively, maybe see if there's a way to
+ // change the surface API such that the peer isn't available until
+ // after initial metadata is received? (Could even change the
+ // transport API to return this with the recv_initial_metadata op.)
+ gpr_atm* peer_string_;
+ // send_message
+ // When we get a send_message op, we replace the original byte stream
+ // with a CachingByteStream that caches the slices to a local buffer for
+ // use in retries.
+ // Note: We inline the cache for the first 3 send_message ops and use
+ // dynamic allocation after that. This number was essentially picked
+ // at random; it could be changed in the future to tune performance.
+ // TODO(roth): As part of implementing hedging, we may need some
+ // synchronization here, since ByteStreamCache does not provide any
+ // synchronization, so it's not safe to have multiple
+ // CachingByteStreams read from the same ByteStreamCache concurrently.
+ y_absl::InlinedVector<ByteStreamCache*, 3> send_messages_;
+ // send_trailing_metadata
+ bool seen_send_trailing_metadata_ = false;
+ grpc_metadata_batch send_trailing_metadata_{arena_};
+};
+
+//
+// RetryFilter::CallData::CallStackDestructionBarrier
+//
+
+// A class to track the existence of LoadBalancedCall call stacks that
+// we've created. We wait until all such call stacks have been
+// destroyed before we return the on_call_stack_destruction closure up
+// to the surface.
+//
+// The parent RetryFilter::CallData object holds a ref to this object.
+// When it is destroyed, it will store the on_call_stack_destruction
+// closure from the surface in this object and then release its ref.
+// We also take a ref to this object for each LB call we create, and
+// those refs are not released until the LB call stack is destroyed.
+// When this object is destroyed, it will invoke the
+// on_call_stack_destruction closure from the surface.
+class RetryFilter::CallData::CallStackDestructionBarrier
+ : public RefCounted<CallStackDestructionBarrier, PolymorphicRefCount,
+ kUnrefCallDtor> {
+ public:
+ CallStackDestructionBarrier() {}
+
+ ~CallStackDestructionBarrier() override {
+ // TODO(yashkt) : This can potentially be a Closure::Run
+ ExecCtx::Run(DEBUG_LOCATION, on_call_stack_destruction_, GRPC_ERROR_NONE);
+ }
+
+ // Set the closure from the surface. This closure will be invoked
+ // when this object is destroyed.
+ void set_on_call_stack_destruction(grpc_closure* on_call_stack_destruction) {
+ on_call_stack_destruction_ = on_call_stack_destruction;
+ }
+
+ // Invoked to get an on_call_stack_destruction closure for a new LB call.
+ grpc_closure* MakeLbCallDestructionClosure(CallData* calld) {
+ Ref().release(); // Ref held by callback.
+ grpc_closure* on_lb_call_destruction_complete =
+ calld->arena_->New<grpc_closure>();
+ GRPC_CLOSURE_INIT(on_lb_call_destruction_complete,
+ OnLbCallDestructionComplete, this, nullptr);
+ return on_lb_call_destruction_complete;
+ }
+
+ private:
+ static void OnLbCallDestructionComplete(void* arg,
+ grpc_error_handle /*error*/) {
+ auto* self = static_cast<CallStackDestructionBarrier*>(arg);
+ self->Unref();
+ }
+
+ grpc_closure* on_call_stack_destruction_ = nullptr;
+};
+
+//
+// RetryFilter::CallData::CallAttempt
+//
+
+RetryFilter::CallData::CallAttempt::CallAttempt(CallData* calld)
+ : RefCounted(GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "CallAttempt"
+ : nullptr),
+ calld_(calld),
+ attempt_dispatch_controller_(this),
+ batch_payload_(calld->call_context_),
+ started_send_initial_metadata_(false),
+ completed_send_initial_metadata_(false),
+ started_send_trailing_metadata_(false),
+ completed_send_trailing_metadata_(false),
+ started_recv_initial_metadata_(false),
+ completed_recv_initial_metadata_(false),
+ started_recv_trailing_metadata_(false),
+ completed_recv_trailing_metadata_(false),
+ seen_recv_trailing_metadata_from_surface_(false),
+ abandoned_(false) {
+ lb_call_ = calld->CreateLoadBalancedCall(&attempt_dispatch_controller_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: create lb_call=%p",
+ calld->chand_, calld, this, lb_call_.get());
+ }
+ // If per_attempt_recv_timeout is set, start a timer.
+ if (calld->retry_policy_ != nullptr &&
+ calld->retry_policy_->per_attempt_recv_timeout().has_value()) {
+ grpc_millis per_attempt_recv_deadline =
+ ExecCtx::Get()->Now() +
+ *calld->retry_policy_->per_attempt_recv_timeout();
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: per-attempt timeout in %" PRId64
+ " ms",
+ calld->chand_, calld, this,
+ *calld->retry_policy_->per_attempt_recv_timeout());
+ }
+ // Schedule retry after computed delay.
+ GRPC_CLOSURE_INIT(&on_per_attempt_recv_timer_, OnPerAttemptRecvTimer, this,
+ nullptr);
+ GRPC_CALL_STACK_REF(calld->owning_call_, "OnPerAttemptRecvTimer");
+ Ref(DEBUG_LOCATION, "OnPerAttemptRecvTimer").release();
+ per_attempt_recv_timer_pending_ = true;
+ grpc_timer_init(&per_attempt_recv_timer_, per_attempt_recv_deadline,
+ &on_per_attempt_recv_timer_);
+ }
+}
+
+RetryFilter::CallData::CallAttempt::~CallAttempt() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying call attempt",
+ calld_->chand_, calld_, this);
+ }
+}
+
+void RetryFilter::CallData::CallAttempt::FreeCachedSendOpDataAfterCommit() {
+ // TODO(roth): When we implement hedging, this logic will need to get
+ // a bit more complex, because there may be other (now abandoned) call
+ // attempts still using this data. We may need to do some sort of
+ // ref-counting instead.
+ if (completed_send_initial_metadata_) {
+ calld_->FreeCachedSendInitialMetadata();
+ }
+ for (size_t i = 0; i < completed_send_message_count_; ++i) {
+ calld_->FreeCachedSendMessage(i);
+ }
+ if (completed_send_trailing_metadata_) {
+ calld_->FreeCachedSendTrailingMetadata();
+ }
+}
+
+bool RetryFilter::CallData::CallAttempt::PendingBatchContainsUnstartedSendOps(
+ PendingBatch* pending) {
+ if (pending->batch->on_complete == nullptr) return false;
+ if (pending->batch->send_initial_metadata &&
+ !started_send_initial_metadata_) {
+ return true;
+ }
+ if (pending->batch->send_message &&
+ started_send_message_count_ < calld_->send_messages_.size()) {
+ return true;
+ }
+ if (pending->batch->send_trailing_metadata &&
+ !started_send_trailing_metadata_) {
+ return true;
+ }
+ return false;
+}
+
+bool RetryFilter::CallData::CallAttempt::HaveSendOpsToReplay() {
+ // We don't check send_initial_metadata here, because that op will always
+ // be started as soon as it is received from the surface, so it will
+ // never need to be started at this point.
+ return started_send_message_count_ < calld_->send_messages_.size() ||
+ (calld_->seen_send_trailing_metadata_ &&
+ !started_send_trailing_metadata_);
+}
+
+void RetryFilter::CallData::CallAttempt::MaybeSwitchToFastPath() {
+ // If we're not yet committed, we can't switch yet.
+ // TODO(roth): As part of implementing hedging, this logic needs to
+ // check that *this* call attempt is the one that we've committed to.
+ // Might need to replace abandoned_ with an enum indicating whether we're
+ // in flight, abandoned, or the winning call attempt.
+ if (!calld_->retry_committed_) return;
+ // If we've already switched to fast path, there's nothing to do here.
+ if (calld_->committed_call_ != nullptr) return;
+ // If the perAttemptRecvTimeout timer is pending, we can't switch yet.
+ if (per_attempt_recv_timer_pending_) return;
+ // If there are still send ops to replay, we can't switch yet.
+ if (HaveSendOpsToReplay()) return;
+ // If we started an internal batch for recv_trailing_metadata but have not
+ // yet seen that op from the surface, we can't switch yet.
+ if (recv_trailing_metadata_internal_batch_ != nullptr) return;
+ // Switch to fast path.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: retry state no longer needed; "
+ "moving LB call to parent and unreffing the call attempt",
+ calld_->chand_, calld_, this);
+ }
+ calld_->committed_call_ = std::move(lb_call_);
+ calld_->call_attempt_.reset(DEBUG_LOCATION, "MaybeSwitchToFastPath");
+}
+
+// If there are any cached send ops that need to be replayed on the
+// current call attempt, creates and returns a new batch to replay those ops.
+// Otherwise, returns nullptr.
+RetryFilter::CallData::CallAttempt::BatchData*
+RetryFilter::CallData::CallAttempt::MaybeCreateBatchForReplay() {
+ BatchData* replay_batch_data = nullptr;
+ // send_initial_metadata.
+ if (calld_->seen_send_initial_metadata_ && !started_send_initial_metadata_ &&
+ !calld_->pending_send_initial_metadata_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
+ "send_initial_metadata op",
+ calld_->chand_, calld_, this);
+ }
+ replay_batch_data = CreateBatch(1, true /* set_on_complete */);
+ replay_batch_data->AddRetriableSendInitialMetadataOp();
+ }
+ // send_message.
+ // Note that we can only have one send_message op in flight at a time.
+ if (started_send_message_count_ < calld_->send_messages_.size() &&
+ started_send_message_count_ == completed_send_message_count_ &&
+ !calld_->pending_send_message_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
+ "send_message op",
+ calld_->chand_, calld_, this);
+ }
+ if (replay_batch_data == nullptr) {
+ replay_batch_data = CreateBatch(1, true /* set_on_complete */);
+ }
+ replay_batch_data->AddRetriableSendMessageOp();
+ }
+ // send_trailing_metadata.
+ // Note that we only add this op if we have no more send_message ops
+ // to start, since we can't send down any more send_message ops after
+ // send_trailing_metadata.
+ if (calld_->seen_send_trailing_metadata_ &&
+ started_send_message_count_ == calld_->send_messages_.size() &&
+ !started_send_trailing_metadata_ &&
+ !calld_->pending_send_trailing_metadata_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: replaying previously completed "
+ "send_trailing_metadata op",
+ calld_->chand_, calld_, this);
+ }
+ if (replay_batch_data == nullptr) {
+ replay_batch_data = CreateBatch(1, true /* set_on_complete */);
+ }
+ replay_batch_data->AddRetriableSendTrailingMetadataOp();
+ }
+ return replay_batch_data;
+}
+
+namespace {
+
+void StartBatchInCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
+ auto* lb_call = static_cast<ClientChannel::LoadBalancedCall*>(
+ batch->handler_private.extra_arg);
+ // Note: This will release the call combiner.
+ lb_call->StartTransportStreamOpBatch(batch);
+}
+
+} // namespace
+
+void RetryFilter::CallData::CallAttempt::AddClosureForBatch(
+ grpc_transport_stream_op_batch* batch, const char* reason,
+ CallCombinerClosureList* closures) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: adding batch (%s): %s",
+ calld_->chand_, calld_, this, reason,
+ grpc_transport_stream_op_batch_string(batch).c_str());
+ }
+ batch->handler_private.extra_arg = lb_call_.get();
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
+ batch, grpc_schedule_on_exec_ctx);
+ closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE, reason);
+}
+
+void RetryFilter::CallData::CallAttempt::
+ AddBatchForInternalRecvTrailingMetadata(CallCombinerClosureList* closures) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call failed but "
+ "recv_trailing_metadata not started; starting it internally",
+ calld_->chand_, calld_, this);
+ }
+ // Create batch_data with 2 refs, since this batch will be unreffed twice:
+ // once for the recv_trailing_metadata_ready callback when the batch
+ // completes, and again when we actually get a recv_trailing_metadata
+ // op from the surface.
+ BatchData* batch_data = CreateBatch(2, false /* set_on_complete */);
+ batch_data->AddRetriableRecvTrailingMetadataOp();
+ recv_trailing_metadata_internal_batch_.reset(batch_data);
+ AddClosureForBatch(batch_data->batch(),
+ "starting internal recv_trailing_metadata", closures);
+}
+
+void RetryFilter::CallData::CallAttempt::AddBatchForCancelOp(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
+ BatchData* cancel_batch_data = CreateBatch(1, /*set_on_complete=*/true);
+ cancel_batch_data->AddCancelStreamOp(error);
+ AddClosureForBatch(cancel_batch_data->batch(),
+ "start cancellation batch on call attempt", closures);
+}
+
+void RetryFilter::CallData::CallAttempt::AddBatchesForPendingBatches(
+ CallCombinerClosureList* closures) {
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(calld_->pending_batches_); ++i) {
+ PendingBatch* pending = &calld_->pending_batches_[i];
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ if (batch == nullptr) continue;
+ bool has_send_ops = false;
+ // Skip any batch that either (a) has already been started on this
+ // call attempt or (b) we can't start yet because we're still
+ // replaying send ops that need to be completed first.
+ // TODO(roth): Note that if any one op in the batch can't be sent
+ // yet due to ops that we're replaying, we don't start any of the ops
+ // in the batch. This is probably okay, but it could conceivably
+ // lead to increased latency in some cases -- e.g., we could delay
+ // starting a recv op due to it being in the same batch with a send
+ // op. If/when we revamp the callback protocol in
+ // transport_stream_op_batch, we may be able to fix this.
+ if (batch->send_initial_metadata) {
+ if (started_send_initial_metadata_) continue;
+ has_send_ops = true;
+ }
+ if (batch->send_message) {
+ if (completed_send_message_count_ < started_send_message_count_) {
+ continue;
+ }
+ has_send_ops = true;
+ }
+ // Note that we only start send_trailing_metadata if we have no more
+ // send_message ops to start, since we can't send down any more
+ // send_message ops after send_trailing_metadata.
+ if (batch->send_trailing_metadata) {
+ if (started_send_message_count_ + batch->send_message <
+ calld_->send_messages_.size() ||
+ started_send_trailing_metadata_) {
+ continue;
+ }
+ has_send_ops = true;
+ }
+ int num_callbacks = has_send_ops; // All send ops share one callback.
+ if (batch->recv_initial_metadata) {
+ if (started_recv_initial_metadata_) continue;
+ ++num_callbacks;
+ }
+ if (batch->recv_message) {
+ if (completed_recv_message_count_ < started_recv_message_count_) {
+ continue;
+ }
+ ++num_callbacks;
+ }
+ if (batch->recv_trailing_metadata) {
+ if (started_recv_trailing_metadata_) {
+ seen_recv_trailing_metadata_from_surface_ = true;
+ // If we previously completed a recv_trailing_metadata op
+ // initiated by AddBatchForInternalRecvTrailingMetadata(), use the
+ // result of that instead of trying to re-start this op.
+ if (GPR_UNLIKELY(recv_trailing_metadata_internal_batch_ != nullptr)) {
+ // If the batch completed, then trigger the completion callback
+ // directly, so that we return the previously returned results to
+ // the application. Otherwise, just unref the internally started
+ // batch, since we'll propagate the completion when it completes.
+ if (completed_recv_trailing_metadata_) {
+ closures->Add(
+ &recv_trailing_metadata_ready_, recv_trailing_metadata_error_,
+ "re-executing recv_trailing_metadata_ready to propagate "
+ "internally triggered result");
+ // Ref will be released by callback.
+ recv_trailing_metadata_internal_batch_.release();
+ } else {
+ recv_trailing_metadata_internal_batch_.reset(
+ DEBUG_LOCATION,
+ "internally started recv_trailing_metadata batch pending and "
+ "recv_trailing_metadata started from surface");
+ GRPC_ERROR_UNREF(recv_trailing_metadata_error_);
+ }
+ recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ }
+ // We don't want the fact that we've already started this op internally
+ // to prevent us from adding a batch that may contain other ops.
+ // Instead, we'll just skip adding this op below.
+ if (num_callbacks == 0) continue;
+ } else {
+ ++num_callbacks;
+ }
+ }
+ // If we're already committed and the following conditions are met,
+ // just send the batch down as-is:
+ // - The batch contains no cached send ops. (If it does, we need
+ // the logic below to use the cached payloads.)
+ // - The batch does not contain recv_trailing_metadata when we have
+ // already started an internal recv_trailing_metadata batch. (If
+ // we've already started an internal recv_trailing_metadata batch,
+ // then we need the logic below to send all ops in the batch
+ // *except* the recv_trailing_metadata op.)
+ if (calld_->retry_committed_ && !pending->send_ops_cached &&
+ (!batch->recv_trailing_metadata || !started_recv_trailing_metadata_)) {
+ AddClosureForBatch(
+ batch,
+ "start non-replayable pending batch on call attempt after commit",
+ closures);
+ calld_->PendingBatchClear(pending);
+ continue;
+ }
+ // Create batch with the right number of callbacks.
+ BatchData* batch_data =
+ CreateBatch(num_callbacks, has_send_ops /* set_on_complete */);
+ // Cache send ops if needed.
+ calld_->MaybeCacheSendOpsForBatch(pending);
+ // send_initial_metadata.
+ if (batch->send_initial_metadata) {
+ batch_data->AddRetriableSendInitialMetadataOp();
+ }
+ // send_message.
+ if (batch->send_message) {
+ batch_data->AddRetriableSendMessageOp();
+ }
+ // send_trailing_metadata.
+ if (batch->send_trailing_metadata) {
+ batch_data->AddRetriableSendTrailingMetadataOp();
+ }
+ // recv_initial_metadata.
+ if (batch->recv_initial_metadata) {
+ // recv_flags is only used on the server side.
+ GPR_ASSERT(batch->payload->recv_initial_metadata.recv_flags == nullptr);
+ batch_data->AddRetriableRecvInitialMetadataOp();
+ }
+ // recv_message.
+ if (batch->recv_message) {
+ batch_data->AddRetriableRecvMessageOp();
+ }
+ // recv_trailing_metadata.
+ if (batch->recv_trailing_metadata && !started_recv_trailing_metadata_) {
+ batch_data->AddRetriableRecvTrailingMetadataOp();
+ }
+ AddClosureForBatch(batch_data->batch(),
+ "start replayable pending batch on call attempt",
+ closures);
+ }
+}
+
+void RetryFilter::CallData::CallAttempt::AddRetriableBatches(
+ CallCombinerClosureList* closures) {
+ // Replay previously-returned send_* ops if needed.
+ BatchData* replay_batch_data = MaybeCreateBatchForReplay();
+ if (replay_batch_data != nullptr) {
+ AddClosureForBatch(replay_batch_data->batch(),
+ "start replay batch on call attempt", closures);
+ }
+ // Now add pending batches.
+ AddBatchesForPendingBatches(closures);
+}
+
+void RetryFilter::CallData::CallAttempt::StartRetriableBatches() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: constructing retriable batches",
+ calld_->chand_, calld_, this);
+ }
+ // Construct list of closures to execute, one for each pending batch.
+ CallCombinerClosureList closures;
+ AddRetriableBatches(&closures);
+ // Note: This will yield the call combiner.
+ // Start batches on LB call.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: starting %" PRIuPTR
+ " retriable batches on lb_call=%p",
+ calld_->chand_, calld_, this, closures.size(), lb_call_.get());
+ }
+ closures.RunClosures(calld_->call_combiner_);
+}
+
+void RetryFilter::CallData::CallAttempt::CancelFromSurface(
+ grpc_transport_stream_op_batch* cancel_batch) {
+ MaybeCancelPerAttemptRecvTimer();
+ // Propagate cancellation to LB call.
+ lb_call_->StartTransportStreamOpBatch(cancel_batch);
+}
+
+bool RetryFilter::CallData::CallAttempt::ShouldRetry(
+ y_absl::optional<grpc_status_code> status, bool is_lb_drop,
+ grpc_mdelem* server_pushback_md, grpc_millis* server_pushback_ms) {
+ // LB drops always inhibit retries.
+ if (is_lb_drop) return false;
+ // TODO(roth): Handle transparent retries here.
+ // If no retry policy, don't retry.
+ if (calld_->retry_policy_ == nullptr) return false;
+ // Check status.
+ if (status.has_value()) {
+ if (GPR_LIKELY(*status == GRPC_STATUS_OK)) {
+ if (calld_->retry_throttle_data_ != nullptr) {
+ calld_->retry_throttle_data_->RecordSuccess();
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: call succeeded",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ }
+ // Status is not OK. Check whether the status is retryable.
+ if (!calld_->retry_policy_->retryable_status_codes().Contains(*status)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: status %s not configured as "
+ "retryable",
+ calld_->chand_, calld_, this,
+ grpc_status_code_to_string(*status));
+ }
+ return false;
+ }
+ }
+ // Record the failure and check whether retries are throttled.
+ // Note that it's important for this check to come after the status
+ // code check above, since we should only record failures whose statuses
+ // match the configured retryable status codes, so that we don't count
+ // things like failures due to malformed requests (INVALID_ARGUMENT).
+ // Conversely, it's important for this to come before the remaining
+ // checks, so that we don't fail to record failures due to other factors.
+ if (calld_->retry_throttle_data_ != nullptr &&
+ !calld_->retry_throttle_data_->RecordFailure()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: retries throttled",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ }
+ // Check whether the call is committed.
+ if (calld_->retry_committed_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: retries already committed",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ }
+ // Check whether we have retries remaining.
+ ++calld_->num_attempts_completed_;
+ if (calld_->num_attempts_completed_ >=
+ calld_->retry_policy_->max_attempts()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO, "chand=%p calld=%p attempt=%p: exceeded %d retry attempts",
+ calld_->chand_, calld_, this, calld_->retry_policy_->max_attempts());
+ }
+ return false;
+ }
+ // Check server push-back.
+ if (server_pushback_md != nullptr) {
+ // If the value is "-1" or any other unparseable string, we do not retry.
+ uint32_t ms;
+ if (!grpc_parse_slice_to_uint32(GRPC_MDVALUE(*server_pushback_md), &ms)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: not retrying due to server "
+ "push-back",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: server push-back: retry in %u ms",
+ calld_->chand_, calld_, this, ms);
+ }
+ *server_pushback_ms = static_cast<grpc_millis>(ms);
+ }
+ }
+ // Check with call dispatch controller.
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ calld_->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (!service_config_call_data->call_dispatch_controller()->ShouldRetry()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call dispatch controller denied retry",
+ calld_->chand_, calld_, this);
+ }
+ return false;
+ }
+ // We should retry.
+ return true;
+}
+
+void RetryFilter::CallData::CallAttempt::Abandon() {
+ abandoned_ = true;
+ // Unref batches for deferred completion callbacks that will now never
+ // be invoked.
+ if (started_recv_trailing_metadata_ &&
+ !seen_recv_trailing_metadata_from_surface_) {
+ recv_trailing_metadata_internal_batch_.reset(
+ DEBUG_LOCATION,
+ "internal recv_trailing_metadata completed before that op was "
+ "started from the surface");
+ }
+ GRPC_ERROR_UNREF(recv_trailing_metadata_error_);
+ recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ recv_initial_metadata_ready_deferred_batch_.reset(
+ DEBUG_LOCATION,
+ "unref deferred recv_initial_metadata_ready batch due to retry");
+ GRPC_ERROR_UNREF(recv_initial_metadata_error_);
+ recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ recv_message_ready_deferred_batch_.reset(
+ DEBUG_LOCATION, "unref deferred recv_message_ready batch due to retry");
+ GRPC_ERROR_UNREF(recv_message_error_);
+ recv_message_error_ = GRPC_ERROR_NONE;
+ for (auto& on_complete_deferred_batch : on_complete_deferred_batches_) {
+ on_complete_deferred_batch.batch.reset(
+ DEBUG_LOCATION, "unref deferred on_complete batch due to retry");
+ GRPC_ERROR_UNREF(on_complete_deferred_batch.error);
+ }
+ on_complete_deferred_batches_.clear();
+}
+
+void RetryFilter::CallData::CallAttempt::OnPerAttemptRecvTimer(
+ void* arg, grpc_error_handle error) {
+ auto* call_attempt = static_cast<CallAttempt*>(arg);
+ GRPC_CLOSURE_INIT(&call_attempt->on_per_attempt_recv_timer_,
+ OnPerAttemptRecvTimerLocked, call_attempt, nullptr);
+ GRPC_CALL_COMBINER_START(call_attempt->calld_->call_combiner_,
+ &call_attempt->on_per_attempt_recv_timer_,
+ GRPC_ERROR_REF(error), "per-attempt timer fired");
+}
+
+void RetryFilter::CallData::CallAttempt::OnPerAttemptRecvTimerLocked(
+ void* arg, grpc_error_handle error) {
+ auto* call_attempt = static_cast<CallAttempt*>(arg);
+ auto* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: perAttemptRecvTimeout timer fired: "
+ "error=%s, per_attempt_recv_timer_pending_=%d",
+ calld->chand_, calld, call_attempt,
+ grpc_error_std_string(error).c_str(),
+ call_attempt->per_attempt_recv_timer_pending_);
+ }
+ CallCombinerClosureList closures;
+ if (error == GRPC_ERROR_NONE &&
+ call_attempt->per_attempt_recv_timer_pending_) {
+ call_attempt->per_attempt_recv_timer_pending_ = false;
+ // Cancel this attempt.
+ // TODO(roth): When implementing hedging, we should not cancel the
+ // current attempt.
+ call_attempt->AddBatchForCancelOp(
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "retry perAttemptRecvTimeout exceeded"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED),
+ &closures);
+ // Check whether we should retry.
+ if (call_attempt->ShouldRetry(
+ /*status=*/y_absl::nullopt, /*is_lb_drop=*/false,
+ /*server_pushback_md=*/nullptr, /*server_pushback_ms=*/nullptr)) {
+ // Mark current attempt as abandoned.
+ call_attempt->Abandon();
+ // We are retrying. Start backoff timer.
+ calld->StartRetryTimer(/*server_pushback_ms=*/-1);
+ } else {
+ // Not retrying, so commit the call.
+ calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
+ }
+ }
+ closures.RunClosures(calld->call_combiner_);
+ call_attempt->Unref(DEBUG_LOCATION, "OnPerAttemptRecvTimer");
+ GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnPerAttemptRecvTimer");
+}
+
+void RetryFilter::CallData::CallAttempt::MaybeCancelPerAttemptRecvTimer() {
+ if (per_attempt_recv_timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: cancelling "
+ "perAttemptRecvTimeout timer",
+ calld_->chand_, calld_, this);
+ }
+ per_attempt_recv_timer_pending_ = false;
+ grpc_timer_cancel(&per_attempt_recv_timer_);
+ }
+}
+
+//
+// RetryFilter::CallData::CallAttempt::BatchData
+//
+
+RetryFilter::CallData::CallAttempt::BatchData::BatchData(
+ RefCountedPtr<CallAttempt> attempt, int refcount, bool set_on_complete)
+ : RefCounted(
+ GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace) ? "BatchData" : nullptr,
+ refcount),
+ call_attempt_(std::move(attempt)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: creating batch %p",
+ call_attempt_->calld_->chand_, call_attempt_->calld_,
+ call_attempt_.get(), this);
+ }
+ // We hold a ref to the call stack for every batch sent on a call attempt.
+ // This is because some batches on the call attempt may not complete
+ // until after all of the batches are completed at the surface (because
+ // each batch that is pending at the surface holds a ref). This
+ // can happen for replayed send ops, and it can happen for
+ // recv_initial_metadata and recv_message ops on a call attempt that has
+ // been abandoned.
+ GRPC_CALL_STACK_REF(call_attempt_->calld_->owning_call_, "Retry BatchData");
+ batch_.payload = &call_attempt_->batch_payload_;
+ if (set_on_complete) {
+ GRPC_CLOSURE_INIT(&on_complete_, OnComplete, this, nullptr);
+ batch_.on_complete = &on_complete_;
+ }
+}
+
+RetryFilter::CallData::CallAttempt::BatchData::~BatchData() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: destroying batch %p",
+ call_attempt_->calld_->chand_, call_attempt_->calld_,
+ call_attempt_.get(), this);
+ }
+ GRPC_CALL_STACK_UNREF(call_attempt_->calld_->owning_call_, "Retry BatchData");
+ call_attempt_.reset(DEBUG_LOCATION, "~BatchData");
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ FreeCachedSendOpDataForCompletedBatch() {
+ auto* calld = call_attempt_->calld_;
+ // TODO(roth): When we implement hedging, this logic will need to get
+ // a bit more complex, because there may be other (now abandoned) call
+ // attempts still using this data. We may need to do some sort of
+ // ref-counting instead.
+ if (batch_.send_initial_metadata) {
+ calld->FreeCachedSendInitialMetadata();
+ }
+ if (batch_.send_message) {
+ calld->FreeCachedSendMessage(call_attempt_->completed_send_message_count_ -
+ 1);
+ }
+ if (batch_.send_trailing_metadata) {
+ calld->FreeCachedSendTrailingMetadata();
+ }
+}
+
+//
+// recv_initial_metadata callback handling
+//
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ MaybeAddClosureForRecvInitialMetadataCallback(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
+ // Find pending batch.
+ PendingBatch* pending = call_attempt_->calld_->PendingBatchFind(
+ "invoking recv_initial_metadata_ready for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_initial_metadata &&
+ batch->payload->recv_initial_metadata
+ .recv_initial_metadata_ready != nullptr;
+ });
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ // Return metadata.
+ *pending->batch->payload->recv_initial_metadata.recv_initial_metadata =
+ std::move(call_attempt_->recv_initial_metadata_);
+ // Propagate trailing_metadata_available.
+ *pending->batch->payload->recv_initial_metadata.trailing_metadata_available =
+ call_attempt_->trailing_metadata_available_;
+ // Update bookkeeping.
+ // Note: Need to do this before invoking the callback, since invoking
+ // the callback will result in yielding the call combiner.
+ grpc_closure* recv_initial_metadata_ready =
+ pending->batch->payload->recv_initial_metadata
+ .recv_initial_metadata_ready;
+ pending->batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ nullptr;
+ call_attempt_->calld_->MaybeClearPendingBatch(pending);
+ // Add callback to closures.
+ closures->Add(recv_initial_metadata_ready, error,
+ "recv_initial_metadata_ready for pending batch");
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::RecvInitialMetadataReady(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_initial_metadata_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
+ }
+ call_attempt->completed_recv_initial_metadata_ = true;
+ // If this attempt has been abandoned, then we're not going to use the
+ // result of this recv_initial_metadata op, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "recv_initial_metadata_ready for abandoned attempt");
+ return;
+ }
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
+ // If we're not committed, check the response to see if we need to commit.
+ if (!calld->retry_committed_) {
+ // If we got an error or a Trailers-Only response and have not yet gotten
+ // the recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
+ if (GPR_UNLIKELY((call_attempt->trailing_metadata_available_ ||
+ error != GRPC_ERROR_NONE) &&
+ !call_attempt->completed_recv_trailing_metadata_)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: deferring "
+ "recv_initial_metadata_ready (Trailers-Only)",
+ calld->chand_, calld, call_attempt);
+ }
+ call_attempt->recv_initial_metadata_ready_deferred_batch_ =
+ std::move(batch_data);
+ call_attempt->recv_initial_metadata_error_ = GRPC_ERROR_REF(error);
+ CallCombinerClosureList closures;
+ if (error != GRPC_ERROR_NONE) {
+ call_attempt->AddBatchForCancelOp(GRPC_ERROR_REF(error), &closures);
+ }
+ if (!call_attempt->started_recv_trailing_metadata_) {
+ // recv_trailing_metadata not yet started by application; start it
+ // ourselves to get status.
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
+ }
+ closures.RunClosures(calld->call_combiner_);
+ return;
+ }
+ // Received valid initial metadata, so commit the call.
+ calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
+ }
+ // Invoke the callback to return the result to the surface.
+ CallCombinerClosureList closures;
+ batch_data->MaybeAddClosureForRecvInitialMetadataCallback(
+ GRPC_ERROR_REF(error), &closures);
+ closures.RunClosures(calld->call_combiner_);
+}
+
+//
+// recv_message callback handling
+//
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ MaybeAddClosureForRecvMessageCallback(grpc_error_handle error,
+ CallCombinerClosureList* closures) {
+ // Find pending op.
+ PendingBatch* pending = call_attempt_->calld_->PendingBatchFind(
+ "invoking recv_message_ready for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_message &&
+ batch->payload->recv_message.recv_message_ready != nullptr;
+ });
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ // Return payload.
+ *pending->batch->payload->recv_message.recv_message =
+ std::move(call_attempt_->recv_message_);
+ // Update bookkeeping.
+ // Note: Need to do this before invoking the callback, since invoking
+ // the callback will result in yielding the call combiner.
+ grpc_closure* recv_message_ready =
+ pending->batch->payload->recv_message.recv_message_ready;
+ pending->batch->payload->recv_message.recv_message_ready = nullptr;
+ call_attempt_->calld_->MaybeClearPendingBatch(pending);
+ // Add callback to closures.
+ closures->Add(recv_message_ready, error,
+ "recv_message_ready for pending batch");
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::RecvMessageReady(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_message_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
+ }
+ ++call_attempt->completed_recv_message_count_;
+ // If this attempt has been abandoned, then we're not going to use the
+ // result of this recv_message op, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "recv_message_ready for abandoned attempt");
+ return;
+ }
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
+ // If we're not committed, check the response to see if we need to commit.
+ if (!calld->retry_committed_) {
+ // If we got an error or the payload was nullptr and we have not yet gotten
+ // the recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
+ if (GPR_UNLIKELY((call_attempt->recv_message_ == nullptr ||
+ error != GRPC_ERROR_NONE) &&
+ !call_attempt->completed_recv_trailing_metadata_)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: deferring recv_message_ready "
+ "(nullptr message and recv_trailing_metadata pending)",
+ calld->chand_, calld, call_attempt);
+ }
+ call_attempt->recv_message_ready_deferred_batch_ = std::move(batch_data);
+ call_attempt->recv_message_error_ = GRPC_ERROR_REF(error);
+ CallCombinerClosureList closures;
+ if (error != GRPC_ERROR_NONE) {
+ call_attempt->AddBatchForCancelOp(GRPC_ERROR_REF(error), &closures);
+ }
+ if (!call_attempt->started_recv_trailing_metadata_) {
+ // recv_trailing_metadata not yet started by application; start it
+ // ourselves to get status.
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
+ }
+ closures.RunClosures(calld->call_combiner_);
+ return;
+ }
+ // Received a valid message, so commit the call.
+ calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
+ }
+ // Invoke the callback to return the result to the surface.
+ CallCombinerClosureList closures;
+ batch_data->MaybeAddClosureForRecvMessageCallback(GRPC_ERROR_REF(error),
+ &closures);
+ closures.RunClosures(calld->call_combiner_);
+}
+
+//
+// recv_trailing_metadata handling
+//
+
+namespace {
+
+// Sets *status, *server_pushback_md, and *is_lb_drop based on md_batch
+// and error.
+void GetCallStatus(grpc_millis deadline, grpc_metadata_batch* md_batch,
+ grpc_error_handle error, grpc_status_code* status,
+ grpc_mdelem** server_pushback_md, bool* is_lb_drop) {
+ if (error != GRPC_ERROR_NONE) {
+ grpc_error_get_status(error, deadline, status, nullptr, nullptr, nullptr);
+ intptr_t value = 0;
+ if (grpc_error_get_int(error, GRPC_ERROR_INT_LB_POLICY_DROP, &value) &&
+ value != 0) {
+ *is_lb_drop = true;
+ }
+ } else {
+ GPR_ASSERT(md_batch->legacy_index()->named.grpc_status != nullptr);
+ *status = grpc_get_status_code_from_metadata(
+ md_batch->legacy_index()->named.grpc_status->md);
+ if (md_batch->legacy_index()->named.grpc_retry_pushback_ms != nullptr) {
+ *server_pushback_md =
+ &md_batch->legacy_index()->named.grpc_retry_pushback_ms->md;
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+} // namespace
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ MaybeAddClosureForRecvTrailingMetadataReady(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
+ auto* calld = call_attempt_->calld_;
+ // Find pending batch.
+ PendingBatch* pending = calld->PendingBatchFind(
+ "invoking recv_trailing_metadata_ready for",
+ [](grpc_transport_stream_op_batch* batch) {
+ return batch->recv_trailing_metadata &&
+ batch->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready != nullptr;
+ });
+ // If we generated the recv_trailing_metadata op internally via
+ // AddBatchForInternalRecvTrailingMetadata(), then there will be no
+ // pending batch.
+ if (pending == nullptr) {
+ call_attempt_->recv_trailing_metadata_error_ = error;
+ return;
+ }
+ // Copy transport stats to be delivered up to the surface.
+ grpc_transport_move_stats(
+ &call_attempt_->collect_stats_,
+ pending->batch->payload->recv_trailing_metadata.collect_stats);
+ // Return metadata.
+ *pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata =
+ std::move(call_attempt_->recv_trailing_metadata_);
+ // Add closure.
+ closures->Add(pending->batch->payload->recv_trailing_metadata
+ .recv_trailing_metadata_ready,
+ error, "recv_trailing_metadata_ready for pending batch");
+ // Update bookkeeping.
+ pending->batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ nullptr;
+ calld->MaybeClearPendingBatch(pending);
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddClosuresForDeferredCompletionCallbacks(
+ CallCombinerClosureList* closures) {
+ // Add closure for deferred recv_initial_metadata_ready.
+ if (GPR_UNLIKELY(call_attempt_->recv_initial_metadata_ready_deferred_batch_ !=
+ nullptr)) {
+ MaybeAddClosureForRecvInitialMetadataCallback(
+ call_attempt_->recv_initial_metadata_error_, closures);
+ call_attempt_->recv_initial_metadata_ready_deferred_batch_.reset(
+ DEBUG_LOCATION, "resuming deferred recv_initial_metadata_ready");
+ call_attempt_->recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ }
+ // Add closure for deferred recv_message_ready.
+ if (GPR_UNLIKELY(call_attempt_->recv_message_ready_deferred_batch_ !=
+ nullptr)) {
+ MaybeAddClosureForRecvMessageCallback(call_attempt_->recv_message_error_,
+ closures);
+ call_attempt_->recv_message_ready_deferred_batch_.reset(
+ DEBUG_LOCATION, "resuming deferred recv_message_ready");
+ call_attempt_->recv_message_error_ = GRPC_ERROR_NONE;
+ }
+ // Add closures for deferred on_complete callbacks.
+ for (auto& on_complete_deferred_batch :
+ call_attempt_->on_complete_deferred_batches_) {
+ closures->Add(&on_complete_deferred_batch.batch->on_complete_,
+ on_complete_deferred_batch.error, "resuming on_complete");
+ on_complete_deferred_batch.batch.release();
+ }
+ call_attempt_->on_complete_deferred_batches_.clear();
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddClosuresToFailUnstartedPendingBatches(
+ grpc_error_handle error, CallCombinerClosureList* closures) {
+ auto* calld = call_attempt_->calld_;
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches_); ++i) {
+ PendingBatch* pending = &calld->pending_batches_[i];
+ if (pending->batch == nullptr) continue;
+ if (call_attempt_->PendingBatchContainsUnstartedSendOps(pending)) {
+ closures->Add(pending->batch->on_complete, GRPC_ERROR_REF(error),
+ "failing on_complete for pending batch");
+ pending->batch->on_complete = nullptr;
+ calld->MaybeClearPendingBatch(pending);
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::RunClosuresForCompletedCall(
+ grpc_error_handle error) {
+ // Construct list of closures to execute.
+ CallCombinerClosureList closures;
+ // First, add closure for recv_trailing_metadata_ready.
+ MaybeAddClosureForRecvTrailingMetadataReady(GRPC_ERROR_REF(error), &closures);
+ // If there are deferred batch completion callbacks, add them to closures.
+ AddClosuresForDeferredCompletionCallbacks(&closures);
+ // Add closures to fail any pending batches that have not yet been started.
+ AddClosuresToFailUnstartedPendingBatches(GRPC_ERROR_REF(error), &closures);
+ // Schedule all of the closures identified above.
+ // Note: This will release the call combiner.
+ closures.RunClosures(call_attempt_->calld_->call_combiner_);
+ GRPC_ERROR_UNREF(error);
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::RecvTrailingMetadataReady(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got recv_trailing_metadata_ready, error=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str());
+ }
+ call_attempt->completed_recv_trailing_metadata_ = true;
+ // If this attempt has been abandoned, then we're not going to use the
+ // result of this recv_trailing_metadata op, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "recv_trailing_metadata_ready for abandoned attempt");
+ return;
+ }
+ // Cancel per-attempt recv timer, if any.
+ call_attempt->MaybeCancelPerAttemptRecvTimer();
+ // Get the call's status and check for server pushback metadata.
+ grpc_status_code status = GRPC_STATUS_OK;
+ grpc_mdelem* server_pushback_md = nullptr;
+ grpc_metadata_batch* md_batch =
+ batch_data->batch_.payload->recv_trailing_metadata.recv_trailing_metadata;
+ bool is_lb_drop = false;
+ GetCallStatus(calld->deadline_, md_batch, GRPC_ERROR_REF(error), &status,
+ &server_pushback_md, &is_lb_drop);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: call finished, status=%s is_lb_drop=%d",
+ calld->chand_, calld, call_attempt, grpc_status_code_to_string(status),
+ is_lb_drop);
+ }
+ // Check if we should retry.
+ grpc_millis server_pushback_ms = -1;
+ if (call_attempt->ShouldRetry(status, is_lb_drop, server_pushback_md,
+ &server_pushback_ms)) {
+ // Start retry timer.
+ calld->StartRetryTimer(server_pushback_ms);
+ // Cancel call attempt.
+ CallCombinerClosureList closures;
+ call_attempt->AddBatchForCancelOp(
+ error == GRPC_ERROR_NONE
+ ? grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("call attempt failed"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_CANCELLED)
+ : GRPC_ERROR_REF(error),
+ &closures);
+ // Record that this attempt has been abandoned.
+ call_attempt->Abandon();
+ // Yields call combiner.
+ closures.RunClosures(calld->call_combiner_);
+ return;
+ }
+ // Not retrying, so commit the call.
+ calld->RetryCommit(call_attempt);
+ // If retry state is no longer needed, switch to fast path for
+ // subsequent batches.
+ call_attempt->MaybeSwitchToFastPath();
+ // Run any necessary closures.
+ batch_data->RunClosuresForCompletedCall(GRPC_ERROR_REF(error));
+}
+
+//
+// on_complete callback handling
+//
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddClosuresForCompletedPendingBatch(grpc_error_handle error,
+ CallCombinerClosureList* closures) {
+ auto* calld = call_attempt_->calld_;
+ PendingBatch* pending = calld->PendingBatchFind(
+ "completed", [this](grpc_transport_stream_op_batch* batch) {
+ // Match the pending batch with the same set of send ops as the
+ // batch we've just completed.
+ return batch->on_complete != nullptr &&
+ batch_.send_initial_metadata == batch->send_initial_metadata &&
+ batch_.send_message == batch->send_message &&
+ batch_.send_trailing_metadata == batch->send_trailing_metadata;
+ });
+ // If batch_data is a replay batch, then there will be no pending
+ // batch to complete.
+ if (pending == nullptr) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ // Propagate payload.
+ if (batch_.send_message) {
+ pending->batch->payload->send_message.stream_write_closed =
+ batch_.payload->send_message.stream_write_closed;
+ }
+ // Add closure.
+ closures->Add(pending->batch->on_complete, error,
+ "on_complete for pending batch");
+ pending->batch->on_complete = nullptr;
+ calld->MaybeClearPendingBatch(pending);
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddClosuresForReplayOrPendingSendOps(CallCombinerClosureList* closures) {
+ auto* calld = call_attempt_->calld_;
+ bool have_pending_send_ops = call_attempt_->HaveSendOpsToReplay();
+ // We don't check send_initial_metadata here, because that op will always
+ // be started as soon as it is received from the surface, so it will
+ // never need to be started at this point.
+ if (!have_pending_send_ops) {
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(calld->pending_batches_); ++i) {
+ PendingBatch* pending = &calld->pending_batches_[i];
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ if (batch == nullptr || pending->send_ops_cached) continue;
+ if (batch->send_message || batch->send_trailing_metadata) {
+ have_pending_send_ops = true;
+ break;
+ }
+ }
+ }
+ if (have_pending_send_ops) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p: starting next batch for pending "
+ "send op(s)",
+ calld->chand_, calld, call_attempt_.get());
+ }
+ call_attempt_->AddRetriableBatches(closures);
+ }
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::OnComplete(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got on_complete, error=%s, batch=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str(),
+ grpc_transport_stream_op_batch_string(&batch_data->batch_).c_str());
+ }
+ // If this attempt has been abandoned, then we're not going to propagate
+ // the completion of this batch, so do nothing.
+ if (call_attempt->abandoned_) {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "on_complete for abandoned attempt");
+ return;
+ }
+ // If we got an error and have not yet gotten the
+ // recv_trailing_metadata_ready callback, then defer propagating this
+ // callback back to the surface. We can evaluate whether to retry when
+ // recv_trailing_metadata comes back.
+ if (GPR_UNLIKELY(!calld->retry_committed_ && error != GRPC_ERROR_NONE &&
+ !call_attempt->completed_recv_trailing_metadata_)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p attempt=%p: deferring on_complete",
+ calld->chand_, calld, call_attempt);
+ }
+ call_attempt->on_complete_deferred_batches_.emplace_back(
+ std::move(batch_data), GRPC_ERROR_REF(error));
+ CallCombinerClosureList closures;
+ call_attempt->AddBatchForCancelOp(GRPC_ERROR_REF(error), &closures);
+ if (!call_attempt->started_recv_trailing_metadata_) {
+ // recv_trailing_metadata not yet started by application; start it
+ // ourselves to get status.
+ call_attempt->AddBatchForInternalRecvTrailingMetadata(&closures);
+ }
+ closures.RunClosures(calld->call_combiner_);
+ return;
+ }
+ // Update bookkeeping in call_attempt.
+ if (batch_data->batch_.send_initial_metadata) {
+ call_attempt->completed_send_initial_metadata_ = true;
+ }
+ if (batch_data->batch_.send_message) {
+ ++call_attempt->completed_send_message_count_;
+ }
+ if (batch_data->batch_.send_trailing_metadata) {
+ call_attempt->completed_send_trailing_metadata_ = true;
+ }
+ // If the call is committed, free cached data for send ops that we've just
+ // completed.
+ if (calld->retry_committed_) {
+ batch_data->FreeCachedSendOpDataForCompletedBatch();
+ }
+ // Construct list of closures to execute.
+ CallCombinerClosureList closures;
+ // Add closure for the completed pending batch, if any.
+ batch_data->AddClosuresForCompletedPendingBatch(GRPC_ERROR_REF(error),
+ &closures);
+ // If needed, add a callback to start any replay or pending send ops on
+ // the LB call.
+ if (!call_attempt->completed_recv_trailing_metadata_) {
+ batch_data->AddClosuresForReplayOrPendingSendOps(&closures);
+ }
+ // If retry state is no longer needed (i.e., we're committed and there
+ // are no more send ops to replay), switch to fast path for subsequent
+ // batches.
+ call_attempt->MaybeSwitchToFastPath();
+ // Schedule all of the closures identified above.
+ // Note: This yields the call combiner.
+ closures.RunClosures(calld->call_combiner_);
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::OnCompleteForCancelOp(
+ void* arg, grpc_error_handle error) {
+ RefCountedPtr<BatchData> batch_data(static_cast<BatchData*>(arg));
+ CallAttempt* call_attempt = batch_data->call_attempt_.get();
+ CallData* calld = call_attempt->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p attempt=%p batch_data=%p: "
+ "got on_complete for cancel_stream batch, error=%s, batch=%s",
+ calld->chand_, calld, call_attempt, batch_data.get(),
+ grpc_error_std_string(error).c_str(),
+ grpc_transport_stream_op_batch_string(&batch_data->batch_).c_str());
+ }
+ GRPC_CALL_COMBINER_STOP(
+ calld->call_combiner_,
+ "on_complete for internally generated cancel_stream op");
+}
+
+//
+// retriable batch construction
+//
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableSendInitialMetadataOp() {
+ auto* calld = call_attempt_->calld_;
+ // Maps the number of retries to the corresponding metadata value slice.
+ const grpc_slice* retry_count_strings[] = {&GRPC_MDSTR_1, &GRPC_MDSTR_2,
+ &GRPC_MDSTR_3, &GRPC_MDSTR_4};
+ // We need to make a copy of the metadata batch for each attempt, since
+ // the filters in the subchannel stack may modify this batch, and we don't
+ // want those modifications to be passed forward to subsequent attempts.
+ //
+ // If we've already completed one or more attempts, add the
+ // grpc-retry-attempts header.
+ grpc_metadata_batch_copy(&calld->send_initial_metadata_,
+ &call_attempt_->send_initial_metadata_);
+ if (GPR_UNLIKELY(call_attempt_->send_initial_metadata_.legacy_index()
+ ->named.grpc_previous_rpc_attempts != nullptr)) {
+ call_attempt_->send_initial_metadata_.Remove(
+ GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
+ }
+ if (GPR_UNLIKELY(calld->num_attempts_completed_ > 0)) {
+ grpc_mdelem retry_md = grpc_mdelem_create(
+ GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS,
+ *retry_count_strings[calld->num_attempts_completed_ - 1], nullptr);
+ grpc_error_handle error = grpc_metadata_batch_add_tail(
+ &call_attempt_->send_initial_metadata_,
+ &call_attempt_->retry_attempts_metadata_, retry_md,
+ GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS);
+ if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
+ gpr_log(GPR_ERROR, "error adding retry metadata: %s",
+ grpc_error_std_string(error).c_str());
+ GPR_ASSERT(false);
+ }
+ }
+ call_attempt_->started_send_initial_metadata_ = true;
+ batch_.send_initial_metadata = true;
+ batch_.payload->send_initial_metadata.send_initial_metadata =
+ &call_attempt_->send_initial_metadata_;
+ batch_.payload->send_initial_metadata.send_initial_metadata_flags =
+ calld->send_initial_metadata_flags_;
+ batch_.payload->send_initial_metadata.peer_string = calld->peer_string_;
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableSendMessageOp() {
+ auto* calld = call_attempt_->calld_;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(
+ GPR_INFO,
+ "chand=%p calld=%p attempt=%p: starting calld->send_messages[%" PRIuPTR
+ "]",
+ calld->chand_, calld, call_attempt_.get(),
+ call_attempt_->started_send_message_count_);
+ }
+ ByteStreamCache* cache =
+ calld->send_messages_[call_attempt_->started_send_message_count_];
+ ++call_attempt_->started_send_message_count_;
+ call_attempt_->send_message_.Init(cache);
+ batch_.send_message = true;
+ batch_.payload->send_message.send_message.reset(
+ call_attempt_->send_message_.get());
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableSendTrailingMetadataOp() {
+ auto* calld = call_attempt_->calld_;
+ // We need to make a copy of the metadata batch for each attempt, since
+ // the filters in the subchannel stack may modify this batch, and we don't
+ // want those modifications to be passed forward to subsequent attempts.
+ grpc_metadata_batch_copy(&calld->send_trailing_metadata_,
+ &call_attempt_->send_trailing_metadata_);
+ call_attempt_->started_send_trailing_metadata_ = true;
+ batch_.send_trailing_metadata = true;
+ batch_.payload->send_trailing_metadata.send_trailing_metadata =
+ &call_attempt_->send_trailing_metadata_;
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableRecvInitialMetadataOp() {
+ call_attempt_->started_recv_initial_metadata_ = true;
+ batch_.recv_initial_metadata = true;
+ call_attempt_->recv_initial_metadata_.Clear();
+ batch_.payload->recv_initial_metadata.recv_initial_metadata =
+ &call_attempt_->recv_initial_metadata_;
+ batch_.payload->recv_initial_metadata.trailing_metadata_available =
+ &call_attempt_->trailing_metadata_available_;
+ GRPC_CLOSURE_INIT(&call_attempt_->recv_initial_metadata_ready_,
+ RecvInitialMetadataReady, this, grpc_schedule_on_exec_ctx);
+ batch_.payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &call_attempt_->recv_initial_metadata_ready_;
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableRecvMessageOp() {
+ ++call_attempt_->started_recv_message_count_;
+ batch_.recv_message = true;
+ batch_.payload->recv_message.recv_message = &call_attempt_->recv_message_;
+ batch_.payload->recv_message.call_failed_before_recv_message = nullptr;
+ GRPC_CLOSURE_INIT(&call_attempt_->recv_message_ready_, RecvMessageReady, this,
+ grpc_schedule_on_exec_ctx);
+ batch_.payload->recv_message.recv_message_ready =
+ &call_attempt_->recv_message_ready_;
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::
+ AddRetriableRecvTrailingMetadataOp() {
+ call_attempt_->started_recv_trailing_metadata_ = true;
+ batch_.recv_trailing_metadata = true;
+ call_attempt_->recv_trailing_metadata_.Clear();
+ batch_.payload->recv_trailing_metadata.recv_trailing_metadata =
+ &call_attempt_->recv_trailing_metadata_;
+ batch_.payload->recv_trailing_metadata.collect_stats =
+ &call_attempt_->collect_stats_;
+ GRPC_CLOSURE_INIT(&call_attempt_->recv_trailing_metadata_ready_,
+ RecvTrailingMetadataReady, this, grpc_schedule_on_exec_ctx);
+ batch_.payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &call_attempt_->recv_trailing_metadata_ready_;
+}
+
+void RetryFilter::CallData::CallAttempt::BatchData::AddCancelStreamOp(
+ grpc_error_handle error) {
+ batch_.cancel_stream = true;
+ batch_.payload->cancel_stream.cancel_error = error;
+ // Override on_complete callback.
+ GRPC_CLOSURE_INIT(&on_complete_, OnCompleteForCancelOp, this, nullptr);
+}
+
+//
+// CallData vtable functions
+//
+
+grpc_error_handle RetryFilter::CallData::Init(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
+ auto* chand = static_cast<RetryFilter*>(elem->channel_data);
+ new (elem->call_data) CallData(chand, *args);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand,
+ elem->call_data);
+ }
+ return GRPC_ERROR_NONE;
+}
+
+void RetryFilter::CallData::Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* then_schedule_closure) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ // Save our ref to the CallStackDestructionBarrier until after our
+ // dtor is invoked.
+ RefCountedPtr<CallStackDestructionBarrier> call_stack_destruction_barrier =
+ std::move(calld->call_stack_destruction_barrier_);
+ calld->~CallData();
+ // Now set the callback in the CallStackDestructionBarrier object,
+ // right before we release our ref to it (implicitly upon returning).
+ // The callback will be invoked when the CallStackDestructionBarrier
+ // is destroyed.
+ call_stack_destruction_barrier->set_on_call_stack_destruction(
+ then_schedule_closure);
+}
+
+void RetryFilter::CallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->StartTransportStreamOpBatch(batch);
+}
+
+void RetryFilter::CallData::SetPollent(grpc_call_element* elem,
+ grpc_polling_entity* pollent) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->pollent_ = pollent;
+}
+
+//
+// CallData implementation
+//
+
+const RetryMethodConfig* GetRetryPolicy(
+ const grpc_call_context_element* context) {
+ if (context == nullptr) return nullptr;
+ auto* svc_cfg_call_data = static_cast<ServiceConfigCallData*>(
+ context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ if (svc_cfg_call_data == nullptr) return nullptr;
+ return static_cast<const RetryMethodConfig*>(
+ svc_cfg_call_data->GetMethodParsedConfig(
+ RetryServiceConfigParser::ParserIndex()));
+}
+
+RetryFilter::CallData::CallData(RetryFilter* chand,
+ const grpc_call_element_args& args)
+ : chand_(chand),
+ retry_throttle_data_(chand->retry_throttle_data_),
+ retry_policy_(GetRetryPolicy(args.context)),
+ retry_backoff_(
+ BackOff::Options()
+ .set_initial_backoff(retry_policy_ == nullptr
+ ? 0
+ : retry_policy_->initial_backoff())
+ .set_multiplier(retry_policy_ == nullptr
+ ? 0
+ : retry_policy_->backoff_multiplier())
+ .set_jitter(RETRY_BACKOFF_JITTER)
+ .set_max_backoff(
+ retry_policy_ == nullptr ? 0 : retry_policy_->max_backoff())),
+ path_(grpc_slice_ref_internal(args.path)),
+ deadline_(args.deadline),
+ arena_(args.arena),
+ owning_call_(args.call_stack),
+ call_combiner_(args.call_combiner),
+ call_context_(args.context),
+ call_stack_destruction_barrier_(
+ arena_->New<CallStackDestructionBarrier>()),
+ pending_send_initial_metadata_(false),
+ pending_send_message_(false),
+ pending_send_trailing_metadata_(false),
+ retry_committed_(false),
+ retry_timer_pending_(false) {}
+
+RetryFilter::CallData::~CallData() {
+ grpc_slice_unref_internal(path_);
+ // Make sure there are no remaining pending batches.
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
+ GPR_ASSERT(pending_batches_[i].batch == nullptr);
+ }
+ GRPC_ERROR_UNREF(cancelled_from_surface_);
+}
+
+void RetryFilter::CallData::StartTransportStreamOpBatch(
+ grpc_transport_stream_op_batch* batch) {
+ // If we have an LB call, delegate to the LB call.
+ if (committed_call_ != nullptr) {
+ // Note: This will release the call combiner.
+ committed_call_->StartTransportStreamOpBatch(batch);
+ return;
+ }
+ // Handle cancellation.
+ if (GPR_UNLIKELY(batch->cancel_stream)) {
+ grpc_error_handle cancel_error = batch->payload->cancel_stream.cancel_error;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: cancelled from surface: %s", chand_,
+ this, grpc_error_std_string(cancel_error).c_str());
+ }
+ // If we have a current call attempt, commit the call, then send
+ // the cancellation down to that attempt. When the call fails, it
+ // will not be retried, because we have committed it here.
+ if (call_attempt_ != nullptr) {
+ RetryCommit(call_attempt_.get());
+ // TODO(roth): When implementing hedging, this will get more
+ // complex, because instead of just passing the batch down to a
+ // single call attempt, we'll need to cancel multiple call
+ // attempts and wait for the cancellation on_complete from each call
+ // attempt before we propagate the on_complete from this batch
+ // back to the surface.
+ // Note: This will release the call combiner.
+ call_attempt_->CancelFromSurface(batch);
+ return;
+ }
+ // Save cancel_error in case subsequent batches are started.
+ GRPC_ERROR_UNREF(cancelled_from_surface_);
+ cancelled_from_surface_ = GRPC_ERROR_REF(cancel_error);
+ // Cancel retry timer.
+ if (retry_timer_pending_) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: cancelling retry timer", chand_,
+ this);
+ }
+ retry_timer_pending_ = false; // Lame timer callback.
+ grpc_timer_cancel(&retry_timer_);
+ FreeAllCachedSendOpData();
+ }
+ // Fail pending batches.
+ PendingBatchesFail(GRPC_ERROR_REF(cancel_error));
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancel_error), call_combiner_);
+ return;
+ }
+ // Add the batch to the pending list.
+ PendingBatch* pending = PendingBatchesAdd(batch);
+ // If the timer is pending, yield the call combiner and wait for it to
+ // run, since we don't want to start another call attempt until it does.
+ if (retry_timer_pending_) {
+ GRPC_CALL_COMBINER_STOP(call_combiner_,
+ "added pending batch while retry timer pending");
+ return;
+ }
+ // If we do not yet have a call attempt, create one.
+ if (call_attempt_ == nullptr) {
+ // If we were previously cancelled from the surface, cancel this
+ // batch instead of creating a call attempt.
+ if (cancelled_from_surface_ != GRPC_ERROR_NONE) {
+ PendingBatchClear(pending);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(cancelled_from_surface_), call_combiner_);
+ return;
+ }
+ // If there is no retry policy, then commit retries immediately.
+ // This ensures that the code below will always jump to the fast path.
+ // TODO(roth): Remove this special case when we implement
+ // transparent retries.
+ if (retry_policy_ == nullptr) retry_committed_ = true;
+ // If this is the first batch and retries are already committed
+ // (e.g., if this batch put the call above the buffer size limit), then
+ // immediately create an LB call and delegate the batch to it. This
+ // avoids the overhead of unnecessarily allocating a CallAttempt
+ // object or caching any of the send op data.
+ // Note that we would ideally like to do this also on subsequent
+ // attempts (e.g., if a batch puts the call above the buffer size
+ // limit since the last attempt was complete), but in practice that's
+ // not really worthwhile, because we will almost always have cached and
+ // completed at least the send_initial_metadata op on the previous
+ // attempt, which means that we'd need special logic to replay the
+ // batch anyway, which is exactly what the CallAttempt object provides.
+ // We also skip this optimization if perAttemptRecvTimeout is set in the
+ // retry policy, because we need the code in CallAttempt to handle
+ // the associated timer.
+ if (num_attempts_completed_ == 0 && retry_committed_ &&
+ (retry_policy_ == nullptr ||
+ !retry_policy_->per_attempt_recv_timeout().has_value())) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: retry committed before first attempt; "
+ "creating LB call",
+ chand_, this);
+ }
+ PendingBatchClear(pending);
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ committed_call_ = CreateLoadBalancedCall(
+ service_config_call_data->call_dispatch_controller());
+ committed_call_->StartTransportStreamOpBatch(batch);
+ return;
+ }
+ // Otherwise, create a call attempt.
+ // The attempt will automatically start any necessary replays or
+ // pending batches.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: creating call attempt", chand_,
+ this);
+ }
+ CreateCallAttempt();
+ return;
+ }
+ // Send batches to call attempt.
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: starting batch on attempt=%p", chand_,
+ this, call_attempt_.get());
+ }
+ call_attempt_->StartRetriableBatches();
+}
+
+OrphanablePtr<ClientChannel::LoadBalancedCall>
+RetryFilter::CallData::CreateLoadBalancedCall(
+ ConfigSelector::CallDispatchController* call_dispatch_controller) {
+ grpc_call_element_args args = {owning_call_, nullptr, call_context_,
+ path_, /*start_time=*/0, deadline_,
+ arena_, call_combiner_};
+ return chand_->client_channel_->CreateLoadBalancedCall(
+ args, pollent_,
+ // This callback holds a ref to the CallStackDestructionBarrier
+ // object until the LB call is destroyed.
+ call_stack_destruction_barrier_->MakeLbCallDestructionClosure(this),
+ call_dispatch_controller,
+ // TODO(roth): Change this when we support transparent retries.
+ /*is_transparent_retry=*/false);
+}
+
+void RetryFilter::CallData::CreateCallAttempt() {
+ call_attempt_ = MakeRefCounted<CallAttempt>(this);
+ call_attempt_->StartRetriableBatches();
+}
+
+//
+// send op data caching
+//
+
+void RetryFilter::CallData::MaybeCacheSendOpsForBatch(PendingBatch* pending) {
+ if (pending->send_ops_cached) return;
+ pending->send_ops_cached = true;
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ // Save a copy of metadata for send_initial_metadata ops.
+ if (batch->send_initial_metadata) {
+ seen_send_initial_metadata_ = true;
+ grpc_metadata_batch* send_initial_metadata =
+ batch->payload->send_initial_metadata.send_initial_metadata;
+ grpc_metadata_batch_copy(send_initial_metadata, &send_initial_metadata_);
+ send_initial_metadata_flags_ =
+ batch->payload->send_initial_metadata.send_initial_metadata_flags;
+ peer_string_ = batch->payload->send_initial_metadata.peer_string;
+ }
+ // Set up cache for send_message ops.
+ if (batch->send_message) {
+ ByteStreamCache* cache = arena_->New<ByteStreamCache>(
+ std::move(batch->payload->send_message.send_message));
+ send_messages_.push_back(cache);
+ }
+ // Save metadata batch for send_trailing_metadata ops.
+ if (batch->send_trailing_metadata) {
+ seen_send_trailing_metadata_ = true;
+ grpc_metadata_batch* send_trailing_metadata =
+ batch->payload->send_trailing_metadata.send_trailing_metadata;
+ grpc_metadata_batch_copy(send_trailing_metadata, &send_trailing_metadata_);
+ }
+}
+
+void RetryFilter::CallData::FreeCachedSendInitialMetadata() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_initial_metadata",
+ chand_, this);
+ }
+ send_initial_metadata_.Clear();
+}
+
+void RetryFilter::CallData::FreeCachedSendMessage(size_t idx) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: destroying send_messages[%" PRIuPTR "]", chand_,
+ this, idx);
+ }
+ send_messages_[idx]->Destroy();
+}
+
+void RetryFilter::CallData::FreeCachedSendTrailingMetadata() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: destroying send_trailing_metadata",
+ chand_, this);
+ }
+ send_trailing_metadata_.Clear();
+}
+
+void RetryFilter::CallData::FreeAllCachedSendOpData() {
+ if (seen_send_initial_metadata_) {
+ FreeCachedSendInitialMetadata();
+ }
+ for (size_t i = 0; i < send_messages_.size(); ++i) {
+ FreeCachedSendMessage(i);
+ }
+ if (seen_send_trailing_metadata_) {
+ FreeCachedSendTrailingMetadata();
+ }
+}
+
+//
+// pending_batches management
+//
+
+size_t RetryFilter::CallData::GetBatchIndex(
+ grpc_transport_stream_op_batch* batch) {
+ if (batch->send_initial_metadata) return 0;
+ if (batch->send_message) return 1;
+ if (batch->send_trailing_metadata) return 2;
+ if (batch->recv_initial_metadata) return 3;
+ if (batch->recv_message) return 4;
+ if (batch->recv_trailing_metadata) return 5;
+ GPR_UNREACHABLE_CODE(return (size_t)-1);
+}
+
+// This is called via the call combiner, so access to calld is synchronized.
+RetryFilter::CallData::PendingBatch* RetryFilter::CallData::PendingBatchesAdd(
+ grpc_transport_stream_op_batch* batch) {
+ const size_t idx = GetBatchIndex(batch);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: adding pending batch at index %" PRIuPTR,
+ chand_, this, idx);
+ }
+ PendingBatch* pending = &pending_batches_[idx];
+ GPR_ASSERT(pending->batch == nullptr);
+ pending->batch = batch;
+ pending->send_ops_cached = false;
+ // Update state in calld about pending batches.
+ // Also check if the batch takes us over the retry buffer limit.
+ // Note: We don't check the size of trailing metadata here, because
+ // gRPC clients do not send trailing metadata.
+ if (batch->send_initial_metadata) {
+ pending_send_initial_metadata_ = true;
+ bytes_buffered_for_retry_ += batch->payload->send_initial_metadata
+ .send_initial_metadata->TransportSize();
+ }
+ if (batch->send_message) {
+ pending_send_message_ = true;
+ bytes_buffered_for_retry_ +=
+ batch->payload->send_message.send_message->length();
+ }
+ if (batch->send_trailing_metadata) {
+ pending_send_trailing_metadata_ = true;
+ }
+ // TODO(roth): When we implement hedging, if there are currently attempts
+ // in flight, we will need to pick the one on which the max number of send
+ // ops have already been sent, and we commit to that attempt.
+ if (GPR_UNLIKELY(bytes_buffered_for_retry_ >
+ chand_->per_rpc_retry_buffer_size_)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: exceeded retry buffer size, committing",
+ chand_, this);
+ }
+ RetryCommit(call_attempt_.get());
+ }
+ return pending;
+}
+
+void RetryFilter::CallData::PendingBatchClear(PendingBatch* pending) {
+ if (pending->batch->send_initial_metadata) {
+ pending_send_initial_metadata_ = false;
+ }
+ if (pending->batch->send_message) {
+ pending_send_message_ = false;
+ }
+ if (pending->batch->send_trailing_metadata) {
+ pending_send_trailing_metadata_ = false;
+ }
+ pending->batch = nullptr;
+}
+
+void RetryFilter::CallData::MaybeClearPendingBatch(PendingBatch* pending) {
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ // We clear the pending batch if all of its callbacks have been
+ // scheduled and reset to nullptr.
+ if (batch->on_complete == nullptr &&
+ (!batch->recv_initial_metadata ||
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready ==
+ nullptr) &&
+ (!batch->recv_message ||
+ batch->payload->recv_message.recv_message_ready == nullptr) &&
+ (!batch->recv_trailing_metadata ||
+ batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready ==
+ nullptr)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: clearing pending batch", chand_,
+ this);
+ }
+ PendingBatchClear(pending);
+ }
+}
+
+// This is called via the call combiner, so access to calld is synchronized.
+void RetryFilter::CallData::FailPendingBatchInCallCombiner(
+ void* arg, grpc_error_handle error) {
+ grpc_transport_stream_op_batch* batch =
+ static_cast<grpc_transport_stream_op_batch*>(arg);
+ CallData* call = static_cast<CallData*>(batch->handler_private.extra_arg);
+ // Note: This will release the call combiner.
+ grpc_transport_stream_op_batch_finish_with_failure(
+ batch, GRPC_ERROR_REF(error), call->call_combiner_);
+}
+
+// This is called via the call combiner, so access to calld is synchronized.
+void RetryFilter::CallData::PendingBatchesFail(grpc_error_handle error) {
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ size_t num_batches = 0;
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
+ if (pending_batches_[i].batch != nullptr) ++num_batches;
+ }
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: failing %" PRIuPTR " pending batches: %s",
+ chand_, this, num_batches, grpc_error_std_string(error).c_str());
+ }
+ CallCombinerClosureList closures;
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
+ PendingBatch* pending = &pending_batches_[i];
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ if (batch != nullptr) {
+ batch->handler_private.extra_arg = this;
+ GRPC_CLOSURE_INIT(&batch->handler_private.closure,
+ FailPendingBatchInCallCombiner, batch,
+ grpc_schedule_on_exec_ctx);
+ closures.Add(&batch->handler_private.closure, GRPC_ERROR_REF(error),
+ "PendingBatchesFail");
+ PendingBatchClear(pending);
+ }
+ }
+ closures.RunClosuresWithoutYielding(call_combiner_);
+ GRPC_ERROR_UNREF(error);
+}
+
+template <typename Predicate>
+RetryFilter::CallData::PendingBatch* RetryFilter::CallData::PendingBatchFind(
+ const char* log_message, Predicate predicate) {
+ for (size_t i = 0; i < GPR_ARRAY_SIZE(pending_batches_); ++i) {
+ PendingBatch* pending = &pending_batches_[i];
+ grpc_transport_stream_op_batch* batch = pending->batch;
+ if (batch != nullptr && predicate(batch)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: %s pending batch at index %" PRIuPTR,
+ chand_, this, log_message, i);
+ }
+ return pending;
+ }
+ }
+ return nullptr;
+}
+
+//
+// retry code
+//
+
+void RetryFilter::CallData::RetryCommit(CallAttempt* call_attempt) {
+ if (retry_committed_) return;
+ retry_committed_ = true;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: committing retries", chand_, this);
+ }
+ if (call_attempt != nullptr) {
+ // If the call attempt's LB call has been committed, inform the call
+ // dispatch controller that the call has been committed.
+ // Note: If call_attempt is null, this is happening before the first
+ // retry attempt is started, in which case we'll just pass the real
+ // call dispatch controller down into the LB call, and it won't be
+ // our problem anymore.
+ if (call_attempt->lb_call_committed()) {
+ auto* service_config_call_data =
+ static_cast<ClientChannelServiceConfigCallData*>(
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value);
+ service_config_call_data->call_dispatch_controller()->Commit();
+ }
+ // Free cached send ops.
+ call_attempt->FreeCachedSendOpDataAfterCommit();
+ }
+}
+
+void RetryFilter::CallData::StartRetryTimer(grpc_millis server_pushback_ms) {
+ // Reset call attempt.
+ call_attempt_.reset(DEBUG_LOCATION, "StartRetryTimer");
+ // Compute backoff delay.
+ grpc_millis next_attempt_time;
+ if (server_pushback_ms >= 0) {
+ next_attempt_time = ExecCtx::Get()->Now() + server_pushback_ms;
+ retry_backoff_.Reset();
+ } else {
+ next_attempt_time = retry_backoff_.NextAttemptTime();
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_retry_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: retrying failed call in %" PRId64 " ms", chand_,
+ this, next_attempt_time - ExecCtx::Get()->Now());
+ }
+ // Schedule retry after computed delay.
+ GRPC_CLOSURE_INIT(&retry_closure_, OnRetryTimer, this, nullptr);
+ GRPC_CALL_STACK_REF(owning_call_, "OnRetryTimer");
+ retry_timer_pending_ = true;
+ grpc_timer_init(&retry_timer_, next_attempt_time, &retry_closure_);
+}
+
+void RetryFilter::CallData::OnRetryTimer(void* arg, grpc_error_handle error) {
+ auto* calld = static_cast<CallData*>(arg);
+ GRPC_CLOSURE_INIT(&calld->retry_closure_, OnRetryTimerLocked, calld, nullptr);
+ GRPC_CALL_COMBINER_START(calld->call_combiner_, &calld->retry_closure_,
+ GRPC_ERROR_REF(error), "retry timer fired");
+}
+
+void RetryFilter::CallData::OnRetryTimerLocked(void* arg,
+ grpc_error_handle error) {
+ auto* calld = static_cast<CallData*>(arg);
+ if (error == GRPC_ERROR_NONE && calld->retry_timer_pending_) {
+ calld->retry_timer_pending_ = false;
+ calld->CreateCallAttempt();
+ } else {
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_, "retry timer cancelled");
+ }
+ GRPC_CALL_STACK_UNREF(calld->owning_call_, "OnRetryTimer");
+}
+
+} // namespace
+
+const grpc_channel_filter kRetryFilterVtable = {
+ RetryFilter::CallData::StartTransportStreamOpBatch,
+ RetryFilter::StartTransportOp,
+ sizeof(RetryFilter::CallData),
+ RetryFilter::CallData::Init,
+ RetryFilter::CallData::SetPollent,
+ RetryFilter::CallData::Destroy,
+ sizeof(RetryFilter),
+ RetryFilter::Init,
+ RetryFilter::Destroy,
+ RetryFilter::GetChannelInfo,
+ "retry_filter",
+};
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.h
index 94d20f0c4ac..a96df8af1fc 100644
--- a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_filter.h
@@ -1,5 +1,5 @@
//
-// Copyright 2017 gRPC authors.
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,14 +14,17 @@
// limitations under the License.
//
-#ifndef GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H
-#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_FILTER_H
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_stack.h"
-extern const grpc_channel_filter grpc_workaround_cronet_compression_filter;
+namespace grpc_core {
-#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_CRONET_COMPRESSION_FILTER_H \
- */
+extern const grpc_channel_filter kRetryFilterVtable;
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_FILTER_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
new file mode 100644
index 00000000000..4de87f03cdb
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.cc
@@ -0,0 +1,316 @@
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_channel/retry_service_config.h"
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/types/optional.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/json/json_util.h"
+#include "src/core/lib/uri/uri_parser.h"
+
+// As per the retry design, we do not allow more than 5 retry attempts.
+#define MAX_MAX_RETRY_ATTEMPTS 5
+
+namespace grpc_core {
+namespace internal {
+
+namespace {
+size_t g_retry_service_config_parser_index;
+}
+
+size_t RetryServiceConfigParser::ParserIndex() {
+ return g_retry_service_config_parser_index;
+}
+
+void RetryServiceConfigParser::Register() {
+ g_retry_service_config_parser_index = ServiceConfigParser::RegisterParser(
+ y_absl::make_unique<RetryServiceConfigParser>());
+}
+
+namespace {
+
+grpc_error_handle ParseRetryThrottling(const Json& json,
+ intptr_t* max_milli_tokens,
+ intptr_t* milli_token_ratio) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling error:Type should be object");
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Parse maxTokens.
+ auto it = json.object_value().find("maxTokens");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:Not found"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:Type should be "
+ "number"));
+ } else {
+ *max_milli_tokens =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str()) * 1000;
+ if (*max_milli_tokens <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:maxTokens error:should be "
+ "greater than zero"));
+ }
+ }
+ // Parse tokenRatio.
+ it = json.object_value().find("tokenRatio");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Not found"));
+ } else if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:type should be "
+ "number"));
+ } else {
+ // We support up to 3 decimal digits.
+ size_t whole_len = it->second.string_value().size();
+ const char* value = it->second.string_value().c_str();
+ uint32_t multiplier = 1;
+ uint32_t decimal_value = 0;
+ const char* decimal_point = strchr(value, '.');
+ if (decimal_point != nullptr) {
+ whole_len = static_cast<size_t>(decimal_point - value);
+ multiplier = 1000;
+ size_t decimal_len = strlen(decimal_point + 1);
+ if (decimal_len > 3) decimal_len = 3;
+ if (!gpr_parse_bytes_to_uint32(decimal_point + 1, decimal_len,
+ &decimal_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Failed "
+ "parsing"));
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryThrottling", &error_list);
+ }
+ uint32_t decimal_multiplier = 1;
+ for (size_t i = 0; i < (3 - decimal_len); ++i) {
+ decimal_multiplier *= 10;
+ }
+ decimal_value *= decimal_multiplier;
+ }
+ uint32_t whole_value;
+ if (!gpr_parse_bytes_to_uint32(value, whole_len, &whole_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:Failed "
+ "parsing"));
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryThrottling", &error_list);
+ }
+ *milli_token_ratio =
+ static_cast<int>((whole_value * multiplier) + decimal_value);
+ if (*milli_token_ratio <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryThrottling field:tokenRatio error:value should "
+ "be greater than 0"));
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryThrottling", &error_list);
+}
+
+} // namespace
+
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+RetryServiceConfigParser::ParseGlobalParams(const grpc_channel_args* /*args*/,
+ const Json& json,
+ grpc_error_handle* error) {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ auto it = json.object_value().find("retryThrottling");
+ if (it == json.object_value().end()) return nullptr;
+ intptr_t max_milli_tokens = 0;
+ intptr_t milli_token_ratio = 0;
+ *error =
+ ParseRetryThrottling(it->second, &max_milli_tokens, &milli_token_ratio);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ return y_absl::make_unique<RetryGlobalConfig>(max_milli_tokens,
+ milli_token_ratio);
+}
+
+namespace {
+
+grpc_error_handle ParseRetryPolicy(
+ const grpc_channel_args* args, const Json& json, int* max_attempts,
+ grpc_millis* initial_backoff, grpc_millis* max_backoff,
+ float* backoff_multiplier, StatusCodeSet* retryable_status_codes,
+ y_absl::optional<grpc_millis>* per_attempt_recv_timeout) {
+ if (json.type() != Json::Type::OBJECT) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryPolicy error:should be of type object");
+ }
+ std::vector<grpc_error_handle> error_list;
+ // Parse maxAttempts.
+ auto it = json.object_value().find("maxAttempts");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAttempts error:required field missing"));
+ } else {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAttempts error:should be of type number"));
+ } else {
+ *max_attempts =
+ gpr_parse_nonnegative_int(it->second.string_value().c_str());
+ if (*max_attempts <= 1) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxAttempts error:should be at least 2"));
+ } else if (*max_attempts > MAX_MAX_RETRY_ATTEMPTS) {
+ gpr_log(GPR_ERROR,
+ "service config: clamped retryPolicy.maxAttempts at %d",
+ MAX_MAX_RETRY_ATTEMPTS);
+ *max_attempts = MAX_MAX_RETRY_ATTEMPTS;
+ }
+ }
+ }
+ // Parse initialBackoff.
+ if (ParseJsonObjectFieldAsDuration(json.object_value(), "initialBackoff",
+ initial_backoff, &error_list) &&
+ *initial_backoff == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:initialBackoff error:must be greater than 0"));
+ }
+ // Parse maxBackoff.
+ if (ParseJsonObjectFieldAsDuration(json.object_value(), "maxBackoff",
+ max_backoff, &error_list) &&
+ *max_backoff == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:maxBackoff error:must be greater than 0"));
+ }
+ // Parse backoffMultiplier.
+ it = json.object_value().find("backoffMultiplier");
+ if (it == json.object_value().end()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:required field missing"));
+ } else {
+ if (it->second.type() != Json::Type::NUMBER) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:should be of type number"));
+ } else {
+ if (sscanf(it->second.string_value().c_str(), "%f", backoff_multiplier) !=
+ 1) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:failed to parse"));
+ } else if (*backoff_multiplier <= 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:backoffMultiplier error:must be greater than 0"));
+ }
+ }
+ }
+ // Parse retryableStatusCodes.
+ it = json.object_value().find("retryableStatusCodes");
+ if (it != json.object_value().end()) {
+ if (it->second.type() != Json::Type::ARRAY) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:must be of type array"));
+ } else {
+ for (const Json& element : it->second.array_value()) {
+ if (element.type() != Json::Type::STRING) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:status codes should be of type "
+ "string"));
+ continue;
+ }
+ grpc_status_code status;
+ if (!grpc_status_code_from_string(element.string_value().c_str(),
+ &status)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:failed to parse status code"));
+ continue;
+ }
+ retryable_status_codes->Add(status);
+ }
+ }
+ }
+ // Parse perAttemptRecvTimeout.
+ if (grpc_channel_args_find_bool(args, GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING,
+ false)) {
+ it = json.object_value().find("perAttemptRecvTimeout");
+ if (it != json.object_value().end()) {
+ grpc_millis per_attempt_recv_timeout_value;
+ if (!ParseDurationFromJson(it->second, &per_attempt_recv_timeout_value)) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:perAttemptRecvTimeout error:type must be STRING of the "
+ "form given by google.proto.Duration."));
+ } else {
+ *per_attempt_recv_timeout = per_attempt_recv_timeout_value;
+ // TODO(roth): As part of implementing hedging, relax this check such
+ // that we allow a value of 0 if a hedging policy is specified.
+ if (per_attempt_recv_timeout_value == 0) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:perAttemptRecvTimeout error:must be greater than 0"));
+ }
+ }
+ } else if (retryable_status_codes->Empty()) {
+ // If perAttemptRecvTimeout not present, retryableStatusCodes must be
+ // non-empty.
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:must be non-empty if "
+ "perAttemptRecvTimeout not present"));
+ }
+ } else {
+ // Hedging not enabled, so the error message for
+ // retryableStatusCodes unset should be different.
+ if (retryable_status_codes->Empty()) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "field:retryableStatusCodes error:must be non-empty"));
+ }
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("retryPolicy", &error_list);
+}
+
+} // namespace
+
+std::unique_ptr<ServiceConfigParser::ParsedConfig>
+RetryServiceConfigParser::ParsePerMethodParams(const grpc_channel_args* args,
+ const Json& json,
+ grpc_error_handle* error) {
+ GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
+ // Parse retry policy.
+ auto it = json.object_value().find("retryPolicy");
+ if (it == json.object_value().end()) return nullptr;
+ int max_attempts = 0;
+ grpc_millis initial_backoff = 0;
+ grpc_millis max_backoff = 0;
+ float backoff_multiplier = 0;
+ StatusCodeSet retryable_status_codes;
+ y_absl::optional<grpc_millis> per_attempt_recv_timeout;
+ *error = ParseRetryPolicy(args, it->second, &max_attempts, &initial_backoff,
+ &max_backoff, &backoff_multiplier,
+ &retryable_status_codes, &per_attempt_recv_timeout);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ return y_absl::make_unique<RetryMethodConfig>(
+ max_attempts, initial_backoff, max_backoff, backoff_multiplier,
+ retryable_status_codes, per_attempt_recv_timeout);
+}
+
+} // namespace internal
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.h
new file mode 100644
index 00000000000..486e870eb0a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_service_config.h
@@ -0,0 +1,96 @@
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "src/core/ext/filters/client_channel/retry_throttle.h"
+#include "src/core/ext/service_config/service_config_parser.h"
+#include "src/core/lib/channel/status_util.h"
+#include "src/core/lib/iomgr/exec_ctx.h" // for grpc_millis
+
+namespace grpc_core {
+namespace internal {
+
+class RetryGlobalConfig : public ServiceConfigParser::ParsedConfig {
+ public:
+ RetryGlobalConfig(intptr_t max_milli_tokens, intptr_t milli_token_ratio)
+ : max_milli_tokens_(max_milli_tokens),
+ milli_token_ratio_(milli_token_ratio) {}
+
+ intptr_t max_milli_tokens() const { return max_milli_tokens_; }
+ intptr_t milli_token_ratio() const { return milli_token_ratio_; }
+
+ private:
+ intptr_t max_milli_tokens_ = 0;
+ intptr_t milli_token_ratio_ = 0;
+};
+
+class RetryMethodConfig : public ServiceConfigParser::ParsedConfig {
+ public:
+ RetryMethodConfig(int max_attempts, grpc_millis initial_backoff,
+ grpc_millis max_backoff, float backoff_multiplier,
+ StatusCodeSet retryable_status_codes,
+ y_absl::optional<grpc_millis> per_attempt_recv_timeout)
+ : max_attempts_(max_attempts),
+ initial_backoff_(initial_backoff),
+ max_backoff_(max_backoff),
+ backoff_multiplier_(backoff_multiplier),
+ retryable_status_codes_(retryable_status_codes),
+ per_attempt_recv_timeout_(per_attempt_recv_timeout) {}
+
+ int max_attempts() const { return max_attempts_; }
+ grpc_millis initial_backoff() const { return initial_backoff_; }
+ grpc_millis max_backoff() const { return max_backoff_; }
+ float backoff_multiplier() const { return backoff_multiplier_; }
+ StatusCodeSet retryable_status_codes() const {
+ return retryable_status_codes_;
+ }
+ y_absl::optional<grpc_millis> per_attempt_recv_timeout() const {
+ return per_attempt_recv_timeout_;
+ }
+
+ private:
+ int max_attempts_ = 0;
+ grpc_millis initial_backoff_ = 0;
+ grpc_millis max_backoff_ = 0;
+ float backoff_multiplier_ = 0;
+ StatusCodeSet retryable_status_codes_;
+ y_absl::optional<grpc_millis> per_attempt_recv_timeout_;
+};
+
+class RetryServiceConfigParser : public ServiceConfigParser::Parser {
+ public:
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParseGlobalParams(
+ const grpc_channel_args* /*args*/, const Json& json,
+ grpc_error_handle* error) override;
+
+ std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
+ const grpc_channel_args* args, const Json& json,
+ grpc_error_handle* error) override;
+
+ static size_t ParserIndex();
+ static void Register();
+};
+
+} // namespace internal
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_RETRY_SERVICE_CONFIG_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
index 98ca9006216..535ebf469f1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/retry_throttle.cc
@@ -23,6 +23,7 @@
#include <limits.h>
#include <string.h>
+#include <map>
#include <util/generic/string.h>
#include <grpc/support/alloc.h>
@@ -30,7 +31,7 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/avl/avl.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
namespace grpc_core {
namespace internal {
@@ -115,54 +116,23 @@ void ServerRetryThrottleData::RecordSuccess() {
}
//
-// avl vtable for string -> server_retry_throttle_data map
-//
-
-namespace {
-
-void* copy_server_name(void* key, void* /*unused*/) {
- return gpr_strdup(static_cast<const char*>(key));
-}
-
-long compare_server_name(void* key1, void* key2, void* /*unused*/) {
- return strcmp(static_cast<const char*>(key1), static_cast<const char*>(key2));
-}
-
-void destroy_server_retry_throttle_data(void* value, void* /*unused*/) {
- ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(value);
- throttle_data->Unref();
-}
-
-void* copy_server_retry_throttle_data(void* value, void* /*unused*/) {
- ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(value);
- return throttle_data->Ref().release();
-}
-
-void destroy_server_name(void* key, void* /*unused*/) { gpr_free(key); }
-
-const grpc_avl_vtable avl_vtable = {
- destroy_server_name, copy_server_name, compare_server_name,
- destroy_server_retry_throttle_data, copy_server_retry_throttle_data};
-
-} // namespace
-
-//
// ServerRetryThrottleMap
//
+using StringToDataMap =
+ std::map<TString, RefCountedPtr<ServerRetryThrottleData>>;
static gpr_mu g_mu;
-static grpc_avl g_avl;
+static StringToDataMap* g_map;
void ServerRetryThrottleMap::Init() {
gpr_mu_init(&g_mu);
- g_avl = grpc_avl_create(&avl_vtable);
+ g_map = new StringToDataMap();
}
void ServerRetryThrottleMap::Shutdown() {
gpr_mu_destroy(&g_mu);
- grpc_avl_unref(g_avl, nullptr);
+ delete g_map;
+ g_map = nullptr;
}
RefCountedPtr<ServerRetryThrottleData> ServerRetryThrottleMap::GetDataForServer(
@@ -170,23 +140,22 @@ RefCountedPtr<ServerRetryThrottleData> ServerRetryThrottleMap::GetDataForServer(
intptr_t milli_token_ratio) {
RefCountedPtr<ServerRetryThrottleData> result;
gpr_mu_lock(&g_mu);
+ auto it = g_map->find(server_name);
ServerRetryThrottleData* throttle_data =
- static_cast<ServerRetryThrottleData*>(
- grpc_avl_get(g_avl, const_cast<char*>(server_name.c_str()), nullptr));
+ it == g_map->end() ? nullptr : it->second.get();
if (throttle_data == nullptr ||
throttle_data->max_milli_tokens() != max_milli_tokens ||
throttle_data->milli_token_ratio() != milli_token_ratio) {
// Entry not found, or found with old parameters. Create a new one.
- result = MakeRefCounted<ServerRetryThrottleData>(
- max_milli_tokens, milli_token_ratio, throttle_data);
- g_avl = grpc_avl_add(g_avl, gpr_strdup(server_name.c_str()),
- result->Ref().release(), nullptr);
- } else {
- // Entry found. Return a new ref to it.
- result = throttle_data->Ref();
+ it = g_map
+ ->emplace(server_name,
+ MakeRefCounted<ServerRetryThrottleData>(
+ max_milli_tokens, milli_token_ratio, throttle_data))
+ .first;
+ throttle_data = it->second.get();
}
gpr_mu_unlock(&g_mu);
- return result;
+ return throttle_data->Ref();
}
} // namespace internal
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
index 6efb9a0a39d..b672c8aa59b 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.cc
@@ -27,7 +27,7 @@
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_join.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
namespace grpc_core {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
index 59b404e6ef8..8bc4daaecfe 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/server_address.h
@@ -128,7 +128,7 @@ class ServerAddressWeightAttribute : public ServerAddress::AttributeInterface {
int Cmp(const AttributeInterface* other) const override {
const auto* other_locality_attr =
static_cast<const ServerAddressWeightAttribute*>(other);
- return GPR_ICMP(weight_, other_locality_attr->weight_);
+ return QsortCompare(weight_, other_locality_attr->weight_);
}
TString ToString() const override {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
index 679c0f572c2..19054299608 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
@@ -19,11 +19,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
+#include "src/core/lib/config/core_configuration.h"
namespace grpc_core {
@@ -36,13 +36,14 @@ class ServiceConfigChannelArgChannelData {
const char* service_config_str = grpc_channel_args_find_string(
args->channel_args, GRPC_ARG_SERVICE_CONFIG);
if (service_config_str != nullptr) {
- grpc_error* service_config_error = GRPC_ERROR_NONE;
+ grpc_error_handle service_config_error = GRPC_ERROR_NONE;
auto service_config = ServiceConfig::Create(
args->channel_args, service_config_str, &service_config_error);
if (service_config_error == GRPC_ERROR_NONE) {
service_config_ = std::move(service_config);
} else {
- gpr_log(GPR_ERROR, "%s", grpc_error_string(service_config_error));
+ gpr_log(GPR_ERROR, "%s",
+ grpc_error_std_string(service_config_error).c_str());
}
GRPC_ERROR_UNREF(service_config_error);
}
@@ -58,26 +59,43 @@ class ServiceConfigChannelArgChannelData {
class ServiceConfigChannelArgCallData {
public:
- ServiceConfigChannelArgCallData(grpc_call_element* elem,
- const grpc_call_element_args* args) {
- ServiceConfigChannelArgChannelData* chand =
- static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
- RefCountedPtr<ServiceConfig> service_config = chand->service_config();
- if (service_config != nullptr) {
- GPR_DEBUG_ASSERT(args->context != nullptr);
- const auto* method_params_vector =
- service_config->GetMethodParsedConfigVector(args->path);
- args->arena->New<ServiceConfigCallData>(
- std::move(service_config), method_params_vector, args->context);
- }
+ ServiceConfigChannelArgCallData(
+ RefCountedPtr<ServiceConfig> service_config,
+ const ServiceConfigParser::ParsedConfigVector* method_config,
+ const grpc_call_element_args* args)
+ : call_context_(args->context),
+ service_config_call_data_(std::move(service_config), method_config,
+ /*call_attributes=*/{}) {
+ GPR_DEBUG_ASSERT(args->context != nullptr);
+ // No need to set the destroy function, since it will be cleaned up
+ // when this filter is destroyed in the filter stack.
+ args->context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value =
+ &service_config_call_data_;
+ }
+
+ ~ServiceConfigChannelArgCallData() {
+ // Remove the entry from call context, just in case anyone above us
+ // tries to look at it during call stack destruction.
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = nullptr;
}
+
+ private:
+ grpc_call_context_element* call_context_;
+ ServiceConfigCallData service_config_call_data_;
};
-grpc_error* ServiceConfigChannelArgInitCallElem(
+grpc_error_handle ServiceConfigChannelArgInitCallElem(
grpc_call_element* elem, const grpc_call_element_args* args) {
- ServiceConfigChannelArgCallData* calld =
- static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
- new (calld) ServiceConfigChannelArgCallData(elem, args);
+ auto* chand =
+ static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
+ auto* calld = static_cast<ServiceConfigChannelArgCallData*>(elem->call_data);
+ RefCountedPtr<ServiceConfig> service_config = chand->service_config();
+ const ServiceConfigParser::ParsedConfigVector* method_config = nullptr;
+ if (service_config != nullptr) {
+ method_config = service_config->GetMethodParsedConfigVector(args->path);
+ }
+ new (calld) ServiceConfigChannelArgCallData(std::move(service_config),
+ method_config, args);
return GRPC_ERROR_NONE;
}
@@ -89,7 +107,7 @@ void ServiceConfigChannelArgDestroyCallElem(
calld->~ServiceConfigChannelArgCallData();
}
-grpc_error* ServiceConfigChannelArgInitChannelElem(
+grpc_error_handle ServiceConfigChannelArgInitChannelElem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
ServiceConfigChannelArgChannelData* chand =
static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
@@ -116,27 +134,23 @@ const grpc_channel_filter ServiceConfigChannelArgFilter = {
grpc_channel_next_get_info,
"service_config_channel_arg"};
-bool maybe_add_service_config_channel_arg_filter(
- grpc_channel_stack_builder* builder, void* /* arg */) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (grpc_channel_args_want_minimal_stack(channel_args) ||
- grpc_channel_args_find_string(channel_args, GRPC_ARG_SERVICE_CONFIG) ==
- nullptr) {
- return true;
- }
- return grpc_channel_stack_builder_prepend_filter(
- builder, &ServiceConfigChannelArgFilter, nullptr, nullptr);
-}
-
} // namespace
-} // namespace grpc_core
-
-void grpc_service_config_channel_arg_filter_init(void) {
- grpc_channel_init_register_stage(
+void RegisterServiceConfigChannelArgFilter(
+ CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_core::maybe_add_service_config_channel_arg_filter, nullptr);
+ [](grpc_channel_stack_builder* builder) {
+ const grpc_channel_args* channel_args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ if (grpc_channel_args_want_minimal_stack(channel_args) ||
+ grpc_channel_args_find_string(channel_args,
+ GRPC_ARG_SERVICE_CONFIG) == nullptr) {
+ return true;
+ }
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &ServiceConfigChannelArgFilter, nullptr, nullptr);
+ });
}
-void grpc_service_config_channel_arg_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
index 50738085f5b..1d9078cce2e 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.cc
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
@@ -34,23 +32,22 @@
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/health/health_check_client.h"
#include "src/core/ext/filters/client_channel/proxy_mapper_registry.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/transport/status_metadata.h"
@@ -131,7 +128,7 @@ size_t ConnectedSubchannel::GetInitialCallSizeEstimate() const {
//
RefCountedPtr<SubchannelCall> SubchannelCall::Create(Args args,
- grpc_error** error) {
+ grpc_error_handle* error) {
const size_t allocation_size =
args.connected_subchannel->GetInitialCallSizeEstimate();
Arena* arena = args.arena;
@@ -139,7 +136,7 @@ RefCountedPtr<SubchannelCall> SubchannelCall::Create(Args args,
arena->Alloc(allocation_size)) SubchannelCall(std::move(args), error));
}
-SubchannelCall::SubchannelCall(Args args, grpc_error** error)
+SubchannelCall::SubchannelCall(Args args, grpc_error_handle* error)
: connected_subchannel_(std::move(args.connected_subchannel)),
deadline_(args.deadline) {
grpc_call_stack* callstk = SUBCHANNEL_CALL_TO_CALL_STACK(this);
@@ -156,8 +153,7 @@ SubchannelCall::SubchannelCall(Args args, grpc_error** error)
*error = grpc_call_stack_init(connected_subchannel_->channel_stack(), 1,
SubchannelCall::Destroy, this, &call_args);
if (GPR_UNLIKELY(*error != GRPC_ERROR_NONE)) {
- const char* error_string = grpc_error_string(*error);
- gpr_log(GPR_ERROR, "error: %s", error_string);
+ gpr_log(GPR_ERROR, "error: %s", grpc_error_std_string(*error).c_str());
return;
}
grpc_call_stack_set_pollset_or_pollset_set(callstk, args.pollent);
@@ -192,8 +188,8 @@ RefCountedPtr<SubchannelCall> SubchannelCall::Ref() {
return RefCountedPtr<SubchannelCall>(this);
}
-RefCountedPtr<SubchannelCall> SubchannelCall::Ref(
- const grpc_core::DebugLocation& location, const char* reason) {
+RefCountedPtr<SubchannelCall> SubchannelCall::Ref(const DebugLocation& location,
+ const char* reason) {
IncrementRefCount(location, reason);
return RefCountedPtr<SubchannelCall>(this);
}
@@ -207,7 +203,7 @@ void SubchannelCall::Unref(const DebugLocation& /*location*/,
GRPC_CALL_STACK_UNREF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason);
}
-void SubchannelCall::Destroy(void* arg, grpc_error* /*error*/) {
+void SubchannelCall::Destroy(void* arg, grpc_error_handle /*error*/) {
GPR_TIMER_SCOPE("subchannel_call_destroy", 0);
SubchannelCall* self = static_cast<SubchannelCall*>(arg);
// Keep some members before destroying the subchannel call.
@@ -252,13 +248,13 @@ namespace {
// Sets *status based on the rest of the parameters.
void GetCallStatus(grpc_status_code* status, grpc_millis deadline,
- grpc_metadata_batch* md_batch, grpc_error* error) {
+ grpc_metadata_batch* md_batch, grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
grpc_error_get_status(error, deadline, status, nullptr, nullptr, nullptr);
} else {
- if (md_batch->idx.named.grpc_status != nullptr) {
+ if (md_batch->legacy_index()->named.grpc_status != nullptr) {
*status = grpc_get_status_code_from_metadata(
- md_batch->idx.named.grpc_status->md);
+ md_batch->legacy_index()->named.grpc_status->md);
} else {
*status = GRPC_STATUS_UNKNOWN;
}
@@ -268,7 +264,8 @@ void GetCallStatus(grpc_status_code* status, grpc_millis deadline,
} // namespace
-void SubchannelCall::RecvTrailingMetadataReady(void* arg, grpc_error* error) {
+void SubchannelCall::RecvTrailingMetadataReady(void* arg,
+ grpc_error_handle error) {
SubchannelCall* call = static_cast<SubchannelCall*>(arg);
GPR_ASSERT(call->recv_trailing_metadata_ != nullptr);
grpc_status_code status = GRPC_STATUS_OK;
@@ -290,8 +287,8 @@ void SubchannelCall::IncrementRefCount() {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), "");
}
-void SubchannelCall::IncrementRefCount(
- const grpc_core::DebugLocation& /*location*/, const char* reason) {
+void SubchannelCall::IncrementRefCount(const DebugLocation& /*location*/,
+ const char* reason) {
GRPC_CALL_STACK_REF(SUBCHANNEL_CALL_TO_CALL_STACK(this), reason);
}
@@ -319,11 +316,12 @@ class Subchannel::ConnectedSubchannelStateWatcher
case GRPC_CHANNEL_TRANSIENT_FAILURE:
case GRPC_CHANNEL_SHUTDOWN: {
if (!c->disconnected_ && c->connected_subchannel_ != nullptr) {
- if (grpc_trace_subchannel.enabled()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
gpr_log(GPR_INFO,
- "Connected subchannel %p of subchannel %p has gone into "
+ "subchannel %p %s: Connected subchannel %p has gone into "
"%s. Attempting to reconnect.",
- c->connected_subchannel_.get(), c,
+ c, c->key_.ToString().c_str(),
+ c->connected_subchannel_.get(),
ConnectivityStateName(new_state));
}
c->connected_subchannel_.reset();
@@ -363,19 +361,13 @@ class Subchannel::AsyncWatcherNotifierLocked {
public:
AsyncWatcherNotifierLocked(
RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher,
- Subchannel* subchannel, grpc_connectivity_state state,
- const y_absl::Status& status)
+ grpc_connectivity_state state, const y_absl::Status& status)
: watcher_(std::move(watcher)) {
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
- if (state == GRPC_CHANNEL_READY) {
- connected_subchannel = subchannel->connected_subchannel_;
- }
- watcher_->PushConnectivityStateChange(
- {state, status, std::move(connected_subchannel)});
+ watcher_->PushConnectivityStateChange({state, status});
ExecCtx::Run(DEBUG_LOCATION,
GRPC_CLOSURE_INIT(
&closure_,
- [](void* arg, grpc_error* /*error*/) {
+ [](void* arg, grpc_error_handle /*error*/) {
auto* self =
static_cast<AsyncWatcherNotifierLocked*>(arg);
self->watcher_->OnConnectivityStateChange();
@@ -405,10 +397,9 @@ void Subchannel::ConnectivityStateWatcherList::RemoveWatcherLocked(
}
void Subchannel::ConnectivityStateWatcherList::NotifyLocked(
- Subchannel* subchannel, grpc_connectivity_state state,
- const y_absl::Status& status) {
+ grpc_connectivity_state state, const y_absl::Status& status) {
for (const auto& p : watchers_) {
- new AsyncWatcherNotifierLocked(p.second, subchannel, state, status);
+ new AsyncWatcherNotifierLocked(p.second, state, status);
}
}
@@ -446,8 +437,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
grpc_connectivity_state initial_state,
RefCountedPtr<Subchannel::ConnectivityStateWatcherInterface> watcher) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, subchannel_.get(), state_,
- status_);
+ new AsyncWatcherNotifierLocked(watcher, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
}
@@ -469,14 +459,14 @@ class Subchannel::HealthWatcherMap::HealthWatcher
if (state_ != GRPC_CHANNEL_CONNECTING) {
state_ = GRPC_CHANNEL_CONNECTING;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), state_, status);
+ watcher_list_.NotifyLocked(state_, status);
}
// If we've become connected, start health checking.
StartHealthCheckingLocked();
} else {
state_ = state;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), state_, status);
+ watcher_list_.NotifyLocked(state_, status);
// We're not connected, so stop health checking.
health_check_client_.reset();
}
@@ -495,7 +485,7 @@ class Subchannel::HealthWatcherMap::HealthWatcher
if (new_state != GRPC_CHANNEL_SHUTDOWN && health_check_client_ != nullptr) {
state_ = new_state;
status_ = status;
- watcher_list_.NotifyLocked(subchannel_.get(), new_state, status);
+ watcher_list_.NotifyLocked(new_state, status);
}
}
@@ -655,42 +645,39 @@ Subchannel::Subchannel(SubchannelKey key,
GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel_refcount) ? "Subchannel"
: nullptr),
key_(std::move(key)),
+ pollset_set_(grpc_pollset_set_create()),
connector_(std::move(connector)),
backoff_(ParseArgsForBackoffValues(args, &min_connect_timeout_ms_)) {
GRPC_STATS_INC_CLIENT_SUBCHANNELS_CREATED();
- pollset_set_ = grpc_pollset_set_create();
- grpc_resolved_address* addr =
- static_cast<grpc_resolved_address*>(gpr_malloc(sizeof(*addr)));
- GetAddressFromSubchannelAddressArg(args, addr);
+ GRPC_CLOSURE_INIT(&on_connecting_finished_, OnConnectingFinished, this,
+ grpc_schedule_on_exec_ctx);
+ // Check proxy mapper to determine address to connect to and channel
+ // args to use.
+ address_for_connect_ = key_.address();
grpc_resolved_address* new_address = nullptr;
grpc_channel_args* new_args = nullptr;
- if (ProxyMapperRegistry::MapAddress(*addr, args, &new_address, &new_args)) {
+ if (ProxyMapperRegistry::MapAddress(address_for_connect_, args, &new_address,
+ &new_args)) {
GPR_ASSERT(new_address != nullptr);
- gpr_free(addr);
- addr = new_address;
+ address_for_connect_ = *new_address;
+ gpr_free(new_address);
}
- static const char* keys_to_remove[] = {GRPC_ARG_SUBCHANNEL_ADDRESS};
- grpc_arg new_arg = CreateSubchannelAddressArg(addr);
- gpr_free(addr);
- args_ = grpc_channel_args_copy_and_add_and_remove(
- new_args != nullptr ? new_args : args, keys_to_remove,
- GPR_ARRAY_SIZE(keys_to_remove), &new_arg, 1);
- gpr_free(new_arg.value.string);
- if (new_args != nullptr) grpc_channel_args_destroy(new_args);
- GRPC_CLOSURE_INIT(&on_connecting_finished_, OnConnectingFinished, this,
- grpc_schedule_on_exec_ctx);
- const grpc_arg* arg = grpc_channel_args_find(args_, GRPC_ARG_ENABLE_CHANNELZ);
- const bool channelz_enabled =
- grpc_channel_arg_get_bool(arg, GRPC_ENABLE_CHANNELZ_DEFAULT);
- arg = grpc_channel_args_find(
- args_, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE);
- const grpc_integer_options options = {
- GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0, INT_MAX};
- size_t channel_tracer_max_memory =
- static_cast<size_t>(grpc_channel_arg_get_integer(arg, options));
+ if (new_args != nullptr) {
+ args_ = new_args;
+ } else {
+ args_ = grpc_channel_args_copy(args);
+ }
+ // Initialize channelz.
+ const bool channelz_enabled = grpc_channel_args_find_bool(
+ args_, GRPC_ARG_ENABLE_CHANNELZ, GRPC_ENABLE_CHANNELZ_DEFAULT);
if (channelz_enabled) {
+ const size_t channel_tracer_max_memory =
+ static_cast<size_t>(grpc_channel_args_find_integer(
+ args_, GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE,
+ {GRPC_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE_DEFAULT, 0,
+ INT_MAX}));
channelz_node_ = MakeRefCounted<channelz::SubchannelNode>(
- GetTargetAddress(), channel_tracer_max_memory);
+ grpc_sockaddr_to_uri(&key_.address()), channel_tracer_max_memory);
channelz_node_->AddTraceEvent(
channelz::ChannelTrace::Severity::Info,
grpc_slice_from_static_string("subchannel created"));
@@ -711,8 +698,8 @@ Subchannel::~Subchannel() {
RefCountedPtr<Subchannel> Subchannel::Create(
OrphanablePtr<SubchannelConnector> connector,
- const grpc_channel_args* args) {
- SubchannelKey key(args);
+ const grpc_resolved_address& address, const grpc_channel_args* args) {
+ SubchannelKey key(address, args);
SubchannelPoolInterface* subchannel_pool =
SubchannelPoolInterface::GetSubchannelPoolFromChannelArgs(args);
GPR_ASSERT(subchannel_pool != nullptr);
@@ -736,9 +723,9 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
// Only update the value if the new keepalive time is larger.
if (new_keepalive_time > keepalive_time_) {
keepalive_time_ = new_keepalive_time;
- if (grpc_trace_subchannel.enabled()) {
- gpr_log(GPR_INFO, "Subchannel=%p: Throttling keepalive time to %d", this,
- new_keepalive_time);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
+ gpr_log(GPR_INFO, "subchannel %p %s: throttling keepalive time to %d",
+ this, key_.ToString().c_str(), new_keepalive_time);
}
const grpc_arg arg_to_add = grpc_channel_arg_integer_create(
const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS), new_keepalive_time);
@@ -750,33 +737,18 @@ void Subchannel::ThrottleKeepaliveTime(int new_keepalive_time) {
}
}
-const char* Subchannel::GetTargetAddress() {
- const grpc_arg* addr_arg =
- grpc_channel_args_find(args_, GRPC_ARG_SUBCHANNEL_ADDRESS);
- const char* addr_str = grpc_channel_arg_get_string(addr_arg);
- GPR_ASSERT(addr_str != nullptr); // Should have been set by LB policy.
- return addr_str;
-}
-
channelz::SubchannelNode* Subchannel::channelz_node() {
return channelz_node_.get();
}
grpc_connectivity_state Subchannel::CheckConnectivityState(
- const y_absl::optional<TString>& health_check_service_name,
- RefCountedPtr<ConnectedSubchannel>* connected_subchannel) {
+ const y_absl::optional<TString>& health_check_service_name) {
MutexLock lock(&mu_);
- grpc_connectivity_state state;
- if (!health_check_service_name.has_value()) {
- state = state_;
- } else {
- state = health_watcher_map_.CheckConnectivityStateLocked(
+ if (health_check_service_name.has_value()) {
+ return health_watcher_map_.CheckConnectivityStateLocked(
this, *health_check_service_name);
}
- if (connected_subchannel != nullptr && state == GRPC_CHANNEL_READY) {
- *connected_subchannel = connected_subchannel_;
- }
- return state;
+ return state_;
}
void Subchannel::WatchConnectivityState(
@@ -790,7 +762,7 @@ void Subchannel::WatchConnectivityState(
}
if (!health_check_service_name.has_value()) {
if (state_ != initial_state) {
- new AsyncWatcherNotifierLocked(watcher, this, state_, status_);
+ new AsyncWatcherNotifierLocked(watcher, state_, status_);
}
watcher_list_.AddWatcherLocked(std::move(watcher));
} else {
@@ -848,44 +820,6 @@ void Subchannel::Orphan() {
health_watcher_map_.ShutdownLocked();
}
-grpc_arg Subchannel::CreateSubchannelAddressArg(
- const grpc_resolved_address* addr) {
- return grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_SUBCHANNEL_ADDRESS),
- gpr_strdup(addr->len > 0 ? grpc_sockaddr_to_uri(addr).c_str() : ""));
-}
-
-const char* Subchannel::GetUriFromSubchannelAddressArg(
- const grpc_channel_args* args) {
- const grpc_arg* addr_arg =
- grpc_channel_args_find(args, GRPC_ARG_SUBCHANNEL_ADDRESS);
- const char* addr_str = grpc_channel_arg_get_string(addr_arg);
- GPR_ASSERT(addr_str != nullptr); // Should have been set by LB policy.
- return addr_str;
-}
-
-namespace {
-
-void UriToSockaddr(const char* uri_str, grpc_resolved_address* addr) {
- y_absl::StatusOr<URI> uri = URI::Parse(uri_str);
- if (!uri.ok()) {
- gpr_log(GPR_ERROR, "%s", uri.status().ToString().c_str());
- GPR_ASSERT(uri.ok());
- }
- if (!grpc_parse_uri(*uri, addr)) memset(addr, 0, sizeof(*addr));
-}
-
-} // namespace
-
-void Subchannel::GetAddressFromSubchannelAddressArg(
- const grpc_channel_args* args, grpc_resolved_address* addr) {
- const char* addr_uri_str = GetUriFromSubchannelAddressArg(args);
- memset(addr, 0, sizeof(*addr));
- if (*addr_uri_str != '\0') {
- UriToSockaddr(addr_uri_str, addr);
- }
-}
-
namespace {
// Returns a string indicating the subchannel's connectivity state change to
@@ -922,7 +856,7 @@ void Subchannel::SetConnectivityStateLocked(grpc_connectivity_state state,
SubchannelConnectivityStateChangeString(state)));
}
// Notify non-health watchers.
- watcher_list_.NotifyLocked(this, state, status);
+ watcher_list_.NotifyLocked(state, status);
// Notify health watchers.
health_watcher_map_.NotifyLocked(state, status);
}
@@ -952,10 +886,11 @@ void Subchannel::MaybeStartConnectingLocked() {
const grpc_millis time_til_next =
next_attempt_deadline_ - ExecCtx::Get()->Now();
if (time_til_next <= 0) {
- gpr_log(GPR_INFO, "Subchannel %p: Retry immediately", this);
+ gpr_log(GPR_INFO, "subchannel %p %s: Retry immediately", this,
+ key_.ToString().c_str());
} else {
- gpr_log(GPR_INFO, "Subchannel %p: Retry in %" PRId64 " milliseconds",
- this, time_til_next);
+ gpr_log(GPR_INFO, "subchannel %p %s: Retry in %" PRId64 " milliseconds",
+ this, key_.ToString().c_str(), time_til_next);
}
GRPC_CLOSURE_INIT(&on_retry_alarm_, OnRetryAlarm, this,
grpc_schedule_on_exec_ctx);
@@ -963,7 +898,7 @@ void Subchannel::MaybeStartConnectingLocked() {
}
}
-void Subchannel::OnRetryAlarm(void* arg, grpc_error* error) {
+void Subchannel::OnRetryAlarm(void* arg, grpc_error_handle error) {
WeakRefCountedPtr<Subchannel> c(static_cast<Subchannel*>(arg));
MutexLock lock(&c->mu_);
c->have_retry_alarm_ = false;
@@ -974,10 +909,12 @@ void Subchannel::OnRetryAlarm(void* arg, grpc_error* error) {
c->retry_immediately_ = false;
error = GRPC_ERROR_NONE;
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
if (error == GRPC_ERROR_NONE) {
- gpr_log(GPR_INFO, "Failed to connect to channel, retrying");
+ gpr_log(GPR_INFO,
+ "subchannel %p %s: failed to connect to channel, retrying", c.get(),
+ c->key_.ToString().c_str());
c->ContinueConnectingLocked();
// Still connecting, keep ref around. Note that this stolen ref won't
// be dropped without first acquiring c->mu_.
@@ -988,6 +925,7 @@ void Subchannel::OnRetryAlarm(void* arg, grpc_error* error) {
void Subchannel::ContinueConnectingLocked() {
SubchannelConnector::Args args;
+ args.address = &address_for_connect_;
args.interested_parties = pollset_set_;
const grpc_millis min_deadline =
min_connect_timeout_ms_ + ExecCtx::Get()->Now();
@@ -998,7 +936,7 @@ void Subchannel::ContinueConnectingLocked() {
connector_->Connect(args, &connecting_result_, &on_connecting_finished_);
}
-void Subchannel::OnConnectingFinished(void* arg, grpc_error* error) {
+void Subchannel::OnConnectingFinished(void* arg, grpc_error_handle error) {
WeakRefCountedPtr<Subchannel> c(static_cast<Subchannel*>(arg));
const grpc_channel_args* delete_channel_args =
c->connecting_result_.channel_args;
@@ -1009,7 +947,8 @@ void Subchannel::OnConnectingFinished(void* arg, grpc_error* error) {
c->PublishTransportLocked()) {
// Do nothing, transport was published.
} else if (!c->disconnected_) {
- gpr_log(GPR_INFO, "Connect failed: %s", grpc_error_string(error));
+ gpr_log(GPR_INFO, "subchannel %p %s: connect failed: %s", c.get(),
+ c->key_.ToString().c_str(), grpc_error_std_string(error).c_str());
c->SetConnectivityStateLocked(GRPC_CHANNEL_TRANSIENT_FAILURE,
grpc_error_to_absl_status(error));
}
@@ -1020,7 +959,7 @@ void Subchannel::OnConnectingFinished(void* arg, grpc_error* error) {
namespace {
-void ConnectionDestroy(void* arg, grpc_error* /*error*/) {
+void ConnectionDestroy(void* arg, grpc_error_handle /*error*/) {
grpc_channel_stack* stk = static_cast<grpc_channel_stack*>(arg);
grpc_channel_stack_destroy(stk);
gpr_free(stk);
@@ -1035,18 +974,20 @@ bool Subchannel::PublishTransportLocked() {
builder, connecting_result_.channel_args);
grpc_channel_stack_builder_set_transport(builder,
connecting_result_.transport);
- if (!grpc_channel_init_create_stack(builder, GRPC_CLIENT_SUBCHANNEL)) {
+ if (!CoreConfiguration::Get().channel_init().CreateStack(
+ builder, GRPC_CLIENT_SUBCHANNEL)) {
grpc_channel_stack_builder_destroy(builder);
return false;
}
grpc_channel_stack* stk;
- grpc_error* error = grpc_channel_stack_builder_finish(
+ grpc_error_handle error = grpc_channel_stack_builder_finish(
builder, 0, 1, ConnectionDestroy, nullptr,
reinterpret_cast<void**>(&stk));
if (error != GRPC_ERROR_NONE) {
grpc_transport_destroy(connecting_result_.transport);
- gpr_log(GPR_ERROR, "error initializing subchannel stack: %s",
- grpc_error_string(error));
+ gpr_log(GPR_ERROR,
+ "subchannel %p %s: error initializing subchannel stack: %s", this,
+ key_.ToString().c_str(), grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return false;
}
@@ -1061,8 +1002,10 @@ bool Subchannel::PublishTransportLocked() {
// Publish.
connected_subchannel_.reset(
new ConnectedSubchannel(stk, args_, channelz_node_));
- gpr_log(GPR_INFO, "New connected subchannel at %p for subchannel %p",
- connected_subchannel_.get(), this);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_subchannel)) {
+ gpr_log(GPR_INFO, "subchannel %p %s: new connected subchannel at %p", this,
+ key_.ToString().c_str(), connected_subchannel_.get());
+ }
if (channelz_node_ != nullptr) {
channelz_node_->SetChildSocket(std::move(socket));
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
index 0bca09c8b34..7fdbe0f1ec9 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
@@ -39,9 +37,6 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata.h"
-// Channel arg containing a URI indicating the address to connect to.
-#define GRPC_ARG_SUBCHANNEL_ADDRESS "grpc.subchannel_address"
-
namespace grpc_core {
class SubchannelCall;
@@ -87,7 +82,8 @@ class SubchannelCall {
grpc_call_context_element* context;
CallCombiner* call_combiner;
};
- static RefCountedPtr<SubchannelCall> Create(Args args, grpc_error** error);
+ static RefCountedPtr<SubchannelCall> Create(Args args,
+ grpc_error_handle* error);
// Continues processing a transport stream op batch.
void StartTransportStreamOpBatch(grpc_transport_stream_op_batch* batch);
@@ -113,20 +109,20 @@ class SubchannelCall {
template <typename T>
friend class RefCountedPtr;
- SubchannelCall(Args args, grpc_error** error);
+ SubchannelCall(Args args, grpc_error_handle* error);
// If channelz is enabled, intercepts recv_trailing so that we may check the
// status and associate it to a subchannel.
void MaybeInterceptRecvTrailingMetadata(
grpc_transport_stream_op_batch* batch);
- static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
// Interface of RefCounted<>.
void IncrementRefCount();
void IncrementRefCount(const DebugLocation& location, const char* reason);
- static void Destroy(void* arg, grpc_error* error);
+ static void Destroy(void* arg, grpc_error_handle error);
RefCountedPtr<ConnectedSubchannel> connected_subchannel_;
grpc_closure* after_call_stack_destroy_ = nullptr;
@@ -152,7 +148,6 @@ class Subchannel : public DualRefCounted<Subchannel> {
struct ConnectivityStateChange {
grpc_connectivity_state state;
y_absl::Status status;
- RefCountedPtr<ConnectedSubchannel> connected_subchannel;
};
~ConnectivityStateWatcherInterface() override = default;
@@ -189,10 +184,10 @@ class Subchannel : public DualRefCounted<Subchannel> {
Y_ABSL_GUARDED_BY(&mu_);
};
- // Creates a subchannel given \a connector and \a args.
+ // Creates a subchannel.
static RefCountedPtr<Subchannel> Create(
OrphanablePtr<SubchannelConnector> connector,
- const grpc_channel_args* args);
+ const grpc_resolved_address& address, const grpc_channel_args* args);
// The ctor and dtor are not intended to use directly.
Subchannel(SubchannelKey key, OrphanablePtr<SubchannelConnector> connector,
@@ -204,10 +199,6 @@ class Subchannel : public DualRefCounted<Subchannel> {
// will have an affect when the subchannel creates a new ConnectedSubchannel.
void ThrottleKeepaliveTime(int new_keepalive_time) Y_ABSL_LOCKS_EXCLUDED(mu_);
- // Gets the string representing the subchannel address.
- // Caller doesn't take ownership.
- const char* GetTargetAddress();
-
const grpc_channel_args* channel_args() const { return args_; }
channelz::SubchannelNode* channelz_node();
@@ -216,10 +207,8 @@ class Subchannel : public DualRefCounted<Subchannel> {
// If health_check_service_name is non-null, the returned connectivity
// state will be based on the state reported by the backend for that
// service name.
- // If the return value is GRPC_CHANNEL_READY, also sets *connected_subchannel.
grpc_connectivity_state CheckConnectivityState(
- const y_absl::optional<TString>& health_check_service_name,
- RefCountedPtr<ConnectedSubchannel>* connected_subchannel)
+ const y_absl::optional<TString>& health_check_service_name)
Y_ABSL_LOCKS_EXCLUDED(mu_);
// Starts watching the subchannel's connectivity state.
@@ -242,31 +231,21 @@ class Subchannel : public DualRefCounted<Subchannel> {
const y_absl::optional<TString>& health_check_service_name,
ConnectivityStateWatcherInterface* watcher) Y_ABSL_LOCKS_EXCLUDED(mu_);
+ RefCountedPtr<ConnectedSubchannel> connected_subchannel()
+ Y_ABSL_LOCKS_EXCLUDED(mu_) {
+ MutexLock lock(&mu_);
+ return connected_subchannel_;
+ }
+
// Attempt to connect to the backend. Has no effect if already connected.
void AttemptToConnect() Y_ABSL_LOCKS_EXCLUDED(mu_);
// Resets the connection backoff of the subchannel.
- // TODO(roth): Move connection backoff out of subchannels and up into LB
- // policy code (probably by adding a SubchannelGroup between
- // SubchannelList and SubchannelData), at which point this method can
- // go away.
void ResetBackoff() Y_ABSL_LOCKS_EXCLUDED(mu_);
// Tears down any existing connection, and arranges for destruction
void Orphan() override Y_ABSL_LOCKS_EXCLUDED(mu_);
- // Returns a new channel arg encoding the subchannel address as a URI
- // string. Caller is responsible for freeing the string.
- static grpc_arg CreateSubchannelAddressArg(const grpc_resolved_address* addr);
-
- // Returns the URI string from the subchannel address arg in \a args.
- static const char* GetUriFromSubchannelAddressArg(
- const grpc_channel_args* args);
-
- // Sets \a addr from the subchannel address arg in \a args.
- static void GetAddressFromSubchannelAddressArg(const grpc_channel_args* args,
- grpc_resolved_address* addr);
-
private:
// A linked list of ConnectivityStateWatcherInterfaces that are monitoring
// the subchannel's state.
@@ -279,7 +258,7 @@ class Subchannel : public DualRefCounted<Subchannel> {
void RemoveWatcherLocked(ConnectivityStateWatcherInterface* watcher);
// Notifies all watchers in the list about a change to state.
- void NotifyLocked(Subchannel* subchannel, grpc_connectivity_state state,
+ void NotifyLocked(grpc_connectivity_state state,
const y_absl::Status& status);
void Clear() { watchers_.clear(); }
@@ -340,18 +319,20 @@ class Subchannel : public DualRefCounted<Subchannel> {
// Methods for connection.
void MaybeStartConnectingLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- static void OnRetryAlarm(void* arg, grpc_error* error)
+ static void OnRetryAlarm(void* arg, grpc_error_handle error)
Y_ABSL_LOCKS_EXCLUDED(mu_);
void ContinueConnectingLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- static void OnConnectingFinished(void* arg, grpc_error* error)
+ static void OnConnectingFinished(void* arg, grpc_error_handle error)
Y_ABSL_LOCKS_EXCLUDED(mu_);
bool PublishTransportLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
// The subchannel pool this subchannel is in.
RefCountedPtr<SubchannelPoolInterface> subchannel_pool_;
- // TODO(juanlishen): Consider using args_ as key_ directly.
// Subchannel key that identifies this subchannel in the subchannel pool.
const SubchannelKey key_;
+ // Actual address to connect to. May be different than the address in
+ // key_ if overridden by proxy mapper.
+ grpc_resolved_address address_for_connect_;
// Channel args.
grpc_channel_args* args_;
// pollset_set tracking who's interested in a connection being setup.
@@ -398,4 +379,4 @@ class Subchannel : public DualRefCounted<Subchannel> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H */
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
index 308541c5309..409d6c33151 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.cc
@@ -20,10 +20,11 @@
#include "src/core/ext/filters/client_channel/subchannel_pool_interface.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/useful.h"
// The subchannel pool to reuse subchannels.
-#define GRPC_ARG_SUBCHANNEL_POOL "grpc.subchannel_pool"
+#define GRPC_ARG_SUBCHANNEL_POOL "grpc.internal.subchannel_pool"
// The subchannel key ID that is only used in test to make each key unique.
#define GRPC_ARG_SUBCHANNEL_KEY_TEST_ONLY_ID "grpc.subchannel_key_test_only_id"
@@ -31,8 +32,9 @@ namespace grpc_core {
TraceFlag grpc_subchannel_pool_trace(false, "subchannel_pool");
-SubchannelKey::SubchannelKey(const grpc_channel_args* args) {
- Init(args, grpc_channel_args_normalize);
+SubchannelKey::SubchannelKey(const grpc_resolved_address& address,
+ const grpc_channel_args* args) {
+ Init(address, args, grpc_channel_args_normalize);
}
SubchannelKey::~SubchannelKey() {
@@ -40,7 +42,7 @@ SubchannelKey::~SubchannelKey() {
}
SubchannelKey::SubchannelKey(const SubchannelKey& other) {
- Init(other.args_, grpc_channel_args_copy);
+ Init(other.address_, other.args_, grpc_channel_args_copy);
}
SubchannelKey& SubchannelKey::operator=(const SubchannelKey& other) {
@@ -48,31 +50,44 @@ SubchannelKey& SubchannelKey::operator=(const SubchannelKey& other) {
return *this;
}
grpc_channel_args_destroy(const_cast<grpc_channel_args*>(args_));
- Init(other.args_, grpc_channel_args_copy);
+ Init(other.address_, other.args_, grpc_channel_args_copy);
return *this;
}
SubchannelKey::SubchannelKey(SubchannelKey&& other) noexcept {
+ address_ = other.address_;
args_ = other.args_;
other.args_ = nullptr;
}
SubchannelKey& SubchannelKey::operator=(SubchannelKey&& other) noexcept {
+ address_ = other.address_;
args_ = other.args_;
other.args_ = nullptr;
return *this;
}
bool SubchannelKey::operator<(const SubchannelKey& other) const {
+ if (address_.len < other.address_.len) return true;
+ if (address_.len > other.address_.len) return false;
+ int r = memcmp(address_.addr, other.address_.addr, address_.len);
+ if (r < 0) return true;
+ if (r > 0) return false;
return grpc_channel_args_compare(args_, other.args_) < 0;
}
void SubchannelKey::Init(
- const grpc_channel_args* args,
+ const grpc_resolved_address& address, const grpc_channel_args* args,
grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args)) {
+ address_ = address;
args_ = copy_channel_args(args);
}
+TString SubchannelKey::ToString() const {
+ return y_absl::StrCat("{address=", grpc_sockaddr_to_uri(&address_),
+ ", args=", grpc_channel_args_string(args_), "}");
+}
+
namespace {
void* arg_copy(void* p) {
@@ -86,7 +101,7 @@ void arg_destroy(void* p) {
subchannel_pool->Unref();
}
-int arg_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+int arg_cmp(void* a, void* b) { return QsortCompare(a, b); }
const grpc_arg_pointer_vtable subchannel_pool_arg_vtable = {
arg_copy, arg_destroy, arg_cmp};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
index 8a8a0cb6934..e5e341716ce 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
+++ b/contrib/libs/grpc/src/core/ext/filters/client_channel/subchannel_pool_interface.h
@@ -25,6 +25,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/iomgr/resolve_address.h"
namespace grpc_core {
@@ -35,7 +36,8 @@ extern TraceFlag grpc_subchannel_pool_trace;
// A key that can uniquely identify a subchannel.
class SubchannelKey {
public:
- explicit SubchannelKey(const grpc_channel_args* args);
+ SubchannelKey(const grpc_resolved_address& address,
+ const grpc_channel_args* args);
~SubchannelKey();
// Copyable.
@@ -47,13 +49,20 @@ class SubchannelKey {
bool operator<(const SubchannelKey& other) const;
+ const grpc_resolved_address& address() const { return address_; }
+ const grpc_channel_args* args() const { return args_; }
+
+ // Human-readable string suitable for logging.
+ TString ToString() const;
+
private:
// Initializes the subchannel key with the given \a args and the function to
// copy channel args.
void Init(
- const grpc_channel_args* args,
+ const grpc_resolved_address& address, const grpc_channel_args* args,
grpc_channel_args* (*copy_channel_args)(const grpc_channel_args* args));
+ grpc_resolved_address address_;
const grpc_channel_args* args_;
};
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc b/contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
index e39dda4dd90..6cd3d12ec70 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/client_idle/client_idle_filter.cc
@@ -20,11 +20,13 @@
#include <limits.h>
+#include <atomic>
+
+#include "src/core/ext/filters/client_idle/idle_filter_state.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/http2_errors.h"
// TODO(juanlishen): The idle filter is disabled in client channel by default
@@ -46,78 +48,8 @@ TraceFlag grpc_trace_client_idle_filter(false, "client_idle_filter");
namespace {
-/*
- client_idle_filter maintains a state tracking if there are active calls in the
- channel and its internal idle_timer_. The states are specified as following:
-
- +--------------------------------------------+-------------+---------+
- | ChannelState | idle_timer_ | channel |
- +--------------------------------------------+-------------+---------+
- | IDLE | unset | idle |
- | CALLS_ACTIVE | unset | busy |
- | TIMER_PENDING | set-valid | idle |
- | TIMER_PENDING_CALLS_ACTIVE | set-invalid | busy |
- | TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START | set-invalid | idle |
- +--------------------------------------------+-------------+---------+
-
- IDLE: The initial state of the client_idle_filter, indicating the channel is
- in IDLE.
-
- CALLS_ACTIVE: The channel has 1 or 1+ active calls and the timer is not set.
-
- TIMER_PENDING: The state after the timer is set and no calls have arrived
- after the timer is set. The channel must have 0 active call in this state. If
- the timer is fired in this state, the channel will go into IDLE state.
-
- TIMER_PENDING_CALLS_ACTIVE: The state after the timer is set and at least one
- call has arrived after the timer is set. The channel must have 1 or 1+ active
- calls in this state. If the timer is fired in this state, we won't reschedule
- it.
-
- TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START: The state after the timer is set
- and at least one call has arrived after the timer is set, BUT the channel
- currently has 0 active call. If the timer is fired in this state, we will
- reschedule it according to the finish time of the latest call.
-
- PROCESSING: The state set to block other threads when the setting thread is
- doing some work to keep state consistency.
-
- idle_timer_ will not be cancelled (unless the channel is shutting down).
- If the timer callback is called when the idle_timer_ is valid (i.e. idle_state
- is TIMER_PENDING), the channel will enter IDLE, otherwise the channel won't be
- changed.
-
- State transitions:
- IDLE
- | ^
- --------------------------------- *
- | *
- v *
- CALLS_ACTIVE =================> TIMER_PENDING
- ^ | ^
- * ------------------------------ *
- * | *
- * v *
-TIMER_PENDING_CALLS_ACTIVE ===> TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START
- ^ |
- | |
- ---------------------------------
-
- ---> Triggered by IncreaseCallCount()
- ===> Triggered by DecreaseCallCount()
- ***> Triggered by IdleTimerCallback()
-*/
-enum ChannelState {
- IDLE,
- CALLS_ACTIVE,
- TIMER_PENDING,
- TIMER_PENDING_CALLS_ACTIVE,
- TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START,
- PROCESSING
-};
-
grpc_millis GetClientIdleTimeout(const grpc_channel_args* args) {
- return GPR_MAX(
+ return std::max(
grpc_channel_arg_get_integer(
grpc_channel_args_find(args, GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS),
{DEFAULT_IDLE_TIMEOUT_MS, 0, INT_MAX}),
@@ -126,8 +58,8 @@ grpc_millis GetClientIdleTimeout(const grpc_channel_args* args) {
class ChannelData {
public:
- static grpc_error* Init(grpc_channel_element* elem,
- grpc_channel_element_args* args);
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
static void Destroy(grpc_channel_element* elem);
static void StartTransportOp(grpc_channel_element* elem,
@@ -139,11 +71,12 @@ class ChannelData {
private:
ChannelData(grpc_channel_element* elem, grpc_channel_element_args* args,
- grpc_error** error);
+ grpc_error_handle* error);
~ChannelData() = default;
- static void IdleTimerCallback(void* arg, grpc_error* error);
- static void IdleTransportOpCompleteCallback(void* arg, grpc_error* error);
+ static void IdleTimerCallback(void* arg, grpc_error_handle error);
+ static void IdleTransportOpCompleteCallback(void* arg,
+ grpc_error_handle error);
void StartIdleTimer();
@@ -157,9 +90,7 @@ class ChannelData {
const grpc_millis client_idle_timeout_;
// Member data used to track the state of channel.
- grpc_millis last_idle_time_;
- Atomic<intptr_t> call_count_{0};
- Atomic<ChannelState> state_{IDLE};
+ IdleFilterState idle_filter_state_{false};
// Idle timer and its callback closure.
grpc_timer idle_timer_;
@@ -170,9 +101,9 @@ class ChannelData {
grpc_closure idle_transport_op_complete_callback_;
};
-grpc_error* ChannelData::Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
- grpc_error* error = GRPC_ERROR_NONE;
+grpc_error_handle ChannelData::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
new (elem->channel_data) ChannelData(elem, args, &error);
return error;
}
@@ -186,7 +117,7 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem,
grpc_transport_op* op) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
// Catch the disconnect_with_error transport op.
- if (op->disconnect_with_error != nullptr) {
+ if (op->disconnect_with_error != GRPC_ERROR_NONE) {
// IncreaseCallCount() introduces a phony call and prevent the timer from
// being reset by other threads.
chand->IncreaseCallCount();
@@ -200,90 +131,19 @@ void ChannelData::StartTransportOp(grpc_channel_element* elem,
}
void ChannelData::IncreaseCallCount() {
- const intptr_t previous_value = call_count_.FetchAdd(1, MemoryOrder::RELAXED);
- GRPC_IDLE_FILTER_LOG("call counter has increased to %" PRIuPTR,
- previous_value + 1);
- if (previous_value == 0) {
- // This call is the one that makes the channel busy.
- // Loop here to make sure the previous decrease operation has finished.
- ChannelState state = state_.Load(MemoryOrder::RELAXED);
- while (true) {
- switch (state) {
- // Timer has not been set. Switch to CALLS_ACTIVE.
- case IDLE:
- // In this case, no other threads will modify the state, so we can
- // just store the value.
- state_.Store(CALLS_ACTIVE, MemoryOrder::RELAXED);
- return;
- // Timer has been set. Switch to TIMER_PENDING_CALLS_ACTIVE.
- case TIMER_PENDING:
- case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START:
- // At this point, the state may have been switched to IDLE by the
- // idle timer callback. Therefore, use CAS operation to change the
- // state atomically.
- // Use MemoryOrder::ACQUIRE on success to ensure last_idle_time_ has
- // been properly set in DecreaseCallCount().
- if (state_.CompareExchangeWeak(&state, TIMER_PENDING_CALLS_ACTIVE,
- MemoryOrder::ACQUIRE,
- MemoryOrder::RELAXED)) {
- return;
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = state_.Load(MemoryOrder::RELAXED);
- break;
- }
- }
- }
+ idle_filter_state_.IncreaseCallCount();
}
void ChannelData::DecreaseCallCount() {
- const intptr_t previous_value = call_count_.FetchSub(1, MemoryOrder::RELAXED);
- GRPC_IDLE_FILTER_LOG("call counter has decreased to %" PRIuPTR,
- previous_value - 1);
- if (previous_value == 1) {
- // This call is the one that makes the channel idle.
- // last_idle_time_ does not need to be Atomic<> because busy-loops in
- // IncreaseCallCount(), DecreaseCallCount() and IdleTimerCallback() will
- // prevent multiple threads from simultaneously accessing this variable.
- last_idle_time_ = ExecCtx::Get()->Now();
- ChannelState state = state_.Load(MemoryOrder::RELAXED);
- while (true) {
- switch (state) {
- // Timer has not been set. Set the timer and switch to TIMER_PENDING
- case CALLS_ACTIVE:
- // Release store here to make other threads see the updated value of
- // last_idle_time_.
- StartIdleTimer();
- state_.Store(TIMER_PENDING, MemoryOrder::RELEASE);
- return;
- // Timer has been set. Switch to
- // TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START
- case TIMER_PENDING_CALLS_ACTIVE:
- // At this point, the state may have been switched to CALLS_ACTIVE by
- // the idle timer callback. Therefore, use CAS operation to change the
- // state atomically.
- // Release store here to make the idle timer callback see the updated
- // value of last_idle_time_ to properly reset the idle timer.
- if (state_.CompareExchangeWeak(
- &state, TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START,
- MemoryOrder::RELEASE, MemoryOrder::RELAXED)) {
- return;
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = state_.Load(MemoryOrder::RELAXED);
- break;
- }
- }
+ if (idle_filter_state_.DecreaseCallCount()) {
+ // If there are no more calls in progress, start the idle timer.
+ StartIdleTimer();
}
}
ChannelData::ChannelData(grpc_channel_element* elem,
grpc_channel_element_args* args,
- grpc_error** /*error*/)
+ grpc_error_handle* /*error*/)
: elem_(elem),
channel_stack_(args->channel_stack),
client_idle_timeout_(GetClientIdleTimeout(args->channel_args)) {
@@ -303,7 +163,7 @@ ChannelData::ChannelData(grpc_channel_element* elem,
grpc_schedule_on_exec_ctx);
}
-void ChannelData::IdleTimerCallback(void* arg, grpc_error* error) {
+void ChannelData::IdleTimerCallback(void* arg, grpc_error_handle error) {
GRPC_IDLE_FILTER_LOG("timer alarms");
ChannelData* chand = static_cast<ChannelData*>(arg);
if (error != GRPC_ERROR_NONE) {
@@ -311,48 +171,17 @@ void ChannelData::IdleTimerCallback(void* arg, grpc_error* error) {
GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "max idle timer callback");
return;
}
- bool finished = false;
- ChannelState state = chand->state_.Load(MemoryOrder::RELAXED);
- while (!finished) {
- switch (state) {
- case TIMER_PENDING:
- // Change the state to PROCESSING to block IncreaseCallCout() until the
- // EnterIdle() operation finishes, preventing mistakenly entering IDLE
- // when active RPC exists.
- finished = chand->state_.CompareExchangeWeak(
- &state, PROCESSING, MemoryOrder::ACQUIRE, MemoryOrder::RELAXED);
- if (finished) {
- chand->EnterIdle();
- chand->state_.Store(IDLE, MemoryOrder::RELAXED);
- }
- break;
- case TIMER_PENDING_CALLS_ACTIVE:
- finished = chand->state_.CompareExchangeWeak(
- &state, CALLS_ACTIVE, MemoryOrder::RELAXED, MemoryOrder::RELAXED);
- break;
- case TIMER_PENDING_CALLS_SEEN_SINCE_TIMER_START:
- // Change the state to PROCESSING to block IncreaseCallCount() until the
- // StartIdleTimer() operation finishes, preventing mistakenly restarting
- // the timer after grpc_timer_cancel() when shutdown.
- finished = chand->state_.CompareExchangeWeak(
- &state, PROCESSING, MemoryOrder::ACQUIRE, MemoryOrder::RELAXED);
- if (finished) {
- chand->StartIdleTimer();
- chand->state_.Store(TIMER_PENDING, MemoryOrder::RELAXED);
- }
- break;
- default:
- // The state has not been switched to desired value yet, try again.
- state = chand->state_.Load(MemoryOrder::RELAXED);
- break;
- }
+ if (chand->idle_filter_state_.CheckTimer()) {
+ chand->StartIdleTimer();
+ } else {
+ chand->EnterIdle();
}
GRPC_IDLE_FILTER_LOG("timer finishes");
GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "max idle timer callback");
}
void ChannelData::IdleTransportOpCompleteCallback(void* arg,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
ChannelData* chand = static_cast<ChannelData*>(arg);
GRPC_CHANNEL_STACK_UNREF(chand->channel_stack_, "idle transport op");
}
@@ -361,7 +190,7 @@ void ChannelData::StartIdleTimer() {
GRPC_IDLE_FILTER_LOG("timer has started");
// Hold a ref to the channel stack for the timer callback.
GRPC_CHANNEL_STACK_REF(channel_stack_, "max idle timer callback");
- grpc_timer_init(&idle_timer_, last_idle_time_ + client_idle_timeout_,
+ grpc_timer_init(&idle_timer_, ExecCtx::Get()->Now() + client_idle_timeout_,
&idle_timer_callback_);
}
@@ -381,15 +210,15 @@ void ChannelData::EnterIdle() {
class CallData {
public:
- static grpc_error* Init(grpc_call_element* elem,
- const grpc_call_element_args* args);
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
static void Destroy(grpc_call_element* elem,
const grpc_call_final_info* final_info,
grpc_closure* then_schedule_closure);
};
-grpc_error* CallData::Init(grpc_call_element* elem,
- const grpc_call_element_args* /*args*/) {
+grpc_error_handle CallData::Init(grpc_call_element* elem,
+ const grpc_call_element_args* /*args*/) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
chand->IncreaseCallCount();
return GRPC_ERROR_NONE;
@@ -415,26 +244,21 @@ const grpc_channel_filter grpc_client_idle_filter = {
grpc_channel_next_get_info,
"client_idle"};
-static bool MaybeAddClientIdleFilter(grpc_channel_stack_builder* builder,
- void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (!grpc_channel_args_want_minimal_stack(channel_args) &&
- GetClientIdleTimeout(channel_args) != INT_MAX) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_client_idle_filter, nullptr, nullptr);
- } else {
- return true;
- }
-}
-
} // namespace
-} // namespace grpc_core
-void grpc_client_idle_filter_init(void) {
- grpc_channel_init_register_stage(
+void RegisterClientIdleFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_core::MaybeAddClientIdleFilter, nullptr);
+ [](grpc_channel_stack_builder* builder) {
+ const grpc_channel_args* channel_args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ if (!grpc_channel_args_want_minimal_stack(channel_args) &&
+ GetClientIdleTimeout(channel_args) != INT_MAX) {
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &grpc_client_idle_filter, nullptr, nullptr);
+ } else {
+ return true;
+ }
+ });
}
-
-void grpc_client_idle_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.cc b/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.cc
new file mode 100644
index 00000000000..cd0689721e1
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.cc
@@ -0,0 +1,96 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/client_idle/idle_filter_state.h"
+
+#include <assert.h>
+
+namespace grpc_core {
+
+IdleFilterState::IdleFilterState(bool start_timer)
+ : state_(start_timer ? kTimerStarted : 0) {}
+
+void IdleFilterState::IncreaseCallCount() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ do {
+ // Increment the counter, and flag that there's been activity.
+ new_state = state;
+ new_state |= kCallsStartedSinceLastTimerCheck;
+ new_state += kCallIncrement;
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+}
+
+bool IdleFilterState::DecreaseCallCount() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ bool start_timer;
+ do {
+ start_timer = false;
+ new_state = state;
+ // Decrement call count (and assert there's at least one call outstanding!)
+ assert(new_state >= kCallIncrement);
+ new_state -= kCallIncrement;
+ // If that decrement reaches a call count of zero and we have not started a
+ // timer
+ if ((new_state >> kCallsInProgressShift) == 0 &&
+ (new_state & kTimerStarted) == 0) {
+ // Flag that we will start a timer, and mark it started so nobody else
+ // does.
+ start_timer = true;
+ new_state |= kTimerStarted;
+ new_state &= ~kCallsInProgressShift;
+ }
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+ return start_timer;
+}
+
+bool IdleFilterState::CheckTimer() {
+ uintptr_t state = state_.load(std::memory_order_relaxed);
+ uintptr_t new_state;
+ bool start_timer;
+ do {
+ if ((state >> kCallsInProgressShift) != 0) {
+ // Still calls in progress: nothing needs updating, just return
+ // and keep the timer going!
+ return true;
+ }
+ new_state = state;
+ bool is_active = false;
+ if (new_state & kCallsStartedSinceLastTimerCheck) {
+ // If any calls started since the last time we checked, then consider the
+ // channel still active and try again.
+ is_active = true;
+ new_state &= ~kCallsStartedSinceLastTimerCheck;
+ }
+ if (is_active) {
+ // If we are still active, we should signal that the timer should start
+ // again.
+ start_timer = true;
+ } else {
+ // Otherwise, we should not start the timer again, and we should signal
+ // that in the updated state.
+ start_timer = false;
+ new_state &= ~kTimerStarted;
+ }
+ } while (!state_.compare_exchange_weak(
+ state, new_state, std::memory_order_acq_rel, std::memory_order_relaxed));
+ return start_timer;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.h b/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.h
new file mode 100644
index 00000000000..ef236b14b4d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/client_idle/idle_filter_state.h
@@ -0,0 +1,66 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_IDLE_IDLE_FILTER_STATE_H
+#define GRPC_CORE_EXT_FILTERS_CLIENT_IDLE_IDLE_FILTER_STATE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+namespace grpc_core {
+
+// State machine for the idle filter.
+// Keeps track of how many calls are in progress, whether there is a timer
+// started, and whether we've seen calls since the previous timer fired.
+class IdleFilterState {
+ public:
+ explicit IdleFilterState(bool start_timer);
+ ~IdleFilterState() = default;
+
+ IdleFilterState(const IdleFilterState&);
+ IdleFilterState& operator=(const IdleFilterState&);
+
+ // Increment the number of calls in progress.
+ void IncreaseCallCount();
+
+ // Decrement the number of calls in progress.
+ // Return true if we reached idle with no timer started.
+ GRPC_MUST_USE_RESULT bool DecreaseCallCount();
+
+ // Check if there's been any activity since the last timer check.
+ // If there was, reset the activity flag and return true to indicated that
+ // a new timer should be started.
+ // If there was not, reset the timer flag and return false - in this case
+ // we know that the channel is idle and has been for one full cycle.
+ GRPC_MUST_USE_RESULT bool CheckTimer();
+
+ private:
+ // Bit in state_ indicating that the timer has been started.
+ static constexpr uintptr_t kTimerStarted = 1;
+ // Bit in state_ indicating that we've seen a call start or stop since the
+ // last timer.
+ static constexpr uintptr_t kCallsStartedSinceLastTimerCheck = 2;
+ // How much should we shift to get the number of calls in progress.
+ static constexpr uintptr_t kCallsInProgressShift = 2;
+ // How much to increment/decrement the state_ when a call is started/stopped.
+ // Ensures we don't clobber the preceding bits.
+ static constexpr uintptr_t kCallIncrement = uintptr_t(1)
+ << kCallsInProgressShift;
+ std::atomic<uintptr_t> state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_CLIENT_IDLE_IDLE_FILTER_STATE_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc b/contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc
index 837e337b64b..9bdd51fc240 100644
--- a/contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/deadline/deadline_filter.cc
@@ -27,10 +27,10 @@
#include <grpc/support/time.h>
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/channel_init.h"
namespace grpc_core {
@@ -51,7 +51,7 @@ class TimerState {
private:
// The on_complete callback used when sending a cancel_error batch down the
// filter stack. Yields the call combiner when the batch returns.
- static void YieldCallCombiner(void* arg, grpc_error* /*ignored*/) {
+ static void YieldCallCombiner(void* arg, grpc_error_handle /*ignored*/) {
TimerState* self = static_cast<TimerState*>(arg);
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(self->elem_->call_data);
@@ -62,7 +62,7 @@ class TimerState {
// This is called via the call combiner, so access to deadline_state is
// synchronized.
- static void SendCancelOpInCallCombiner(void* arg, grpc_error* error) {
+ static void SendCancelOpInCallCombiner(void* arg, grpc_error_handle error) {
TimerState* self = static_cast<TimerState*>(arg);
grpc_transport_stream_op_batch* batch = grpc_make_transport_stream_op(
GRPC_CLOSURE_INIT(&self->closure_, YieldCallCombiner, self, nullptr));
@@ -72,7 +72,7 @@ class TimerState {
}
// Timer callback.
- static void TimerCallback(void* arg, grpc_error* error) {
+ static void TimerCallback(void* arg, grpc_error_handle error) {
TimerState* self = static_cast<TimerState*>(arg);
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(self->elem_->call_data);
@@ -114,9 +114,7 @@ class TimerState {
// synchronized.
static void start_timer_if_needed(grpc_call_element* elem,
grpc_millis deadline) {
- if (deadline == GRPC_MILLIS_INF_FUTURE) {
- return;
- }
+ if (deadline == GRPC_MILLIS_INF_FUTURE) return;
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(elem->call_data);
GPR_ASSERT(deadline_state->timer_state == nullptr);
@@ -135,7 +133,7 @@ static void cancel_timer_if_needed(grpc_deadline_state* deadline_state) {
}
// Callback run when we receive trailing metadata.
-static void recv_trailing_metadata_ready(void* arg, grpc_error* error) {
+static void recv_trailing_metadata_ready(void* arg, grpc_error_handle error) {
grpc_deadline_state* deadline_state = static_cast<grpc_deadline_state*>(arg);
cancel_timer_if_needed(deadline_state);
// Invoke the original callback.
@@ -168,7 +166,7 @@ struct start_timer_after_init_state {
grpc_millis deadline;
grpc_closure closure;
};
-static void start_timer_after_init(void* arg, grpc_error* error) {
+static void start_timer_after_init(void* arg, grpc_error_handle error) {
struct start_timer_after_init_state* state =
static_cast<struct start_timer_after_init_state*>(arg);
grpc_deadline_state* deadline_state =
@@ -241,8 +239,8 @@ void grpc_deadline_state_client_start_transport_stream_op_batch(
//
// Constructor for channel_data. Used for both client and server filters.
-static grpc_error* deadline_init_channel_elem(grpc_channel_element* /*elem*/,
- grpc_channel_element_args* args) {
+static grpc_error_handle deadline_init_channel_elem(
+ grpc_channel_element* /*elem*/, grpc_channel_element_args* args) {
GPR_ASSERT(!args->is_last);
return GRPC_ERROR_NONE;
}
@@ -268,8 +266,8 @@ typedef struct server_call_data {
} server_call_data;
// Constructor for call_data. Used for both client and server filters.
-static grpc_error* deadline_init_call_elem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+static grpc_error_handle deadline_init_call_elem(
+ grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) grpc_deadline_state(elem, *args, args->deadline);
return GRPC_ERROR_NONE;
}
@@ -292,10 +290,12 @@ static void deadline_client_start_transport_stream_op_batch(
}
// Callback for receiving initial metadata on the server.
-static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
+static void recv_initial_metadata_ready(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
server_call_data* calld = static_cast<server_call_data*>(elem->call_data);
- start_timer_if_needed(elem, calld->recv_initial_metadata->deadline);
+ start_timer_if_needed(
+ elem, calld->recv_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(GRPC_MILLIS_INF_FUTURE));
// Invoke the next callback.
grpc_core::Closure::Run(DEBUG_LOCATION,
calld->next_recv_initial_metadata_ready,
@@ -370,25 +370,22 @@ bool grpc_deadline_checking_enabled(const grpc_channel_args* channel_args) {
!grpc_channel_args_want_minimal_stack(channel_args));
}
-static bool maybe_add_deadline_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- return grpc_deadline_checking_enabled(
- grpc_channel_stack_builder_get_channel_arguments(builder))
- ? grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg),
- nullptr, nullptr)
- : true;
-}
-
-void grpc_deadline_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_deadline_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_deadline_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_deadline_filter,
- const_cast<grpc_channel_filter*>(&grpc_server_deadline_filter));
+namespace grpc_core {
+void RegisterDeadlineFilter(CoreConfiguration::Builder* builder) {
+ auto register_filter = [builder](grpc_channel_stack_type type,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [filter](grpc_channel_stack_builder* builder) {
+ if (grpc_deadline_checking_enabled(
+ grpc_channel_stack_builder_get_channel_arguments(builder))) {
+ return grpc_channel_stack_builder_prepend_filter(builder, filter,
+ nullptr, nullptr);
+ }
+ return true;
+ });
+ };
+ register_filter(GRPC_CLIENT_DIRECT_CHANNEL, &grpc_client_deadline_filter);
+ register_filter(GRPC_SERVER_CHANNEL, &grpc_server_deadline_filter);
}
-
-void grpc_deadline_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc b/contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
index 5ee53c24158..a8b11a26e6c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/fault_injection/fault_injection_filter.cc
@@ -18,17 +18,17 @@
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
+#include <atomic>
+
#include "y_absl/strings/numbers.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
#include "src/core/ext/filters/fault_injection/service_config_parser.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/status_util.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/timer.h"
@@ -40,32 +40,32 @@ TraceFlag grpc_fault_injection_filter_trace(false, "fault_injection_filter");
namespace {
-Atomic<uint32_t> g_active_faults{0};
+std::atomic<uint32_t> g_active_faults{0};
static_assert(
- std::is_trivially_destructible<Atomic<uint32_t>>::value,
+ std::is_trivially_destructible<std::atomic<uint32_t>>::value,
"the active fault counter needs to have a trivially destructible type");
-inline int GetLinkedMetadatumValueInt(grpc_linked_mdelem* md) {
+inline int GetMetadatumValueInt(grpc_mdelem md) {
int res;
- if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
+ if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md)), &res)) {
return res;
} else {
return -1;
}
}
-inline uint32_t GetLinkedMetadatumValueUnsignedInt(grpc_linked_mdelem* md) {
+inline uint32_t GetMetadatumValueUnsignedInt(grpc_mdelem md) {
uint32_t res;
- if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
+ if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md)), &res)) {
return res;
} else {
return -1;
}
}
-inline int64_t GetLinkedMetadatumValueInt64(grpc_linked_mdelem* md) {
+inline int64_t GetMetadatumValueInt64(grpc_mdelem md) {
int64_t res;
- if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md->md)), &res)) {
+ if (y_absl::SimpleAtoi(StringViewFromSlice(GRPC_MDVALUE(md)), &res)) {
return res;
} else {
return -1;
@@ -83,8 +83,8 @@ inline bool UnderFraction(const uint32_t numerator,
class ChannelData {
public:
- static grpc_error* Init(grpc_channel_element* elem,
- grpc_channel_element_args* args);
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
static void Destroy(grpc_channel_element* elem);
int index() const { return index_; }
@@ -99,8 +99,8 @@ class ChannelData {
class CallData {
public:
- static grpc_error* Init(grpc_call_element* elem,
- const grpc_call_element_args* args);
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
static void Destroy(grpc_call_element* elem,
const grpc_call_final_info* /*final_info*/,
@@ -129,7 +129,7 @@ class CallData {
// GRPC_ERROR_NONE.
// If this call is already been delay injected, skip the active faults
// quota check.
- grpc_error* MaybeAbort();
+ grpc_error_handle MaybeAbort();
// Delays the stream operations batch.
void DelayBatch(grpc_call_element* elem,
@@ -140,15 +140,15 @@ class CallData {
// Finishes the fault injection, should only be called once.
void FaultInjectionFinished() {
- g_active_faults.FetchSub(1, MemoryOrder::RELAXED);
+ g_active_faults.fetch_sub(1, std::memory_order_relaxed);
}
// This is a callback that will be invoked after the delay timer is up.
- static void ResumeBatch(void* arg, grpc_error* error);
+ static void ResumeBatch(void* arg, grpc_error_handle error);
// This is a callback invoked upon completion of recv_trailing_metadata.
// Injects the abort_error_ to the recv_trailing_metadata batch if needed.
- static void HijackedRecvTrailingMetadataReady(void* arg, grpc_error*);
+ static void HijackedRecvTrailingMetadataReady(void* arg, grpc_error_handle);
// Used to track the policy structs that needs to be destroyed in dtor.
bool fi_policy_owned_ = false;
@@ -166,7 +166,7 @@ class CallData {
ResumeBatchCanceller* resume_batch_canceller_ Y_ABSL_GUARDED_BY(delay_mu_);
grpc_transport_stream_op_batch* delayed_batch_ Y_ABSL_GUARDED_BY(delay_mu_);
// Abort states
- grpc_error* abort_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle abort_error_ = GRPC_ERROR_NONE;
grpc_closure recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ready_;
// Protects the asynchronous delay, resume, and cancellation.
@@ -175,8 +175,8 @@ class CallData {
// ChannelData
-grpc_error* ChannelData::Init(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+grpc_error_handle ChannelData::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
GPR_ASSERT(elem->filter == &FaultInjectionFilterVtable);
new (elem->channel_data) ChannelData(elem, args);
return GRPC_ERROR_NONE;
@@ -204,7 +204,7 @@ class CallData::ResumeBatchCanceller {
}
private:
- static void Cancel(void* arg, grpc_error* error) {
+ static void Cancel(void* arg, grpc_error_handle error) {
auto* self = static_cast<ResumeBatchCanceller*>(arg);
auto* chand = static_cast<ChannelData*>(self->elem_->channel_data);
auto* calld = static_cast<CallData*>(self->elem_->call_data);
@@ -214,7 +214,7 @@ class CallData::ResumeBatchCanceller {
gpr_log(GPR_INFO,
"chand=%p calld=%p: cancelling schdueled pick: "
"error=%s self=%p calld->resume_batch_canceller_=%p",
- chand, calld, grpc_error_string(error), self,
+ chand, calld, grpc_error_std_string(error).c_str(), self,
calld->resume_batch_canceller_);
}
if (error != GRPC_ERROR_NONE && calld->resume_batch_canceller_ == self) {
@@ -237,8 +237,8 @@ class CallData::ResumeBatchCanceller {
// CallData
-grpc_error* CallData::Init(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+grpc_error_handle CallData::Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
auto* calld = new (elem->call_data) CallData(elem, args);
if (calld->fi_policy_ == nullptr) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -273,7 +273,7 @@ void CallData::StartTransportStreamOpBatch(
calld->DelayBatch(elem, batch);
return;
}
- grpc_error* abort_error = calld->MaybeAbort();
+ grpc_error_handle abort_error = calld->MaybeAbort();
if (abort_error != GRPC_ERROR_NONE) {
calld->abort_error_ = abort_error;
grpc_transport_stream_op_batch_finish_with_failure(
@@ -346,9 +346,8 @@ void CallData::DecideWhetherToInjectFaults(
*fi_policy_);
}
};
- for (grpc_linked_mdelem* md = initial_metadata->list.head; md != nullptr;
- md = md->next) {
- y_absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
+ initial_metadata->ForEach([&](grpc_mdelem md) {
+ y_absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md));
// Only perform string comparison if:
// 1. Needs to check this header;
// 2. The value is not been filled before.
@@ -357,31 +356,31 @@ void CallData::DecideWhetherToInjectFaults(
copied_policy->abort_code == GRPC_STATUS_OK) &&
key == fi_policy_->abort_code_header) {
maybe_copy_policy_func();
- grpc_status_code_from_int(GetLinkedMetadatumValueInt(md),
+ grpc_status_code_from_int(GetMetadatumValueInt(md),
&copied_policy->abort_code);
}
if (!fi_policy_->abort_percentage_header.empty() &&
key == fi_policy_->abort_percentage_header) {
maybe_copy_policy_func();
copied_policy->abort_percentage_numerator =
- GPR_MIN(GetLinkedMetadatumValueUnsignedInt(md),
- fi_policy_->abort_percentage_numerator);
+ std::min(GetMetadatumValueUnsignedInt(md),
+ fi_policy_->abort_percentage_numerator);
}
if (!fi_policy_->delay_header.empty() &&
(copied_policy == nullptr || copied_policy->delay == 0) &&
key == fi_policy_->delay_header) {
maybe_copy_policy_func();
copied_policy->delay = static_cast<grpc_millis>(
- GPR_MAX(GetLinkedMetadatumValueInt64(md), 0));
+ std::max(GetMetadatumValueInt64(md), int64_t(0)));
}
if (!fi_policy_->delay_percentage_header.empty() &&
key == fi_policy_->delay_percentage_header) {
maybe_copy_policy_func();
copied_policy->delay_percentage_numerator =
- GPR_MIN(GetLinkedMetadatumValueUnsignedInt(md),
- fi_policy_->delay_percentage_numerator);
+ std::min(GetMetadatumValueUnsignedInt(md),
+ fi_policy_->delay_percentage_numerator);
}
- }
+ });
if (copied_policy != nullptr) fi_policy_ = copied_policy;
}
// Roll the dice
@@ -400,10 +399,11 @@ void CallData::DecideWhetherToInjectFaults(
}
bool CallData::HaveActiveFaultsQuota(bool increment) {
- if (g_active_faults.Load(MemoryOrder::ACQUIRE) >= fi_policy_->max_faults) {
+ if (g_active_faults.load(std::memory_order_acquire) >=
+ fi_policy_->max_faults) {
return false;
}
- if (increment) g_active_faults.FetchAdd(1, MemoryOrder::RELAXED);
+ if (increment) g_active_faults.fetch_add(1, std::memory_order_relaxed);
return true;
}
@@ -414,7 +414,7 @@ bool CallData::MaybeDelay() {
return false;
}
-grpc_error* CallData::MaybeAbort() {
+grpc_error_handle CallData::MaybeAbort() {
if (abort_request_ && (delay_request_ || HaveActiveFaultsQuota(false))) {
return grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_COPIED_STRING(fi_policy_->abort_message.c_str()),
@@ -434,7 +434,7 @@ void CallData::DelayBatch(grpc_call_element* elem,
grpc_timer_init(&delay_timer_, resume_time, &batch->handler_private.closure);
}
-void CallData::ResumeBatch(void* arg, grpc_error* error) {
+void CallData::ResumeBatch(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<CallData*>(elem->call_data);
MutexLock lock(&calld->delay_mu_);
@@ -454,15 +454,18 @@ void CallData::ResumeBatch(void* arg, grpc_error* error) {
// Abort if needed.
error = calld->MaybeAbort();
if (error != GRPC_ERROR_NONE) {
+ calld->abort_error_ = error;
grpc_transport_stream_op_batch_finish_with_failure(
- calld->delayed_batch_, error, calld->call_combiner_);
+ calld->delayed_batch_, GRPC_ERROR_REF(calld->abort_error_),
+ calld->call_combiner_);
return;
}
// Chain to the next filter.
grpc_call_next_op(elem, calld->delayed_batch_);
}
-void CallData::HijackedRecvTrailingMetadataReady(void* arg, grpc_error* error) {
+void CallData::HijackedRecvTrailingMetadataReady(void* arg,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<CallData*>(elem->call_data);
if (calld->abort_error_ != GRPC_ERROR_NONE) {
@@ -492,7 +495,7 @@ extern const grpc_channel_filter FaultInjectionFilterVtable = {
};
void FaultInjectionFilterInit(void) {
- grpc_core::FaultInjectionServiceConfigParser::Register();
+ FaultInjectionServiceConfigParser::Register();
}
void FaultInjectionFilterShutdown(void) {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc b/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
index ffda88c947e..a5075fe66f5 100644
--- a/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.cc
@@ -22,7 +22,7 @@
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/string_view.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/status_util.h"
@@ -37,17 +37,15 @@ size_t g_fault_injection_parser_index;
std::vector<FaultInjectionMethodParsedConfig::FaultInjectionPolicy>
ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
- std::vector<grpc_error*>* error_list) {
+ std::vector<grpc_error_handle>* error_list) {
std::vector<FaultInjectionMethodParsedConfig::FaultInjectionPolicy> policies;
for (size_t i = 0; i < policies_json_array.size(); i++) {
FaultInjectionMethodParsedConfig::FaultInjectionPolicy
fault_injection_policy;
- std::vector<grpc_error*> sub_error_list;
+ std::vector<grpc_error_handle> sub_error_list;
if (policies_json_array[i].type() != Json::Type::OBJECT) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("faultInjectionPolicy index ", i,
- " is not a JSON object")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "faultInjectionPolicy index ", i, " is not a JSON object")));
continue;
}
const Json::Object& json_object = policies_json_array[i].object_value();
@@ -133,15 +131,9 @@ ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
}
}
if (!sub_error_list.empty()) {
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("failed to parse faultInjectionPolicy index ", i)
- .c_str());
- for (size_t i = 0; i < sub_error_list.size(); ++i) {
- error = grpc_error_add_child(error, sub_error_list[i]);
- }
- error_list->push_back(error);
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("failed to parse faultInjectionPolicy index ", i),
+ &sub_error_list));
}
policies.push_back(std::move(fault_injection_policy));
}
@@ -152,7 +144,7 @@ ParseFaultInjectionPolicy(const Json::Array& policies_json_array,
std::unique_ptr<ServiceConfigParser::ParsedConfig>
FaultInjectionServiceConfigParser::ParsePerMethodParams(
- const grpc_channel_args* args, const Json& json, grpc_error** error) {
+ const grpc_channel_args* args, const Json& json, grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
// Only parse fault injection policy if the following channel arg is present.
if (!grpc_channel_args_find_bool(
@@ -162,7 +154,7 @@ FaultInjectionServiceConfigParser::ParsePerMethodParams(
// Parse fault injection policy from given Json
std::vector<FaultInjectionMethodParsedConfig::FaultInjectionPolicy>
fault_injection_policies;
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
const Json::Array* policies_json_array;
if (ParseJsonObjectField(json.object_value(), "faultInjectionPolicy",
&policies_json_array, &error_list)) {
diff --git a/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.h b/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
index 33e395e0728..e9b692bfccd 100644
--- a/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
+++ b/contrib/libs/grpc/src/core/ext/filters/fault_injection/service_config_parser.h
@@ -21,7 +21,7 @@
#include <vector>
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/iomgr/exec_ctx.h"
namespace grpc_core {
@@ -73,7 +73,7 @@ class FaultInjectionServiceConfigParser : public ServiceConfigParser::Parser {
// Parses the per-method service config for fault injection filter.
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
const grpc_channel_args* args, const Json& json,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
// Returns the parser index for FaultInjectionServiceConfigParser.
static size_t ParserIndex();
// Registers FaultInjectionServiceConfigParser to ServiceConfigParser.
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
index 25be7ae437b..c1b1e0bed44 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/client/http_client_filter.cc
@@ -17,6 +17,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/client/http_client_filter.h"
+
#include <stdint.h>
#include <string.h>
@@ -30,7 +32,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/filters/http/client/http_client_filter.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/profiling/timers.h"
@@ -48,10 +49,12 @@
/* default maximum size of payload eligible for GET request */
static constexpr size_t kMaxPayloadSizeForGet = 2048;
-static void recv_initial_metadata_ready(void* user_data, grpc_error* error);
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* error);
-static void on_send_message_next_done(void* arg, grpc_error* error);
-static void send_message_on_complete(void* arg, grpc_error* error);
+static void recv_initial_metadata_ready(void* user_data,
+ grpc_error_handle error);
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle error);
+static void on_send_message_next_done(void* arg, grpc_error_handle error);
+static void send_message_on_complete(void* arg, grpc_error_handle error);
namespace {
struct call_data {
@@ -75,20 +78,17 @@ struct call_data {
// State for handling send_initial_metadata ops.
grpc_linked_mdelem method;
grpc_linked_mdelem scheme;
- grpc_linked_mdelem authority;
- grpc_linked_mdelem te_trailers;
grpc_linked_mdelem content_type;
- grpc_linked_mdelem user_agent;
// State for handling recv_initial_metadata ops.
grpc_metadata_batch* recv_initial_metadata;
- grpc_error* recv_initial_metadata_error = GRPC_ERROR_NONE;
+ grpc_error_handle recv_initial_metadata_error = GRPC_ERROR_NONE;
grpc_closure* original_recv_initial_metadata_ready = nullptr;
grpc_closure recv_initial_metadata_ready;
// State for handling recv_trailing_metadata ops.
grpc_metadata_batch* recv_trailing_metadata;
grpc_closure* original_recv_trailing_metadata_ready;
grpc_closure recv_trailing_metadata_ready;
- grpc_error* recv_trailing_metadata_error = GRPC_ERROR_NONE;
+ grpc_error_handle recv_trailing_metadata_error = GRPC_ERROR_NONE;
bool seen_recv_trailing_metadata_ready = false;
// State for handling send_message ops.
grpc_transport_stream_op_batch* send_message_batch;
@@ -103,64 +103,61 @@ struct call_data {
struct channel_data {
grpc_mdelem static_scheme;
- grpc_mdelem user_agent;
+ grpc_core::Slice user_agent;
size_t max_payload_size_for_get;
};
} // namespace
-static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
- if (b->idx.named.status != nullptr) {
+static grpc_error_handle client_filter_incoming_metadata(
+ grpc_metadata_batch* b) {
+ if (b->legacy_index()->named.status != nullptr) {
/* If both gRPC status and HTTP status are provided in the response, we
* should prefer the gRPC status code, as mentioned in
* https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md.
*/
- if (b->idx.named.grpc_status != nullptr ||
- grpc_mdelem_static_value_eq(b->idx.named.status->md,
+ if (b->legacy_index()->named.grpc_status != nullptr ||
+ grpc_mdelem_static_value_eq(b->legacy_index()->named.status->md,
GRPC_MDELEM_STATUS_200)) {
- grpc_metadata_batch_remove(b, GRPC_BATCH_STATUS);
+ b->Remove(GRPC_BATCH_STATUS);
} else {
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.status->md),
- GPR_DUMP_ASCII);
+ char* val = grpc_dump_slice(
+ GRPC_MDVALUE(b->legacy_index()->named.status->md), GPR_DUMP_ASCII);
TString msg =
y_absl::StrCat("Received http2 header with status: ", val);
- grpc_error* e = grpc_error_set_str(
+ grpc_error_handle e = grpc_error_set_str(
grpc_error_set_int(
grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Received http2 :status header with non-200 OK status"),
- GRPC_ERROR_STR_VALUE, grpc_slice_from_copied_string(val)),
+ GRPC_ERROR_STR_VALUE, val),
GRPC_ERROR_INT_GRPC_STATUS,
grpc_http2_status_to_grpc_status(atoi(val))),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_cpp_string(std::move(msg)));
+ GRPC_ERROR_STR_GRPC_MESSAGE, msg);
gpr_free(val);
return e;
}
}
- if (b->idx.named.grpc_message != nullptr) {
- grpc_slice pct_decoded_msg = grpc_permissive_percent_decode_slice(
- GRPC_MDVALUE(b->idx.named.grpc_message->md));
- if (grpc_slice_is_equivalent(pct_decoded_msg,
- GRPC_MDVALUE(b->idx.named.grpc_message->md))) {
- grpc_slice_unref_internal(pct_decoded_msg);
- } else {
- grpc_metadata_batch_set_value(b->idx.named.grpc_message, pct_decoded_msg);
- }
+ if (grpc_core::Slice* grpc_message =
+ b->get_pointer(grpc_core::GrpcMessageMetadata())) {
+ *grpc_message =
+ grpc_core::PermissivePercentDecodeSlice(std::move(*grpc_message));
}
- if (b->idx.named.content_type != nullptr) {
+ if (b->legacy_index()->named.content_type != nullptr) {
if (!grpc_mdelem_static_value_eq(
- b->idx.named.content_type->md,
+ b->legacy_index()->named.content_type->md,
GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) {
- if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md),
- EXPECTED_CONTENT_TYPE,
- EXPECTED_CONTENT_TYPE_LENGTH) &&
+ if (grpc_slice_buf_start_eq(
+ GRPC_MDVALUE(b->legacy_index()->named.content_type->md),
+ EXPECTED_CONTENT_TYPE, EXPECTED_CONTENT_TYPE_LENGTH) &&
(GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
+ b->legacy_index()
+ ->named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
'+' ||
GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
+ b->legacy_index()
+ ->named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
';')) {
/* Although the C implementation doesn't (currently) generate them,
any custom +-suffix is explicitly valid. */
@@ -170,26 +167,28 @@ static grpc_error* client_filter_incoming_metadata(grpc_metadata_batch* b) {
} else {
/* TODO(klempner): We're currently allowing this, but we shouldn't
see it without a proxy so log for now. */
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
- GPR_DUMP_ASCII);
+ char* val = grpc_dump_slice(
+ GRPC_MDVALUE(b->legacy_index()->named.content_type->md),
+ GPR_DUMP_ASCII);
gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
gpr_free(val);
}
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE);
+ b->Remove(GRPC_BATCH_CONTENT_TYPE);
}
return GRPC_ERROR_NONE;
}
-static void recv_initial_metadata_ready(void* user_data, grpc_error* error) {
+static void recv_initial_metadata_ready(void* user_data,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (error == GRPC_ERROR_NONE) {
error = client_filter_incoming_metadata(calld->recv_initial_metadata);
calld->recv_initial_metadata_error = GRPC_ERROR_REF(error);
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
grpc_closure* closure = calld->original_recv_initial_metadata_ready;
calld->original_recv_initial_metadata_ready = nullptr;
@@ -201,7 +200,8 @@ static void recv_initial_metadata_ready(void* user_data, grpc_error* error) {
grpc_core::Closure::Run(DEBUG_LOCATION, closure, error);
}
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* error) {
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (calld->original_recv_initial_metadata_ready != nullptr) {
@@ -215,7 +215,7 @@ static void recv_trailing_metadata_ready(void* user_data, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
error = client_filter_incoming_metadata(calld->recv_trailing_metadata);
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
error = grpc_error_add_child(
error, GRPC_ERROR_REF(calld->recv_initial_metadata_error));
@@ -223,10 +223,13 @@ static void recv_trailing_metadata_ready(void* user_data, grpc_error* error) {
calld->original_recv_trailing_metadata_ready, error);
}
-static void send_message_on_complete(void* arg, grpc_error* error) {
+static void send_message_on_complete(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->send_message_cache.Destroy();
+ // Set the batch's send_message bit back to true, so the retry code
+ // above knows what was in this batch.
+ calld->send_message_batch->send_message = true;
grpc_core::Closure::Run(DEBUG_LOCATION,
calld->original_send_message_on_complete,
GRPC_ERROR_REF(error));
@@ -234,9 +237,10 @@ static void send_message_on_complete(void* arg, grpc_error* error) {
// Pulls a slice from the send_message byte stream, updating
// calld->send_message_bytes_read.
-static grpc_error* pull_slice_from_send_message(call_data* calld) {
+static grpc_error_handle pull_slice_from_send_message(call_data* calld) {
grpc_slice incoming_slice;
- grpc_error* error = calld->send_message_caching_stream->Pull(&incoming_slice);
+ grpc_error_handle error =
+ calld->send_message_caching_stream->Pull(&incoming_slice);
if (error == GRPC_ERROR_NONE) {
calld->send_message_bytes_read += GRPC_SLICE_LENGTH(incoming_slice);
grpc_slice_unref_internal(incoming_slice);
@@ -249,10 +253,11 @@ static grpc_error* pull_slice_from_send_message(call_data* calld) {
// calld->send_message_caching_stream->length(), then we have completed
// reading from the byte stream; otherwise, an async read has been dispatched
// and on_send_message_next_done() will be invoked when it is complete.
-static grpc_error* read_all_available_send_message_data(call_data* calld) {
+static grpc_error_handle read_all_available_send_message_data(
+ call_data* calld) {
while (calld->send_message_caching_stream->Next(
SIZE_MAX, &calld->on_send_message_next_done)) {
- grpc_error* error = pull_slice_from_send_message(calld);
+ grpc_error_handle error = pull_slice_from_send_message(calld);
if (error != GRPC_ERROR_NONE) return error;
if (calld->send_message_bytes_read ==
calld->send_message_caching_stream->length()) {
@@ -263,7 +268,7 @@ static grpc_error* read_all_available_send_message_data(call_data* calld) {
}
// Async callback for ByteStream::Next().
-static void on_send_message_next_done(void* arg, grpc_error* error) {
+static void on_send_message_next_done(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
@@ -301,12 +306,13 @@ static char* slice_buffer_to_string(grpc_slice_buffer* slice_buffer) {
// Modifies the path entry in the batch's send_initial_metadata to
// append the base64-encoded query for a GET request.
-static grpc_error* update_path_for_get(grpc_call_element* elem,
- grpc_transport_stream_op_batch* batch) {
+static grpc_error_handle update_path_for_get(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
call_data* calld = static_cast<call_data*>(elem->call_data);
grpc_slice path_slice =
GRPC_MDVALUE(batch->payload->send_initial_metadata.send_initial_metadata
- ->idx.named.path->md);
+ ->legacy_index()
+ ->named.path->md);
/* sum up individual component's lengths and allocate enough memory to
* hold combined path+query */
size_t estimated_len = GRPC_SLICE_LENGTH(path_slice);
@@ -330,24 +336,23 @@ static grpc_error* update_path_for_get(grpc_call_element* elem,
true /* url_safe */, false /* multi_line */);
gpr_free(payload_bytes);
/* remove trailing unused memory and add trailing 0 to terminate string */
- char* t = reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice);
+ char* t =
+ reinterpret_cast<char*> GRPC_SLICE_START_PTR(path_with_query_slice) +
+ GRPC_SLICE_LENGTH(path_slice);
/* safe to use strlen since base64_encode will always add '\0' */
- path_with_query_slice =
- grpc_slice_sub_no_ref(path_with_query_slice, 0, strlen(t));
+ path_with_query_slice = grpc_slice_sub_no_ref(
+ path_with_query_slice, 0, GRPC_SLICE_LENGTH(path_slice) + strlen(t));
/* substitute previous path with the new path+query */
grpc_mdelem mdelem_path_and_query =
grpc_mdelem_from_slices(GRPC_MDSTR_PATH, path_with_query_slice);
grpc_metadata_batch* b =
batch->payload->send_initial_metadata.send_initial_metadata;
- return grpc_metadata_batch_substitute(b, b->idx.named.path,
- mdelem_path_and_query);
+ return b->Substitute(b->legacy_index()->named.path, mdelem_path_and_query);
}
static void remove_if_present(grpc_metadata_batch* batch,
grpc_metadata_batch_callouts_index idx) {
- if (batch->idx.array[idx] != nullptr) {
- grpc_metadata_batch_remove(batch, idx);
- }
+ batch->Remove(idx);
}
static void http_client_start_transport_stream_op_batch(
@@ -376,7 +381,7 @@ static void http_client_start_transport_stream_op_batch(
&calld->recv_trailing_metadata_ready;
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
bool batch_will_be_handled_asynchronously = false;
if (batch->send_initial_metadata) {
// Decide which HTTP VERB to use. We use GET if the request is marked
@@ -431,13 +436,7 @@ static void http_client_start_transport_stream_op_batch(
GRPC_BATCH_SCHEME);
remove_if_present(
batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_TE);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
GRPC_BATCH_CONTENT_TYPE);
- remove_if_present(
- batch->payload->send_initial_metadata.send_initial_metadata,
- GRPC_BATCH_USER_AGENT);
/* Send : prefixed headers, which have to be before any application
layer headers. */
@@ -449,33 +448,28 @@ static void http_client_start_transport_stream_op_batch(
batch->payload->send_initial_metadata.send_initial_metadata,
&calld->scheme, channeld->static_scheme, GRPC_BATCH_SCHEME);
if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_tail(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->te_trailers, GRPC_MDELEM_TE_TRAILERS, GRPC_BATCH_TE);
- if (error != GRPC_ERROR_NONE) goto done;
+ batch->payload->send_initial_metadata.send_initial_metadata->Set(
+ grpc_core::TeMetadata(), grpc_core::TeMetadata::kTrailers);
error = grpc_metadata_batch_add_tail(
batch->payload->send_initial_metadata.send_initial_metadata,
&calld->content_type, GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC,
GRPC_BATCH_CONTENT_TYPE);
if (error != GRPC_ERROR_NONE) goto done;
- error = grpc_metadata_batch_add_tail(
- batch->payload->send_initial_metadata.send_initial_metadata,
- &calld->user_agent, GRPC_MDELEM_REF(channeld->user_agent),
- GRPC_BATCH_USER_AGENT);
- if (error != GRPC_ERROR_NONE) goto done;
+ batch->payload->send_initial_metadata.send_initial_metadata->Set(
+ grpc_core::UserAgentMetadata(), channeld->user_agent.Ref());
}
done:
if (error != GRPC_ERROR_NONE) {
- grpc_transport_stream_op_batch_finish_with_failure(
- calld->send_message_batch, error, calld->call_combiner);
+ grpc_transport_stream_op_batch_finish_with_failure(batch, error,
+ calld->call_combiner);
} else if (!batch_will_be_handled_asynchronously) {
grpc_call_next_op(elem, batch);
}
}
/* Constructor for call_data */
-static grpc_error* http_client_init_call_elem(
+static grpc_error_handle http_client_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) call_data(elem, *args);
return GRPC_ERROR_NONE;
@@ -526,8 +520,8 @@ static size_t max_payload_size_from_args(const grpc_channel_args* args) {
return kMaxPayloadSizeForGet;
}
-static grpc_core::ManagedMemorySlice user_agent_from_args(
- const grpc_channel_args* args, const char* transport_name) {
+static grpc_core::Slice user_agent_from_args(const grpc_channel_args* args,
+ const char* transport_name) {
std::vector<TString> user_agent_fields;
for (size_t i = 0; args && i < args->num_args; i++) {
@@ -557,29 +551,27 @@ static grpc_core::ManagedMemorySlice user_agent_from_args(
}
TString user_agent_string = y_absl::StrJoin(user_agent_fields, " ");
- return grpc_core::ManagedMemorySlice(user_agent_string.c_str());
+ return grpc_core::Slice::FromCopiedString(user_agent_string.c_str());
}
/* Constructor for channel_data */
-static grpc_error* http_client_init_channel_elem(
+static grpc_error_handle http_client_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
+ new (chand) channel_data();
GPR_ASSERT(!args->is_last);
GPR_ASSERT(args->optional_transport != nullptr);
chand->static_scheme = scheme_from_args(args->channel_args);
chand->max_payload_size_for_get =
max_payload_size_from_args(args->channel_args);
- chand->user_agent = grpc_mdelem_from_slices(
- GRPC_MDSTR_USER_AGENT,
- user_agent_from_args(args->channel_args,
- args->optional_transport->vtable->name));
+ chand->user_agent = grpc_core::Slice(user_agent_from_args(
+ args->channel_args, args->optional_transport->vtable->name));
return GRPC_ERROR_NONE;
}
/* Destructor for channel data */
static void http_client_destroy_channel_elem(grpc_channel_element* elem) {
- channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- GRPC_MDELEM_UNREF(chand->user_agent);
+ static_cast<channel_data*>(elem->channel_data)->~channel_data();
}
const grpc_channel_filter grpc_http_client_filter = {
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
index 9511d2591a3..1915ebdab18 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/client_authority_filter.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/client_authority_filter.h"
+
#include <assert.h>
#include <limits.h>
#include <string.h>
@@ -26,13 +28,13 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/filters/http/client_authority_filter.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/static_metadata.h"
@@ -55,9 +57,10 @@ void client_authority_start_transport_stream_op_batch(
// Handle send_initial_metadata.
// If the initial metadata doesn't already contain :authority, add it.
if (batch->send_initial_metadata &&
- batch->payload->send_initial_metadata.send_initial_metadata->idx.named
- .authority == nullptr) {
- grpc_error* error = grpc_metadata_batch_add_head(
+ batch->payload->send_initial_metadata.send_initial_metadata
+ ->legacy_index()
+ ->named.authority == nullptr) {
+ grpc_error_handle error = grpc_metadata_batch_add_head(
batch->payload->send_initial_metadata.send_initial_metadata,
&calld->authority_storage,
GRPC_MDELEM_REF(chand->default_authority_mdelem), GRPC_BATCH_AUTHORITY);
@@ -72,7 +75,7 @@ void client_authority_start_transport_stream_op_batch(
}
/* Constructor for call_data */
-grpc_error* client_authority_init_call_elem(
+grpc_error_handle client_authority_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->call_combiner = args->call_combiner;
@@ -85,7 +88,7 @@ void client_authority_destroy_call_elem(
grpc_closure* /*ignored*/) {}
/* Constructor for channel_data */
-grpc_error* client_authority_init_channel_elem(
+grpc_error_handle client_authority_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
const grpc_arg* default_authority_arg =
@@ -130,8 +133,7 @@ const grpc_channel_filter grpc_client_authority_filter = {
grpc_channel_next_get_info,
"authority"};
-static bool add_client_authority_filter(grpc_channel_stack_builder* builder,
- void* arg) {
+static bool add_client_authority_filter(grpc_channel_stack_builder* builder) {
const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
const grpc_arg* disable_client_authority_filter_arg = grpc_channel_args_find(
@@ -144,16 +146,14 @@ static bool add_client_authority_filter(grpc_channel_stack_builder* builder,
}
}
return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
+ builder, &grpc_client_authority_filter, nullptr, nullptr);
}
-void grpc_client_authority_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, INT_MAX, add_client_authority_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_authority_filter));
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX, add_client_authority_filter,
- const_cast<grpc_channel_filter*>(&grpc_client_authority_filter));
+namespace grpc_core {
+void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL, INT_MAX,
+ add_client_authority_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX,
+ add_client_authority_filter);
}
-
-void grpc_client_authority_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc b/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
index d5577d56145..08fa1685d7a 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/http_filters_plugin.cc
@@ -25,84 +25,64 @@
#include "src/core/ext/filters/http/message_compress/message_decompress_filter.h"
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/transport_impl.h"
-struct optional_filter {
- const grpc_channel_filter* filter;
- const char* control_channel_arg;
-};
-
-static optional_filter compress_filter = {
- &grpc_message_compress_filter, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION};
-
-static optional_filter decompress_filter = {
- &grpc_core::MessageDecompressFilter,
- GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION};
-
static bool is_building_http_like_transport(
grpc_channel_stack_builder* builder) {
grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
return t != nullptr && strstr(t->vtable->name, "http");
}
-template <bool enable_in_minimal_stack>
-static bool maybe_add_optional_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- if (!is_building_http_like_transport(builder)) return true;
- optional_filter* filtarg = static_cast<optional_filter*>(arg);
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- bool enable = grpc_channel_arg_get_bool(
- grpc_channel_args_find(channel_args, filtarg->control_channel_arg),
- enable_in_minimal_stack ||
- !grpc_channel_args_want_minimal_stack(channel_args));
- return enable ? grpc_channel_stack_builder_prepend_filter(
- builder, filtarg->filter, nullptr, nullptr)
- : true;
-}
-
-static bool maybe_add_required_filter(grpc_channel_stack_builder* builder,
- void* arg) {
- return is_building_http_like_transport(builder)
- ? grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg),
- nullptr, nullptr)
- : true;
-}
-
-void grpc_http_filters_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<false>, &compress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_optional_filter<true>, &decompress_filter);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_client_filter));
- grpc_channel_init_register_stage(
- GRPC_CLIENT_DIRECT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_client_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_required_filter,
- const_cast<grpc_channel_filter*>(&grpc_http_server_filter));
+namespace grpc_core {
+void RegisterHttpFilters(CoreConfiguration::Builder* builder) {
+ auto optional = [builder](grpc_channel_stack_type channel_type,
+ bool enable_in_minimal_stack,
+ const char* control_channel_arg,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ channel_type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [enable_in_minimal_stack, control_channel_arg,
+ filter](grpc_channel_stack_builder* builder) {
+ if (!is_building_http_like_transport(builder)) return true;
+ const grpc_channel_args* channel_args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ bool enable = grpc_channel_arg_get_bool(
+ grpc_channel_args_find(channel_args, control_channel_arg),
+ enable_in_minimal_stack ||
+ !grpc_channel_args_want_minimal_stack(channel_args));
+ if (!enable) return true;
+ return grpc_channel_stack_builder_prepend_filter(builder, filter,
+ nullptr, nullptr);
+ });
+ };
+ auto required = [builder](grpc_channel_stack_type channel_type,
+ const grpc_channel_filter* filter) {
+ builder->channel_init()->RegisterStage(
+ channel_type, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [filter](grpc_channel_stack_builder* builder) {
+ if (!is_building_http_like_transport(builder)) return true;
+ return grpc_channel_stack_builder_prepend_filter(builder, filter,
+ nullptr, nullptr);
+ });
+ };
+ optional(GRPC_CLIENT_SUBCHANNEL, false,
+ GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_CLIENT_DIRECT_CHANNEL, false,
+ GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_SERVER_CHANNEL, false, GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION,
+ &grpc_message_compress_filter);
+ optional(GRPC_CLIENT_SUBCHANNEL, true,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
+ optional(GRPC_CLIENT_DIRECT_CHANNEL, true,
+ GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION, &MessageDecompressFilter);
+ optional(GRPC_SERVER_CHANNEL, true, GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION,
+ &MessageDecompressFilter);
+ required(GRPC_CLIENT_SUBCHANNEL, &grpc_http_client_filter);
+ required(GRPC_CLIENT_DIRECT_CHANNEL, &grpc_http_client_filter);
+ required(GRPC_SERVER_CHANNEL, &grpc_http_server_filter);
}
-
-void grpc_http_filters_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
index 53f6e2b80de..9493044a4b1 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_compress_filter.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
+
#include <assert.h>
#include <string.h>
@@ -28,7 +30,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/filters/http/message_compress/message_compress_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/compression/algorithm_metadata.h"
#include "src/core/lib/compression/compression_args.h"
@@ -54,11 +55,14 @@ class ChannelData {
grpc_channel_args_get_channel_default_compression_algorithm(
args->channel_args);
// Make sure the default is enabled.
- if (!GPR_BITGET(enabled_compression_algorithms_bitset_,
- default_compression_algorithm_)) {
+ if (size_t(default_compression_algorithm_) >= 32 ||
+ !grpc_core::GetBit(enabled_compression_algorithms_bitset_,
+ default_compression_algorithm_)) {
const char* name;
- GPR_ASSERT(grpc_compression_algorithm_name(default_compression_algorithm_,
- &name) == 1);
+ if (!grpc_compression_algorithm_name(default_compression_algorithm_,
+ &name)) {
+ name = "<unknown>";
+ }
gpr_log(GPR_ERROR,
"default compression algorithm %s not enabled: switching to none",
name);
@@ -107,7 +111,8 @@ class CallData {
ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
// The call's message compression algorithm is set to channel's default
// setting. It can be overridden later by initial metadata.
- if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
+ if (GPR_LIKELY(
+ grpc_core::GetBit(channeld->enabled_compression_algorithms_bitset(),
channeld->default_compression_algorithm()))) {
message_compression_algorithm_ =
grpc_compression_algorithm_to_message_compression_algorithm(
@@ -131,25 +136,25 @@ class CallData {
bool SkipMessageCompression();
void InitializeState(grpc_call_element* elem);
- grpc_error* ProcessSendInitialMetadata(grpc_call_element* elem,
- grpc_metadata_batch* initial_metadata);
+ grpc_error_handle ProcessSendInitialMetadata(
+ grpc_call_element* elem, grpc_metadata_batch* initial_metadata);
// Methods for processing a send_message batch
- static void StartSendMessageBatch(void* elem_arg, grpc_error* unused);
- static void OnSendMessageNextDone(void* elem_arg, grpc_error* error);
- grpc_error* PullSliceFromSendMessage();
+ static void StartSendMessageBatch(void* elem_arg, grpc_error_handle unused);
+ static void OnSendMessageNextDone(void* elem_arg, grpc_error_handle error);
+ grpc_error_handle PullSliceFromSendMessage();
void ContinueReadingSendMessage(grpc_call_element* elem);
void FinishSendMessage(grpc_call_element* elem);
void SendMessageBatchContinue(grpc_call_element* elem);
static void FailSendMessageBatchInCallCombiner(void* calld_arg,
- grpc_error* error);
+ grpc_error_handle error);
- static void SendMessageOnComplete(void* calld_arg, grpc_error* error);
+ static void SendMessageOnComplete(void* calld_arg, grpc_error_handle error);
grpc_core::CallCombiner* call_combiner_;
grpc_message_compression_algorithm message_compression_algorithm_ =
GRPC_MESSAGE_COMPRESS_NONE;
- grpc_error* cancel_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
grpc_transport_stream_op_batch* send_message_batch_ = nullptr;
bool seen_initial_metadata_ = false;
/* Set to true, if the fields below are initialized. */
@@ -190,24 +195,25 @@ bool CallData::SkipMessageCompression() {
// channel's default setting.
grpc_compression_algorithm FindCompressionAlgorithm(
grpc_metadata_batch* initial_metadata, ChannelData* channeld) {
- if (initial_metadata->idx.named.grpc_internal_encoding_request == nullptr) {
+ if (initial_metadata->legacy_index()->named.grpc_internal_encoding_request ==
+ nullptr) {
return channeld->default_compression_algorithm();
}
grpc_compression_algorithm compression_algorithm;
// Parse the compression algorithm from the initial metadata.
- grpc_mdelem md =
- initial_metadata->idx.named.grpc_internal_encoding_request->md;
+ grpc_mdelem md = initial_metadata->legacy_index()
+ ->named.grpc_internal_encoding_request->md;
GPR_ASSERT(grpc_compression_algorithm_parse(GRPC_MDVALUE(md),
&compression_algorithm));
// Remove this metadata since it's an internal one (i.e., it won't be
// transmitted out).
- grpc_metadata_batch_remove(initial_metadata,
- GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST);
+ initial_metadata->Remove(GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST);
// Check if that algorithm is enabled. Note that GRPC_COMPRESS_NONE is always
// enabled.
// TODO(juanlishen): Maybe use channel default or abort() if the algorithm
// from the initial metadata is disabled.
- if (GPR_LIKELY(GPR_BITGET(channeld->enabled_compression_algorithms_bitset(),
+ if (GPR_LIKELY(
+ grpc_core::GetBit(channeld->enabled_compression_algorithms_bitset(),
compression_algorithm))) {
return compression_algorithm;
}
@@ -232,7 +238,7 @@ void CallData::InitializeState(grpc_call_element* elem) {
grpc_schedule_on_exec_ctx);
}
-grpc_error* CallData::ProcessSendInitialMetadata(
+grpc_error_handle CallData::ProcessSendInitialMetadata(
grpc_call_element* elem, grpc_metadata_batch* initial_metadata) {
ChannelData* channeld = static_cast<ChannelData*>(elem->channel_data);
// Find the compression algorithm.
@@ -246,7 +252,7 @@ grpc_error* CallData::ProcessSendInitialMetadata(
grpc_compression_algorithm_to_stream_compression_algorithm(
compression_algorithm);
// Hint compression algorithm.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (message_compression_algorithm_ != GRPC_MESSAGE_COMPRESS_NONE) {
InitializeState(elem);
error = grpc_metadata_batch_add_tail(
@@ -271,7 +277,7 @@ grpc_error* CallData::ProcessSendInitialMetadata(
if (error != GRPC_ERROR_NONE) return error;
// Do not overwrite accept-encoding header if it already presents (e.g., added
// by some proxy).
- if (!initial_metadata->idx.named.accept_encoding) {
+ if (!initial_metadata->legacy_index()->named.accept_encoding) {
error = grpc_metadata_batch_add_tail(
initial_metadata, &accept_stream_encoding_storage_,
GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(
@@ -281,7 +287,7 @@ grpc_error* CallData::ProcessSendInitialMetadata(
return error;
}
-void CallData::SendMessageOnComplete(void* calld_arg, grpc_error* error) {
+void CallData::SendMessageOnComplete(void* calld_arg, grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(calld_arg);
grpc_slice_buffer_reset_and_unref_internal(&calld->slices_);
grpc_core::Closure::Run(DEBUG_LOCATION,
@@ -348,7 +354,7 @@ void CallData::FinishSendMessage(grpc_call_element* elem) {
}
void CallData::FailSendMessageBatchInCallCombiner(void* calld_arg,
- grpc_error* error) {
+ grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(calld_arg);
if (calld->send_message_batch_ != nullptr) {
grpc_transport_stream_op_batch_finish_with_failure(
@@ -359,9 +365,9 @@ void CallData::FailSendMessageBatchInCallCombiner(void* calld_arg,
}
// Pulls a slice from the send_message byte stream and adds it to slices_.
-grpc_error* CallData::PullSliceFromSendMessage() {
+grpc_error_handle CallData::PullSliceFromSendMessage() {
grpc_slice incoming_slice;
- grpc_error* error =
+ grpc_error_handle error =
send_message_batch_->payload->send_message.send_message->Pull(
&incoming_slice);
if (error == GRPC_ERROR_NONE) {
@@ -382,7 +388,7 @@ void CallData::ContinueReadingSendMessage(grpc_call_element* elem) {
}
while (send_message_batch_->payload->send_message.send_message->Next(
~static_cast<size_t>(0), &on_send_message_next_done_)) {
- grpc_error* error = PullSliceFromSendMessage();
+ grpc_error_handle error = PullSliceFromSendMessage();
if (error != GRPC_ERROR_NONE) {
// Closure callback; does not take ownership of error.
FailSendMessageBatchInCallCombiner(this, error);
@@ -398,7 +404,7 @@ void CallData::ContinueReadingSendMessage(grpc_call_element* elem) {
}
// Async callback for ByteStream::Next().
-void CallData::OnSendMessageNextDone(void* elem_arg, grpc_error* error) {
+void CallData::OnSendMessageNextDone(void* elem_arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
CallData* calld = static_cast<CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
@@ -421,7 +427,8 @@ void CallData::OnSendMessageNextDone(void* elem_arg, grpc_error* error) {
}
}
-void CallData::StartSendMessageBatch(void* elem_arg, grpc_error* /*unused*/) {
+void CallData::StartSendMessageBatch(void* elem_arg,
+ grpc_error_handle /*unused*/) {
grpc_call_element* elem = static_cast<grpc_call_element*>(elem_arg);
CallData* calld = static_cast<CallData*>(elem->call_data);
if (calld->SkipMessageCompression()) {
@@ -458,7 +465,7 @@ void CallData::CompressStartTransportStreamOpBatch(
// Handle send_initial_metadata.
if (batch->send_initial_metadata) {
GPR_ASSERT(!seen_initial_metadata_);
- grpc_error* error = ProcessSendInitialMetadata(
+ grpc_error_handle error = ProcessSendInitialMetadata(
elem, batch->payload->send_initial_metadata.send_initial_metadata);
if (error != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(batch, error,
@@ -503,8 +510,8 @@ void CompressStartTransportStreamOpBatch(
}
/* Constructor for call_data */
-grpc_error* CompressInitCallElem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+grpc_error_handle CompressInitCallElem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
new (elem->call_data) CallData(elem, *args);
return GRPC_ERROR_NONE;
}
@@ -518,8 +525,8 @@ void CompressDestroyCallElem(grpc_call_element* elem,
}
/* Constructor for ChannelData */
-grpc_error* CompressInitChannelElem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+grpc_error_handle CompressInitChannelElem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
}
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
index 93fbe5db8e8..0fc6831a819 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/message_compress/message_decompress_filter.cc
@@ -24,13 +24,13 @@
#include <string.h>
#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
#include <grpc/compression.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "y_absl/strings/str_format.h"
#include "src/core/ext/filters/message_size/message_size_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/compression/algorithm_metadata.h"
@@ -89,24 +89,24 @@ class CallData {
grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
private:
- static void OnRecvInitialMetadataReady(void* arg, grpc_error* error);
+ static void OnRecvInitialMetadataReady(void* arg, grpc_error_handle error);
// Methods for processing a receive message event
void MaybeResumeOnRecvMessageReady();
- static void OnRecvMessageReady(void* arg, grpc_error* error);
- static void OnRecvMessageNextDone(void* arg, grpc_error* error);
- grpc_error* PullSliceFromRecvMessage();
+ static void OnRecvMessageReady(void* arg, grpc_error_handle error);
+ static void OnRecvMessageNextDone(void* arg, grpc_error_handle error);
+ grpc_error_handle PullSliceFromRecvMessage();
void ContinueReadingRecvMessage();
void FinishRecvMessage();
- void ContinueRecvMessageReadyCallback(grpc_error* error);
+ void ContinueRecvMessageReadyCallback(grpc_error_handle error);
// Methods for processing a recv_trailing_metadata event
void MaybeResumeOnRecvTrailingMetadataReady();
- static void OnRecvTrailingMetadataReady(void* arg, grpc_error* error);
+ static void OnRecvTrailingMetadataReady(void* arg, grpc_error_handle error);
CallCombiner* call_combiner_;
// Overall error for the call
- grpc_error* error_ = GRPC_ERROR_NONE;
+ grpc_error_handle error_ = GRPC_ERROR_NONE;
// Fields for handling recv_initial_metadata_ready callback
grpc_closure on_recv_initial_metadata_ready_;
grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
@@ -130,7 +130,7 @@ class CallData {
bool seen_recv_trailing_metadata_ready_ = false;
grpc_closure on_recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
- grpc_error* on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
};
grpc_message_compression_algorithm DecodeMessageCompressionAlgorithm(
@@ -149,11 +149,11 @@ grpc_message_compression_algorithm DecodeMessageCompressionAlgorithm(
return algorithm;
}
-void CallData::OnRecvInitialMetadataReady(void* arg, grpc_error* error) {
+void CallData::OnRecvInitialMetadataReady(void* arg, grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(arg);
if (error == GRPC_ERROR_NONE) {
grpc_linked_mdelem* grpc_encoding =
- calld->recv_initial_metadata_->idx.named.grpc_encoding;
+ calld->recv_initial_metadata_->legacy_index()->named.grpc_encoding;
if (grpc_encoding != nullptr) {
calld->algorithm_ = DecodeMessageCompressionAlgorithm(grpc_encoding->md);
}
@@ -174,7 +174,7 @@ void CallData::MaybeResumeOnRecvMessageReady() {
}
}
-void CallData::OnRecvMessageReady(void* arg, grpc_error* error) {
+void CallData::OnRecvMessageReady(void* arg, grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(arg);
if (error == GRPC_ERROR_NONE) {
if (calld->original_recv_initial_metadata_ready_ != nullptr) {
@@ -196,12 +196,12 @@ void CallData::OnRecvMessageReady(void* arg, grpc_error* error) {
if (calld->max_recv_message_length_ >= 0 &&
(*calld->recv_message_)->length() >
static_cast<uint32_t>(calld->max_recv_message_length_)) {
- TString message_string = y_absl::StrFormat(
- "Received message larger than max (%u vs. %d)",
- (*calld->recv_message_)->length(), calld->max_recv_message_length_);
GPR_DEBUG_ASSERT(calld->error_ == GRPC_ERROR_NONE);
calld->error_ = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(message_string.c_str()),
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Received message larger than max (%u vs. %d)",
+ (*calld->recv_message_)->length(),
+ calld->max_recv_message_length_)),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
return calld->ContinueRecvMessageReadyCallback(
GRPC_ERROR_REF(calld->error_));
@@ -218,7 +218,7 @@ void CallData::ContinueReadingRecvMessage() {
while ((*recv_message_)
->Next((*recv_message_)->length() - recv_slices_.length,
&on_recv_message_next_done_)) {
- grpc_error* error = PullSliceFromRecvMessage();
+ grpc_error_handle error = PullSliceFromRecvMessage();
if (error != GRPC_ERROR_NONE) {
return ContinueRecvMessageReadyCallback(error);
}
@@ -229,16 +229,16 @@ void CallData::ContinueReadingRecvMessage() {
}
}
-grpc_error* CallData::PullSliceFromRecvMessage() {
+grpc_error_handle CallData::PullSliceFromRecvMessage() {
grpc_slice incoming_slice;
- grpc_error* error = (*recv_message_)->Pull(&incoming_slice);
+ grpc_error_handle error = (*recv_message_)->Pull(&incoming_slice);
if (error == GRPC_ERROR_NONE) {
grpc_slice_buffer_add(&recv_slices_, incoming_slice);
}
return error;
}
-void CallData::OnRecvMessageNextDone(void* arg, grpc_error* error) {
+void CallData::OnRecvMessageNextDone(void* arg, grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(arg);
if (error != GRPC_ERROR_NONE) {
return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error));
@@ -260,11 +260,10 @@ void CallData::FinishRecvMessage() {
if (grpc_msg_decompress(algorithm_, &recv_slices_, &decompressed_slices) ==
0) {
GPR_DEBUG_ASSERT(error_ == GRPC_ERROR_NONE);
- error_ = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_ = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("Unexpected error decompressing data for algorithm with "
"enum value ",
- algorithm_)
- .c_str());
+ algorithm_));
grpc_slice_buffer_destroy_internal(&decompressed_slices);
} else {
uint32_t recv_flags =
@@ -283,7 +282,7 @@ void CallData::FinishRecvMessage() {
ContinueRecvMessageReadyCallback(GRPC_ERROR_REF(error_));
}
-void CallData::ContinueRecvMessageReadyCallback(grpc_error* error) {
+void CallData::ContinueRecvMessageReadyCallback(grpc_error_handle error) {
MaybeResumeOnRecvTrailingMetadataReady();
// The surface will clean up the receiving stream if there is an error.
grpc_closure* closure = original_recv_message_ready_;
@@ -294,14 +293,14 @@ void CallData::ContinueRecvMessageReadyCallback(grpc_error* error) {
void CallData::MaybeResumeOnRecvTrailingMetadataReady() {
if (seen_recv_trailing_metadata_ready_) {
seen_recv_trailing_metadata_ready_ = false;
- grpc_error* error = on_recv_trailing_metadata_ready_error_;
+ grpc_error_handle error = on_recv_trailing_metadata_ready_error_;
on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_trailing_metadata_ready_,
error, "Continuing OnRecvTrailingMetadataReady");
}
}
-void CallData::OnRecvTrailingMetadataReady(void* arg, grpc_error* error) {
+void CallData::OnRecvTrailingMetadataReady(void* arg, grpc_error_handle error) {
CallData* calld = static_cast<CallData*>(arg);
if (calld->original_recv_initial_metadata_ready_ != nullptr ||
calld->original_recv_message_ready_ != nullptr) {
@@ -356,8 +355,8 @@ void DecompressStartTransportStreamOpBatch(
calld->DecompressStartTransportStreamOpBatch(elem, batch);
}
-grpc_error* DecompressInitCallElem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+grpc_error_handle DecompressInitCallElem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
new (elem->call_data) CallData(*args, chand);
return GRPC_ERROR_NONE;
@@ -370,8 +369,8 @@ void DecompressDestroyCallElem(grpc_call_element* elem,
calld->~CallData();
}
-grpc_error* DecompressInitChannelElem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+grpc_error_handle DecompressInitChannelElem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
new (chand) ChannelData(args);
return GRPC_ERROR_NONE;
diff --git a/contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc b/contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc
index e4ece548b55..1fd26386ae2 100644
--- a/contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/http/server/http_server_filter.cc
@@ -20,9 +20,11 @@
#include "src/core/ext/filters/http/server/http_server_filter.h"
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/profiling/timers.h"
@@ -35,9 +37,11 @@
#define EXPECTED_CONTENT_TYPE "application/grpc"
#define EXPECTED_CONTENT_TYPE_LENGTH (sizeof(EXPECTED_CONTENT_TYPE) - 1)
-static void hs_recv_initial_metadata_ready(void* user_data, grpc_error* err);
-static void hs_recv_trailing_metadata_ready(void* user_data, grpc_error* err);
-static void hs_recv_message_ready(void* user_data, grpc_error* err);
+static void hs_recv_initial_metadata_ready(void* user_data,
+ grpc_error_handle err);
+static void hs_recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle err);
+static void hs_recv_message_ready(void* user_data, grpc_error_handle err);
namespace {
@@ -74,7 +78,7 @@ struct call_data {
// State for intercepting recv_initial_metadata.
grpc_closure recv_initial_metadata_ready;
- grpc_error* recv_initial_metadata_ready_error = GRPC_ERROR_NONE;
+ grpc_error_handle recv_initial_metadata_ready_error = GRPC_ERROR_NONE;
grpc_closure* original_recv_initial_metadata_ready;
grpc_metadata_batch* recv_initial_metadata = nullptr;
uint32_t* recv_initial_metadata_flags;
@@ -89,7 +93,7 @@ struct call_data {
// State for intercepting recv_trailing_metadata
grpc_closure recv_trailing_metadata_ready;
grpc_closure* original_recv_trailing_metadata_ready;
- grpc_error* recv_trailing_metadata_ready_error;
+ grpc_error_handle recv_trailing_metadata_ready_error;
bool seen_recv_trailing_metadata_ready = false;
};
@@ -99,23 +103,17 @@ struct channel_data {
} // namespace
-static grpc_error* hs_filter_outgoing_metadata(grpc_metadata_batch* b) {
- if (b->idx.named.grpc_message != nullptr) {
- grpc_slice pct_encoded_msg = grpc_percent_encode_slice(
- GRPC_MDVALUE(b->idx.named.grpc_message->md),
- grpc_compatible_percent_encoding_unreserved_bytes);
- if (grpc_slice_is_equivalent(pct_encoded_msg,
- GRPC_MDVALUE(b->idx.named.grpc_message->md))) {
- grpc_slice_unref_internal(pct_encoded_msg);
- } else {
- grpc_metadata_batch_set_value(b->idx.named.grpc_message, pct_encoded_msg);
- }
+static grpc_error_handle hs_filter_outgoing_metadata(grpc_metadata_batch* b) {
+ if (grpc_core::Slice* grpc_message =
+ b->get_pointer(grpc_core::GrpcMessageMetadata())) {
+ *grpc_message = grpc_core::PercentEncodeSlice(
+ std::move(*grpc_message), grpc_core::PercentEncodingType::Compatible);
}
return GRPC_ERROR_NONE;
}
-static void hs_add_error(const char* error_name, grpc_error** cumulative,
- grpc_error* new_err) {
+static void hs_add_error(const char* error_name, grpc_error_handle* cumulative,
+ grpc_error_handle new_err) {
if (new_err == GRPC_ERROR_NONE) return;
if (*cumulative == GRPC_ERROR_NONE) {
*cumulative = GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_name);
@@ -149,24 +147,25 @@ static bool md_strict_equal(grpc_mdelem a, grpc_mdelem b_static) {
}
}
-static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem,
- grpc_metadata_batch* b) {
+static grpc_error_handle hs_filter_incoming_metadata(grpc_call_element* elem,
+ grpc_metadata_batch* b) {
call_data* calld = static_cast<call_data*>(elem->call_data);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* error_name = "Failed processing incoming headers";
- if (b->idx.named.method != nullptr) {
- if (md_strict_equal(b->idx.named.method->md, GRPC_MDELEM_METHOD_POST)) {
+ if (b->legacy_index()->named.method != nullptr) {
+ if (md_strict_equal(b->legacy_index()->named.method->md,
+ GRPC_MDELEM_METHOD_POST)) {
*calld->recv_initial_metadata_flags &=
~(GRPC_INITIAL_METADATA_CACHEABLE_REQUEST |
GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST);
- } else if (md_strict_equal(b->idx.named.method->md,
+ } else if (md_strict_equal(b->legacy_index()->named.method->md,
GRPC_MDELEM_METHOD_PUT)) {
*calld->recv_initial_metadata_flags &=
~GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
*calld->recv_initial_metadata_flags |=
GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST;
- } else if (md_strict_equal(b->idx.named.method->md,
+ } else if (md_strict_equal(b->legacy_index()->named.method->md,
GRPC_MDELEM_METHOD_GET)) {
*calld->recv_initial_metadata_flags |=
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST;
@@ -176,64 +175,63 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem,
hs_add_error(error_name, &error,
grpc_attach_md_to_error(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.method->md));
+ b->legacy_index()->named.method->md));
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_METHOD);
+ b->Remove(GRPC_BATCH_METHOD);
} else {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":method")));
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":method"));
}
- if (b->idx.named.te != nullptr) {
- if (!grpc_mdelem_static_value_eq(b->idx.named.te->md,
- GRPC_MDELEM_TE_TRAILERS)) {
- hs_add_error(error_name, &error,
- grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.te->md));
- }
- grpc_metadata_batch_remove(b, GRPC_BATCH_TE);
- } else {
+ auto te = b->Take(grpc_core::TeMetadata());
+ if (te == grpc_core::TeMetadata::kTrailers) {
+ // Do nothing, ok.
+ } else if (!te.has_value()) {
hs_add_error(error_name, &error,
grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string("te")));
+ GRPC_ERROR_STR_KEY, "te"));
+ } else {
+ hs_add_error(error_name, &error,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad te header"));
}
- if (b->idx.named.scheme != nullptr) {
- if (!md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTP) &&
- !md_strict_equal(b->idx.named.scheme->md, GRPC_MDELEM_SCHEME_HTTPS) &&
- !grpc_mdelem_static_value_eq(b->idx.named.scheme->md,
+ if (b->legacy_index()->named.scheme != nullptr) {
+ if (!md_strict_equal(b->legacy_index()->named.scheme->md,
+ GRPC_MDELEM_SCHEME_HTTP) &&
+ !md_strict_equal(b->legacy_index()->named.scheme->md,
+ GRPC_MDELEM_SCHEME_HTTPS) &&
+ !grpc_mdelem_static_value_eq(b->legacy_index()->named.scheme->md,
GRPC_MDELEM_SCHEME_GRPC)) {
hs_add_error(error_name, &error,
grpc_attach_md_to_error(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad header"),
- b->idx.named.scheme->md));
+ b->legacy_index()->named.scheme->md));
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_SCHEME);
+ b->Remove(GRPC_BATCH_SCHEME);
} else {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":scheme")));
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":scheme"));
}
- if (b->idx.named.content_type != nullptr) {
+ if (b->legacy_index()->named.content_type != nullptr) {
if (!grpc_mdelem_static_value_eq(
- b->idx.named.content_type->md,
+ b->legacy_index()->named.content_type->md,
GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC)) {
- if (grpc_slice_buf_start_eq(GRPC_MDVALUE(b->idx.named.content_type->md),
- EXPECTED_CONTENT_TYPE,
- EXPECTED_CONTENT_TYPE_LENGTH) &&
+ if (grpc_slice_buf_start_eq(
+ GRPC_MDVALUE(b->legacy_index()->named.content_type->md),
+ EXPECTED_CONTENT_TYPE, EXPECTED_CONTENT_TYPE_LENGTH) &&
(GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
+ b->legacy_index()
+ ->named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
'+' ||
GRPC_SLICE_START_PTR(GRPC_MDVALUE(
- b->idx.named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
+ b->legacy_index()
+ ->named.content_type->md))[EXPECTED_CONTENT_TYPE_LENGTH] ==
';')) {
/* Although the C implementation doesn't (currently) generate them,
any custom +-suffix is explicitly valid. */
@@ -243,27 +241,27 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem,
} else {
/* TODO(klempner): We're currently allowing this, but we shouldn't
see it without a proxy so log for now. */
- char* val = grpc_dump_slice(GRPC_MDVALUE(b->idx.named.content_type->md),
- GPR_DUMP_ASCII);
+ char* val = grpc_dump_slice(
+ GRPC_MDVALUE(b->legacy_index()->named.content_type->md),
+ GPR_DUMP_ASCII);
gpr_log(GPR_INFO, "Unexpected content-type '%s'", val);
gpr_free(val);
}
}
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_TYPE);
+ b->Remove(GRPC_BATCH_CONTENT_TYPE);
}
- if (b->idx.named.path == nullptr) {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":path")));
+ if (b->legacy_index()->named.path == nullptr) {
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":path"));
} else if (*calld->recv_initial_metadata_flags &
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) {
/* We have a cacheable request made with GET verb. The path contains the
* query parameter which is base64 encoded request payload. */
const char k_query_separator = '?';
- grpc_slice path_slice = GRPC_MDVALUE(b->idx.named.path->md);
+ grpc_slice path_slice = GRPC_MDVALUE(b->legacy_index()->named.path->md);
uint8_t* path_ptr = GRPC_SLICE_START_PTR(path_slice);
size_t path_length = GRPC_SLICE_LENGTH(path_slice);
/* offset of the character '?' */
@@ -279,8 +277,8 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem,
grpc_mdelem mdelem_path_without_query = grpc_mdelem_from_slices(
GRPC_MDSTR_PATH, grpc_slice_sub(path_slice, 0, offset));
- grpc_metadata_batch_substitute(b, b->idx.named.path,
- mdelem_path_without_query);
+ (void)b->Substitute(b->legacy_index()->named.path,
+ mdelem_path_without_query);
/* decode payload from query and add to the slice buffer to be returned */
const int k_url_safe = 1;
@@ -300,37 +298,30 @@ static grpc_error* hs_filter_incoming_metadata(grpc_call_element* elem,
}
}
- if (b->idx.named.host != nullptr && b->idx.named.authority == nullptr) {
- grpc_linked_mdelem* el = b->idx.named.host;
- grpc_mdelem md = GRPC_MDELEM_REF(el->md);
- grpc_metadata_batch_remove(b, el);
- hs_add_error(
- error_name, &error,
- grpc_metadata_batch_add_head(
- b, el,
- grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY,
- grpc_slice_ref_internal(GRPC_MDVALUE(md))),
- GRPC_BATCH_AUTHORITY));
- GRPC_MDELEM_UNREF(md);
+ if (b->legacy_index()->named.authority == nullptr) {
+ y_absl::optional<grpc_core::Slice> host = b->Take(grpc_core::HostMetadata());
+ if (host.has_value()) {
+ b->Append(":authority", std::move(*host));
+ }
}
- if (b->idx.named.authority == nullptr) {
- hs_add_error(
- error_name, &error,
- grpc_error_set_str(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
- GRPC_ERROR_STR_KEY, grpc_slice_from_static_string(":authority")));
+ if (b->legacy_index()->named.authority == nullptr) {
+ hs_add_error(error_name, &error,
+ grpc_error_set_str(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Missing header"),
+ GRPC_ERROR_STR_KEY, ":authority"));
}
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
- if (!chand->surface_user_agent && b->idx.named.user_agent != nullptr) {
- grpc_metadata_batch_remove(b, GRPC_BATCH_USER_AGENT);
+ if (!chand->surface_user_agent) {
+ b->Remove(grpc_core::UserAgentMetadata());
}
return error;
}
-static void hs_recv_initial_metadata_ready(void* user_data, grpc_error* err) {
+static void hs_recv_initial_metadata_ready(void* user_data,
+ grpc_error_handle err) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->seen_recv_initial_metadata_ready = true;
@@ -354,7 +345,7 @@ static void hs_recv_initial_metadata_ready(void* user_data, grpc_error* err) {
"resuming recv_message_ready from recv_initial_metadata_ready");
}
} else {
- GRPC_ERROR_REF(err);
+ (void)GRPC_ERROR_REF(err);
}
if (calld->seen_recv_trailing_metadata_ready) {
GRPC_CALL_COMBINER_START(calld->call_combiner,
@@ -367,7 +358,7 @@ static void hs_recv_initial_metadata_ready(void* user_data, grpc_error* err) {
calld->original_recv_initial_metadata_ready, err);
}
-static void hs_recv_message_ready(void* user_data, grpc_error* err) {
+static void hs_recv_message_ready(void* user_data, grpc_error_handle err) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
calld->seen_recv_message_ready = true;
@@ -392,7 +383,8 @@ static void hs_recv_message_ready(void* user_data, grpc_error* err) {
}
}
-static void hs_recv_trailing_metadata_ready(void* user_data, grpc_error* err) {
+static void hs_recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle err) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (!calld->seen_recv_initial_metadata_ready) {
@@ -410,13 +402,13 @@ static void hs_recv_trailing_metadata_ready(void* user_data, grpc_error* err) {
calld->original_recv_trailing_metadata_ready, err);
}
-static grpc_error* hs_mutate_op(grpc_call_element* elem,
- grpc_transport_stream_op_batch* op) {
+static grpc_error_handle hs_mutate_op(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op) {
/* grab pointers to our data from the call element */
call_data* calld = static_cast<call_data*>(elem->call_data);
if (op->send_initial_metadata) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* error_name = "Failed sending initial metadata";
hs_add_error(
error_name, &error,
@@ -463,7 +455,7 @@ static grpc_error* hs_mutate_op(grpc_call_element* elem,
}
if (op->send_trailing_metadata) {
- grpc_error* error = hs_filter_outgoing_metadata(
+ grpc_error_handle error = hs_filter_outgoing_metadata(
op->payload->send_trailing_metadata.send_trailing_metadata);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -475,7 +467,7 @@ static void hs_start_transport_stream_op_batch(
grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
GPR_TIMER_SCOPE("hs_start_transport_stream_op_batch", 0);
call_data* calld = static_cast<call_data*>(elem->call_data);
- grpc_error* error = hs_mutate_op(elem, op);
+ grpc_error_handle error = hs_mutate_op(elem, op);
if (error != GRPC_ERROR_NONE) {
grpc_transport_stream_op_batch_finish_with_failure(op, error,
calld->call_combiner);
@@ -485,8 +477,8 @@ static void hs_start_transport_stream_op_batch(
}
/* Constructor for call_data */
-static grpc_error* hs_init_call_elem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+static grpc_error_handle hs_init_call_elem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
new (elem->call_data) call_data(elem, *args);
return GRPC_ERROR_NONE;
}
@@ -500,8 +492,8 @@ static void hs_destroy_call_elem(grpc_call_element* elem,
}
/* Constructor for channel_data */
-static grpc_error* hs_init_channel_elem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+static grpc_error_handle hs_init_channel_elem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
GPR_ASSERT(!args->is_last);
chand->surface_user_agent = grpc_channel_arg_get_bool(
diff --git a/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc b/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
index f34f7d4325c..f9c2b983bb6 100644
--- a/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/max_age/max_age_filter.cc
@@ -25,8 +25,8 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/http2_errors.h"
/* If these settings change, make sure that we are not sending a GOAWAY for
@@ -206,7 +206,8 @@ static void decrease_call_count(channel_data* chand) {
}
}
-static void start_max_idle_timer_after_init(void* arg, grpc_error* /*error*/) {
+static void start_max_idle_timer_after_init(void* arg,
+ grpc_error_handle /*error*/) {
channel_data* chand = static_cast<channel_data*>(arg);
/* Decrease call_count. If there are no active calls at this time,
max_idle_timer will start here. If the number of active calls is not 0,
@@ -258,7 +259,8 @@ class ConnectivityWatcher : public AsyncConnectivityStateWatcherInterface {
} // namespace grpc_core
-static void start_max_age_timer_after_init(void* arg, grpc_error* /*error*/) {
+static void start_max_age_timer_after_init(void* arg,
+ grpc_error_handle /*error*/) {
channel_data* chand = static_cast<channel_data*>(arg);
{
grpc_core::MutexLock lock(&chand->max_age_timer_mu);
@@ -277,8 +279,8 @@ static void start_max_age_timer_after_init(void* arg, grpc_error* /*error*/) {
"max_age start_max_age_timer_after_init");
}
-static void start_max_age_grace_timer_after_goaway_op(void* arg,
- grpc_error* /*error*/) {
+static void start_max_age_grace_timer_after_goaway_op(
+ void* arg, grpc_error_handle /*error*/) {
channel_data* chand = static_cast<channel_data*>(arg);
{
grpc_core::MutexLock lock(&chand->max_age_timer_mu);
@@ -307,7 +309,7 @@ static void close_max_idle_channel(channel_data* chand) {
elem->filter->start_transport_op(elem, op);
}
-static void max_idle_timer_cb(void* arg, grpc_error* error) {
+static void max_idle_timer_cb(void* arg, grpc_error_handle error) {
channel_data* chand = static_cast<channel_data*>(arg);
if (error == GRPC_ERROR_NONE) {
bool try_again = true;
@@ -351,7 +353,7 @@ static void max_idle_timer_cb(void* arg, grpc_error* error) {
GRPC_CHANNEL_STACK_UNREF(chand->channel_stack, "max_age max_idle_timer");
}
-static void close_max_age_channel(void* arg, grpc_error* error) {
+static void close_max_age_channel(void* arg, grpc_error_handle error) {
channel_data* chand = static_cast<channel_data*>(arg);
{
grpc_core::MutexLock lock(&chand->max_age_timer_mu);
@@ -374,7 +376,7 @@ static void close_max_age_channel(void* arg, grpc_error* error) {
GRPC_CHANNEL_STACK_UNREF(chand->channel_stack, "max_age max_age_timer");
}
-static void force_close_max_age_channel(void* arg, grpc_error* error) {
+static void force_close_max_age_channel(void* arg, grpc_error_handle error) {
channel_data* chand = static_cast<channel_data*>(arg);
{
grpc_core::MutexLock lock(&chand->max_age_timer_mu);
@@ -412,7 +414,7 @@ add_random_max_connection_age_jitter_and_convert_to_grpc_millis(int value) {
}
/* Constructor for call_data. */
-static grpc_error* max_age_init_call_elem(
+static grpc_error_handle max_age_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
increase_call_count(chand);
@@ -428,8 +430,8 @@ static void max_age_destroy_call_elem(
}
/* Constructor for channel_data. */
-static grpc_error* max_age_init_channel_elem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+static grpc_error_handle max_age_init_channel_elem(
+ grpc_channel_element* elem, grpc_channel_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
new (chand) channel_data();
chand->channel_stack = args->channel_stack;
@@ -532,29 +534,27 @@ const grpc_channel_filter grpc_max_age_filter = {
grpc_channel_next_get_info,
"max_age"};
-static bool maybe_add_max_age_filter(grpc_channel_stack_builder* builder,
- void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- bool enable =
- grpc_channel_arg_get_integer(
- grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS),
- MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX ||
- grpc_channel_arg_get_integer(
- grpc_channel_args_find(channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS),
- MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX;
- if (enable) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_max_age_filter, nullptr, nullptr);
- } else {
- return true;
- }
-}
-
-void grpc_max_age_filter_init(void) {
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_max_age_filter, nullptr);
+namespace grpc_core {
+void RegisterMaxAgeFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](grpc_channel_stack_builder* builder) {
+ const grpc_channel_args* channel_args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ bool enable = grpc_channel_arg_get_integer(
+ grpc_channel_args_find(
+ channel_args, GRPC_ARG_MAX_CONNECTION_AGE_MS),
+ MAX_CONNECTION_AGE_INTEGER_OPTIONS) != INT_MAX ||
+ grpc_channel_arg_get_integer(
+ grpc_channel_args_find(
+ channel_args, GRPC_ARG_MAX_CONNECTION_IDLE_MS),
+ MAX_CONNECTION_IDLE_INTEGER_OPTIONS) != INT_MAX;
+ if (enable) {
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &grpc_max_age_filter, nullptr, nullptr);
+ } else {
+ return true;
+ }
+ });
}
-
-void grpc_max_age_filter_shutdown(void) {}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
index a8ebe787db4..b9479e3c838 100644
--- a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.cc
@@ -27,18 +27,18 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_call_data.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
-static void recv_message_ready(void* user_data, grpc_error* error);
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* error);
+static void recv_message_ready(void* user_data, grpc_error_handle error);
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle error);
namespace grpc_core {
@@ -67,9 +67,10 @@ const MessageSizeParsedConfig* MessageSizeParsedConfig::GetFromCallContext(
std::unique_ptr<ServiceConfigParser::ParsedConfig>
MessageSizeParser::ParsePerMethodParams(const grpc_channel_args* /*args*/,
- const Json& json, grpc_error** error) {
+ const Json& json,
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr && *error == GRPC_ERROR_NONE);
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
// Max request size.
int max_request_message_bytes = -1;
auto it = json.object_value().find("maxRequestMessageBytes");
@@ -179,7 +180,7 @@ struct call_data {
grpc_closure recv_message_ready;
grpc_closure recv_trailing_metadata_ready;
// The error caused by a message that is too large, or GRPC_ERROR_NONE
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Used by recv_message_ready.
grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message = nullptr;
// Original recv_message_ready callback, invoked after our own.
@@ -187,31 +188,29 @@ struct call_data {
// Original recv_trailing_metadata callback, invoked after our own.
grpc_closure* original_recv_trailing_metadata_ready;
bool seen_recv_trailing_metadata = false;
- grpc_error* recv_trailing_metadata_error;
+ grpc_error_handle recv_trailing_metadata_error;
};
} // namespace
// Callback invoked when we receive a message. Here we check the max
// receive message size.
-static void recv_message_ready(void* user_data, grpc_error* error) {
+static void recv_message_ready(void* user_data, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (*calld->recv_message != nullptr && calld->limits.max_recv_size >= 0 &&
(*calld->recv_message)->length() >
static_cast<size_t>(calld->limits.max_recv_size)) {
- grpc_error* new_error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Received message larger than max (%u vs. %d)",
- (*calld->recv_message)->length(),
- calld->limits.max_recv_size)
- .c_str()),
+ grpc_error_handle new_error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Received message larger than max (%u vs. %d)",
+ (*calld->recv_message)->length(), calld->limits.max_recv_size)),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
error = grpc_error_add_child(GRPC_ERROR_REF(error), new_error);
GRPC_ERROR_UNREF(calld->error);
calld->error = GRPC_ERROR_REF(error);
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
// Invoke the next callback.
grpc_closure* closure = calld->next_recv_message_ready;
@@ -233,7 +232,8 @@ static void recv_message_ready(void* user_data, grpc_error* error) {
// Callback invoked on completion of recv_trailing_metadata
// Notifies the recv_trailing_metadata batch of any message size failures
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* error) {
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (calld->next_recv_message_ready != nullptr) {
@@ -261,14 +261,12 @@ static void message_size_start_transport_stream_op_batch(
static_cast<size_t>(calld->limits.max_send_size)) {
grpc_transport_stream_op_batch_finish_with_failure(
op,
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Sent message larger than max (%u vs. %d)",
- op->payload->send_message.send_message->length(),
- calld->limits.max_send_size)
- .c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED),
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Sent message larger than max (%u vs. %d)",
+ op->payload->send_message.send_message->length(),
+ calld->limits.max_send_size)),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_RESOURCE_EXHAUSTED),
calld->call_combiner);
return;
}
@@ -291,7 +289,7 @@ static void message_size_start_transport_stream_op_batch(
}
// Constructor for call_data.
-static grpc_error* message_size_init_call_elem(
+static grpc_error_handle message_size_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
new (elem->call_data) call_data(elem, *chand, *args);
@@ -315,7 +313,7 @@ grpc_core::MessageSizeParsedConfig::message_size_limits get_message_size_limits(
}
// Constructor for channel_data.
-static grpc_error* message_size_init_channel_elem(
+static grpc_error_handle message_size_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
GPR_ASSERT(!args->is_last);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
@@ -345,7 +343,7 @@ const grpc_channel_filter grpc_message_size_filter = {
// Used for GRPC_CLIENT_SUBCHANNEL
static bool maybe_add_message_size_filter_subchannel(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
+ grpc_channel_stack_builder* builder) {
const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
if (grpc_channel_args_want_minimal_stack(channel_args)) {
@@ -357,8 +355,7 @@ static bool maybe_add_message_size_filter_subchannel(
// Used for GRPC_CLIENT_DIRECT_CHANNEL and GRPC_SERVER_CHANNEL. Adds the filter
// only if message size limits or service config is specified.
-static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder,
- void* /*arg*/) {
+static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder) {
const grpc_channel_args* channel_args =
grpc_channel_stack_builder_get_channel_arguments(builder);
if (grpc_channel_args_want_minimal_stack(channel_args)) {
@@ -385,16 +382,21 @@ static bool maybe_add_message_size_filter(grpc_channel_stack_builder* builder,
}
void grpc_message_size_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter_subchannel, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- maybe_add_message_size_filter, nullptr);
grpc_core::MessageSizeParser::Register();
}
void grpc_message_size_filter_shutdown(void) {}
+
+namespace grpc_core {
+void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_SUBCHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_message_size_filter_subchannel);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_message_size_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ maybe_add_message_size_filter);
+}
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
index 0583a789267..b196534394f 100644
--- a/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
+++ b/contrib/libs/grpc/src/core/ext/filters/message_size/message_size_filter.h
@@ -19,7 +19,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_message_size_filter;
@@ -51,7 +51,7 @@ class MessageSizeParser : public ServiceConfigParser::Parser {
public:
std::unique_ptr<ServiceConfigParser::ParsedConfig> ParsePerMethodParams(
const grpc_channel_args* /*args*/, const Json& json,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
static void Register();
diff --git a/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc
new file mode 100644
index 00000000000..85df64e4c2a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.cc
@@ -0,0 +1,67 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/server_config_selector/server_config_selector.h"
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+namespace {
+
+void* ServerConfigSelectorProviderArgCopy(void* p) {
+ ServerConfigSelectorProvider* arg =
+ static_cast<ServerConfigSelectorProvider*>(p);
+ return arg->Ref().release();
+}
+
+void ServerConfigSelectorProviderArgDestroy(void* p) {
+ ServerConfigSelectorProvider* arg =
+ static_cast<ServerConfigSelectorProvider*>(p);
+ arg->Unref();
+}
+
+int ServerConfigSelectorProviderArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
+
+const grpc_arg_pointer_vtable kChannelArgVtable = {
+ ServerConfigSelectorProviderArgCopy, ServerConfigSelectorProviderArgDestroy,
+ ServerConfigSelectorProviderArgCmp};
+
+const char* kServerConfigSelectorProviderChannelArgName =
+ "grpc.internal.server_config_selector_provider";
+
+} // namespace
+
+grpc_arg ServerConfigSelectorProvider::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(kServerConfigSelectorProviderChannelArgName),
+ const_cast<ServerConfigSelectorProvider*>(this), &kChannelArgVtable);
+}
+
+RefCountedPtr<ServerConfigSelectorProvider>
+ServerConfigSelectorProvider::GetFromChannelArgs(
+ const grpc_channel_args& args) {
+ ServerConfigSelectorProvider* config_selector_provider =
+ grpc_channel_args_find_pointer<ServerConfigSelectorProvider>(
+ &args, kServerConfigSelectorProviderChannelArgName);
+ return config_selector_provider != nullptr ? config_selector_provider->Ref()
+ : nullptr;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h
new file mode 100644
index 00000000000..afef9fed9c8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector.h
@@ -0,0 +1,70 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
+#define GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/status/statusor.h"
+
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// ServerConfigSelector allows for choosing the service config to apply to a
+// server-side call based on the received initial metadata.
+class ServerConfigSelector : public RefCounted<ServerConfigSelector> {
+ public:
+ // Configuration to apply to an incoming call
+ struct CallConfig {
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
+ RefCountedPtr<ServiceConfig> service_config;
+ };
+
+ ~ServerConfigSelector() override = default;
+ // Returns the CallConfig to apply to a call based on the incoming \a metadata
+ virtual CallConfig GetCallConfig(grpc_metadata_batch* metadata) = 0;
+};
+
+// ServerConfigSelectorProvider allows for subscribers to watch for updates on
+// ServerConfigSelector. It is propagated via channel args.
+class ServerConfigSelectorProvider
+ : public RefCounted<ServerConfigSelectorProvider> {
+ public:
+ class ServerConfigSelectorWatcher {
+ public:
+ virtual ~ServerConfigSelectorWatcher() = default;
+ virtual void OnServerConfigSelectorUpdate(
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> update) = 0;
+ };
+
+ ~ServerConfigSelectorProvider() override = default;
+ // Only a single watcher is allowed at present
+ virtual y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorWatcher> watcher) = 0;
+ virtual void CancelWatch() = 0;
+
+ grpc_arg MakeChannelArg() const;
+ static RefCountedPtr<ServerConfigSelectorProvider> GetFromChannelArgs(
+ const grpc_channel_args& args);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
new file mode 100644
index 00000000000..89dfc5890b2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc
@@ -0,0 +1,265 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/filters/server_config_selector/server_config_selector_filter.h"
+
+#include "src/core/ext/filters/server_config_selector/server_config_selector.h"
+#include "src/core/ext/service_config/service_config_call_data.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_core {
+
+namespace {
+
+class ChannelData {
+ public:
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
+ static void Destroy(grpc_channel_element* elem);
+
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> config_selector() {
+ MutexLock lock(&mu_);
+ return config_selector_;
+ }
+
+ private:
+ class ServerConfigSelectorWatcher
+ : public ServerConfigSelectorProvider::ServerConfigSelectorWatcher {
+ public:
+ explicit ServerConfigSelectorWatcher(ChannelData* chand) : chand_(chand) {}
+ void OnServerConfigSelectorUpdate(
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> update) override {
+ MutexLock lock(&chand_->mu_);
+ chand_->config_selector_ = std::move(update);
+ }
+
+ private:
+ ChannelData* chand_;
+ };
+
+ explicit ChannelData(RefCountedPtr<ServerConfigSelectorProvider>
+ server_config_selector_provider);
+ ~ChannelData();
+
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider_;
+ Mutex mu_;
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> config_selector_
+ Y_ABSL_GUARDED_BY(mu_);
+};
+
+class CallData {
+ public:
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args* args);
+ static void Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /* final_info */,
+ grpc_closure* /* then_schedule_closure */);
+ static void StartTransportStreamOpBatch(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op);
+
+ private:
+ CallData(grpc_call_element* elem, const grpc_call_element_args& args);
+ ~CallData();
+ static void RecvInitialMetadataReady(void* user_data,
+ grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* user_data,
+ grpc_error_handle error);
+ void MaybeResumeRecvTrailingMetadataReady();
+
+ grpc_call_context_element* call_context_;
+ CallCombiner* call_combiner_;
+ ServiceConfigCallData service_config_call_data_;
+ // Overall error for the call
+ grpc_error_handle error_ = GRPC_ERROR_NONE;
+ // State for keeping track of recv_initial_metadata
+ grpc_metadata_batch* recv_initial_metadata_ = nullptr;
+ grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
+ grpc_closure recv_initial_metadata_ready_;
+ // State for keeping of track of recv_trailing_metadata
+ grpc_closure* original_recv_trailing_metadata_ready_;
+ grpc_closure recv_trailing_metadata_ready_;
+ grpc_error_handle recv_trailing_metadata_ready_error_;
+ bool seen_recv_trailing_metadata_ready_ = false;
+};
+
+// ChannelData
+
+grpc_error_handle ChannelData::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ GPR_ASSERT(elem->filter = &kServerConfigSelectorFilter);
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider =
+ ServerConfigSelectorProvider::GetFromChannelArgs(*args->channel_args);
+ if (server_config_selector_provider == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No ServerConfigSelectorProvider object found");
+ }
+ new (elem->channel_data)
+ ChannelData(std::move(server_config_selector_provider));
+ return GRPC_ERROR_NONE;
+}
+
+void ChannelData::Destroy(grpc_channel_element* elem) {
+ auto* chand = static_cast<ChannelData*>(elem->channel_data);
+ chand->~ChannelData();
+}
+
+ChannelData::ChannelData(
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider)
+ : server_config_selector_provider_(
+ std::move(server_config_selector_provider)) {
+ GPR_ASSERT(server_config_selector_provider_ != nullptr);
+ auto server_config_selector_watcher =
+ y_absl::make_unique<ServerConfigSelectorWatcher>(this);
+ config_selector_ = server_config_selector_provider_->Watch(
+ std::move(server_config_selector_watcher));
+}
+
+ChannelData::~ChannelData() { server_config_selector_provider_->CancelWatch(); }
+
+// CallData
+
+grpc_error_handle CallData::Init(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
+ new (elem->call_data) CallData(elem, *args);
+ return GRPC_ERROR_NONE;
+}
+
+void CallData::Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*then_schedule_closure*/) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
+}
+
+void CallData::StartTransportStreamOpBatch(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ if (op->recv_initial_metadata) {
+ calld->recv_initial_metadata_ =
+ op->payload->recv_initial_metadata.recv_initial_metadata;
+ calld->original_recv_initial_metadata_ready_ =
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &calld->recv_initial_metadata_ready_;
+ }
+ if (op->recv_trailing_metadata) {
+ // We might generate errors on receiving initial metadata which we need to
+ // bubble up through recv_trailing_metadata_ready
+ calld->original_recv_trailing_metadata_ready_ =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
+ &calld->recv_trailing_metadata_ready_;
+ }
+ // Chain to the next filter.
+ grpc_call_next_op(elem, op);
+}
+
+CallData::CallData(grpc_call_element* elem, const grpc_call_element_args& args)
+ : call_context_(args.context), call_combiner_(args.call_combiner) {
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&recv_trailing_metadata_ready_, RecvTrailingMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+}
+
+CallData::~CallData() {
+ // Remove the entry from call context, just in case anyone above us
+ // tries to look at it during call stack destruction.
+ call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = nullptr;
+ GRPC_ERROR_UNREF(error_);
+}
+
+void CallData::RecvInitialMetadataReady(void* user_data,
+ grpc_error_handle error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
+ if (error == GRPC_ERROR_NONE) {
+ auto config_selector = chand->config_selector();
+ if (config_selector.ok()) {
+ auto call_config =
+ config_selector.value()->GetCallConfig(calld->recv_initial_metadata_);
+ if (call_config.error != GRPC_ERROR_NONE) {
+ calld->error_ = call_config.error;
+ error = call_config.error; // Does not take a ref
+ } else {
+ calld->service_config_call_data_ =
+ ServiceConfigCallData(std::move(call_config.service_config),
+ call_config.method_configs, {});
+ calld->call_context_[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value =
+ &calld->service_config_call_data_;
+ }
+ } else {
+ calld->error_ = absl_status_to_grpc_error(config_selector.status());
+ error = calld->error_;
+ }
+ }
+ calld->MaybeResumeRecvTrailingMetadataReady();
+ grpc_closure* closure = calld->original_recv_initial_metadata_ready_;
+ calld->original_recv_initial_metadata_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, GRPC_ERROR_REF(error));
+}
+
+void CallData::RecvTrailingMetadataReady(void* user_data,
+ grpc_error_handle error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ if (calld->original_recv_initial_metadata_ready_ != nullptr) {
+ calld->seen_recv_trailing_metadata_ready_ = true;
+ calld->recv_trailing_metadata_ready_error_ = GRPC_ERROR_REF(error);
+ GRPC_CALL_COMBINER_STOP(calld->call_combiner_,
+ "Deferring RecvTrailingMetadataReady until after "
+ "RecvInitialMetadataReady");
+ return;
+ }
+ error = grpc_error_add_child(GRPC_ERROR_REF(error), calld->error_);
+ calld->error_ = GRPC_ERROR_NONE;
+ grpc_closure* closure = calld->original_recv_trailing_metadata_ready_;
+ calld->original_recv_trailing_metadata_ready_ = nullptr;
+ Closure::Run(DEBUG_LOCATION, closure, error);
+}
+
+void CallData::MaybeResumeRecvTrailingMetadataReady() {
+ if (seen_recv_trailing_metadata_ready_) {
+ seen_recv_trailing_metadata_ready_ = false;
+ grpc_error_handle error = recv_trailing_metadata_ready_error_;
+ recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
+ GRPC_CALL_COMBINER_START(call_combiner_, &recv_trailing_metadata_ready_,
+ error, "Continuing RecvTrailingMetadataReady");
+ }
+}
+
+} // namespace
+
+const grpc_channel_filter kServerConfigSelectorFilter = {
+ CallData::StartTransportStreamOpBatch,
+ grpc_channel_next_op,
+ sizeof(CallData),
+ CallData::Init,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ CallData::Destroy,
+ sizeof(ChannelData),
+ ChannelData::Init,
+ ChannelData::Destroy,
+ grpc_channel_next_get_info,
+ "server_config_selector_filter",
+};
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.h b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h
index 68b32cc891e..370a229be48 100644
--- a/contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.h
+++ b/contrib/libs/grpc/src/core/ext/filters/server_config_selector/server_config_selector_filter.h
@@ -1,4 +1,6 @@
-// Copyright 2020 gRPC authors.
+//
+//
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -11,21 +13,20 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
+//
+//
-#ifndef GRPC_TEST_CORE_UTIL_EVAL_ARGS_MOCK_ENDPOINT_H
-#define GRPC_TEST_CORE_UTIL_EVAL_ARGS_MOCK_ENDPOINT_H
+#ifndef GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
+#define GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/channel/channel_stack.h"
namespace grpc_core {
-grpc_endpoint* CreateEvalArgsMockEndpoint(const char* local_address,
- const int local_port,
- const char* peer_address,
- const int peer_port);
+extern const grpc_channel_filter kServerConfigSelectorFilter;
} // namespace grpc_core
-#endif // GRPC_TEST_CORE_UTIL_EVAL_ARGS_MOCK_ENDPOINT_H
+#endif // GRPC_CORE_EXT_FILTERS_SERVER_CONFIG_SELECTOR_SERVER_CONFIG_SELECTOR_FILTER_H
diff --git a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc b/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
deleted file mode 100644
index 40239d6c300..00000000000
--- a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc
+++ /dev/null
@@ -1,210 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/workarounds/workaround_cronet_compression_filter.h"
-
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-
-#include "src/core/ext/filters/workarounds/workaround_utils.h"
-#include "src/core/lib/channel/channel_stack_builder.h"
-#include "src/core/lib/surface/channel_init.h"
-#include "src/core/lib/transport/metadata.h"
-
-namespace {
-struct call_data {
- // Receive closures are chained: we inject this closure as the
- // recv_initial_metadata_ready up-call on transport_stream_op, and remember to
- // call our next_recv_initial_metadata_ready member after handling it.
- grpc_closure recv_initial_metadata_ready;
- // Used by recv_initial_metadata_ready.
- grpc_metadata_batch* recv_initial_metadata;
- // Original recv_initial_metadata_ready callback, invoked after our own.
- grpc_closure* next_recv_initial_metadata_ready;
-
- // Marks whether the workaround is active
- bool workaround_active;
-};
-} // namespace
-
-// Find the user agent metadata element in the batch
-static bool get_user_agent_mdelem(const grpc_metadata_batch* batch,
- grpc_mdelem* md) {
- if (batch->idx.named.user_agent != nullptr) {
- *md = batch->idx.named.user_agent->md;
- return true;
- }
- return false;
-}
-
-// Callback invoked when we receive an initial metadata.
-static void recv_initial_metadata_ready(void* user_data, grpc_error* error) {
- grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
- call_data* calld = static_cast<call_data*>(elem->call_data);
-
- if (GRPC_ERROR_NONE == error) {
- grpc_mdelem md;
- if (get_user_agent_mdelem(calld->recv_initial_metadata, &md)) {
- grpc_workaround_user_agent_md* user_agent_md = grpc_parse_user_agent(md);
- if (user_agent_md
- ->workaround_active[GRPC_WORKAROUND_ID_CRONET_COMPRESSION]) {
- calld->workaround_active = true;
- }
- }
- }
-
- // Invoke the next callback.
- grpc_core::Closure::Run(DEBUG_LOCATION,
- calld->next_recv_initial_metadata_ready,
- GRPC_ERROR_REF(error));
-}
-
-// Start transport stream op.
-static void cronet_compression_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
-
- // Inject callback for receiving initial metadata
- if (op->recv_initial_metadata) {
- calld->next_recv_initial_metadata_ready =
- op->payload->recv_initial_metadata.recv_initial_metadata_ready;
- op->payload->recv_initial_metadata.recv_initial_metadata_ready =
- &calld->recv_initial_metadata_ready;
- calld->recv_initial_metadata =
- op->payload->recv_initial_metadata.recv_initial_metadata;
- }
-
- if (op->send_message) {
- /* Send message happens after client's user-agent (initial metadata) is
- * received, so workaround_active must be set already */
- if (calld->workaround_active) {
- op->payload->send_message.send_message->set_flags(
- op->payload->send_message.send_message->flags() |
- GRPC_WRITE_NO_COMPRESS);
- }
- }
-
- // Chain to the next filter.
- grpc_call_next_op(elem, op);
-}
-
-// Constructor for call_data.
-static grpc_error* cronet_compression_init_call_elem(
- grpc_call_element* elem, const grpc_call_element_args* /*args*/) {
- call_data* calld = static_cast<call_data*>(elem->call_data);
- calld->next_recv_initial_metadata_ready = nullptr;
- calld->workaround_active = false;
- GRPC_CLOSURE_INIT(&calld->recv_initial_metadata_ready,
- recv_initial_metadata_ready, elem,
- grpc_schedule_on_exec_ctx);
- return GRPC_ERROR_NONE;
-}
-
-// Destructor for call_data.
-static void cronet_compression_destroy_call_elem(
- grpc_call_element* /*elem*/, const grpc_call_final_info* /*final_info*/,
- grpc_closure* /*ignored*/) {}
-
-// Constructor for channel_data.
-static grpc_error* cronet_compression_init_channel_elem(
- grpc_channel_element* /*elem*/, grpc_channel_element_args* /*args*/) {
- return GRPC_ERROR_NONE;
-}
-
-// Destructor for channel_data.
-static void cronet_compression_destroy_channel_elem(
- grpc_channel_element* /*elem*/) {}
-
-// Parse the user agent
-static bool parse_user_agent(grpc_mdelem md) {
- const char grpc_objc_specifier[] = "grpc-objc/";
- const size_t grpc_objc_specifier_len = sizeof(grpc_objc_specifier) - 1;
- const char cronet_specifier[] = "cronet_http";
- const size_t cronet_specifier_len = sizeof(cronet_specifier) - 1;
-
- char* user_agent_str = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- bool grpc_objc_specifier_seen = false;
- bool cronet_specifier_seen = false;
- char *major_version_str = user_agent_str, *minor_version_str;
- long major_version = 0, minor_version = 0;
-
- char* head = strtok(user_agent_str, " ");
- while (head != nullptr) {
- if (!grpc_objc_specifier_seen &&
- 0 == strncmp(head, grpc_objc_specifier, grpc_objc_specifier_len)) {
- major_version_str = head + grpc_objc_specifier_len;
- grpc_objc_specifier_seen = true;
- } else if (grpc_objc_specifier_seen &&
- 0 == strncmp(head, cronet_specifier, cronet_specifier_len)) {
- cronet_specifier_seen = true;
- break;
- }
-
- head = strtok(nullptr, " ");
- }
- if (grpc_objc_specifier_seen) {
- major_version_str = strtok(major_version_str, ".");
- minor_version_str = strtok(nullptr, ".");
- major_version = atol(major_version_str);
- minor_version = atol(minor_version_str);
- }
-
- gpr_free(user_agent_str);
- return (grpc_objc_specifier_seen && cronet_specifier_seen &&
- (major_version < 1 || (major_version == 1 && minor_version <= 3)));
-}
-
-const grpc_channel_filter grpc_workaround_cronet_compression_filter = {
- cronet_compression_start_transport_stream_op_batch,
- grpc_channel_next_op,
- sizeof(call_data),
- cronet_compression_init_call_elem,
- grpc_call_stack_ignore_set_pollset_or_pollset_set,
- cronet_compression_destroy_call_elem,
- 0,
- cronet_compression_init_channel_elem,
- cronet_compression_destroy_channel_elem,
- grpc_channel_next_get_info,
- "workaround_cronet_compression"};
-
-static bool register_workaround_cronet_compression(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
- const grpc_channel_args* channel_args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- const grpc_arg* a = grpc_channel_args_find(
- channel_args, GRPC_ARG_WORKAROUND_CRONET_COMPRESSION);
- if (a == nullptr) {
- return true;
- }
- if (!grpc_channel_arg_get_bool(a, false)) {
- return true;
- }
- return grpc_channel_stack_builder_prepend_filter(
- builder, &grpc_workaround_cronet_compression_filter, nullptr, nullptr);
-}
-
-void grpc_workaround_cronet_compression_filter_init(void) {
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, GRPC_WORKAROUND_PRIORITY_HIGH,
- register_workaround_cronet_compression, nullptr);
- grpc_register_workaround(GRPC_WORKAROUND_ID_CRONET_COMPRESSION,
- parse_user_agent);
-}
-
-void grpc_workaround_cronet_compression_filter_shutdown(void) {}
diff --git a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.cc b/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.cc
deleted file mode 100644
index 2a184ba895f..00000000000
--- a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/filters/workarounds/workaround_utils.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-user_agent_parser ua_parser[GRPC_MAX_WORKAROUND_ID];
-
-static void destroy_user_agent_md(void* user_agent_md) {
- gpr_free(user_agent_md);
-}
-
-grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md) {
- grpc_workaround_user_agent_md* user_agent_md =
- static_cast<grpc_workaround_user_agent_md*>(
- grpc_mdelem_get_user_data(md, destroy_user_agent_md));
-
- if (nullptr != user_agent_md) {
- return user_agent_md;
- }
- user_agent_md = static_cast<grpc_workaround_user_agent_md*>(
- gpr_malloc(sizeof(grpc_workaround_user_agent_md)));
- for (int i = 0; i < GRPC_MAX_WORKAROUND_ID; i++) {
- if (ua_parser[i]) {
- user_agent_md->workaround_active[i] = ua_parser[i](md);
- }
- }
- grpc_mdelem_set_user_data(md, destroy_user_agent_md, user_agent_md);
-
- return user_agent_md;
-}
-
-void grpc_register_workaround(uint32_t id, user_agent_parser parser) {
- GPR_ASSERT(id < GRPC_MAX_WORKAROUND_ID);
- ua_parser[id] = parser;
-}
diff --git a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.h b/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.h
deleted file mode 100644
index f172ccc0788..00000000000
--- a/contrib/libs/grpc/src/core/ext/filters/workarounds/workaround_utils.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright 2017 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#ifndef GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H
-#define GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/workaround_list.h>
-
-#include "src/core/lib/transport/metadata.h"
-
-#define GRPC_WORKAROUND_PRIORITY_HIGH 10001
-#define GRPC_WORKAROUND_PROIRITY_LOW 9999
-
-typedef struct grpc_workaround_user_agent_md {
- bool workaround_active[GRPC_MAX_WORKAROUND_ID];
-} grpc_workaround_user_agent_md;
-
-grpc_workaround_user_agent_md* grpc_parse_user_agent(grpc_mdelem md);
-
-typedef bool (*user_agent_parser)(grpc_mdelem);
-
-void grpc_register_workaround(uint32_t id, user_agent_parser parser);
-
-#endif /* GRPC_CORE_EXT_FILTERS_WORKAROUNDS_WORKAROUND_UTILS_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc b/contrib/libs/grpc/src/core/ext/service_config/service_config.cc
index 3f5483e7720..4489221f8fa 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.cc
+++ b/contrib/libs/grpc/src/core/ext/service_config/service_config.cc
@@ -16,7 +16,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
#include <util/generic/string.h>
@@ -24,7 +24,7 @@
#include <grpc/support/log.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -32,7 +32,7 @@ namespace grpc_core {
RefCountedPtr<ServiceConfig> ServiceConfig::Create(
const grpc_channel_args* args, y_absl::string_view json_string,
- grpc_error** error) {
+ grpc_error_handle* error) {
GPR_DEBUG_ASSERT(error != nullptr);
Json json = Json::Parse(json_string, error);
if (*error != GRPC_ERROR_NONE) return nullptr;
@@ -42,7 +42,7 @@ RefCountedPtr<ServiceConfig> ServiceConfig::Create(
ServiceConfig::ServiceConfig(const grpc_channel_args* args,
TString json_string, Json json,
- grpc_error** error)
+ grpc_error_handle* error)
: json_string_(std::move(json_string)), json_(std::move(json)) {
GPR_DEBUG_ASSERT(error != nullptr);
if (json_.type() != Json::Type::OBJECT) {
@@ -50,12 +50,12 @@ ServiceConfig::ServiceConfig(const grpc_channel_args* args,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("JSON value is not an object");
return;
}
- std::vector<grpc_error*> error_list;
- grpc_error* global_error = GRPC_ERROR_NONE;
+ std::vector<grpc_error_handle> error_list;
+ grpc_error_handle global_error = GRPC_ERROR_NONE;
parsed_global_configs_ =
ServiceConfigParser::ParseGlobalParameters(args, json_, &global_error);
if (global_error != GRPC_ERROR_NONE) error_list.push_back(global_error);
- grpc_error* local_error = ParsePerMethodParams(args);
+ grpc_error_handle local_error = ParsePerMethodParams(args);
if (local_error != GRPC_ERROR_NONE) error_list.push_back(local_error);
if (!error_list.empty()) {
*error = GRPC_ERROR_CREATE_FROM_VECTOR("Service config parsing error",
@@ -69,13 +69,13 @@ ServiceConfig::~ServiceConfig() {
}
}
-grpc_error* ServiceConfig::ParseJsonMethodConfig(const grpc_channel_args* args,
- const Json& json) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle ServiceConfig::ParseJsonMethodConfig(
+ const grpc_channel_args* args, const Json& json) {
+ std::vector<grpc_error_handle> error_list;
// Parse method config with each registered parser.
auto parsed_configs =
y_absl::make_unique<ServiceConfigParser::ParsedConfigVector>();
- grpc_error* parser_error = GRPC_ERROR_NONE;
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
*parsed_configs =
ServiceConfigParser::ParsePerMethodParameters(args, json, &parser_error);
if (parser_error != GRPC_ERROR_NONE) {
@@ -94,7 +94,7 @@ grpc_error* ServiceConfig::ParseJsonMethodConfig(const grpc_channel_args* args,
}
const Json::Array& name_array = it->second.array_value();
for (const Json& name : name_array) {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
TString path = ParseJsonMethodName(name, &parse_error);
if (parse_error != GRPC_ERROR_NONE) {
error_list.push_back(parse_error);
@@ -130,8 +130,9 @@ grpc_error* ServiceConfig::ParseJsonMethodConfig(const grpc_channel_args* args,
return GRPC_ERROR_CREATE_FROM_VECTOR("methodConfig", &error_list);
}
-grpc_error* ServiceConfig::ParsePerMethodParams(const grpc_channel_args* args) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle ServiceConfig::ParsePerMethodParams(
+ const grpc_channel_args* args) {
+ std::vector<grpc_error_handle> error_list;
auto it = json_.object_value().find("methodConfig");
if (it != json_.object_value().end()) {
if (it->second.type() != Json::Type::ARRAY) {
@@ -144,7 +145,7 @@ grpc_error* ServiceConfig::ParsePerMethodParams(const grpc_channel_args* args) {
"field:methodConfig error:not of type Object"));
continue;
}
- grpc_error* error = ParseJsonMethodConfig(args, method_config);
+ grpc_error_handle error = ParseJsonMethodConfig(args, method_config);
if (error != GRPC_ERROR_NONE) {
error_list.push_back(error);
}
@@ -154,7 +155,7 @@ grpc_error* ServiceConfig::ParsePerMethodParams(const grpc_channel_args* args) {
}
TString ServiceConfig::ParseJsonMethodName(const Json& json,
- grpc_error** error) {
+ grpc_error_handle* error) {
if (json.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:name error:type is not object");
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h b/contrib/libs/grpc/src/core/ext/service_config/service_config.h
index 86d71f18316..27abc72e995 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config.h
+++ b/contrib/libs/grpc/src/core/ext/service_config/service_config.h
@@ -14,8 +14,8 @@
// limitations under the License.
//
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H
+#ifndef GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_H
+#define GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_H
#include <grpc/support/port_platform.h>
@@ -26,7 +26,7 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
@@ -67,10 +67,10 @@ class ServiceConfig : public RefCounted<ServiceConfig> {
/// Returns null on parse error.
static RefCountedPtr<ServiceConfig> Create(const grpc_channel_args* args,
y_absl::string_view json_string,
- grpc_error** error);
+ grpc_error_handle* error);
ServiceConfig(const grpc_channel_args* args, TString json_string,
- Json json, grpc_error** error);
+ Json json, grpc_error_handle* error);
~ServiceConfig() override;
const TString& json_string() const { return json_string_; }
@@ -91,13 +91,14 @@ class ServiceConfig : public RefCounted<ServiceConfig> {
private:
// Helper functions for parsing the method configs.
- grpc_error* ParsePerMethodParams(const grpc_channel_args* args);
- grpc_error* ParseJsonMethodConfig(const grpc_channel_args* args,
- const Json& json);
+ grpc_error_handle ParsePerMethodParams(const grpc_channel_args* args);
+ grpc_error_handle ParseJsonMethodConfig(const grpc_channel_args* args,
+ const Json& json);
// Returns a path string for the JSON name object specified by json.
// Sets *error on error.
- static TString ParseJsonMethodName(const Json& json, grpc_error** error);
+ static TString ParseJsonMethodName(const Json& json,
+ grpc_error_handle* error);
TString json_string_;
Json json_;
@@ -123,4 +124,4 @@ class ServiceConfig : public RefCounted<ServiceConfig> {
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_H */
+#endif /* GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h b/contrib/libs/grpc/src/core/ext/service_config/service_config_call_data.h
index 0ddbc3698bc..8ccaeab6211 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_call_data.h
+++ b/contrib/libs/grpc/src/core/ext/service_config/service_config_call_data.h
@@ -14,8 +14,8 @@
// limitations under the License.
//
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H
+#ifndef GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H
+#define GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H
#include <grpc/support/port_platform.h>
@@ -23,37 +23,30 @@
#include "y_absl/strings/string_view.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
namespace grpc_core {
-/// When a service config is applied to a call in the client_channel_filter,
-/// we create an instance of this object on the arena. A pointer to this
-/// object is also stored in the call_context, so that future filters can
+/// Stores the service config data associated with an individual call.
+/// A pointer to this object is stored in the call_context
+/// GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA element, so that filters can
/// easily access method and global parameters for the call.
class ServiceConfigCallData {
public:
+ using CallAttributes = std::map<const char*, y_absl::string_view>;
+
+ ServiceConfigCallData() : method_configs_(nullptr) {}
+
ServiceConfigCallData(
RefCountedPtr<ServiceConfig> service_config,
const ServiceConfigParser::ParsedConfigVector* method_configs,
- std::map<const char*, y_absl::string_view> call_attributes,
- grpc_call_context_element* call_context)
+ CallAttributes call_attributes)
: service_config_(std::move(service_config)),
method_configs_(method_configs),
- call_attributes_(std::move(call_attributes)) {
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].value = this;
- call_context[GRPC_CONTEXT_SERVICE_CONFIG_CALL_DATA].destroy = Destroy;
- }
-
- ServiceConfigCallData(
- RefCountedPtr<ServiceConfig> service_config,
- const ServiceConfigParser::ParsedConfigVector* method_configs,
- grpc_call_context_element* call_context)
- : ServiceConfigCallData(std::move(service_config), method_configs, {},
- call_context) {}
+ call_attributes_(std::move(call_attributes)) {}
ServiceConfig* service_config() { return service_config_.get(); }
@@ -66,21 +59,14 @@ class ServiceConfigCallData {
return service_config_->GetGlobalParsedConfig(index);
}
- const std::map<const char*, y_absl::string_view>& call_attributes() const {
- return call_attributes_;
- }
+ const CallAttributes& call_attributes() const { return call_attributes_; }
private:
- static void Destroy(void* ptr) {
- ServiceConfigCallData* self = static_cast<ServiceConfigCallData*>(ptr);
- self->~ServiceConfigCallData();
- }
-
RefCountedPtr<ServiceConfig> service_config_;
- const ServiceConfigParser::ParsedConfigVector* method_configs_ = nullptr;
- std::map<const char*, y_absl::string_view> call_attributes_;
+ const ServiceConfigParser::ParsedConfigVector* method_configs_;
+ CallAttributes call_attributes_;
};
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_CALL_DATA_H */
+#endif /* GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_CALL_DATA_H */
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc b/contrib/libs/grpc/src/core/ext/service_config/service_config_parser.cc
index 9575a1f85ab..04cc7dcbe1c 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.cc
+++ b/contrib/libs/grpc/src/core/ext/service_config/service_config_parser.cc
@@ -16,7 +16,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/filters/client_channel/service_config_parser.h"
+#include "src/core/ext/service_config/service_config_parser.h"
#include <grpc/support/log.h>
@@ -29,12 +29,12 @@ typedef y_absl::InlinedVector<std::unique_ptr<ServiceConfigParser::Parser>,
ServiceConfigParserList* g_registered_parsers;
} // namespace
-void ServiceConfigParser::Init() {
+void ServiceConfigParserInit() {
GPR_ASSERT(g_registered_parsers == nullptr);
g_registered_parsers = new ServiceConfigParserList();
}
-void ServiceConfigParser::Shutdown() {
+void ServiceConfigParserShutdown() {
delete g_registered_parsers;
g_registered_parsers = nullptr;
}
@@ -47,11 +47,11 @@ size_t ServiceConfigParser::RegisterParser(std::unique_ptr<Parser> parser) {
ServiceConfigParser::ParsedConfigVector
ServiceConfigParser::ParseGlobalParameters(const grpc_channel_args* args,
const Json& json,
- grpc_error** error) {
+ grpc_error_handle* error) {
ParsedConfigVector parsed_global_configs;
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error* parser_error = GRPC_ERROR_NONE;
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
auto parsed_config = (*g_registered_parsers)[i]->ParseGlobalParams(
args, json, &parser_error);
if (parser_error != GRPC_ERROR_NONE) {
@@ -68,11 +68,11 @@ ServiceConfigParser::ParseGlobalParameters(const grpc_channel_args* args,
ServiceConfigParser::ParsedConfigVector
ServiceConfigParser::ParsePerMethodParameters(const grpc_channel_args* args,
const Json& json,
- grpc_error** error) {
+ grpc_error_handle* error) {
ParsedConfigVector parsed_method_configs;
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
for (size_t i = 0; i < g_registered_parsers->size(); i++) {
- grpc_error* parser_error = GRPC_ERROR_NONE;
+ grpc_error_handle parser_error = GRPC_ERROR_NONE;
auto parsed_config = (*g_registered_parsers)[i]->ParsePerMethodParams(
args, json, &parser_error);
if (parser_error != GRPC_ERROR_NONE) {
diff --git a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h b/contrib/libs/grpc/src/core/ext/service_config/service_config_parser.h
index 6fcb768377f..aa9c31967c3 100644
--- a/contrib/libs/grpc/src/core/ext/filters/client_channel/service_config_parser.h
+++ b/contrib/libs/grpc/src/core/ext/service_config/service_config_parser.h
@@ -14,8 +14,8 @@
// limitations under the License.
//
-#ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
-#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H
+#ifndef GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H
+#define GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H
#include <grpc/support/port_platform.h>
@@ -30,6 +30,11 @@
namespace grpc_core {
+// Initialization functions for ServiceConfigParser. ServiceConfigParser should
+// be initialized before any parser implementation is registered.
+void ServiceConfigParserInit();
+void ServiceConfigParserShutdown();
+
// Service config parser registry.
// See service_config.h for more information.
class ServiceConfigParser {
@@ -47,7 +52,8 @@ class ServiceConfigParser {
virtual ~Parser() = default;
virtual std::unique_ptr<ParsedConfig> ParseGlobalParams(
- const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
+ const grpc_channel_args*, const Json& /* json */,
+ grpc_error_handle* error) {
// Avoid unused parameter warning on debug-only parameter
(void)error;
GPR_DEBUG_ASSERT(error != nullptr);
@@ -55,7 +61,8 @@ class ServiceConfigParser {
}
virtual std::unique_ptr<ParsedConfig> ParsePerMethodParams(
- const grpc_channel_args*, const Json& /* json */, grpc_error** error) {
+ const grpc_channel_args*, const Json& /* json */,
+ grpc_error_handle* error) {
// Avoid unused parameter warning on debug-only parameter
(void)error;
GPR_DEBUG_ASSERT(error != nullptr);
@@ -68,9 +75,6 @@ class ServiceConfigParser {
kNumPreallocatedParsers>
ParsedConfigVector;
- static void Init();
- static void Shutdown();
-
/// Globally register a service config parser. On successful registration, it
/// returns the index at which the parser was registered. On failure, -1 is
/// returned. Each new service config update will go through all the
@@ -81,12 +85,13 @@ class ServiceConfigParser {
static ParsedConfigVector ParseGlobalParameters(const grpc_channel_args* args,
const Json& json,
- grpc_error** error);
+ grpc_error_handle* error);
static ParsedConfigVector ParsePerMethodParameters(
- const grpc_channel_args* args, const Json& json, grpc_error** error);
+ const grpc_channel_args* args, const Json& json,
+ grpc_error_handle* error);
};
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SERVICE_CONFIG_PARSER_H */
+#endif /* GRPC_CORE_EXT_SERVICE_CONFIG_SERVICE_CONFIG_PARSER_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/README.md b/contrib/libs/grpc/src/core/ext/transport/binder/README.md
new file mode 100644
index 00000000000..2a797d3b4d8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/README.md
@@ -0,0 +1,6 @@
+# Binder transport for cross process IPC on Android
+
+Under construction.
+
+This transport implements
+[BinderChannel for native cross-process communication on Android](https://github.com/grpc/proposal/blob/master/L73-java-binderchannel.md)
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.cc
new file mode 100644
index 00000000000..0f0676d5aa0
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.cc
@@ -0,0 +1,133 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/binder_connector.h"
+#include "src/core/lib/iomgr/port.h"
+
+#ifdef GRPC_HAVE_UNIX_SOCKET
+#include <sys/un.h>
+#endif
+
+#include <functional>
+#include <map>
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/filters/client_channel/connector.h"
+#include "src/core/ext/filters/client_channel/subchannel.h"
+#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+
+namespace {
+
+// TODO(mingcl): Currently this does no error handling and assumes the
+// connection always succeeds in reasonable amount of time.
+class BinderConnector : public grpc_core::SubchannelConnector {
+ public:
+ BinderConnector() {}
+ ~BinderConnector() override {}
+ void Connect(const Args& args, Result* result,
+ grpc_closure* notify) override {
+#ifdef GRPC_HAVE_UNIX_SOCKET
+ {
+ struct sockaddr_un* un =
+ reinterpret_cast<struct sockaddr_un*>(args.address->addr);
+ // length of identifier, including null terminator
+ size_t id_length = args.address->len - sizeof(un->sun_family);
+ // The c-style string at least will have a null terminator, and the
+ // connection id itself should not be empty
+ GPR_ASSERT(id_length >= 2);
+ // Make sure there is null terminator at the expected location before
+ // reading from it
+ GPR_ASSERT(un->sun_path[id_length - 1] == '\0');
+ conn_id_ = un->sun_path;
+ }
+#else
+ GPR_ASSERT(0);
+#endif
+ gpr_log(GPR_INFO, "BinderConnector %p conn_id_ = %s", this,
+ conn_id_.c_str());
+
+ args_ = args;
+ GPR_ASSERT(notify_ == nullptr);
+ GPR_ASSERT(notify != nullptr);
+ notify_ = notify;
+ result_ = result;
+
+ Ref().release(); // Ref held by the following callback
+
+ grpc_binder::GetEndpointBinderPool()->GetEndpointBinder(
+ conn_id_,
+ std::bind(&BinderConnector::OnConnected, this, std::placeholders::_1));
+ }
+
+ void OnConnected(std::unique_ptr<grpc_binder::Binder> endpoint_binder) {
+ GPR_ASSERT(endpoint_binder != nullptr);
+ grpc_transport* transport = grpc_create_binder_transport_client(
+ std::move(endpoint_binder),
+ grpc_binder::GetSecurityPolicySetting()->Get(conn_id_));
+ GPR_ASSERT(transport != nullptr);
+ result_->channel_args = grpc_channel_args_copy(args_.channel_args);
+ result_->transport = transport;
+
+ GPR_ASSERT(notify_ != nullptr);
+ // ExecCtx is required here for running grpc_closure because this callback
+ // might be invoked from non-gRPC code
+ if (grpc_core::ExecCtx::Get() == nullptr) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
+ } else {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
+ }
+
+ Unref(); // Was referenced in BinderConnector::Connect
+ }
+ void Shutdown(grpc_error_handle error) override { (void)error; }
+
+ private:
+ Args args_;
+ grpc_closure* notify_ = nullptr;
+ Result* result_ = nullptr;
+
+ TString conn_id_;
+};
+
+} // namespace
+
+namespace grpc_core {
+
+RefCountedPtr<Subchannel> BinderClientChannelFactory::CreateSubchannel(
+ const grpc_resolved_address& address, const grpc_channel_args* args) {
+ gpr_log(GPR_INFO, "BinderClientChannelFactory creating subchannel %p", this);
+ grpc_arg default_authority_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>("binder.authority"));
+ grpc_channel_args* new_args =
+ grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+
+ RefCountedPtr<Subchannel> s =
+ Subchannel::Create(MakeOrphanable<BinderConnector>(), address, new_args);
+
+ return s;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_NO_BINDER
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.h
new file mode 100644
index 00000000000..e03bbfc5c6a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/binder_connector.h
@@ -0,0 +1,44 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "y_absl/strings/string_view.h"
+#include "y_absl/strings/strip.h"
+
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/support/channel_arguments.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/filters/client_channel/client_channel_factory.h"
+
+namespace grpc_core {
+
+class BinderClientChannelFactory : public ClientChannelFactory {
+ public:
+ RefCountedPtr<Subchannel> CreateSubchannel(
+ const grpc_resolved_address& address,
+ const grpc_channel_args* args) override;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_BINDER_CONNECTOR_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create.cc
new file mode 100644
index 00000000000..69cd4744cc6
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create.cc
@@ -0,0 +1,172 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/create_channel_binder.h>
+
+// The interface is only defined if GPR_ANDROID is defined, because some
+// arguments requires JNI.
+// Furthermore, the interface is non-phony only when
+// GPR_SUPPORT_BINDER_TRANSPORT is true because actual implementation of binder
+// transport requires newer version of NDK API
+
+#ifdef GPR_ANDROID
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_posix.h>
+#include <grpc/support/log.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/time/clock.h"
+#include "y_absl/time/time.h"
+
+#include <grpcpp/impl/grpc_library.h>
+
+#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/ext/transport/binder/client/channel_create_impl.h"
+#include "src/core/ext/transport/binder/client/connection_id_generator.h"
+#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/transport/transport.h"
+#include "src/cpp/client/create_channel_internal.h"
+
+namespace grpc {
+namespace experimental {
+
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void* jni_env_void, jobject application, y_absl::string_view package_name,
+ y_absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ return CreateCustomBinderChannel(jni_env_void, application, package_name,
+ class_name, security_policy,
+ ChannelArguments());
+}
+
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void* jni_env_void, jobject application, y_absl::string_view package_name,
+ y_absl::string_view class_name,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ const ChannelArguments& args) {
+ grpc::internal::GrpcLibrary init_lib;
+ init_lib.init();
+
+ GPR_ASSERT(jni_env_void != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ TString connection_id = grpc_binder::GetConnectionIdGenerator()->Generate(
+ TString(package_name), TString(class_name));
+
+ // After invoking this Java method, Java code will put endpoint binder into
+ // `EndpointBinderPool` after the connection succeeds
+ // TODO(mingcl): Consider if we want to delay the connection establishment
+ // until SubchannelConnector start establishing connection. For now we don't
+ // see any benifits doing that.
+ grpc_binder::TryEstablishConnection(static_cast<JNIEnv*>(jni_env_void),
+ application, package_name, class_name,
+ connection_id);
+
+ // Set server URI to a URI that contains connection id. The URI will be used
+ // by subchannel connector to obtain correct endpoint binder from
+ // `EndpointBinderPool`.
+ grpc_channel_args channel_args;
+ args.SetChannelArgs(&channel_args);
+ grpc_channel_args* new_args;
+ {
+ grpc_arg server_uri_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_SERVER_URI),
+ const_cast<char*>(("binder:" + connection_id).c_str()));
+ const char* to_remove[] = {GRPC_ARG_SERVER_URI};
+ new_args = grpc_channel_args_copy_and_add_and_remove(
+ &channel_args, to_remove, 1, &server_uri_arg, 1);
+ }
+
+ grpc_binder::GetSecurityPolicySetting()->Set(connection_id, security_policy);
+
+ auto channel = CreateChannelInternal(
+ "", ::grpc::internal::CreateClientBinderChannelImpl(new_args),
+ std::vector<
+ std::unique_ptr<experimental::ClientInterceptorFactoryInterface>>());
+
+ grpc_channel_args_destroy(new_args);
+
+ return channel;
+}
+
+bool InitializeBinderChannelJavaClass(void* jni_env_void) {
+ return grpc_binder::FindNativeConnectionHelper(
+ static_cast<JNIEnv*>(jni_env_void)) != nullptr;
+}
+
+} // namespace experimental
+} // namespace grpc
+
+#else // !GPR_SUPPORT_BINDER_TRANSPORT
+
+namespace grpc {
+namespace experimental {
+
+std::shared_ptr<grpc::Channel> CreateBinderChannel(
+ void*, jobject, y_absl::string_view, y_absl::string_view,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+std::shared_ptr<grpc::Channel> CreateCustomBinderChannel(
+ void*, jobject, y_absl::string_view, y_absl::string_view,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>,
+ const ChannelArguments&) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+bool InitializeBinderChannelJavaClass(void* jni_env_void) {
+ gpr_log(GPR_ERROR,
+ "This APK is compiled with Android API level = %d, which is not "
+ "supported. See port_platform.h for supported versions.",
+ __ANDROID_API__);
+ GPR_ASSERT(0);
+ return {};
+}
+
+} // namespace experimental
+} // namespace grpc
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+#endif // GPR_ANDROID
+
+#endif // GRPC_NO_BINDER
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc
new file mode 100644
index 00000000000..63449dbcb54
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.cc
@@ -0,0 +1,105 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/client/channel_create_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <memory>
+#include <utility>
+
+#include "src/core/ext/transport/binder/client/binder_connector.h"
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
+
+namespace {
+
+grpc_core::BinderClientChannelFactory* g_factory;
+gpr_once g_factory_once = GPR_ONCE_INIT;
+
+void FactoryInit() { g_factory = new grpc_core::BinderClientChannelFactory(); }
+} // namespace
+
+namespace grpc {
+namespace internal {
+
+grpc_channel* CreateDirectBinderChannelImplForTesting(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ const grpc_channel_args* args,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ grpc_core::ExecCtx exec_ctx;
+
+ grpc_transport* transport = grpc_create_binder_transport_client(
+ std::move(endpoint_binder), security_policy);
+ GPR_ASSERT(transport != nullptr);
+
+ grpc_arg default_authority_arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>("binder.authority"));
+ grpc_channel_args* final_args =
+ grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_channel* channel =
+ grpc_channel_create("binder_target_placeholder", final_args,
+ GRPC_CLIENT_DIRECT_CHANNEL, transport, &error);
+ // TODO(mingcl): Handle error properly
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ grpc_channel_args_destroy(final_args);
+ return channel;
+}
+
+grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args) {
+ grpc_core::ExecCtx exec_ctx;
+
+ gpr_once_init(&g_factory_once, FactoryInit);
+
+ // Set channel factory argument
+ grpc_arg channel_factory_arg =
+ grpc_core::ClientChannelFactory::CreateChannelArg(g_factory);
+ const char* arg_to_remove = channel_factory_arg.key;
+ grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
+ args, &arg_to_remove, 1, &channel_factory_arg, 1);
+
+ grpc_error_handle error = GRPC_ERROR_NONE;
+
+ grpc_channel* channel =
+ grpc_channel_create("binder_channel_target_placeholder", new_args,
+ GRPC_CLIENT_CHANNEL, nullptr, &error);
+
+ // Clean up.
+ grpc_channel_args_destroy(new_args);
+ if (channel == nullptr) {
+ intptr_t integer;
+ grpc_status_code status = GRPC_STATUS_INTERNAL;
+ if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
+ status = static_cast<grpc_status_code>(integer);
+ }
+ GRPC_ERROR_UNREF(error);
+ channel = grpc_lame_client_channel_create(
+ "binder_channel_target_placeholder", status,
+ "Failed to create binder channel");
+ }
+
+ return channel;
+}
+
+} // namespace internal
+} // namespace grpc
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.h
new file mode 100644
index 00000000000..d48fa228014
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/channel_create_impl.h
@@ -0,0 +1,42 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc {
+namespace internal {
+
+// Creates a GRPC_CLIENT_DIRECT_CHANNEL channel from endpoint binder
+// At this moment this is only used for testing.
+grpc_channel* CreateDirectBinderChannelImplForTesting(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ const grpc_channel_args* args,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+// Creates a GRPC_CLIENT_CHANNEL channel
+grpc_channel* CreateClientBinderChannelImpl(const grpc_channel_args* args);
+
+} // namespace internal
+} // namespace grpc
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CHANNEL_CREATE_IMPL_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc
new file mode 100644
index 00000000000..096a4f0556e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.cc
@@ -0,0 +1,70 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/client/connection_id_generator.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include "y_absl/strings/str_cat.h"
+
+namespace {
+// Make sure `s` does not contain characters other than numbers, alphabets,
+// period and underscore
+TString Normalize(y_absl::string_view str_view) {
+ TString s = TString(str_view);
+ for (size_t i = 0; i < s.length(); i++) {
+ if (!isalnum(s[i]) && s[i] != '.') {
+ s[i] = '_';
+ }
+ }
+ return s;
+}
+
+// Remove prefix of the string if the string is longer than len
+TString StripToLength(const TString& s, size_t len) {
+ if (s.length() > len) {
+ return s.substr(s.length() - len, len);
+ }
+ return s;
+}
+} // namespace
+
+namespace grpc_binder {
+
+TString ConnectionIdGenerator::Generate(y_absl::string_view package_name,
+ y_absl::string_view class_name) {
+ // reserve some room for serial number
+ const size_t kReserveForNumbers = 15;
+ TString s = StripToLength(
+ y_absl::StrCat(Normalize(package_name), "-", Normalize(class_name)),
+ kPathLengthLimit - kReserveForNumbers);
+ TString ret;
+ {
+ grpc_core::MutexLock l(&m_);
+ // Insert a hyphen before serial number
+ ret = y_absl::StrCat(s, "-", ++count_);
+ }
+ GPR_ASSERT(ret.length() < kPathLengthLimit);
+ return ret;
+}
+
+ConnectionIdGenerator* GetConnectionIdGenerator() {
+ static ConnectionIdGenerator* cig = new ConnectionIdGenerator();
+ return cig;
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.h
new file mode 100644
index 00000000000..ebadb8e9128
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/connection_id_generator.h
@@ -0,0 +1,52 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// Generates somewhat human-readable unique identifiers from package name and
+// class name. We will generate a Id that only contains unreserved URI
+// characters (uppercase and lowercase letters, decimal digits, hyphen, period,
+// underscore, and tilde).
+class ConnectionIdGenerator {
+ public:
+ TString Generate(y_absl::string_view package_name,
+ y_absl::string_view class_name);
+
+ private:
+ // Our generated Id need to fit in unix socket path length limit. We use 100
+ // here to be safe.
+ const size_t kPathLengthLimit = 100;
+
+ grpc_core::Mutex m_;
+ // Every generated identifier will followed by the value of this counter to
+ // make sure every generated id is unique.
+ int count_ Y_ABSL_GUARDED_BY(m_);
+};
+
+ConnectionIdGenerator* GetConnectionIdGenerator();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_CONNECTION_ID_GENERATOR_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc
new file mode 100644
index 00000000000..e534fd74180
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.cc
@@ -0,0 +1,113 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/client/endpoint_binder_pool.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#error #include <jni.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+
+extern "C" {
+// Adds endpoint binder to binder pool when Java notify us that the endpoint
+// binder is ready. This is called from GrpcBinderConnection.java
+JNIEXPORT void JNICALL
+Java_io_grpc_binder_cpp_GrpcBinderConnection_notifyConnected__Ljava_lang_String_2Landroid_os_IBinder_2(
+ JNIEnv* jni_env, jobject, jstring conn_id_jstring, jobject ibinder) {
+ jboolean isCopy;
+ const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
+ gpr_log(GPR_INFO, "%s invoked with conn_id = %s", __func__, conn_id);
+ GPR_ASSERT(ibinder != nullptr);
+ grpc_binder::ndk_util::SpAIBinder aibinder =
+ grpc_binder::FromJavaBinder(jni_env, ibinder);
+ gpr_log(GPR_INFO, "%s got aibinder = %p", __func__, aibinder.get());
+ auto b = y_absl::make_unique<grpc_binder::BinderAndroid>(aibinder);
+ GPR_ASSERT(b != nullptr);
+ grpc_binder::GetEndpointBinderPool()->AddEndpointBinder(conn_id,
+ std::move(b));
+ if (isCopy == JNI_TRUE) {
+ jni_env->ReleaseStringUTFChars(conn_id_jstring, conn_id);
+ }
+}
+}
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+namespace grpc_binder {
+
+void EndpointBinderPool ::GetEndpointBinder(
+ TString conn_id,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb) {
+ gpr_log(GPR_INFO, "EndpointBinder requested. conn_id = %s", conn_id.c_str());
+ std::unique_ptr<grpc_binder::Binder> b;
+ {
+ grpc_core::MutexLock l(&m_);
+ if (binder_map_.count(conn_id)) {
+ b = std::move(binder_map_[conn_id]);
+ binder_map_.erase(conn_id);
+ GPR_ASSERT(b != nullptr);
+ } else {
+ if (pending_requests_.count(conn_id) != 0) {
+ gpr_log(GPR_ERROR,
+ "Duplicate GetEndpointBinder requested. conn_id = %s",
+ conn_id.c_str());
+ return;
+ }
+ pending_requests_[conn_id] = std::move(cb);
+ return;
+ }
+ }
+ GPR_ASSERT(b != nullptr);
+ cb(std::move(b));
+}
+
+void EndpointBinderPool::AddEndpointBinder(
+ TString conn_id, std::unique_ptr<grpc_binder::Binder> b) {
+ gpr_log(GPR_INFO, "EndpointBinder added. conn_id = %s", conn_id.c_str());
+ GPR_ASSERT(b != nullptr);
+ // cb will be set in the following block if there is a pending callback
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ if (binder_map_.count(conn_id) != 0) {
+ gpr_log(GPR_ERROR, "EndpointBinder already in the pool. conn_id = %s",
+ conn_id.c_str());
+ return;
+ }
+ if (pending_requests_.count(conn_id)) {
+ cb = std::move(pending_requests_[conn_id]);
+ pending_requests_.erase(conn_id);
+ } else {
+ binder_map_[conn_id] = std::move(b);
+ b = nullptr;
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(b));
+ }
+}
+
+EndpointBinderPool* GetEndpointBinderPool() {
+ static EndpointBinderPool* p = new EndpointBinderPool();
+ return p;
+}
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h
new file mode 100644
index 00000000000..bd213b9e0cc
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/endpoint_binder_pool.h
@@ -0,0 +1,65 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <util/generic/string.h>
+
+#include "y_absl/container/flat_hash_map.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// This class serves as a buffer of endpoint binders between C++ and
+// Java. `AddEndpointBinder` will be indirectly invoked by Java code, and
+// `GetEndpointBinder` is for C++ code to register callback to get endpoint
+// binder when become available. This simplifies JNI related threading issues
+// since both side only need to interact with this buffer in non-blocking
+// manner and avoids cross-language callbacks.
+class EndpointBinderPool {
+ public:
+ // Invokes the callback when the binder corresponding to the conn_id become
+ // available. If the binder is already available, invokes the callback
+ // immediately.
+ // Ownership of the endpoint binder will be transferred to the callback
+ // function and it will be removed from the pool
+ void GetEndpointBinder(
+ TString conn_id,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)> cb);
+
+ // Add an endpoint binder to the pool
+ void AddEndpointBinder(TString conn_id,
+ std::unique_ptr<grpc_binder::Binder> b);
+
+ private:
+ grpc_core::Mutex m_;
+ y_absl::flat_hash_map<TString, std::unique_ptr<grpc_binder::Binder>>
+ binder_map_ Y_ABSL_GUARDED_BY(m_);
+ y_absl::flat_hash_map<TString,
+ std::function<void(std::unique_ptr<grpc_binder::Binder>)>>
+ pending_requests_ Y_ABSL_GUARDED_BY(m_);
+};
+
+// Returns the singleton
+EndpointBinderPool* GetEndpointBinderPool();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_ENDPOINT_BINDER_POOL_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.cc
new file mode 100644
index 00000000000..16d6ae121fd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.cc
@@ -0,0 +1,85 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/client/jni_utils.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpc/support/log.h>
+
+#if defined(ANDROID) || defined(__ANDROID__)
+
+namespace grpc_binder {
+
+jclass FindNativeConnectionHelper(JNIEnv* env) {
+ auto do_find = [env]() {
+ jclass cl = env->FindClass("io/grpc/binder/cpp/NativeConnectionHelper");
+ if (cl == nullptr) {
+ return cl;
+ }
+ jclass global_cl = static_cast<jclass>(env->NewGlobalRef(cl));
+ GPR_ASSERT(global_cl != nullptr);
+ return global_cl;
+ };
+ static jclass connection_helper_class = do_find();
+ if (connection_helper_class != nullptr) {
+ return connection_helper_class;
+ }
+ // Some possible reasons:
+ // * There is no Java class in the call stack and this is not invoked
+ // from JNI_OnLoad
+ // * The APK does not correctly depends on the helper class, or the
+ // class get shrinked
+ gpr_log(GPR_ERROR,
+ "Cannot find binder transport Java helper class. Did you invoke "
+ "grpc::experimental::InitializeBinderChannelJavaClass correctly "
+ "beforehand? Did the APK correctly include the connection helper "
+ "class (i.e depends on build target "
+ "src/core/ext/transport/binder/java/io/grpc/binder/"
+ "cpp:connection_helper) ?");
+ // TODO(mingcl): Maybe it is worth to try again so the failure can be fixed
+ // by invoking this function again at a different thread.
+ return nullptr;
+}
+
+void TryEstablishConnection(JNIEnv* env, jobject application,
+ y_absl::string_view pkg, y_absl::string_view cls,
+ y_absl::string_view conn_id) {
+ TString method = "tryEstablishConnection";
+ TString type =
+ "(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/"
+ "lang/String;)V";
+
+ jclass cl = FindNativeConnectionHelper(env);
+ if (cl == nullptr) {
+ return;
+ }
+
+ jmethodID mid = env->GetStaticMethodID(cl, method.c_str(), type.c_str());
+ if (mid == nullptr) {
+ gpr_log(GPR_ERROR, "No method id %s", method.c_str());
+ }
+
+ env->CallStaticVoidMethod(cl, mid, application,
+ env->NewStringUTF(TString(pkg).c_str()),
+ env->NewStringUTF(TString(cls).c_str()),
+ env->NewStringUTF(TString(conn_id).c_str()));
+}
+
+} // namespace grpc_binder
+
+#endif
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.h
new file mode 100644
index 00000000000..e8bab42b048
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/jni_utils.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
+
+#if defined(ANDROID) || defined(__ANDROID__)
+
+#include <grpc/support/port_platform.h>
+
+#error #include <jni.h>
+
+#include "y_absl/strings/string_view.h"
+
+namespace grpc_binder {
+
+// Finds NativeConnectionHelper Java class and caches it. This is useful because
+// FindClass only works when there is a Java class in the call stack. Typically
+// user might want to call this once in a place that is called from Java (ex.
+// JNI_OnLoad) so subsequent BinderTransport code can find Java class
+jclass FindNativeConnectionHelper(JNIEnv* env);
+
+// Calls Java method NativeConnectionHelper.tryEstablishConnection
+void TryEstablishConnection(JNIEnv* env, jobject application,
+ y_absl::string_view pkg, y_absl::string_view cls,
+ y_absl::string_view conn_id);
+
+} // namespace grpc_binder
+
+#endif
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_JNI_UTILS_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc b/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc
new file mode 100644
index 00000000000..1837f62d7d2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.cc
@@ -0,0 +1,45 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/client/security_policy_setting.h"
+
+namespace grpc_binder {
+
+void SecurityPolicySetting::Set(
+ y_absl::string_view connection_id,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(security_policy_map_.count(TString(connection_id)) == 0);
+ security_policy_map_[TString(connection_id)] = security_policy;
+}
+
+std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+SecurityPolicySetting::Get(y_absl::string_view connection_id) {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(security_policy_map_.count(TString(connection_id)) != 0);
+ return security_policy_map_[TString(connection_id)];
+}
+
+SecurityPolicySetting* GetSecurityPolicySetting() {
+ static SecurityPolicySetting* s = new SecurityPolicySetting();
+ return s;
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.h b/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.h
new file mode 100644
index 00000000000..073a9fa8712
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/client/security_policy_setting.h
@@ -0,0 +1,51 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/container/flat_hash_map.h"
+#include "y_absl/strings/string_view.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// A singleton class for setting security setting for each connection. This is
+// required because we cannot pass security policy shared pointers around using
+// gRPC arguments, we can only pass connection_id around as part of URI
+class SecurityPolicySetting {
+ public:
+ void Set(y_absl::string_view connection_id,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> Get(
+ y_absl::string_view connection_id);
+
+ private:
+ grpc_core::Mutex m_;
+ y_absl::flat_hash_map<
+ TString, std::shared_ptr<grpc::experimental::binder::SecurityPolicy>>
+ security_policy_map_ Y_ABSL_GUARDED_BY(m_);
+};
+
+SecurityPolicySetting* GetSecurityPolicySetting();
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_CLIENT_SECURITY_POLICY_SETTING_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc b/contrib/libs/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc
new file mode 100644
index 00000000000..1381619955f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/security_policy/binder_security_policy.cc
@@ -0,0 +1,52 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#ifdef GPR_ANDROID
+
+#include <unistd.h>
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+UntrustedSecurityPolicy::UntrustedSecurityPolicy() = default;
+
+UntrustedSecurityPolicy::~UntrustedSecurityPolicy() = default;
+
+bool UntrustedSecurityPolicy::IsAuthorized(int) { return true; };
+
+InternalOnlySecurityPolicy::InternalOnlySecurityPolicy() = default;
+
+InternalOnlySecurityPolicy::~InternalOnlySecurityPolicy() = default;
+
+#ifdef GPR_ANDROID
+bool InternalOnlySecurityPolicy::IsAuthorized(int uid) {
+ return static_cast<uid_t>(uid) == getuid();
+}
+#else
+bool InternalOnlySecurityPolicy::IsAuthorized(int) { return false; }
+#endif
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
new file mode 100644
index 00000000000..9d42d844cf2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.cc
@@ -0,0 +1,249 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/server/binder_server.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <memory>
+#include <util/generic/string.h>
+#include <utility>
+
+#include "y_absl/memory/memory.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#error #include <jni.h>
+
+extern "C" {
+
+// This will be invoked from
+// src/core/ext/transport/binder/java/io/grpc/binder/cpp/GrpcCppServerBuilder.java
+JNIEXPORT jobject JNICALL
+Java_io_grpc_binder_cpp_GrpcCppServerBuilder_GetEndpointBinderInternal__Ljava_lang_String_2(
+ JNIEnv* jni_env, jobject, jstring conn_id_jstring) {
+ grpc_binder::ndk_util::AIBinder* ai_binder = nullptr;
+
+ {
+ // This block is the scope of conn_id c-string
+ jboolean isCopy;
+ const char* conn_id = jni_env->GetStringUTFChars(conn_id_jstring, &isCopy);
+ ai_binder = static_cast<grpc_binder::ndk_util::AIBinder*>(
+ grpc_get_endpoint_binder(TString(conn_id)));
+ if (ai_binder == nullptr) {
+ gpr_log(GPR_ERROR, "Cannot find endpoint binder with connection id = %s",
+ conn_id);
+ }
+ if (isCopy == JNI_TRUE) {
+ jni_env->ReleaseStringUTFChars(conn_id_jstring, conn_id);
+ }
+ }
+
+ if (ai_binder == nullptr) {
+ return nullptr;
+ }
+
+ return grpc_binder::ndk_util::AIBinder_toJavaBinder(jni_env, ai_binder);
+}
+}
+
+#endif
+
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+void* GetEndpointBinder(const TString& service) {
+ return grpc_get_endpoint_binder(service);
+}
+
+void AddEndpointBinder(const TString& service, void* endpoint_binder) {
+ grpc_add_endpoint_binder(service, endpoint_binder);
+}
+
+void RemoveEndpointBinder(const TString& service) {
+ grpc_remove_endpoint_binder(service);
+}
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+static y_absl::flat_hash_map<TString, void*>* g_endpoint_binder_pool =
+ nullptr;
+
+namespace {
+
+grpc_core::Mutex* GetBinderPoolMutex() {
+ static grpc_core::Mutex* mu = new grpc_core::Mutex();
+ return mu;
+}
+
+} // namespace
+
+void grpc_add_endpoint_binder(const TString& service,
+ void* endpoint_binder) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ g_endpoint_binder_pool = new y_absl::flat_hash_map<TString, void*>();
+ }
+ (*g_endpoint_binder_pool)[service] = endpoint_binder;
+}
+
+void grpc_remove_endpoint_binder(const TString& service) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ return;
+ }
+ g_endpoint_binder_pool->erase(service);
+}
+
+void* grpc_get_endpoint_binder(const TString& service) {
+ grpc_core::MutexLock lock(GetBinderPoolMutex());
+ if (g_endpoint_binder_pool == nullptr) {
+ return nullptr;
+ }
+ auto iter = g_endpoint_binder_pool->find(service);
+ return iter == g_endpoint_binder_pool->end() ? nullptr : iter->second;
+}
+
+namespace grpc_core {
+
+class BinderServerListener : public Server::ListenerInterface {
+ public:
+ BinderServerListener(
+ Server* server, TString addr, BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy)
+ : server_(server),
+ addr_(std::move(addr)),
+ factory_(std::move(factory)),
+ security_policy_(security_policy) {}
+
+ void Start(Server* /*server*/,
+ const std::vector<grpc_pollset*>* /*pollsets*/) override {
+ tx_receiver_ = factory_(
+ [this](transaction_code_t code, grpc_binder::ReadableParcel* parcel,
+ int uid) { return OnSetupTransport(code, parcel, uid); });
+ endpoint_binder_ = tx_receiver_->GetRawBinder();
+ grpc_add_endpoint_binder(addr_, endpoint_binder_);
+ }
+
+ channelz::ListenSocketNode* channelz_listen_socket_node() const override {
+ return nullptr;
+ }
+
+ void SetOnDestroyDone(grpc_closure* on_destroy_done) override {
+ on_destroy_done_ = on_destroy_done;
+ }
+
+ void Orphan() override { delete this; }
+
+ ~BinderServerListener() override {
+ ExecCtx::Get()->Flush();
+ if (on_destroy_done_) {
+ ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, GRPC_ERROR_NONE);
+ ExecCtx::Get()->Flush();
+ }
+ grpc_remove_endpoint_binder(addr_);
+ }
+
+ private:
+ y_absl::Status OnSetupTransport(transaction_code_t code,
+ grpc_binder::ReadableParcel* parcel, int uid) {
+ ExecCtx exec_ctx;
+ if (grpc_binder::BinderTransportTxCode(code) !=
+ grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT) {
+ return y_absl::InvalidArgumentError("Not a SETUP_TRANSPORT request");
+ }
+
+ gpr_log(GPR_INFO, "BinderServerListener calling uid = %d", uid);
+ if (!security_policy_->IsAuthorized(uid)) {
+ // TODO(mingcl): For now we just ignore this unauthorized
+ // SETUP_TRANSPORT transaction and ghost the client. Check if we should
+ // send back a SHUTDOWN_TRANSPORT in this case.
+ return y_absl::PermissionDeniedError(
+ "UID " + ToString(uid) +
+ " is not allowed to connect to this "
+ "server according to security policy.");
+ }
+
+ int version;
+ y_absl::Status status = parcel->ReadInt32(&version);
+ if (!status.ok()) {
+ return status;
+ }
+ gpr_log(GPR_INFO, "BinderTransport client protocol version = %d", version);
+ // TODO(waynetu): Check supported version.
+ std::unique_ptr<grpc_binder::Binder> client_binder{};
+ status = parcel->ReadBinder(&client_binder);
+ if (!status.ok()) {
+ return status;
+ }
+ if (!client_binder) {
+ return y_absl::InvalidArgumentError("NULL binder read from the parcel");
+ }
+ client_binder->Initialize();
+ // Finish the second half of SETUP_TRANSPORT in
+ // grpc_create_binder_transport_server().
+ grpc_transport* server_transport = grpc_create_binder_transport_server(
+ std::move(client_binder), security_policy_);
+ GPR_ASSERT(server_transport);
+ grpc_channel_args* args = grpc_channel_args_copy(server_->channel_args());
+ grpc_error_handle error =
+ server_->SetupTransport(server_transport, nullptr, args, nullptr);
+ grpc_channel_args_destroy(args);
+ return grpc_error_to_absl_status(error);
+ }
+
+ Server* server_;
+ grpc_closure* on_destroy_done_ = nullptr;
+ TString addr_;
+ BinderTxReceiverFactory factory_;
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+ void* endpoint_binder_ = nullptr;
+ std::unique_ptr<grpc_binder::TransactionReceiver> tx_receiver_;
+};
+
+bool AddBinderPort(const TString& addr, grpc_server* server,
+ BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ // TODO(mingcl): Check if the addr is valid here after binder address resolver
+ // related code are merged.
+ const TString kBinderUriScheme = "binder:";
+ if (addr.compare(0, kBinderUriScheme.size(), kBinderUriScheme) != 0) {
+ return false;
+ }
+ TString conn_id = addr.substr(kBinderUriScheme.size());
+ Server* core_server = Server::FromC(server);
+ core_server->AddListener(
+ OrphanablePtr<Server::ListenerInterface>(new BinderServerListener(
+ core_server, conn_id, std::move(factory), security_policy)));
+ return true;
+}
+
+} // namespace grpc_core
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.h b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.h
new file mode 100644
index 00000000000..892c7923871
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server.h
@@ -0,0 +1,67 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+
+#include "y_absl/container/flat_hash_map.h"
+#include "y_absl/status/status.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
+
+// TODO(waynetu): This is part of the public API and should be moved to the
+// include/ folder.
+namespace grpc {
+namespace experimental {
+namespace binder {
+
+void* GetEndpointBinder(const TString& service);
+void AddEndpointBinder(const TString& service, void* endpoint_binder);
+void RemoveEndpointBinder(const TString& service);
+
+} // namespace binder
+} // namespace experimental
+} // namespace grpc
+
+void grpc_add_endpoint_binder(const TString& service,
+ void* endpoint_binder);
+void grpc_remove_endpoint_binder(const TString& service);
+void* grpc_get_endpoint_binder(const TString& service);
+
+namespace grpc_core {
+
+// Consume a callback, produce a transaction listener. This is used to perform
+// testing in non-Android environments where the actual binder is not available.
+using BinderTxReceiverFactory =
+ std::function<std::unique_ptr<grpc_binder::TransactionReceiver>(
+ grpc_binder::TransactionReceiver::OnTransactCb)>;
+
+bool AddBinderPort(const TString& addr, grpc_server* server,
+ BinderTxReceiverFactory factory,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_SERVER_BINDER_SERVER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc
new file mode 100644
index 00000000000..40e7c5f941e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/server/binder_server_credentials.cc
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include <grpcpp/security/binder_security_policy.h>
+#include <grpcpp/security/server_credentials.h>
+
+#include "src/core/ext/transport/binder/server/binder_server.h"
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+
+namespace grpc {
+namespace experimental {
+
+namespace {
+
+class BinderServerCredentialsImpl final : public ServerCredentials {
+ public:
+ explicit BinderServerCredentialsImpl(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy)
+ : security_policy_(security_policy) {}
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+ int AddPortToServer(const TString& addr, grpc_server* server) override {
+ return grpc_core::AddBinderPort(
+ TString(addr), server,
+ [](grpc_binder::TransactionReceiver::OnTransactCb transact_cb) {
+ return y_absl::make_unique<grpc_binder::TransactionReceiverAndroid>(
+ nullptr, std::move(transact_cb));
+ },
+ security_policy_);
+ }
+#else
+ int AddPortToServer(const TString& /*addr*/,
+ grpc_server* /*server*/) override {
+ return 0;
+ }
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+
+ void SetAuthMetadataProcessor(
+ const std::shared_ptr<AuthMetadataProcessor>& /*processor*/) override {
+ GPR_ASSERT(false);
+ }
+
+ private:
+ bool IsInsecure() const override { return true; }
+
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+};
+
+} // namespace
+
+std::shared_ptr<ServerCredentials> BinderServerCredentials(
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ GPR_ASSERT(security_policy != nullptr);
+ return std::shared_ptr<ServerCredentials>(
+ new BinderServerCredentialsImpl(security_policy));
+}
+
+} // namespace experimental
+} // namespace grpc
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_stream.h b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_stream.h
new file mode 100644
index 00000000000..da376656c87
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_stream.h
@@ -0,0 +1,114 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+
+struct RecvInitialMetadataArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ y_absl::StatusOr<grpc_binder::Metadata> initial_metadata;
+};
+
+struct RecvMessageArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ y_absl::StatusOr<TString> message;
+};
+
+struct RecvTrailingMetadataArgs {
+ grpc_binder_stream* gbs;
+ grpc_binder_transport* gbt;
+ int tx_code;
+ y_absl::StatusOr<grpc_binder::Metadata> trailing_metadata;
+ int status;
+};
+
+// TODO(mingcl): Figure out if we want to use class instead of struct here
+struct grpc_binder_stream {
+ // server_data will be null for client, and for server it will be whatever
+ // passed in to the accept_stream_fn callback by client.
+ grpc_binder_stream(grpc_binder_transport* t, grpc_stream_refcount* refcount,
+ const void* /*server_data*/, grpc_core::Arena* arena,
+ int tx_code, bool is_client)
+ : t(t),
+ refcount(refcount),
+ arena(arena),
+ tx_code(tx_code),
+ is_client(is_client),
+ is_closed(false) {
+ // TODO(waynetu): Should this be protected?
+ t->registered_stream[tx_code] = this;
+
+ recv_initial_metadata_args.gbs = this;
+ recv_initial_metadata_args.gbt = t;
+ recv_message_args.gbs = this;
+ recv_message_args.gbt = t;
+ recv_trailing_metadata_args.gbs = this;
+ recv_trailing_metadata_args.gbt = t;
+ }
+
+ ~grpc_binder_stream() {
+ GRPC_ERROR_UNREF(cancel_self_error);
+ if (destroy_stream_then_closure != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_then_closure,
+ GRPC_ERROR_NONE);
+ }
+ }
+
+ int GetTxCode() const { return tx_code; }
+
+ grpc_binder_transport* t;
+ grpc_stream_refcount* refcount;
+ grpc_core::Arena* arena;
+ grpc_core::ManualConstructor<grpc_core::SliceBufferByteStream> sbs;
+ int tx_code;
+ const bool is_client;
+ bool is_closed;
+
+ grpc_closure* destroy_stream_then_closure = nullptr;
+ grpc_closure destroy_stream;
+
+ // The reason why this stream is cancelled and closed.
+ grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
+
+ grpc_closure recv_initial_metadata_closure;
+ RecvInitialMetadataArgs recv_initial_metadata_args;
+ grpc_closure recv_message_closure;
+ RecvMessageArgs recv_message_args;
+ grpc_closure recv_trailing_metadata_closure;
+ RecvTrailingMetadataArgs recv_trailing_metadata_args;
+
+ // We store these fields passed from op batch, in order to access them through
+ // grpc_binder_stream
+ grpc_metadata_batch* recv_initial_metadata;
+ grpc_closure* recv_initial_metadata_ready = nullptr;
+ bool* trailing_metadata_available = nullptr;
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message;
+ grpc_closure* recv_message_ready = nullptr;
+ bool* call_failed_before_recv_message = nullptr;
+ grpc_metadata_batch* recv_trailing_metadata;
+ grpc_closure* recv_trailing_metadata_finished = nullptr;
+
+ bool trailing_metadata_sent = false;
+ bool need_to_call_trailing_metadata_callback = false;
+};
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_STREAM_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.cc b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.cc
new file mode 100644
index 00000000000..465fc9b0bd8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.cc
@@ -0,0 +1,777 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/transport/binder_transport.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <cstdint>
+#include <memory>
+#include <util/generic/string.h>
+#include <utility>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/substitute.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/transport/binder_stream.h"
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/transport/byte_stream.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/transport/status_metadata.h"
+#include "src/core/lib/transport/transport.h"
+
+#ifndef NDEBUG
+static void grpc_binder_stream_ref(grpc_binder_stream* s, const char* reason) {
+ grpc_stream_ref(s->refcount, reason);
+}
+static void grpc_binder_stream_unref(grpc_binder_stream* s,
+ const char* reason) {
+ grpc_stream_unref(s->refcount, reason);
+}
+static void grpc_binder_ref_transport(grpc_binder_transport* t,
+ const char* reason, const char* file,
+ int line) {
+ t->refs.Ref(grpc_core::DebugLocation(file, line), reason);
+}
+static void grpc_binder_unref_transport(grpc_binder_transport* t,
+ const char* reason, const char* file,
+ int line) {
+ if (t->refs.Unref(grpc_core::DebugLocation(file, line), reason)) {
+ delete t;
+ }
+}
+#else
+static void grpc_binder_stream_ref(grpc_binder_stream* s) {
+ grpc_stream_ref(s->refcount);
+}
+static void grpc_binder_stream_unref(grpc_binder_stream* s) {
+ grpc_stream_unref(s->refcount);
+}
+static void grpc_binder_ref_transport(grpc_binder_transport* t) {
+ t->refs.Ref();
+}
+static void grpc_binder_unref_transport(grpc_binder_transport* t) {
+ if (t->refs.Unref()) {
+ delete t;
+ }
+}
+#endif
+
+#ifndef NDEBUG
+#define GRPC_BINDER_STREAM_REF(stream, reason) \
+ grpc_binder_stream_ref(stream, reason)
+#define GRPC_BINDER_STREAM_UNREF(stream, reason) \
+ grpc_binder_stream_unref(stream, reason)
+#define GRPC_BINDER_REF_TRANSPORT(t, r) \
+ grpc_binder_ref_transport(t, r, __FILE__, __LINE__)
+#define GRPC_BINDER_UNREF_TRANSPORT(t, r) \
+ grpc_binder_unref_transport(t, r, __FILE__, __LINE__)
+#else
+#define GRPC_BINDER_STREAM_REF(stream, reason) grpc_binder_stream_ref(stream)
+#define GRPC_BINDER_STREAM_UNREF(stream, reason) \
+ grpc_binder_stream_unref(stream)
+#define GRPC_BINDER_REF_TRANSPORT(t, r) grpc_binder_ref_transport(t)
+#define GRPC_BINDER_UNREF_TRANSPORT(t, r) grpc_binder_unref_transport(t)
+#endif
+
+static int init_stream(grpc_transport* gt, grpc_stream* gs,
+ grpc_stream_refcount* refcount, const void* server_data,
+ grpc_core::Arena* arena) {
+ GPR_TIMER_SCOPE("init_stream", 0);
+ gpr_log(GPR_INFO, "%s = %p %p %p %p %p", __func__, gt, gs, refcount,
+ server_data, arena);
+ grpc_binder_transport* t = reinterpret_cast<grpc_binder_transport*>(gt);
+ // TODO(mingcl): Figure out if we need to worry about concurrent invocation
+ // here
+ new (gs) grpc_binder_stream(t, refcount, server_data, arena,
+ t->NewStreamTxCode(), t->is_client);
+ return 0;
+}
+
+static void set_pollset(grpc_transport* gt, grpc_stream* gs, grpc_pollset* gp) {
+ gpr_log(GPR_INFO, "%s = %p %p %p", __func__, gt, gs, gp);
+}
+
+static void set_pollset_set(grpc_transport*, grpc_stream*, grpc_pollset_set*) {
+ gpr_log(GPR_INFO, __func__);
+}
+
+static void AssignMetadata(grpc_metadata_batch* mb,
+ const grpc_binder::Metadata& md) {
+ mb->Clear();
+ for (auto& p : md) {
+ mb->Append(p.first, grpc_core::Slice::FromCopiedString(p.second));
+ }
+}
+
+static void cancel_stream_locked(grpc_binder_transport* gbt,
+ grpc_binder_stream* gbs,
+ grpc_error_handle error) {
+ gpr_log(GPR_INFO, "cancel_stream_locked");
+ if (!gbs->is_closed) {
+ GPR_ASSERT(gbs->cancel_self_error == GRPC_ERROR_NONE);
+ gbs->is_closed = true;
+ gbs->cancel_self_error = GRPC_ERROR_REF(error);
+ gbt->transport_stream_receiver->CancelStream(gbs->tx_code);
+ gbt->registered_stream.erase(gbs->tx_code);
+ if (gbs->recv_initial_metadata_ready != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, gbs->recv_initial_metadata_ready,
+ GRPC_ERROR_REF(error));
+ gbs->recv_initial_metadata_ready = nullptr;
+ gbs->recv_initial_metadata = nullptr;
+ gbs->trailing_metadata_available = nullptr;
+ }
+ if (gbs->recv_message_ready != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, gbs->recv_message_ready,
+ GRPC_ERROR_REF(error));
+ gbs->recv_message_ready = nullptr;
+ gbs->recv_message->reset();
+ gbs->recv_message = nullptr;
+ gbs->call_failed_before_recv_message = nullptr;
+ }
+ if (gbs->recv_trailing_metadata_finished != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION,
+ gbs->recv_trailing_metadata_finished,
+ GRPC_ERROR_REF(error));
+ gbs->recv_trailing_metadata_finished = nullptr;
+ gbs->recv_trailing_metadata = nullptr;
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+static bool ContainsAuthorityAndPath(const grpc_binder::Metadata& metadata) {
+ bool has_authority = false;
+ bool has_path = false;
+ for (const auto& kv : metadata) {
+ if (kv.first == grpc_core::StringViewFromSlice(GRPC_MDSTR_AUTHORITY)) {
+ has_authority = true;
+ }
+ if (kv.first == grpc_core::StringViewFromSlice(GRPC_MDSTR_PATH)) {
+ has_path = true;
+ }
+ }
+ return has_authority && has_path;
+}
+
+static void recv_initial_metadata_locked(void* arg,
+ grpc_error_handle /*error*/) {
+ RecvInitialMetadataArgs* args = static_cast<RecvInitialMetadataArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO,
+ "recv_initial_metadata_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_initial_metadata);
+ GPR_ASSERT(gbs->recv_initial_metadata_ready);
+ if (!args->initial_metadata.ok()) {
+ gpr_log(GPR_ERROR, "Failed to parse initial metadata");
+ return absl_status_to_grpc_error(args->initial_metadata.status());
+ }
+ if (!gbs->is_client) {
+ // For server, we expect :authority and :path in initial metadata.
+ if (!ContainsAuthorityAndPath(*args->initial_metadata)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ "Missing :authority or :path in initial metadata");
+ }
+ }
+ AssignMetadata(gbs->recv_initial_metadata, *args->initial_metadata);
+ return GRPC_ERROR_NONE;
+ }();
+
+ grpc_closure* cb = gbs->recv_initial_metadata_ready;
+ gbs->recv_initial_metadata_ready = nullptr;
+ gbs->recv_initial_metadata = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_initial_metadata");
+}
+
+static void recv_message_locked(void* arg, grpc_error_handle /*error*/) {
+ RecvMessageArgs* args = static_cast<RecvMessageArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO, "recv_message_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_message);
+ GPR_ASSERT(gbs->recv_message_ready);
+ if (!args->message.ok()) {
+ gpr_log(GPR_ERROR, "Failed to receive message");
+ if (args->message.status().message() ==
+ grpc_binder::TransportStreamReceiver::
+ kGrpcBinderTransportCancelledGracefully) {
+ gpr_log(GPR_ERROR, "message cancelled gracefully");
+ // Cancelled because we've already received trailing metadata.
+ // It's not an error in this case.
+ return GRPC_ERROR_NONE;
+ } else {
+ return absl_status_to_grpc_error(args->message.status());
+ }
+ }
+ grpc_slice_buffer buf;
+ grpc_slice_buffer_init(&buf);
+ grpc_slice_buffer_add(&buf, grpc_slice_from_cpp_string(*args->message));
+
+ gbs->sbs.Init(&buf, 0);
+ gbs->recv_message->reset(gbs->sbs.get());
+ return GRPC_ERROR_NONE;
+ }();
+
+ if (error != GRPC_ERROR_NONE &&
+ gbs->call_failed_before_recv_message != nullptr) {
+ *gbs->call_failed_before_recv_message = true;
+ }
+ grpc_closure* cb = gbs->recv_message_ready;
+ gbs->recv_message_ready = nullptr;
+ gbs->recv_message = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ }
+
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_message");
+}
+
+static void recv_trailing_metadata_locked(void* arg,
+ grpc_error_handle /*error*/) {
+ RecvTrailingMetadataArgs* args = static_cast<RecvTrailingMetadataArgs*>(arg);
+ grpc_binder_stream* gbs = args->gbs;
+
+ gpr_log(GPR_INFO,
+ "recv_trailing_metadata_locked is_client = %d is_closed = %d",
+ gbs->is_client, gbs->is_closed);
+
+ if (!gbs->is_closed) {
+ grpc_error_handle error = [&] {
+ GPR_ASSERT(gbs->recv_trailing_metadata);
+ GPR_ASSERT(gbs->recv_trailing_metadata_finished);
+ if (!args->trailing_metadata.ok()) {
+ gpr_log(GPR_ERROR, "Failed to receive trailing metadata");
+ return absl_status_to_grpc_error(args->trailing_metadata.status());
+ }
+ if (!gbs->is_client) {
+ // Client will not send non-empty trailing metadata.
+ if (!args->trailing_metadata.value().empty()) {
+ gpr_log(GPR_ERROR, "Server receives non-empty trailing metadata.");
+ return GRPC_ERROR_CANCELLED;
+ }
+ } else {
+ AssignMetadata(gbs->recv_trailing_metadata, *args->trailing_metadata);
+ // Append status to metadata
+ // TODO(b/192208695): See if we can avoid to manually put status
+ // code into the header
+ gpr_log(GPR_INFO, "status = %d", args->status);
+ grpc_linked_mdelem* glm = static_cast<grpc_linked_mdelem*>(
+ gbs->arena->Alloc(sizeof(grpc_linked_mdelem)));
+ glm->md = grpc_get_reffed_status_elem(args->status);
+ GPR_ASSERT(gbs->recv_trailing_metadata->LinkTail(glm) ==
+ GRPC_ERROR_NONE);
+ gpr_log(GPR_INFO, "trailing_metadata = %p",
+ gbs->recv_trailing_metadata);
+ gpr_log(GPR_INFO, "glm = %p", glm);
+ }
+ return GRPC_ERROR_NONE;
+ }();
+
+ if (gbs->is_client || gbs->trailing_metadata_sent) {
+ grpc_closure* cb = gbs->recv_trailing_metadata_finished;
+ gbs->recv_trailing_metadata_finished = nullptr;
+ gbs->recv_trailing_metadata = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+ } else {
+ // According to transport explaineer - "Server extra: This op shouldn't
+ // actually be considered complete until the server has also sent trailing
+ // metadata to provide the other side with final status"
+ //
+ // We haven't sent trailing metadata yet, so we have to delay completing
+ // the recv_trailing_metadata callback.
+ gbs->need_to_call_trailing_metadata_callback = true;
+ }
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "recv_trailing_metadata");
+}
+
+namespace grpc_binder {
+namespace {
+
+class MetadataEncoder {
+ public:
+ MetadataEncoder(bool is_client, Transaction* tx, Metadata* init_md)
+ : is_client_(is_client), tx_(tx), init_md_(init_md) {}
+
+ void Encode(grpc_mdelem md) {
+ y_absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md));
+ y_absl::string_view value = grpc_core::StringViewFromSlice(GRPC_MDVALUE(md));
+ gpr_log(GPR_INFO, "send metadata key-value %s",
+ y_absl::StrCat(key, " ", value).c_str());
+ if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_PATH)) {
+ // TODO(b/192208403): Figure out if it is correct to simply drop '/'
+ // prefix and treat it as rpc method name
+ GPR_ASSERT(value[0] == '/');
+ TString path = TString(value).substr(1);
+
+ // Only client send method ref.
+ GPR_ASSERT(is_client_);
+ tx_->SetMethodRef(path);
+ } else if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_STATUS)) {
+ int status = grpc_get_status_code_from_metadata(md);
+ gpr_log(GPR_INFO, "send trailing metadata status = %d", status);
+ tx_->SetStatus(status);
+ } else {
+ init_md_->emplace_back(TString(key), TString(value));
+ }
+ }
+
+ template <typename Trait>
+ void Encode(Trait, const typename Trait::ValueType& value) {
+ init_md_->emplace_back(TString(Trait::key()),
+ TString(Trait::Encode(value).as_string_view()));
+ }
+
+ private:
+ const bool is_client_;
+ Transaction* const tx_;
+ Metadata* const init_md_;
+};
+
+} // namespace
+} // namespace grpc_binder
+
+static void perform_stream_op_locked(void* stream_op,
+ grpc_error_handle /*error*/) {
+ grpc_transport_stream_op_batch* op =
+ static_cast<grpc_transport_stream_op_batch*>(stream_op);
+ grpc_binder_stream* gbs =
+ static_cast<grpc_binder_stream*>(op->handler_private.extra_arg);
+ grpc_binder_transport* gbt = gbs->t;
+ if (op->cancel_stream) {
+ // TODO(waynetu): Is this true?
+ GPR_ASSERT(!op->send_initial_metadata && !op->send_message &&
+ !op->send_trailing_metadata && !op->recv_initial_metadata &&
+ !op->recv_message && !op->recv_trailing_metadata);
+ gpr_log(GPR_INFO, "cancel_stream is_client = %d", gbs->is_client);
+ if (!gbs->is_client) {
+ // Send trailing metadata to inform the other end about the cancellation,
+ // regardless if we'd already done that or not.
+ grpc_binder::Transaction cancel_tx(gbs->GetTxCode(), gbt->is_client);
+ cancel_tx.SetSuffix(grpc_binder::Metadata{});
+ cancel_tx.SetStatus(1);
+ y_absl::Status status = gbt->wire_writer->RpcCall(cancel_tx);
+ }
+ cancel_stream_locked(gbt, gbs, op->payload->cancel_stream.cancel_error);
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete, GRPC_ERROR_NONE);
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+ return;
+ }
+
+ if (gbs->is_closed) {
+ if (op->send_message) {
+ // Reset the send_message payload to prevent memory leaks.
+ op->payload->send_message.send_message.reset();
+ }
+ if (op->recv_initial_metadata) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->recv_message) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION,
+ op->payload->recv_message.recv_message_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->recv_trailing_metadata) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION,
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
+ GRPC_ERROR_REF(gbs->cancel_self_error));
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+ return;
+ }
+
+ int tx_code = gbs->tx_code;
+ grpc_binder::Transaction tx(tx_code, gbt->is_client);
+
+ if (op->send_initial_metadata) {
+ gpr_log(GPR_INFO, "send_initial_metadata");
+ grpc_binder::Metadata init_md;
+ auto batch = op->payload->send_initial_metadata.send_initial_metadata;
+
+ grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx, &init_md);
+ batch->Encode(&encoder);
+ tx.SetPrefix(init_md);
+ }
+ if (op->send_message) {
+ gpr_log(GPR_INFO, "send_message");
+ size_t remaining = op->payload->send_message.send_message->length();
+ TString message_data;
+ while (remaining > 0) {
+ grpc_slice message_slice;
+ // TODO(waynetu): Temporarily assume that the message is ready.
+ GPR_ASSERT(
+ op->payload->send_message.send_message->Next(SIZE_MAX, nullptr));
+ grpc_error_handle error =
+ op->payload->send_message.send_message->Pull(&message_slice);
+ // TODO(waynetu): Cancel the stream if error is not GRPC_ERROR_NONE.
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
+ uint8_t* p = GRPC_SLICE_START_PTR(message_slice);
+ size_t len = GRPC_SLICE_LENGTH(message_slice);
+ remaining -= len;
+ message_data += TString(reinterpret_cast<char*>(p), len);
+ grpc_slice_unref_internal(message_slice);
+ }
+ gpr_log(GPR_INFO, "message_data = %s", message_data.c_str());
+ tx.SetData(message_data);
+ // TODO(b/192369787): Are we supposed to reset here to avoid
+ // use-after-free issue in call.cc?
+ op->payload->send_message.send_message.reset();
+ }
+
+ if (op->send_trailing_metadata) {
+ gpr_log(GPR_INFO, "send_trailing_metadata");
+ auto batch = op->payload->send_trailing_metadata.send_trailing_metadata;
+ grpc_binder::Metadata trailing_metadata;
+
+ grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx,
+ &trailing_metadata);
+ batch->Encode(&encoder);
+
+ // TODO(mingcl): Will we ever has key-value pair here? According to
+ // wireformat client suffix data is always empty.
+ tx.SetSuffix(trailing_metadata);
+ }
+ if (op->recv_initial_metadata) {
+ gpr_log(GPR_INFO, "recv_initial_metadata");
+ gbs->recv_initial_metadata_ready =
+ op->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ gbs->recv_initial_metadata =
+ op->payload->recv_initial_metadata.recv_initial_metadata;
+ gbs->trailing_metadata_available =
+ op->payload->recv_initial_metadata.trailing_metadata_available;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_initial_metadata");
+ gbt->transport_stream_receiver->RegisterRecvInitialMetadata(
+ tx_code, [tx_code, gbs,
+ gbt](y_absl::StatusOr<grpc_binder::Metadata> initial_metadata) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_initial_metadata_args.tx_code = tx_code;
+ gbs->recv_initial_metadata_args.initial_metadata =
+ std::move(initial_metadata);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_initial_metadata_closure,
+ recv_initial_metadata_locked,
+ &gbs->recv_initial_metadata_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ if (op->recv_message) {
+ gpr_log(GPR_INFO, "recv_message");
+ gbs->recv_message_ready = op->payload->recv_message.recv_message_ready;
+ gbs->recv_message = op->payload->recv_message.recv_message;
+ gbs->call_failed_before_recv_message =
+ op->payload->recv_message.call_failed_before_recv_message;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_message");
+ gbt->transport_stream_receiver->RegisterRecvMessage(
+ tx_code, [tx_code, gbs, gbt](y_absl::StatusOr<TString> message) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_message_args.tx_code = tx_code;
+ gbs->recv_message_args.message = std::move(message);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_message_closure, recv_message_locked,
+ &gbs->recv_message_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ if (op->recv_trailing_metadata) {
+ gpr_log(GPR_INFO, "recv_trailing_metadata");
+ gbs->recv_trailing_metadata_finished =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
+ gbs->recv_trailing_metadata =
+ op->payload->recv_trailing_metadata.recv_trailing_metadata;
+ GRPC_BINDER_STREAM_REF(gbs, "recv_trailing_metadata");
+ gbt->transport_stream_receiver->RegisterRecvTrailingMetadata(
+ tx_code, [tx_code, gbs, gbt](
+ y_absl::StatusOr<grpc_binder::Metadata> trailing_metadata,
+ int status) {
+ grpc_core::ExecCtx exec_ctx;
+ gbs->recv_trailing_metadata_args.tx_code = tx_code;
+ gbs->recv_trailing_metadata_args.trailing_metadata =
+ std::move(trailing_metadata);
+ gbs->recv_trailing_metadata_args.status = status;
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&gbs->recv_trailing_metadata_closure,
+ recv_trailing_metadata_locked,
+ &gbs->recv_trailing_metadata_args, nullptr),
+ GRPC_ERROR_NONE);
+ });
+ }
+ // Only send transaction when there's a send op presented.
+ y_absl::Status status = y_absl::OkStatus();
+ if (op->send_initial_metadata || op->send_message ||
+ op->send_trailing_metadata) {
+ // TODO(waynetu): RpcCall() is doing a lot of work (including waiting for
+ // acknowledgements from the other side). Consider delaying this operation
+ // with combiner.
+ status = gbt->wire_writer->RpcCall(tx);
+ if (!gbs->is_client && op->send_trailing_metadata) {
+ gbs->trailing_metadata_sent = true;
+ // According to transport explaineer - "Server extra: This op shouldn't
+ // actually be considered complete until the server has also sent trailing
+ // metadata to provide the other side with final status"
+ //
+ // Because we've done sending trailing metadata here, we can safely
+ // complete the recv_trailing_metadata callback here.
+ if (gbs->need_to_call_trailing_metadata_callback) {
+ grpc_closure* cb = gbs->recv_trailing_metadata_finished;
+ gbs->recv_trailing_metadata_finished = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
+ gbs->need_to_call_trailing_metadata_callback = false;
+ }
+ }
+ }
+ // Note that this should only be scheduled when all non-recv ops are
+ // completed
+ if (op->on_complete != nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
+ absl_status_to_grpc_error(status));
+ gpr_log(GPR_INFO, "on_complete closure schuduled");
+ }
+ GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
+}
+
+static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
+ grpc_transport_stream_op_batch* op) {
+ GPR_TIMER_SCOPE("perform_stream_op", 0);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ grpc_binder_stream* gbs = reinterpret_cast<grpc_binder_stream*>(gs);
+ gpr_log(GPR_INFO, "%s = %p %p %p is_client = %d", __func__, gt, gs, op,
+ gbs->is_client);
+ GRPC_BINDER_STREAM_REF(gbs, "perform_stream_op");
+ op->handler_private.extra_arg = gbs;
+ gbt->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
+ perform_stream_op_locked, op, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void close_transport_locked(grpc_binder_transport* gbt) {
+ gbt->state_tracker.SetState(GRPC_CHANNEL_SHUTDOWN, y_absl::OkStatus(),
+ "transport closed due to disconnection/goaway");
+ while (!gbt->registered_stream.empty()) {
+ cancel_stream_locked(
+ gbt, gbt->registered_stream.begin()->second,
+ grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("transport closed"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ }
+}
+
+static void perform_transport_op_locked(void* transport_op,
+ grpc_error_handle /*error*/) {
+ grpc_transport_op* op = static_cast<grpc_transport_op*>(transport_op);
+ grpc_binder_transport* gbt =
+ static_cast<grpc_binder_transport*>(op->handler_private.extra_arg);
+ // TODO(waynetu): Should we lock here to avoid data race?
+ if (op->start_connectivity_watch != nullptr) {
+ gbt->state_tracker.AddWatcher(op->start_connectivity_watch_state,
+ std::move(op->start_connectivity_watch));
+ }
+ if (op->stop_connectivity_watch != nullptr) {
+ gbt->state_tracker.RemoveWatcher(op->stop_connectivity_watch);
+ }
+ if (op->set_accept_stream) {
+ gbt->accept_stream_fn = op->set_accept_stream_fn;
+ gbt->accept_stream_user_data = op->set_accept_stream_user_data;
+ }
+ if (op->on_consumed) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
+ }
+ bool do_close = false;
+ if (op->disconnect_with_error != GRPC_ERROR_NONE) {
+ do_close = true;
+ GRPC_ERROR_UNREF(op->disconnect_with_error);
+ }
+ if (op->goaway_error != GRPC_ERROR_NONE) {
+ do_close = true;
+ GRPC_ERROR_UNREF(op->goaway_error);
+ }
+ if (do_close) {
+ close_transport_locked(gbt);
+ }
+ GRPC_BINDER_UNREF_TRANSPORT(gbt, "perform_transport_op");
+}
+
+static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ op->handler_private.extra_arg = gbt;
+ GRPC_BINDER_REF_TRANSPORT(gbt, "perform_transport_op");
+ gbt->combiner->Run(
+ GRPC_CLOSURE_INIT(&op->handler_private.closure,
+ perform_transport_op_locked, op, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
+ grpc_binder_stream* gbs = static_cast<grpc_binder_stream*>(sp);
+ grpc_binder_transport* gbt = gbs->t;
+ cancel_stream_locked(
+ gbt, gbs,
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING("destroy stream"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE));
+ gbs->~grpc_binder_stream();
+}
+
+static void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
+ grpc_closure* then_schedule_closure) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_stream* gbs = reinterpret_cast<grpc_binder_stream*>(gs);
+ gbs->destroy_stream_then_closure = then_schedule_closure;
+ gbs->t->combiner->Run(GRPC_CLOSURE_INIT(&gbs->destroy_stream,
+ destroy_stream_locked, gbs, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static void destroy_transport_locked(void* gt, grpc_error_handle /*error*/) {
+ grpc_binder_transport* gbt = static_cast<grpc_binder_transport*>(gt);
+ close_transport_locked(gbt);
+ // Release the references held by the transport.
+ gbt->wire_reader = nullptr;
+ gbt->transport_stream_receiver = nullptr;
+ gbt->wire_writer = nullptr;
+ GRPC_BINDER_UNREF_TRANSPORT(gbt, "transport destroyed");
+}
+
+static void destroy_transport(grpc_transport* gt) {
+ gpr_log(GPR_INFO, __func__);
+ grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
+ gbt->combiner->Run(
+ GRPC_CLOSURE_CREATE(destroy_transport_locked, gbt, nullptr),
+ GRPC_ERROR_NONE);
+}
+
+static grpc_endpoint* get_endpoint(grpc_transport*) {
+ gpr_log(GPR_INFO, __func__);
+ return nullptr;
+}
+
+// See grpc_transport_vtable declaration for meaning of each field
+static const grpc_transport_vtable vtable = {sizeof(grpc_binder_stream),
+ "binder",
+ init_stream,
+ set_pollset,
+ set_pollset_set,
+ perform_stream_op,
+ perform_transport_op,
+ destroy_stream,
+ destroy_transport,
+ get_endpoint};
+
+static const grpc_transport_vtable* get_vtable() { return &vtable; }
+
+static void accept_stream_locked(void* gt, grpc_error_handle /*error*/) {
+ grpc_binder_transport* gbt = static_cast<grpc_binder_transport*>(gt);
+ if (gbt->accept_stream_fn) {
+ // must pass in a non-null value.
+ (*gbt->accept_stream_fn)(gbt->accept_stream_user_data, &gbt->base, gbt);
+ }
+}
+
+grpc_binder_transport::grpc_binder_transport(
+ std::unique_ptr<grpc_binder::Binder> binder, bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy)
+ : is_client(is_client),
+ combiner(grpc_combiner_create()),
+ state_tracker(
+ is_client ? "binder_transport_client" : "binder_transport_server",
+ GRPC_CHANNEL_READY),
+ refs(1, nullptr) {
+ gpr_log(GPR_INFO, __func__);
+ base.vtable = get_vtable();
+ GRPC_CLOSURE_INIT(&accept_stream_closure, accept_stream_locked, this,
+ nullptr);
+ transport_stream_receiver =
+ std::make_shared<grpc_binder::TransportStreamReceiverImpl>(
+ is_client, /*accept_stream_callback=*/[this] {
+ grpc_core::ExecCtx exec_ctx;
+ combiner->Run(&accept_stream_closure, GRPC_ERROR_NONE);
+ });
+ // WireReader holds a ref to grpc_binder_transport.
+ GRPC_BINDER_REF_TRANSPORT(this, "wire reader");
+ wire_reader = grpc_core::MakeOrphanable<grpc_binder::WireReaderImpl>(
+ transport_stream_receiver, is_client, security_policy,
+ /*on_destruct_callback=*/
+ [this] {
+ // Unref transport when destructed.
+ GRPC_BINDER_UNREF_TRANSPORT(this, "wire reader");
+ });
+ wire_writer = wire_reader->SetupTransport(std::move(binder));
+}
+
+grpc_binder_transport::~grpc_binder_transport() {
+ GRPC_COMBINER_UNREF(combiner, "binder_transport");
+}
+
+grpc_transport* grpc_create_binder_transport_client(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ gpr_log(GPR_INFO, __func__);
+
+ GPR_ASSERT(endpoint_binder != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ grpc_binder_transport* t = new grpc_binder_transport(
+ std::move(endpoint_binder), /*is_client=*/true, security_policy);
+
+ return &t->base;
+}
+
+grpc_transport* grpc_create_binder_transport_server(
+ std::unique_ptr<grpc_binder::Binder> client_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy) {
+ gpr_log(GPR_INFO, __func__);
+
+ GPR_ASSERT(client_binder != nullptr);
+ GPR_ASSERT(security_policy != nullptr);
+
+ grpc_binder_transport* t = new grpc_binder_transport(
+ std::move(client_binder), /*is_client=*/false, security_policy);
+
+ return &t->base;
+}
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.h b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.h
new file mode 100644
index 00000000000..f989e5f4427
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/transport/binder_transport.h
@@ -0,0 +1,95 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <util/generic/string.h>
+#include <utility>
+#include <vector>
+
+#include "y_absl/container/flat_hash_map.h"
+
+#include <grpc/support/log.h>
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/transport/transport.h"
+#include "src/core/lib/transport/transport_impl.h"
+
+struct grpc_binder_stream;
+
+// TODO(mingcl): Consider putting the struct in a namespace (Eventually this
+// depends on what style we want to follow)
+// TODO(mingcl): Decide casing for this class name. Should we use C-style class
+// name here or just go with C++ style?
+struct grpc_binder_transport {
+ explicit grpc_binder_transport(
+ std::unique_ptr<grpc_binder::Binder> binder, bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+ ~grpc_binder_transport();
+
+ int NewStreamTxCode() {
+ // TODO(mingcl): Wrap around when all tx codes are used. "If we do detect a
+ // collision however, we will fail the new call with UNAVAILABLE, and shut
+ // down the transport gracefully."
+ GPR_ASSERT(next_free_tx_code <= LAST_CALL_TRANSACTION);
+ return next_free_tx_code++;
+ }
+
+ grpc_transport base; /* must be first */
+
+ std::shared_ptr<grpc_binder::TransportStreamReceiver>
+ transport_stream_receiver;
+ grpc_core::OrphanablePtr<grpc_binder::WireReader> wire_reader;
+ std::shared_ptr<grpc_binder::WireWriter> wire_writer;
+
+ bool is_client;
+ // A set of currently registered streams (the key is the stream ID).
+ y_absl::flat_hash_map<int, grpc_binder_stream*> registered_stream;
+ grpc_core::Combiner* combiner;
+
+ grpc_closure accept_stream_closure;
+
+ // The callback and the data for the callback when the stream is connected
+ // between client and server.
+ void (*accept_stream_fn)(void* user_data, grpc_transport* transport,
+ const void* server_data) = nullptr;
+ void* accept_stream_user_data = nullptr;
+
+ grpc_core::ConnectivityStateTracker state_tracker;
+ grpc_core::RefCount refs;
+
+ private:
+ int next_free_tx_code = grpc_binder::kFirstCallId;
+};
+
+grpc_transport* grpc_create_binder_transport_client(
+ std::unique_ptr<grpc_binder::Binder> endpoint_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+grpc_transport* grpc_create_binder_transport_server(
+ std::unique_ptr<grpc_binder::Binder> client_binder,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy);
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_TRANSPORT_BINDER_TRANSPORT_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc b/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc
new file mode 100644
index 00000000000..5c0aedd7d53
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.cc
@@ -0,0 +1,165 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+
+#ifndef GRPC_NO_BINDER
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <dlfcn.h>
+
+#include <grpc/support/log.h>
+
+namespace {
+void* GetNdkBinderHandle() {
+ // TODO(mingcl): Consider using RTLD_NOLOAD to check if it is already loaded
+ // first
+ static void* handle = dlopen("libbinder_ndk.so", RTLD_LAZY);
+ if (handle == nullptr) {
+ gpr_log(
+ GPR_ERROR,
+ "Cannot open libbinder_ndk.so. Does this device support API level 29?");
+ GPR_ASSERT(0);
+ }
+ return handle;
+}
+} // namespace
+
+namespace grpc_binder {
+namespace ndk_util {
+
+// Helper macro to obtain the function pointer corresponding to the name
+#define FORWARD(name) \
+ typedef decltype(&name) func_type; \
+ static func_type ptr = \
+ reinterpret_cast<func_type>(dlsym(GetNdkBinderHandle(), #name)); \
+ if (ptr == nullptr) { \
+ gpr_log(GPR_ERROR, \
+ "dlsym failed. Cannot find %s in libbinder_ndk.so. " \
+ "BinderTransport requires API level >= 33", \
+ #name); \
+ GPR_ASSERT(0); \
+ } \
+ return ptr
+
+void AIBinder_Class_disableInterfaceTokenHeader(AIBinder_Class* clazz) {
+ FORWARD(AIBinder_Class_disableInterfaceTokenHeader)(clazz);
+}
+
+void* AIBinder_getUserData(AIBinder* binder) {
+ FORWARD(AIBinder_getUserData)(binder);
+}
+
+uid_t AIBinder_getCallingUid() { FORWARD(AIBinder_getCallingUid)(); }
+
+AIBinder* AIBinder_fromJavaBinder(JNIEnv* env, jobject binder) {
+ FORWARD(AIBinder_fromJavaBinder)(env, binder);
+}
+
+AIBinder_Class* AIBinder_Class_define(const char* interfaceDescriptor,
+ AIBinder_Class_onCreate onCreate,
+ AIBinder_Class_onDestroy onDestroy,
+ AIBinder_Class_onTransact onTransact) {
+ FORWARD(AIBinder_Class_define)
+ (interfaceDescriptor, onCreate, onDestroy, onTransact);
+}
+
+AIBinder* AIBinder_new(const AIBinder_Class* clazz, void* args) {
+ FORWARD(AIBinder_new)(clazz, args);
+}
+
+bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz) {
+ FORWARD(AIBinder_associateClass)(binder, clazz);
+}
+
+void AIBinder_incStrong(AIBinder* binder) {
+ FORWARD(AIBinder_incStrong)(binder);
+}
+
+void AIBinder_decStrong(AIBinder* binder) {
+ FORWARD(AIBinder_decStrong)(binder);
+}
+
+binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code,
+ AParcel** in, AParcel** out,
+ binder_flags_t flags) {
+ FORWARD(AIBinder_transact)(binder, code, in, out, flags);
+}
+
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteArrayAllocator allocator) {
+ FORWARD(AParcel_readByteArray)(parcel, arrayData, allocator);
+}
+
+void AParcel_delete(AParcel* parcel) { FORWARD(AParcel_delete)(parcel); }
+int32_t AParcel_getDataSize(const AParcel* parcel) {
+ FORWARD(AParcel_getDataSize)(parcel);
+}
+
+binder_status_t AParcel_writeInt32(AParcel* parcel, int32_t value) {
+ FORWARD(AParcel_writeInt32)(parcel, value);
+}
+
+binder_status_t AParcel_writeInt64(AParcel* parcel, int64_t value) {
+ FORWARD(AParcel_writeInt64)(parcel, value);
+}
+
+binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) {
+ FORWARD(AParcel_writeStrongBinder)(parcel, binder);
+}
+
+binder_status_t AParcel_writeString(AParcel* parcel, const char* string,
+ int32_t length) {
+ FORWARD(AParcel_writeString)(parcel, string, length);
+}
+
+binder_status_t AParcel_readInt32(const AParcel* parcel, int32_t* value) {
+ FORWARD(AParcel_readInt32)(parcel, value);
+}
+
+binder_status_t AParcel_readInt64(const AParcel* parcel, int64_t* value) {
+ FORWARD(AParcel_readInt64)(parcel, value);
+}
+
+binder_status_t AParcel_readString(const AParcel* parcel, void* stringData,
+ AParcel_stringAllocator allocator) {
+ FORWARD(AParcel_readString)(parcel, stringData, allocator);
+}
+
+binder_status_t AParcel_readStrongBinder(const AParcel* parcel,
+ AIBinder** binder) {
+ FORWARD(AParcel_readStrongBinder)(parcel, binder);
+}
+
+binder_status_t AParcel_writeByteArray(AParcel* parcel, const int8_t* arrayData,
+ int32_t length) {
+ FORWARD(AParcel_writeByteArray)(parcel, arrayData, length);
+}
+
+binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in) {
+ FORWARD(AIBinder_prepareTransaction)(binder, in);
+}
+
+jobject AIBinder_toJavaBinder(JNIEnv* env, AIBinder* binder) {
+ FORWARD(AIBinder_toJavaBinder)(env, binder);
+}
+
+} // namespace ndk_util
+} // namespace grpc_binder
+
+#endif
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.h b/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.h
new file mode 100644
index 00000000000..305bbf52f86
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/utils/ndk_binder.h
@@ -0,0 +1,107 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <assert.h>
+#error #include <jni.h>
+
+#include <memory>
+
+// This file defines NdkBinder functions, variables, and types in
+// ::grpc_binder::ndk_util namespace. This allows us to dynamically load
+// libbinder_ndk at runtime, and make it possible to compile the code without
+// the library present at compile time.
+
+// TODO(mingcl): Consider if we want to check API level and include NDK headers
+// normally if the level is high enough
+
+namespace grpc_binder {
+namespace ndk_util {
+
+struct AIBinder;
+struct AParcel;
+struct AIBinder_Class;
+
+// Only enum values used by the project is defined here
+enum {
+ FLAG_ONEWAY = 0x01,
+};
+enum {
+ STATUS_OK = 0,
+ STATUS_UNKNOWN_ERROR = (-2147483647 - 1),
+};
+
+typedef int32_t binder_status_t;
+typedef uint32_t binder_flags_t;
+typedef uint32_t transaction_code_t;
+
+typedef bool (*AParcel_byteArrayAllocator)(void* arrayData, int32_t length,
+ int8_t** outBuffer);
+typedef bool (*AParcel_stringAllocator)(void* stringData, int32_t length,
+ char** buffer);
+typedef void* (*AIBinder_Class_onCreate)(void* args);
+typedef void (*AIBinder_Class_onDestroy)(void* userData);
+typedef binder_status_t (*AIBinder_Class_onTransact)(AIBinder* binder,
+ transaction_code_t code,
+ const AParcel* in,
+ AParcel* out);
+
+void AIBinder_Class_disableInterfaceTokenHeader(AIBinder_Class* clazz);
+void* AIBinder_getUserData(AIBinder* binder);
+uid_t AIBinder_getCallingUid();
+AIBinder* AIBinder_fromJavaBinder(JNIEnv* env, jobject binder);
+AIBinder_Class* AIBinder_Class_define(const char* interfaceDescriptor,
+ AIBinder_Class_onCreate onCreate,
+ AIBinder_Class_onDestroy onDestroy,
+ AIBinder_Class_onTransact onTransact);
+AIBinder* AIBinder_new(const AIBinder_Class* clazz, void* args);
+bool AIBinder_associateClass(AIBinder* binder, const AIBinder_Class* clazz);
+void AIBinder_incStrong(AIBinder* binder);
+void AIBinder_decStrong(AIBinder* binder);
+binder_status_t AIBinder_transact(AIBinder* binder, transaction_code_t code,
+ AParcel** in, AParcel** out,
+ binder_flags_t flags);
+binder_status_t AParcel_readByteArray(const AParcel* parcel, void* arrayData,
+ AParcel_byteArrayAllocator allocator);
+void AParcel_delete(AParcel* parcel);
+int32_t AParcel_getDataSize(const AParcel* parcel);
+binder_status_t AParcel_writeInt32(AParcel* parcel, int32_t value);
+binder_status_t AParcel_writeInt64(AParcel* parcel, int64_t value);
+binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder);
+binder_status_t AParcel_writeString(AParcel* parcel, const char* string,
+ int32_t length);
+binder_status_t AParcel_readInt32(const AParcel* parcel, int32_t* value);
+binder_status_t AParcel_readInt64(const AParcel* parcel, int64_t* value);
+binder_status_t AParcel_readString(const AParcel* parcel, void* stringData,
+ AParcel_stringAllocator allocator);
+binder_status_t AParcel_readStrongBinder(const AParcel* parcel,
+ AIBinder** binder);
+binder_status_t AParcel_writeByteArray(AParcel* parcel, const int8_t* arrayData,
+ int32_t length);
+binder_status_t AIBinder_prepareTransaction(AIBinder* binder, AParcel** in);
+jobject AIBinder_toJavaBinder(JNIEnv* env, AIBinder* binder);
+
+} // namespace ndk_util
+
+} // namespace grpc_binder
+
+#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_NDK_BINDER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h
new file mode 100644
index 00000000000..f81ac17affa
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver.h
@@ -0,0 +1,71 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/status/statusor.h"
+
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+
+namespace grpc_binder {
+
+typedef int StreamIdentifier;
+
+class TransportStreamReceiver {
+ public:
+ virtual ~TransportStreamReceiver() = default;
+
+ using InitialMetadataCallbackType =
+ std::function<void(y_absl::StatusOr<Metadata>)>;
+ using MessageDataCallbackType =
+ std::function<void(y_absl::StatusOr<TString>)>;
+ using TrailingMetadataCallbackType =
+ std::function<void(y_absl::StatusOr<Metadata>, int)>;
+
+ // Only handles single time invocation. Callback object will be deleted.
+ // The callback should be valid until invocation or unregister.
+ virtual void RegisterRecvInitialMetadata(StreamIdentifier id,
+ InitialMetadataCallbackType cb) = 0;
+ virtual void RegisterRecvMessage(StreamIdentifier id,
+ MessageDataCallbackType cb) = 0;
+ virtual void RegisterRecvTrailingMetadata(
+ StreamIdentifier id, TrailingMetadataCallbackType cb) = 0;
+
+ // For the following functions, the second arguments are the transaction
+ // result received from the lower level. If it is None, that means there's
+ // something wrong when receiving the corresponding transaction. In such case,
+ // we should cancel the gRPC callback as well.
+ virtual void NotifyRecvInitialMetadata(
+ StreamIdentifier id, y_absl::StatusOr<Metadata> initial_metadata) = 0;
+ virtual void NotifyRecvMessage(StreamIdentifier id,
+ y_absl::StatusOr<TString> message) = 0;
+ virtual void NotifyRecvTrailingMetadata(
+ StreamIdentifier id, y_absl::StatusOr<Metadata> trailing_metadata,
+ int status) = 0;
+ // Remove all entries associated with stream number `id`.
+ virtual void CancelStream(StreamIdentifier id) = 0;
+
+ static const y_absl::string_view kGrpcBinderTransportCancelledGracefully;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
new file mode 100644
index 00000000000..864222897ad
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.cc
@@ -0,0 +1,255 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <functional>
+#include <util/generic/string.h>
+#include <utility>
+
+#include <grpc/support/log.h>
+
+namespace grpc_binder {
+
+const y_absl::string_view
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully =
+ "grpc-binder-transport: cancelled gracefully";
+
+void TransportStreamReceiverImpl::RegisterRecvInitialMetadata(
+ StreamIdentifier id, InitialMetadataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ y_absl::StatusOr<Metadata> initial_metadata{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(initial_metadata_cbs_.count(id) == 0);
+ auto iter = pending_initial_metadata_.find(id);
+ if (iter == pending_initial_metadata_.end()) {
+ if (trailing_metadata_recvd_.count(id)) {
+ cb(y_absl::CancelledError(""));
+ } else {
+ initial_metadata_cbs_[id] = std::move(cb);
+ }
+ cb = nullptr;
+ } else {
+ initial_metadata = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_initial_metadata_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(initial_metadata));
+ }
+}
+
+void TransportStreamReceiverImpl::RegisterRecvMessage(
+ StreamIdentifier id, MessageDataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ y_absl::StatusOr<TString> message{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(message_cbs_.count(id) == 0);
+ auto iter = pending_message_.find(id);
+ if (iter == pending_message_.end()) {
+ // If we'd already received trailing-metadata and there's no pending
+ // messages, cancel the callback.
+ if (trailing_metadata_recvd_.count(id)) {
+ cb(y_absl::CancelledError(
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully));
+ } else {
+ message_cbs_[id] = std::move(cb);
+ }
+ cb = nullptr;
+ } else {
+ // We'll still keep all pending messages received before the trailing
+ // metadata since they're issued before the end of stream, as promised by
+ // WireReader which keeps transactions commit in-order.
+ message = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_message_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(message));
+ }
+}
+
+void TransportStreamReceiverImpl::RegisterRecvTrailingMetadata(
+ StreamIdentifier id, TrailingMetadataCallbackType cb) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ std::pair<y_absl::StatusOr<Metadata>, int> trailing_metadata{};
+ {
+ grpc_core::MutexLock l(&m_);
+ GPR_ASSERT(trailing_metadata_cbs_.count(id) == 0);
+ auto iter = pending_trailing_metadata_.find(id);
+ if (iter == pending_trailing_metadata_.end()) {
+ trailing_metadata_cbs_[id] = std::move(cb);
+ cb = nullptr;
+ } else {
+ trailing_metadata = std::move(iter->second.front());
+ iter->second.pop();
+ if (iter->second.empty()) {
+ pending_trailing_metadata_.erase(iter);
+ }
+ }
+ }
+ if (cb != nullptr) {
+ cb(std::move(trailing_metadata.first), trailing_metadata.second);
+ }
+}
+
+void TransportStreamReceiverImpl::NotifyRecvInitialMetadata(
+ StreamIdentifier id, y_absl::StatusOr<Metadata> initial_metadata) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ if (!is_client_ && accept_stream_callback_ && initial_metadata.ok()) {
+ accept_stream_callback_();
+ }
+ InitialMetadataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = initial_metadata_cbs_.find(id);
+ if (iter != initial_metadata_cbs_.end()) {
+ cb = iter->second;
+ initial_metadata_cbs_.erase(iter);
+ } else {
+ pending_initial_metadata_[id].push(std::move(initial_metadata));
+ return;
+ }
+ }
+ cb(std::move(initial_metadata));
+}
+
+void TransportStreamReceiverImpl::NotifyRecvMessage(
+ StreamIdentifier id, y_absl::StatusOr<TString> message) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ MessageDataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = message_cbs_.find(id);
+ if (iter != message_cbs_.end()) {
+ cb = iter->second;
+ message_cbs_.erase(iter);
+ } else {
+ pending_message_[id].push(std::move(message));
+ return;
+ }
+ }
+ cb(std::move(message));
+}
+
+void TransportStreamReceiverImpl::NotifyRecvTrailingMetadata(
+ StreamIdentifier id, y_absl::StatusOr<Metadata> trailing_metadata,
+ int status) {
+ // Trailing metadata mark the end of the stream. Since TransportStreamReceiver
+ // assumes in-order commitments of transactions and that trailing metadata is
+ // parsed after message data, we can safely cancel all upcoming callbacks of
+ // recv_message.
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ OnRecvTrailingMetadata(id);
+ TrailingMetadataCallbackType cb;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = trailing_metadata_cbs_.find(id);
+ if (iter != trailing_metadata_cbs_.end()) {
+ cb = iter->second;
+ trailing_metadata_cbs_.erase(iter);
+ } else {
+ pending_trailing_metadata_[id].emplace(std::move(trailing_metadata),
+ status);
+ return;
+ }
+ }
+ cb(std::move(trailing_metadata), status);
+}
+
+void TransportStreamReceiverImpl::CancelInitialMetadataCallback(
+ StreamIdentifier id, y_absl::Status error) {
+ InitialMetadataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = initial_metadata_cbs_.find(id);
+ if (iter != initial_metadata_cbs_.end()) {
+ callback = std::move(iter->second);
+ initial_metadata_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error);
+ }
+}
+
+void TransportStreamReceiverImpl::CancelMessageCallback(StreamIdentifier id,
+ y_absl::Status error) {
+ MessageDataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = message_cbs_.find(id);
+ if (iter != message_cbs_.end()) {
+ callback = std::move(iter->second);
+ message_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error);
+ }
+}
+
+void TransportStreamReceiverImpl::CancelTrailingMetadataCallback(
+ StreamIdentifier id, y_absl::Status error) {
+ TrailingMetadataCallbackType callback = nullptr;
+ {
+ grpc_core::MutexLock l(&m_);
+ auto iter = trailing_metadata_cbs_.find(id);
+ if (iter != trailing_metadata_cbs_.end()) {
+ callback = std::move(iter->second);
+ trailing_metadata_cbs_.erase(iter);
+ }
+ }
+ if (callback != nullptr) {
+ std::move(callback)(error, 0);
+ }
+}
+
+void TransportStreamReceiverImpl::OnRecvTrailingMetadata(StreamIdentifier id) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ m_.Lock();
+ trailing_metadata_recvd_.insert(id);
+ m_.Unlock();
+ CancelInitialMetadataCallback(id, y_absl::CancelledError(""));
+ CancelMessageCallback(
+ id,
+ y_absl::CancelledError(
+ TransportStreamReceiver::kGrpcBinderTransportCancelledGracefully));
+}
+
+void TransportStreamReceiverImpl::CancelStream(StreamIdentifier id) {
+ gpr_log(GPR_INFO, "%s id = %d is_client = %d", __func__, id, is_client_);
+ CancelInitialMetadataCallback(id, y_absl::CancelledError("Stream cancelled"));
+ CancelMessageCallback(id, y_absl::CancelledError("Stream cancelled"));
+ CancelTrailingMetadataCallback(id, y_absl::CancelledError("Stream cancelled"));
+ grpc_core::MutexLock l(&m_);
+ trailing_metadata_recvd_.erase(id);
+ pending_initial_metadata_.erase(id);
+ pending_message_.erase(id);
+ pending_trailing_metadata_.erase(id);
+}
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
new file mode 100644
index 00000000000..fda2f0a20c9
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
@@ -0,0 +1,112 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <map>
+#include <queue>
+#include <set>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+// Routes the data received from transport to corresponding streams
+class TransportStreamReceiverImpl : public TransportStreamReceiver {
+ public:
+ explicit TransportStreamReceiverImpl(
+ bool is_client, std::function<void()> accept_stream_callback = nullptr)
+ : is_client_(is_client),
+ accept_stream_callback_(accept_stream_callback) {}
+ void RegisterRecvInitialMetadata(StreamIdentifier id,
+ InitialMetadataCallbackType cb) override;
+ void RegisterRecvMessage(StreamIdentifier id,
+ MessageDataCallbackType cb) override;
+ void RegisterRecvTrailingMetadata(StreamIdentifier id,
+ TrailingMetadataCallbackType cb) override;
+ void NotifyRecvInitialMetadata(
+ StreamIdentifier id, y_absl::StatusOr<Metadata> initial_metadata) override;
+ void NotifyRecvMessage(StreamIdentifier id,
+ y_absl::StatusOr<TString> message) override;
+ void NotifyRecvTrailingMetadata(StreamIdentifier id,
+ y_absl::StatusOr<Metadata> trailing_metadata,
+ int status) override;
+
+ void CancelStream(StreamIdentifier id) override;
+
+ private:
+ // Trailing metadata marks the end of one-side of the stream. Thus, after
+ // receiving trailing metadata from the other-end, we know that there will
+ // never be in-coming message data anymore, and all recv_message callbacks
+ // (as well as recv_initial_metadata callback, if there's any) registered will
+ // never be satisfied. This function cancels all such callbacks gracefully
+ // (with GRPC_ERROR_NONE) to avoid being blocked waiting for them.
+ void OnRecvTrailingMetadata(StreamIdentifier id);
+
+ void CancelInitialMetadataCallback(StreamIdentifier id, y_absl::Status error);
+ void CancelMessageCallback(StreamIdentifier id, y_absl::Status error);
+ void CancelTrailingMetadataCallback(StreamIdentifier id, y_absl::Status error);
+
+ std::map<StreamIdentifier, InitialMetadataCallbackType> initial_metadata_cbs_;
+ std::map<StreamIdentifier, MessageDataCallbackType> message_cbs_;
+ std::map<StreamIdentifier, TrailingMetadataCallbackType>
+ trailing_metadata_cbs_;
+ // TODO(waynetu): Better thread safety design. For example, use separate
+ // mutexes for different type of messages.
+ grpc_core::Mutex m_;
+ // TODO(waynetu): gRPC surface layer will not wait for the current message to
+ // be delivered before sending the next message. The following implementation
+ // is still buggy with the current implementation of wire writer if
+ // transaction issued first completes after the one issued later does. This is
+ // because we just take the first element out of the queue and assume it's the
+ // one issued first without further checking, which results in callbacks being
+ // invoked with incorrect data.
+ //
+ // This should be fixed in the wire writer level and make sure out-of-order
+ // messages will be re-ordered by it. In such case, the queueing approach will
+ // work fine. Refer to the TODO in WireWriterImpl::ProcessTransaction() at
+ // wire_reader_impl.cc for detecting and resolving out-of-order transactions.
+ //
+ // TODO(waynetu): Use y_absl::flat_hash_map.
+ std::map<StreamIdentifier, std::queue<y_absl::StatusOr<Metadata>>>
+ pending_initial_metadata_ Y_ABSL_GUARDED_BY(m_);
+ std::map<StreamIdentifier, std::queue<y_absl::StatusOr<TString>>>
+ pending_message_ Y_ABSL_GUARDED_BY(m_);
+ std::map<StreamIdentifier,
+ std::queue<std::pair<y_absl::StatusOr<Metadata>, int>>>
+ pending_trailing_metadata_ Y_ABSL_GUARDED_BY(m_);
+ // Record whether or not the recv_message callbacks of a given stream is
+ // cancelled. Although we explicitly cancel the registered recv_message() in
+ // CancelRecvMessageCallbacksDueToTrailingMetadata(), there are chances that
+ // the registration comes "after" we receive trailing metadata. Therefore,
+ // when RegisterRecvMessage() gets called, we should check whether
+ // recv_message_cancelled_ contains the corresponding stream ID, and if so,
+ // directly cancel the callback gracefully without pending it.
+ std::set<StreamIdentifier> trailing_metadata_recvd_ Y_ABSL_GUARDED_BY(m_);
+
+ bool is_client_;
+ // Called when receiving initial metadata to inform the server about a new
+ // stream.
+ std::function<void()> accept_stream_callback_;
+};
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_UTILS_TRANSPORT_STREAM_RECEIVER_IMPL_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder.h
new file mode 100644
index 00000000000..0f7f75af86a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder.h
@@ -0,0 +1,105 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+#include <functional>
+#include <memory>
+#include <util/generic/string.h>
+
+#include "y_absl/status/status.h"
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder_constants.h"
+#include "src/core/lib/gprpp/orphanable.h"
+
+namespace grpc_binder {
+
+class HasRawBinder {
+ public:
+ virtual ~HasRawBinder() = default;
+ virtual void* GetRawBinder() = 0;
+};
+
+class Binder;
+
+// TODO(waynetu): We might need other methods as well.
+// TODO(waynetu): Find a better way to express the returned status than
+// binder_status_t.
+class WritableParcel {
+ public:
+ virtual ~WritableParcel() = default;
+ virtual int32_t GetDataSize() const = 0;
+ virtual y_absl::Status WriteInt32(int32_t data) = 0;
+ virtual y_absl::Status WriteInt64(int64_t data) = 0;
+ virtual y_absl::Status WriteBinder(HasRawBinder* binder) = 0;
+ virtual y_absl::Status WriteString(y_absl::string_view s) = 0;
+ virtual y_absl::Status WriteByteArray(const int8_t* buffer, int32_t length) = 0;
+
+ y_absl::Status WriteByteArrayWithLength(y_absl::string_view buffer) {
+ y_absl::Status status = WriteInt32(buffer.length());
+ if (!status.ok()) return status;
+ if (buffer.empty()) return y_absl::OkStatus();
+ return WriteByteArray(reinterpret_cast<const int8_t*>(buffer.data()),
+ buffer.length());
+ }
+};
+
+// TODO(waynetu): We might need other methods as well.
+// TODO(waynetu): Find a better way to express the returned status than
+// binder_status_t.
+class ReadableParcel {
+ public:
+ virtual ~ReadableParcel() = default;
+ virtual int32_t GetDataSize() const = 0;
+ virtual y_absl::Status ReadInt32(int32_t* data) = 0;
+ virtual y_absl::Status ReadInt64(int64_t* data) = 0;
+ virtual y_absl::Status ReadBinder(std::unique_ptr<Binder>* data) = 0;
+ virtual y_absl::Status ReadByteArray(TString* data) = 0;
+ virtual y_absl::Status ReadString(TString* str) = 0;
+};
+
+class TransactionReceiver : public HasRawBinder {
+ public:
+ using OnTransactCb =
+ std::function<y_absl::Status(transaction_code_t, ReadableParcel*, int uid)>;
+
+ ~TransactionReceiver() override = default;
+};
+
+class WireReader;
+
+class Binder : public HasRawBinder {
+ public:
+ ~Binder() override = default;
+
+ virtual void Initialize() = 0;
+ virtual y_absl::Status PrepareTransaction() = 0;
+ virtual y_absl::Status Transact(BinderTransportTxCode tx_code) = 0;
+
+ virtual WritableParcel* GetWritableParcel() const = 0;
+
+ // TODO(waynetu): Can we decouple the receiver from the binder?
+ virtual std::unique_ptr<TransactionReceiver> ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc
new file mode 100644
index 00000000000..0c22d34276c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.cc
@@ -0,0 +1,310 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#include <map>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/strings/str_cat.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/wire_format/binder_android.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+namespace {
+
+struct BinderUserData {
+ explicit BinderUserData(grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb* callback)
+ : wire_reader_ref(wire_reader_ref), callback(callback) {}
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref;
+ TransactionReceiver::OnTransactCb* callback;
+};
+
+struct OnCreateArgs {
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref;
+ TransactionReceiver::OnTransactCb* callback;
+};
+
+void* f_onCreate_userdata(void* data) {
+ auto* args = static_cast<OnCreateArgs*>(data);
+ return new BinderUserData(args->wire_reader_ref, args->callback);
+}
+
+void f_onDestroy_delete(void* data) {
+ auto* user_data = static_cast<BinderUserData*>(data);
+ delete user_data;
+}
+
+void* f_onCreate_noop(void* /*args*/) { return nullptr; }
+void f_onDestroy_noop(void* /*userData*/) {}
+
+// TODO(mingcl): Consider if thread safety is a requirement here
+ndk_util::binder_status_t f_onTransact(ndk_util::AIBinder* binder,
+ transaction_code_t code,
+ const ndk_util::AParcel* in,
+ ndk_util::AParcel* /*out*/) {
+ gpr_log(GPR_INFO, __func__);
+ gpr_log(GPR_INFO, "tx code = %u", code);
+
+ auto* user_data =
+ static_cast<BinderUserData*>(ndk_util::AIBinder_getUserData(binder));
+ TransactionReceiver::OnTransactCb* callback = user_data->callback;
+ // Wrap the parcel in a ReadableParcel.
+ std::unique_ptr<ReadableParcel> output =
+ y_absl::make_unique<ReadableParcelAndroid>(in);
+ // The lock should be released "after" the callback finishes.
+ y_absl::Status status =
+ (*callback)(code, output.get(), ndk_util::AIBinder_getCallingUid());
+ if (status.ok()) {
+ return ndk_util::STATUS_OK;
+ } else {
+ gpr_log(GPR_ERROR, "Callback failed: %s", status.ToString().c_str());
+ return ndk_util::STATUS_UNKNOWN_ERROR;
+ }
+}
+
+// StdStringAllocator, ReadString, StdVectorAllocator, and ReadVector's
+// implementations are copied from android/binder_parcel_utils.h
+// We cannot include the header because it does not compile in C++11
+
+bool StdStringAllocator(void* stringData, int32_t length, char** buffer) {
+ if (length <= 0) return false;
+
+ TString* str = static_cast<TString*>(stringData);
+ str->resize(static_cast<size_t>(length) - 1);
+ *buffer = &(*str)[0];
+ return true;
+}
+
+ndk_util::binder_status_t AParcelReadString(const ndk_util::AParcel* parcel,
+ TString* str) {
+ void* stringData = static_cast<void*>(str);
+ return ndk_util::AParcel_readString(parcel, stringData, StdStringAllocator);
+}
+
+template <typename T>
+bool StdVectorAllocator(void* vectorData, int32_t length, T** outBuffer) {
+ if (length < 0) return false;
+
+ std::vector<T>* vec = static_cast<std::vector<T>*>(vectorData);
+ if (static_cast<size_t>(length) > vec->max_size()) return false;
+
+ vec->resize(static_cast<size_t>(length));
+ *outBuffer = vec->data();
+ return true;
+}
+
+ndk_util::binder_status_t AParcelReadVector(const ndk_util::AParcel* parcel,
+ std::vector<uint8_t>* vec) {
+ void* vectorData = static_cast<void*>(vec);
+ return ndk_util::AParcel_readByteArray(parcel, vectorData,
+ StdVectorAllocator<int8_t>);
+}
+
+} // namespace
+
+ndk_util::SpAIBinder FromJavaBinder(JNIEnv* jni_env, jobject binder) {
+ return ndk_util::SpAIBinder(
+ ndk_util::AIBinder_fromJavaBinder(jni_env, binder));
+}
+
+TransactionReceiverAndroid::TransactionReceiverAndroid(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ OnTransactCb transact_cb)
+ : transact_cb_(transact_cb) {
+ // TODO(mingcl): For now interface descriptor is always empty, figure out if
+ // we want it to be something more meaningful (we can probably manually change
+ // interface descriptor by modifying Java code's reply to
+ // os.IBinder.INTERFACE_TRANSACTION)
+ ndk_util::AIBinder_Class* aibinder_class = ndk_util::AIBinder_Class_define(
+ /*interfaceDescriptor=*/"", f_onCreate_userdata, f_onDestroy_delete,
+ f_onTransact);
+
+ ndk_util::AIBinder_Class_disableInterfaceTokenHeader(aibinder_class);
+
+ // Pass the on-transact callback to the on-create function of the binder. The
+ // on-create function equips the callback with a mutex and gives it to the
+ // user data stored in the binder which can be retrieved later.
+ // Also Ref() (called implicitly by the copy constructor of RefCountedPtr) the
+ // wire reader so that it would not be destructed during the callback
+ // invocation.
+ OnCreateArgs args;
+ args.wire_reader_ref = wire_reader_ref;
+ args.callback = &transact_cb_;
+ binder_ = ndk_util::AIBinder_new(aibinder_class, &args);
+ GPR_ASSERT(binder_);
+ gpr_log(GPR_INFO, "ndk_util::AIBinder_associateClass = %d",
+ static_cast<int>(
+ ndk_util::AIBinder_associateClass(binder_, aibinder_class)));
+}
+
+TransactionReceiverAndroid::~TransactionReceiverAndroid() {
+ // Release the binder.
+ ndk_util::AIBinder_decStrong(binder_);
+}
+
+namespace {
+
+ndk_util::binder_status_t f_onTransact_noop(ndk_util::AIBinder* /*binder*/,
+ transaction_code_t /*code*/,
+ const ndk_util::AParcel* /*in*/,
+ ndk_util::AParcel* /*out*/) {
+ return {};
+}
+
+void AssociateWithNoopClass(ndk_util::AIBinder* binder) {
+ // Need to associate class before using it
+ ndk_util::AIBinder_Class* aibinder_class = ndk_util::AIBinder_Class_define(
+ "", f_onCreate_noop, f_onDestroy_noop, f_onTransact_noop);
+
+ ndk_util::AIBinder_Class_disableInterfaceTokenHeader(aibinder_class);
+
+ gpr_log(GPR_INFO, "ndk_util::AIBinder_associateClass = %d",
+ static_cast<int>(
+ ndk_util::AIBinder_associateClass(binder, aibinder_class)));
+}
+
+} // namespace
+
+void BinderAndroid::Initialize() {
+ ndk_util::AIBinder* binder = binder_.get();
+ AssociateWithNoopClass(binder);
+}
+
+y_absl::Status BinderAndroid::PrepareTransaction() {
+ ndk_util::AIBinder* binder = binder_.get();
+ return ndk_util::AIBinder_prepareTransaction(
+ binder, &input_parcel_->parcel_) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError(
+ "ndk_util::AIBinder_prepareTransaction failed");
+}
+
+y_absl::Status BinderAndroid::Transact(BinderTransportTxCode tx_code) {
+ ndk_util::AIBinder* binder = binder_.get();
+ // We only do one-way transaction and thus the output parcel is never used.
+ ndk_util::AParcel* unused_output_parcel;
+ y_absl::Status result =
+ (ndk_util::AIBinder_transact(
+ binder, static_cast<transaction_code_t>(tx_code),
+ &input_parcel_->parcel_, &unused_output_parcel,
+ ndk_util::FLAG_ONEWAY) == ndk_util::STATUS_OK)
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("ndk_util::AIBinder_transact failed");
+ ndk_util::AParcel_delete(unused_output_parcel);
+ return result;
+}
+
+std::unique_ptr<TransactionReceiver> BinderAndroid::ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const {
+ return y_absl::make_unique<TransactionReceiverAndroid>(wire_reader_ref,
+ transact_cb);
+}
+
+int32_t WritableParcelAndroid::GetDataSize() const {
+ return ndk_util::AParcel_getDataSize(parcel_);
+}
+
+y_absl::Status WritableParcelAndroid::WriteInt32(int32_t data) {
+ return ndk_util::AParcel_writeInt32(parcel_, data) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_writeInt32 failed");
+}
+
+y_absl::Status WritableParcelAndroid::WriteInt64(int64_t data) {
+ return ndk_util::AParcel_writeInt64(parcel_, data) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_writeInt64 failed");
+}
+
+y_absl::Status WritableParcelAndroid::WriteBinder(HasRawBinder* binder) {
+ return ndk_util::AParcel_writeStrongBinder(
+ parcel_, reinterpret_cast<ndk_util::AIBinder*>(
+ binder->GetRawBinder())) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_writeStrongBinder failed");
+}
+
+y_absl::Status WritableParcelAndroid::WriteString(y_absl::string_view s) {
+ return ndk_util::AParcel_writeString(parcel_, s.data(), s.length()) ==
+ ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_writeString failed");
+}
+
+y_absl::Status WritableParcelAndroid::WriteByteArray(const int8_t* buffer,
+ int32_t length) {
+ return ndk_util::AParcel_writeByteArray(parcel_, buffer, length) ==
+ ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_writeByteArray failed");
+}
+
+int32_t ReadableParcelAndroid::GetDataSize() const {
+ return ndk_util::AParcel_getDataSize(parcel_);
+}
+
+y_absl::Status ReadableParcelAndroid::ReadInt32(int32_t* data) {
+ return ndk_util::AParcel_readInt32(parcel_, data) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_readInt32 failed");
+}
+
+y_absl::Status ReadableParcelAndroid::ReadInt64(int64_t* data) {
+ return ndk_util::AParcel_readInt64(parcel_, data) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_readInt64 failed");
+}
+
+y_absl::Status ReadableParcelAndroid::ReadBinder(std::unique_ptr<Binder>* data) {
+ ndk_util::AIBinder* binder;
+ if (AParcel_readStrongBinder(parcel_, &binder) != ndk_util::STATUS_OK) {
+ *data = nullptr;
+ return y_absl::InternalError("AParcel_readStrongBinder failed");
+ }
+ *data = y_absl::make_unique<BinderAndroid>(ndk_util::SpAIBinder(binder));
+ return y_absl::OkStatus();
+}
+
+y_absl::Status ReadableParcelAndroid::ReadByteArray(TString* data) {
+ std::vector<uint8_t> vec;
+ if (AParcelReadVector(parcel_, &vec) == ndk_util::STATUS_OK) {
+ data->resize(vec.size());
+ if (!vec.empty()) {
+ memcpy(&((*data)[0]), vec.data(), vec.size());
+ }
+ return y_absl::OkStatus();
+ }
+ return y_absl::InternalError("AParcel_readByteArray failed");
+}
+
+y_absl::Status ReadableParcelAndroid::ReadString(TString* str) {
+ return AParcelReadString(parcel_, str) == ndk_util::STATUS_OK
+ ? y_absl::OkStatus()
+ : y_absl::InternalError("AParcel_readString failed");
+}
+
+} // namespace grpc_binder
+
+#endif // GPR_SUPPORT_BINDER_TRANSPORT
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.h
new file mode 100644
index 00000000000..21e453ea9b6
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_android.h
@@ -0,0 +1,122 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+
+#error #include <jni.h>
+
+#include <memory>
+
+#include "y_absl/memory/memory.h"
+
+#error #include "src/core/ext/transport/binder/utils/binder_auto_utils.h"
+#include "src/core/ext/transport/binder/utils/ndk_binder.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+
+namespace grpc_binder {
+
+ndk_util::SpAIBinder FromJavaBinder(JNIEnv* jni_env, jobject binder);
+
+class BinderAndroid;
+
+class WritableParcelAndroid final : public WritableParcel {
+ public:
+ WritableParcelAndroid() = default;
+ explicit WritableParcelAndroid(ndk_util::AParcel* parcel) : parcel_(parcel) {}
+ ~WritableParcelAndroid() override = default;
+
+ int32_t GetDataSize() const override;
+ y_absl::Status WriteInt32(int32_t data) override;
+ y_absl::Status WriteInt64(int64_t data) override;
+ y_absl::Status WriteBinder(HasRawBinder* binder) override;
+ y_absl::Status WriteString(y_absl::string_view s) override;
+ y_absl::Status WriteByteArray(const int8_t* buffer, int32_t length) override;
+
+ private:
+ ndk_util::AParcel* parcel_ = nullptr;
+
+ friend class BinderAndroid;
+};
+
+class ReadableParcelAndroid final : public ReadableParcel {
+ public:
+ ReadableParcelAndroid() = default;
+ // TODO(waynetu): Get rid of the const_cast.
+ explicit ReadableParcelAndroid(const ndk_util::AParcel* parcel)
+ : parcel_(parcel) {}
+ ~ReadableParcelAndroid() override = default;
+
+ int32_t GetDataSize() const override;
+ y_absl::Status ReadInt32(int32_t* data) override;
+ y_absl::Status ReadInt64(int64_t* data) override;
+ y_absl::Status ReadBinder(std::unique_ptr<Binder>* data) override;
+ y_absl::Status ReadByteArray(TString* data) override;
+ y_absl::Status ReadString(TString* str) override;
+
+ private:
+ const ndk_util::AParcel* parcel_ = nullptr;
+
+ friend class BinderAndroid;
+};
+
+class BinderAndroid final : public Binder {
+ public:
+ explicit BinderAndroid(ndk_util::SpAIBinder binder)
+ : binder_(binder),
+ input_parcel_(y_absl::make_unique<WritableParcelAndroid>()) {}
+ ~BinderAndroid() override = default;
+
+ void* GetRawBinder() override { return binder_.get(); }
+
+ void Initialize() override;
+ y_absl::Status PrepareTransaction() override;
+ y_absl::Status Transact(BinderTransportTxCode tx_code) override;
+
+ WritableParcel* GetWritableParcel() const override {
+ return input_parcel_.get();
+ }
+
+ std::unique_ptr<TransactionReceiver> ConstructTxReceiver(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ TransactionReceiver::OnTransactCb transact_cb) const override;
+
+ private:
+ ndk_util::SpAIBinder binder_;
+ std::unique_ptr<WritableParcelAndroid> input_parcel_;
+};
+
+class TransactionReceiverAndroid final : public TransactionReceiver {
+ public:
+ TransactionReceiverAndroid(
+ grpc_core::RefCountedPtr<WireReader> wire_reader_ref,
+ OnTransactCb transaction_cb);
+ ~TransactionReceiverAndroid() override;
+ void* GetRawBinder() override { return binder_; }
+
+ private:
+ ndk_util::AIBinder* binder_;
+ OnTransactCb transact_cb_;
+};
+
+} // namespace grpc_binder
+
+#endif /*GPR_SUPPORT_BINDER_TRANSPORT*/
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_ANDROID_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc
new file mode 100644
index 00000000000..42048bdb0ae
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.cc
@@ -0,0 +1,29 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/wire_format/binder_constants.h"
+
+const int FIRST_CALL_TRANSACTION = 0x00000001;
+const int LAST_CALL_TRANSACTION = 0x00FFFFFF;
+
+namespace grpc_binder {
+
+const int kFirstCallId = FIRST_CALL_TRANSACTION + 1000;
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h
new file mode 100644
index 00000000000..c3a7402a95c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/binder_constants.h
@@ -0,0 +1,43 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+
+#include "y_absl/base/attributes.h"
+
+using transaction_code_t = uint32_t;
+
+Y_ABSL_CONST_INIT extern const int FIRST_CALL_TRANSACTION;
+Y_ABSL_CONST_INIT extern const int LAST_CALL_TRANSACTION;
+
+namespace grpc_binder {
+
+enum class BinderTransportTxCode {
+ SETUP_TRANSPORT = 1,
+ SHUTDOWN_TRANSPORT = 2,
+ ACKNOWLEDGE_BYTES = 3,
+ PING = 4,
+ PING_RESPONSE = 5,
+};
+
+Y_ABSL_CONST_INIT extern const int kFirstCallId;
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_BINDER_CONSTANTS_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.cc
new file mode 100644
index 00000000000..939b5574c0f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.cc
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#ifndef GRPC_NO_BINDER
+
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+
+namespace grpc_binder {
+
+const int kFlagPrefix = 0x1;
+const int kFlagMessageData = 0x2;
+const int kFlagSuffix = 0x4;
+const int kFlagOutOfBandClose = 0x8;
+const int kFlagExpectSingleMessage = 0x10;
+const int kFlagStatusDescription = 0x20;
+const int kFlagMessageDataIsParcelable = 0x40;
+const int kFlagMessageDataIsPartial = 0x80;
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.h
new file mode 100644
index 00000000000..dd8b5521789
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/transaction.h
@@ -0,0 +1,102 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_binder {
+
+Y_ABSL_CONST_INIT extern const int kFlagPrefix;
+Y_ABSL_CONST_INIT extern const int kFlagMessageData;
+Y_ABSL_CONST_INIT extern const int kFlagSuffix;
+Y_ABSL_CONST_INIT extern const int kFlagOutOfBandClose;
+Y_ABSL_CONST_INIT extern const int kFlagExpectSingleMessage;
+Y_ABSL_CONST_INIT extern const int kFlagStatusDescription;
+Y_ABSL_CONST_INIT extern const int kFlagMessageDataIsParcelable;
+Y_ABSL_CONST_INIT extern const int kFlagMessageDataIsPartial;
+
+using Metadata = std::vector<std::pair<TString, TString>>;
+
+class Transaction {
+ public:
+ Transaction(int tx_code, bool is_client)
+ : tx_code_(tx_code), is_client_(is_client) {}
+ // TODO(mingcl): Consider using string_view
+ void SetPrefix(Metadata prefix_metadata) {
+ prefix_metadata_ = prefix_metadata;
+ GPR_ASSERT((flags_ & kFlagPrefix) == 0);
+ flags_ |= kFlagPrefix;
+ }
+ void SetMethodRef(TString method_ref) {
+ GPR_ASSERT(is_client_);
+ method_ref_ = method_ref;
+ }
+ void SetData(TString message_data) {
+ message_data_ = message_data;
+ GPR_ASSERT((flags_ & kFlagMessageData) == 0);
+ flags_ |= kFlagMessageData;
+ }
+ void SetSuffix(Metadata suffix_metadata) {
+ if (is_client_) GPR_ASSERT(suffix_metadata.empty());
+ suffix_metadata_ = suffix_metadata;
+ GPR_ASSERT((flags_ & kFlagSuffix) == 0);
+ flags_ |= kFlagSuffix;
+ }
+ void SetStatusDescription(TString status_desc) {
+ GPR_ASSERT(!is_client_);
+ GPR_ASSERT((flags_ & kFlagStatusDescription) == 0);
+ status_desc_ = status_desc;
+ }
+ void SetStatus(int status) {
+ GPR_ASSERT(!is_client_);
+ GPR_ASSERT((flags_ >> 16) == 0);
+ GPR_ASSERT(status < (1 << 16));
+ flags_ |= (status << 16);
+ }
+
+ bool IsClient() const { return is_client_; }
+ bool IsServer() const { return !is_client_; }
+ int GetTxCode() const { return tx_code_; }
+ int GetFlags() const { return flags_; }
+
+ y_absl::string_view GetMethodRef() const { return method_ref_; }
+ const Metadata& GetPrefixMetadata() const { return prefix_metadata_; }
+ const Metadata& GetSuffixMetadata() const { return suffix_metadata_; }
+ y_absl::string_view GetMessageData() const { return message_data_; }
+ y_absl::string_view GetStatusDesc() const { return status_desc_; }
+
+ private:
+ int tx_code_;
+ bool is_client_;
+ Metadata prefix_metadata_;
+ Metadata suffix_metadata_;
+ TString method_ref_;
+ TString message_data_;
+ TString status_desc_;
+
+ int flags_ = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_TRANSACTION_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h
new file mode 100644
index 00000000000..8a5068eb693
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader.h
@@ -0,0 +1,38 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+#include "src/core/lib/gprpp/orphanable.h"
+
+namespace grpc_binder {
+
+class WireReader : public grpc_core::InternallyRefCounted<WireReader> {
+ public:
+ ~WireReader() override = default;
+ virtual std::shared_ptr<WireWriter> SetupTransport(
+ std::unique_ptr<Binder> endpoint_binder) = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
new file mode 100644
index 00000000000..7a0ddfac961
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.cc
@@ -0,0 +1,386 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/wire_format/wire_reader_impl.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <functional>
+#include <limits>
+#include <util/generic/string.h>
+#include <utility>
+#include <vector>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/status/statusor.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+
+#include <util/string/cast.h>
+
+#define RETURN_IF_ERROR(expr) \
+ do { \
+ const y_absl::Status status = (expr); \
+ if (!status.ok()) return status; \
+ } while (0)
+
+namespace grpc_binder {
+namespace {
+
+y_absl::StatusOr<Metadata> parse_metadata(ReadableParcel* reader) {
+ int num_header;
+ RETURN_IF_ERROR(reader->ReadInt32(&num_header));
+ gpr_log(GPR_INFO, "num_header = %d", num_header);
+ if (num_header < 0) {
+ return y_absl::InvalidArgumentError("num_header cannot be negative");
+ }
+ std::vector<std::pair<TString, TString>> ret;
+ for (int i = 0; i < num_header; i++) {
+ int count;
+ RETURN_IF_ERROR(reader->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ TString key{};
+ if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&key));
+ gpr_log(GPR_INFO, "key = %s", key.c_str());
+ RETURN_IF_ERROR(reader->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ TString value{};
+ if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&value));
+ gpr_log(GPR_INFO, "value = %s", value.c_str());
+ ret.emplace_back(key, value);
+ }
+ return ret;
+}
+
+} // namespace
+
+WireReaderImpl::WireReaderImpl(
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver,
+ bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
+ std::function<void()> on_destruct_callback)
+ : transport_stream_receiver_(std::move(transport_stream_receiver)),
+ is_client_(is_client),
+ security_policy_(security_policy),
+ on_destruct_callback_(on_destruct_callback) {}
+
+WireReaderImpl::~WireReaderImpl() {
+ if (on_destruct_callback_) {
+ on_destruct_callback_();
+ }
+}
+
+std::shared_ptr<WireWriter> WireReaderImpl::SetupTransport(
+ std::unique_ptr<Binder> binder) {
+ gpr_log(GPR_INFO, "Setting up transport");
+ if (!is_client_) {
+ SendSetupTransport(binder.get());
+ {
+ grpc_core::MutexLock lock(&mu_);
+ connected_ = true;
+ wire_writer_ = std::make_shared<WireWriterImpl>(std::move(binder));
+ }
+ return wire_writer_;
+ } else {
+ SendSetupTransport(binder.get());
+ auto other_end_binder = RecvSetupTransport();
+ {
+ grpc_core::MutexLock lock(&mu_);
+ connected_ = true;
+ wire_writer_ =
+ std::make_shared<WireWriterImpl>(std::move(other_end_binder));
+ }
+ return wire_writer_;
+ }
+}
+
+void WireReaderImpl::SendSetupTransport(Binder* binder) {
+ binder->Initialize();
+ gpr_log(GPR_INFO, "prepare transaction = %d",
+ binder->PrepareTransaction().ok());
+ WritableParcel* writable_parcel = binder->GetWritableParcel();
+ int32_t version = 77;
+ gpr_log(GPR_INFO, "write int32 = %d",
+ writable_parcel->WriteInt32(version).ok());
+ // The lifetime of the transaction receiver is the same as the wire writer's.
+ // The transaction receiver is responsible for not calling the on-transact
+ // callback when it's dead.
+ // Give TransactionReceiver a Ref() since WireReader cannot be destructed
+ // during callback execution. TransactionReceiver should make sure that the
+ // callback owns a Ref() when it's being invoked.
+ tx_receiver_ = binder->ConstructTxReceiver(
+ /*wire_reader_ref=*/Ref(),
+ [this](transaction_code_t code, ReadableParcel* readable_parcel,
+ int uid) {
+ return this->ProcessTransaction(code, readable_parcel, uid);
+ });
+
+ gpr_log(GPR_INFO, "tx_receiver = %p", tx_receiver_->GetRawBinder());
+ gpr_log(GPR_INFO, "AParcel_writeStrongBinder = %d",
+ writable_parcel->WriteBinder(tx_receiver_.get()).ok());
+ gpr_log(GPR_INFO, "AIBinder_transact = %d",
+ binder->Transact(BinderTransportTxCode::SETUP_TRANSPORT).ok());
+}
+
+std::unique_ptr<Binder> WireReaderImpl::RecvSetupTransport() {
+ // TODO(b/191941760): avoid blocking, handle wire_writer_noti lifetime
+ // better
+ gpr_log(GPR_INFO, "start waiting for noti");
+ connection_noti_.WaitForNotification();
+ gpr_log(GPR_INFO, "end waiting for noti");
+ return std::move(other_end_binder_);
+}
+
+y_absl::Status WireReaderImpl::ProcessTransaction(transaction_code_t code,
+ ReadableParcel* parcel,
+ int uid) {
+ gpr_log(GPR_INFO, __func__);
+ gpr_log(GPR_INFO, "tx code = %u", code);
+ if (code >= static_cast<unsigned>(kFirstCallId)) {
+ gpr_log(GPR_INFO, "This is probably a Streaming Tx");
+ return ProcessStreamingTransaction(code, parcel);
+ }
+
+ if (!(code >= static_cast<transaction_code_t>(
+ BinderTransportTxCode::SETUP_TRANSPORT) &&
+ code <= static_cast<transaction_code_t>(
+ BinderTransportTxCode::PING_RESPONSE))) {
+ gpr_log(GPR_INFO,
+ "Received unknown control message. Shutdown transport gracefully.");
+ // TODO(waynetu): Shutdown transport gracefully.
+ return y_absl::OkStatus();
+ }
+
+ grpc_core::MutexLock lock(&mu_);
+
+ if (BinderTransportTxCode(code) != BinderTransportTxCode::SETUP_TRANSPORT &&
+ !connected_) {
+ return y_absl::InvalidArgumentError("Transports not connected yet");
+ }
+
+ // TODO(mingcl): See if we want to check the security policy for every RPC
+ // call or just during transport setup.
+
+ switch (BinderTransportTxCode(code)) {
+ case BinderTransportTxCode::SETUP_TRANSPORT: {
+ if (recvd_setup_transport_) {
+ return y_absl::InvalidArgumentError(
+ "Already received a SETUP_TRANSPORT request");
+ }
+ recvd_setup_transport_ = true;
+
+ gpr_log(GPR_ERROR, "calling uid = %d", uid);
+ if (!security_policy_->IsAuthorized(uid)) {
+ return y_absl::PermissionDeniedError(
+ "UID " + ToString(uid) +
+ " is not allowed to connect to this "
+ "transport according to security policy.");
+ }
+
+ int version;
+ RETURN_IF_ERROR(parcel->ReadInt32(&version));
+ gpr_log(GPR_INFO, "version = %d", version);
+ std::unique_ptr<Binder> binder{};
+ RETURN_IF_ERROR(parcel->ReadBinder(&binder));
+ if (!binder) {
+ return y_absl::InternalError("Read NULL binder from the parcel");
+ }
+ binder->Initialize();
+ other_end_binder_ = std::move(binder);
+ connection_noti_.Notify();
+ break;
+ }
+ case BinderTransportTxCode::SHUTDOWN_TRANSPORT: {
+ gpr_log(GPR_ERROR,
+ "Received SHUTDOWN_TRANSPORT request but not implemented yet.");
+ return y_absl::UnimplementedError("SHUTDOWN_TRANSPORT");
+ }
+ case BinderTransportTxCode::ACKNOWLEDGE_BYTES: {
+ int64_t num_bytes = -1;
+ RETURN_IF_ERROR(parcel->ReadInt64(&num_bytes));
+ gpr_log(GPR_INFO, "received acknowledge bytes = %lld",
+ static_cast<long long>(num_bytes));
+ wire_writer_->OnAckReceived(num_bytes);
+ break;
+ }
+ case BinderTransportTxCode::PING: {
+ if (is_client_) {
+ return y_absl::FailedPreconditionError("Receive PING request in client");
+ }
+ int ping_id = -1;
+ RETURN_IF_ERROR(parcel->ReadInt32(&ping_id));
+ gpr_log(GPR_INFO, "received ping id = %d", ping_id);
+ // TODO(waynetu): Ping back.
+ break;
+ }
+ case BinderTransportTxCode::PING_RESPONSE: {
+ int value = -1;
+ RETURN_IF_ERROR(parcel->ReadInt32(&value));
+ gpr_log(GPR_INFO, "received ping response = %d", value);
+ break;
+ }
+ }
+ return y_absl::OkStatus();
+}
+
+y_absl::Status WireReaderImpl::ProcessStreamingTransaction(
+ transaction_code_t code, ReadableParcel* parcel) {
+ grpc_core::MutexLock lock(&mu_);
+ if (!connected_) {
+ return y_absl::InvalidArgumentError("Transports not connected yet");
+ }
+
+ // Indicate which callbacks should be cancelled. It will be initialized as the
+ // flags the in-coming transaction carries, and when a particular callback is
+ // completed, the corresponding bit in cancellation_flag will be set to 0 so
+ // that we won't cancel it afterward.
+ int cancellation_flags = 0;
+ y_absl::Status status =
+ ProcessStreamingTransactionImpl(code, parcel, &cancellation_flags);
+ if (!status.ok()) {
+ gpr_log(GPR_ERROR, "Failed to process streaming transaction: %s",
+ status.ToString().c_str());
+ // Something went wrong when receiving transaction. Cancel failed requests.
+ if (cancellation_flags & kFlagPrefix) {
+ gpr_log(GPR_INFO, "cancelling initial metadata");
+ transport_stream_receiver_->NotifyRecvInitialMetadata(code, status);
+ }
+ if (cancellation_flags & kFlagMessageData) {
+ gpr_log(GPR_INFO, "cancelling message data");
+ transport_stream_receiver_->NotifyRecvMessage(code, status);
+ }
+ if (cancellation_flags & kFlagSuffix) {
+ gpr_log(GPR_INFO, "cancelling trailing metadata");
+ transport_stream_receiver_->NotifyRecvTrailingMetadata(code, status, 0);
+ }
+ }
+ if ((num_incoming_bytes_ - num_acknowledged_bytes_) >= kFlowControlAckBytes) {
+ GPR_ASSERT(wire_writer_);
+ y_absl::Status ack_status = wire_writer_->SendAck(num_incoming_bytes_);
+ if (status.ok()) {
+ status = ack_status;
+ }
+ num_acknowledged_bytes_ = num_incoming_bytes_;
+ }
+ return status;
+}
+
+y_absl::Status WireReaderImpl::ProcessStreamingTransactionImpl(
+ transaction_code_t code, ReadableParcel* parcel, int* cancellation_flags) {
+ GPR_ASSERT(cancellation_flags);
+ num_incoming_bytes_ += parcel->GetDataSize();
+
+ int flags;
+ RETURN_IF_ERROR(parcel->ReadInt32(&flags));
+ gpr_log(GPR_INFO, "flags = %d", flags);
+ *cancellation_flags = flags;
+
+ // Ignore in-coming transaction with flag = 0 to match with Java
+ // implementation.
+ // TODO(waynetu): Check with grpc-java team to see whether this is the
+ // intended behavior.
+ // TODO(waynetu): What should be returned here?
+ if (flags == 0) {
+ gpr_log(GPR_INFO, "[WARNING] Receive empty transaction. Ignored.");
+ return y_absl::OkStatus();
+ }
+
+ int status = flags >> 16;
+ gpr_log(GPR_INFO, "status = %d", status);
+ gpr_log(GPR_INFO, "FLAG_PREFIX = %d", (flags & kFlagPrefix));
+ gpr_log(GPR_INFO, "FLAG_MESSAGE_DATA = %d", (flags & kFlagMessageData));
+ gpr_log(GPR_INFO, "FLAG_SUFFIX = %d", (flags & kFlagSuffix));
+ int seq_num;
+ RETURN_IF_ERROR(parcel->ReadInt32(&seq_num));
+ // TODO(waynetu): For now we'll just assume that the transactions commit in
+ // the same order they're issued. The following assertion detects
+ // out-of-order or missing transactions. WireReaderImpl should be fixed if
+ // we indeed found such behavior.
+ int32_t& expectation = expected_seq_num_[code];
+ if (seq_num < 0 || seq_num != expectation) {
+ // Unexpected sequence number.
+ return y_absl::InternalError("Unexpected sequence number");
+ }
+ // TODO(waynetu): According to the protocol, "The sequence number will wrap
+ // around to 0 if more than 2^31 messages are sent." For now we'll just
+ // assert that it never reach such circumstances.
+ GPR_ASSERT(expectation < std::numeric_limits<int32_t>::max() &&
+ "Sequence number too large");
+ expectation++;
+ gpr_log(GPR_INFO, "sequence number = %d", seq_num);
+ if (flags & kFlagPrefix) {
+ TString method_ref;
+ if (!is_client_) {
+ RETURN_IF_ERROR(parcel->ReadString(&method_ref));
+ }
+ y_absl::StatusOr<Metadata> initial_metadata_or_error = parse_metadata(parcel);
+ if (!initial_metadata_or_error.ok()) {
+ return initial_metadata_or_error.status();
+ }
+ if (!is_client_) {
+ initial_metadata_or_error->emplace_back(":path",
+ TString("/") + method_ref);
+ }
+ transport_stream_receiver_->NotifyRecvInitialMetadata(
+ code, *initial_metadata_or_error);
+ *cancellation_flags &= ~kFlagPrefix;
+ }
+ if (flags & kFlagMessageData) {
+ int count;
+ RETURN_IF_ERROR(parcel->ReadInt32(&count));
+ gpr_log(GPR_INFO, "count = %d", count);
+ TString msg_data{};
+ if (count > 0) {
+ RETURN_IF_ERROR(parcel->ReadByteArray(&msg_data));
+ }
+ gpr_log(GPR_INFO, "msg_data = %s", msg_data.c_str());
+ message_buffer_[code] += msg_data;
+ if ((flags & kFlagMessageDataIsPartial) == 0) {
+ TString s = std::move(message_buffer_[code]);
+ message_buffer_.erase(code);
+ transport_stream_receiver_->NotifyRecvMessage(code, std::move(s));
+ }
+ *cancellation_flags &= ~kFlagMessageData;
+ }
+ if (flags & kFlagSuffix) {
+ if (flags & kFlagStatusDescription) {
+ // FLAG_STATUS_DESCRIPTION set
+ TString desc;
+ RETURN_IF_ERROR(parcel->ReadString(&desc));
+ gpr_log(GPR_INFO, "description = %s", desc.c_str());
+ }
+ Metadata trailing_metadata;
+ if (is_client_) {
+ y_absl::StatusOr<Metadata> trailing_metadata_or_error =
+ parse_metadata(parcel);
+ if (!trailing_metadata_or_error.ok()) {
+ return trailing_metadata_or_error.status();
+ }
+ trailing_metadata = *trailing_metadata_or_error;
+ }
+ transport_stream_receiver_->NotifyRecvTrailingMetadata(
+ code, std::move(trailing_metadata), status);
+ *cancellation_flags &= ~kFlagSuffix;
+ }
+ return y_absl::OkStatus();
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h
new file mode 100644
index 00000000000..973ae642617
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_reader_impl.h
@@ -0,0 +1,137 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+#include <utility>
+
+#include "y_absl/container/flat_hash_map.h"
+#include "y_absl/synchronization/notification.h"
+
+#include <grpcpp/security/binder_security_policy.h>
+
+#include "src/core/ext/transport/binder/utils/transport_stream_receiver.h"
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/wire_reader.h"
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+
+namespace grpc_binder {
+
+class WireReaderImpl : public WireReader {
+ public:
+ WireReaderImpl(
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver,
+ bool is_client,
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy>
+ security_policy,
+ std::function<void()> on_destruct_callback = nullptr);
+ ~WireReaderImpl() override;
+
+ void Orphan() override { Unref(); }
+
+ /// Setup the transport between endpoint binders.
+ ///
+ /// The client and the server both call SetupTransport() when constructing
+ /// transport.
+ ///
+ /// High-level overview of transaction setup:
+ /// 0. Client obtains an |endpoint_binder| from the server (in the Android
+ /// setting, this can be achieved by "binding" to the server APK).
+ /// 1. Client creates a binder |client_binder| and hook its on-transaction
+ /// callback to client's ProcessTransaction(). Client then sends
+ /// |client_binder| through |endpoint_binder| to server.
+ /// 2. Server receives |client_binder| via |endpoint_binder|.
+ /// 3. Server creates a binder |server_binder| and hook its on-transaction
+ /// callback to server's ProcessTransaction(). Server then sends
+ /// |server_binder| through |client_binder| back to the client.
+ /// 4. Client receives |server_binder| via |client_binder|'s on-transaction
+ /// callback.
+ ///
+ /// The parameter \p binder here means different things for client nad server.
+ /// For client, \p binder refers to |endpoint_binder|, and for server, \p
+ /// binder refers to |client_binder|. That is, for server-side transport
+ /// setup, we assume that the first half of SETUP_TRANSPORT (up to step 2) is
+ /// already done somewhere else (see test/end2end/binder_transport_test.cc for
+ /// how it's handled in the testing environment).
+ std::shared_ptr<WireWriter> SetupTransport(
+ std::unique_ptr<Binder> binder) override;
+
+ y_absl::Status ProcessTransaction(transaction_code_t code,
+ ReadableParcel* parcel, int uid);
+
+ /// Send SETUP_TRANSPORT request through \p binder.
+ ///
+ /// This is the one half (for client it's the first half, and for server it's
+ /// the second) of the SETUP_TRANSPORT negotiation process. First, a new
+ /// binder is created. We take its "receiving" part and construct the
+ /// transaction receiver with it, and sends the "sending" part along with the
+ /// SETUP_TRANSPORT message through \p binder.
+ void SendSetupTransport(Binder* binder);
+
+ /// Recv SETUP_TRANSPORT request.
+ ///
+ /// This is the other half of the SETUP_TRANSPORT process. We wait for
+ /// in-coming SETUP_TRANSPORT request with the "sending" part of a binder from
+ /// the other end. For client, the message is coming from the trasnaction
+ /// receiver we just constructed in SendSetupTransport(). For server, we
+ /// assume that this step is already completed.
+ // TODO(waynetu): In the testing environment, we still use this method (on
+ // another WireReader instance) for server-side transport setup, and thus it
+ // is marked as public. Try moving this method back to private, and hopefully
+ // we can also avoid moving |other_end_binder_| out in the implementation.
+ std::unique_ptr<Binder> RecvSetupTransport();
+
+ private:
+ y_absl::Status ProcessStreamingTransaction(transaction_code_t code,
+ ReadableParcel* parcel);
+ y_absl::Status ProcessStreamingTransactionImpl(transaction_code_t code,
+ ReadableParcel* parcel,
+ int* cancellation_flags)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ std::shared_ptr<TransportStreamReceiver> transport_stream_receiver_;
+ y_absl::Notification connection_noti_;
+ grpc_core::Mutex mu_;
+ bool connected_ Y_ABSL_GUARDED_BY(mu_) = false;
+ bool recvd_setup_transport_ Y_ABSL_GUARDED_BY(mu_) = false;
+ // NOTE: other_end_binder_ will be moved out when RecvSetupTransport() is
+ // called. Be cautious not to access it afterward.
+ std::unique_ptr<Binder> other_end_binder_;
+ y_absl::flat_hash_map<transaction_code_t, int32_t> expected_seq_num_
+ Y_ABSL_GUARDED_BY(mu_);
+ y_absl::flat_hash_map<transaction_code_t, TString> message_buffer_
+ Y_ABSL_GUARDED_BY(mu_);
+ std::unique_ptr<TransactionReceiver> tx_receiver_;
+ bool is_client_;
+ std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy_;
+ // When WireReaderImpl gets destructed, call on_destruct_callback_. This is
+ // mostly for decrementing the reference count of its transport.
+ std::function<void()> on_destruct_callback_;
+
+ // ACK every 16k bytes.
+ static constexpr int64_t kFlowControlAckBytes = 16 * 1024;
+ int64_t num_incoming_bytes_ Y_ABSL_GUARDED_BY(mu_) = 0;
+ int64_t num_acknowledged_bytes_ Y_ABSL_GUARDED_BY(mu_) = 0;
+
+ // Used to send ACK.
+ std::shared_ptr<WireWriter> wire_writer_;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_READER_IMPL_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc
new file mode 100644
index 00000000000..51b77e9c1da
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.cc
@@ -0,0 +1,184 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/binder/wire_format/wire_writer.h"
+
+#ifndef GRPC_NO_BINDER
+
+#include <utility>
+
+#include <grpc/support/log.h>
+
+#define RETURN_IF_ERROR(expr) \
+ do { \
+ const y_absl::Status status = (expr); \
+ if (!status.ok()) return status; \
+ } while (0)
+
+namespace grpc_binder {
+WireWriterImpl::WireWriterImpl(std::unique_ptr<Binder> binder)
+ : binder_(std::move(binder)) {}
+
+y_absl::Status WireWriterImpl::WriteInitialMetadata(const Transaction& tx,
+ WritableParcel* parcel) {
+ if (tx.IsClient()) {
+ // Only client sends method ref.
+ RETURN_IF_ERROR(parcel->WriteString(tx.GetMethodRef()));
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetPrefixMetadata().size()));
+ for (const auto& md : tx.GetPrefixMetadata()) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.first));
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.second));
+ }
+ return y_absl::OkStatus();
+}
+
+y_absl::Status WireWriterImpl::WriteTrailingMetadata(const Transaction& tx,
+ WritableParcel* parcel) {
+ if (tx.IsServer()) {
+ if (tx.GetFlags() & kFlagStatusDescription) {
+ RETURN_IF_ERROR(parcel->WriteString(tx.GetStatusDesc()));
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetSuffixMetadata().size()));
+ for (const auto& md : tx.GetSuffixMetadata()) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.first));
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(md.second));
+ }
+ } else {
+ // client suffix currently is always empty according to the wireformat
+ if (!tx.GetSuffixMetadata().empty()) {
+ gpr_log(GPR_ERROR, "Got non-empty suffix metadata from client.");
+ }
+ }
+ return y_absl::OkStatus();
+}
+
+const int64_t WireWriterImpl::kBlockSize = 16 * 1024;
+const int64_t WireWriterImpl::kFlowControlWindowSize = 128 * 1024;
+
+bool WireWriterImpl::CanBeSentInOneTransaction(const Transaction& tx) const {
+ return (tx.GetFlags() & kFlagMessageData) == 0 ||
+ tx.GetMessageData().size() <= kBlockSize;
+}
+
+y_absl::Status WireWriterImpl::RpcCallFastPath(const Transaction& tx) {
+ int& seq = seq_num_[tx.GetTxCode()];
+ // Fast path: send data in one transaction.
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ RETURN_IF_ERROR(parcel->WriteInt32(tx.GetFlags()));
+ RETURN_IF_ERROR(parcel->WriteInt32(seq++));
+ if (tx.GetFlags() & kFlagPrefix) {
+ RETURN_IF_ERROR(WriteInitialMetadata(tx, parcel));
+ }
+ if (tx.GetFlags() & kFlagMessageData) {
+ RETURN_IF_ERROR(parcel->WriteByteArrayWithLength(tx.GetMessageData()));
+ }
+ if (tx.GetFlags() & kFlagSuffix) {
+ RETURN_IF_ERROR(WriteTrailingMetadata(tx, parcel));
+ }
+ // FIXME(waynetu): Construct BinderTransportTxCode from an arbitrary integer
+ // is an undefined behavior.
+ return binder_->Transact(BinderTransportTxCode(tx.GetTxCode()));
+}
+
+bool WireWriterImpl::WaitForAcknowledgement() {
+ if (num_outgoing_bytes_ < num_acknowledged_bytes_ + kFlowControlWindowSize) {
+ return true;
+ }
+ y_absl::Time deadline = y_absl::Now() + y_absl::Seconds(1);
+ do {
+ if (cv_.WaitWithDeadline(&mu_, deadline)) {
+ return false;
+ }
+ if (y_absl::Now() >= deadline) {
+ return false;
+ }
+ } while (num_outgoing_bytes_ >=
+ num_acknowledged_bytes_ + kFlowControlWindowSize);
+ return true;
+}
+
+y_absl::Status WireWriterImpl::RpcCall(const Transaction& tx) {
+ // TODO(mingcl): check tx_code <= last call id
+ grpc_core::MutexLock lock(&mu_);
+ GPR_ASSERT(tx.GetTxCode() >= kFirstCallId);
+ if (CanBeSentInOneTransaction(tx)) {
+ return RpcCallFastPath(tx);
+ }
+ // Slow path: the message data is too large to fit in one transaction.
+ int& seq = seq_num_[tx.GetTxCode()];
+ int original_flags = tx.GetFlags();
+ GPR_ASSERT(original_flags & kFlagMessageData);
+ y_absl::string_view data = tx.GetMessageData();
+ size_t bytes_sent = 0;
+ while (bytes_sent < data.size()) {
+ if (!WaitForAcknowledgement()) {
+ return y_absl::InternalError("Timeout waiting for acknowledgement");
+ }
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ size_t size =
+ std::min(static_cast<size_t>(kBlockSize), data.size() - bytes_sent);
+ int flags = kFlagMessageData;
+ if (bytes_sent == 0) {
+ // This is the first transaction. Include initial metadata if there's any.
+ if (original_flags & kFlagPrefix) {
+ flags |= kFlagPrefix;
+ }
+ }
+ if (bytes_sent + kBlockSize >= data.size()) {
+ // This is the last transaction. Include trailing metadata if there's any.
+ if (original_flags & kFlagSuffix) {
+ flags |= kFlagSuffix;
+ }
+ } else {
+ // There are more messages to send.
+ flags |= kFlagMessageDataIsPartial;
+ }
+ RETURN_IF_ERROR(parcel->WriteInt32(flags));
+ RETURN_IF_ERROR(parcel->WriteInt32(seq++));
+ if (flags & kFlagPrefix) {
+ RETURN_IF_ERROR(WriteInitialMetadata(tx, parcel));
+ }
+ RETURN_IF_ERROR(
+ parcel->WriteByteArrayWithLength(data.substr(bytes_sent, size)));
+ if (flags & kFlagSuffix) {
+ RETURN_IF_ERROR(WriteTrailingMetadata(tx, parcel));
+ }
+ num_outgoing_bytes_ += parcel->GetDataSize();
+ RETURN_IF_ERROR(binder_->Transact(BinderTransportTxCode(tx.GetTxCode())));
+ bytes_sent += size;
+ }
+ return y_absl::OkStatus();
+}
+
+y_absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
+ grpc_core::MutexLock lock(&mu_);
+ RETURN_IF_ERROR(binder_->PrepareTransaction());
+ WritableParcel* parcel = binder_->GetWritableParcel();
+ RETURN_IF_ERROR(parcel->WriteInt64(num_bytes));
+ return binder_->Transact(BinderTransportTxCode::ACKNOWLEDGE_BYTES);
+}
+
+void WireWriterImpl::OnAckReceived(int64_t num_bytes) {
+ grpc_core::MutexLock lock(&mu_);
+ num_acknowledged_bytes_ = std::max(num_acknowledged_bytes_, num_bytes);
+ cv_.Signal();
+}
+
+} // namespace grpc_binder
+#endif
diff --git a/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h
new file mode 100644
index 00000000000..030a4ffbed7
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/binder/wire_format/wire_writer.h
@@ -0,0 +1,84 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
+#define GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/container/flat_hash_map.h"
+
+#include "src/core/ext/transport/binder/wire_format/binder.h"
+#include "src/core/ext/transport/binder/wire_format/transaction.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_binder {
+
+class WireWriter {
+ public:
+ virtual ~WireWriter() = default;
+ virtual y_absl::Status RpcCall(const Transaction& call) = 0;
+ virtual y_absl::Status SendAck(int64_t num_bytes) = 0;
+ virtual void OnAckReceived(int64_t num_bytes) = 0;
+};
+
+class WireWriterImpl : public WireWriter {
+ public:
+ explicit WireWriterImpl(std::unique_ptr<Binder> binder);
+ y_absl::Status RpcCall(const Transaction& tx) override;
+ y_absl::Status SendAck(int64_t num_bytes) override;
+ void OnAckReceived(int64_t num_bytes) override;
+
+ // Split long message into chunks of size 16k. This doesn't necessarily have
+ // to be the same as the flow control acknowledgement size, but it should not
+ // exceed 128k.
+ static const int64_t kBlockSize;
+ // Flow control allows sending at most 128k between acknowledgements.
+ static const int64_t kFlowControlWindowSize;
+
+ private:
+ y_absl::Status WriteInitialMetadata(const Transaction& tx,
+ WritableParcel* parcel)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ y_absl::Status WriteTrailingMetadata(const Transaction& tx,
+ WritableParcel* parcel)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ bool CanBeSentInOneTransaction(const Transaction& tx) const;
+ y_absl::Status RpcCallFastPath(const Transaction& tx)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ // Wait for acknowledgement from the other side for a while (the timeout is
+ // currently set to 10ms for debugability). Returns true if we are able to
+ // proceed, and false otherwise.
+ //
+ // TODO(waynetu): Currently, RpcCall() will fail if we are blocked for 10ms.
+ // In the future, we should queue the transactions and release them later when
+ // acknowledgement comes.
+ bool WaitForAcknowledgement() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ grpc_core::Mutex mu_;
+ grpc_core::CondVar cv_;
+ std::unique_ptr<Binder> binder_ Y_ABSL_GUARDED_BY(mu_);
+ y_absl::flat_hash_map<int, int> seq_num_ Y_ABSL_GUARDED_BY(mu_);
+ int64_t num_outgoing_bytes_ Y_ABSL_GUARDED_BY(mu_) = 0;
+ int64_t num_acknowledged_bytes_ Y_ABSL_GUARDED_BY(mu_) = 0;
+};
+
+} // namespace grpc_binder
+
+#endif // GRPC_CORE_EXT_TRANSPORT_BINDER_WIRE_FORMAT_WIRE_WRITER_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
index 1fdab76dbf0..33f762760a8 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/alpn/alpn.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/alpn/alpn.h"
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/useful.h"
/* in order of preference */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.cc
deleted file mode 100644
index 325b312991d..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/transport/chttp2/client/authority.h"
-
-grpc_channel_args* grpc_default_authority_add_if_not_present(
- const grpc_channel_args* args) {
- const bool has_default_authority =
- grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) != nullptr;
- grpc_arg new_args[1];
- size_t num_new_args = 0;
- TString default_authority;
- if (!has_default_authority) {
- const grpc_arg* server_uri_arg =
- grpc_channel_args_find(args, GRPC_ARG_SERVER_URI);
- const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
- GPR_ASSERT(server_uri_str != nullptr);
- default_authority =
- grpc_core::ResolverRegistry::GetDefaultAuthority(server_uri_str);
- new_args[num_new_args++] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
- const_cast<char*>(default_authority.c_str()));
- }
- return grpc_channel_args_copy_and_add(args, new_args, num_new_args);
-}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.h
deleted file mode 100644
index 642584ef566..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/authority.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc.h>
-
-#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gprpp/memory.h"
-
-/// Returns a copy of \a args with the default authority channel arg set if it
-/// wasn't already present.
-grpc_channel_args* grpc_default_authority_add_if_not_present(
- const grpc_channel_args* args);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_AUTHORITY_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
index 345663a04cd..d2c55ff1263 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.cc
@@ -20,21 +20,19 @@
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
-#include <grpc/grpc.h>
-
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/connector.h"
-#include "src/core/ext/filters/client_channel/http_connect_handshaker.h"
-#include "src/core/ext/filters/client_channel/subchannel.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -45,13 +43,13 @@ Chttp2Connector::Chttp2Connector() {
}
Chttp2Connector::~Chttp2Connector() {
- if (endpoint_ != nullptr) grpc_endpoint_destroy(endpoint_);
+ if (endpoint_ != nullptr) {
+ grpc_endpoint_destroy(endpoint_);
+ }
}
void Chttp2Connector::Connect(const Args& args, Result* result,
grpc_closure* notify) {
- grpc_resolved_address addr;
- Subchannel::GetAddressFromSubchannelAddressArg(args.channel_args, &addr);
grpc_endpoint** ep;
{
MutexLock lock(&mu_);
@@ -72,10 +70,10 @@ void Chttp2Connector::Connect(const Args& args, Result* result,
// make sure that we still exist at that point by taking a ref.
Ref().release(); // Ref held by callback.
grpc_tcp_client_connect(&connected_, ep, args.interested_parties,
- args.channel_args, &addr, args.deadline);
+ args.channel_args, args.address, args.deadline);
}
-void Chttp2Connector::Shutdown(grpc_error* error) {
+void Chttp2Connector::Shutdown(grpc_error_handle error) {
MutexLock lock(&mu_);
shutdown_ = true;
if (handshake_mgr_ != nullptr) {
@@ -89,7 +87,7 @@ void Chttp2Connector::Shutdown(grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-void Chttp2Connector::Connected(void* arg, grpc_error* error) {
+void Chttp2Connector::Connected(void* arg, grpc_error_handle error) {
Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
bool unref = false;
{
@@ -120,9 +118,9 @@ void Chttp2Connector::Connected(void* arg, grpc_error* error) {
void Chttp2Connector::StartHandshakeLocked() {
handshake_mgr_ = MakeRefCounted<HandshakeManager>();
- HandshakerRegistry::AddHandshakers(HANDSHAKER_CLIENT, args_.channel_args,
- args_.interested_parties,
- handshake_mgr_.get());
+ CoreConfiguration::Get().handshaker_registry().AddHandshakers(
+ HANDSHAKER_CLIENT, args_.channel_args, args_.interested_parties,
+ handshake_mgr_.get());
grpc_endpoint_add_to_pollset_set(endpoint_, args_.interested_parties);
handshake_mgr_->DoHandshake(endpoint_, args_.channel_args, args_.deadline,
nullptr /* acceptor */, OnHandshakeDone, this);
@@ -131,14 +129,14 @@ void Chttp2Connector::StartHandshakeLocked() {
namespace {
void NullThenSchedClosure(const DebugLocation& location, grpc_closure** closure,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_closure* c = *closure;
*closure = nullptr;
ExecCtx::Run(location, c, error);
}
} // namespace
-void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error* error) {
+void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error_handle error) {
auto* args = static_cast<HandshakerArgs*>(arg);
Chttp2Connector* self = static_cast<Chttp2Connector*>(args->user_data);
{
@@ -194,7 +192,7 @@ void Chttp2Connector::OnHandshakeDone(void* arg, grpc_error* error) {
self->Unref();
}
-void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error* error) {
+void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error_handle error) {
Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
{
MutexLock lock(&self->mu_);
@@ -220,7 +218,7 @@ void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error* error) {
self->Unref();
}
-void Chttp2Connector::OnTimeout(void* arg, grpc_error* /*error*/) {
+void Chttp2Connector::OnTimeout(void* arg, grpc_error_handle /*error*/) {
Chttp2Connector* self = static_cast<Chttp2Connector*>(arg);
{
MutexLock lock(&self->mu_);
@@ -245,7 +243,7 @@ void Chttp2Connector::OnTimeout(void* arg, grpc_error* /*error*/) {
self->Unref();
}
-void Chttp2Connector::MaybeNotify(grpc_error* error) {
+void Chttp2Connector::MaybeNotify(grpc_error_handle error) {
if (notify_error_.has_value()) {
GRPC_ERROR_UNREF(error);
NullThenSchedClosure(DEBUG_LOCATION, &notify_, notify_error_.value());
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
index 1488b8e128f..7f17d68505a 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/chttp2_connector.h
@@ -33,14 +33,14 @@ class Chttp2Connector : public SubchannelConnector {
~Chttp2Connector() override;
void Connect(const Args& args, Result* result, grpc_closure* notify) override;
- void Shutdown(grpc_error* error) override;
+ void Shutdown(grpc_error_handle error) override;
private:
- static void Connected(void* arg, grpc_error* error);
+ static void Connected(void* arg, grpc_error_handle error);
void StartHandshakeLocked();
- static void OnHandshakeDone(void* arg, grpc_error* error);
- static void OnReceiveSettings(void* arg, grpc_error* error);
- static void OnTimeout(void* arg, grpc_error* error);
+ static void OnHandshakeDone(void* arg, grpc_error_handle error);
+ static void OnReceiveSettings(void* arg, grpc_error_handle error);
+ static void OnTimeout(void* arg, grpc_error_handle error);
// We cannot invoke notify_ until both OnTimeout() and OnReceiveSettings()
// have been called since that is an indicator to the upper layer that we are
@@ -51,7 +51,7 @@ class Chttp2Connector : public SubchannelConnector {
// invoked, we call MaybeNotify() again to actually invoke the notify_
// callback. Note that this only happens if the handshake is done and the
// connector is waiting on the SETTINGS frame.
- void MaybeNotify(grpc_error* error);
+ void MaybeNotify(grpc_error_handle error);
Mutex mu_;
Args args_;
@@ -66,7 +66,7 @@ class Chttp2Connector : public SubchannelConnector {
grpc_closure on_receive_settings_;
grpc_timer timer_;
grpc_closure on_timeout_;
- y_absl::optional<grpc_error*> notify_error_;
+ y_absl::optional<grpc_error_handle> notify_error_;
RefCountedPtr<HandshakeManager> handshake_mgr_;
};
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
index d82cc1d3f5e..66129d92b36 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create.cc
@@ -1,35 +1,32 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
-
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
-#include "src/core/ext/transport/chttp2/client/authority.h"
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
@@ -38,20 +35,16 @@ namespace grpc_core {
class Chttp2InsecureClientChannelFactory : public ClientChannelFactory {
public:
RefCountedPtr<Subchannel> CreateSubchannel(
+ const grpc_resolved_address& address,
const grpc_channel_args* args) override {
- grpc_channel_args* new_args =
- grpc_default_authority_add_if_not_present(args);
- RefCountedPtr<Subchannel> s =
- Subchannel::Create(MakeOrphanable<Chttp2Connector>(), new_args);
- grpc_channel_args_destroy(new_args);
- return s;
+ return Subchannel::Create(MakeOrphanable<Chttp2Connector>(), address, args);
}
};
namespace {
grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
- grpc_error** error) {
+ grpc_error_handle* error) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
if (error != nullptr) {
@@ -60,15 +53,19 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
return nullptr;
}
// Add channel arg containing the server URI.
- grpc_core::UniquePtr<char> canonical_target =
+ UniquePtr<char> canonical_target =
ResolverRegistry::AddDefaultPrefixIfNeeded(target);
grpc_arg arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());
const char* to_remove[] = {GRPC_ARG_SERVER_URI};
- grpc_channel_args* new_args =
+ grpc_channel_args* new_args0 =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
+ const grpc_channel_args* new_args = CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(new_args0);
+ grpc_channel_args_destroy(new_args0);
grpc_channel* channel = grpc_channel_create(
- target, new_args, GRPC_CLIENT_CHANNEL, nullptr, nullptr, error);
+ target, new_args, GRPC_CLIENT_CHANNEL, nullptr, error);
grpc_channel_args_destroy(new_args);
return channel;
}
@@ -106,7 +103,7 @@ grpc_channel* grpc_insecure_channel_create(const char* target,
const char* arg_to_remove = arg.key;
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove(
args, &arg_to_remove, 1, &arg, 1);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Create channel.
grpc_channel* channel = grpc_core::CreateChannel(target, new_args, &error);
// Clean up.
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
index 1360047cd56..ba821d049e7 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc
@@ -31,6 +31,7 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/tcp_client_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/transport/transport.h"
@@ -44,22 +45,22 @@ grpc_channel* grpc_insecure_channel_create_from_fd(
grpc_arg default_authority_arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
const_cast<char*>("test.authority"));
- grpc_channel_args* final_args =
- grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ args = grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ const grpc_channel_args* final_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel_args_destroy(args);
int flags = fcntl(fd, F_GETFL, 0);
GPR_ASSERT(fcntl(fd, F_SETFL, flags | O_NONBLOCK) == 0);
-
grpc_endpoint* client = grpc_tcp_client_create_from_fd(
- grpc_fd_create(fd, "client", true), args, "fd-client");
-
+ grpc_fd_create(fd, "client", true), final_args, "fd-client");
grpc_transport* transport =
grpc_create_chttp2_transport(final_args, client, true);
GPR_ASSERT(transport);
- grpc_error* error = nullptr;
- grpc_channel* channel =
- grpc_channel_create(target, final_args, GRPC_CLIENT_DIRECT_CHANNEL,
- transport, nullptr, &error);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_channel* channel = grpc_channel_create(
+ target, final_args, GRPC_CLIENT_DIRECT_CHANNEL, transport, &error);
grpc_channel_args_destroy(final_args);
if (channel != nullptr) {
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
@@ -82,7 +83,8 @@ grpc_channel* grpc_insecure_channel_create_from_fd(
#else // !GPR_SUPPORT_CHANNELS_FROM_FD
grpc_channel* grpc_insecure_channel_create_from_fd(
- const char* target, int fd, const grpc_channel_args* args) {
+ const char* /* target */, int /* fd */,
+ const grpc_channel_args* /* args */) {
GPR_ASSERT(0);
return nullptr;
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index d3f60add4d4..c5fb03b82b1 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -1,42 +1,39 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2015 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
-
#include <string.h>
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/transport/chttp2/client/chttp2_connector.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/transport/authority_override.h"
#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
@@ -44,6 +41,7 @@ namespace grpc_core {
class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
public:
RefCountedPtr<Subchannel> CreateSubchannel(
+ const grpc_resolved_address& address,
const grpc_channel_args* args) override {
grpc_channel_args* new_args = GetSecureNamingChannelArgs(args);
if (new_args == nullptr) {
@@ -51,8 +49,8 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
"Failed to create channel args during subchannel creation.");
return nullptr;
}
- RefCountedPtr<Subchannel> s =
- Subchannel::Create(MakeOrphanable<Chttp2Connector>(), new_args);
+ RefCountedPtr<Subchannel> s = Subchannel::Create(
+ MakeOrphanable<Chttp2Connector>(), address, new_args);
grpc_channel_args_destroy(new_args);
return s;
}
@@ -76,52 +74,29 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
return nullptr;
}
// Find the authority to use in the security connector.
- // First, check the authority override channel arg.
- // Otherwise, get it from the server name used to construct the
- // channel.
- TString authority(FindAuthorityOverrideInArgs(args));
- if (authority.empty()) {
- const char* server_uri_str =
- grpc_channel_args_find_string(args, GRPC_ARG_SERVER_URI);
- GPR_ASSERT(server_uri_str != nullptr);
- authority = ResolverRegistry::GetDefaultAuthority(server_uri_str);
- }
- grpc_arg args_to_add[2];
- size_t num_args_to_add = 0;
- if (grpc_channel_args_find(args, GRPC_ARG_DEFAULT_AUTHORITY) == nullptr) {
- // If the channel args don't already contain GRPC_ARG_DEFAULT_AUTHORITY,
- // add the arg, setting it to the value just obtained.
- args_to_add[num_args_to_add++] = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
- const_cast<char*>(authority.c_str()));
- }
- grpc_channel_args* args_with_authority =
- grpc_channel_args_copy_and_add(args, args_to_add, num_args_to_add);
+ const char* authority =
+ grpc_channel_args_find_string(args, GRPC_ARG_DEFAULT_AUTHORITY);
+ GPR_ASSERT(authority != nullptr);
// Create the security connector using the credentials and target name.
grpc_channel_args* new_args_from_connector = nullptr;
RefCountedPtr<grpc_channel_security_connector>
subchannel_security_connector =
channel_credentials->create_security_connector(
- /*call_creds=*/nullptr, authority.c_str(), args_with_authority,
+ /*call_creds=*/nullptr, authority, args,
&new_args_from_connector);
if (subchannel_security_connector == nullptr) {
gpr_log(GPR_ERROR,
"Failed to create secure subchannel for secure name '%s'",
- authority.c_str());
- grpc_channel_args_destroy(args_with_authority);
+ authority);
return nullptr;
}
grpc_arg new_security_connector_arg =
grpc_security_connector_to_arg(subchannel_security_connector.get());
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
- new_args_from_connector != nullptr ? new_args_from_connector
- : args_with_authority,
+ new_args_from_connector != nullptr ? new_args_from_connector : args,
&new_security_connector_arg, 1);
subchannel_security_connector.reset(DEBUG_LOCATION, "lb_channel_create");
- if (new_args_from_connector != nullptr) {
- grpc_channel_args_destroy(new_args_from_connector);
- }
- grpc_channel_args_destroy(args_with_authority);
+ grpc_channel_args_destroy(new_args_from_connector);
return new_args;
}
};
@@ -129,7 +104,7 @@ class Chttp2SecureClientChannelFactory : public ClientChannelFactory {
namespace {
grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
- grpc_error** error) {
+ grpc_error_handle* error) {
if (target == nullptr) {
gpr_log(GPR_ERROR, "cannot create channel with NULL target name");
if (error != nullptr) {
@@ -138,7 +113,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
return nullptr;
}
// Add channel arg containing the server URI.
- grpc_core::UniquePtr<char> canonical_target =
+ UniquePtr<char> canonical_target =
ResolverRegistry::AddDefaultPrefixIfNeeded(target);
grpc_arg arg = grpc_channel_arg_string_create(
const_cast<char*>(GRPC_ARG_SERVER_URI), canonical_target.get());
@@ -146,7 +121,7 @@ grpc_channel* CreateChannel(const char* target, const grpc_channel_args* args,
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
grpc_channel* channel = grpc_channel_create(
- target, new_args, GRPC_CLIENT_CHANNEL, nullptr, nullptr, error);
+ target, new_args, GRPC_CLIENT_CHANNEL, nullptr, error);
grpc_channel_args_destroy(new_args);
return channel;
}
@@ -180,8 +155,11 @@ grpc_channel* grpc_secure_channel_create(grpc_channel_credentials* creds,
"reserved=%p)",
4, ((void*)creds, target, (void*)args, (void*)reserved));
GPR_ASSERT(reserved == nullptr);
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
grpc_channel* channel = nullptr;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (creds != nullptr) {
// Add channel args containing the client channel factory and channel
// credentials.
@@ -199,6 +177,7 @@ grpc_channel* grpc_secure_channel_create(grpc_channel_credentials* creds,
// Clean up.
grpc_channel_args_destroy(new_args);
}
+ grpc_channel_args_destroy(args);
if (channel == nullptr) {
intptr_t integer;
grpc_status_code status = GRPC_STATUS_INTERNAL;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
index 45ea9c8a4eb..893d683bbe7 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc
@@ -23,11 +23,13 @@
#include <inttypes.h>
#include <limits.h>
#include <string.h>
+
#include <vector>
#include "y_absl/strings/match.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/strip.h"
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
@@ -38,20 +40,22 @@
#include "src/core/ext/filters/http/server/http_server_filter.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/resource_quota.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
+#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
namespace {
@@ -61,14 +65,14 @@ const char kUnixAbstractUriPrefix[] = "unix-abstract:";
class Chttp2ServerListener : public Server::ListenerInterface {
public:
- static grpc_error* Create(Server* server, grpc_resolved_address* addr,
- grpc_channel_args* args,
- Chttp2ServerArgsModifier args_modifier,
- int* port_num);
+ static grpc_error_handle Create(Server* server, grpc_resolved_address* addr,
+ grpc_channel_args* args,
+ Chttp2ServerArgsModifier args_modifier,
+ int* port_num);
- static grpc_error* CreateWithAcceptor(Server* server, const char* name,
- grpc_channel_args* args,
- Chttp2ServerArgsModifier args_modifier);
+ static grpc_error_handle CreateWithAcceptor(
+ Server* server, const char* name, grpc_channel_args* args,
+ Chttp2ServerArgsModifier args_modifier);
// Do not instantiate directly. Use one of the factory methods above.
Chttp2ServerListener(Server* server, grpc_channel_args* args,
@@ -122,12 +126,12 @@ class Chttp2ServerListener : public Server::ListenerInterface {
using InternallyRefCounted<HandshakingState>::Ref;
private:
- static void OnTimeout(void* arg, grpc_error* error);
- static void OnReceiveSettings(void* arg, grpc_error* /* error */);
- static void OnHandshakeDone(void* arg, grpc_error* error);
+ static void OnTimeout(void* arg, grpc_error_handle error);
+ static void OnReceiveSettings(void* arg, grpc_error_handle /* error */);
+ static void OnHandshakeDone(void* arg, grpc_error_handle error);
RefCountedPtr<ActiveConnection> const connection_;
grpc_pollset* const accepting_pollset_;
- grpc_tcp_server_acceptor* const acceptor_;
+ grpc_tcp_server_acceptor* acceptor_;
RefCountedPtr<HandshakeManager> handshake_mgr_
Y_ABSL_GUARDED_BY(&connection_->mu_);
// State for enforcing handshake timeout on receiving HTTP/2 settings.
@@ -140,7 +144,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
ActiveConnection(grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor,
- grpc_channel_args* args);
+ grpc_channel_args* args, MemoryOwner memory_owner);
~ActiveConnection() override;
void Orphan() override;
@@ -155,7 +159,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
using InternallyRefCounted<ActiveConnection>::Ref;
private:
- static void OnClose(void* arg, grpc_error* error);
+ static void OnClose(void* arg, grpc_error_handle error);
RefCountedPtr<Chttp2ServerListener> listener_;
Mutex mu_ Y_ABSL_ACQUIRED_AFTER(&listener_->mu_);
@@ -179,7 +183,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor);
- static void TcpServerShutdownComplete(void* arg, grpc_error* error);
+ static void TcpServerShutdownComplete(void* arg, grpc_error_handle error);
static void DestroyListener(Server* /*server*/, void* arg,
grpc_closure* destroy_done);
@@ -216,10 +220,10 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_resolved_address resolved_address_;
Chttp2ServerArgsModifier const args_modifier_;
ConfigFetcherWatcher* config_fetcher_watcher_ = nullptr;
- Mutex channel_args_mu_;
- grpc_channel_args* args_ Y_ABSL_GUARDED_BY(channel_args_mu_);
+ grpc_channel_args* args_;
+ Mutex connection_manager_mu_;
RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
- connection_manager_ Y_ABSL_GUARDED_BY(channel_args_mu_);
+ connection_manager_ Y_ABSL_GUARDED_BY(connection_manager_mu_);
Mutex mu_;
// Signals whether grpc_tcp_server_start() has been called.
bool started_ Y_ABSL_GUARDED_BY(mu_) = false;
@@ -234,6 +238,7 @@ class Chttp2ServerListener : public Server::ListenerInterface {
grpc_closure tcp_server_shutdown_complete_ Y_ABSL_GUARDED_BY(mu_);
grpc_closure* on_destroy_done_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
RefCountedPtr<channelz::ListenSocketNode> channelz_listen_socket_;
+ MemoryQuotaRefPtr memory_quota_;
};
//
@@ -246,7 +251,7 @@ void Chttp2ServerListener::ConfigFetcherWatcher::UpdateConnectionManager(
RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
connection_manager_to_destroy;
{
- MutexLock lock(&listener_->channel_args_mu_);
+ MutexLock lock(&listener_->connection_manager_mu_);
connection_manager_to_destroy = listener_->connection_manager_;
listener_->connection_manager_ = std::move(connection_manager);
}
@@ -259,12 +264,12 @@ void Chttp2ServerListener::ConfigFetcherWatcher::UpdateConnectionManager(
if (listener_->started_) return;
}
int port_temp;
- grpc_error* error = grpc_tcp_server_add_port(
+ grpc_error_handle error = grpc_tcp_server_add_port(
listener_->tcp_server_, &listener_->resolved_address_, &port_temp);
if (error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(error);
gpr_log(GPR_ERROR, "Error adding port to server: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
// TODO(yashykt): We wouldn't need to assert here if we bound to the
// port earlier during AddPort.
GPR_ASSERT(0);
@@ -313,13 +318,14 @@ Chttp2ServerListener::ActiveConnection::HandshakingState::HandshakingState(
deadline_(GetConnectionDeadline(args)),
interested_parties_(grpc_pollset_set_create()) {
grpc_pollset_set_add_pollset(interested_parties_, accepting_pollset_);
- HandshakerRegistry::AddHandshakers(HANDSHAKER_SERVER, args,
- interested_parties_, handshake_mgr_.get());
+ CoreConfiguration::Get().handshaker_registry().AddHandshakers(
+ HANDSHAKER_SERVER, args, interested_parties_, handshake_mgr_.get());
}
Chttp2ServerListener::ActiveConnection::HandshakingState::~HandshakingState() {
grpc_pollset_set_del_pollset(interested_parties_, accepting_pollset_);
grpc_pollset_set_destroy(interested_parties_);
+ gpr_free(acceptor_);
}
void Chttp2ServerListener::ActiveConnection::HandshakingState::Orphan() {
@@ -347,7 +353,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::Start(
}
void Chttp2ServerListener::ActiveConnection::HandshakingState::OnTimeout(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
HandshakingState* self = static_cast<HandshakingState*>(arg);
// Note that we may be called with GRPC_ERROR_NONE when the timer fires
// or with an error indicating that the timer system is being shut down.
@@ -366,29 +372,25 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnTimeout(
}
void Chttp2ServerListener::ActiveConnection::HandshakingState::
- OnReceiveSettings(void* arg, grpc_error* /* error */) {
+ OnReceiveSettings(void* arg, grpc_error_handle /* error */) {
HandshakingState* self = static_cast<HandshakingState*>(arg);
grpc_timer_cancel(&self->timer_);
self->Unref();
}
void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
auto* args = static_cast<HandshakerArgs*>(arg);
HandshakingState* self = static_cast<HandshakingState*>(args->user_data);
OrphanablePtr<HandshakingState> handshaking_state_ref;
RefCountedPtr<HandshakeManager> handshake_mgr;
bool cleanup_connection = false;
- bool free_resource_quota = false;
- grpc_resource_user* resource_user =
- self->connection_->listener_->server_->default_resource_user();
{
MutexLock connection_lock(&self->connection_->mu_);
if (error != GRPC_ERROR_NONE || self->connection_->shutdown_) {
- const char* error_str = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str);
+ TString error_str = grpc_error_std_string(error);
+ gpr_log(GPR_DEBUG, "Handshaking failed: %s", error_str.c_str());
cleanup_connection = true;
- free_resource_quota = true;
if (error == GRPC_ERROR_NONE && args->endpoint != nullptr) {
// We were shut down or stopped serving after handshaking completed
// successfully, so destroy the endpoint here.
@@ -407,13 +409,12 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
// handshaker may have handed off the connection to some external
// code, so we can just clean up here without creating a transport.
if (args->endpoint != nullptr) {
- grpc_transport* transport = grpc_create_chttp2_transport(
- args->args, args->endpoint, false, resource_user);
- grpc_error* channel_init_err =
+ grpc_transport* transport =
+ grpc_create_chttp2_transport(args->args, args->endpoint, false);
+ grpc_error_handle channel_init_err =
self->connection_->listener_->server_->SetupTransport(
transport, self->accepting_pollset_, args->args,
- grpc_chttp2_transport_get_socket_node(transport),
- resource_user);
+ grpc_chttp2_transport_get_socket_node(transport));
if (channel_init_err == GRPC_ERROR_NONE) {
// Use notify_on_receive_settings callback to enforce the
// handshake deadline.
@@ -455,18 +456,16 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
} else {
// Failed to create channel from transport. Clean up.
gpr_log(GPR_ERROR, "Failed to create channel: %s",
- grpc_error_string(channel_init_err));
+ grpc_error_std_string(channel_init_err).c_str());
GRPC_ERROR_UNREF(channel_init_err);
grpc_transport_destroy(transport);
grpc_slice_buffer_destroy_internal(args->read_buffer);
gpr_free(args->read_buffer);
cleanup_connection = true;
- free_resource_quota = true;
grpc_channel_args_destroy(args->args);
}
} else {
cleanup_connection = true;
- free_resource_quota = true;
}
}
// Since the handshake manager is done, the connection no longer needs to
@@ -477,10 +476,8 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
handshaking_state_ref = std::move(self->connection_->handshaking_state_);
}
gpr_free(self->acceptor_);
+ self->acceptor_ = nullptr;
OrphanablePtr<ActiveConnection> connection;
- if (free_resource_quota && resource_user != nullptr) {
- grpc_resource_user_free(resource_user, GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
if (cleanup_connection) {
MutexLock listener_lock(&self->connection_->listener_->mu_);
auto it = self->connection_->listener_->connections_.find(
@@ -499,8 +496,8 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
Chttp2ServerListener::ActiveConnection::ActiveConnection(
grpc_pollset* accepting_pollset, grpc_tcp_server_acceptor* acceptor,
- grpc_channel_args* args)
- : handshaking_state_(MakeOrphanable<HandshakingState>(
+ grpc_channel_args* args, MemoryOwner memory_owner)
+ : handshaking_state_(memory_owner.MakeOrphanable<HandshakingState>(
Ref(), accepting_pollset, acceptor, args)) {
GRPC_CLOSURE_INIT(&on_close_, ActiveConnection::OnClose, this,
grpc_schedule_on_exec_ctx);
@@ -553,8 +550,8 @@ void Chttp2ServerListener::ActiveConnection::Start(
handshaking_state_ref->Start(endpoint, args);
}
-void Chttp2ServerListener::ActiveConnection::OnClose(void* arg,
- grpc_error* /* error */) {
+void Chttp2ServerListener::ActiveConnection::OnClose(
+ void* arg, grpc_error_handle /* error */) {
ActiveConnection* self = static_cast<ActiveConnection*>(arg);
OrphanablePtr<ActiveConnection> connection;
{
@@ -577,15 +574,14 @@ void Chttp2ServerListener::ActiveConnection::OnClose(void* arg,
// Chttp2ServerListener
//
-grpc_error* Chttp2ServerListener::Create(Server* server,
- grpc_resolved_address* addr,
- grpc_channel_args* args,
- Chttp2ServerArgsModifier args_modifier,
- int* port_num) {
+grpc_error_handle Chttp2ServerListener::Create(
+ Server* server, grpc_resolved_address* addr, grpc_channel_args* args,
+ Chttp2ServerArgsModifier args_modifier, int* port_num) {
Chttp2ServerListener* listener = nullptr;
// The bulk of this method is inside of a lambda to make cleanup
// easier without using goto.
- grpc_error* error = [&]() {
+ grpc_error_handle error = [&]() {
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Create Chttp2ServerListener.
listener = new Chttp2ServerListener(server, args, args_modifier);
error = grpc_tcp_server_create(&listener->tcp_server_shutdown_complete_,
@@ -627,12 +623,12 @@ grpc_error* Chttp2ServerListener::Create(Server* server,
return error;
}
-grpc_error* Chttp2ServerListener::CreateWithAcceptor(
+grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
Server* server, const char* name, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier) {
Chttp2ServerListener* listener =
new Chttp2ServerListener(server, args, args_modifier);
- grpc_error* error = grpc_tcp_server_create(
+ grpc_error_handle error = grpc_tcp_server_create(
&listener->tcp_server_shutdown_complete_, args, &listener->tcp_server_);
if (error != GRPC_ERROR_NONE) {
delete listener;
@@ -649,7 +645,10 @@ grpc_error* Chttp2ServerListener::CreateWithAcceptor(
Chttp2ServerListener::Chttp2ServerListener(
Server* server, grpc_channel_args* args,
Chttp2ServerArgsModifier args_modifier)
- : server_(server), args_modifier_(args_modifier), args_(args) {
+ : server_(server),
+ args_modifier_(args_modifier),
+ args_(args),
+ memory_quota_(ResourceQuotaFromChannelArgs(args)->memory_quota()) {
GRPC_CLOSURE_INIT(&tcp_server_shutdown_complete_, TcpServerShutdownComplete,
this, grpc_schedule_on_exec_ctx);
}
@@ -669,16 +668,10 @@ Chttp2ServerListener::~Chttp2ServerListener() {
void Chttp2ServerListener::Start(
Server* /*server*/, const std::vector<grpc_pollset*>* /* pollsets */) {
if (server_->config_fetcher() != nullptr) {
- grpc_channel_args* args = nullptr;
auto watcher = y_absl::make_unique<ConfigFetcherWatcher>(Ref());
config_fetcher_watcher_ = watcher.get();
- {
- MutexLock lock(&channel_args_mu_);
- args = grpc_channel_args_copy(args_);
- }
server_->config_fetcher()->StartWatch(
- grpc_sockaddr_to_string(&resolved_address_, false), args,
- std::move(watcher));
+ grpc_sockaddr_to_string(&resolved_address_, false), std::move(watcher));
} else {
{
MutexLock lock(&mu_);
@@ -702,49 +695,56 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
grpc_pollset* accepting_pollset,
grpc_tcp_server_acceptor* acceptor) {
Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
- grpc_channel_args* args = nullptr;
+ grpc_channel_args* args = self->args_;
+ grpc_channel_args* args_to_destroy = nullptr;
RefCountedPtr<grpc_server_config_fetcher::ConnectionManager>
connection_manager;
{
- MutexLock lock(&self->channel_args_mu_);
- args = grpc_channel_args_copy(self->args_);
+ MutexLock lock(&self->connection_manager_mu_);
connection_manager = self->connection_manager_;
}
- auto endpoint_cleanup = [&](grpc_error* error) {
+ auto endpoint_cleanup = [&](grpc_error_handle error) {
grpc_endpoint_shutdown(tcp, error);
grpc_endpoint_destroy(tcp);
gpr_free(acceptor);
};
if (self->server_->config_fetcher() != nullptr) {
if (connection_manager == nullptr) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"No ConnectionManager configured. Closing connection.");
endpoint_cleanup(error);
- grpc_channel_args_destroy(args);
return;
}
// TODO(yashykt): Maybe combine the following two arg modifiers into a
// single one.
+ // Make a copy of the args so as to avoid destroying the original.
+ args = grpc_channel_args_copy(args);
y_absl::StatusOr<grpc_channel_args*> args_result =
connection_manager->UpdateChannelArgsForConnection(args, tcp);
if (!args_result.ok()) {
gpr_log(GPR_DEBUG, "Closing connection: %s",
args_result.status().ToString().c_str());
- endpoint_cleanup(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- args_result.status().ToString().c_str()));
+ endpoint_cleanup(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(args_result.status().ToString()));
return;
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
args = self->args_modifier_(*args_result, &error);
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_DEBUG, "Closing connection: %s", grpc_error_string(error));
+ gpr_log(GPR_DEBUG, "Closing connection: %s",
+ grpc_error_std_string(error).c_str());
endpoint_cleanup(error);
grpc_channel_args_destroy(args);
return;
}
- }
- auto connection =
- MakeOrphanable<ActiveConnection>(accepting_pollset, acceptor, args);
+ args_to_destroy = args;
+ }
+ auto memory_owner = self->memory_quota_->CreateMemoryOwner(
+ y_absl::StrCat(grpc_endpoint_get_peer(tcp), ":server_channel"));
+ auto connection = memory_owner.MakeOrphanable<ActiveConnection>(
+ accepting_pollset, acceptor, args, std::move(memory_owner));
+ // We no longer own acceptor
+ acceptor = nullptr;
// Hold a ref to connection to allow starting handshake outside the
// critical region
RefCountedPtr<ActiveConnection> connection_ref = connection->Ref();
@@ -753,23 +753,13 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
MutexLock lock(&self->mu_);
// Shutdown the the connection if listener's stopped serving.
if (!self->shutdown_ && self->is_serving_) {
- grpc_resource_user* resource_user =
- self->server_->default_resource_user();
- if (resource_user != nullptr &&
- !grpc_resource_user_safe_alloc(resource_user,
- GRPC_RESOURCE_QUOTA_CHANNEL_SIZE)) {
- gpr_log(
- GPR_ERROR,
- "Memory quota exhausted, rejecting connection, no handshaking.");
- } else {
- // This ref needs to be taken in the critical region after having made
- // sure that the listener has not been Orphaned, so as to avoid
- // heap-use-after-free issues where `Ref()` is invoked when the ref of
- // tcp_server_ has already reached 0. (Ref() implementation of
- // Chttp2ServerListener is grpc_tcp_server_ref().)
- listener_ref = self->Ref();
- self->connections_.emplace(connection.get(), std::move(connection));
- }
+ // This ref needs to be taken in the critical region after having made
+ // sure that the listener has not been Orphaned, so as to avoid
+ // heap-use-after-free issues where `Ref()` is invoked when the ref of
+ // tcp_server_ has already reached 0. (Ref() implementation of
+ // Chttp2ServerListener is grpc_tcp_server_ref().)
+ listener_ref = self->Ref();
+ self->connections_.emplace(connection.get(), std::move(connection));
}
}
if (connection != nullptr) {
@@ -777,11 +767,11 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
} else {
connection_ref->Start(std::move(listener_ref), tcp, args);
}
- grpc_channel_args_destroy(args);
+ grpc_channel_args_destroy(args_to_destroy);
}
void Chttp2ServerListener::TcpServerShutdownComplete(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
Chttp2ServerListener* self = static_cast<Chttp2ServerListener*>(arg);
self->channelz_listen_socket_.reset();
GRPC_ERROR_UNREF(error);
@@ -822,27 +812,36 @@ void Chttp2ServerListener::Orphan() {
// Chttp2ServerAddPort()
//
-grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
- grpc_channel_args* args,
- Chttp2ServerArgsModifier args_modifier,
- int* port_num) {
+grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
+ grpc_channel_args* args,
+ Chttp2ServerArgsModifier args_modifier,
+ int* port_num) {
+ if (addr == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid address: addr cannot be a nullptr.");
+ }
if (strncmp(addr, "external:", 9) == 0) {
- return grpc_core::Chttp2ServerListener::CreateWithAcceptor(
- server, addr, args, args_modifier);
+ return Chttp2ServerListener::CreateWithAcceptor(server, addr, args,
+ args_modifier);
}
*port_num = -1;
grpc_resolved_addresses* resolved = nullptr;
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
+ TString parsed_addr = URI::PercentDecode(addr);
+ y_absl::string_view parsed_addr_unprefixed{parsed_addr};
// Using lambda to avoid use of goto.
- grpc_error* error = [&]() {
- if (y_absl::StartsWith(addr, kUnixUriPrefix)) {
- error = grpc_resolve_unix_domain_address(
- addr + sizeof(kUnixUriPrefix) - 1, &resolved);
- } else if (y_absl::StartsWith(addr, kUnixAbstractUriPrefix)) {
- error = grpc_resolve_unix_abstract_domain_address(
- addr + sizeof(kUnixAbstractUriPrefix) - 1, &resolved);
+ grpc_error_handle error = [&]() {
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (y_absl::ConsumePrefix(&parsed_addr_unprefixed, kUnixUriPrefix)) {
+ error =
+ grpc_resolve_unix_domain_address(parsed_addr_unprefixed, &resolved);
+ } else if (y_absl::ConsumePrefix(&parsed_addr_unprefixed,
+ kUnixAbstractUriPrefix)) {
+ error = grpc_resolve_unix_abstract_domain_address(parsed_addr_unprefixed,
+ &resolved);
} else {
- error = grpc_blocking_resolve_address(addr, "https", &resolved);
+ error = grpc_blocking_resolve_address(parsed_addr.c_str(), "https",
+ &resolved);
}
if (error != GRPC_ERROR_NONE) return error;
// Create a listener for each resolved address.
@@ -853,9 +852,9 @@ grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
grpc_sockaddr_set_port(&resolved->addrs[i], *port_num);
}
int port_temp = -1;
- error = grpc_core::Chttp2ServerListener::Create(
- server, &resolved->addrs[i], grpc_channel_args_copy(args),
- args_modifier, &port_temp);
+ error = Chttp2ServerListener::Create(server, &resolved->addrs[i],
+ grpc_channel_args_copy(args),
+ args_modifier, &port_temp);
if (error != GRPC_ERROR_NONE) {
error_list.push_back(error);
} else {
@@ -879,13 +878,13 @@ grpc_error* Chttp2ServerAddPort(Server* server, const char* addr,
resolved->naddrs - error_list.size(), resolved->naddrs);
error = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
msg.c_str(), error_list.data(), error_list.size());
- gpr_log(GPR_INFO, "WARNING: %s", grpc_error_string(error));
+ gpr_log(GPR_INFO, "WARNING: %s", grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
// we managed to bind some addresses: continue without error
}
return GRPC_ERROR_NONE;
}(); // lambda end
- for (grpc_error* error : error_list) {
+ for (grpc_error_handle error : error_list) {
GRPC_ERROR_UNREF(error);
}
grpc_channel_args_destroy(args);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
index 10322e9af34..e4e6b7cc978 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/chttp2_server.h
@@ -34,11 +34,11 @@ namespace grpc_core {
// added to the server. Takes ownership of the args. Caller takes ownership of
// returned args. On failure, the error parameter will be set.
using Chttp2ServerArgsModifier =
- std::function<grpc_channel_args*(grpc_channel_args*, grpc_error**)>;
+ std::function<grpc_channel_args*(grpc_channel_args*, grpc_error_handle*)>;
/// Adds a port to \a server. Sets \a port_num to the port number.
/// Takes ownership of \a args.
-grpc_error* Chttp2ServerAddPort(
+grpc_error_handle Chttp2ServerAddPort(
Server* server, const char* addr, grpc_channel_args* args,
Chttp2ServerArgsModifier connection_args_modifier, int* port_num);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
index 3a3d6f371e5..39fa12345da 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
-
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/server/chttp2_server.h"
@@ -30,7 +29,7 @@
namespace {
grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
- grpc_error** /*error*/) {
+ grpc_error_handle* /*error*/) {
return args;
}
@@ -41,14 +40,12 @@ int grpc_server_add_insecure_http2_port(grpc_server* server, const char* addr) {
int port_num = 0;
GRPC_API_TRACE("grpc_server_add_insecure_http2_port(server=%p, addr=%s)", 2,
(server, addr));
- grpc_error* err = grpc_core::Chttp2ServerAddPort(
- server->core_server.get(), addr,
- grpc_channel_args_copy(server->core_server->channel_args()),
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
+ grpc_error_handle err = grpc_core::Chttp2ServerAddPort(
+ core_server, addr, grpc_channel_args_copy(core_server->channel_args()),
ModifyArgsForConnection, &port_num);
if (err != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(err);
- gpr_log(GPR_ERROR, "%s", msg);
-
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
GRPC_ERROR_UNREF(err);
}
return port_num;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
index 43edf6f2aeb..dde878e21e9 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc
@@ -33,6 +33,7 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"
@@ -41,17 +42,18 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
GPR_ASSERT(reserved == nullptr);
grpc_core::ExecCtx exec_ctx;
- grpc_core::Server* core_server = server->core_server.get();
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
const grpc_channel_args* server_args = core_server->channel_args();
TString name = y_absl::StrCat("fd:", fd);
+ auto memory_quota =
+ grpc_core::ResourceQuotaFromChannelArgs(server_args)->memory_quota();
grpc_endpoint* server_endpoint = grpc_tcp_create(
- grpc_fd_create(fd, name.c_str(), true), server_args, name.c_str());
-
+ grpc_fd_create(fd, name.c_str(), true), server_args, name);
grpc_transport* transport = grpc_create_chttp2_transport(
- server_args, server_endpoint, false /* is_client */);
-
- grpc_error* error =
+ server_args, server_endpoint, false /* is_client */
+ );
+ grpc_error_handle error =
core_server->SetupTransport(transport, nullptr, server_args, nullptr);
if (error == GRPC_ERROR_NONE) {
for (grpc_pollset* pollset : core_server->pollsets()) {
@@ -60,7 +62,7 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
grpc_chttp2_transport_start_reading(transport, nullptr, nullptr, nullptr);
} else {
gpr_log(GPR_ERROR, "Failed to create channel: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
grpc_transport_destroy(transport);
}
@@ -68,8 +70,9 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
#else // !GPR_SUPPORT_CHANNELS_FROM_FD
-void grpc_server_add_insecure_channel_from_fd(grpc_server* server,
- void* reserved, int fd) {
+void grpc_server_add_insecure_channel_from_fd(grpc_server* /* server */,
+ void* /* reserved */,
+ int /* fd */) {
GPR_ASSERT(0);
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
index a78332b54e5..91ed32e8521 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc
@@ -27,7 +27,6 @@
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/server/chttp2_server.h"
-
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/handshaker.h"
@@ -40,7 +39,7 @@
namespace {
grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
- grpc_error** error) {
+ grpc_error_handle* error) {
grpc_server_credentials* server_credentials =
grpc_find_server_credentials_in_args(args);
if (server_credentials == nullptr) {
@@ -50,10 +49,9 @@ grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
}
auto security_connector = server_credentials->create_security_connector(args);
if (security_connector == nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("Unable to create secure server with credentials of type ",
- server_credentials->type())
- .c_str());
+ server_credentials->type()));
return args;
}
grpc_arg arg_to_add =
@@ -69,7 +67,7 @@ grpc_channel_args* ModifyArgsForConnection(grpc_channel_args* args,
int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
grpc_server_credentials* creds) {
grpc_core::ExecCtx exec_ctx;
- grpc_error* err = GRPC_ERROR_NONE;
+ grpc_error_handle err = GRPC_ERROR_NONE;
grpc_core::RefCountedPtr<grpc_server_security_connector> sc;
int port_num = 0;
grpc_channel_args* args = nullptr;
@@ -77,6 +75,7 @@ int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
"grpc_server_add_secure_http2_port("
"server=%p, addr=%s, creds=%p)",
3, (server, addr, creds));
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
// Create security context.
if (creds == nullptr) {
err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -93,36 +92,32 @@ int grpc_server_add_secure_http2_port(grpc_server* server, const char* addr,
// rewritten, we would be able to make this workaround go away by removing
// that assumption. As an immediate drawback of this workaround, config
// fetchers need to be registered before adding ports to the server.
- if (server->core_server->config_fetcher() != nullptr) {
+ if (core_server->config_fetcher() != nullptr) {
// Create channel args.
grpc_arg arg_to_add = grpc_server_credentials_to_arg(creds);
- args = grpc_channel_args_copy_and_add(server->core_server->channel_args(),
+ args = grpc_channel_args_copy_and_add(core_server->channel_args(),
&arg_to_add, 1);
} else {
sc = creds->create_security_connector(nullptr);
if (sc == nullptr) {
- err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Unable to create secure server with credentials of type ",
- creds->type())
- .c_str());
+ err = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Unable to create secure server with credentials of type ",
+ creds->type()));
goto done;
}
grpc_arg args_to_add[2];
args_to_add[0] = grpc_server_credentials_to_arg(creds);
args_to_add[1] = grpc_security_connector_to_arg(sc.get());
- args = grpc_channel_args_copy_and_add(server->core_server->channel_args(),
- args_to_add,
- GPR_ARRAY_SIZE(args_to_add));
+ args = grpc_channel_args_copy_and_add(
+ core_server->channel_args(), args_to_add, GPR_ARRAY_SIZE(args_to_add));
}
// Add server port.
- err = grpc_core::Chttp2ServerAddPort(server->core_server.get(), addr, args,
+ err = grpc_core::Chttp2ServerAddPort(core_server, addr, args,
ModifyArgsForConnection, &port_num);
done:
sc.reset(DEBUG_LOCATION, "server");
if (err != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(err);
- gpr_log(GPR_ERROR, "%s", msg);
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
GRPC_ERROR_UNREF(err);
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
index 2906a5d2a05..595210addc8 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.cc
@@ -18,9 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/ext/transport/chttp2/transport/bin_decoder.h"
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -146,7 +148,7 @@ bool grpc_base64_decode_partial(struct grpc_base64_decode_context* ctx) {
switch (input_tail) {
case 3:
ctx->output_cur[1] = COMPOSE_OUTPUT_BYTE_1(ctx->input_cur);
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 2:
ctx->output_cur[0] = COMPOSE_OUTPUT_BYTE_0(ctx->input_cur);
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
index 1cbca033a1f..a2d614207f9 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
#include <stdbool.h>
+#include <grpc/slice.h>
+
struct grpc_base64_decode_context {
/* input/output: */
const uint8_t* input_cur;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
index ba39bbdbe33..cd92f726aa4 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.cc
@@ -23,6 +23,7 @@
#include <string.h>
#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/huffsyms.h"
static const char alphabet[] =
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index ebb5e944d31..19ff7482cc5 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -18,18 +18,18 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
#include "y_absl/strings/str_format.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
#include "src/core/ext/transport/chttp2/transport/context_list.h"
#include "src/core/ext/transport/chttp2/transport/frame_data.h"
@@ -46,6 +46,8 @@
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/trace.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/error_utils.h"
@@ -100,23 +102,23 @@ grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_refcount(false,
"chttp2_refcount");
// forward declarations of various callbacks that we'll build closures around
-static void write_action_begin_locked(void* t, grpc_error* error);
-static void write_action(void* t, grpc_error* error);
-static void write_action_end(void* t, grpc_error* error);
-static void write_action_end_locked(void* t, grpc_error* error);
+static void write_action_begin_locked(void* t, grpc_error_handle error);
+static void write_action(void* t, grpc_error_handle error);
+static void write_action_end(void* t, grpc_error_handle error);
+static void write_action_end_locked(void* t, grpc_error_handle error);
-static void read_action(void* t, grpc_error* error);
-static void read_action_locked(void* t, grpc_error* error);
+static void read_action(void* t, grpc_error_handle error);
+static void read_action_locked(void* t, grpc_error_handle error);
static void continue_read_action_locked(grpc_chttp2_transport* t);
-static void complete_fetch(void* gs, grpc_error* error);
-static void complete_fetch_locked(void* gs, grpc_error* error);
+static void complete_fetch(void* gs, grpc_error_handle error);
+static void complete_fetch_locked(void* gs, grpc_error_handle error);
// Set a transport level setting, and push it to our peer
static void queue_setting_update(grpc_chttp2_transport* t,
grpc_chttp2_setting_id id, uint32_t value);
static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_error* error);
+ grpc_error_handle error);
// Start new streams that have been created if we can
static void maybe_start_some_streams(grpc_chttp2_transport* t);
@@ -126,40 +128,41 @@ static void connectivity_state_set(grpc_chttp2_transport* t,
const y_absl::Status& status,
const char* reason);
-static void benign_reclaimer(void* arg, grpc_error* error);
-static void destructive_reclaimer(void* arg, grpc_error* error);
-static void benign_reclaimer_locked(void* arg, grpc_error* error);
-static void destructive_reclaimer_locked(void* arg, grpc_error* error);
+static void benign_reclaimer_locked(void* arg, grpc_error_handle error);
+static void destructive_reclaimer_locked(void* arg, grpc_error_handle error);
static void post_benign_reclaimer(grpc_chttp2_transport* t);
static void post_destructive_reclaimer(grpc_chttp2_transport* t);
-static void close_transport_locked(grpc_chttp2_transport* t, grpc_error* error);
-static void end_all_the_calls(grpc_chttp2_transport* t, grpc_error* error);
-
-static void start_bdp_ping(void* tp, grpc_error* error);
-static void finish_bdp_ping(void* tp, grpc_error* error);
-static void start_bdp_ping_locked(void* tp, grpc_error* error);
-static void finish_bdp_ping_locked(void* tp, grpc_error* error);
-static void next_bdp_ping_timer_expired(void* tp, grpc_error* error);
-static void next_bdp_ping_timer_expired_locked(void* tp, grpc_error* error);
-
-static void cancel_pings(grpc_chttp2_transport* t, grpc_error* error);
+static void close_transport_locked(grpc_chttp2_transport* t,
+ grpc_error_handle error);
+static void end_all_the_calls(grpc_chttp2_transport* t,
+ grpc_error_handle error);
+
+static void start_bdp_ping(void* tp, grpc_error_handle error);
+static void finish_bdp_ping(void* tp, grpc_error_handle error);
+static void start_bdp_ping_locked(void* tp, grpc_error_handle error);
+static void finish_bdp_ping_locked(void* tp, grpc_error_handle error);
+static void next_bdp_ping_timer_expired(void* tp, grpc_error_handle error);
+static void next_bdp_ping_timer_expired_locked(void* tp,
+ grpc_error_handle error);
+
+static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error);
static void send_ping_locked(grpc_chttp2_transport* t,
grpc_closure* on_initiate, grpc_closure* on_ack);
-static void retry_initiate_ping_locked(void* tp, grpc_error* error);
+static void retry_initiate_ping_locked(void* tp, grpc_error_handle error);
// keepalive-relevant functions
-static void init_keepalive_ping(void* arg, grpc_error* error);
-static void init_keepalive_ping_locked(void* arg, grpc_error* error);
-static void start_keepalive_ping(void* arg, grpc_error* error);
-static void finish_keepalive_ping(void* arg, grpc_error* error);
-static void start_keepalive_ping_locked(void* arg, grpc_error* error);
-static void finish_keepalive_ping_locked(void* arg, grpc_error* error);
-static void keepalive_watchdog_fired(void* arg, grpc_error* error);
-static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error);
+static void init_keepalive_ping(void* arg, grpc_error_handle error);
+static void init_keepalive_ping_locked(void* arg, grpc_error_handle error);
+static void start_keepalive_ping(void* arg, grpc_error_handle error);
+static void finish_keepalive_ping(void* arg, grpc_error_handle error);
+static void start_keepalive_ping_locked(void* arg, grpc_error_handle error);
+static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error);
+static void keepalive_watchdog_fired(void* arg, grpc_error_handle error);
+static void keepalive_watchdog_fired_locked(void* arg, grpc_error_handle error);
-static void reset_byte_stream(void* arg, grpc_error* error);
+static void reset_byte_stream(void* arg, grpc_error_handle error);
// Flow control default enabled. Can be disabled by setting
// GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
@@ -201,9 +204,8 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
grpc_slice_buffer_destroy_internal(&qbuf);
grpc_slice_buffer_destroy_internal(&outbuf);
- grpc_chttp2_hpack_compressor_destroy(&hpack_compressor);
- grpc_error* error =
+ grpc_error_handle error =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed");
// ContextList::Execute follows semantics of a callback function and does not
// take a ref on error
@@ -212,7 +214,6 @@ grpc_chttp2_transport::~grpc_chttp2_transport() {
cl = nullptr;
grpc_slice_buffer_destroy_internal(&read_buffer);
- grpc_chttp2_hpack_parser_destroy(&hpack_parser);
grpc_chttp2_goaway_parser_destroy(&goaway_parser);
for (i = 0; i < STREAM_LIST_COUNT; i++) {
@@ -278,8 +279,7 @@ static bool read_channel_args(grpc_chttp2_transport* t,
const int value =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
if (value >= 0) {
- grpc_chttp2_hpack_compressor_set_max_usable_size(
- &t->hpack_compressor, static_cast<uint32_t>(value));
+ t->hpack_compressor.SetMaxUsableSize(value);
}
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA)) {
@@ -442,14 +442,18 @@ static void init_keepalive_pings_if_enabled(grpc_chttp2_transport* t) {
}
grpc_chttp2_transport::grpc_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user)
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client)
: refs(1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_refcount)
? "chttp2_refcount"
: nullptr),
ep(ep),
peer_string(grpc_endpoint_get_peer(ep)),
- resource_user(resource_user),
+ memory_owner(grpc_core::ResourceQuotaFromChannelArgs(channel_args)
+ ->memory_quota()
+ ->CreateMemoryOwner(y_absl::StrCat(
+ grpc_endpoint_get_peer(ep), ":client_transport"))),
+ self_reservation(
+ memory_owner.MakeReservation(sizeof(grpc_chttp2_transport))),
combiner(grpc_combiner_create()),
state_tracker(is_client ? "client_transport" : "server_transport",
GRPC_CHANNEL_READY),
@@ -472,7 +476,6 @@ grpc_chttp2_transport::grpc_chttp2_transport(
grpc_slice_buffer_add(&outbuf, grpc_slice_from_copied_string(
GRPC_CHTTP2_CLIENT_CONNECT_STRING));
}
- grpc_chttp2_hpack_compressor_init(&hpack_compressor);
grpc_slice_buffer_init(&qbuf);
// copy in initial settings to all setting sets
size_t i;
@@ -482,7 +485,6 @@ grpc_chttp2_transport::grpc_chttp2_transport(
settings[j][i] = grpc_chttp2_settings_parameters[i].default_value;
}
}
- grpc_chttp2_hpack_parser_init(&hpack_parser);
grpc_chttp2_goaway_parser_init(&goaway_parser);
// configure http2 the way we like it
@@ -534,13 +536,14 @@ grpc_chttp2_transport::grpc_chttp2_transport(
}
}
-static void destroy_transport_locked(void* tp, grpc_error* /*error*/) {
+static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->destroying = 1;
close_transport_locked(
t, grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Transport destroyed"),
GRPC_ERROR_INT_OCCURRED_DURING_WRITE, t->write_state));
+ t->memory_owner.Reset();
// Must be the last line.
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destroy");
}
@@ -552,7 +555,7 @@ static void destroy_transport(grpc_transport* gt) {
}
static void close_transport_locked(grpc_chttp2_transport* t,
- grpc_error* error) {
+ grpc_error_handle error) {
end_all_the_calls(t, GRPC_ERROR_REF(error));
cancel_pings(t, GRPC_ERROR_REF(error));
if (t->closed_with_error == GRPC_ERROR_NONE) {
@@ -561,7 +564,7 @@ static void close_transport_locked(grpc_chttp2_transport* t,
GRPC_STATUS_UNAVAILABLE);
}
if (t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE) {
- if (t->close_transport_on_writes_finished == nullptr) {
+ if (t->close_transport_on_writes_finished == GRPC_ERROR_NONE) {
t->close_transport_on_writes_finished =
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Delayed close due to in-progress write");
@@ -646,8 +649,12 @@ grpc_chttp2_stream::grpc_chttp2_stream(grpc_chttp2_transport* t,
: t(t),
refcount(refcount),
reffer(this),
- metadata_buffer{grpc_chttp2_incoming_metadata_buffer(arena),
- grpc_chttp2_incoming_metadata_buffer(arena)} {
+ stream_reservation(t->memory_owner.MakeReservation(
+ grpc_core::kResourceQuotaCallSize)), // TODO(ctiller): sizeof(*this),
+ // or better, move allocation to
+ // memory quota.
+ initial_metadata_buffer(arena),
+ trailing_metadata_buffer(arena) {
if (server_data) {
id = static_cast<uint32_t>(reinterpret_cast<uintptr_t>(server_data));
*t->accepting_stream = this;
@@ -711,13 +718,7 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
GRPC_ERROR_UNREF(read_closed_error);
GRPC_ERROR_UNREF(write_closed_error);
GRPC_ERROR_UNREF(byte_stream_error);
-
flow_control.Destroy();
-
- if (t->resource_user != nullptr) {
- grpc_resource_user_free(t->resource_user, GRPC_RESOURCE_QUOTA_CALL_SIZE);
- }
-
GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, GRPC_ERROR_NONE);
}
@@ -731,7 +732,7 @@ static int init_stream(grpc_transport* gt, grpc_stream* gs,
return 0;
}
-static void destroy_stream_locked(void* sp, grpc_error* /*error*/) {
+static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
GPR_TIMER_SCOPE("destroy_stream", 0);
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(sp);
s->~grpc_chttp2_stream();
@@ -766,18 +767,6 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
if (t->accept_stream_cb == nullptr) {
return nullptr;
}
- // Don't accept the stream if memory quota doesn't allow. Note that we should
- // simply refuse the stream here instead of canceling the stream after it's
- // accepted since the latter will create the call which costs much memory.
- if (t->resource_user != nullptr &&
- !grpc_resource_user_safe_alloc(t->resource_user,
- GRPC_RESOURCE_QUOTA_CALL_SIZE)) {
- gpr_log(GPR_ERROR, "Memory exhausted, rejecting the stream.");
- grpc_chttp2_add_rst_stream_to_next_write(t, id, GRPC_HTTP2_REFUSED_STREAM,
- nullptr);
- grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_RST_STREAM);
- return nullptr;
- }
grpc_chttp2_stream* accepting = nullptr;
GPR_ASSERT(t->accepting_stream == nullptr);
t->accepting_stream = &accepting;
@@ -818,9 +807,9 @@ static void set_write_state(grpc_chttp2_transport* t,
// from peer while we had some pending writes)
if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
- if (t->close_transport_on_writes_finished != nullptr) {
- grpc_error* err = t->close_transport_on_writes_finished;
- t->close_transport_on_writes_finished = nullptr;
+ if (t->close_transport_on_writes_finished != GRPC_ERROR_NONE) {
+ grpc_error_handle err = t->close_transport_on_writes_finished;
+ t->close_transport_on_writes_finished = GRPC_ERROR_NONE;
close_transport_locked(t, err);
}
}
@@ -951,7 +940,8 @@ static const char* begin_writing_desc(bool partial) {
}
}
-static void write_action_begin_locked(void* gt, grpc_error* /*error_ignored*/) {
+static void write_action_begin_locked(void* gt,
+ grpc_error_handle /*error_ignored*/) {
GPR_TIMER_SCOPE("write_action_begin_locked", 0);
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
GPR_ASSERT(t->write_state != GRPC_CHTTP2_WRITE_STATE_IDLE);
@@ -990,7 +980,7 @@ static void write_action_begin_locked(void* gt, grpc_error* /*error_ignored*/) {
}
}
-static void write_action(void* gt, grpc_error* /*error*/) {
+static void write_action(void* gt, grpc_error_handle /*error*/) {
GPR_TIMER_SCOPE("write_action", 0);
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(gt);
void* cl = t->cl;
@@ -1002,7 +992,7 @@ static void write_action(void* gt, grpc_error* /*error*/) {
cl);
}
-static void write_action_end(void* tp, grpc_error* error) {
+static void write_action_end(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->write_action_end_locked,
write_action_end_locked, t, nullptr),
@@ -1011,7 +1001,7 @@ static void write_action_end(void* tp, grpc_error* error) {
// Callback from the grpc_endpoint after bytes have been written by calling
// sendmsg
-static void write_action_end_locked(void* tp, grpc_error* error) {
+static void write_action_end_locked(void* tp, grpc_error_handle error) {
GPR_TIMER_SCOPE("terminate_writing_with_lock", 0);
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
@@ -1066,7 +1056,7 @@ static void queue_setting_update(grpc_chttp2_transport* t,
grpc_chttp2_setting_id id, uint32_t value) {
const grpc_chttp2_setting_parameters* sp =
&grpc_chttp2_settings_parameters[id];
- uint32_t use_value = GPR_CLAMP(value, sp->min_value, sp->max_value);
+ uint32_t use_value = grpc_core::Clamp(value, sp->min_value, sp->max_value);
if (use_value != value) {
gpr_log(GPR_INFO, "Requested parameter %s clamped from %d to %d", sp->name,
value, use_value);
@@ -1080,7 +1070,7 @@ static void queue_setting_update(grpc_chttp2_transport* t,
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
- const grpc_slice& goaway_text) {
+ y_absl::string_view goaway_text) {
// Discard the error from a previous goaway frame (if any)
if (t->goaway_error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(t->goaway_error);
@@ -1100,7 +1090,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
// received a GOAWAY with a non NO_ERROR code.
if (goaway_error != GRPC_HTTP2_NO_ERROR) {
gpr_log(GPR_INFO, "%s: Got goaway [%d] err=%s", t->peer_string.c_str(),
- goaway_error, grpc_error_string(t->goaway_error));
+ goaway_error, grpc_error_std_string(t->goaway_error).c_str());
}
y_absl::Status status = grpc_error_to_absl_status(t->goaway_error);
// When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug
@@ -1109,7 +1099,7 @@ void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
// for new connections on that channel.
if (GPR_UNLIKELY(t->is_client &&
goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM &&
- grpc_slice_str_cmp(goaway_text, "too_many_pings") == 0)) {
+ goaway_text == "too_many_pings")) {
gpr_log(GPR_ERROR,
"Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug "
"data equal to \"too_many_pings\"");
@@ -1206,7 +1196,8 @@ static void null_then_sched_closure(grpc_closure** closure) {
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
grpc_chttp2_stream* /*s*/,
grpc_closure** pclosure,
- grpc_error* error, const char* desc) {
+ grpc_error_handle error,
+ const char* desc) {
grpc_closure* closure = *pclosure;
*pclosure = nullptr;
if (closure == nullptr) {
@@ -1215,7 +1206,6 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
}
closure->next_data.scratch -= CLOSURE_BARRIER_FIRST_REF_BIT;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- const char* errstr = grpc_error_string(error);
gpr_log(
GPR_INFO,
"complete_closure_step: t=%p %p refs=%d flags=0x%04x desc=%s err=%s "
@@ -1225,15 +1215,16 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
CLOSURE_BARRIER_FIRST_REF_BIT),
static_cast<int>(closure->next_data.scratch %
CLOSURE_BARRIER_FIRST_REF_BIT),
- desc, errstr, write_state_name(t->write_state));
+ desc, grpc_error_std_string(error).c_str(),
+ write_state_name(t->write_state));
}
if (error != GRPC_ERROR_NONE) {
if (closure->error_data.error == GRPC_ERROR_NONE) {
closure->error_data.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Error in HTTP transport completing operation");
- closure->error_data.error = grpc_error_set_str(
- closure->error_data.error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(t->peer_string.c_str()));
+ closure->error_data.error =
+ grpc_error_set_str(closure->error_data.error,
+ GRPC_ERROR_STR_TARGET_ADDRESS, t->peer_string);
}
closure->error_data.error =
grpc_error_add_child(closure->error_data.error, error);
@@ -1253,9 +1244,10 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
}
static bool contains_non_ok_status(grpc_metadata_batch* batch) {
- if (batch->idx.named.grpc_status != nullptr) {
- return !grpc_mdelem_static_value_eq(batch->idx.named.grpc_status->md,
- GRPC_MDELEM_GRPC_STATUS_0);
+ if (batch->legacy_index()->named.grpc_status != nullptr) {
+ return !grpc_mdelem_static_value_eq(
+ batch->legacy_index()->named.grpc_status->md,
+ GRPC_MDELEM_GRPC_STATUS_0);
}
return false;
}
@@ -1283,7 +1275,6 @@ static void continue_fetching_send_locked(grpc_chttp2_transport* t,
if (s->fetching_send_message == nullptr) {
// Stream was cancelled before message fetch completed
abort(); /* TODO(ctiller): what cleanup here? */
- return; /* early out */
}
if (s->fetched_send_message_length == s->fetching_send_message->length()) {
int64_t notify_offset = s->next_message_end_offset;
@@ -1314,7 +1305,8 @@ static void continue_fetching_send_locked(grpc_chttp2_transport* t,
UINT32_MAX, GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
::complete_fetch, s,
grpc_schedule_on_exec_ctx))) {
- grpc_error* error = s->fetching_send_message->Pull(&s->fetching_slice);
+ grpc_error_handle error =
+ s->fetching_send_message->Pull(&s->fetching_slice);
if (error != GRPC_ERROR_NONE) {
s->fetching_send_message.reset();
grpc_chttp2_cancel_stream(t, s, error);
@@ -1325,14 +1317,14 @@ static void continue_fetching_send_locked(grpc_chttp2_transport* t,
}
}
-static void complete_fetch(void* gs, grpc_error* error) {
+static void complete_fetch(void* gs, grpc_error_handle error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
s->t->combiner->Run(GRPC_CLOSURE_INIT(&s->complete_fetch_locked,
::complete_fetch_locked, s, nullptr),
GRPC_ERROR_REF(error));
}
-static void complete_fetch_locked(void* gs, grpc_error* error) {
+static void complete_fetch_locked(void* gs, grpc_error_handle error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(gs);
grpc_chttp2_transport* t = s->t;
if (error == GRPC_ERROR_NONE) {
@@ -1350,19 +1342,18 @@ static void complete_fetch_locked(void* gs, grpc_error* error) {
static void log_metadata(const grpc_metadata_batch* md_batch, uint32_t id,
bool is_client, bool is_initial) {
- for (grpc_linked_mdelem* md = md_batch->list.head; md != nullptr;
- md = md->next) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
+ md_batch->ForEach([=](grpc_mdelem md) {
+ char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
+ char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md));
gpr_log(GPR_INFO, "HTTP:%d:%s:%s: %s: %s", id, is_initial ? "HDR" : "TRL",
is_client ? "CLI" : "SVR", key, value);
gpr_free(key);
gpr_free(value);
- }
+ });
}
static void perform_stream_op_locked(void* stream_op,
- grpc_error* /*error_ignored*/) {
+ grpc_error_handle /*error_ignored*/) {
GPR_TIMER_SCOPE("perform_stream_op_locked", 0);
grpc_transport_stream_op_batch* op =
@@ -1412,12 +1403,13 @@ static void perform_stream_op_locked(void* stream_op,
on_complete->next_data.scratch |= CLOSURE_BARRIER_MAY_COVER_WRITE;
// Identify stream compression
- if (op_payload->send_initial_metadata.send_initial_metadata->idx.named
- .content_encoding == nullptr ||
+ if (op_payload->send_initial_metadata.send_initial_metadata->legacy_index()
+ ->named.content_encoding == nullptr ||
grpc_stream_compression_method_parse(
GRPC_MDVALUE(
- op_payload->send_initial_metadata.send_initial_metadata->idx
- .named.content_encoding->md),
+ op_payload->send_initial_metadata.send_initial_metadata
+ ->legacy_index()
+ ->named.content_encoding->md),
true, &s->stream_compression_method) == 0) {
s->stream_compression_method = GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS;
}
@@ -1431,7 +1423,10 @@ static void perform_stream_op_locked(void* stream_op,
s->send_initial_metadata =
op_payload->send_initial_metadata.send_initial_metadata;
if (t->is_client) {
- s->deadline = GPR_MIN(s->deadline, s->send_initial_metadata->deadline);
+ s->deadline = std::min(
+ s->deadline,
+ s->send_initial_metadata->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(GRPC_MILLIS_INF_FUTURE));
}
if (contains_non_ok_status(s->send_initial_metadata)) {
s->seen_error = true;
@@ -1537,8 +1532,7 @@ static void perform_stream_op_locked(void* stream_op,
s->sent_trailing_metadata_op = nullptr;
grpc_chttp2_complete_closure_step(
t, s, &s->send_trailing_metadata_finished,
- grpc_metadata_batch_is_empty(
- op->payload->send_trailing_metadata.send_trailing_metadata)
+ op->payload->send_trailing_metadata.send_trailing_metadata->empty()
? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Attempt to send trailing metadata after "
@@ -1576,6 +1570,8 @@ static void perform_stream_op_locked(void* stream_op,
GPR_ASSERT(!s->pending_byte_stream);
s->recv_message_ready = op_payload->recv_message.recv_message_ready;
s->recv_message = op_payload->recv_message.recv_message;
+ s->call_failed_before_recv_message =
+ op_payload->recv_message.call_failed_before_recv_message;
if (s->id != 0) {
if (!s->read_closed) {
before = s->frame_storage.length +
@@ -1585,8 +1581,7 @@ static void perform_stream_op_locked(void* stream_op,
grpc_chttp2_maybe_complete_recv_message(t, s);
if (s->id != 0) {
if (!s->read_closed && s->frame_storage.length == 0) {
- size_t after = s->frame_storage.length +
- s->unprocessed_incoming_frames_buffer_cached_length;
+ size_t after = s->unprocessed_incoming_frames_buffer_cached_length;
s->flow_control->IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
before - after);
grpc_chttp2_act_on_flowctl_action(s->flow_control->MakeAction(), t, s);
@@ -1623,14 +1618,14 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (!t->is_client) {
if (op->send_initial_metadata) {
- grpc_millis deadline =
- op->payload->send_initial_metadata.send_initial_metadata->deadline;
- GPR_ASSERT(deadline == GRPC_MILLIS_INF_FUTURE);
+ GPR_ASSERT(!op->payload->send_initial_metadata.send_initial_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .has_value());
}
if (op->send_trailing_metadata) {
- grpc_millis deadline =
- op->payload->send_trailing_metadata.send_trailing_metadata->deadline;
- GPR_ASSERT(deadline == GRPC_MILLIS_INF_FUTURE);
+ GPR_ASSERT(!op->payload->send_trailing_metadata.send_trailing_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .has_value());
}
}
@@ -1646,7 +1641,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
GRPC_ERROR_NONE);
}
-static void cancel_pings(grpc_chttp2_transport* t, grpc_error* error) {
+static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
// callback remaining pings: they're not allowed to call into the transport,
// and maybe they hold resources that need to be freed
grpc_chttp2_ping_queue* pq = &t->ping_queue;
@@ -1713,14 +1708,14 @@ static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
GRPC_ERROR_NONE);
}
-void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error* error) {
+void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->retry_initiate_ping_locked,
retry_initiate_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void retry_initiate_ping_locked(void* tp, grpc_error* error) {
+static void retry_initiate_ping_locked(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->ping_state.is_delayed_ping_timer_set = false;
if (error == GRPC_ERROR_NONE) {
@@ -1743,18 +1738,18 @@ void grpc_chttp2_ack_ping(grpc_chttp2_transport* t, uint64_t id) {
}
}
-static void send_goaway(grpc_chttp2_transport* t, grpc_error* error) {
+static void send_goaway(grpc_chttp2_transport* t, grpc_error_handle error) {
// We want to log this irrespective of whether http tracing is enabled
- gpr_log(GPR_INFO, "%s: Sending goaway err=%s", t->peer_string.c_str(),
- grpc_error_string(error));
+ gpr_log(GPR_DEBUG, "%s: Sending goaway err=%s", t->peer_string.c_str(),
+ grpc_error_std_string(error).c_str());
t->sent_goaway_state = GRPC_CHTTP2_GOAWAY_SEND_SCHEDULED;
grpc_http2_error_code http_error;
- grpc_slice slice;
- grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, nullptr, &slice,
+ TString message;
+ grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, nullptr, &message,
&http_error, nullptr);
- grpc_chttp2_goaway_append(t->last_new_stream_id,
- static_cast<uint32_t>(http_error),
- grpc_slice_ref_internal(slice), &t->qbuf);
+ grpc_chttp2_goaway_append(
+ t->last_new_stream_id, static_cast<uint32_t>(http_error),
+ grpc_slice_from_cpp_string(std::move(message)), &t->qbuf);
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_GOAWAY_SENT);
GRPC_ERROR_UNREF(error);
}
@@ -1784,12 +1779,12 @@ void grpc_chttp2_reset_ping_clock(grpc_chttp2_transport* t) {
}
static void perform_transport_op_locked(void* stream_op,
- grpc_error* /*error_ignored*/) {
+ grpc_error_handle /*error_ignored*/) {
grpc_transport_op* op = static_cast<grpc_transport_op*>(stream_op);
grpc_chttp2_transport* t =
static_cast<grpc_chttp2_transport*>(op->handler_private.extra_arg);
- if (op->goaway_error) {
+ if (op->goaway_error != GRPC_ERROR_NONE) {
send_goaway(t, op->goaway_error);
}
@@ -1856,15 +1851,14 @@ void grpc_chttp2_maybe_complete_recv_initial_metadata(
&s->unprocessed_incoming_frames_buffer);
}
}
- grpc_chttp2_incoming_metadata_buffer_publish(&s->metadata_buffer[0],
- s->recv_initial_metadata);
+ *s->recv_initial_metadata = std::move(s->initial_metadata_buffer);
null_then_sched_closure(&s->recv_initial_metadata_ready);
}
}
void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
grpc_chttp2_stream* s) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (s->recv_message_ready != nullptr) {
*s->recv_message = nullptr;
if (s->final_metadata_requested && s->seen_error) {
@@ -1941,6 +1935,10 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* /*t*/,
null_then_sched_closure(&s->recv_message_ready);
} else if (s->published_metadata[1] != GRPC_METADATA_NOT_PUBLISHED) {
*s->recv_message = nullptr;
+ if (s->call_failed_before_recv_message != nullptr) {
+ *s->call_failed_before_recv_message =
+ (s->published_metadata[1] != GRPC_METADATA_PUBLISHED_AT_CLOSE);
+ }
null_then_sched_closure(&s->recv_message_ready);
}
GRPC_ERROR_UNREF(error);
@@ -1969,7 +1967,8 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS) {
grpc_slice_buffer_move_first(
&s->frame_storage,
- GPR_MIN(s->frame_storage.length, GRPC_HEADER_SIZE_IN_BYTES),
+ std::min(s->frame_storage.length,
+ size_t(GRPC_HEADER_SIZE_IN_BYTES)),
&s->unprocessed_incoming_frames_buffer);
if (s->unprocessed_incoming_frames_buffer.length > 0) {
s->unprocessed_incoming_frames_decompressed = true;
@@ -2006,15 +2005,14 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
s->recv_trailing_metadata_finished != nullptr) {
grpc_transport_move_stats(&s->stats, s->collecting_stats);
s->collecting_stats = nullptr;
- grpc_chttp2_incoming_metadata_buffer_publish(&s->metadata_buffer[1],
- s->recv_trailing_metadata);
+ *s->recv_trailing_metadata = std::move(s->trailing_metadata_buffer);
null_then_sched_closure(&s->recv_trailing_metadata_finished);
}
}
}
static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(
grpc_chttp2_stream_map_delete(&t->stream_map, id));
GPR_DEBUG_ASSERT(s);
@@ -2057,7 +2055,7 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
}
void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_error* due_to_error) {
+ grpc_error_handle due_to_error) {
if (!t->is_client && !s->sent_trailing_metadata &&
grpc_error_has_clear_grpc_status(due_to_error)) {
close_from_api(t, s, due_to_error);
@@ -2081,10 +2079,11 @@ void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
}
void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_status_code status;
- grpc_slice slice;
- grpc_error_get_status(error, s->deadline, &status, &slice, nullptr, nullptr);
+ TString message;
+ grpc_error_get_status(error, s->deadline, &status, &message, nullptr,
+ nullptr);
if (status != GRPC_STATUS_OK) {
s->seen_error = true;
}
@@ -2099,17 +2098,13 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
char status_string[GPR_LTOA_MIN_BUFSIZE];
gpr_ltoa(status, status_string);
GRPC_LOG_IF_ERROR("add_status",
- grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- &s->metadata_buffer[1],
- grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_STATUS,
- grpc_core::UnmanagedMemorySlice(status_string))));
- if (!GRPC_SLICE_IS_EMPTY(slice)) {
- GRPC_LOG_IF_ERROR(
- "add_status_message",
- grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- &s->metadata_buffer[1],
- grpc_mdelem_create(GRPC_MDSTR_GRPC_MESSAGE, slice, nullptr)));
+ s->trailing_metadata_buffer.ReplaceOrAppend(
+ GRPC_MDSTR_GRPC_STATUS,
+ grpc_core::UnmanagedMemorySlice(status_string)));
+ if (!message.empty()) {
+ s->trailing_metadata_buffer.Set(
+ grpc_core::GrpcMessageMetadata(),
+ grpc_core::Slice::FromCopiedBuffer(message));
}
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);
@@ -2118,7 +2113,8 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
GRPC_ERROR_UNREF(error);
}
-static void add_error(grpc_error* error, grpc_error** refs, size_t* nrefs) {
+static void add_error(grpc_error_handle error, grpc_error_handle* refs,
+ size_t* nrefs) {
if (error == GRPC_ERROR_NONE) return;
for (size_t i = 0; i < *nrefs; i++) {
if (error == refs[i]) {
@@ -2129,14 +2125,15 @@ static void add_error(grpc_error* error, grpc_error** refs, size_t* nrefs) {
++*nrefs;
}
-static grpc_error* removal_error(grpc_error* extra_error, grpc_chttp2_stream* s,
- const char* main_error_msg) {
- grpc_error* refs[3];
+static grpc_error_handle removal_error(grpc_error_handle extra_error,
+ grpc_chttp2_stream* s,
+ const char* main_error_msg) {
+ grpc_error_handle refs[3];
size_t nrefs = 0;
add_error(s->read_closed_error, refs, &nrefs);
add_error(s->write_closed_error, refs, &nrefs);
add_error(extra_error, refs, &nrefs);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (nrefs > 0) {
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(main_error_msg,
refs, nrefs);
@@ -2146,7 +2143,8 @@ static grpc_error* removal_error(grpc_error* extra_error, grpc_chttp2_stream* s,
}
static void flush_write_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_chttp2_write_cb** list, grpc_error* error) {
+ grpc_chttp2_write_cb** list,
+ grpc_error_handle error) {
while (*list) {
grpc_chttp2_write_cb* cb = *list;
*list = cb->next;
@@ -2159,7 +2157,8 @@ static void flush_write_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
}
void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
- grpc_chttp2_stream* s, grpc_error* error) {
+ grpc_chttp2_stream* s,
+ grpc_error_handle error) {
error =
removal_error(error, s, "Pending writes failed due to stream closure");
s->send_initial_metadata = nullptr;
@@ -2183,10 +2182,10 @@ void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
grpc_chttp2_stream* s, int close_reads,
- int close_writes, grpc_error* error) {
+ int close_writes, grpc_error_handle error) {
if (s->read_closed && s->write_closed) {
// already closed, but we should still fake the status if needed.
- grpc_error* overall_error = removal_error(error, s, "Stream removed");
+ grpc_error_handle overall_error = removal_error(error, s, "Stream removed");
if (overall_error != GRPC_ERROR_NONE) {
grpc_chttp2_fake_status(t, s, overall_error);
}
@@ -2207,7 +2206,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
}
if (s->read_closed && s->write_closed) {
became_closed = true;
- grpc_error* overall_error =
+ grpc_error_handle overall_error =
removal_error(GRPC_ERROR_REF(error), s, "Stream removed");
if (s->id != 0) {
remove_stream(t, s->id, GRPC_ERROR_REF(overall_error));
@@ -2236,7 +2235,7 @@ void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
}
static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_slice hdr;
grpc_slice status_hdr;
grpc_slice http_status_hdr;
@@ -2245,8 +2244,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
uint8_t* p;
uint32_t len = 0;
grpc_status_code grpc_status;
- grpc_slice slice;
- grpc_error_get_status(error, s->deadline, &grpc_status, &slice, nullptr,
+ TString message;
+ grpc_error_get_status(error, s->deadline, &grpc_status, &message, nullptr,
nullptr);
GPR_ASSERT(grpc_status >= 0 && (int)grpc_status < 100);
@@ -2339,10 +2338,10 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
GPR_ASSERT(p == GRPC_SLICE_END_PTR(status_hdr));
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(status_hdr);
- size_t msg_len = GRPC_SLICE_LENGTH(slice);
+ size_t msg_len = message.length();
GPR_ASSERT(msg_len <= UINT32_MAX);
- uint32_t msg_len_len = GRPC_CHTTP2_VARINT_LENGTH((uint32_t)msg_len, 1);
- message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_len);
+ grpc_core::VarintWriter<1> msg_len_writer(msg_len);
+ message_pfx = GRPC_SLICE_MALLOC(14 + msg_len_writer.length());
p = GRPC_SLICE_START_PTR(message_pfx);
*p++ = 0x00; /* literal header, not indexed */
*p++ = 12; /* len(grpc-message) */
@@ -2358,8 +2357,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
*p++ = 'a';
*p++ = 'g';
*p++ = 'e';
- GRPC_CHTTP2_WRITE_VARINT((uint32_t)msg_len, 1, 0, p, (uint32_t)msg_len_len);
- p += msg_len_len;
+ msg_len_writer.Write(0, p);
+ p += msg_len_writer.length();
GPR_ASSERT(p == GRPC_SLICE_END_PTR(message_pfx));
len += static_cast<uint32_t> GRPC_SLICE_LENGTH(message_pfx);
len += static_cast<uint32_t>(msg_len);
@@ -2384,7 +2383,8 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
}
grpc_slice_buffer_add(&t->qbuf, status_hdr);
grpc_slice_buffer_add(&t->qbuf, message_pfx);
- grpc_slice_buffer_add(&t->qbuf, grpc_slice_ref_internal(slice));
+ grpc_slice_buffer_add(&t->qbuf,
+ grpc_slice_from_cpp_string(std::move(message)));
grpc_chttp2_reset_ping_clock(t);
grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR,
&s->stats.outgoing);
@@ -2394,7 +2394,7 @@ static void close_from_api(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
}
struct cancel_stream_cb_args {
- grpc_error* error;
+ grpc_error_handle error;
grpc_chttp2_transport* t;
};
@@ -2404,7 +2404,8 @@ static void cancel_stream_cb(void* user_data, uint32_t /*key*/, void* stream) {
grpc_chttp2_cancel_stream(args->t, s, GRPC_ERROR_REF(args->error));
}
-static void end_all_the_calls(grpc_chttp2_transport* t, grpc_error* error) {
+static void end_all_the_calls(grpc_chttp2_transport* t,
+ grpc_error_handle error) {
intptr_t http2_error;
// If there is no explicit grpc or HTTP/2 error, set to UNAVAILABLE on server.
if (!t->is_client && !grpc_error_has_clear_grpc_status(error) &&
@@ -2430,7 +2431,7 @@ static void WithUrgency(grpc_chttp2_transport* t,
break;
case grpc_core::chttp2::FlowControlAction::Urgency::UPDATE_IMMEDIATELY:
grpc_chttp2_initiate_write(t, reason);
- // fallthrough
+ Y_ABSL_FALLTHROUGH_INTENDED;
case grpc_core::chttp2::FlowControlAction::Urgency::QUEUE_UPDATE:
action();
break;
@@ -2458,15 +2459,15 @@ void grpc_chttp2_act_on_flowctl_action(
});
}
-static grpc_error* try_http_parsing(grpc_chttp2_transport* t) {
+static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
grpc_http_parser parser;
size_t i = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_http_response response;
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
for (; i < t->read_buffer.count && parse_error == GRPC_ERROR_NONE; i++) {
parse_error =
grpc_http_parser_parse(&parser, t->read_buffer.slices[i], nullptr);
@@ -2487,34 +2488,34 @@ static grpc_error* try_http_parsing(grpc_chttp2_transport* t) {
return error;
}
-static void read_action(void* tp, grpc_error* error) {
+static void read_action(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void read_action_locked(void* tp, grpc_error* error) {
+static void read_action_locked(void* tp, grpc_error_handle error) {
GPR_TIMER_SCOPE("reading_action_locked", 0);
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
- grpc_error* err = error;
+ grpc_error_handle err = error;
if (err != GRPC_ERROR_NONE) {
err = grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Endpoint read failed", &err, 1),
GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
t->write_state);
}
- GPR_SWAP(grpc_error*, err, error);
+ std::swap(err, error);
GRPC_ERROR_UNREF(err);
if (t->closed_with_error == GRPC_ERROR_NONE) {
GPR_TIMER_SCOPE("reading_action.parse", 0);
size_t i = 0;
- grpc_error* errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
- GRPC_ERROR_NONE};
+ grpc_error_handle errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
+ GRPC_ERROR_NONE};
for (; i < t->read_buffer.count && errors[1] == GRPC_ERROR_NONE; i++) {
errors[1] = grpc_chttp2_perform_read(t, t->read_buffer.slices[i]);
}
@@ -2605,18 +2606,18 @@ void schedule_bdp_ping_locked(grpc_chttp2_transport* t) {
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_BDP_PING);
}
-static void start_bdp_ping(void* tp, grpc_error* error) {
+static void start_bdp_ping(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_bdp_ping_locked,
start_bdp_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void start_bdp_ping_locked(void* tp, grpc_error* error) {
+static void start_bdp_ping_locked(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "%s: Start BDP ping err=%s", t->peer_string.c_str(),
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
return;
@@ -2629,18 +2630,18 @@ static void start_bdp_ping_locked(void* tp, grpc_error* error) {
t->bdp_ping_started = true;
}
-static void finish_bdp_ping(void* tp, grpc_error* error) {
+static void finish_bdp_ping(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_bdp_ping_locked,
finish_bdp_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void finish_bdp_ping_locked(void* tp, grpc_error* error) {
+static void finish_bdp_ping_locked(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_INFO, "%s: Complete BDP ping err=%s", t->peer_string.c_str(),
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
if (error != GRPC_ERROR_NONE || t->closed_with_error != GRPC_ERROR_NONE) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "bdp_ping");
@@ -2666,7 +2667,7 @@ static void finish_bdp_ping_locked(void* tp, grpc_error* error) {
&t->next_bdp_ping_timer_expired_locked);
}
-static void next_bdp_ping_timer_expired(void* tp, grpc_error* error) {
+static void next_bdp_ping_timer_expired(void* tp, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
t->combiner->Run(
GRPC_CLOSURE_INIT(&t->next_bdp_ping_timer_expired_locked,
@@ -2674,7 +2675,8 @@ static void next_bdp_ping_timer_expired(void* tp, grpc_error* error) {
GRPC_ERROR_REF(error));
}
-static void next_bdp_ping_timer_expired_locked(void* tp, grpc_error* error) {
+static void next_bdp_ping_timer_expired_locked(void* tp,
+ grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
GPR_ASSERT(t->have_next_bdp_ping_timer);
t->have_next_bdp_ping_timer = false;
@@ -2750,14 +2752,14 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
}
}
-static void init_keepalive_ping(void* arg, grpc_error* error) {
+static void init_keepalive_ping(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->init_keepalive_ping_locked,
init_keepalive_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void init_keepalive_ping_locked(void* arg, grpc_error* error) {
+static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING);
if (t->destroying || t->closed_with_error != GRPC_ERROR_NONE) {
@@ -2790,14 +2792,14 @@ static void init_keepalive_ping_locked(void* arg, grpc_error* error) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "init keepalive ping");
}
-static void start_keepalive_ping(void* arg, grpc_error* error) {
+static void start_keepalive_ping(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked,
start_keepalive_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void start_keepalive_ping_locked(void* arg, grpc_error* error) {
+static void start_keepalive_ping_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (error != GRPC_ERROR_NONE) {
return;
@@ -2818,14 +2820,14 @@ static void start_keepalive_ping_locked(void* arg, grpc_error* error) {
t->keepalive_ping_started = true;
}
-static void finish_keepalive_ping(void* arg, grpc_error* error) {
+static void finish_keepalive_ping(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
t->combiner->Run(GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
finish_keepalive_ping_locked, t, nullptr),
GRPC_ERROR_REF(error));
}
-static void finish_keepalive_ping_locked(void* arg, grpc_error* error) {
+static void finish_keepalive_ping_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
if (error == GRPC_ERROR_NONE) {
@@ -2856,7 +2858,7 @@ static void finish_keepalive_ping_locked(void* arg, grpc_error* error) {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "keepalive ping end");
}
-static void keepalive_watchdog_fired(void* arg, grpc_error* error) {
+static void keepalive_watchdog_fired(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
t->combiner->Run(
GRPC_CLOSURE_INIT(&t->keepalive_watchdog_fired_locked,
@@ -2864,7 +2866,8 @@ static void keepalive_watchdog_fired(void* arg, grpc_error* error) {
GRPC_ERROR_REF(error));
}
-static void keepalive_watchdog_fired_locked(void* arg, grpc_error* error) {
+static void keepalive_watchdog_fired_locked(void* arg,
+ grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_PINGING) {
if (error == GRPC_ERROR_NONE) {
@@ -2921,7 +2924,7 @@ static void set_pollset_set(grpc_transport* gt, grpc_stream* /*gs*/,
// BYTE STREAM
//
-static void reset_byte_stream(void* arg, grpc_error* error) {
+static void reset_byte_stream(void* arg, grpc_error_handle error) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(arg);
s->pending_byte_stream = false;
if (error == GRPC_ERROR_NONE) {
@@ -2952,8 +2955,8 @@ Chttp2IncomingByteStream::Chttp2IncomingByteStream(
stream->byte_stream_error = GRPC_ERROR_NONE;
}
-void Chttp2IncomingByteStream::OrphanLocked(void* arg,
- grpc_error* /*error_ignored*/) {
+void Chttp2IncomingByteStream::OrphanLocked(
+ void* arg, grpc_error_handle /*error_ignored*/) {
Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
grpc_chttp2_stream* s = bs->stream_;
grpc_chttp2_transport* t = s->t;
@@ -2972,7 +2975,7 @@ void Chttp2IncomingByteStream::Orphan() {
}
void Chttp2IncomingByteStream::NextLocked(void* arg,
- grpc_error* /*error_ignored*/) {
+ grpc_error_handle /*error_ignored*/) {
Chttp2IncomingByteStream* bs = static_cast<Chttp2IncomingByteStream*>(arg);
grpc_chttp2_transport* t = bs->transport_;
grpc_chttp2_stream* s = bs->stream_;
@@ -2987,11 +2990,10 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
grpc_slice_buffer_swap(&s->frame_storage,
&s->unprocessed_incoming_frames_buffer);
s->unprocessed_incoming_frames_decompressed = false;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
- GRPC_ERROR_NONE);
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete, GRPC_ERROR_NONE);
} else if (s->byte_stream_error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
- GRPC_ERROR_REF(s->byte_stream_error));
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
+ GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref();
s->data_parser.parsing_frame = nullptr;
@@ -3000,8 +3002,8 @@ void Chttp2IncomingByteStream::NextLocked(void* arg,
if (bs->remaining_bytes_ != 0) {
s->byte_stream_error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Truncated message", &s->read_closed_error, 1);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
- GRPC_ERROR_REF(s->byte_stream_error));
+ ExecCtx::Run(DEBUG_LOCATION, bs->next_action_.on_complete,
+ GRPC_ERROR_REF(s->byte_stream_error));
if (s->data_parser.parsing_frame != nullptr) {
s->data_parser.parsing_frame->Unref();
s->data_parser.parsing_frame = nullptr;
@@ -3042,9 +3044,9 @@ void Chttp2IncomingByteStream::MaybeCreateStreamDecompressionCtx() {
}
}
-grpc_error* Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
+grpc_error_handle Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
GPR_TIMER_SCOPE("incoming_byte_stream_pull", 0);
- grpc_error* error;
+ grpc_error_handle error;
if (stream_->unprocessed_incoming_frames_buffer.length > 0) {
if (!stream_->unprocessed_incoming_frames_decompressed &&
stream_->stream_decompression_method !=
@@ -3087,20 +3089,19 @@ grpc_error* Chttp2IncomingByteStream::Pull(grpc_slice* slice) {
return GRPC_ERROR_NONE;
}
-void Chttp2IncomingByteStream::PublishError(grpc_error* error) {
+void Chttp2IncomingByteStream::PublishError(grpc_error_handle error) {
GPR_ASSERT(error != GRPC_ERROR_NONE);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_->on_next,
- GRPC_ERROR_REF(error));
+ ExecCtx::Run(DEBUG_LOCATION, stream_->on_next, GRPC_ERROR_REF(error));
stream_->on_next = nullptr;
GRPC_ERROR_UNREF(stream_->byte_stream_error);
stream_->byte_stream_error = GRPC_ERROR_REF(error);
grpc_chttp2_cancel_stream(transport_, stream_, GRPC_ERROR_REF(error));
}
-grpc_error* Chttp2IncomingByteStream::Push(const grpc_slice& slice,
- grpc_slice* slice_out) {
+grpc_error_handle Chttp2IncomingByteStream::Push(const grpc_slice& slice,
+ grpc_slice* slice_out) {
if (remaining_bytes_ < GRPC_SLICE_LENGTH(slice)) {
- grpc_error* error =
+ grpc_error_handle error =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many bytes in stream");
transport_->combiner->Run(&stream_->reset_byte_stream,
GRPC_ERROR_REF(error));
@@ -3115,8 +3116,8 @@ grpc_error* Chttp2IncomingByteStream::Push(const grpc_slice& slice,
}
}
-grpc_error* Chttp2IncomingByteStream::Finished(grpc_error* error,
- bool reset_on_error) {
+grpc_error_handle Chttp2IncomingByteStream::Finished(grpc_error_handle error,
+ bool reset_on_error) {
if (error == GRPC_ERROR_NONE) {
if (remaining_bytes_ != 0) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Truncated message");
@@ -3130,7 +3131,7 @@ grpc_error* Chttp2IncomingByteStream::Finished(grpc_error* error,
return error;
}
-void Chttp2IncomingByteStream::Shutdown(grpc_error* error) {
+void Chttp2IncomingByteStream::Shutdown(grpc_error_handle error) {
GRPC_ERROR_UNREF(Finished(error, true /* reset_on_error */));
}
@@ -3144,10 +3145,19 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) {
if (!t->benign_reclaimer_registered) {
t->benign_reclaimer_registered = true;
GRPC_CHTTP2_REF_TRANSPORT(t, "benign_reclaimer");
- GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked, benign_reclaimer, t,
- grpc_schedule_on_exec_ctx);
- grpc_resource_user_post_reclaimer(grpc_endpoint_get_resource_user(t->ep),
- false, &t->benign_reclaimer_locked);
+ t->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kBenign,
+ [t](y_absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (sweep.has_value()) {
+ GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
+ benign_reclaimer_locked, t,
+ grpc_schedule_on_exec_ctx);
+ t->active_reclamation = std::move(*sweep);
+ t->combiner->Run(&t->benign_reclaimer_locked, GRPC_ERROR_NONE);
+ } else {
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
+ }
+ });
}
}
@@ -3155,21 +3165,23 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
if (!t->destructive_reclaimer_registered) {
t->destructive_reclaimer_registered = true;
GRPC_CHTTP2_REF_TRANSPORT(t, "destructive_reclaimer");
- GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked, destructive_reclaimer,
- t, grpc_schedule_on_exec_ctx);
- grpc_resource_user_post_reclaimer(grpc_endpoint_get_resource_user(t->ep),
- true, &t->destructive_reclaimer_locked);
+ t->memory_owner.PostReclaimer(
+ grpc_core::ReclamationPass::kDestructive,
+ [t](y_absl::optional<grpc_core::ReclamationSweep> sweep) {
+ if (sweep.has_value()) {
+ GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
+ destructive_reclaimer_locked, t,
+ grpc_schedule_on_exec_ctx);
+ t->active_reclamation = std::move(*sweep);
+ t->combiner->Run(&t->destructive_reclaimer_locked, GRPC_ERROR_NONE);
+ } else {
+ GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
+ }
+ });
}
}
-static void benign_reclaimer(void* arg, grpc_error* error) {
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
- t->combiner->Run(GRPC_CLOSURE_INIT(&t->benign_reclaimer_locked,
- benign_reclaimer_locked, t, nullptr),
- GRPC_ERROR_REF(error));
-}
-
-static void benign_reclaimer_locked(void* arg, grpc_error* error) {
+static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
if (error == GRPC_ERROR_NONE &&
grpc_chttp2_stream_map_size(&t->stream_map) == 0) {
@@ -3193,20 +3205,12 @@ static void benign_reclaimer_locked(void* arg, grpc_error* error) {
}
t->benign_reclaimer_registered = false;
if (error != GRPC_ERROR_CANCELLED) {
- grpc_resource_user_finish_reclamation(
- grpc_endpoint_get_resource_user(t->ep));
+ t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
}
-static void destructive_reclaimer(void* arg, grpc_error* error) {
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
- t->combiner->Run(GRPC_CLOSURE_INIT(&t->destructive_reclaimer_locked,
- destructive_reclaimer_locked, t, nullptr),
- GRPC_ERROR_REF(error));
-}
-
-static void destructive_reclaimer_locked(void* arg, grpc_error* error) {
+static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(arg);
size_t n = grpc_chttp2_stream_map_size(&t->stream_map);
t->destructive_reclaimer_registered = false;
@@ -3231,8 +3235,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error* error) {
}
}
if (error != GRPC_ERROR_CANCELLED) {
- grpc_resource_user_finish_reclamation(
- grpc_endpoint_get_resource_user(t->ep));
+ t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
}
@@ -3315,10 +3318,8 @@ grpc_chttp2_transport_get_socket_node(grpc_transport* transport) {
}
grpc_transport* grpc_create_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user) {
- auto t =
- new grpc_chttp2_transport(channel_args, ep, is_client, resource_user);
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client) {
+ auto t = new grpc_chttp2_transport(channel_args, ep, is_client);
return &t->base;
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
index a72d268d189..3204a5f89ac 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.h
@@ -34,9 +34,11 @@ extern grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser;
extern bool g_flow_control_enabled;
+/// Creates a CHTTP2 Transport. This takes ownership of a \a resource_user ref
+/// from the caller; if the caller still needs the resource_user after creating
+/// a transport, the caller must take another ref.
grpc_transport* grpc_create_chttp2_transport(
- const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user = nullptr);
+ const grpc_channel_args* channel_args, grpc_endpoint* ep, bool is_client);
grpc_core::RefCountedPtr<grpc_core::channelz::SocketNode>
grpc_chttp2_transport_get_socket_node(grpc_transport* transport);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
index a0473ea822a..70e3774699d 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.cc
@@ -22,7 +22,7 @@
namespace {
void (*write_timestamps_callback_g)(void*, grpc_core::Timestamps*,
- grpc_error* error) = nullptr;
+ grpc_error_handle error) = nullptr;
void* (*get_copied_context_fn_g)(void*) = nullptr;
} // namespace
@@ -40,8 +40,7 @@ void ContextList::Append(ContextList** head, grpc_chttp2_stream* s) {
*head = elem;
}
-void ContextList::Execute(void* arg, grpc_core::Timestamps* ts,
- grpc_error* error) {
+void ContextList::Execute(void* arg, Timestamps* ts, grpc_error_handle error) {
ContextList* head = static_cast<ContextList*>(arg);
ContextList* to_be_freed;
while (head != nullptr) {
@@ -57,9 +56,8 @@ void ContextList::Execute(void* arg, grpc_core::Timestamps* ts,
}
}
-void grpc_http2_set_write_timestamps_callback(void (*fn)(void*,
- grpc_core::Timestamps*,
- grpc_error* error)) {
+void grpc_http2_set_write_timestamps_callback(
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
write_timestamps_callback_g = fn;
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.h
index 5b9d2ab3784..f4963d849cb 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/context_list.h
@@ -21,9 +21,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/buffer_list.h"
-
#include "src/core/ext/transport/chttp2/transport/internal.h"
+#include "src/core/lib/iomgr/buffer_list.h"
namespace grpc_core {
/** A list of RPC Contexts */
@@ -36,7 +35,7 @@ class ContextList {
/* Executes a function \a fn with each context in the list and \a ts. It also
* frees up the entire list after this operation. It is intended as a callback
* and hence does not take a ref on \a error */
- static void Execute(void* arg, grpc_core::Timestamps* ts, grpc_error* error);
+ static void Execute(void* arg, Timestamps* ts, grpc_error_handle error);
private:
void* trace_context_ = nullptr;
@@ -44,9 +43,8 @@ class ContextList {
size_t byte_offset_ = 0;
};
-void grpc_http2_set_write_timestamps_callback(void (*fn)(void*,
- grpc_core::Timestamps*,
- grpc_error* error));
+void grpc_http2_set_write_timestamps_callback(
+ void (*fn)(void*, Timestamps*, grpc_error_handle error));
void grpc_http2_set_fn_get_copied_context(void* (*fn)(void*));
} /* namespace grpc_core */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
index fd76c4b3d9a..e9fc2468f4b 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc
@@ -43,12 +43,14 @@ namespace chttp2 {
TestOnlyTransportTargetWindowEstimatesMocker*
g_test_only_transport_target_window_estimates_mocker;
+bool g_test_only_transport_flow_control_window_check;
+
namespace {
-static constexpr const int kTracePadding = 30;
-static constexpr const uint32_t kMaxWindowUpdateSize = (1u << 31) - 1;
+constexpr const int kTracePadding = 30;
+constexpr const int64_t kMaxWindowUpdateSize = (1u << 31) - 1;
-static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
+char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
TString str;
if (old_val != new_val) {
str = y_absl::StrFormat("%" PRId64 " -> %" PRId64 "", old_val, new_val);
@@ -58,7 +60,7 @@ static char* fmt_int64_diff_str(int64_t old_val, int64_t new_val) {
return gpr_leftpad(str.c_str(), ' ', kTracePadding);
}
-static char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
+char* fmt_uint32_diff_str(uint32_t old_val, uint32_t new_val) {
TString str;
if (old_val != new_val) {
str = y_absl::StrFormat("%" PRIu32 " -> %" PRIu32 "", old_val, new_val);
@@ -179,7 +181,7 @@ TransportFlowControl::TransportFlowControl(const grpc_chttp2_transport* t,
: t_(t),
enable_bdp_probe_(enable_bdp_probe),
bdp_estimator_(t->peer_string.c_str()),
- pid_controller_(grpc_core::PidController::Args()
+ pid_controller_(PidController::Args()
.set_gain_p(4)
.set_gain_i(8)
.set_gain_d(0)
@@ -187,7 +189,7 @@ TransportFlowControl::TransportFlowControl(const grpc_chttp2_transport* t,
.set_min_control_value(-1)
.set_max_control_value(25)
.set_integral_range(10)),
- last_pid_update_(grpc_core::ExecCtx::Get()->Now()) {}
+ last_pid_update_(ExecCtx::Get()->Now()) {}
uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
FlowControlTrace trace("t updt sent", this, nullptr);
@@ -195,22 +197,21 @@ uint32_t TransportFlowControl::MaybeSendUpdate(bool writing_anyway) {
static_cast<uint32_t>(target_window());
if ((writing_anyway || announced_window_ <= target_announced_window / 2) &&
announced_window_ != target_announced_window) {
- const uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
- target_announced_window - announced_window_, 0, kMaxWindowUpdateSize);
+ const uint32_t announce =
+ static_cast<uint32_t>(Clamp(target_announced_window - announced_window_,
+ int64_t(0), kMaxWindowUpdateSize));
announced_window_ += announce;
return announce;
}
return 0;
}
-grpc_error* TransportFlowControl::ValidateRecvData(
+grpc_error_handle TransportFlowControl::ValidateRecvData(
int64_t incoming_frame_size) {
if (incoming_frame_size > announced_window_) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("frame of size %" PRId64
- " overflows local window of %" PRId64,
- incoming_frame_size, announced_window_)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "frame of size %" PRId64 " overflows local window of %" PRId64,
+ incoming_frame_size, announced_window_));
}
return GRPC_ERROR_NONE;
}
@@ -219,10 +220,10 @@ StreamFlowControl::StreamFlowControl(TransportFlowControl* tfc,
const grpc_chttp2_stream* s)
: tfc_(tfc), s_(s) {}
-grpc_error* StreamFlowControl::RecvData(int64_t incoming_frame_size) {
+grpc_error_handle StreamFlowControl::RecvData(int64_t incoming_frame_size) {
FlowControlTrace trace(" data recv", tfc_, this);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
error = tfc_->ValidateRecvData(incoming_frame_size);
if (error != GRPC_ERROR_NONE) return error;
@@ -257,9 +258,27 @@ grpc_error* StreamFlowControl::RecvData(int64_t incoming_frame_size) {
uint32_t StreamFlowControl::MaybeSendUpdate() {
FlowControlTrace trace("s updt sent", tfc_, this);
+ // If a recently sent settings frame caused the stream's flow control window
+ // to go in the negative (or < GRPC_HEADER_SIZE_IN_BYTES), update the delta if
+ // one of the following conditions is satisfied -
+ // 1) There is a pending byte_stream and higher layers have expressed interest
+ // in reading additional data through the invokation of `Next()` where the
+ // bytes are to be available asynchronously. 2) There is a pending
+ // recv_message op.
+ // In these cases, we want to make sure that bytes are still flowing.
+ if (local_window_delta_ < GRPC_HEADER_SIZE_IN_BYTES) {
+ if (s_->on_next != nullptr) {
+ GPR_DEBUG_ASSERT(s_->pending_byte_stream);
+ IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES, 0);
+ } else if (s_->recv_message != nullptr) {
+ IncomingByteStreamUpdate(GRPC_HEADER_SIZE_IN_BYTES,
+ s_->frame_storage.length);
+ }
+ }
if (local_window_delta_ > announced_window_delta_) {
- uint32_t announce = static_cast<uint32_t> GPR_CLAMP(
- local_window_delta_ - announced_window_delta_, 0, kMaxWindowUpdateSize);
+ uint32_t announce = static_cast<uint32_t>(
+ Clamp(local_window_delta_ - announced_window_delta_, int64_t(0),
+ kMaxWindowUpdateSize));
UpdateAnnouncedWindowDelta(tfc_, announce);
return announce;
}
@@ -270,13 +289,10 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
size_t have_already) {
FlowControlTrace trace("app st recv", tfc_, this);
uint32_t max_recv_bytes;
- uint32_t sent_init_window =
- tfc_->transport()->settings[GRPC_SENT_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE];
/* clamp max recv hint to an allowable size */
- if (max_size_hint >= kMaxWindowUpdateSize - sent_init_window) {
- max_recv_bytes = kMaxWindowUpdateSize - sent_init_window;
+ if (max_size_hint >= kMaxWindowDelta) {
+ max_recv_bytes = kMaxWindowDelta;
} else {
max_recv_bytes = static_cast<uint32_t>(max_size_hint);
}
@@ -289,7 +305,12 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
}
/* add some small lookahead to keep pipelines flowing */
- GPR_DEBUG_ASSERT(max_recv_bytes <= kMaxWindowUpdateSize - sent_init_window);
+ GPR_DEBUG_ASSERT(
+ max_recv_bytes <=
+ kMaxWindowUpdateSize -
+ tfc_->transport()
+ ->settings[GRPC_SENT_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
if (local_window_delta_ < max_recv_bytes) {
uint32_t add_max_recv_bytes =
static_cast<uint32_t>(max_recv_bytes - local_window_delta_);
@@ -298,10 +319,8 @@ void StreamFlowControl::IncomingByteStreamUpdate(size_t max_size_hint,
}
// Take in a target and modifies it based on the memory pressure of the system
-static double AdjustForMemoryPressure(grpc_resource_quota* quota,
- double target) {
+static double AdjustForMemoryPressure(double memory_pressure, double target) {
// do not increase window under heavy memory pressure.
- double memory_pressure = grpc_resource_quota_get_memory_pressure(quota);
static const double kLowMemPressure = 0.1;
static const double kZeroTarget = 22;
static const double kHighMemPressure = 0.8;
@@ -310,20 +329,21 @@ static double AdjustForMemoryPressure(grpc_resource_quota* quota,
target = (target - kZeroTarget) * memory_pressure / kLowMemPressure +
kZeroTarget;
} else if (memory_pressure > kHighMemPressure) {
- target *= 1 - GPR_MIN(1, (memory_pressure - kHighMemPressure) /
- (kMaxMemPressure - kHighMemPressure));
+ target *= 1 - std::min(1.0, (memory_pressure - kHighMemPressure) /
+ (kMaxMemPressure - kHighMemPressure));
}
return target;
}
double TransportFlowControl::TargetLogBdp() {
- return AdjustForMemoryPressure(
- grpc_resource_user_quota(grpc_endpoint_get_resource_user(t_->ep)),
- 1 + log2(bdp_estimator_.EstimateBdp()));
+ return AdjustForMemoryPressure(t_->memory_owner.is_valid()
+ ? t_->memory_owner.InstantaneousPressure()
+ : 0.0,
+ 1 + log2(bdp_estimator_.EstimateBdp()));
}
double TransportFlowControl::SmoothLogBdp(double value) {
- grpc_millis now = grpc_core::ExecCtx::Get()->Now();
+ grpc_millis now = ExecCtx::Get()->Now();
double bdp_error = value - pid_controller_.last_control_value();
const double dt = static_cast<double>(now - last_pid_update_) * 1e-3;
last_pid_update_ = now;
@@ -358,10 +378,10 @@ FlowControlAction TransportFlowControl::PeriodicUpdate() {
->ComputeNextTargetInitialWindowSizeFromPeriodicUpdate(
target_initial_window_size_ /* current target */);
}
- // Though initial window 'could' drop to 0, we keep the floor at 128
- target_initial_window_size_ =
- static_cast<int32_t> GPR_CLAMP(target, 128, INT32_MAX);
-
+ // Though initial window 'could' drop to 0, we keep the floor at
+ // kMinInitialWindowSize
+ target_initial_window_size_ = static_cast<int32_t>(Clamp(
+ target, double(kMinInitialWindowSize), double(kMaxInitialWindowSize)));
action.set_send_initial_window_update(
DeltaUrgency(target_initial_window_size_,
GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE),
@@ -370,10 +390,11 @@ FlowControlAction TransportFlowControl::PeriodicUpdate() {
// get bandwidth estimate and update max_frame accordingly.
double bw_dbl = bdp_estimator_.EstimateBandwidth();
// we target the max of BDP or bandwidth in microseconds.
- int32_t frame_size = static_cast<int32_t> GPR_CLAMP(
- GPR_MAX((int32_t)GPR_CLAMP(bw_dbl, 0, INT_MAX) / 1000,
- target_initial_window_size_),
- 16384, 16777215);
+ int32_t frame_size = static_cast<int32_t>(Clamp(
+ std::max(
+ static_cast<int32_t>(Clamp(bw_dbl, 0.0, double(INT_MAX))) / 1000,
+ static_cast<int32_t>(target_initial_window_size_)),
+ 16384, 16777215));
action.set_send_max_frame_size_update(
DeltaUrgency(static_cast<int64_t>(frame_size),
GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE),
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
index 7e053585b18..c269be2d0c2 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -47,10 +47,16 @@ static constexpr uint32_t kDefaultWindow = 65535;
static constexpr int64_t kMaxWindow = static_cast<int64_t>((1u << 31) - 1);
// TODO(ncteisen): Tune this
static constexpr uint32_t kFrameSize = 1024 * 1024;
+static constexpr const uint32_t kMinInitialWindowSize = 128;
+static constexpr const uint32_t kMaxInitialWindowSize = (1u << 30);
+// The maximum per-stream flow control window delta to advertise.
+static constexpr const uint32_t kMaxWindowDelta = (1u << 20);
class TransportFlowControl;
class StreamFlowControl;
+extern bool g_test_only_transport_flow_control_window_check;
+
// Encapsulates a collections of actions the transport needs to take with
// regard to flow control. Each action comes with urgencies that tell the
// transport how quickly the action must take place.
@@ -168,7 +174,7 @@ class TransportFlowControlBase {
// Called to do bookkeeping when a stream owned by this transport receives
// data from the wire. Also does error checking for frame size.
- virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
+ virtual grpc_error_handle RecvData(int64_t /* incoming_frame_size */) = 0;
// Called to do bookkeeping when we receive a WINDOW_UPDATE frame.
virtual void RecvUpdate(uint32_t /* size */) = 0;
@@ -210,7 +216,7 @@ class TransportFlowControlDisabled final : public TransportFlowControlBase {
FlowControlAction MakeAction() override { return FlowControlAction(); }
FlowControlAction PeriodicUpdate() override { return FlowControlAction(); }
void StreamSentData(int64_t /* size */) override {}
- grpc_error* RecvData(int64_t /* incoming_frame_size */) override {
+ grpc_error_handle RecvData(int64_t /* incoming_frame_size */) override {
return GRPC_ERROR_NONE;
}
void RecvUpdate(uint32_t /* size */) override {}
@@ -246,14 +252,14 @@ class TransportFlowControl final : public TransportFlowControlBase {
void StreamSentData(int64_t size) override { remote_window_ -= size; }
- grpc_error* ValidateRecvData(int64_t incoming_frame_size);
+ grpc_error_handle ValidateRecvData(int64_t incoming_frame_size);
void CommitRecvData(int64_t incoming_frame_size) {
announced_window_ -= incoming_frame_size;
}
- grpc_error* RecvData(int64_t incoming_frame_size) override {
+ grpc_error_handle RecvData(int64_t incoming_frame_size) override {
FlowControlTrace trace(" data recv", this, nullptr);
- grpc_error* error = ValidateRecvData(incoming_frame_size);
+ grpc_error_handle error = ValidateRecvData(incoming_frame_size);
if (error != GRPC_ERROR_NONE) return error;
CommitRecvData(incoming_frame_size);
return GRPC_ERROR_NONE;
@@ -268,10 +274,10 @@ class TransportFlowControl final : public TransportFlowControlBase {
// See comment above announced_stream_total_over_incoming_window_ for the
// logic behind this decision.
int64_t target_window() const override {
- return static_cast<uint32_t> GPR_MIN(
- (int64_t)((1u << 31) - 1),
- announced_stream_total_over_incoming_window_ +
- target_initial_window_size_);
+ return static_cast<uint32_t>(
+ std::min(static_cast<int64_t>((1u << 31) - 1),
+ announced_stream_total_over_incoming_window_ +
+ target_initial_window_size_));
}
const grpc_chttp2_transport* transport() const { return t_; }
@@ -325,10 +331,10 @@ class TransportFlowControl final : public TransportFlowControlBase {
const bool enable_bdp_probe_;
/* bdp estimation */
- grpc_core::BdpEstimator bdp_estimator_;
+ BdpEstimator bdp_estimator_;
/* pid controller */
- grpc_core::PidController pid_controller_;
+ PidController pid_controller_;
grpc_millis last_pid_update_ = 0;
};
@@ -352,7 +358,7 @@ class StreamFlowControlBase {
virtual void SentData(int64_t /* outgoing_frame_size */) = 0;
// Bookkeeping and error checking for when data is received by this stream.
- virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0;
+ virtual grpc_error_handle RecvData(int64_t /* incoming_frame_size */) = 0;
// Called to check if this stream needs to send a WINDOW_UPDATE frame.
virtual uint32_t MaybeSendUpdate() = 0;
@@ -373,9 +379,9 @@ class StreamFlowControlBase {
virtual void TestOnlyForceHugeWindow() {}
// Getters
- int64_t remote_window_delta() { return remote_window_delta_; }
- int64_t local_window_delta() { return local_window_delta_; }
- int64_t announced_window_delta() { return announced_window_delta_; }
+ int64_t remote_window_delta() const { return remote_window_delta_; }
+ int64_t local_window_delta() const { return local_window_delta_; }
+ int64_t announced_window_delta() const { return announced_window_delta_; }
protected:
friend class ::grpc::testing::TrickledCHTTP2;
@@ -395,7 +401,7 @@ class StreamFlowControlDisabled : public StreamFlowControlBase {
}
FlowControlAction MakeAction() override { return FlowControlAction(); }
void SentData(int64_t /* outgoing_frame_size */) override {}
- grpc_error* RecvData(int64_t /* incoming_frame_size */) override {
+ grpc_error_handle RecvData(int64_t /* incoming_frame_size */) override {
return GRPC_ERROR_NONE;
}
uint32_t MaybeSendUpdate() override { return 0; }
@@ -427,7 +433,7 @@ class StreamFlowControl final : public StreamFlowControlBase {
}
// we have received data from the wire
- grpc_error* RecvData(int64_t incoming_frame_size) override;
+ grpc_error_handle RecvData(int64_t incoming_frame_size) override;
// returns an announce if we should send a stream update to our peer, else
// returns zero
@@ -479,4 +485,4 @@ extern TestOnlyTransportTargetWindowEstimatesMocker*
} // namespace chttp2
} // namespace grpc_core
-#endif
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FLOW_CONTROL_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
index b1bc4599ed0..4b35a04e0ab 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.cc
@@ -26,6 +26,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
@@ -41,14 +42,14 @@ grpc_chttp2_data_parser::~grpc_chttp2_data_parser() {
GRPC_ERROR_UNREF(error);
}
-grpc_error* grpc_chttp2_data_parser_begin_frame(
+grpc_error_handle grpc_chttp2_data_parser_begin_frame(
grpc_chttp2_data_parser* /*parser*/, uint8_t flags, uint32_t stream_id,
grpc_chttp2_stream* s) {
if (flags & ~GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
- return grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unsupported data flags: 0x%02x", flags).c_str()),
- GRPC_ERROR_INT_STREAM_ID, static_cast<intptr_t>(stream_id));
+ return grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "unsupported data flags: 0x%02x", flags)),
+ GRPC_ERROR_INT_STREAM_ID,
+ static_cast<intptr_t>(stream_id));
}
if (flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) {
@@ -89,11 +90,11 @@ void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
stats->data_bytes += write_bytes;
}
-grpc_error* grpc_deframe_unprocessed_incoming_frames(
+grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_chttp2_data_parser* p, grpc_chttp2_stream* s,
grpc_slice_buffer* slices, grpc_slice* slice_out,
grpc_core::OrphanablePtr<grpc_core::ByteStream>* stream_out) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_chttp2_transport* t = s->t;
while (slices->count > 0) {
@@ -128,15 +129,14 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
p->is_frame_compressed = true; /* GPR_TRUE */
break;
default:
- p->error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type)
- .c_str());
+ p->error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Bad GRPC frame type 0x%02x", p->frame_type));
p->error = grpc_error_set_int(p->error, GRPC_ERROR_INT_STREAM_ID,
static_cast<intptr_t>(s->id));
- p->error = grpc_error_set_str(
- p->error, GRPC_ERROR_STR_RAW_BYTES,
- grpc_slice_from_moved_string(grpc_core::UniquePtr<char>(
- grpc_dump_slice(*slice, GPR_DUMP_HEX | GPR_DUMP_ASCII))));
+ grpc_core::UniquePtr<char> dmp(
+ grpc_dump_slice(*slice, GPR_DUMP_HEX | GPR_DUMP_ASCII));
+ p->error = grpc_error_set_str(p->error, GRPC_ERROR_STR_RAW_BYTES,
+ dmp.get());
p->error =
grpc_error_set_int(p->error, GRPC_ERROR_INT_OFFSET, cur - beg);
p->state = GRPC_CHTTP2_DATA_ERROR;
@@ -148,7 +148,7 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_1:
s->stats.incoming.framing_bytes++;
p->frame_size = (static_cast<uint32_t>(*cur)) << 24;
@@ -157,7 +157,7 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_2:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 16;
@@ -166,7 +166,7 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_3:
s->stats.incoming.framing_bytes++;
p->frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@@ -175,7 +175,7 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_remove_first(slices);
continue;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_DATA_FH_4:
s->stats.incoming.framing_bytes++;
GPR_ASSERT(stream_out != nullptr);
@@ -275,11 +275,11 @@ grpc_error* grpc_deframe_unprocessed_incoming_frames(
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_chttp2_data_parser_parse(void* /*parser*/,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_data_parser_parse(void* /*parser*/,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last) {
if (!s->pending_byte_stream) {
grpc_slice_ref_internal(slice);
grpc_slice_buffer_add(&s->frame_storage, slice);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
index ec3890098ec..6690e5f3098 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_data.h
@@ -25,6 +25,7 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/byte_stream.h"
#include "src/core/lib/transport/transport.h"
@@ -50,31 +51,31 @@ struct grpc_chttp2_data_parser {
grpc_chttp2_stream_state state = GRPC_CHTTP2_DATA_FH_0;
uint8_t frame_type = 0;
uint32_t frame_size = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
bool is_frame_compressed = false;
grpc_core::Chttp2IncomingByteStream* parsing_frame = nullptr;
};
/* start processing a new data frame */
-grpc_error* grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser* parser,
- uint8_t flags,
- uint32_t stream_id,
- grpc_chttp2_stream* s);
+grpc_error_handle grpc_chttp2_data_parser_begin_frame(
+ grpc_chttp2_data_parser* parser, uint8_t flags, uint32_t stream_id,
+ grpc_chttp2_stream* s);
/* handle a slice of a data frame - is_last indicates the last slice of a
frame */
-grpc_error* grpc_chttp2_data_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice, int is_last);
+grpc_error_handle grpc_chttp2_data_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
uint32_t write_bytes, int is_eof,
grpc_transport_one_way_stats* stats,
grpc_slice_buffer* outbuf);
-grpc_error* grpc_deframe_unprocessed_incoming_frames(
+grpc_error_handle grpc_deframe_unprocessed_incoming_frames(
grpc_chttp2_data_parser* p, grpc_chttp2_stream* s,
grpc_slice_buffer* slices, grpc_slice* slice_out,
grpc_core::OrphanablePtr<grpc_core::ByteStream>* stream_out);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
index 118158ce524..07930cf5f74 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_goaway.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -28,6 +27,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser* p) {
p->debug_data = nullptr;
}
@@ -36,12 +37,11 @@ void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p) {
gpr_free(p->debug_data);
}
-grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p,
- uint32_t length,
- uint8_t /*flags*/) {
+grpc_error_handle grpc_chttp2_goaway_parser_begin_frame(
+ grpc_chttp2_goaway_parser* p, uint32_t length, uint8_t /*flags*/) {
if (length < 8) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("goaway frame too short (%d bytes)", length).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("goaway frame too short (%d bytes)", length));
}
gpr_free(p->debug_data);
@@ -52,11 +52,11 @@ grpc_error* grpc_chttp2_goaway_parser_begin_frame(grpc_chttp2_goaway_parser* p,
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* /*s*/,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* /*s*/,
+ const grpc_slice& slice,
+ int is_last) {
const uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
const uint8_t* const end = GRPC_SLICE_END_PTR(slice);
const uint8_t* cur = beg;
@@ -71,7 +71,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id = (static_cast<uint32_t>(*cur)) << 24;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI1;
@@ -79,7 +79,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI2;
@@ -87,7 +87,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_LSI3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI3;
@@ -95,7 +95,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->last_stream_id |= (static_cast<uint32_t>(*cur));
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR0:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR0;
@@ -103,7 +103,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code = (static_cast<uint32_t>(*cur)) << 24;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR1;
@@ -111,7 +111,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR2;
@@ -119,7 +119,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_ERR3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR3;
@@ -127,7 +127,7 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
}
p->error_code |= (static_cast<uint32_t>(*cur));
++cur;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_GOAWAY_DEBUG:
if (end != cur) {
memcpy(p->debug_data + p->debug_pos, cur,
@@ -139,7 +139,8 @@ grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
if (is_last) {
grpc_chttp2_add_incoming_goaway(
t, p->error_code, p->last_stream_id,
- grpc_slice_new(p->debug_data, p->debug_length, gpr_free));
+ y_absl::string_view(p->debug_data, p->debug_length));
+ gpr_free(p->debug_data);
p->debug_data = nullptr;
}
return GRPC_ERROR_NONE;
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
index df6274d6286..2ceb6202424 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_goaway.h
@@ -23,6 +23,7 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
typedef enum {
@@ -47,13 +48,13 @@ struct grpc_chttp2_goaway_parser {
};
void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser* p);
void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser* p);
-grpc_error* grpc_chttp2_goaway_parser_begin_frame(
+grpc_error_handle grpc_chttp2_goaway_parser_begin_frame(
grpc_chttp2_goaway_parser* parser, uint32_t length, uint8_t flags);
-grpc_error* grpc_chttp2_goaway_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last);
+grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code,
const grpc_slice& debug_data,
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
index ae152099ba5..366ecab8366 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_ping.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -28,6 +27,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
static bool g_disable_ping_ack = false;
grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) {
@@ -55,13 +56,11 @@ grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes) {
return slice;
}
-grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
- uint32_t length,
- uint8_t flags) {
+grpc_error_handle grpc_chttp2_ping_parser_begin_frame(
+ grpc_chttp2_ping_parser* parser, uint32_t length, uint8_t flags) {
if (flags & 0xfe || length != 8) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("invalid ping: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
parser->is_ack = flags;
@@ -69,11 +68,11 @@ grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_chttp2_ping_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* /*s*/,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* /*s*/,
+ const grpc_slice& slice,
+ int is_last) {
const uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
const uint8_t* const end = GRPC_SLICE_END_PTR(slice);
const uint8_t* cur = beg;
@@ -113,7 +112,8 @@ grpc_error* grpc_chttp2_ping_parser_parse(void* parser,
}
if (!g_disable_ping_ack) {
if (t->ping_ack_count == t->ping_ack_capacity) {
- t->ping_ack_capacity = GPR_MAX(t->ping_ack_capacity * 3 / 2, 3);
+ t->ping_ack_capacity =
+ std::max(t->ping_ack_capacity * 3 / 2, size_t(3));
t->ping_acks = static_cast<uint64_t*>(gpr_realloc(
t->ping_acks, t->ping_ack_capacity * sizeof(*t->ping_acks)));
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
index e356bf43f07..c878cff851b 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_ping.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
struct grpc_chttp2_ping_parser {
@@ -31,12 +32,13 @@ struct grpc_chttp2_ping_parser {
};
grpc_slice grpc_chttp2_ping_create(uint8_t ack, uint64_t opaque_8bytes);
-grpc_error* grpc_chttp2_ping_parser_begin_frame(grpc_chttp2_ping_parser* parser,
- uint32_t length, uint8_t flags);
-grpc_error* grpc_chttp2_ping_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice, int is_last);
+grpc_error_handle grpc_chttp2_ping_parser_begin_frame(
+ grpc_chttp2_ping_parser* parser, uint32_t length, uint8_t flags);
+grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
/* Test-only function for disabling ping ack */
void grpc_set_disable_ping_ack(bool disable_ping_ack);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
index 5113329991b..ffeccf772e1 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_rst_stream.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
@@ -28,6 +27,7 @@
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/transport/http2_errors.h"
@@ -68,23 +68,21 @@ void grpc_chttp2_add_rst_stream_to_next_write(
grpc_chttp2_rst_stream_create(id, code, stats));
}
-grpc_error* grpc_chttp2_rst_stream_parser_begin_frame(
+grpc_error_handle grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags) {
if (length != 4) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid rst_stream: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "invalid rst_stream: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_chttp2_rst_stream_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last) {
const uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
const uint8_t* const end = GRPC_SLICE_END_PTR(slice);
const uint8_t* cur = beg;
@@ -104,14 +102,13 @@ grpc_error* grpc_chttp2_rst_stream_parser_parse(void* parser,
((static_cast<uint32_t>(p->reason_bytes[1])) << 16) |
((static_cast<uint32_t>(p->reason_bytes[2])) << 8) |
((static_cast<uint32_t>(p->reason_bytes[3])));
- grpc_error* error = GRPC_ERROR_NONE;
- if (reason != GRPC_HTTP2_NO_ERROR || s->metadata_buffer[1].size == 0) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (reason != GRPC_HTTP2_NO_ERROR || s->trailing_metadata_buffer.empty()) {
error = grpc_error_set_int(
grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("RST_STREAM"),
GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_cpp_string(y_absl::StrCat(
- "Received RST_STREAM with error code ", reason))),
+ y_absl::StrCat("Received RST_STREAM with error code ", reason)),
GRPC_ERROR_INT_HTTP2_ERROR, static_cast<intptr_t>(reason));
}
grpc_chttp2_mark_stream_closed(t, s, true, true, error);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
index e324ee2cfc3..6581317617e 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_rst_stream.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/transport.h"
@@ -39,12 +40,12 @@ void grpc_chttp2_add_rst_stream_to_next_write(
grpc_chttp2_transport* t, uint32_t id, uint32_t code,
grpc_transport_one_way_stats* stats);
-grpc_error* grpc_chttp2_rst_stream_parser_begin_frame(
+grpc_error_handle grpc_chttp2_rst_stream_parser_begin_frame(
grpc_chttp2_rst_stream_parser* parser, uint32_t length, uint8_t flags);
-grpc_error* grpc_chttp2_rst_stream_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last);
+grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_RST_STREAM_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
index 9e9a838cc3b..36b730f6623 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_settings.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <string.h>
@@ -30,6 +29,7 @@
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/frame.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/http2_errors.h"
@@ -84,7 +84,7 @@ grpc_slice grpc_chttp2_settings_ack_create(void) {
return output;
}
-grpc_error* grpc_chttp2_settings_parser_begin_frame(
+grpc_error_handle grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser* parser, uint32_t length, uint8_t flags,
uint32_t* settings) {
parser->target_settings = settings;
@@ -110,10 +110,27 @@ grpc_error* grpc_chttp2_settings_parser_begin_frame(
}
}
-grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
- grpc_chttp2_stream* /*s*/,
- const grpc_slice& slice,
- int is_last) {
+namespace {
+
+void StreamFlowControlWindowCheck(void* user_data, uint32_t /* key */,
+ void* stream) {
+ bool* error = static_cast<bool*>(user_data);
+ grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(stream);
+ if ((s->t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] +
+ s->t->initial_window_update + s->flow_control->remote_window_delta()) >
+ ((1u << 31) - 1)) {
+ *error = true;
+ }
+}
+
+} // namespace
+
+grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* /*s*/,
+ const grpc_slice& slice,
+ int is_last) {
grpc_chttp2_settings_parser* parser =
static_cast<grpc_chttp2_settings_parser*>(p);
const uint8_t* cur = GRPC_SLICE_START_PTR(slice);
@@ -145,7 +162,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
}
parser->id = static_cast<uint16_t>((static_cast<uint16_t>(*cur)) << 8);
cur++;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_ID1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_ID1;
@@ -153,7 +170,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
}
parser->id = static_cast<uint16_t>(parser->id | (*cur));
cur++;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL0:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL0;
@@ -161,7 +178,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
}
parser->value = (static_cast<uint32_t>(*cur)) << 24;
cur++;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL1;
@@ -169,7 +186,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 16;
cur++;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL2:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL2;
@@ -177,7 +194,7 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
}
parser->value |= (static_cast<uint32_t>(*cur)) << 8;
cur++;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_CHTTP2_SPS_VAL3:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL3;
@@ -200,18 +217,16 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
if (parser->value < sp->min_value || parser->value > sp->max_value) {
switch (sp->invalid_value_behavior) {
case GRPC_CHTTP2_CLAMP_INVALID_VALUE:
- parser->value =
- GPR_CLAMP(parser->value, sp->min_value, sp->max_value);
+ parser->value = grpc_core::Clamp(parser->value, sp->min_value,
+ sp->max_value);
break;
case GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE:
grpc_chttp2_goaway_append(
t->last_new_stream_id, sp->error_value,
grpc_slice_from_static_string("HTTP2 settings error"),
&t->qbuf);
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid value %u passed for %s",
- parser->value, sp->name)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "invalid value %u passed for %s", parser->value, sp->name));
}
}
if (id == GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE &&
@@ -224,6 +239,23 @@ grpc_error* grpc_chttp2_settings_parser_parse(void* p, grpc_chttp2_transport* t,
t->is_client ? "cli" : "svr",
static_cast<int>(t->initial_window_update));
}
+ if (grpc_core::chttp2::
+ g_test_only_transport_flow_control_window_check) {
+ bool error = false;
+ if (parser->value > grpc_core::chttp2::kMaxInitialWindowSize ||
+ parser->value < grpc_core::chttp2::kMinInitialWindowSize) {
+ error = true;
+ } else {
+ grpc_chttp2_stream_map_for_each(
+ &t->stream_map, StreamFlowControlWindowCheck, &error);
+ }
+ if (error) {
+ grpc_chttp2_goaway_append(
+ t->last_new_stream_id, sp->error_value,
+ grpc_slice_from_static_string("HTTP2 settings error"),
+ &t->qbuf);
+ }
+ }
}
parser->incoming_settings[id] = parser->value;
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
index 147d5ea3a33..9ec116b7280 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_settings.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
@@ -49,13 +50,13 @@ grpc_slice grpc_chttp2_settings_create(uint32_t* old_settings,
/* Create an ack settings frame */
grpc_slice grpc_chttp2_settings_ack_create(void);
-grpc_error* grpc_chttp2_settings_parser_begin_frame(
+grpc_error_handle grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser* parser, uint32_t length, uint8_t flags,
uint32_t* settings);
-grpc_error* grpc_chttp2_settings_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last);
+grpc_error_handle grpc_chttp2_settings_parser_parse(void* parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_SETTINGS_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
index f4f779b4b97..55cf7b29a86 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/frame_window_update.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
@@ -27,6 +26,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
+
grpc_slice grpc_chttp2_window_update_create(
uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats* stats) {
static const size_t frame_size = 13;
@@ -53,24 +54,20 @@ grpc_slice grpc_chttp2_window_update_create(
return slice;
}
-grpc_error* grpc_chttp2_window_update_parser_begin_frame(
+grpc_error_handle grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser* parser, uint32_t length, uint8_t flags) {
if (flags || length != 4) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("invalid window update: length=%d, flags=%02x", length,
- flags)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "invalid window update: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
parser->amount = 0;
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_chttp2_window_update_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_window_update_parser_parse(
+ void* parser, grpc_chttp2_transport* t, grpc_chttp2_stream* s,
+ const grpc_slice& slice, int is_last) {
const uint8_t* const beg = GRPC_SLICE_START_PTR(slice);
const uint8_t* const end = GRPC_SLICE_END_PTR(slice);
const uint8_t* cur = beg;
@@ -91,14 +88,20 @@ grpc_error* grpc_chttp2_window_update_parser_parse(void* parser,
// top bit is reserved and must be ignored.
uint32_t received_update = p->amount & 0x7fffffffu;
if (received_update == 0) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("invalid window update bytes: ", p->amount).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("invalid window update bytes: ", p->amount));
}
GPR_ASSERT(is_last);
if (t->incoming_stream_id != 0) {
if (s != nullptr) {
s->flow_control->RecvUpdate(received_update);
+ if (grpc_core::chttp2::
+ g_test_only_transport_flow_control_window_check &&
+ s->flow_control->remote_window_delta() >
+ grpc_core::chttp2::kMaxWindowDelta) {
+ GPR_ASSERT(false);
+ }
if (grpc_chttp2_list_remove_stalled_by_stream(t, s)) {
grpc_chttp2_mark_stream_writable(t, s);
grpc_chttp2_initiate_write(
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
index 340445d87a4..ea414d7a8d7 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/frame_window_update.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/lib/transport/transport.h"
@@ -33,12 +34,10 @@ struct grpc_chttp2_window_update_parser {
grpc_slice grpc_chttp2_window_update_create(
uint32_t id, uint32_t window_delta, grpc_transport_one_way_stats* stats);
-grpc_error* grpc_chttp2_window_update_parser_begin_frame(
+grpc_error_handle grpc_chttp2_window_update_parser_begin_frame(
grpc_chttp2_window_update_parser* parser, uint32_t length, uint8_t flags);
-grpc_error* grpc_chttp2_window_update_parser_parse(void* parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last);
+grpc_error_handle grpc_chttp2_window_update_parser_parse(
+ void* parser, grpc_chttp2_transport* t, grpc_chttp2_stream* s,
+ const grpc_slice& slice, int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_WINDOW_UPDATE_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h
new file mode 100644
index 00000000000..f5886529331
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_constants.h
@@ -0,0 +1,41 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+namespace grpc_core {
+namespace hpack_constants {
+// Per entry overhead bytes as per the spec
+static constexpr uint32_t kEntryOverhead = 32;
+// Initial table size as per the spec
+static constexpr uint32_t kInitialTableSize = 4096;
+
+// last index in the static table
+static constexpr uint32_t kLastStaticEntry = 61;
+
+static constexpr uint32_t EntriesForBytes(uint32_t bytes) noexcept {
+ return (bytes + kEntryOverhead - 1) / kEntryOverhead;
+}
+
+static constexpr uint32_t kInitialTableEntries =
+ EntriesForBytes(kInitialTableSize);
+} // namespace hpack_constants
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_CONSTANTS_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
index cc1eba96582..47f6743e8fe 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.cc
@@ -27,12 +27,11 @@
* TODO(murgatroid99): Remove this
*/
#include <grpc/grpc.h>
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_utils.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -42,257 +41,30 @@
#include "src/core/lib/transport/static_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"
+namespace grpc_core {
+
namespace {
-/* (Maybe-cuckoo) hpack encoder hash table implementation.
-
- This hashtable implementation is a subset of a proper cuckoo hash; while we
- have fallback cells that a value can be hashed to if the first cell is full,
- we do not attempt to iteratively rearrange entries into backup cells to get
- things to fit. Instead, if both a cell and the backup cell for a value are
- occupied, the older existing entry is evicted.
-
- Note that we can disable backup-cell picking by setting
- GRPC_HPACK_ENCODER_USE_CUCKOO_HASH to 0. In that case, we simply evict an
- existing entry rather than try to use a backup. Hence, "maybe-cuckoo."
- TODO(arjunroy): Add unit tests for hashtable implementation. */
-#define GRPC_HPACK_ENCODER_USE_CUCKOO_HASH 1
-#define HASH_FRAGMENT_MASK (GRPC_CHTTP2_HPACKC_NUM_VALUES - 1)
-#define HASH_FRAGMENT_1(x) ((x)&HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_2(x) \
- (((x) >> GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS) & HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_3(x) \
- (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 2)) & HASH_FRAGMENT_MASK)
-#define HASH_FRAGMENT_4(x) \
- (((x) >> (GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS * 3)) & HASH_FRAGMENT_MASK)
/* don't consider adding anything bigger than this to the hpack table */
constexpr size_t kMaxDecoderSpaceUsage = 512;
constexpr size_t kDataFrameHeaderSize = 9;
-constexpr uint8_t kMaxFilterValue = 255;
-
-/* if the probability of this item being seen again is < 1/x then don't add
- it to the table */
-#define ONE_ON_ADD_PROBABILITY (GRPC_CHTTP2_HPACKC_NUM_VALUES >> 1)
-/* The hpack index we encode over the wire. Meaningful to the hpack encoder and
- parser on the remote end as well as HTTP2. *Not* the same as
- HpackEncoderSlotHash, which is only meaningful to the hpack encoder
- implementation (HpackEncoderSlotHash is used for the hashtable implementation
- when mapping from metadata to HpackEncoderIndex. */
-typedef uint32_t HpackEncoderIndex;
-/* Internal-table bookkeeping (*not* the hpack index). */
-typedef uint32_t HpackEncoderSlotHash;
-
-struct SliceRefComparator {
- typedef grpc_slice_refcount* Type;
- static grpc_slice_refcount* Null() { return nullptr; }
- static bool IsNull(const grpc_slice_refcount* sref) {
- return sref == nullptr;
- }
- static bool Equals(const grpc_slice_refcount* s1,
- const grpc_slice_refcount* s2) {
- return s1 == s2;
- }
- static void Ref(grpc_slice_refcount* sref) {
- GPR_DEBUG_ASSERT(sref != nullptr);
- sref->Ref();
- }
- static void Unref(grpc_slice_refcount* sref) {
- GPR_DEBUG_ASSERT(sref != nullptr);
- sref->Unref();
- }
-};
-
-struct MetadataComparator {
- typedef grpc_mdelem Type;
- static grpc_mdelem Null() { return {0}; }
- static bool IsNull(const grpc_mdelem md) { return md.payload == 0; }
- static bool Equals(const grpc_mdelem md1, const grpc_mdelem md2) {
- return md1.payload == md2.payload;
- }
- static void Ref(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(md.payload != 0);
- GRPC_MDELEM_REF(md);
- }
- static void Unref(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(md.payload != 0);
- GRPC_MDELEM_UNREF(md);
- }
-};
-
-/* Index table management */
-template <typename Hashtable>
-static HpackEncoderIndex HpackIndex(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return hashtable[hash_index].index;
-}
-
-template <typename ValueType, typename Hashtable>
-static const ValueType& GetEntry(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return hashtable[hash_index].value;
-}
-
-template <typename Cmp, typename Hashtable>
-static bool TableEmptyAt(const Hashtable* hashtable,
- HpackEncoderSlotHash hash_index) {
- return Cmp::Equals(hashtable[hash_index].value, Cmp::Null());
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static bool Matches(const Hashtable* hashtable, const ValueType& value,
- HpackEncoderSlotHash hash_index) {
- return Cmp::Equals(value, hashtable[hash_index].value);
-}
-template <typename Hashtable>
-static void UpdateIndex(Hashtable* hashtable, HpackEncoderSlotHash hash_index,
- HpackEncoderIndex hpack_index) {
- hashtable[hash_index].index = hpack_index;
-}
-
-template <typename Hashtable, typename ValueType>
-static void SetIndex(Hashtable* hashtable, HpackEncoderSlotHash hash_index,
- const ValueType& value, HpackEncoderIndex hpack_index) {
- hashtable[hash_index].value = value;
- UpdateIndex(hashtable, hash_index, hpack_index);
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static bool GetMatchingIndex(Hashtable* hashtable, const ValueType& value,
- uint32_t value_hash, HpackEncoderIndex* index) {
- const HpackEncoderSlotHash cuckoo_first = HASH_FRAGMENT_2(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_first)) {
- *index = HpackIndex(hashtable, cuckoo_first);
- return true;
- }
-#if GRPC_HPACK_ENCODER_USE_CUCKOO_HASH
- const HpackEncoderSlotHash cuckoo_second = HASH_FRAGMENT_3(value_hash);
-
- if (Matches<Cmp>(hashtable, value, cuckoo_second)) {
- *index = HpackIndex(hashtable, cuckoo_second);
- return true;
- }
-#endif
- return false;
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static ValueType ReplaceOlderIndex(Hashtable* hashtable, const ValueType& value,
- HpackEncoderSlotHash hash_index_a,
- HpackEncoderSlotHash hash_index_b,
- HpackEncoderIndex new_index) {
- const HpackEncoderIndex hpack_idx_a = hashtable[hash_index_a].index;
- const HpackEncoderIndex hpack_idx_b = hashtable[hash_index_b].index;
- const HpackEncoderSlotHash id =
- hpack_idx_a < hpack_idx_b ? hash_index_a : hash_index_b;
- ValueType old = GetEntry<typename Cmp::Type>(hashtable, id);
- SetIndex(hashtable, id, value, new_index);
- return old;
-}
-
-template <typename Cmp, typename Hashtable, typename ValueType>
-static void UpdateAddOrEvict(Hashtable hashtable, const ValueType& value,
- uint32_t value_hash, HpackEncoderIndex new_index) {
- const HpackEncoderSlotHash cuckoo_first = HASH_FRAGMENT_2(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_first)) {
- UpdateIndex(hashtable, cuckoo_first, new_index);
- return;
- }
- if (TableEmptyAt<Cmp>(hashtable, cuckoo_first)) {
- Cmp::Ref(value);
- SetIndex(hashtable, cuckoo_first, value, new_index);
- return;
- }
-#if GRPC_HPACK_ENCODER_USE_CUCKOO_HASH
- const HpackEncoderSlotHash cuckoo_second = HASH_FRAGMENT_3(value_hash);
- if (Matches<Cmp>(hashtable, value, cuckoo_second)) {
- UpdateIndex(hashtable, cuckoo_second, new_index);
- return;
- }
- Cmp::Ref(value);
- if (TableEmptyAt<Cmp>(hashtable, cuckoo_second)) {
- SetIndex(hashtable, cuckoo_second, value, new_index);
- return;
- }
- Cmp::Unref(ReplaceOlderIndex<Cmp>(hashtable, value, cuckoo_first,
- cuckoo_second, new_index));
-#else
- ValueType old = GetEntry<typename Cmp::Type>(hashtable, cuckoo_first);
- SetIndex(hashtable, cuckoo_first, value, new_index);
- Cmp::Unref(old);
-#endif
-}
-
-/* halve all counts because an element reached max */
-static void HalveFilter(uint8_t /*idx*/, uint32_t* sum, uint8_t* elems) {
- *sum = 0;
- for (int i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
- elems[i] /= 2;
- (*sum) += elems[i];
- }
-}
-
-/* increment a filter count, halve all counts if one element reaches max */
-static void IncrementFilter(uint8_t idx, uint32_t* sum, uint8_t* elems) {
- elems[idx]++;
- if (GPR_LIKELY(elems[idx] < kMaxFilterValue)) {
- (*sum)++;
- } else {
- HalveFilter(idx, sum, elems);
- }
-}
-
-static uint32_t UpdateHashtablePopularity(
- grpc_chttp2_hpack_compressor* hpack_compressor, uint32_t elem_hash) {
- const uint32_t popularity_hash = HASH_FRAGMENT_1(elem_hash);
- IncrementFilter(popularity_hash, &hpack_compressor->filter_elems_sum,
- hpack_compressor->filter_elems);
- return popularity_hash;
-}
-
-static bool CanAddToHashtable(grpc_chttp2_hpack_compressor* hpack_compressor,
- uint32_t popularity_hash) {
- const bool can_add =
- hpack_compressor->filter_elems[popularity_hash] >=
- hpack_compressor->filter_elems_sum / ONE_ON_ADD_PROBABILITY;
- return can_add;
-}
} /* namespace */
-struct framer_state {
- int is_first_frame;
- /* number of bytes in 'output' when we started the frame - used to calculate
- frame length */
- size_t output_length_at_start_of_frame;
- /* index (in output) of the header for the current frame */
- size_t header_idx;
-#ifndef NDEBUG
- /* have we seen a regular (non-colon-prefixed) header yet? */
- uint8_t seen_regular_header;
-#endif
- /* output stream id */
- uint32_t stream_id;
- grpc_slice_buffer* output;
- grpc_transport_one_way_stats* stats;
- /* maximum size of a frame */
- size_t max_frame_size;
- bool use_true_binary_metadata;
- bool is_end_of_stream;
-};
/* fills p (which is expected to be kDataFrameHeaderSize bytes long)
* with a data frame header */
-static void fill_header(uint8_t* p, uint8_t type, uint32_t id, size_t len,
- uint8_t flags) {
+static void FillHeader(uint8_t* p, uint8_t type, uint32_t id, size_t len,
+ uint8_t flags) {
/* len is the current frame size (i.e. for the frame we're finishing).
We finish a frame if:
1) We called ensure_space(), (i.e. add_tiny_header_data()) and adding
- 'need_bytes' to the frame would cause us to exceed st->max_frame_size.
+ 'need_bytes' to the frame would cause us to exceed max_frame_size.
2) We called add_header_data, and adding the slice would cause us to exceed
- st->max_frame_size.
+ max_frame_size.
3) We're done encoding the header.
- Thus, len is always <= st->max_frame_size.
- st->max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
+ Thus, len is always <= max_frame_size.
+ max_frame_size is derived from GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE,
which has a max allowable value of 16777215 (see chttp_transport.cc).
Thus, the following assert can be a debug assert. */
GPR_DEBUG_ASSERT(len < 16777316);
@@ -307,174 +79,123 @@ static void fill_header(uint8_t* p, uint8_t type, uint32_t id, size_t len,
*p++ = static_cast<uint8_t>(id);
}
-static size_t current_frame_size(framer_state* st) {
+size_t HPackCompressor::Framer::CurrentFrameSize() const {
const size_t frame_size =
- st->output->length - st->output_length_at_start_of_frame;
- GPR_DEBUG_ASSERT(frame_size <= st->max_frame_size);
+ output_->length - prefix_.output_length_at_start_of_frame;
+ GPR_DEBUG_ASSERT(frame_size <= max_frame_size_);
return frame_size;
}
-/* finish a frame - fill in the previously reserved header */
-static void finish_frame(framer_state* st, int is_header_boundary) {
- uint8_t type = 0xff;
- type =
- static_cast<uint8_t>(st->is_first_frame ? GRPC_CHTTP2_FRAME_HEADER
- : GRPC_CHTTP2_FRAME_CONTINUATION);
- uint8_t flags = 0xff;
- /* per the HTTP/2 spec:
- A HEADERS frame carries the END_STREAM flag that signals the end of a
- stream. However, a HEADERS frame with the END_STREAM flag set can be
- followed by CONTINUATION frames on the same stream. Logically, the
- CONTINUATION frames are part of the HEADERS frame.
- Thus, we add the END_STREAM flag to the HEADER frame (the first frame). */
- flags = static_cast<uint8_t>(st->is_first_frame && st->is_end_of_stream
- ? GRPC_CHTTP2_DATA_FLAG_END_STREAM
- : 0);
- /* per the HTTP/2 spec:
- A HEADERS frame without the END_HEADERS flag set MUST be followed by
- a CONTINUATION frame for the same stream.
- Thus, we add the END_HEADER flag to the last frame. */
- flags |= static_cast<uint8_t>(
- is_header_boundary ? GRPC_CHTTP2_DATA_FLAG_END_HEADERS : 0);
- fill_header(GRPC_SLICE_START_PTR(st->output->slices[st->header_idx]), type,
- st->stream_id, current_frame_size(st), flags);
- st->stats->framing_bytes += kDataFrameHeaderSize;
- st->is_first_frame = 0;
-}
-
-/* begin a new frame: reserve off header space, remember how many bytes we'd
- output before beginning */
-static void begin_frame(framer_state* st) {
+// finish a frame - fill in the previously reserved header
+void HPackCompressor::Framer::FinishFrame(bool is_header_boundary) {
+ const uint8_t type = is_first_frame_ ? GRPC_CHTTP2_FRAME_HEADER
+ : GRPC_CHTTP2_FRAME_CONTINUATION;
+ uint8_t flags = 0;
+ // per the HTTP/2 spec:
+ // A HEADERS frame carries the END_STREAM flag that signals the end of a
+ // stream. However, a HEADERS frame with the END_STREAM flag set can be
+ // followed by CONTINUATION frames on the same stream. Logically, the
+ // CONTINUATION frames are part of the HEADERS frame.
+ // Thus, we add the END_STREAM flag to the HEADER frame (the first frame).
+ if (is_first_frame_ && is_end_of_stream_) {
+ flags |= GRPC_CHTTP2_DATA_FLAG_END_STREAM;
+ }
+ // per the HTTP/2 spec:
+ // A HEADERS frame without the END_HEADERS flag set MUST be followed by
+ // a CONTINUATION frame for the same stream.
+ // Thus, we add the END_HEADER flag to the last frame.
+ if (is_header_boundary) {
+ flags |= GRPC_CHTTP2_DATA_FLAG_END_HEADERS;
+ }
+ FillHeader(GRPC_SLICE_START_PTR(output_->slices[prefix_.header_idx]), type,
+ stream_id_, CurrentFrameSize(), flags);
+ stats_->framing_bytes += kDataFrameHeaderSize;
+ is_first_frame_ = false;
+}
+
+// begin a new frame: reserve off header space, remember how many bytes we'd
+// output before beginning
+HPackCompressor::Framer::FramePrefix HPackCompressor::Framer::BeginFrame() {
grpc_slice reserved;
reserved.refcount = nullptr;
reserved.data.inlined.length = kDataFrameHeaderSize;
- st->header_idx = grpc_slice_buffer_add_indexed(st->output, reserved);
- st->output_length_at_start_of_frame = st->output->length;
+ return FramePrefix{grpc_slice_buffer_add_indexed(output_, reserved),
+ output_->length};
}
-/* make sure that the current frame is of the type desired, and has sufficient
- space to add at least about_to_add bytes -- finishes the current frame if
- needed */
-static void ensure_space(framer_state* st, size_t need_bytes) {
- if (GPR_LIKELY(current_frame_size(st) + need_bytes <= st->max_frame_size)) {
+// make sure that the current frame is of the type desired, and has sufficient
+// space to add at least about_to_add bytes -- finishes the current frame if
+// needed
+void HPackCompressor::Framer::EnsureSpace(size_t need_bytes) {
+ if (GPR_LIKELY(CurrentFrameSize() + need_bytes <= max_frame_size_)) {
return;
}
- finish_frame(st, 0);
- begin_frame(st);
+ FinishFrame(false);
+ prefix_ = BeginFrame();
}
-static void add_header_data(framer_state* st, grpc_slice slice) {
- size_t len = GRPC_SLICE_LENGTH(slice);
- size_t remaining;
+void HPackCompressor::Framer::Add(grpc_slice slice) {
+ const size_t len = GRPC_SLICE_LENGTH(slice);
if (len == 0) return;
- remaining = st->max_frame_size - current_frame_size(st);
+ const size_t remaining = max_frame_size_ - CurrentFrameSize();
if (len <= remaining) {
- st->stats->header_bytes += len;
- grpc_slice_buffer_add(st->output, slice);
+ stats_->header_bytes += len;
+ grpc_slice_buffer_add(output_, slice);
} else {
- st->stats->header_bytes += remaining;
- grpc_slice_buffer_add(st->output, grpc_slice_split_head(&slice, remaining));
- finish_frame(st, 0);
- begin_frame(st);
- add_header_data(st, slice);
+ stats_->header_bytes += remaining;
+ grpc_slice_buffer_add(output_, grpc_slice_split_head(&slice, remaining));
+ FinishFrame(false);
+ prefix_ = BeginFrame();
+ Add(slice);
}
}
-static uint8_t* add_tiny_header_data(framer_state* st, size_t len) {
- ensure_space(st, len);
- st->stats->header_bytes += len;
- return grpc_slice_buffer_tiny_add(st->output, len);
-}
-
-static void evict_entry(grpc_chttp2_hpack_compressor* c) {
- c->tail_remote_index++;
- GPR_ASSERT(c->tail_remote_index > 0);
- GPR_ASSERT(c->table_size >=
- c->table_elem_size[c->tail_remote_index % c->cap_table_elems]);
- GPR_ASSERT(c->table_elems > 0);
- c->table_size = static_cast<uint16_t>(
- c->table_size -
- c->table_elem_size[c->tail_remote_index % c->cap_table_elems]);
- c->table_elems--;
-}
-
-// Reserve space in table for the new element, evict entries if needed.
-// Return the new index of the element. Return 0 to indicate not adding to
-// table.
-static uint32_t prepare_space_for_new_elem(grpc_chttp2_hpack_compressor* c,
- size_t elem_size) {
- uint32_t new_index = c->tail_remote_index + c->table_elems + 1;
- GPR_DEBUG_ASSERT(elem_size < 65536);
-
- // TODO(arjunroy): Re-examine semantics
- if (elem_size > c->max_table_size) {
- while (c->table_size > 0) {
- evict_entry(c);
- }
- return 0;
- }
-
- /* Reserve space for this element in the remote table: if this overflows
- the current table, drop elements until it fits, matching the decompressor
- algorithm */
- while (c->table_size + elem_size > c->max_table_size) {
- evict_entry(c);
- }
- GPR_ASSERT(c->table_elems < c->max_table_size);
- c->table_elem_size[new_index % c->cap_table_elems] =
- static_cast<uint16_t>(elem_size);
- c->table_size = static_cast<uint16_t>(c->table_size + elem_size);
- c->table_elems++;
-
- return new_index;
+uint8_t* HPackCompressor::Framer::AddTiny(size_t len) {
+ EnsureSpace(len);
+ stats_->header_bytes += len;
+ return grpc_slice_buffer_tiny_add(output_, len);
}
// Add a key to the dynamic table. Both key and value will be added to table at
// the decoder.
-static void AddKeyWithIndex(grpc_chttp2_hpack_compressor* c,
- grpc_slice_refcount* key_ref, uint32_t new_index,
- uint32_t key_hash) {
- UpdateAddOrEvict<SliceRefComparator>(c->key_table.entries, key_ref, key_hash,
- new_index);
+void HPackCompressor::AddKeyWithIndex(grpc_slice_refcount* key_ref,
+ uint32_t new_index, uint32_t key_hash) {
+ key_index_.Insert(KeySliceRef(key_ref, key_hash), new_index);
}
/* add an element to the decoder table */
-static void AddElemWithIndex(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- uint32_t new_index, uint32_t elem_hash,
- uint32_t key_hash) {
+void HPackCompressor::AddElemWithIndex(grpc_mdelem elem, uint32_t new_index,
+ uint32_t elem_hash, uint32_t key_hash) {
GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(elem));
- UpdateAddOrEvict<MetadataComparator>(c->elem_table.entries, elem, elem_hash,
- new_index);
- AddKeyWithIndex(c, GRPC_MDKEY(elem).refcount, new_index, key_hash);
+ elem_index_.Insert(KeyElem(elem, elem_hash), new_index);
+ AddKeyWithIndex(GRPC_MDKEY(elem).refcount, new_index, key_hash);
}
-static void add_elem(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- size_t elem_size, uint32_t elem_hash, uint32_t key_hash) {
- uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
+void HPackCompressor::AddElem(grpc_mdelem elem, size_t elem_size,
+ uint32_t elem_hash, uint32_t key_hash) {
+ uint32_t new_index = table_.AllocateIndex(elem_size);
if (new_index != 0) {
- AddElemWithIndex(c, elem, new_index, elem_hash, key_hash);
+ AddElemWithIndex(elem, new_index, elem_hash, key_hash);
}
}
-static void add_key(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- size_t elem_size, uint32_t key_hash) {
- uint32_t new_index = prepare_space_for_new_elem(c, elem_size);
+void HPackCompressor::AddKey(grpc_mdelem elem, size_t elem_size,
+ uint32_t key_hash) {
+ uint32_t new_index = table_.AllocateIndex(elem_size);
if (new_index != 0) {
- AddKeyWithIndex(c, GRPC_MDKEY(elem).refcount, new_index, key_hash);
+ AddKeyWithIndex(GRPC_MDKEY(elem).refcount, new_index, key_hash);
}
}
-static void emit_indexed(grpc_chttp2_hpack_compressor* /*c*/,
- uint32_t elem_index, framer_state* st) {
+void HPackCompressor::Framer::EmitIndexed(uint32_t elem_index) {
GRPC_STATS_INC_HPACK_SEND_INDEXED();
- uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(elem_index, 1);
- GRPC_CHTTP2_WRITE_VARINT(elem_index, 1, 0x80, add_tiny_header_data(st, len),
- len);
+ VarintWriter<1> w(elem_index);
+ w.Write(0x80, AddTiny(w.length()));
}
-struct wire_value {
- wire_value(uint8_t huffman_prefix, bool insert_null_before_wire_value,
- const grpc_slice& slice)
+struct WireValue {
+ WireValue(uint8_t huffman_prefix, bool insert_null_before_wire_value,
+ const grpc_slice& slice)
: data(slice),
huffman_prefix(huffman_prefix),
insert_null_before_wire_value(insert_null_before_wire_value),
@@ -488,124 +209,209 @@ struct wire_value {
const size_t length;
};
-template <bool mdkey_definitely_interned>
-static wire_value get_wire_value(grpc_mdelem elem, bool true_binary_enabled) {
- const bool is_bin_hdr =
- mdkey_definitely_interned
- ? grpc_is_refcounted_slice_binary_header(GRPC_MDKEY(elem))
- : grpc_is_binary_header_internal(GRPC_MDKEY(elem));
- const grpc_slice& value = GRPC_MDVALUE(elem);
+static WireValue GetWireValue(const grpc_slice& value, bool true_binary_enabled,
+ bool is_bin_hdr) {
if (is_bin_hdr) {
if (true_binary_enabled) {
GRPC_STATS_INC_HPACK_SEND_BINARY();
- return wire_value(0x00, true, grpc_slice_ref_internal(value));
+ return WireValue(0x00, true, grpc_slice_ref_internal(value));
} else {
GRPC_STATS_INC_HPACK_SEND_BINARY_BASE64();
- return wire_value(0x80, false,
- grpc_chttp2_base64_encode_and_huffman_compress(value));
+ return WireValue(0x80, false,
+ grpc_chttp2_base64_encode_and_huffman_compress(value));
}
} else {
/* TODO(ctiller): opportunistically compress non-binary headers */
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
- return wire_value(0x00, false, grpc_slice_ref_internal(value));
+ return WireValue(0x00, false, grpc_slice_ref_internal(value));
}
}
-static uint32_t wire_value_length(const wire_value& v) {
- GPR_DEBUG_ASSERT(v.length <= UINT32_MAX);
- return static_cast<uint32_t>(v.length);
-}
+struct DefinitelyInterned {
+ static bool IsBinary(grpc_slice key) {
+ return grpc_is_refcounted_slice_binary_header(key);
+ }
+};
+struct UnsureIfInterned {
+ static bool IsBinary(grpc_slice key) {
+ return grpc_is_binary_header_internal(key);
+ }
+};
-namespace {
-enum class EmitLitHdrType { INC_IDX, NO_IDX };
-
-enum class EmitLitHdrVType { INC_IDX_V, NO_IDX_V };
-} // namespace
-
-template <EmitLitHdrType type>
-static void emit_lithdr(grpc_chttp2_hpack_compressor* /*c*/, uint32_t key_index,
- grpc_mdelem elem, framer_state* st) {
- switch (type) {
- case EmitLitHdrType::INC_IDX:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX();
- break;
- case EmitLitHdrType::NO_IDX:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX();
- break;
+class StringValue {
+ public:
+ template <typename MetadataKeyType>
+ StringValue(MetadataKeyType, grpc_mdelem elem, bool use_true_binary_metadata)
+ : wire_value_(GetWireValue(GRPC_MDVALUE(elem), use_true_binary_metadata,
+ MetadataKeyType::IsBinary(GRPC_MDKEY(elem)))),
+ len_val_(wire_value_.length) {}
+
+ size_t prefix_length() const {
+ return len_val_.length() +
+ (wire_value_.insert_null_before_wire_value ? 1 : 0);
+ }
+
+ void WritePrefix(uint8_t* prefix_data) {
+ len_val_.Write(wire_value_.huffman_prefix, prefix_data);
+ if (wire_value_.insert_null_before_wire_value) {
+ prefix_data[len_val_.length()] = 0;
+ }
}
- const uint32_t len_pfx = type == EmitLitHdrType::INC_IDX
- ? GRPC_CHTTP2_VARINT_LENGTH(key_index, 2)
- : GRPC_CHTTP2_VARINT_LENGTH(key_index, 4);
- const wire_value value =
- get_wire_value<true>(elem, st->use_true_binary_metadata);
- const uint32_t len_val = wire_value_length(value);
- const uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
- GPR_DEBUG_ASSERT(len_pfx + len_val_len < GRPC_SLICE_INLINED_SIZE);
- uint8_t* data = add_tiny_header_data(
- st,
- len_pfx + len_val_len + (value.insert_null_before_wire_value ? 1 : 0));
- switch (type) {
- case EmitLitHdrType::INC_IDX:
- GRPC_CHTTP2_WRITE_VARINT(key_index, 2, 0x40, data, len_pfx);
- break;
- case EmitLitHdrType::NO_IDX:
- GRPC_CHTTP2_WRITE_VARINT(key_index, 4, 0x00, data, len_pfx);
- break;
+
+ const grpc_slice& data() { return wire_value_.data; }
+
+ private:
+ WireValue wire_value_;
+ VarintWriter<1> len_val_;
+};
+
+class BinaryStringValue {
+ public:
+ explicit BinaryStringValue(const grpc_slice& value,
+ bool use_true_binary_metadata)
+ : wire_value_(GetWireValue(value, use_true_binary_metadata, true)),
+ len_val_(wire_value_.length) {}
+
+ size_t prefix_length() const {
+ return len_val_.length() +
+ (wire_value_.insert_null_before_wire_value ? 1 : 0);
}
- GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix, &data[len_pfx],
- len_val_len);
- if (value.insert_null_before_wire_value) {
- data[len_pfx + len_val_len] = 0;
+
+ void WritePrefix(uint8_t* prefix_data) {
+ len_val_.Write(wire_value_.huffman_prefix, prefix_data);
+ if (wire_value_.insert_null_before_wire_value) {
+ prefix_data[len_val_.length()] = 0;
+ }
}
- add_header_data(st, value.data);
-}
-template <EmitLitHdrVType type>
-static void emit_lithdr_v(grpc_chttp2_hpack_compressor* /*c*/, grpc_mdelem elem,
- framer_state* st) {
- switch (type) {
- case EmitLitHdrVType::INC_IDX_V:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
- break;
- case EmitLitHdrVType::NO_IDX_V:
- GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
- break;
+ const grpc_slice& data() { return wire_value_.data; }
+
+ private:
+ WireValue wire_value_;
+ VarintWriter<1> len_val_;
+};
+
+class NonBinaryStringValue {
+ public:
+ explicit NonBinaryStringValue(const grpc_slice& value)
+ : value_(value), len_val_(GRPC_SLICE_LENGTH(value)) {}
+
+ size_t prefix_length() const { return len_val_.length(); }
+
+ void WritePrefix(uint8_t* prefix_data) { len_val_.Write(0x00, prefix_data); }
+
+ const grpc_slice& data() { return value_; }
+
+ private:
+ grpc_slice value_;
+ VarintWriter<1> len_val_;
+};
+
+class StringKey {
+ public:
+ explicit StringKey(grpc_slice key)
+ : key_(key), len_key_(GRPC_SLICE_LENGTH(key)) {}
+
+ size_t prefix_length() const { return 1 + len_key_.length(); }
+
+ void WritePrefix(uint8_t type, uint8_t* data) {
+ data[0] = type;
+ len_key_.Write(0x00, data + 1);
}
+
+ grpc_slice key() const { return key_; }
+
+ private:
+ grpc_slice key_;
+ VarintWriter<1> len_key_;
+};
+
+void HPackCompressor::Framer::EmitLitHdrIncIdx(uint32_t key_index,
+ grpc_mdelem elem) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX();
+ StringValue emit(DefinitelyInterned(), elem, use_true_binary_metadata_);
+ VarintWriter<2> key(key_index);
+ uint8_t* data = AddTiny(key.length() + emit.prefix_length());
+ key.Write(0x40, data);
+ emit.WritePrefix(data + key.length());
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrNotIdx(uint32_t key_index,
+ grpc_mdelem elem) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX();
+ StringValue emit(DefinitelyInterned(), elem, use_true_binary_metadata_);
+ VarintWriter<4> key(key_index);
+ uint8_t* data = AddTiny(key.length() + emit.prefix_length());
+ key.Write(0x00, data);
+ emit.WritePrefix(data + key.length());
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithStringKeyIncIdx(grpc_mdelem elem) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
- const uint32_t len_key =
- static_cast<uint32_t>(GRPC_SLICE_LENGTH(GRPC_MDKEY(elem)));
- const wire_value value =
- type == EmitLitHdrVType::INC_IDX_V
- ? get_wire_value<true>(elem, st->use_true_binary_metadata)
- : get_wire_value<false>(elem, st->use_true_binary_metadata);
- const uint32_t len_val = wire_value_length(value);
- const uint32_t len_key_len = GRPC_CHTTP2_VARINT_LENGTH(len_key, 1);
- const uint32_t len_val_len = GRPC_CHTTP2_VARINT_LENGTH(len_val, 1);
- GPR_DEBUG_ASSERT(len_key <= UINT32_MAX);
- GPR_DEBUG_ASSERT(1 + len_key_len < GRPC_SLICE_INLINED_SIZE);
- uint8_t* key_buf = add_tiny_header_data(st, 1 + len_key_len);
- key_buf[0] = type == EmitLitHdrVType::INC_IDX_V ? 0x40 : 0x00;
- GRPC_CHTTP2_WRITE_VARINT(len_key, 1, 0x00, &key_buf[1], len_key_len);
- add_header_data(st, grpc_slice_ref_internal(GRPC_MDKEY(elem)));
- uint8_t* value_buf = add_tiny_header_data(
- st, len_val_len + (value.insert_null_before_wire_value ? 1 : 0));
- GRPC_CHTTP2_WRITE_VARINT(len_val, 1, value.huffman_prefix, value_buf,
- len_val_len);
- if (value.insert_null_before_wire_value) {
- value_buf[len_val_len] = 0;
- }
- add_header_data(st, value.data);
+ StringKey key(GRPC_MDKEY(elem));
+ key.WritePrefix(0x40, AddTiny(key.prefix_length()));
+ Add(grpc_slice_ref_internal(key.key()));
+ StringValue emit(DefinitelyInterned(), elem, use_true_binary_metadata_);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithNonBinaryStringKeyIncIdx(
+ const grpc_slice& key_slice, const grpc_slice& value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_INCIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(key_slice);
+ key.WritePrefix(0x40, AddTiny(key.prefix_length()));
+ Add(grpc_slice_ref_internal(key.key()));
+ NonBinaryStringValue emit(value_slice);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(grpc_slice_ref_internal(emit.data()));
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithStringKeyNotIdx(grpc_mdelem elem) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(GRPC_MDKEY(elem));
+ key.WritePrefix(0x00, AddTiny(key.prefix_length()));
+ Add(grpc_slice_ref_internal(key.key()));
+ StringValue emit(UnsureIfInterned(), elem, use_true_binary_metadata_);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
}
-static void emit_advertise_table_size_change(grpc_chttp2_hpack_compressor* c,
- framer_state* st) {
- uint32_t len = GRPC_CHTTP2_VARINT_LENGTH(c->max_table_size, 3);
- GRPC_CHTTP2_WRITE_VARINT(c->max_table_size, 3, 0x20,
- add_tiny_header_data(st, len), len);
- c->advertise_table_size_change = 0;
+void HPackCompressor::Framer::EmitLitHdrWithBinaryStringKeyNotIdx(
+ const grpc_slice& key_slice, const grpc_slice& value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(key_slice);
+ key.WritePrefix(0x00, AddTiny(key.prefix_length()));
+ Add(grpc_slice_ref_internal(key.key()));
+ BinaryStringValue emit(value_slice, use_true_binary_metadata_);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(emit.data());
+}
+
+void HPackCompressor::Framer::EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ const grpc_slice& key_slice, const grpc_slice& value_slice) {
+ GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
+ GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
+ StringKey key(key_slice);
+ key.WritePrefix(0x00, AddTiny(key.prefix_length()));
+ Add(grpc_slice_ref_internal(key.key()));
+ NonBinaryStringValue emit(value_slice);
+ emit.WritePrefix(AddTiny(emit.prefix_length()));
+ Add(grpc_slice_ref_internal(emit.data()));
+}
+
+void HPackCompressor::Framer::AdvertiseTableSizeChange() {
+ VarintWriter<3> w(compressor_->table_.max_size());
+ w.Write(0x20, AddTiny(w.length()));
}
-static void GPR_ATTRIBUTE_NOINLINE hpack_enc_log(grpc_mdelem elem) {
+void HPackCompressor::Framer::Log(grpc_mdelem elem) {
char* k = grpc_slice_to_c_string(GRPC_MDKEY(elem));
char* v = nullptr;
if (grpc_is_binary_header_internal(GRPC_MDKEY(elem))) {
@@ -623,11 +429,6 @@ static void GPR_ATTRIBUTE_NOINLINE hpack_enc_log(grpc_mdelem elem) {
gpr_free(v);
}
-static uint32_t dynidx(grpc_chttp2_hpack_compressor* c, uint32_t elem_index) {
- return 1 + GRPC_CHTTP2_LAST_STATIC_ENTRY + c->tail_remote_index +
- c->table_elems - elem_index;
-}
-
struct EmitIndexedStatus {
EmitIndexedStatus() = default;
EmitIndexedStatus(uint32_t elem_hash, bool emitted, bool can_add)
@@ -637,264 +438,173 @@ struct EmitIndexedStatus {
const bool can_add = false;
};
-static EmitIndexedStatus maybe_emit_indexed(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem elem,
- framer_state* st) {
- const uint32_t elem_hash =
- GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED
- ? reinterpret_cast<grpc_core::InternedMetadata*>(
- GRPC_MDELEM_DATA(elem))
- ->hash()
- : reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(elem))
- ->hash();
- /* Update filter to see if we can perhaps add this elem. */
- const uint32_t popularity_hash = UpdateHashtablePopularity(c, elem_hash);
- /* is this elem currently in the decoders table? */
- HpackEncoderIndex indices_key;
- if (GetMatchingIndex<MetadataComparator>(c->elem_table.entries, elem,
- elem_hash, &indices_key) &&
- indices_key > c->tail_remote_index) {
- emit_indexed(c, dynidx(c, indices_key), st);
- return EmitIndexedStatus(elem_hash, true, false);
- }
- /* Didn't hit either cuckoo index, so no emit. */
- return EmitIndexedStatus(elem_hash, false,
- CanAddToHashtable(c, popularity_hash));
-}
-
-static void emit_maybe_add(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- framer_state* st, uint32_t indices_key,
- bool should_add_elem, size_t decoder_space_usage,
- uint32_t elem_hash, uint32_t key_hash) {
- if (should_add_elem) {
- emit_lithdr<EmitLitHdrType::INC_IDX>(c, dynidx(c, indices_key), elem, st);
- add_elem(c, elem, decoder_space_usage, elem_hash, key_hash);
- } else {
- emit_lithdr<EmitLitHdrType::NO_IDX>(c, dynidx(c, indices_key), elem, st);
- }
-}
-
/* encode an mdelem */
-static void hpack_enc(grpc_chttp2_hpack_compressor* c, grpc_mdelem elem,
- framer_state* st) {
+void HPackCompressor::Framer::EncodeDynamic(grpc_mdelem elem) {
const grpc_slice& elem_key = GRPC_MDKEY(elem);
- /* User-provided key len validated in grpc_validate_header_key_is_legal(). */
+ // User-provided key len validated in grpc_validate_header_key_is_legal().
GPR_DEBUG_ASSERT(GRPC_SLICE_LENGTH(elem_key) > 0);
- /* Header ordering: all reserved headers (prefixed with ':') must precede
- * regular headers. This can be a debug assert, since:
- * 1) User cannot give us ':' headers (grpc_validate_header_key_is_legal()).
- * 2) grpc filters/core should be checked during debug builds. */
+ // Header ordering: all reserved headers (prefixed with ':') must precede
+ // regular headers. This can be a debug assert, since:
+ // 1) User cannot give us ':' headers (grpc_validate_header_key_is_legal()).
+ // 2) grpc filters/core should be checked during debug builds. */
#ifndef NDEBUG
if (GRPC_SLICE_START_PTR(elem_key)[0] != ':') { /* regular header */
- st->seen_regular_header = 1;
+ seen_regular_header_ = true;
} else {
GPR_DEBUG_ASSERT(
- st->seen_regular_header == 0 &&
+ !seen_regular_header_ &&
"Reserved header (colon-prefixed) happening after regular ones.");
}
#endif
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- hpack_enc_log(elem);
+ Log(elem);
}
const bool elem_interned = GRPC_MDELEM_IS_INTERNED(elem);
const bool key_interned = elem_interned || grpc_slice_is_interned(elem_key);
- /* Key is not interned, emit literals. */
+ // Key is not interned, emit literals.
if (!key_interned) {
- emit_lithdr_v<EmitLitHdrVType::NO_IDX_V>(c, elem, st);
+ EmitLitHdrWithStringKeyNotIdx(elem);
return;
}
/* Interned metadata => maybe already indexed. */
- const EmitIndexedStatus ret =
- elem_interned ? maybe_emit_indexed(c, elem, st) : EmitIndexedStatus();
- if (ret.emitted) {
- return;
+ uint32_t elem_hash = 0;
+ if (elem_interned) {
+ // Update filter to see if we can perhaps add this elem.
+ elem_hash =
+ GRPC_MDELEM_STORAGE(elem) == GRPC_MDELEM_STORAGE_INTERNED
+ ? reinterpret_cast<InternedMetadata*>(GRPC_MDELEM_DATA(elem))
+ ->hash()
+ : reinterpret_cast<StaticMetadata*>(GRPC_MDELEM_DATA(elem))->hash();
+ bool can_add_to_hashtable =
+ compressor_->filter_elems_.AddElement(elem_hash % kNumFilterValues);
+ /* is this elem currently in the decoders table? */
+ auto indices_key =
+ compressor_->elem_index_.Lookup(KeyElem(elem, elem_hash));
+ if (indices_key.has_value() &&
+ compressor_->table_.ConvertableToDynamicIndex(*indices_key)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(*indices_key));
+ return;
+ }
+ /* Didn't hit either cuckoo index, so no emit. */
+ if (!can_add_to_hashtable) elem_hash = 0;
}
+
/* should this elem be in the table? */
const size_t decoder_space_usage =
- grpc_chttp2_get_size_in_hpack_table(elem, st->use_true_binary_metadata);
+ MetadataSizeInHPackTable(elem, use_true_binary_metadata_);
const bool decoder_space_available =
decoder_space_usage < kMaxDecoderSpaceUsage;
const bool should_add_elem =
- elem_interned && decoder_space_available && ret.can_add;
- const uint32_t elem_hash = ret.elem_hash;
+ elem_interned && decoder_space_available && elem_hash != 0;
/* no hits for the elem... maybe there's a key? */
const uint32_t key_hash = elem_key.refcount->Hash(elem_key);
- HpackEncoderIndex indices_key;
- if (GetMatchingIndex<SliceRefComparator>(
- c->key_table.entries, elem_key.refcount, key_hash, &indices_key) &&
- indices_key > c->tail_remote_index) {
- emit_maybe_add(c, elem, st, indices_key, should_add_elem,
- decoder_space_usage, elem_hash, key_hash);
+ auto indices_key =
+ compressor_->key_index_.Lookup(KeySliceRef(elem_key.refcount, key_hash));
+ if (indices_key.has_value() &&
+ compressor_->table_.ConvertableToDynamicIndex(*indices_key)) {
+ if (should_add_elem) {
+ EmitLitHdrIncIdx(compressor_->table_.DynamicIndex(*indices_key), elem);
+ compressor_->AddElem(elem, decoder_space_usage, elem_hash, key_hash);
+ } else {
+ EmitLitHdrNotIdx(compressor_->table_.DynamicIndex(*indices_key), elem);
+ }
return;
}
/* no elem, key in the table... fall back to literal emission */
const bool should_add_key = !elem_interned && decoder_space_available;
if (should_add_elem || should_add_key) {
- emit_lithdr_v<EmitLitHdrVType::INC_IDX_V>(c, elem, st);
+ EmitLitHdrWithStringKeyIncIdx(elem);
} else {
- emit_lithdr_v<EmitLitHdrVType::NO_IDX_V>(c, elem, st);
+ EmitLitHdrWithStringKeyNotIdx(elem);
}
if (should_add_elem) {
- add_elem(c, elem, decoder_space_usage, elem_hash, key_hash);
+ compressor_->AddElem(elem, decoder_space_usage, elem_hash, key_hash);
} else if (should_add_key) {
- add_key(c, elem, decoder_space_usage, key_hash);
+ compressor_->AddKey(elem, decoder_space_usage, key_hash);
}
}
-#define STRLEN_LIT(x) (sizeof(x) - 1)
-#define TIMEOUT_KEY "grpc-timeout"
+void HPackCompressor::Framer::Encode(TeMetadata, TeMetadata::ValueType value) {
+ GPR_ASSERT(value == TeMetadata::ValueType::kTrailers);
+ EncodeAlwaysIndexed(
+ &compressor_->te_index_, GRPC_MDSTR_TE, GRPC_MDSTR_TRAILERS,
+ 2 /* te */ + 8 /* trailers */ + hpack_constants::kEntryOverhead);
+}
+
+void HPackCompressor::Framer::EncodeAlwaysIndexed(uint32_t* index,
+ const grpc_slice& key,
+ const grpc_slice& value,
+ uint32_t transport_length) {
+ if (compressor_->table_.ConvertableToDynamicIndex(*index)) {
+ EmitIndexed(compressor_->table_.DynamicIndex(*index));
+ } else {
+ *index = compressor_->table_.AllocateIndex(transport_length);
+ EmitLitHdrWithNonBinaryStringKeyIncIdx(key, value);
+ }
+}
-static void deadline_enc(grpc_chttp2_hpack_compressor* c, grpc_millis deadline,
- framer_state* st) {
+void HPackCompressor::Framer::Encode(GrpcTimeoutMetadata,
+ grpc_millis deadline) {
char timeout_str[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
grpc_mdelem mdelem;
- grpc_http2_encode_timeout(deadline - grpc_core::ExecCtx::Get()->Now(),
- timeout_str);
- mdelem = grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_TIMEOUT, grpc_core::UnmanagedMemorySlice(timeout_str));
- hpack_enc(c, mdelem, st);
+ grpc_http2_encode_timeout(deadline - ExecCtx::Get()->Now(), timeout_str);
+ mdelem = grpc_mdelem_from_slices(GRPC_MDSTR_GRPC_TIMEOUT,
+ UnmanagedMemorySlice(timeout_str));
+ EncodeDynamic(mdelem);
GRPC_MDELEM_UNREF(mdelem);
}
-static uint32_t elems_for_bytes(uint32_t bytes) { return (bytes + 31) / 32; }
-
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c) {
- memset(c, 0, sizeof(*c));
- c->max_table_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
- c->cap_table_elems = elems_for_bytes(c->max_table_size);
- c->max_table_elems = c->cap_table_elems;
- c->max_usable_size = GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE;
- const size_t alloc_size = sizeof(*c->table_elem_size) * c->cap_table_elems;
- c->table_elem_size = static_cast<uint16_t*>(gpr_malloc(alloc_size));
- memset(c->table_elem_size, 0, alloc_size);
-}
-
-void grpc_chttp2_hpack_compressor_destroy(grpc_chttp2_hpack_compressor* c) {
- for (int i = 0; i < GRPC_CHTTP2_HPACKC_NUM_VALUES; i++) {
- auto* const key = GetEntry<grpc_slice_refcount*>(c->key_table.entries, i);
- if (key != nullptr) {
- key->Unref();
- }
- GRPC_MDELEM_UNREF(GetEntry<grpc_mdelem>(c->elem_table.entries, i));
+void HPackCompressor::Framer::Encode(UserAgentMetadata, const Slice& slice) {
+ if (!slice.is_equivalent(compressor_->user_agent_)) {
+ compressor_->user_agent_ = slice.Ref();
+ compressor_->user_agent_index_ = 0;
}
- gpr_free(c->table_elem_size);
+ EncodeAlwaysIndexed(
+ &compressor_->user_agent_index_, GRPC_MDSTR_USER_AGENT, slice.c_slice(),
+ 10 /* user-agent */ + slice.size() + hpack_constants::kEntryOverhead);
}
-void grpc_chttp2_hpack_compressor_set_max_usable_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
- c->max_usable_size = max_table_size;
- grpc_chttp2_hpack_compressor_set_max_table_size(
- c, GPR_MIN(c->max_table_size, max_table_size));
+void HPackCompressor::SetMaxUsableSize(uint32_t max_table_size) {
+ max_usable_size_ = max_table_size;
+ SetMaxTableSize(std::min(table_.max_size(), max_table_size));
}
-static void rebuild_elems(grpc_chttp2_hpack_compressor* c, uint32_t new_cap) {
- uint16_t* table_elem_size =
- static_cast<uint16_t*>(gpr_malloc(sizeof(*table_elem_size) * new_cap));
- uint32_t i;
-
- memset(table_elem_size, 0, sizeof(*table_elem_size) * new_cap);
- GPR_ASSERT(c->table_elems <= new_cap);
-
- for (i = 0; i < c->table_elems; i++) {
- uint32_t ofs = c->tail_remote_index + i + 1;
- table_elem_size[ofs % new_cap] =
- c->table_elem_size[ofs % c->cap_table_elems];
+void HPackCompressor::SetMaxTableSize(uint32_t max_table_size) {
+ if (table_.SetMaxSize(std::min(max_usable_size_, max_table_size))) {
+ advertise_table_size_change_ = true;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "set max table size from encoder to %d",
+ max_table_size);
+ }
}
-
- c->cap_table_elems = new_cap;
- gpr_free(c->table_elem_size);
- c->table_elem_size = table_elem_size;
}
-void grpc_chttp2_hpack_compressor_set_max_table_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size) {
- max_table_size = GPR_MIN(max_table_size, c->max_usable_size);
- if (max_table_size == c->max_table_size) {
- return;
- }
- while (c->table_size > 0 && c->table_size > max_table_size) {
- evict_entry(c);
- }
- c->max_table_size = max_table_size;
- c->max_table_elems = elems_for_bytes(max_table_size);
- if (c->max_table_elems > c->cap_table_elems) {
- rebuild_elems(c, GPR_MAX(c->max_table_elems, 2 * c->cap_table_elems));
- } else if (c->max_table_elems < c->cap_table_elems / 3) {
- uint32_t new_cap = GPR_MAX(c->max_table_elems, 16);
- if (new_cap != c->cap_table_elems) {
- rebuild_elems(c, new_cap);
- }
- }
- c->advertise_table_size_change = 1;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "set max table size from encoder to %d", max_table_size);
+HPackCompressor::Framer::Framer(const EncodeHeaderOptions& options,
+ HPackCompressor* compressor,
+ grpc_slice_buffer* output)
+ : max_frame_size_(options.max_frame_size),
+ use_true_binary_metadata_(options.use_true_binary_metadata),
+ is_end_of_stream_(options.is_end_of_stream),
+ stream_id_(options.stream_id),
+ output_(output),
+ stats_(options.stats),
+ compressor_(compressor),
+ prefix_(BeginFrame()) {
+ if (y_absl::exchange(compressor_->advertise_table_size_change_, false)) {
+ AdvertiseTableSizeChange();
}
}
-void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem** extra_headers,
- size_t extra_headers_size,
- grpc_metadata_batch* metadata,
- const grpc_encode_header_options* options,
- grpc_slice_buffer* outbuf) {
- /* grpc_chttp2_encode_header is called by FlushInitial/TrailingMetadata in
- writing.cc. Specifically, on streams returned by NextStream(), which
- returns streams from the list GRPC_CHTTP2_LIST_WRITABLE. The only way to be
- added to the list is via grpc_chttp2_list_add_writable_stream(), which
- validates that stream_id is not 0. So, this can be a debug assert. */
- GPR_DEBUG_ASSERT(options->stream_id != 0);
- framer_state st;
-#ifndef NDEBUG
- st.seen_regular_header = 0;
-#endif
- st.stream_id = options->stream_id;
- st.output = outbuf;
- st.is_first_frame = 1;
- st.stats = options->stats;
- st.max_frame_size = options->max_frame_size;
- st.use_true_binary_metadata = options->use_true_binary_metadata;
- st.is_end_of_stream = options->is_eof;
-
- /* Encode a metadata batch; store the returned values, representing
- a metadata element that needs to be unreffed back into the metadata
- slot. THIS MAY NOT BE THE SAME ELEMENT (if a decoder table slot got
- updated). After this loop, we'll do a batch unref of elements. */
- begin_frame(&st);
- if (c->advertise_table_size_change != 0) {
- emit_advertise_table_size_change(c, &st);
- }
- for (size_t i = 0; i < extra_headers_size; ++i) {
- grpc_mdelem md = *extra_headers[i];
- const bool is_static =
- GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC;
- uintptr_t static_index;
- if (is_static &&
- (static_index =
- reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md))
- ->StaticIndex()) < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- emit_indexed(c, static_cast<uint32_t>(static_index + 1), &st);
- } else {
- hpack_enc(c, md, &st);
+void HPackCompressor::Framer::Encode(grpc_mdelem md) {
+ if (GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC) {
+ const uintptr_t static_index =
+ reinterpret_cast<StaticMetadata*>(GRPC_MDELEM_DATA(md))->StaticIndex();
+ if (static_index < hpack_constants::kLastStaticEntry) {
+ EmitIndexed(static_cast<uint32_t>(static_index + 1));
+ return;
}
}
- grpc_metadata_batch_assert_ok(metadata);
- for (grpc_linked_mdelem* l = metadata->list.head; l; l = l->next) {
- const bool is_static =
- GRPC_MDELEM_STORAGE(l->md) == GRPC_MDELEM_STORAGE_STATIC;
- uintptr_t static_index;
- if (is_static &&
- (static_index = reinterpret_cast<grpc_core::StaticMetadata*>(
- GRPC_MDELEM_DATA(l->md))
- ->StaticIndex()) < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- emit_indexed(c, static_cast<uint32_t>(static_index + 1), &st);
- } else {
- hpack_enc(c, l->md, &st);
- }
- }
- grpc_millis deadline = metadata->deadline;
- if (deadline != GRPC_MILLIS_INF_FUTURE) {
- deadline_enc(c, deadline, &st);
- }
-
- finish_frame(&st, 1);
+ EncodeDynamic(md);
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
index 5093f80ae2b..f7eaeb28d42 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder.h
@@ -23,85 +23,287 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/ext/transport/chttp2/transport/frame.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder_index.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h"
+#include "src/core/ext/transport/chttp2/transport/popularity_count.h"
#include "src/core/lib/transport/metadata.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport.h"
-// This should be <= 8. We use 6 to save space.
-#define GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS 6
-#define GRPC_CHTTP2_HPACKC_NUM_VALUES (1 << GRPC_CHTTP2_HPACKC_NUM_VALUES_BITS)
-/* initial table size, per spec */
-#define GRPC_CHTTP2_HPACKC_INITIAL_TABLE_SIZE 4096
-/* maximum table size we'll actually use */
-#define GRPC_CHTTP2_HPACKC_MAX_TABLE_SIZE (1024 * 1024)
-
extern grpc_core::TraceFlag grpc_http_trace;
-struct grpc_chttp2_hpack_compressor {
- uint32_t max_table_size;
- uint32_t max_table_elems;
- uint32_t cap_table_elems;
- /** maximum number of bytes we'll use for the decode table (to guard against
- peers ooming us by setting decode table size high) */
- uint32_t max_usable_size;
- /* one before the lowest usable table index */
- uint32_t tail_remote_index;
- uint32_t table_size;
- uint32_t table_elems;
- uint16_t* table_elem_size;
- /** if non-zero, advertise to the decoder that we'll start using a table
- of this size */
- uint8_t advertise_table_size_change;
-
- /* filter tables for elems: this tables provides an approximate
- popularity count for particular hashes, and are used to determine whether
- a new literal should be added to the compression table or not.
- They track a single integer that counts how often a particular value has
- been seen. When that count reaches max (255), all values are halved. */
- uint32_t filter_elems_sum;
- uint8_t filter_elems[GRPC_CHTTP2_HPACKC_NUM_VALUES];
-
- /* entry tables for keys & elems: these tables track values that have been
- seen and *may* be in the decompressor table */
- struct {
- struct {
- grpc_mdelem value;
- uint32_t index;
- } entries[GRPC_CHTTP2_HPACKC_NUM_VALUES];
- } elem_table; /* Metadata table management */
- struct {
- struct {
- /* Only store the slice refcount - we do not need the byte buffer or
- length of the slice since we only need to store a mapping between the
- identity of the slice and the corresponding HPACK index. Since the
- slice *must* be static or interned, the refcount is sufficient to
- establish identity. */
- grpc_slice_refcount* value;
- uint32_t index;
- } entries[GRPC_CHTTP2_HPACKC_NUM_VALUES];
- } key_table; /* Key table management */
+namespace grpc_core {
+
+// Wrapper to take an array of mdelems and make them encodable
+class MetadataArray {
+ public:
+ MetadataArray(grpc_mdelem** elems, size_t count)
+ : elems_(elems), count_(count) {}
+
+ template <typename Encoder>
+ void Encode(Encoder* encoder) const {
+ for (size_t i = 0; i < count_; i++) {
+ encoder->Encode(*elems_[i]);
+ }
+ }
+
+ private:
+ grpc_mdelem** elems_;
+ size_t count_;
+};
+
+namespace metadata_detail {
+template <typename A, typename B>
+class ConcatMetadata {
+ public:
+ ConcatMetadata(const A& a, const B& b) : a_(a), b_(b) {}
+
+ template <typename Encoder>
+ void Encode(Encoder* encoder) const {
+ a_.Encode(encoder);
+ b_.Encode(encoder);
+ }
+
+ private:
+ const A& a_;
+ const B& b_;
};
+} // namespace metadata_detail
+
+template <typename A, typename B>
+metadata_detail::ConcatMetadata<A, B> ConcatMetadata(const A& a, const B& b) {
+ return metadata_detail::ConcatMetadata<A, B>(a, b);
+}
+
+class HPackCompressor {
+ public:
+ HPackCompressor() = default;
+ ~HPackCompressor() = default;
+
+ // Maximum table size we'll actually use.
+ static constexpr uint32_t kMaxTableSize = 1024 * 1024;
+
+ void SetMaxTableSize(uint32_t max_table_size);
+ void SetMaxUsableSize(uint32_t max_table_size);
+
+ uint32_t test_only_table_size() const {
+ return table_.test_only_table_size();
+ }
+
+ struct EncodeHeaderOptions {
+ uint32_t stream_id;
+ bool is_end_of_stream;
+ bool use_true_binary_metadata;
+ size_t max_frame_size;
+ grpc_transport_one_way_stats* stats;
+ };
+
+ template <typename HeaderSet>
+ void EncodeHeaders(const EncodeHeaderOptions& options,
+ const HeaderSet& headers, grpc_slice_buffer* output) {
+ Framer framer(options, this, output);
+ headers.Encode(&framer);
+ }
+
+ class Framer {
+ public:
+ Framer(const EncodeHeaderOptions& options, HPackCompressor* compressor,
+ grpc_slice_buffer* output);
+ ~Framer() { FinishFrame(true); }
+
+ Framer(const Framer&) = delete;
+ Framer& operator=(const Framer&) = delete;
+
+ void Encode(grpc_mdelem md);
+ void Encode(GrpcTimeoutMetadata, grpc_millis deadline);
+ void Encode(TeMetadata, TeMetadata::ValueType value);
+ void Encode(UserAgentMetadata, const Slice& slice);
+ void Encode(GrpcMessageMetadata, const Slice& slice) {
+ if (slice.empty()) return;
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ StaticSlice::FromStaticString("grpc-message").c_slice(),
+ slice.c_slice());
+ }
+ template <typename Which>
+ void Encode(Which, const Slice& slice) {
+ if (y_absl::EndsWith(Which::key(), "-bin")) {
+ EmitLitHdrWithBinaryStringKeyNotIdx(
+ StaticSlice::FromStaticString(Which::key()).c_slice(),
+ slice.c_slice());
+ } else {
+ EmitLitHdrWithNonBinaryStringKeyNotIdx(
+ StaticSlice::FromStaticString(Which::key()).c_slice(),
+ slice.c_slice());
+ }
+ }
+
+ private:
+ struct FramePrefix {
+ // index (in output_) of the header for the frame
+ size_t header_idx;
+ // number of bytes in 'output' when we started the frame - used to
+ // calculate frame length
+ size_t output_length_at_start_of_frame;
+ };
+
+ FramePrefix BeginFrame();
+ void FinishFrame(bool is_header_boundary);
+ void EnsureSpace(size_t need_bytes);
+
+ void AdvertiseTableSizeChange();
+ void EmitIndexed(uint32_t index);
+ void EncodeDynamic(grpc_mdelem elem);
+ static GPR_ATTRIBUTE_NOINLINE void Log(grpc_mdelem elem);
+
+ void EmitLitHdrIncIdx(uint32_t key_index, grpc_mdelem elem);
+ void EmitLitHdrNotIdx(uint32_t key_index, grpc_mdelem elem);
+ void EmitLitHdrWithStringKeyIncIdx(grpc_mdelem elem);
+ void EmitLitHdrWithNonBinaryStringKeyIncIdx(const grpc_slice& key_slice,
+ const grpc_slice& value_slice);
+ void EmitLitHdrWithBinaryStringKeyNotIdx(const grpc_slice& key_slice,
+ const grpc_slice& value_slice);
+ void EmitLitHdrWithNonBinaryStringKeyNotIdx(const grpc_slice& key_slice,
+ const grpc_slice& value_slice);
+ void EmitLitHdrWithStringKeyNotIdx(grpc_mdelem elem);
-void grpc_chttp2_hpack_compressor_init(grpc_chttp2_hpack_compressor* c);
-void grpc_chttp2_hpack_compressor_destroy(grpc_chttp2_hpack_compressor* c);
-void grpc_chttp2_hpack_compressor_set_max_table_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
-void grpc_chttp2_hpack_compressor_set_max_usable_size(
- grpc_chttp2_hpack_compressor* c, uint32_t max_table_size);
-
-struct grpc_encode_header_options {
- uint32_t stream_id;
- bool is_eof;
- bool use_true_binary_metadata;
- size_t max_frame_size;
- grpc_transport_one_way_stats* stats;
+ void EncodeAlwaysIndexed(uint32_t* index, const grpc_slice& key,
+ const grpc_slice& value,
+ uint32_t transport_length);
+
+ size_t CurrentFrameSize() const;
+ void Add(grpc_slice slice);
+ uint8_t* AddTiny(size_t len);
+
+ // maximum size of a frame
+ const size_t max_frame_size_;
+ bool is_first_frame_ = true;
+ const bool use_true_binary_metadata_;
+ const bool is_end_of_stream_;
+ // output stream id
+ const uint32_t stream_id_;
+#ifndef NDEBUG
+ // have we seen a regular (non-colon-prefixed) header yet?
+ bool seen_regular_header_ = false;
+#endif
+ grpc_slice_buffer* const output_;
+ grpc_transport_one_way_stats* const stats_;
+ HPackCompressor* const compressor_;
+ FramePrefix prefix_;
+ };
+
+ private:
+ static constexpr size_t kNumFilterValues = 64;
+
+ void AddKeyWithIndex(grpc_slice_refcount* key_ref, uint32_t new_index,
+ uint32_t key_hash);
+ void AddElemWithIndex(grpc_mdelem elem, uint32_t new_index,
+ uint32_t elem_hash, uint32_t key_hash);
+ void AddElem(grpc_mdelem elem, size_t elem_size, uint32_t elem_hash,
+ uint32_t key_hash);
+ void AddKey(grpc_mdelem elem, size_t elem_size, uint32_t key_hash);
+
+ // maximum number of bytes we'll use for the decode table (to guard against
+ // peers ooming us by setting decode table size high)
+ uint32_t max_usable_size_ = hpack_constants::kInitialTableSize;
+ // if non-zero, advertise to the decoder that we'll start using a table
+ // of this size
+ bool advertise_table_size_change_ = false;
+ HPackEncoderTable table_;
+
+ // filter tables for elems: this tables provides an approximate
+ // popularity count for particular hashes, and are used to determine whether
+ // a new literal should be added to the compression table or not.
+ // They track a single integer that counts how often a particular value has
+ // been seen. When that count reaches max (255), all values are halved.
+ PopularityCount<kNumFilterValues> filter_elems_;
+
+ class KeyElem {
+ public:
+ class Stored {
+ public:
+ Stored() : elem_(GRPC_MDNULL) {}
+ explicit Stored(grpc_mdelem elem) : elem_(GRPC_MDELEM_REF(elem)) {}
+ Stored(const Stored& other) : elem_(GRPC_MDELEM_REF(other.elem_)) {}
+ Stored& operator=(Stored other) {
+ std::swap(elem_, other.elem_);
+ return *this;
+ }
+ ~Stored() { GRPC_MDELEM_UNREF(elem_); }
+
+ const grpc_mdelem& elem() const { return elem_; }
+
+ bool operator==(const Stored& other) const noexcept {
+ return elem_.payload == other.elem_.payload;
+ }
+
+ private:
+ grpc_mdelem elem_;
+ };
+
+ KeyElem(grpc_mdelem elem, uint32_t hash) : elem_(elem), hash_(hash) {}
+ KeyElem(const KeyElem&);
+ KeyElem& operator=(const KeyElem&);
+
+ uint32_t hash() const {
+ // TODO(ctiller): unify this with what's in the cc file when we move this
+ // code to c++
+ return hash_ >> 6;
+ }
+
+ Stored stored() const { return Stored(elem_); }
+
+ bool operator==(const Stored& stored) const noexcept {
+ return elem_.payload == stored.elem().payload;
+ }
+
+ private:
+ grpc_mdelem elem_;
+ uint32_t hash_;
+ };
+
+ class KeySliceRef {
+ public:
+ using Stored = RefCountedPtr<grpc_slice_refcount>;
+
+ KeySliceRef(grpc_slice_refcount* ref, uint32_t hash)
+ : ref_(ref), hash_(hash) {}
+ KeySliceRef(const KeySliceRef&) = delete;
+ KeySliceRef& operator=(const KeySliceRef&) = delete;
+
+ uint32_t hash() const {
+ // TODO(ctiller): unify this with what's in the cc file when we move this
+ // code to c++
+ return hash_ >> 6;
+ }
+
+ Stored stored() const {
+ ref_->Ref();
+ return Stored(ref_);
+ }
+
+ bool operator==(const Stored& stored) const noexcept {
+ return ref_ == stored.get();
+ }
+
+ private:
+ grpc_slice_refcount* ref_;
+ uint32_t hash_;
+ };
+
+ // entry tables for keys & elems: these tables track values that have been
+ // seen and *may* be in the decompressor table
+ HPackEncoderIndex<KeyElem, kNumFilterValues> elem_index_;
+ HPackEncoderIndex<KeySliceRef, kNumFilterValues> key_index_;
+ // Index into table_ for the te:trailers metadata element
+ uint32_t te_index_ = 0;
+ // Index into table_ for the user-agent metadata element
+ uint32_t user_agent_index_ = 0;
+ // The user-agent string referred to by user_agent_index_
+ Slice user_agent_;
};
-void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c,
- grpc_mdelem** extra_headers,
- size_t extra_headers_size,
- grpc_metadata_batch* metadata,
- const grpc_encode_header_options* options,
- grpc_slice_buffer* outbuf);
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h
new file mode 100644
index 00000000000..f3e5003bcda
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_index.h
@@ -0,0 +1,107 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_INDEX_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_INDEX_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/types/optional.h"
+
+namespace grpc_core {
+
+// A fixed size mapping of a key to a chronologically ordered index
+template <typename Key, size_t kNumEntries>
+class HPackEncoderIndex {
+ public:
+ using Index = uint32_t;
+
+ HPackEncoderIndex() : entries_{} {}
+
+ // If key exists in the table, update it to a new index.
+ // If it does not and there is an empty slot, add it to the index.
+ // Finally, if it does not and there is no empty slot, evict the oldest
+ // conflicting member.
+ void Insert(const Key& key, Index new_index) {
+ auto* const cuckoo_first = first_slot(key);
+ if (cuckoo_first->UpdateOrAdd(key, new_index)) return;
+ auto* const cuckoo_second = second_slot(key);
+ if (cuckoo_second->UpdateOrAdd(key, new_index)) return;
+ auto* const clobber = Older(cuckoo_first, cuckoo_second);
+ clobber->key = key.stored();
+ clobber->index = new_index;
+ }
+
+ // Lookup key and return its index, or return empty if it's not in this table.
+ y_absl::optional<Index> Lookup(const Key& key) {
+ auto* const cuckoo_first = first_slot(key);
+ if (key == cuckoo_first->key) return cuckoo_first->index;
+ auto* const cuckoo_second = second_slot(key);
+ if (key == cuckoo_second->key) return cuckoo_second->index;
+ return {};
+ }
+
+ private:
+ using StoredKey = typename Key::Stored;
+
+ // One entry in the index
+ struct Entry {
+ Entry() : key{}, index{} {};
+
+ StoredKey key;
+ Index index;
+
+ // Update this entry if it matches key, otherwise if it's empty add it.
+ // If neither happens, return false.
+ bool UpdateOrAdd(const Key& new_key, Index new_index) {
+ if (new_key == key) {
+ index = new_index;
+ return true;
+ } else if (key == StoredKey()) {
+ key = new_key.stored();
+ index = new_index;
+ return true;
+ } else {
+ return false;
+ }
+ }
+ };
+
+ static Entry* Older(Entry* a, Entry* b) {
+ if (a->index < b->index) {
+ return a;
+ } else {
+ return b;
+ }
+ }
+
+ // Return the first slot in which key could be stored.
+ Entry* first_slot(const Key& key) {
+ return &entries_[key.hash() % kNumEntries];
+ }
+
+ // Return the second slot in which key could be stored.
+ Entry* second_slot(const Key& key) {
+ return &entries_[(key.hash() / kNumEntries) % kNumEntries];
+ }
+
+ // Fixed size entry map.
+ // We store each key/value pair in two slots based on it's hash value.
+ // They can be evicted individually.
+ Entry entries_[kNumEntries];
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_INDEX_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
new file mode 100644
index 00000000000..bfe152a91f5
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc
@@ -0,0 +1,86 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+uint32_t HPackEncoderTable::AllocateIndex(size_t element_size) {
+ uint32_t new_index = tail_remote_index_ + table_elems_ + 1;
+ GPR_DEBUG_ASSERT(element_size < 65536);
+
+ if (element_size > max_table_size_) {
+ while (table_size_ > 0) {
+ EvictOne();
+ }
+ return 0;
+ }
+
+ // Reserve space for this element in the remote table: if this overflows
+ // the current table, drop elements until it fits, matching the decompressor
+ // algorithm.
+ while (table_size_ + element_size > max_table_size_) {
+ EvictOne();
+ }
+ GPR_ASSERT(table_elems_ < elem_size_.size());
+ elem_size_[new_index % elem_size_.size()] =
+ static_cast<uint16_t>(element_size);
+ table_size_ += element_size;
+ table_elems_++;
+
+ return new_index;
+}
+
+bool HPackEncoderTable::SetMaxSize(uint32_t max_table_size) {
+ if (max_table_size == max_table_size_) {
+ return false;
+ }
+ while (table_size_ > 0 && table_size_ > max_table_size) {
+ EvictOne();
+ }
+ max_table_size_ = max_table_size;
+ const size_t max_table_elems =
+ hpack_constants::EntriesForBytes(max_table_size);
+ // TODO(ctiller): integrate with ResourceQuota to rebuild smaller when we can.
+ if (max_table_elems > elem_size_.size()) {
+ Rebuild(std::max(max_table_elems, 2 * elem_size_.size()));
+ }
+ return true;
+}
+
+void HPackEncoderTable::EvictOne() {
+ tail_remote_index_++;
+ GPR_ASSERT(tail_remote_index_ > 0);
+ GPR_ASSERT(table_elems_ > 0);
+ auto removing_size = elem_size_[tail_remote_index_ % elem_size_.size()];
+ GPR_ASSERT(table_size_ >= removing_size);
+ table_size_ -= removing_size;
+ table_elems_--;
+}
+
+void HPackEncoderTable::Rebuild(uint32_t capacity) {
+ decltype(elem_size_) new_elem_size(capacity);
+ GPR_ASSERT(table_elems_ <= capacity);
+ for (uint32_t i = 0; i < table_elems_; i++) {
+ uint32_t ofs = tail_remote_index_ + i + 1;
+ new_elem_size[ofs % capacity] = elem_size_[ofs % elem_size_.size()];
+ }
+ elem_size_.swap(new_elem_size);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
new file mode 100644
index 00000000000..47971d271cb
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_encoder_table.h
@@ -0,0 +1,69 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/container/inlined_vector.h"
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+
+namespace grpc_core {
+
+// Tracks the values available in the remote HPACK header table, and their
+// sizes.
+class HPackEncoderTable {
+ public:
+ HPackEncoderTable() : elem_size_(hpack_constants::kInitialTableEntries) {}
+
+ // Reserve space in table for the new element, evict entries if needed.
+ // Return the new index of the element. Return 0 to indicate not adding to
+ // table.
+ uint32_t AllocateIndex(size_t element_size);
+ // Set the maximum table size. Return true if it changed.
+ bool SetMaxSize(uint32_t max_table_size);
+ // Get the current max table size
+ uint32_t max_size() const { return max_table_size_; }
+ // Get the current table size
+ uint32_t test_only_table_size() const { return table_size_; }
+
+ // Convert an element index into a dynamic index
+ uint32_t DynamicIndex(uint32_t index) const {
+ return 1 + hpack_constants::kLastStaticEntry + tail_remote_index_ +
+ table_elems_ - index;
+ }
+ // Check if an element index is convertable to a dynamic index
+ bool ConvertableToDynamicIndex(uint32_t index) const {
+ return index > tail_remote_index_;
+ }
+
+ private:
+ void EvictOne();
+ void Rebuild(uint32_t capacity);
+
+ // one before the lowest usable table index
+ uint32_t tail_remote_index_ = 0;
+ uint32_t max_table_size_ = hpack_constants::kInitialTableSize;
+ uint32_t table_elems_ = 0;
+ uint32_t table_size_ = 0;
+ // The size of each element in the HPACK table.
+ y_absl::InlinedVector<uint16_t, hpack_constants::kInitialTableEntries>
+ elem_size_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_ENCODER_TABLE_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
index af79fed4d1b..29be85c5cb3 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -19,7 +19,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
#include <assert.h>
#include <stddef.h>
@@ -32,6 +31,7 @@
#include <grpc/support/log.h>
#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/profiling/timers.h"
@@ -40,198 +40,17 @@
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/http2_errors.h"
-grpc_core::DebugOnlyTraceFlag grpc_trace_chttp2_hpack_parser(
- false, "chttp2_hpack_parser");
-
-typedef enum {
- NOT_BINARY,
- BINARY_BEGIN,
- B64_BYTE0,
- B64_BYTE1,
- B64_BYTE2,
- B64_BYTE3
-} binary_state;
-
-/* How parsing works:
-
- The parser object keeps track of a function pointer which represents the
- current parse state.
-
- Each time new bytes are presented, we call into the current state, which
- recursively parses until all bytes in the given chunk are exhausted.
-
- The parse state that terminates then saves its function pointer to be the
- current state so that it can resume when more bytes are available.
-
- It's expected that most optimizing compilers will turn this code into
- a set of indirect jumps, and so not waste stack space. */
-
-/* forward declarations for parsing states */
-static grpc_error* parse_begin(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_error(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end, grpc_error* error);
-static grpc_error* still_parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_illegal_op(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-
-static grpc_error* parse_string_prefix(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_key_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_value_string_with_indexed_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_value_string_with_literal_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end);
-
-static grpc_error* parse_value0(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_value1(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_value2(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_value3(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_value4(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_value5up(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-
-static grpc_error* parse_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_indexed_field_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_lithdr_incidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_lithdr_notidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_lithdr_nvridx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end);
-static grpc_error* parse_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-static grpc_error* parse_max_tbl_size_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end);
-
-/* we translate the first byte of a hpack field into one of these decoding
- cases, then use a lookup table to jump directly to the appropriate parser.
-
- _X => the integer index is all ones, meaning we need to do varint decoding
- _V => the integer index is all zeros, meaning we need to decode an additional
- string value */
-typedef enum {
- INDEXED_FIELD,
- INDEXED_FIELD_X,
- LITHDR_INCIDX,
- LITHDR_INCIDX_X,
- LITHDR_INCIDX_V,
- LITHDR_NOTIDX,
- LITHDR_NOTIDX_X,
- LITHDR_NOTIDX_V,
- LITHDR_NVRIDX,
- LITHDR_NVRIDX_X,
- LITHDR_NVRIDX_V,
- MAX_TBL_SIZE,
- MAX_TBL_SIZE_X,
- ILLEGAL
-} first_byte_type;
-
-/* jump table of parse state functions -- order must match first_byte_type
- above */
-static const grpc_chttp2_hpack_parser_state first_byte_action[] = {
- parse_indexed_field, parse_indexed_field_x, parse_lithdr_incidx,
- parse_lithdr_incidx_x, parse_lithdr_incidx_v, parse_lithdr_notidx,
- parse_lithdr_notidx_x, parse_lithdr_notidx_v, parse_lithdr_nvridx,
- parse_lithdr_nvridx_x, parse_lithdr_nvridx_v, parse_max_tbl_size,
- parse_max_tbl_size_x, parse_illegal_op};
-
-/* indexes the first byte to a parse state function - generated by
- gen_hpack_tables.c */
-static const uint8_t first_byte_lut[256] = {
- LITHDR_NOTIDX_V, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX,
- LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX, LITHDR_NOTIDX_X,
- LITHDR_NVRIDX_V, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX,
- LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX, LITHDR_NVRIDX_X,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE,
- MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE, MAX_TBL_SIZE_X,
- LITHDR_INCIDX_V, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX,
- LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX, LITHDR_INCIDX_X,
- ILLEGAL, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD,
- INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD, INDEXED_FIELD_X,
-};
+#if __cplusplus > 201103L
+#define GRPC_HPACK_CONSTEXPR_FN constexpr
+#define GRPC_HPACK_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_HPACK_CONSTEXPR_FN
+#define GRPC_HPACK_CONSTEXPR_VALUE const
+#endif
+
+namespace grpc_core {
+
+TraceFlag grpc_trace_chttp2_hpack_parser(false, "chttp2_hpack_parser");
/* state table for huffman decoding: given a state, gives an index/16 into
next_sub_tbl. Taking that index and adding the value of the nibble being
@@ -606,1062 +425,918 @@ static const int16_t emit_sub_tbl[249 * 16] = {
13, 22, 22, 22, 22, 256, 256, 256, 256,
};
-static const uint8_t inverse_base64[256] = {
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255,
- 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255,
- 255, 64, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
- 255,
+namespace {
+// The alphabet used for base64 encoding binary metadata.
+constexpr char kBase64Alphabet[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+
+// An inverted table: for each value in kBase64Alphabet, table contains the
+// index with which it's stored, so we can quickly invert the encoding without
+// any complicated runtime logic.
+struct Base64InverseTable {
+ uint8_t table[256]{};
+ GRPC_HPACK_CONSTEXPR_FN Base64InverseTable() {
+ for (int i = 0; i < 256; i++) {
+ table[i] = 255;
+ }
+ for (const char* p = kBase64Alphabet; *p; p++) {
+ uint8_t idx = *p;
+ uint8_t ofs = p - kBase64Alphabet;
+ table[idx] = ofs;
+ }
+ }
};
-static void GPR_ATTRIBUTE_NOINLINE on_hdr_log(grpc_mdelem md) {
- char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* v = nullptr;
- if (grpc_is_binary_header_internal(GRPC_MDKEY(md))) {
- v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
- } else {
- v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+GRPC_HPACK_CONSTEXPR_VALUE Base64InverseTable kBase64InverseTable;
+} // namespace
+
+// Input tracks the current byte through the input data and provides it
+// via a simple stream interface.
+class HPackParser::Input {
+ public:
+ Input(grpc_slice_refcount* current_slice_refcount, const uint8_t* begin,
+ const uint8_t* end)
+ : current_slice_refcount_(current_slice_refcount),
+ begin_(begin),
+ end_(end),
+ frontier_(begin) {}
+
+ // If input is backed by a slice, retrieve its refcount. If not, return
+ // nullptr.
+ grpc_slice_refcount* slice_refcount() { return current_slice_refcount_; }
+
+ // Have we reached the end of input?
+ bool end_of_stream() const { return begin_ == end_; }
+ // How many bytes until end of input
+ size_t remaining() const { return end_ - begin_; }
+ // Current position, as a pointer
+ const uint8_t* cur_ptr() const { return begin_; }
+ // End position, as a pointer
+ const uint8_t* end_ptr() const { return end_; }
+ // Move read position forward by n, unchecked
+ void Advance(size_t n) { begin_ += n; }
+
+ // Retrieve the current character, or nullopt if end of stream
+ // Do not advance
+ y_absl::optional<uint8_t> peek() const {
+ if (end_of_stream()) {
+ return {};
+ }
+ return *begin_;
}
- gpr_log(
- GPR_INFO,
- "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
- k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md),
- grpc_slice_is_interned(GRPC_MDKEY(md)),
- grpc_slice_is_interned(GRPC_MDVALUE(md)));
- gpr_free(k);
- gpr_free(v);
-}
-/* emission helpers */
-template <bool do_add>
-static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
- on_hdr_log(md);
- }
- if (do_add) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
- GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
- grpc_error* err = grpc_chttp2_hptbl_add(&p->table, md);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) return err;
+ // Retrieve and advance past the current character, or return nullopt if end
+ // of stream
+ y_absl::optional<uint8_t> Next() {
+ if (end_of_stream()) {
+ return UnexpectedEOF(y_absl::optional<uint8_t>());
+ }
+ return *begin_++;
}
- return p->on_header(p->on_header_user_data, md);
-}
-static grpc_core::UnmanagedMemorySlice take_string_extern(
- grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) {
- grpc_core::UnmanagedMemorySlice s;
- if (!str->copied) {
- GPR_DEBUG_ASSERT(!grpc_slice_is_interned(str->data.referenced));
- s = static_cast<grpc_core::UnmanagedMemorySlice&>(str->data.referenced);
- str->copied = true;
- str->data.referenced = grpc_core::UnmanagedMemorySlice();
- } else {
- s = grpc_core::UnmanagedMemorySlice(str->data.copied.str,
- str->data.copied.length);
+ // Helper to parse a varint delta on top of value, return nullopt on failure
+ // (setting error)
+ y_absl::optional<uint32_t> ParseVarint(uint32_t value) {
+ // TODO(ctiller): break out a variant of this when we know there are at
+ // least 5 bytes in input_
+ auto cur = Next();
+ if (!cur) return {};
+ value += *cur & 0x7f;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 7;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 14;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ value += (*cur & 0x7f) << 21;
+ if ((*cur & 0x80) == 0) return value;
+
+ cur = Next();
+ if (!cur) return {};
+ uint32_t c = (*cur) & 0x7f;
+ // We might overflow here, so we need to be a little careful about the
+ // addition
+ if (c > 0xf) return ParseVarintOutOfRange(value, *cur);
+ const uint32_t add = c << 28;
+ if (add > 0xffffffffu - value) {
+ return ParseVarintOutOfRange(value, *cur);
+ }
+ value += add;
+ if ((*cur & 0x80) == 0) return value;
+
+ // Spec weirdness: we can add an infinite stream of 0x80 at the end of a
+ // varint and still end up with a correctly encoded varint.
+ do {
+ cur = Next();
+ if (!cur.has_value()) return {};
+ } while (*cur == 0x80);
+
+ // BUT... the last byte needs to be 0x00 or we'll overflow dramatically!
+ if (*cur == 0) return value;
+ return ParseVarintOutOfRange(value, *cur);
}
- str->data.copied.length = 0;
- return s;
-}
-static grpc_core::ManagedMemorySlice take_string_intern(
- grpc_chttp2_hpack_parser* /*p*/, grpc_chttp2_hpack_parser_string* str) {
- grpc_core::ManagedMemorySlice s;
- if (!str->copied) {
- s = grpc_core::ManagedMemorySlice(&str->data.referenced);
- grpc_slice_unref_internal(str->data.referenced);
- str->copied = true;
- str->data.referenced = grpc_empty_slice();
- } else {
- s = grpc_core::ManagedMemorySlice(str->data.copied.str,
- str->data.copied.length);
+ // Prefix for a string
+ struct StringPrefix {
+ // Number of bytes in input for string
+ uint32_t length;
+ // Is it huffman compressed
+ bool huff;
+ };
+
+ // Parse a string prefix
+ y_absl::optional<StringPrefix> ParseStringPrefix() {
+ auto cur = Next();
+ if (!cur.has_value()) return {};
+ // Huffman if the top bit is 1
+ const bool huff = (*cur & 0x80) != 0;
+ // String length
+ uint32_t strlen = (*cur & 0x7f);
+ if (strlen == 0x7f) {
+ // all ones ==> varint string length
+ auto v = ParseVarint(0x7f);
+ if (!v.has_value()) return {};
+ strlen = *v;
+ }
+ return StringPrefix{strlen, huff};
}
- str->data.copied.length = 0;
- return s;
-}
-/* jump to the next state */
-static grpc_error* parse_next(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- p->state = *p->next_state++;
- return p->state(p, cur, end);
-}
+ // Check if we saw an EOF.. must be verified before looking at TakeError
+ bool eof_error() const { return eof_error_; }
-/* begin parsing a header: all functionality is encoded into lookup tables
- above */
-static grpc_error* parse_begin(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_begin;
- return GRPC_ERROR_NONE;
+ // Extract the parse error, leaving the current error as NONE.
+ grpc_error_handle TakeError() {
+ grpc_error_handle out = error_;
+ error_ = GRPC_ERROR_NONE;
+ return out;
}
- return first_byte_action[first_byte_lut[*cur]](p, cur, end);
-}
-
-/* stream dependency and prioritization data: we just skip it */
-static grpc_error* parse_stream_weight(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_weight;
- return GRPC_ERROR_NONE;
+ // Set the current error - allows the rest of the code not to need to pass
+ // around StatusOr<> which would be prohibitive here.
+ GPR_ATTRIBUTE_NOINLINE void SetError(grpc_error_handle error) {
+ if (error_ != GRPC_ERROR_NONE || eof_error_) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ error_ = error;
+ begin_ = end_;
}
- return p->after_prioritization(p, cur + 1, end);
-}
-
-static grpc_error* parse_stream_dep3(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep3;
- return GRPC_ERROR_NONE;
+ // If no error is set, set it to the value produced by error_factory.
+ // Return return_value unchanged.
+ template <typename F, typename T>
+ GPR_ATTRIBUTE_NOINLINE T MaybeSetErrorAndReturn(F error_factory,
+ T return_value) {
+ if (error_ != GRPC_ERROR_NONE || eof_error_) return return_value;
+ error_ = error_factory();
+ begin_ = end_;
+ return return_value;
}
- return parse_stream_weight(p, cur + 1, end);
-}
-
-static grpc_error* parse_stream_dep2(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep2;
- return GRPC_ERROR_NONE;
+ // Set the error to an unexpected eof, and return result (code golfed as this
+ // is a common case)
+ template <typename T>
+ T UnexpectedEOF(T return_value) {
+ if (error_ != GRPC_ERROR_NONE) return return_value;
+ eof_error_ = true;
+ return return_value;
}
- return parse_stream_dep3(p, cur + 1, end);
-}
-
-static grpc_error* parse_stream_dep1(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep1;
- return GRPC_ERROR_NONE;
+ // Update the frontier - signifies we've successfully parsed another element
+ void UpdateFrontier() { frontier_ = begin_; }
+
+ // Get the frontier - for buffering should we fail due to eof
+ const uint8_t* frontier() const { return frontier_; }
+
+ private:
+ // Helper to set the error to out of range for ParseVarint
+ y_absl::optional<uint32_t> ParseVarintOutOfRange(uint32_t value,
+ uint8_t last_byte) {
+ return MaybeSetErrorAndReturn(
+ [value, last_byte] {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "integer overflow in hpack integer decoding: have 0x%08x, "
+ "got byte 0x%02x on byte 5",
+ value, last_byte));
+ },
+ y_absl::optional<uint32_t>());
}
- return parse_stream_dep2(p, cur + 1, end);
-}
+ // Refcount if we are backed by a slice
+ grpc_slice_refcount* current_slice_refcount_;
+ // Current input point
+ const uint8_t* begin_;
+ // End of stream point
+ const uint8_t* const end_;
+ // Frontier denotes the first byte past successfully processed input
+ const uint8_t* frontier_;
+ // Current error
+ grpc_error_handle error_ = GRPC_ERROR_NONE;
+ // If the error was EOF, we flag it here..
+ bool eof_error_ = false;
+};
-static grpc_error* parse_stream_dep0(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_stream_dep0;
- return GRPC_ERROR_NONE;
+// Helper to parse a string and turn it into a slice with appropriate memory
+// management characteristics
+class HPackParser::String {
+ public:
+ // Helper to specify a string should be internalized
+ struct Intern {};
+ // Helper to specify a string should be externalized
+ struct Extern {};
+
+ private:
+ // Forward declare take functions... we'll need them in the public interface
+ Slice Take(Extern);
+ Slice Take(Intern);
+
+ public:
+ String(const String&) = delete;
+ String& operator=(const String&) = delete;
+ String(String&& other) noexcept : value_(std::move(other.value_)) {
+ other.value_ = y_absl::Span<const uint8_t>();
}
-
- return parse_stream_dep1(p, cur + 1, end);
-}
-
-static grpc_error* GPR_ATTRIBUTE_NOINLINE
-on_invalid_hpack_idx(grpc_chttp2_hpack_parser* p) {
- return grpc_error_set_int(
- grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid HPACK index received"),
- GRPC_ERROR_INT_INDEX, static_cast<intptr_t>(p->index)),
- GRPC_ERROR_INT_SIZE, static_cast<intptr_t>(p->table.num_ents));
-}
-
-/* emit an indexed field; jumps to begin the next field on completion */
-static grpc_error* finish_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- grpc_mdelem md = grpc_chttp2_hptbl_lookup<true>(&p->table, p->index);
- if (GPR_UNLIKELY(GRPC_MDISNULL(md))) {
- return on_invalid_hpack_idx(p);
+ String& operator=(String&& other) noexcept {
+ value_ = std::move(other.value_);
+ other.value_ = y_absl::Span<const uint8_t>();
+ return *this;
}
- GRPC_STATS_INC_HPACK_RECV_INDEXED();
- grpc_error* err = on_hdr<false>(p, md);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) return err;
- return parse_begin(p, cur, end);
-}
-/* parse an indexed field with index < 127 */
-static grpc_error* parse_indexed_field(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- p->dynamic_table_update_allowed = 0;
- p->index = (*cur) & 0x7f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return finish_indexed_field(p, cur + 1, end);
-}
+ // Take the value and leave this empty
+ // Use Intern/Extern to choose memory management
+ template <typename T>
+ auto Take() -> decltype(this->Take(T())) {
+ return Take(T());
+ }
-/* parse an indexed field with index >= 127 */
-static grpc_error* parse_indexed_field_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- finish_indexed_field};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0x7f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ // Return a reference to the value as a string view
+ y_absl::string_view string_view() const {
+ if (auto* p = y_absl::get_if<Slice>(&value_)) {
+ return p->as_string_view();
+ } else if (auto* p = y_absl::get_if<y_absl::Span<const uint8_t>>(&value_)) {
+ return y_absl::string_view(reinterpret_cast<const char*>(p->data()),
+ p->size());
+ } else if (auto* p = y_absl::get_if<std::vector<uint8_t>>(&value_)) {
+ return y_absl::string_view(reinterpret_cast<const char*>(p->data()),
+ p->size());
+ }
+ GPR_UNREACHABLE_CODE(return y_absl::string_view());
+ }
-/* When finishing with a header, get the cached md element for this index.
- This is set in parse_value_string(). We ensure (in debug mode) that the
- cached metadata corresponds with the index we are examining. */
-static grpc_mdelem get_precomputed_md_for_idx(grpc_chttp2_hpack_parser* p) {
- GPR_DEBUG_ASSERT(p->md_for_index.payload != 0);
- GPR_DEBUG_ASSERT(static_cast<int64_t>(p->index) == p->precomputed_md_index);
- grpc_mdelem md = p->md_for_index;
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
-#ifndef NDEBUG
- p->precomputed_md_index = -1;
-#endif
- return md;
-}
+ // Parse a non-binary string
+ static y_absl::optional<String> Parse(Input* input) {
+ auto pfx = input->ParseStringPrefix();
+ if (!pfx.has_value()) return {};
+ if (pfx->huff) {
+ // Huffman coded
+ std::vector<uint8_t> output;
+ auto v = ParseHuff(input, pfx->length,
+ [&output](uint8_t c) { output.push_back(c); });
+ if (!v) return {};
+ return String(std::move(output));
+ }
+ return ParseUncompressed(input, pfx->length);
+ }
-static const grpc_core::ManagedMemorySlice& get_indexed_key(grpc_mdelem md) {
- GPR_DEBUG_ASSERT(GRPC_MDELEM_IS_INTERNED(md));
- return static_cast<const grpc_core::ManagedMemorySlice&>(
- grpc_slice_ref_internal(GRPC_MDKEY(md)));
-}
+ // Parse a binary string
+ static y_absl::optional<String> ParseBinary(Input* input) {
+ auto pfx = input->ParseStringPrefix();
+ if (!pfx.has_value()) return {};
+ if (!pfx->huff) {
+ if (pfx->length > 0 && input->peek() == 0) {
+ // 'true-binary'
+ input->Advance(1);
+ return ParseUncompressed(input, pfx->length - 1);
+ }
+ // Base64 encoded... pull out the string, then unbase64 it
+ auto base64 = ParseUncompressed(input, pfx->length);
+ if (!base64.has_value()) return {};
+ return Unbase64(input, std::move(*base64));
+ } else {
+ // Huffman encoded...
+ std::vector<uint8_t> decompressed;
+ // State here says either we don't know if it's base64 or binary, or we do
+ // and what is it.
+ enum class State { kUnsure, kBinary, kBase64 };
+ State state = State::kUnsure;
+ auto decompressed_ok =
+ ParseHuff(input, pfx->length, [&state, &decompressed](uint8_t c) {
+ if (state == State::kUnsure) {
+ // First byte... if it's zero it's binary
+ if (c == 0) {
+ // Save the type, and skip the zero
+ state = State::kBinary;
+ return;
+ } else {
+ // Flag base64, store this value
+ state = State::kBase64;
+ }
+ }
+ // Non-first byte, or base64 first byte
+ decompressed.push_back(c);
+ });
+ if (!decompressed_ok) return {};
+ switch (state) {
+ case State::kUnsure:
+ // No bytes, empty span
+ return String(y_absl::Span<const uint8_t>());
+ case State::kBinary:
+ // Binary, we're done
+ return String(std::move(decompressed));
+ case State::kBase64:
+ // Base64 - unpack it
+ return Unbase64(input, String(std::move(decompressed)));
+ }
+ GPR_UNREACHABLE_CODE(abort(););
+ }
+ }
-/* finish a literal header with incremental indexing */
-static grpc_error* finish_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error* err = on_hdr<true>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_intern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ private:
+ void AppendBytes(const uint8_t* data, size_t length);
+ explicit String(std::vector<uint8_t> v) : value_(std::move(v)) {}
+ explicit String(y_absl::Span<const uint8_t> v) : value_(v) {}
+ String(grpc_slice_refcount* r, const uint8_t* begin, const uint8_t* end)
+ : value_(Slice::FromRefcountAndBytes(r, begin, end)) {}
+
+ // Parse some huffman encoded bytes, using output(uint8_t b) to emit each
+ // decoded byte.
+ template <typename Out>
+ static bool ParseHuff(Input* input, uint32_t length, Out output) {
+ GRPC_STATS_INC_HPACK_RECV_HUFFMAN();
+ int16_t state = 0;
+ // Parse one half byte... we leverage some lookup tables to keep the logic
+ // here really simple.
+ auto nibble = [&output, &state](uint8_t nibble) {
+ int16_t emit = emit_sub_tbl[16 * emit_tbl[state] + nibble];
+ int16_t next = next_sub_tbl[16 * next_tbl[state] + nibble];
+ if (emit != -1) {
+ if (emit >= 0 && emit < 256) {
+ output(static_cast<uint8_t>(emit));
+ } else {
+ assert(emit == 256);
+ }
+ }
+ state = next;
+ };
+ // If there's insufficient bytes remaining, return now.
+ if (input->remaining() < length) {
+ return input->UnexpectedEOF(false);
+ }
+ // Grab the byte range, and iterate through it.
+ const uint8_t* p = input->cur_ptr();
+ input->Advance(length);
+ for (uint32_t i = 0; i < length; i++) {
+ nibble(p[i] >> 4);
+ nibble(p[i] & 0xf);
+ }
+ return true;
+ }
-/* finish a literal header with incremental indexing with no index */
-static grpc_error* finish_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V();
- grpc_error* err = on_hdr<true>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_intern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ // Parse some uncompressed string bytes.
+ static y_absl::optional<String> ParseUncompressed(Input* input,
+ uint32_t length) {
+ GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
+ // Check there's enough bytes
+ if (input->remaining() < length) {
+ return input->UnexpectedEOF(y_absl::optional<String>());
+ }
+ auto* refcount = input->slice_refcount();
+ auto* p = input->cur_ptr();
+ input->Advance(length);
+ if (refcount != nullptr) {
+ return String(refcount, p, p + length);
+ } else {
+ return String(y_absl::Span<const uint8_t>(p, length));
+ }
+ }
-/* parse a literal header with incremental indexing; index < 63 */
-static grpc_error* parse_lithdr_incidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_incidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0x3f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ // Turn base64 encoded bytes into not base64 encoded bytes.
+ // Only takes input to set an error on failure.
+ static y_absl::optional<String> Unbase64(Input* input, String s) {
+ y_absl::optional<std::vector<uint8_t>> result;
+ if (auto* p = y_absl::get_if<Slice>(&s.value_)) {
+ result = Unbase64Loop(p->begin(), p->end());
+ }
+ if (auto* p = y_absl::get_if<y_absl::Span<const uint8_t>>(&s.value_)) {
+ result = Unbase64Loop(p->begin(), p->end());
+ }
+ if (auto* p = y_absl::get_if<std::vector<uint8_t>>(&s.value_)) {
+ result = Unbase64Loop(p->data(), p->data() + p->size());
+ }
+ if (!result.has_value()) {
+ return input->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "illegal base64 encoding");
+ },
+ y_absl::optional<String>());
+ }
+ return String(std::move(*result));
+ }
-/* parse a literal header with incremental indexing; index >= 63 */
-static grpc_error* parse_lithdr_incidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_incidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0x3f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ // Main loop for Unbase64
+ static y_absl::optional<std::vector<uint8_t>> Unbase64Loop(const uint8_t* cur,
+ const uint8_t* end) {
+ while (cur != end && end[-1] == '=') {
+ --end;
+ }
-/* parse a literal header with incremental indexing; index = 0 */
-static grpc_error* parse_lithdr_incidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_incidx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ std::vector<uint8_t> out;
+ out.reserve(3 * (end - cur) / 4 + 3);
-/* finish a literal header without incremental indexing */
-static grpc_error* finish_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error* err = on_hdr<false>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ // Decode 4 bytes at a time while we can
+ while (end - cur >= 4) {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
+ ++cur;
-/* finish a literal header without incremental indexing with index = 0 */
-static grpc_error* finish_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V();
- grpc_error* err = on_hdr<false>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
+ ++cur;
-/* parse a literal header without incremental indexing; index < 15 */
-static grpc_error* parse_lithdr_notidx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_notidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 6;
+ ++cur;
-/* parse a literal header without incremental indexing; index >= 15 */
-static grpc_error* parse_lithdr_notidx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_notidx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits;
+ ++cur;
-/* parse a literal header without incremental indexing; index == 0 */
-static grpc_error* parse_lithdr_notidx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_notidx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ out.insert(out.end(), {static_cast<uint8_t>(buffer >> 16),
+ static_cast<uint8_t>(buffer >> 8),
+ static_cast<uint8_t>(buffer)});
+ }
+ // Deal with the last 0, 1, 2, or 3 bytes.
+ switch (end - cur) {
+ case 0:
+ return out;
+ case 1:
+ return {};
+ case 2: {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
-/* finish a literal header that is never indexed */
-static grpc_error* finish_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX();
- grpc_mdelem md = get_precomputed_md_for_idx(p);
- grpc_error* err = on_hdr<false>(
- p, grpc_mdelem_from_slices(get_indexed_key(md),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
-/* finish a literal header that is never indexed with an extra value */
-static grpc_error* finish_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V();
- grpc_error* err = on_hdr<false>(
- p, grpc_mdelem_from_slices(take_string_intern(p, &p->key),
- take_string_extern(p, &p->value)));
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
+ if (buffer & 0xffff) return {};
+ out.push_back(static_cast<uint8_t>(buffer >> 16));
+ return out;
+ }
+ case 3: {
+ uint32_t bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ uint32_t buffer = bits << 18;
-/* parse a literal header that is never indexed; index < 15 */
-static grpc_error* parse_lithdr_nvridx(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_value_string_with_indexed_key, finish_lithdr_nvridx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = (*cur) & 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return parse_string_prefix(p, cur + 1, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 12;
-/* parse a literal header that is never indexed; index >= 15 */
-static grpc_error* parse_lithdr_nvridx_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_string_prefix, parse_value_string_with_indexed_key,
- finish_lithdr_nvridx};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- p->index = 0xf;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
+ ++cur;
+ bits = kBase64InverseTable.table[*cur];
+ if (bits > 63) return {};
+ buffer |= bits << 6;
-/* parse a literal header that is never indexed; index == 0 */
-static grpc_error* parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- parse_key_string, parse_string_prefix,
- parse_value_string_with_literal_key, finish_lithdr_nvridx_v};
- p->dynamic_table_update_allowed = 0;
- p->next_state = and_then;
- return parse_string_prefix(p, cur + 1, end);
-}
+ ++cur;
+ if (buffer & 0xff) return {};
+ out.push_back(static_cast<uint8_t>(buffer >> 16));
+ out.push_back(static_cast<uint8_t>(buffer >> 8));
+ return out;
+ }
+ }
-/* finish parsing a max table size change */
-static grpc_error* finish_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
- gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index);
+ GPR_UNREACHABLE_CODE(return out;);
}
- grpc_error* err =
- grpc_chttp2_hptbl_set_current_table_size(&p->table, p->index);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_begin(p, cur, end);
-}
-/* parse a max table size change, max size < 15 */
-static grpc_error* parse_max_tbl_size(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (p->dynamic_table_update_allowed == 0) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "More than two max table size changes in a single frame"));
- }
- p->dynamic_table_update_allowed--;
- p->index = (*cur) & 0x1f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- return finish_max_tbl_size(p, cur + 1, end);
-}
+ y_absl::variant<Slice, y_absl::Span<const uint8_t>, std::vector<uint8_t>> value_;
+};
-/* parse a max table size change, max size >= 15 */
-static grpc_error* parse_max_tbl_size_x(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur,
- const uint8_t* end) {
- static const grpc_chttp2_hpack_parser_state and_then[] = {
- finish_max_tbl_size};
- if (p->dynamic_table_update_allowed == 0) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "More than two max table size changes in a single frame"));
+// Parser parses one key/value pair from a byte stream.
+class HPackParser::Parser {
+ public:
+ Parser(Input* input, grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, HPackTable* table,
+ uint8_t* dynamic_table_updates_allowed, uint32_t* frame_length,
+ LogInfo log_info)
+ : input_(input),
+ metadata_buffer_(metadata_buffer),
+ table_(table),
+ dynamic_table_updates_allowed_(dynamic_table_updates_allowed),
+ frame_length_(frame_length),
+ metadata_size_limit_(metadata_size_limit),
+ log_info_(log_info) {}
+
+ // Skip any priority bits, or return false on failure
+ bool SkipPriority() {
+ if (input_->remaining() < 5) return input_->UnexpectedEOF(false);
+ input_->Advance(5);
+ return true;
}
- p->dynamic_table_update_allowed--;
- p->next_state = and_then;
- p->index = 0x1f;
- p->md_for_index.payload = 0; /* Invalidate cached md when index changes. */
- p->parsing.value = &p->index;
- return parse_value0(p, cur + 1, end);
-}
-/* a parse error: jam the parse state into parse_error, and return error */
-static grpc_error* parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* /*cur*/, const uint8_t* /*end*/,
- grpc_error* err) {
- GPR_ASSERT(err != GRPC_ERROR_NONE);
- if (p->last_error == GRPC_ERROR_NONE) {
- p->last_error = GRPC_ERROR_REF(err);
+ bool Parse() {
+ auto cur = *input_->Next();
+ switch (cur >> 4) {
+ // Literal header not indexed - First byte format: 0000xxxx
+ // Literal header never indexed - First byte format: 0001xxxx
+ // Where xxxx:
+ // 0000 - literal key
+ // 1111 - indexed key, varint encoded index
+ // other - indexed key, inline encoded index
+ case 0:
+ case 1:
+ switch (cur & 0xf) {
+ case 0: // literal key
+ return FinishHeaderOmitFromTable(ParseLiteralKey<String::Extern>());
+ case 0xf: // varint encoded key index
+ return FinishHeaderOmitFromTable(
+ ParseVarIdxKey<String::Extern>(0xf));
+ default: // inline encoded key index
+ return FinishHeaderOmitFromTable(
+ ParseIdxKey<String::Extern>(cur & 0xf));
+ }
+ // Update max table size.
+ // First byte format: 001xxxxx
+ // Where xxxxx:
+ // 11111 - max size is varint encoded
+ // other - max size is stored inline
+ case 2:
+ // inline encoded max table size
+ return FinishMaxTableSize(cur & 0x1f);
+ case 3:
+ if (cur == 0x3f) {
+ // varint encoded max table size
+ return FinishMaxTableSize(input_->ParseVarint(0x1f));
+ } else {
+ // inline encoded max table size
+ return FinishMaxTableSize(cur & 0x1f);
+ }
+ // Literal header with incremental indexing.
+ // First byte format: 01xxxxxx
+ // Where xxxxxx:
+ // 000000 - literal key
+ // 111111 - indexed key, varint encoded index
+ // other - indexed key, inline encoded index
+ case 4:
+ if (cur == 0x40) {
+ // literal key
+ return FinishHeaderAndAddToTable(ParseLiteralKey<String::Intern>());
+ }
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case 5:
+ case 6:
+ // inline encoded key index
+ return FinishHeaderAndAddToTable(
+ ParseIdxKey<String::Intern>(cur & 0x3f));
+ case 7:
+ if (cur == 0x7f) {
+ // varint encoded key index
+ return FinishHeaderAndAddToTable(
+ ParseVarIdxKey<String::Intern>(0x3f));
+ } else {
+ // inline encoded key index
+ return FinishHeaderAndAddToTable(
+ ParseIdxKey<String::Intern>(cur & 0x3f));
+ }
+ // Indexed Header Field Representation
+ // First byte format: 1xxxxxxx
+ // Where xxxxxxx:
+ // 0000000 - illegal
+ // 1111111 - varint encoded field index
+ // other - inline encoded field index
+ case 8:
+ if (cur == 0x80) {
+ // illegal value.
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Illegal hpack op code");
+ },
+ false);
+ }
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ // inline encoded field index
+ return FinishIndexed(cur & 0x7f);
+ case 15:
+ if (cur == 0xff) {
+ // varint encoded field index
+ return FinishIndexed(input_->ParseVarint(0x7f));
+ } else {
+ // inline encoded field index
+ return FinishIndexed(cur & 0x7f);
+ }
+ }
+ GPR_UNREACHABLE_CODE(abort());
}
- p->state = still_parse_error;
- return err;
-}
-
-static grpc_error* still_parse_error(grpc_chttp2_hpack_parser* p,
- const uint8_t* /*cur*/,
- const uint8_t* /*end*/) {
- return GRPC_ERROR_REF(p->last_error);
-}
-static grpc_error* parse_illegal_op(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- GPR_ASSERT(cur != end);
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Illegal hpack op code ", *cur).c_str());
- return parse_error(p, cur, end, err);
-}
-
-/* parse the 1st byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error* parse_value0(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value0;
- return GRPC_ERROR_NONE;
+ private:
+ void GPR_ATTRIBUTE_NOINLINE LogHeader(const HPackTable::Memento& memento) {
+ const char* type;
+ switch (log_info_.type) {
+ case LogInfo::kHeaders:
+ type = "HDR";
+ break;
+ case LogInfo::kTrailers:
+ type = "TRL";
+ break;
+ case LogInfo::kDontKnow:
+ type = "???";
+ break;
+ }
+ gpr_log(GPR_DEBUG, "HTTP:%d:%s:%s: %s", log_info_.stream_id, type,
+ log_info_.is_client ? "CLI" : "SVR", memento.DebugString().c_str());
}
- *p->parsing.value += (*cur) & 0x7f;
+ bool EmitHeader(const HPackTable::Memento& md) {
+ // Pass up to the transport
+ if (GPR_UNLIKELY(metadata_buffer_ == nullptr)) return true;
+ *frame_length_ += md.transport_size();
+ if (GPR_UNLIKELY(*frame_length_ > metadata_size_limit_)) {
+ return HandleMetadataSizeLimitExceeded(md);
+ }
- if ((*cur) & 0x80) {
- return parse_value1(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ grpc_error_handle err = metadata_buffer_->Set(md);
+ if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
+ input_->SetError(err);
+ return false;
+ }
+ return true;
}
-}
-/* parse the 2nd byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error* parse_value1(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value1;
- return GRPC_ERROR_NONE;
+ bool FinishHeaderAndAddToTable(y_absl::optional<HPackTable::Memento> md) {
+ // Allow higher code to just pass in failures ... simplifies things a bit.
+ if (!md.has_value()) return false;
+ // Log if desired
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
+ LogHeader(*md);
+ }
+ // Emit whilst we own the metadata.
+ auto r = EmitHeader(*md);
+ // Add to the hpack table
+ grpc_error_handle err = table_->Add(std::move(*md));
+ if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
+ input_->SetError(err);
+ return false;
+ };
+ return r;
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 7;
-
- if ((*cur) & 0x80) {
- return parse_value2(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ bool FinishHeaderOmitFromTable(y_absl::optional<HPackTable::Memento> md) {
+ // Allow higher code to just pass in failures ... simplifies things a bit.
+ if (!md.has_value()) return false;
+ return FinishHeaderOmitFromTable(*md);
}
-}
-/* parse the 3rd byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error* parse_value2(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value2;
- return GRPC_ERROR_NONE;
+ bool FinishHeaderOmitFromTable(const HPackTable::Memento& md) {
+ // Log if desired
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_chttp2_hpack_parser)) {
+ LogHeader(md);
+ }
+ return EmitHeader(md);
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 14;
-
- if ((*cur) & 0x80) {
- return parse_value3(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ // Parse a string encoded key and a string encoded value
+ template <typename TakeValueType>
+ y_absl::optional<HPackTable::Memento> ParseLiteralKey() {
+ auto key = String::Parse(input_);
+ if (!key.has_value()) return {};
+ auto value = ParseValueString(y_absl::EndsWith(key->string_view(), "-bin"));
+ if (GPR_UNLIKELY(!value.has_value())) {
+ return {};
+ }
+ auto key_string = key->string_view();
+ auto value_slice = value->Take<TakeValueType>();
+ const auto transport_size = key_string.size() + value_slice.size() +
+ hpack_constants::kEntryOverhead;
+ return grpc_metadata_batch::Parse(key->string_view(),
+ std::move(value_slice), transport_size);
}
-}
-/* parse the 4th byte of a varint into p->parsing.value
- no overflow is possible */
-static grpc_error* parse_value3(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- if (cur == end) {
- p->state = parse_value3;
- return GRPC_ERROR_NONE;
+ // Parse an index encoded key and a string encoded value
+ template <typename TakeValueType>
+ y_absl::optional<HPackTable::Memento> ParseIdxKey(uint32_t index) {
+ const auto* elem = table_->Lookup(index);
+ if (GPR_UNLIKELY(elem == nullptr)) {
+ return InvalidHPackIndexError(index,
+ y_absl::optional<HPackTable::Memento>());
+ }
+ auto value = ParseValueString(elem->is_binary_header());
+ if (GPR_UNLIKELY(!value.has_value())) return {};
+ return elem->WithNewValue(value->Take<TakeValueType>());
}
- *p->parsing.value += ((static_cast<uint32_t>(*cur)) & 0x7f) << 21;
-
- if ((*cur) & 0x80) {
- return parse_value4(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ // Parse a varint index encoded key and a string encoded value
+ template <typename TakeValueType>
+ y_absl::optional<HPackTable::Memento> ParseVarIdxKey(uint32_t offset) {
+ auto index = input_->ParseVarint(offset);
+ if (GPR_UNLIKELY(!index.has_value())) return {};
+ return ParseIdxKey<TakeValueType>(*index);
}
-}
-
-/* parse the 5th byte of a varint into p->parsing.value
- depending on the byte, we may overflow, and care must be taken */
-static grpc_error* parse_value4(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- uint8_t c;
- uint32_t cur_value;
- uint32_t add_value;
- if (cur == end) {
- p->state = parse_value4;
- return GRPC_ERROR_NONE;
+ // Parse a string, figuring out if it's binary or not by the key name.
+ y_absl::optional<String> ParseValueString(bool is_binary) {
+ if (is_binary) {
+ return String::ParseBinary(input_);
+ } else {
+ return String::Parse(input_);
+ }
}
- c = (*cur) & 0x7f;
- if (c > 0xf) {
- goto error;
+ // Emit an indexed field
+ bool FinishIndexed(y_absl::optional<uint32_t> index) {
+ *dynamic_table_updates_allowed_ = 0;
+ if (!index.has_value()) return false;
+ const auto* elem = table_->Lookup(*index);
+ if (GPR_UNLIKELY(elem == nullptr)) {
+ return InvalidHPackIndexError(*index, false);
+ }
+ GRPC_STATS_INC_HPACK_RECV_INDEXED();
+ return FinishHeaderOmitFromTable(*elem);
}
- cur_value = *p->parsing.value;
- add_value = (static_cast<uint32_t>(c)) << 28;
- if (add_value > 0xffffffffu - cur_value) {
- goto error;
+ // finish parsing a max table size change
+ bool FinishMaxTableSize(y_absl::optional<uint32_t> size) {
+ if (!size.has_value()) return false;
+ if (*dynamic_table_updates_allowed_ == 0) {
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "More than two max table size changes in a single frame");
+ },
+ false);
+ }
+ (*dynamic_table_updates_allowed_)--;
+ grpc_error_handle err = table_->SetCurrentTableSize(*size);
+ if (err != GRPC_ERROR_NONE) {
+ input_->SetError(err);
+ return false;
+ }
+ return true;
}
- *p->parsing.value = cur_value + add_value;
-
- if ((*cur) & 0x80) {
- return parse_value5up(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+ // Set an invalid hpack index error if no error has been set. Returns result
+ // unmodified.
+ template <typename R>
+ R InvalidHPackIndexError(uint32_t index, R result) {
+ return input_->MaybeSetErrorAndReturn(
+ [this, index] {
+ return grpc_error_set_int(
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid HPACK index received"),
+ GRPC_ERROR_INT_INDEX,
+ static_cast<intptr_t>(index)),
+ GRPC_ERROR_INT_SIZE,
+ static_cast<intptr_t>(this->table_->num_entries()));
+ },
+ std::move(result));
}
-error:
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "integer overflow in hpack integer decoding: have 0x%08x, "
- "got byte 0x%02x on byte 5",
- *p->parsing.value, *cur)
- .c_str());
- return parse_error(p, cur, end, err);
-}
-
-/* parse any trailing bytes in a varint: it's possible to append an arbitrary
- number of 0x80's and not affect the value - a zero will terminate - and
- anything else will overflow */
-static grpc_error* parse_value5up(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- while (cur != end && *cur == 0x80) {
- ++cur;
+ GPR_ATTRIBUTE_NOINLINE
+ bool HandleMetadataSizeLimitExceeded(const HPackTable::Memento&) {
+ gpr_log(GPR_DEBUG,
+ "received initial metadata size exceeds limit (%" PRIu32
+ " vs. %" PRIu32
+ "). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
+ *frame_length_, metadata_size_limit_);
+ if (metadata_buffer_ != nullptr) metadata_buffer_->Clear();
+ return input_->MaybeSetErrorAndReturn(
+ [] {
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "received initial metadata size exceeds limit"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_RESOURCE_EXHAUSTED);
+ },
+ false);
}
- if (cur == end) {
- p->state = parse_value5up;
- return GRPC_ERROR_NONE;
- }
+ Input* const input_;
+ grpc_metadata_batch* const metadata_buffer_;
+ HPackTable* const table_;
+ uint8_t* const dynamic_table_updates_allowed_;
+ uint32_t* const frame_length_;
+ const uint32_t metadata_size_limit_;
+ const LogInfo log_info_;
+};
- if (*cur == 0) {
- return parse_next(p, cur + 1, end);
+Slice HPackParser::String::Take(Extern) {
+ if (auto* p = y_absl::get_if<Slice>(&value_)) {
+ return p->Copy();
+ } else if (auto* p = y_absl::get_if<y_absl::Span<const uint8_t>>(&value_)) {
+ return Slice::FromCopiedBuffer(*p);
+ } else if (auto* p = y_absl::get_if<std::vector<uint8_t>>(&value_)) {
+ return Slice::FromCopiedBuffer(*p);
}
-
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "integer overflow in hpack integer decoding: have 0x%08x, "
- "got byte 0x%02x sometime after byte 5",
- *p->parsing.value, *cur)
- .c_str());
- return parse_error(p, cur, end, err);
+ GPR_UNREACHABLE_CODE(return Slice());
}
-/* parse a string prefix */
-static grpc_error* parse_string_prefix(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (cur == end) {
- p->state = parse_string_prefix;
- return GRPC_ERROR_NONE;
- }
-
- p->strlen = (*cur) & 0x7f;
- p->huff = (*cur) >> 7;
- if (p->strlen == 0x7f) {
- p->parsing.value = &p->strlen;
- return parse_value0(p, cur + 1, end);
- } else {
- return parse_next(p, cur + 1, end);
+Slice HPackParser::String::Take(Intern) {
+ ManagedMemorySlice m;
+ if (auto* p = y_absl::get_if<Slice>(&value_)) {
+ m = ManagedMemorySlice(&p->c_slice());
+ } else if (auto* p = y_absl::get_if<y_absl::Span<const uint8_t>>(&value_)) {
+ m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size());
+ } else if (auto* p = y_absl::get_if<std::vector<uint8_t>>(&value_)) {
+ m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size());
}
+ return Slice(m);
}
-/* append some bytes to a string */
-static void append_bytes(grpc_chttp2_hpack_parser_string* str,
- const uint8_t* data, size_t length) {
- if (length == 0) return;
- if (length + str->data.copied.length > str->data.copied.capacity) {
- GPR_ASSERT(str->data.copied.length + length <= UINT32_MAX);
- str->data.copied.capacity =
- static_cast<uint32_t>(str->data.copied.length + length);
- str->data.copied.str = static_cast<char*>(
- gpr_realloc(str->data.copied.str, str->data.copied.capacity));
- }
- memcpy(str->data.copied.str + str->data.copied.length, data, length);
- GPR_ASSERT(length <= UINT32_MAX - str->data.copied.length);
- str->data.copied.length += static_cast<uint32_t>(length);
-}
+/* PUBLIC INTERFACE */
-static grpc_error* append_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- grpc_chttp2_hpack_parser_string* str = p->parsing.str;
- uint32_t bits;
- uint8_t decoded[3];
- switch (static_cast<binary_state>(p->binary)) {
- case NOT_BINARY:
- append_bytes(str, cur, static_cast<size_t>(end - cur));
- return GRPC_ERROR_NONE;
- case BINARY_BEGIN:
- if (cur == end) {
- p->binary = BINARY_BEGIN;
- return GRPC_ERROR_NONE;
- }
- if (*cur == 0) {
- /* 'true-binary' case */
- ++cur;
- p->binary = NOT_BINARY;
- GRPC_STATS_INC_HPACK_RECV_BINARY();
- append_bytes(str, cur, static_cast<size_t>(end - cur));
- return GRPC_ERROR_NONE;
- }
- GRPC_STATS_INC_HPACK_RECV_BINARY_BASE64();
- /* fallthrough */
- b64_byte0:
- case B64_BYTE0:
- if (cur == end) {
- p->binary = B64_BYTE0;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte0;
- }
- p->base64_buffer = bits << 18;
- /* fallthrough */
- b64_byte1:
- case B64_BYTE1:
- if (cur == end) {
- p->binary = B64_BYTE1;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte1;
- }
- p->base64_buffer |= bits << 12;
- /* fallthrough */
- b64_byte2:
- case B64_BYTE2:
- if (cur == end) {
- p->binary = B64_BYTE2;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte2;
- }
- p->base64_buffer |= bits << 6;
- /* fallthrough */
- b64_byte3:
- case B64_BYTE3:
- if (cur == end) {
- p->binary = B64_BYTE3;
- return GRPC_ERROR_NONE;
- }
- bits = inverse_base64[*cur];
- ++cur;
- if (bits == 255) {
- return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Illegal base64 character"));
- } else if (bits == 64) {
- goto b64_byte3;
- }
- p->base64_buffer |= bits;
- bits = p->base64_buffer;
- decoded[0] = static_cast<uint8_t>(bits >> 16);
- decoded[1] = static_cast<uint8_t>(bits >> 8);
- decoded[2] = static_cast<uint8_t>(bits);
- append_bytes(str, decoded, 3);
- goto b64_byte0;
+HPackParser::HPackParser() = default;
+
+HPackParser::~HPackParser() = default;
+
+void HPackParser::BeginFrame(grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, Boundary boundary,
+ Priority priority, LogInfo log_info) {
+ metadata_buffer_ = metadata_buffer;
+ boundary_ = boundary;
+ priority_ = priority;
+ dynamic_table_updates_allowed_ = 2;
+ frame_length_ = 0;
+ metadata_size_limit_ = metadata_size_limit;
+ log_info_ = log_info;
+}
+
+grpc_error_handle HPackParser::Parse(const grpc_slice& slice, bool is_last) {
+ if (GPR_UNLIKELY(!unparsed_bytes_.empty())) {
+ std::vector<uint8_t> buffer = std::move(unparsed_bytes_);
+ buffer.insert(buffer.end(), GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_END_PTR(slice));
+ return ParseInput(
+ Input(nullptr, buffer.data(), buffer.data() + buffer.size()), is_last);
}
- GPR_UNREACHABLE_CODE(return parse_error(
- p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here")));
+ return ParseInput(Input(slice.refcount, GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_END_PTR(slice)),
+ is_last);
}
-static grpc_error* finish_str(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- uint8_t decoded[2];
- uint32_t bits;
- grpc_chttp2_hpack_parser_string* str = p->parsing.str;
- switch (static_cast<binary_state>(p->binary)) {
- case NOT_BINARY:
- break;
- case BINARY_BEGIN:
- break;
- case B64_BYTE0:
- break;
- case B64_BYTE1:
- return parse_error(p, cur, end,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "illegal base64 encoding")); /* illegal encoding */
- case B64_BYTE2:
- bits = p->base64_buffer;
- if (bits & 0xffff) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("trailing bits in base64 encoding: 0x%04x",
- bits & 0xffff)
- .c_str());
- return parse_error(p, cur, end, err);
- }
- decoded[0] = static_cast<uint8_t>(bits >> 16);
- append_bytes(str, decoded, 1);
- break;
- case B64_BYTE3:
- bits = p->base64_buffer;
- if (bits & 0xff) {
- grpc_error* err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("trailing bits in base64 encoding: 0x%02x",
- bits & 0xff)
- .c_str());
- return parse_error(p, cur, end, err);
- }
- decoded[0] = static_cast<uint8_t>(bits >> 16);
- decoded[1] = static_cast<uint8_t>(bits >> 8);
- append_bytes(str, decoded, 2);
- break;
+grpc_error_handle HPackParser::ParseInput(Input input, bool is_last) {
+ if (ParseInputInner(&input)) {
+ return GRPC_ERROR_NONE;
}
- return GRPC_ERROR_NONE;
-}
-
-/* decode a nibble from a huffman encoded stream */
-static grpc_error* huff_nibble(grpc_chttp2_hpack_parser* p, uint8_t nibble) {
- int16_t emit = emit_sub_tbl[16 * emit_tbl[p->huff_state] + nibble];
- int16_t next = next_sub_tbl[16 * next_tbl[p->huff_state] + nibble];
- if (emit != -1) {
- if (emit >= 0 && emit < 256) {
- uint8_t c = static_cast<uint8_t>(emit);
- grpc_error* err = append_string(p, &c, (&c) + 1);
- if (err != GRPC_ERROR_NONE) return err;
- } else {
- assert(emit == 256);
+ if (input.eof_error()) {
+ if (GPR_UNLIKELY(is_last && is_boundary())) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Incomplete header at the end of a header/continuation sequence");
}
- }
- p->huff_state = next;
- return GRPC_ERROR_NONE;
-}
-
-/* decode full bytes from a huffman encoded stream */
-static grpc_error* add_huff_bytes(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- for (; cur != end; ++cur) {
- grpc_error* err = huff_nibble(p, *cur >> 4);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- err = huff_nibble(p, *cur & 0xf);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- }
- return GRPC_ERROR_NONE;
-}
-
-/* decode some string bytes based on the current decoding mode
- (huffman or not) */
-static grpc_error* add_str_bytes(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- if (p->huff) {
- return add_huff_bytes(p, cur, end);
- } else {
- return append_string(p, cur, end);
- }
-}
-
-/* parse a string - tries to do large chunks at a time */
-static grpc_error* parse_string(grpc_chttp2_hpack_parser* p, const uint8_t* cur,
- const uint8_t* end) {
- size_t remaining = p->strlen - p->strgot;
- size_t given = static_cast<size_t>(end - cur);
- if (remaining <= given) {
- grpc_error* err = add_str_bytes(p, cur, cur + remaining);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- err = finish_str(p, cur + remaining, end);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_next(p, cur + remaining, end);
- } else {
- grpc_error* err = add_str_bytes(p, cur, cur + given);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- GPR_ASSERT(given <= UINT32_MAX - p->strgot);
- p->strgot += static_cast<uint32_t>(given);
- p->state = parse_string;
+ unparsed_bytes_ = std::vector<uint8_t>(input.frontier(), input.end_ptr());
return GRPC_ERROR_NONE;
}
+ return input.TakeError();
}
-/* begin parsing a string - performs setup, calls parse_string */
-static grpc_error* begin_parse_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end,
- uint8_t binary,
- grpc_chttp2_hpack_parser_string* str) {
- if (!p->huff && binary == NOT_BINARY &&
- static_cast<uint32_t>(end - cur) >= p->strlen &&
- p->current_slice_refcount != nullptr) {
- GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
- str->copied = false;
- str->data.referenced.refcount = p->current_slice_refcount;
- str->data.referenced.data.refcounted.bytes = const_cast<uint8_t*>(cur);
- str->data.referenced.data.refcounted.length = p->strlen;
- grpc_slice_ref_internal(str->data.referenced);
- return parse_next(p, cur + p->strlen, end);
- }
- p->strgot = 0;
- str->copied = true;
- str->data.copied.length = 0;
- p->parsing.str = str;
- p->huff_state = 0;
- p->binary = binary;
- switch (p->binary) {
- case NOT_BINARY:
- if (p->huff) {
- GRPC_STATS_INC_HPACK_RECV_HUFFMAN();
- } else {
- GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
- }
- break;
- case BINARY_BEGIN:
- /* stats incremented later: don't know true binary or not */
+bool HPackParser::ParseInputInner(Input* input) {
+ switch (priority_) {
+ case Priority::None:
break;
- default:
- abort();
+ case Priority::Included: {
+ if (input->remaining() < 5) return input->UnexpectedEOF(false);
+ input->Advance(5);
+ input->UpdateFrontier();
+ priority_ = Priority::None;
+ }
}
- return parse_string(p, cur, end);
-}
-
-/* parse the key string */
-static grpc_error* parse_key_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end) {
- return begin_parse_string(p, cur, end, NOT_BINARY, &p->key);
-}
-
-/* check if a key represents a binary header or not */
-
-static bool is_binary_literal_header(grpc_chttp2_hpack_parser* p) {
- /* We know that either argument here is a reference counter slice.
- * 1. If it is a grpc_core::StaticSlice, the refcount is set to kNoopRefcount.
- * 2. If it's p->key.data.referenced, then p->key.copied was set to false,
- * which occurs in begin_parse_string() - where the refcount is set to
- * p->current_slice_refcount, which is not null. */
- return grpc_is_refcounted_slice_binary_header(
- p->key.copied ? grpc_core::ExternallyManagedSlice(
- p->key.data.copied.str, p->key.data.copied.length)
- : p->key.data.referenced);
-}
-
-/* Cache the metadata for the given index during initial parsing. This avoids a
- pointless recomputation of the metadata when finishing a header. We read the
- cached value in get_precomputed_md_for_idx(). */
-static void set_precomputed_md_idx(grpc_chttp2_hpack_parser* p,
- grpc_mdelem md) {
- GPR_DEBUG_ASSERT(p->md_for_index.payload == 0);
- GPR_DEBUG_ASSERT(p->precomputed_md_index == -1);
- p->md_for_index = md;
-#ifndef NDEBUG
- p->precomputed_md_index = p->index;
-#endif
-}
-
-/* Determines if a metadata element key associated with the current parser index
- is a binary indexed header during string parsing. We'll need to revisit this
- metadata when we're done parsing, so we cache the metadata for this index
- here using set_precomputed_md_idx(). */
-static grpc_error* is_binary_indexed_header(grpc_chttp2_hpack_parser* p,
- bool* is) {
- grpc_mdelem elem = grpc_chttp2_hptbl_lookup(&p->table, p->index);
- if (GPR_UNLIKELY(GRPC_MDISNULL(elem))) {
- return on_invalid_hpack_idx(p);
+ while (!input->end_of_stream()) {
+ if (GPR_UNLIKELY(!Parser(input, metadata_buffer_, metadata_size_limit_,
+ &table_, &dynamic_table_updates_allowed_,
+ &frame_length_, log_info_)
+ .Parse())) {
+ return false;
+ }
+ input->UpdateFrontier();
}
- /* We know that GRPC_MDKEY(elem) points to a reference counted slice since:
- * 1. elem was a result of grpc_chttp2_hptbl_lookup
- * 2. An item in this table is either static (see entries with
- * index < GRPC_CHTTP2_LAST_STATIC_ENTRY or added via
- * grpc_chttp2_hptbl_add).
- * 3. If added via grpc_chttp2_hptbl_add, the entry is either static or
- * interned.
- * 4. Both static and interned element slices have non-null refcounts. */
- *is = grpc_is_refcounted_slice_binary_header(GRPC_MDKEY(elem));
- set_precomputed_md_idx(p, elem);
- return GRPC_ERROR_NONE;
-}
-
-/* parse the value string */
-static grpc_error* parse_value_string(grpc_chttp2_hpack_parser* p,
- const uint8_t* cur, const uint8_t* end,
- bool is_binary) {
- return begin_parse_string(p, cur, end, is_binary ? BINARY_BEGIN : NOT_BINARY,
- &p->value);
-}
-
-static grpc_error* parse_value_string_with_indexed_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) {
- bool is_binary = false;
- grpc_error* err = is_binary_indexed_header(p, &is_binary);
- if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
- return parse_value_string(p, cur, end, is_binary);
-}
-
-static grpc_error* parse_value_string_with_literal_key(
- grpc_chttp2_hpack_parser* p, const uint8_t* cur, const uint8_t* end) {
- return parse_value_string(p, cur, end, is_binary_literal_header(p));
-}
-
-/* "Uninitialized" header parser to save us a branch in on_hdr(). */
-static grpc_error* on_header_uninitialized(void* /*user_data*/,
- grpc_mdelem md) {
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING("on_header callback not set");
-}
-
-/* PUBLIC INTERFACE */
-
-void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser* p) {
- p->on_header = on_header_uninitialized;
- p->on_header_user_data = nullptr;
- p->state = parse_begin;
- p->key.data.referenced = grpc_empty_slice();
- p->key.data.copied.str = nullptr;
- p->key.data.copied.capacity = 0;
- p->key.data.copied.length = 0;
- p->value.data.referenced = grpc_empty_slice();
- p->value.data.copied.str = nullptr;
- p->value.data.copied.capacity = 0;
- p->value.data.copied.length = 0;
- /* Cached metadata for the current index the parser is handling. This is set
- to 0 initially, invalidated when the index changes, and invalidated when it
- is read (by get_precomputed_md_for_idx()). It is set during string parsing,
- by set_precomputed_md_idx() - which is called by parse_value_string().
- The goal here is to avoid recomputing the metadata for the index when
- finishing with a header as well as the initial parse. */
- p->md_for_index.payload = 0;
-#ifndef NDEBUG
- /* In debug mode, this ensures that the cached metadata we're reading is in
- * fact correct for the index we are examining. */
- p->precomputed_md_index = -1;
-#endif
- p->dynamic_table_update_allowed = 2;
- p->last_error = GRPC_ERROR_NONE;
+ return true;
}
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p) {
- p->after_prioritization = p->state;
- p->state = parse_stream_dep0;
-}
+void HPackParser::FinishFrame() { metadata_buffer_ = nullptr; }
-void grpc_chttp2_hpack_parser_destroy(grpc_chttp2_hpack_parser* p) {
- grpc_chttp2_hptbl_destroy(&p->table);
- GRPC_ERROR_UNREF(p->last_error);
- grpc_slice_unref_internal(p->key.data.referenced);
- grpc_slice_unref_internal(p->value.data.referenced);
- gpr_free(p->key.data.copied.str);
- gpr_free(p->value.data.copied.str);
-}
+} // namespace grpc_core
-grpc_error* grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser* p,
- const grpc_slice& slice) {
-/* max number of bytes to parse at a time... limits call stack depth on
- * compilers without TCO */
-#define MAX_PARSE_LENGTH 1024
- p->current_slice_refcount = slice.refcount;
- const uint8_t* start = GRPC_SLICE_START_PTR(slice);
- const uint8_t* end = GRPC_SLICE_END_PTR(slice);
- grpc_error* error = GRPC_ERROR_NONE;
- while (start != end && error == GRPC_ERROR_NONE) {
- const uint8_t* target = start + GPR_MIN(MAX_PARSE_LENGTH, end - start);
- error = p->state(p, start, target);
- start = target;
- }
- p->current_slice_refcount = nullptr;
- return error;
-}
+// TODO(ctiller): this serves as an eviction notice for the remainder of this
+// file... it belongs elsewhere!
typedef void (*maybe_complete_func_type)(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
@@ -1669,7 +1344,7 @@ static const maybe_complete_func_type maybe_complete_funcs[] = {
grpc_chttp2_maybe_complete_recv_initial_metadata,
grpc_chttp2_maybe_complete_recv_trailing_metadata};
-static void force_client_rst_stream(void* sp, grpc_error* /*error*/) {
+static void force_client_rst_stream(void* sp, grpc_error_handle /*error*/) {
grpc_chttp2_stream* s = static_cast<grpc_chttp2_stream*>(sp);
grpc_chttp2_transport* t = s->t;
if (!s->write_closed) {
@@ -1684,10 +1359,11 @@ static void force_client_rst_stream(void* sp, grpc_error* /*error*/) {
static void parse_stream_compression_md(grpc_chttp2_transport* /*t*/,
grpc_chttp2_stream* s,
grpc_metadata_batch* initial_metadata) {
- if (initial_metadata->idx.named.content_encoding == nullptr ||
+ if (initial_metadata->legacy_index()->named.content_encoding == nullptr ||
grpc_stream_compression_method_parse(
- GRPC_MDVALUE(initial_metadata->idx.named.content_encoding->md), false,
- &s->stream_decompression_method) == 0) {
+ GRPC_MDVALUE(
+ initial_metadata->legacy_index()->named.content_encoding->md),
+ false, &s->stream_decompression_method) == 0) {
s->stream_decompression_method =
GRPC_STREAM_COMPRESSION_IDENTITY_DECOMPRESS;
}
@@ -1699,45 +1375,40 @@ static void parse_stream_compression_md(grpc_chttp2_transport* /*t*/,
}
}
-grpc_error* grpc_chttp2_header_parser_parse(void* hpack_parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last) {
+grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last) {
GPR_TIMER_SCOPE("grpc_chttp2_header_parser_parse", 0);
- grpc_chttp2_hpack_parser* parser =
- static_cast<grpc_chttp2_hpack_parser*>(hpack_parser);
+ auto* parser = static_cast<grpc_core::HPackParser*>(hpack_parser);
if (s != nullptr) {
s->stats.incoming.header_bytes += GRPC_SLICE_LENGTH(slice);
}
- grpc_error* error = grpc_chttp2_hpack_parser_parse(parser, slice);
+ grpc_error_handle error = parser->Parse(slice, is_last != 0);
if (error != GRPC_ERROR_NONE) {
return error;
}
if (is_last) {
- if (parser->is_boundary && parser->state != parse_begin) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "end of header frame not aligned with a hpack record boundary");
- }
/* need to check for null stream: this can occur if we receive an invalid
stream id on a header */
if (s != nullptr) {
- if (parser->is_boundary) {
- if (s->header_frames_received == GPR_ARRAY_SIZE(s->metadata_buffer)) {
+ if (parser->is_boundary()) {
+ if (s->header_frames_received == 2) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Too many trailer frames");
}
/* Process stream compression md element if it exists */
if (s->header_frames_received ==
0) { /* Only acts on initial metadata */
- parse_stream_compression_md(t, s, &s->metadata_buffer[0].batch);
+ parse_stream_compression_md(t, s, &s->initial_metadata_buffer);
}
s->published_metadata[s->header_frames_received] =
GRPC_METADATA_PUBLISHED_FROM_WIRE;
maybe_complete_funcs[s->header_frames_received](t, s);
s->header_frames_received++;
}
- if (parser->is_eof) {
+ if (parser->is_eof()) {
if (t->is_client && !s->write_closed) {
/* server eof ==> complete closure; we may need to forcefully close
the stream. Wait until the combiner lock is ready to be released
@@ -1751,11 +1422,7 @@ grpc_error* grpc_chttp2_header_parser_parse(void* hpack_parser,
grpc_chttp2_mark_stream_closed(t, s, true, false, GRPC_ERROR_NONE);
}
}
- parser->on_header = on_header_uninitialized;
- parser->on_header_user_data = nullptr;
- parser->is_boundary = 0xde;
- parser->is_eof = 0xde;
- parser->dynamic_table_update_allowed = 2;
+ parser->FinishFrame();
}
return GRPC_ERROR_NONE;
}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
index 1b859c4d7c6..88b5d52c413 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser.h
@@ -24,94 +24,113 @@
#include <stddef.h>
#include "src/core/ext/transport/chttp2/transport/frame.h"
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
+#include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h"
#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/metadata_batch.h"
-typedef struct grpc_chttp2_hpack_parser grpc_chttp2_hpack_parser;
-
-typedef grpc_error* (*grpc_chttp2_hpack_parser_state)(
- grpc_chttp2_hpack_parser* p, const uint8_t* beg, const uint8_t* end);
-
-struct grpc_chttp2_hpack_parser_string {
- bool copied;
- struct {
- grpc_slice referenced;
- struct {
- char* str;
- uint32_t length;
- uint32_t capacity;
- } copied;
- } data;
-};
-struct grpc_chttp2_hpack_parser {
- /* user specified callback for each header output */
- grpc_error* (*on_header)(void* user_data, grpc_mdelem md);
- void* on_header_user_data;
-
- grpc_error* last_error;
-
- /* current parse state - or a function that implements it */
- grpc_chttp2_hpack_parser_state state;
- /* future states dependent on the opening op code */
- const grpc_chttp2_hpack_parser_state* next_state;
- /* what to do after skipping prioritization data */
- grpc_chttp2_hpack_parser_state after_prioritization;
- /* the refcount of the slice that we're currently parsing */
- grpc_slice_refcount* current_slice_refcount;
- /* the value we're currently parsing */
- union {
- uint32_t* value;
- grpc_chttp2_hpack_parser_string* str;
- } parsing;
- /* string parameters for each chunk */
- grpc_chttp2_hpack_parser_string key;
- grpc_chttp2_hpack_parser_string value;
- /* parsed index */
- uint32_t index;
- /* When we parse a value string, we determine the metadata element for a
- specific index, which we need again when we're finishing up with that
- header. To avoid calculating the metadata element for that index a second
- time at that stage, we cache (and invalidate) the element here. */
- grpc_mdelem md_for_index;
-#ifndef NDEBUG
- int64_t precomputed_md_index;
-#endif
- /* length of source bytes for the currently parsing string */
- uint32_t strlen;
- /* number of source bytes read for the currently parsing string */
- uint32_t strgot;
- /* huffman decoding state */
- int16_t huff_state;
- /* is the string being decoded binary? */
- uint8_t binary;
- /* is the current string huffman encoded? */
- uint8_t huff;
- /* is a dynamic table update allowed? */
- uint8_t dynamic_table_update_allowed;
- /* set by higher layers, used by grpc_chttp2_header_parser_parse to signal
- it should append a metadata boundary at the end of frame */
- uint8_t is_boundary;
- uint8_t is_eof;
- uint32_t base64_buffer;
-
- /* hpack table */
- grpc_chttp2_hptbl table;
-};
+namespace grpc_core {
+
+// Top level interface for parsing a sequence of header, continuation frames.
+class HPackParser {
+ public:
+ // What kind of stream boundary is provided by this frame?
+ enum class Boundary : uint8_t {
+ // More continuations are expected
+ None,
+ // This marks the end of headers, so data frames should follow
+ EndOfHeaders,
+ // This marks the end of headers *and* the end of the stream
+ EndOfStream
+ };
+ // What kind of priority is represented in the next frame
+ enum class Priority : uint8_t {
+ // No priority field
+ None,
+ // Yes there's a priority field
+ Included
+ };
+ // Details about a frame we only need to know for logging
+ struct LogInfo {
+ // The stream ID
+ uint32_t stream_id;
+ // Headers or trailers?
+ enum Type : uint8_t {
+ kHeaders,
+ kTrailers,
+ kDontKnow,
+ };
+ Type type;
+ // Client or server?
+ bool is_client;
+ };
+
+ HPackParser();
+ ~HPackParser();
+
+ // Non-copyable/movable
+ HPackParser(const HPackParser&) = delete;
+ HPackParser& operator=(const HPackParser&) = delete;
+
+ // Begin parsing a new frame
+ // Sink receives each parsed header,
+ void BeginFrame(grpc_metadata_batch* metadata_buffer,
+ uint32_t metadata_size_limit, Boundary boundary,
+ Priority priority, LogInfo log_info);
+ // Start throwing away any received headers after parsing them.
+ void StopBufferingFrame() { metadata_buffer_ = nullptr; }
+ // Parse one slice worth of data
+ grpc_error_handle Parse(const grpc_slice& slice, bool is_last);
+ // Reset state ready for the next BeginFrame
+ void FinishFrame();
-void grpc_chttp2_hpack_parser_init(grpc_chttp2_hpack_parser* p);
-void grpc_chttp2_hpack_parser_destroy(grpc_chttp2_hpack_parser* p);
+ // Retrieve the associated hpack table (for tests, debugging)
+ HPackTable* hpack_table() { return &table_; }
+ // Is the current frame a boundary of some sort
+ bool is_boundary() const { return boundary_ != Boundary::None; }
+ // Is the current frame the end of a stream
+ bool is_eof() const { return boundary_ == Boundary::EndOfStream; }
-void grpc_chttp2_hpack_parser_set_has_priority(grpc_chttp2_hpack_parser* p);
+ private:
+ // Helper classes: see implementation
+ class Parser;
+ class Input;
+ class String;
+
+ grpc_error_handle ParseInput(Input input, bool is_last);
+ bool ParseInputInner(Input* input);
+
+ // Target metadata buffer
+ grpc_metadata_batch* metadata_buffer_ = nullptr;
+
+ // Bytes that could not be parsed last parsing round
+ std::vector<uint8_t> unparsed_bytes_;
+ // Buffer kind of boundary
+ // TODO(ctiller): see if we can move this argument to Parse, and avoid
+ // buffering.
+ Boundary boundary_;
+ // Buffer priority
+ // TODO(ctiller): see if we can move this argument to Parse, and avoid
+ // buffering.
+ Priority priority_;
+ uint8_t dynamic_table_updates_allowed_;
+ // Length of frame so far.
+ uint32_t frame_length_;
+ uint32_t metadata_size_limit_;
+ // Information for logging
+ LogInfo log_info_;
+
+ // hpack table
+ HPackTable table_;
+};
-grpc_error* grpc_chttp2_hpack_parser_parse(grpc_chttp2_hpack_parser* p,
- const grpc_slice& slice);
+} // namespace grpc_core
/* wraps grpc_chttp2_hpack_parser_parse to provide a frame level parser for
the transport */
-grpc_error* grpc_chttp2_header_parser_parse(void* hpack_parser,
- grpc_chttp2_transport* t,
- grpc_chttp2_stream* s,
- const grpc_slice& slice,
- int is_last);
+grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
+ grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s,
+ const grpc_slice& slice,
+ int is_last);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
new file mode 100644
index 00000000000..3aa8741b96f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
@@ -0,0 +1,146 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_parser_table.h"
+
+#include <assert.h>
+#include <string.h>
+
+#include "y_absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/murmur_hash.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/validate_metadata.h"
+#include "src/core/lib/transport/static_metadata.h"
+
+extern grpc_core::TraceFlag grpc_http_trace;
+
+namespace grpc_core {
+
+HPackTable::HPackTable() : static_metadata_(GetStaticMementos()) {}
+
+HPackTable::~HPackTable() = default;
+
+/* Evict one element from the table */
+void HPackTable::EvictOne() {
+ auto first_entry = std::move(entries_[first_entry_]);
+ GPR_ASSERT(first_entry.transport_size() <= mem_used_);
+ mem_used_ -= first_entry.transport_size();
+ first_entry_ = ((first_entry_ + 1) % entries_.size());
+ num_entries_--;
+}
+
+void HPackTable::Rebuild(uint32_t new_cap) {
+ EntriesVec entries;
+ entries.resize(new_cap);
+ for (size_t i = 0; i < num_entries_; i++) {
+ entries[i] = std::move(entries_[(first_entry_ + i) % entries_.size()]);
+ }
+ first_entry_ = 0;
+ entries_.swap(entries);
+}
+
+void HPackTable::SetMaxBytes(uint32_t max_bytes) {
+ if (max_bytes_ == max_bytes) {
+ return;
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
+ }
+ while (mem_used_ > max_bytes) {
+ EvictOne();
+ }
+ max_bytes_ = max_bytes;
+}
+
+grpc_error_handle HPackTable::SetCurrentTableSize(uint32_t bytes) {
+ if (current_table_bytes_ == bytes) {
+ return GRPC_ERROR_NONE;
+ }
+ if (bytes > max_bytes_) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Attempt to make hpack table %d bytes when max is %d bytes", bytes,
+ max_bytes_));
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
+ gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
+ }
+ while (mem_used_ > bytes) {
+ EvictOne();
+ }
+ current_table_bytes_ = bytes;
+ max_entries_ = hpack_constants::EntriesForBytes(bytes);
+ if (max_entries_ > entries_.size()) {
+ Rebuild(max_entries_);
+ } else if (max_entries_ < entries_.size() / 3) {
+ // TODO(ctiller): move to resource quota system, only shrink under memory
+ // pressure
+ uint32_t new_cap =
+ std::max(max_entries_, static_cast<uint32_t>(kInlineEntries));
+ if (new_cap != entries_.size()) {
+ Rebuild(new_cap);
+ }
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle HPackTable::Add(Memento md) {
+ if (current_table_bytes_ > max_bytes_) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "HPACK max table size reduced to %d but not reflected by hpack "
+ "stream (still at %d)",
+ max_bytes_, current_table_bytes_));
+ }
+
+ // we can't add elements bigger than the max table size
+ if (md.transport_size() > current_table_bytes_) {
+ // HPACK draft 10 section 4.4 states:
+ // If the size of the new entry is less than or equal to the maximum
+ // size, that entry is added to the table. It is not an error to
+ // attempt to add an entry that is larger than the maximum size; an
+ // attempt to add an entry larger than the entire table causes
+ // the table to be emptied of all existing entries, and results in an
+ // empty table.
+ while (num_entries_) {
+ EvictOne();
+ }
+ return GRPC_ERROR_NONE;
+ }
+
+ // evict entries to ensure no overflow
+ while (md.transport_size() >
+ static_cast<size_t>(current_table_bytes_) - mem_used_) {
+ EvictOne();
+ }
+
+ // copy the finalized entry in
+ mem_used_ += md.transport_size();
+ entries_[(first_entry_ + num_entries_) % entries_.size()] = std::move(md);
+
+ // update accounting values
+ num_entries_++;
+ return GRPC_ERROR_NONE;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h
new file mode 100644
index 00000000000..3251b803271
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_parser_table.h
@@ -0,0 +1,137 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/slice.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
+#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/metadata_batch.h"
+#include "src/core/lib/transport/static_metadata.h"
+
+namespace grpc_core {
+
+// HPACK header table
+class HPackTable {
+ public:
+ HPackTable();
+ ~HPackTable();
+
+ HPackTable(const HPackTable&) = delete;
+ HPackTable& operator=(const HPackTable&) = delete;
+
+ void SetMaxBytes(uint32_t max_bytes);
+ grpc_error_handle SetCurrentTableSize(uint32_t bytes);
+
+ using Memento = ParsedMetadata<grpc_metadata_batch>;
+
+ // Lookup, but don't ref.
+ const Memento* Lookup(uint32_t index) const {
+ // Static table comes first, just return an entry from it.
+ // NB: This imposes the constraint that the first
+ // GRPC_CHTTP2_LAST_STATIC_ENTRY entries in the core static metadata table
+ // must follow the hpack standard. If that changes, we *must* not rely on
+ // reading the core static metadata table here; at that point we'd need our
+ // own singleton static metadata in the correct order.
+ if (index <= hpack_constants::kLastStaticEntry) {
+ return &static_metadata_.memento[index - 1];
+ } else {
+ return LookupDynamic(index);
+ }
+ }
+
+ // add a table entry to the index
+ grpc_error_handle Add(Memento md) GRPC_MUST_USE_RESULT;
+
+ // Current entry count in the table.
+ uint32_t num_entries() const { return num_entries_; }
+
+ private:
+ struct StaticMementos {
+ StaticMementos() {
+ for (uint32_t i = 0; i < hpack_constants::kLastStaticEntry; i++) {
+ memento[i] = Memento(g_static_mdelem_manifested[i]);
+ }
+ }
+ Memento memento[hpack_constants::kLastStaticEntry];
+ };
+ static const StaticMementos& GetStaticMementos() {
+ static const StaticMementos static_mementos;
+ return static_mementos;
+ }
+
+ enum { kInlineEntries = hpack_constants::kInitialTableEntries };
+ using EntriesVec = y_absl::InlinedVector<Memento, kInlineEntries>;
+
+ const Memento* LookupDynamic(uint32_t index) const {
+ // Not static - find the value in the list of valid entries
+ const uint32_t tbl_index = index - (hpack_constants::kLastStaticEntry + 1);
+ if (tbl_index < num_entries_) {
+ uint32_t offset =
+ (num_entries_ - 1u - tbl_index + first_entry_) % entries_.size();
+ return &entries_[offset];
+ }
+ // Invalid entry: return error
+ return nullptr;
+ }
+
+ void EvictOne();
+ void Rebuild(uint32_t new_cap);
+
+ // The first used entry in ents.
+ uint32_t first_entry_ = 0;
+ // How many entries are in the table.
+ uint32_t num_entries_ = 0;
+ // The amount of memory used by the table, according to the hpack algorithm
+ uint32_t mem_used_ = 0;
+ // The max memory allowed to be used by the table, according to the hpack
+ // algorithm.
+ uint32_t max_bytes_ = hpack_constants::kInitialTableSize;
+ // The currently agreed size of the table, according to the hpack algorithm.
+ uint32_t current_table_bytes_ = hpack_constants::kInitialTableSize;
+ // Maximum number of entries we could possibly fit in the table, given defined
+ // overheads.
+ uint32_t max_entries_ = hpack_constants::kInitialTableEntries;
+ // HPack table entries
+ EntriesVec entries_{hpack_constants::kInitialTableEntries};
+ // Mementos for static data
+ const StaticMementos& static_metadata_;
+};
+
+} // namespace grpc_core
+
+/* Returns the static hpack table index that corresponds to /a elem. Returns 0
+ if /a elem is not statically stored or if it is not in the static hpack
+ table */
+inline uintptr_t grpc_chttp2_get_static_hpack_table_index(grpc_mdelem md) {
+ uintptr_t index =
+ reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md)) -
+ grpc_core::g_static_mdelem_table;
+ if (index < grpc_core::hpack_constants::kLastStaticEntry) {
+ return index + 1; // Hpack static metadata element indices start at 1
+ }
+ return 0;
+}
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_PARSER_TABLE_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
deleted file mode 100644
index 812d17cb457..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/transport/chttp2/transport/hpack_table.h"
-
-#include <assert.h>
-#include <string.h>
-
-#include "y_absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gpr/murmur_hash.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/validate_metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-extern grpc_core::TraceFlag grpc_http_trace;
-
-void grpc_chttp2_hptbl_destroy(grpc_chttp2_hptbl* tbl) {
- size_t i;
- for (i = 0; i < tbl->num_ents; i++) {
- GRPC_MDELEM_UNREF(tbl->ents[(tbl->first_ent + i) % tbl->cap_entries]);
- }
- gpr_free(tbl->ents);
- tbl->ents = nullptr;
-}
-
-template <bool take_ref>
-static grpc_mdelem lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index) {
- /* Not static - find the value in the list of valid entries */
- tbl_index -= (GRPC_CHTTP2_LAST_STATIC_ENTRY + 1);
- if (tbl_index < tbl->num_ents) {
- uint32_t offset =
- (tbl->num_ents - 1u - tbl_index + tbl->first_ent) % tbl->cap_entries;
- grpc_mdelem md = tbl->ents[offset];
- if (take_ref) {
- GRPC_MDELEM_REF(md);
- }
- return md;
- }
- /* Invalid entry: return error */
- return GRPC_MDNULL;
-}
-
-grpc_mdelem grpc_chttp2_hptbl_lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index) {
- return lookup_dynamic_index<false>(tbl, tbl_index);
-}
-
-grpc_mdelem grpc_chttp2_hptbl_lookup_ref_dynamic_index(
- const grpc_chttp2_hptbl* tbl, uint32_t tbl_index) {
- return lookup_dynamic_index<true>(tbl, tbl_index);
-}
-
-/* Evict one element from the table */
-static void evict1(grpc_chttp2_hptbl* tbl) {
- grpc_mdelem first_ent = tbl->ents[tbl->first_ent];
- size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(first_ent)) +
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(first_ent)) +
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
- GPR_ASSERT(elem_bytes <= tbl->mem_used);
- tbl->mem_used -= static_cast<uint32_t>(elem_bytes);
- tbl->first_ent = ((tbl->first_ent + 1) % tbl->cap_entries);
- tbl->num_ents--;
- GRPC_MDELEM_UNREF(first_ent);
-}
-
-static void rebuild_ents(grpc_chttp2_hptbl* tbl, uint32_t new_cap) {
- grpc_mdelem* ents =
- static_cast<grpc_mdelem*>(gpr_malloc(sizeof(*ents) * new_cap));
- uint32_t i;
-
- for (i = 0; i < tbl->num_ents; i++) {
- ents[i] = tbl->ents[(tbl->first_ent + i) % tbl->cap_entries];
- }
- gpr_free(tbl->ents);
- tbl->ents = ents;
- tbl->cap_entries = new_cap;
- tbl->first_ent = 0;
-}
-
-void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl,
- uint32_t max_bytes) {
- if (tbl->max_bytes == max_bytes) {
- return;
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "Update hpack parser max size to %d", max_bytes);
- }
- while (tbl->mem_used > max_bytes) {
- evict1(tbl);
- }
- tbl->max_bytes = max_bytes;
-}
-
-grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl* tbl,
- uint32_t bytes) {
- if (tbl->current_table_bytes == bytes) {
- return GRPC_ERROR_NONE;
- }
- if (bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Attempt to make hpack table %d bytes when max is %d bytes", bytes,
- tbl->max_bytes)
- .c_str());
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- gpr_log(GPR_INFO, "Update hpack parser table size to %d", bytes);
- }
- while (tbl->mem_used > bytes) {
- evict1(tbl);
- }
- tbl->current_table_bytes = bytes;
- tbl->max_entries = grpc_chttp2_hptbl::entries_for_bytes(bytes);
- if (tbl->max_entries > tbl->cap_entries) {
- rebuild_ents(tbl, GPR_MAX(tbl->max_entries, 2 * tbl->cap_entries));
- } else if (tbl->max_entries < tbl->cap_entries / 3) {
- uint32_t new_cap = GPR_MAX(tbl->max_entries, 16u);
- if (new_cap != tbl->cap_entries) {
- rebuild_ents(tbl, new_cap);
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* grpc_chttp2_hptbl_add(grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
- /* determine how many bytes of buffer this entry represents */
- size_t elem_bytes = GRPC_SLICE_LENGTH(GRPC_MDKEY(md)) +
- GRPC_SLICE_LENGTH(GRPC_MDVALUE(md)) +
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
-
- if (tbl->current_table_bytes > tbl->max_bytes) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "HPACK max table size reduced to %d but not reflected by hpack "
- "stream (still at %d)",
- tbl->max_bytes, tbl->current_table_bytes)
- .c_str());
- }
-
- /* we can't add elements bigger than the max table size */
- if (elem_bytes > tbl->current_table_bytes) {
- /* HPACK draft 10 section 4.4 states:
- * If the size of the new entry is less than or equal to the maximum
- * size, that entry is added to the table. It is not an error to
- * attempt to add an entry that is larger than the maximum size; an
- * attempt to add an entry larger than the entire table causes
- * the table
- * to be emptied of all existing entries, and results in an
- * empty table.
- */
- while (tbl->num_ents) {
- evict1(tbl);
- }
- return GRPC_ERROR_NONE;
- }
-
- /* evict entries to ensure no overflow */
- while (elem_bytes >
- static_cast<size_t>(tbl->current_table_bytes) - tbl->mem_used) {
- evict1(tbl);
- }
-
- /* copy the finalized entry in */
- tbl->ents[(tbl->first_ent + tbl->num_ents) % tbl->cap_entries] =
- GRPC_MDELEM_REF(md);
-
- /* update accounting values */
- tbl->num_ents++;
- tbl->mem_used += static_cast<uint32_t>(elem_bytes);
- return GRPC_ERROR_NONE;
-}
-
-grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
- const grpc_chttp2_hptbl* tbl, grpc_mdelem md) {
- grpc_chttp2_hptbl_find_result r = {0, 0};
- uint32_t i;
-
- /* See if the string is in the static table */
- for (i = 0; i < GRPC_CHTTP2_LAST_STATIC_ENTRY; i++) {
- grpc_mdelem ent = grpc_static_mdelem_manifested()[i];
- if (!grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDKEY(ent))) continue;
- r.index = i + 1u;
- r.has_value = grpc_slice_eq(GRPC_MDVALUE(md), GRPC_MDVALUE(ent));
- if (r.has_value) return r;
- }
-
- /* Scan the dynamic table */
- for (i = 0; i < tbl->num_ents; i++) {
- uint32_t idx = static_cast<uint32_t>(tbl->num_ents - i +
- GRPC_CHTTP2_LAST_STATIC_ENTRY);
- grpc_mdelem ent = tbl->ents[(tbl->first_ent + i) % tbl->cap_entries];
- if (!grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDKEY(ent))) continue;
- r.index = idx;
- r.has_value = grpc_slice_eq(GRPC_MDVALUE(md), GRPC_MDVALUE(ent));
- if (r.has_value) return r;
- }
-
- return r;
-}
-
-static size_t get_base64_encoded_size(size_t raw_length) {
- static const uint8_t tail_xtra[3] = {0, 2, 3};
- return raw_length / 3 * 4 + tail_xtra[raw_length % 3];
-}
-
-size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
- bool use_true_binary_metadata) {
- const uint8_t* key_buf = GRPC_SLICE_START_PTR(GRPC_MDKEY(elem));
- size_t key_len = GRPC_SLICE_LENGTH(GRPC_MDKEY(elem));
- size_t overhead_and_key = 32 + key_len;
- size_t value_len = GRPC_SLICE_LENGTH(GRPC_MDVALUE(elem));
- if (grpc_key_is_binary_header(key_buf, key_len)) {
- return overhead_and_key + (use_true_binary_metadata
- ? value_len + 1
- : get_base64_encoded_size(value_len));
- } else {
- return overhead_and_key + value_len;
- }
-}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h
deleted file mode 100644
index 34c3dceda75..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_table.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/slice.h>
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/transport/metadata.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-/* HPACK header table */
-
-/* last index in the static table */
-#define GRPC_CHTTP2_LAST_STATIC_ENTRY 61
-
-/* Initial table size as per the spec */
-#define GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE 4096
-/* Maximum table size that we'll use */
-#define GRPC_CHTTP2_MAX_HPACK_TABLE_SIZE GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE
-/* Per entry overhead bytes as per the spec */
-#define GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD 32
-#if 0
-/* Maximum number of entries we could possibly fit in the table, given defined
- overheads */
-#define GRPC_CHTTP2_MAX_TABLE_COUNT \
- ((GRPC_CHTTP2_MAX_HPACK_TABLE_SIZE + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD - 1) / \
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD)
-#endif
-
-/* hpack decoder table */
-struct grpc_chttp2_hptbl {
- static uint32_t entries_for_bytes(uint32_t bytes) {
- return (bytes + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD - 1) /
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
- }
- static constexpr uint32_t kInitialCapacity =
- (GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE + GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD -
- 1) /
- GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD;
-
- grpc_chttp2_hptbl() {
- GPR_DEBUG_ASSERT(!ents);
- constexpr uint32_t AllocSize = sizeof(*ents) * kInitialCapacity;
- ents = static_cast<grpc_mdelem*>(gpr_malloc(AllocSize));
- memset(ents, 0, AllocSize);
- }
-
- /* the first used entry in ents */
- uint32_t first_ent = 0;
- /* how many entries are in the table */
- uint32_t num_ents = 0;
- /* the amount of memory used by the table, according to the hpack algorithm */
- uint32_t mem_used = 0;
- /* the max memory allowed to be used by the table, according to the hpack
- algorithm */
- uint32_t max_bytes = GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE;
- /* the currently agreed size of the table, according to the hpack algorithm */
- uint32_t current_table_bytes = GRPC_CHTTP2_INITIAL_HPACK_TABLE_SIZE;
- /* Maximum number of entries we could possibly fit in the table, given defined
- overheads */
- uint32_t max_entries = kInitialCapacity;
- /* Number of entries allocated in ents */
- uint32_t cap_entries = kInitialCapacity;
- /* a circular buffer of headers - this is stored in the opposite order to
- what hpack specifies, in order to simplify table management a little...
- meaning lookups need to SUBTRACT from the end position */
- grpc_mdelem* ents = nullptr;
-};
-
-void grpc_chttp2_hptbl_destroy(grpc_chttp2_hptbl* tbl);
-void grpc_chttp2_hptbl_set_max_bytes(grpc_chttp2_hptbl* tbl,
- uint32_t max_bytes);
-grpc_error* grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl* tbl,
- uint32_t bytes);
-
-/* lookup a table entry based on its hpack index */
-grpc_mdelem grpc_chttp2_hptbl_lookup_dynamic_index(const grpc_chttp2_hptbl* tbl,
- uint32_t tbl_index);
-grpc_mdelem grpc_chttp2_hptbl_lookup_ref_dynamic_index(
- const grpc_chttp2_hptbl* tbl, uint32_t tbl_index);
-template <bool take_ref = false>
-inline grpc_mdelem grpc_chttp2_hptbl_lookup(const grpc_chttp2_hptbl* tbl,
- uint32_t index) {
- /* Static table comes first, just return an entry from it.
- NB: This imposes the constraint that the first
- GRPC_CHTTP2_LAST_STATIC_ENTRY entries in the core static metadata table
- must follow the hpack standard. If that changes, we *must* not rely on
- reading the core static metadata table here; at that point we'd need our
- own singleton static metadata in the correct order. */
- if (index <= GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- return grpc_static_mdelem_manifested()[index - 1];
- } else {
- if (take_ref) {
- return grpc_chttp2_hptbl_lookup_ref_dynamic_index(tbl, index);
- } else {
- return grpc_chttp2_hptbl_lookup_dynamic_index(tbl, index);
- }
- }
-}
-/* add a table entry to the index */
-grpc_error* grpc_chttp2_hptbl_add(grpc_chttp2_hptbl* tbl,
- grpc_mdelem md) GRPC_MUST_USE_RESULT;
-
-size_t grpc_chttp2_get_size_in_hpack_table(grpc_mdelem elem,
- bool use_true_binary_metadata);
-
-/* Returns the static hpack table index that corresponds to /a elem. Returns 0
- if /a elem is not statically stored or if it is not in the static hpack
- table */
-inline uintptr_t grpc_chttp2_get_static_hpack_table_index(grpc_mdelem md) {
- uintptr_t index =
- reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table();
- if (index < GRPC_CHTTP2_LAST_STATIC_ENTRY) {
- return index + 1; // Hpack static metadata element indices start at 1
- }
- return 0;
-}
-
-/* Find a key/value pair in the table... returns the index in the table of the
- most similar entry, or 0 if the value was not found */
-struct grpc_chttp2_hptbl_find_result {
- uint32_t index;
- int has_value;
-};
-grpc_chttp2_hptbl_find_result grpc_chttp2_hptbl_find(
- const grpc_chttp2_hptbl* tbl, grpc_mdelem md);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_TABLE_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.cc
new file mode 100644
index 00000000000..fb1d2cb21b5
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.cc
@@ -0,0 +1,46 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/transport/chttp2/transport/hpack_utils.h"
+
+#include "src/core/lib/surface/validate_metadata.h"
+
+namespace grpc_core {
+
+namespace {
+size_t Base64EncodedSize(size_t raw_length) {
+ static constexpr uint8_t tail_xtra[3] = {0, 2, 3};
+ return raw_length / 3 * 4 + tail_xtra[raw_length % 3];
+}
+} // namespace
+
+// Return the size occupied by some metadata in the HPACK table.
+size_t MetadataSizeInHPackTable(grpc_mdelem elem,
+ bool use_true_binary_metadata) {
+ const uint8_t* key_buf = GRPC_SLICE_START_PTR(GRPC_MDKEY(elem));
+ size_t key_len = GRPC_SLICE_LENGTH(GRPC_MDKEY(elem));
+ size_t overhead_and_key = 32 + key_len;
+ size_t value_len = GRPC_SLICE_LENGTH(GRPC_MDVALUE(elem));
+ if (grpc_key_is_binary_header(key_buf, key_len)) {
+ return overhead_and_key + (use_true_binary_metadata
+ ? value_len + 1
+ : Base64EncodedSize(value_len));
+ } else {
+ return overhead_and_key + value_len;
+ }
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.h
new file mode 100644
index 00000000000..a1c9baa4769
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/hpack_utils.h
@@ -0,0 +1,30 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_UTILS_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_UTILS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/transport/metadata.h"
+
+namespace grpc_core {
+
+// Return the size occupied by some metadata in the HPACK table.
+size_t MetadataSizeInHPackTable(grpc_mdelem elem,
+ bool use_true_binary_metadata);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_HPACK_UTILS_H
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
deleted file mode 100644
index d04630d726b..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
-
-#include <string.h>
-
-#include "src/core/ext/transport/chttp2/transport/internal.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-grpc_error* grpc_chttp2_incoming_metadata_buffer_add(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_mdelem elem) {
- buffer->size += GRPC_MDELEM_LENGTH(elem);
- grpc_linked_mdelem* storage;
- if (buffer->count < buffer->kPreallocatedMDElem) {
- storage = &buffer->preallocated_mdelems[buffer->count];
- buffer->count++;
- } else {
- storage = static_cast<grpc_linked_mdelem*>(
- buffer->arena->Alloc(sizeof(grpc_linked_mdelem)));
- }
- storage->md = elem;
- return grpc_metadata_batch_link_tail(&buffer->batch, storage);
-}
-
-grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_mdelem elem) {
- for (grpc_linked_mdelem* l = buffer->batch.list.head; l != nullptr;
- l = l->next) {
- if (grpc_slice_eq(GRPC_MDKEY(l->md), GRPC_MDKEY(elem))) {
- GRPC_MDELEM_UNREF(l->md);
- l->md = elem;
- return GRPC_ERROR_NONE;
- }
- }
- return grpc_chttp2_incoming_metadata_buffer_add(buffer, elem);
-}
-
-void grpc_chttp2_incoming_metadata_buffer_set_deadline(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline) {
- buffer->batch.deadline = deadline;
-}
-
-void grpc_chttp2_incoming_metadata_buffer_publish(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_metadata_batch* batch) {
- grpc_metadata_batch_move(&buffer->batch, batch);
-}
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h
deleted file mode 100644
index b63caa1ae25..00000000000
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/incoming_metadata.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H
-#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/transport/transport.h"
-
-struct grpc_chttp2_incoming_metadata_buffer {
- explicit grpc_chttp2_incoming_metadata_buffer(grpc_core::Arena* arena)
- : arena(arena) {
- grpc_metadata_batch_init(&batch);
- batch.deadline = GRPC_MILLIS_INF_FUTURE;
- }
- ~grpc_chttp2_incoming_metadata_buffer() {
- grpc_metadata_batch_destroy(&batch);
- }
-
- static constexpr size_t kPreallocatedMDElem = 10;
-
- grpc_core::Arena* arena;
- size_t size = 0; // total size of metadata.
- size_t count = 0; // minimum of count of metadata and kPreallocatedMDElem.
- // These preallocated mdelems are used while count < kPreallocatedMDElem.
- grpc_linked_mdelem preallocated_mdelems[kPreallocatedMDElem];
- grpc_metadata_batch batch;
-};
-
-void grpc_chttp2_incoming_metadata_buffer_publish(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_metadata_batch* batch);
-
-grpc_error* grpc_chttp2_incoming_metadata_buffer_add(
- grpc_chttp2_incoming_metadata_buffer* buffer,
- grpc_mdelem elem) GRPC_MUST_USE_RESULT;
-grpc_error* grpc_chttp2_incoming_metadata_buffer_replace_or_add(
- grpc_chttp2_incoming_metadata_buffer* buffer,
- grpc_mdelem elem) GRPC_MUST_USE_RESULT;
-void grpc_chttp2_incoming_metadata_buffer_set_deadline(
- grpc_chttp2_incoming_metadata_buffer* buffer, grpc_millis deadline);
-
-#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INCOMING_METADATA_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
index 4be244d330c..dbf0576b319 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/internal.h
@@ -34,7 +34,6 @@
#include "src/core/ext/transport/chttp2/transport/frame_window_update.h"
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include "src/core/ext/transport/chttp2/transport/hpack_parser.h"
-#include "src/core/ext/transport/chttp2/transport/incoming_metadata.h"
#include "src/core/ext/transport/chttp2/transport/stream_map.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/compression/stream_compression.h"
@@ -42,7 +41,9 @@
#include "src/core/lib/iomgr/combiner.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/transport/connectivity_state.h"
+#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport_impl.h"
namespace grpc_core {
@@ -217,8 +218,8 @@ class Chttp2IncomingByteStream : public ByteStream {
void Orphan() override;
bool Next(size_t max_size_hint, grpc_closure* on_complete) override;
- grpc_error* Pull(grpc_slice* slice) override;
- void Shutdown(grpc_error* error) override;
+ grpc_error_handle Pull(grpc_slice* slice) override;
+ void Shutdown(grpc_error_handle error) override;
// TODO(roth): When I converted this class to C++, I wanted to make it
// inherit from RefCounted or InternallyRefCounted instead of continuing
@@ -241,24 +242,24 @@ class Chttp2IncomingByteStream : public ByteStream {
}
}
- void PublishError(grpc_error* error);
+ void PublishError(grpc_error_handle error);
- grpc_error* Push(const grpc_slice& slice, grpc_slice* slice_out);
+ grpc_error_handle Push(const grpc_slice& slice, grpc_slice* slice_out);
- grpc_error* Finished(grpc_error* error, bool reset_on_error);
+ grpc_error_handle Finished(grpc_error_handle error, bool reset_on_error);
uint32_t remaining_bytes() const { return remaining_bytes_; }
private:
- static void NextLocked(void* arg, grpc_error* error_ignored);
- static void OrphanLocked(void* arg, grpc_error* error_ignored);
+ static void NextLocked(void* arg, grpc_error_handle error_ignored);
+ static void OrphanLocked(void* arg, grpc_error_handle error_ignored);
void MaybeCreateStreamDecompressionCtx();
grpc_chttp2_transport* transport_; // Immutable.
grpc_chttp2_stream* stream_; // Immutable.
- grpc_core::RefCount refs_;
+ RefCount refs_;
/* Accessed only by transport thread when stream->pending_byte_stream == false
* Accessed only by application thread when stream->pending_byte_stream ==
@@ -287,8 +288,7 @@ typedef enum {
struct grpc_chttp2_transport {
grpc_chttp2_transport(const grpc_channel_args* channel_args,
- grpc_endpoint* ep, bool is_client,
- grpc_resource_user* resource_user);
+ grpc_endpoint* ep, bool is_client);
~grpc_chttp2_transport();
grpc_transport base; /* must be first */
@@ -296,7 +296,9 @@ struct grpc_chttp2_transport {
grpc_endpoint* ep;
TString peer_string;
- grpc_resource_user* resource_user;
+ grpc_core::MemoryOwner memory_owner;
+ const grpc_core::MemoryAllocator::Reservation self_reservation;
+ grpc_core::ReclamationSweep active_reclamation;
grpc_core::Combiner* combiner;
@@ -309,7 +311,7 @@ struct grpc_chttp2_transport {
/** is the transport destroying itself? */
uint8_t destroying = false;
/** has the upper layer closed the transport? */
- grpc_error* closed_with_error = GRPC_ERROR_NONE;
+ grpc_error_handle closed_with_error = GRPC_ERROR_NONE;
/** is there a read request to the endpoint outstanding? */
uint8_t endpoint_reading = 1;
@@ -345,7 +347,7 @@ struct grpc_chttp2_transport {
/** data to write now */
grpc_slice_buffer outbuf;
/** hpack encoding */
- grpc_chttp2_hpack_compressor hpack_compressor;
+ grpc_core::HPackCompressor hpack_compressor;
/** is this a client? */
bool is_client;
@@ -358,7 +360,7 @@ struct grpc_chttp2_transport {
/** Set to a grpc_error object if a goaway frame is received. By default, set
* to GRPC_ERROR_NONE */
- grpc_error* goaway_error = GRPC_ERROR_NONE;
+ grpc_error_handle goaway_error = GRPC_ERROR_NONE;
grpc_chttp2_sent_goaway_state sent_goaway_state = GRPC_CHTTP2_NO_GOAWAY_SEND;
@@ -394,7 +396,7 @@ struct grpc_chttp2_transport {
grpc_chttp2_server_ping_recv_state ping_recv_state;
/** parser for headers */
- grpc_chttp2_hpack_parser hpack_parser;
+ grpc_core::HPackParser hpack_parser;
/** simple one shot parsers */
union {
grpc_chttp2_window_update_parser window_update;
@@ -428,9 +430,9 @@ struct grpc_chttp2_transport {
/* active parser */
void* parser_data = nullptr;
grpc_chttp2_stream* incoming_stream = nullptr;
- grpc_error* (*parser)(void* parser_user_data, grpc_chttp2_transport* t,
- grpc_chttp2_stream* s, const grpc_slice& slice,
- int is_last);
+ grpc_error_handle (*parser)(void* parser_user_data, grpc_chttp2_transport* t,
+ grpc_chttp2_stream* s, const grpc_slice& slice,
+ int is_last);
grpc_chttp2_write_cb* write_cb_pool = nullptr;
@@ -443,7 +445,7 @@ struct grpc_chttp2_transport {
/* if non-NULL, close the transport with this error when writes are finished
*/
- grpc_error* close_transport_on_writes_finished = GRPC_ERROR_NONE;
+ grpc_error_handle close_transport_on_writes_finished = GRPC_ERROR_NONE;
/* a list of closures to run after writes are finished */
grpc_closure_list run_after_write = GRPC_CLOSURE_LIST_INIT;
@@ -521,6 +523,8 @@ struct grpc_chttp2_stream {
explicit Reffer(grpc_chttp2_stream* s);
} reffer;
+ grpc_core::MemoryAllocator::Reservation stream_reservation;
+
grpc_closure destroy_stream;
grpc_closure* destroy_stream_arg;
@@ -555,7 +559,8 @@ struct grpc_chttp2_stream {
grpc_metadata_batch* recv_initial_metadata;
grpc_closure* recv_initial_metadata_ready = nullptr;
bool* trailing_metadata_available = nullptr;
- grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message;
+ grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message = nullptr;
+ bool* call_failed_before_recv_message = nullptr;
grpc_closure* recv_message_ready = nullptr;
grpc_metadata_batch* recv_trailing_metadata;
grpc_closure* recv_trailing_metadata_finished = nullptr;
@@ -581,14 +586,15 @@ struct grpc_chttp2_stream {
bool eos_sent = false;
/** the error that resulted in this stream being read-closed */
- grpc_error* read_closed_error = GRPC_ERROR_NONE;
+ grpc_error_handle read_closed_error = GRPC_ERROR_NONE;
/** the error that resulted in this stream being write-closed */
- grpc_error* write_closed_error = GRPC_ERROR_NONE;
+ grpc_error_handle write_closed_error = GRPC_ERROR_NONE;
grpc_published_metadata_method published_metadata[2] = {};
bool final_metadata_requested = false;
- grpc_chttp2_incoming_metadata_buffer metadata_buffer[2];
+ grpc_metadata_batch initial_metadata_buffer;
+ grpc_metadata_batch trailing_metadata_buffer;
grpc_slice_buffer frame_storage; /* protected by t combiner */
@@ -604,13 +610,14 @@ struct grpc_chttp2_stream {
* true */
grpc_slice_buffer unprocessed_incoming_frames_buffer;
grpc_closure reset_byte_stream;
- grpc_error* byte_stream_error = GRPC_ERROR_NONE; /* protected by t combiner */
- bool received_last_frame = false; /* protected by t combiner */
+ grpc_error_handle byte_stream_error =
+ GRPC_ERROR_NONE; /* protected by t combiner */
+ bool received_last_frame = false; /* protected by t combiner */
grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
/** saw some stream level error */
- grpc_error* forced_close_error = GRPC_ERROR_NONE;
+ grpc_error_handle forced_close_error = GRPC_ERROR_NONE;
/** how many header frames have we received? */
uint8_t header_frames_received = 0;
/** parsing state for data frames */
@@ -696,12 +703,12 @@ struct grpc_chttp2_begin_write_result {
};
grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
grpc_chttp2_transport* t);
-void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error* error);
+void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error);
/** Process one slice of incoming data; return 1 if the connection is still
viable after reading, or 0 if the connection should be torn down */
-grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
- const grpc_slice& slice);
+grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
+ const grpc_slice& slice);
bool grpc_chttp2_list_add_writable_stream(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
@@ -764,14 +771,15 @@ grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
void grpc_chttp2_add_incoming_goaway(grpc_chttp2_transport* t,
uint32_t goaway_error,
uint32_t last_stream_id,
- const grpc_slice& goaway_text);
+ y_absl::string_view goaway_text);
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t);
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
grpc_chttp2_stream* s,
grpc_closure** pclosure,
- grpc_error* error, const char* desc);
+ grpc_error_handle error,
+ const char* desc);
#define GRPC_HEADER_SIZE_IN_BYTES 5
#define MAX_SIZE_T (~(size_t)0)
@@ -791,10 +799,11 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
} while (0)
void grpc_chttp2_fake_status(grpc_chttp2_transport* t,
- grpc_chttp2_stream* stream, grpc_error* error);
+ grpc_chttp2_stream* stream,
+ grpc_error_handle error);
void grpc_chttp2_mark_stream_closed(grpc_chttp2_transport* t,
grpc_chttp2_stream* s, int close_reads,
- int close_writes, grpc_error* error);
+ int close_writes, grpc_error_handle error);
void grpc_chttp2_start_writing(grpc_chttp2_transport* t);
#ifndef NDEBUG
@@ -862,7 +871,7 @@ void grpc_chttp2_mark_stream_writable(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_error* due_to_error);
+ grpc_error_handle due_to_error);
void grpc_chttp2_maybe_complete_recv_initial_metadata(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
@@ -872,14 +881,15 @@ void grpc_chttp2_maybe_complete_recv_trailing_metadata(grpc_chttp2_transport* t,
grpc_chttp2_stream* s);
void grpc_chttp2_fail_pending_writes(grpc_chttp2_transport* t,
- grpc_chttp2_stream* s, grpc_error* error);
+ grpc_chttp2_stream* s,
+ grpc_error_handle error);
/** Set the default keepalive configurations, must only be called at
initialization */
void grpc_chttp2_config_default_keepalive_args(grpc_channel_args* args,
bool is_client);
-void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error* error);
+void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error);
void schedule_bdp_ping_locked(grpc_chttp2_transport* t);
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
index bdd14259d03..10cbbb59c84 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/parsing.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/transport/chttp2/transport/internal.h"
-
#include <string.h>
#include "y_absl/strings/str_cat.h"
@@ -28,6 +26,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/slice/slice_utils.h"
@@ -36,27 +35,31 @@
#include "src/core/lib/transport/status_conversion.h"
#include "src/core/lib/transport/timeout_encoding.h"
-static grpc_error* init_frame_parser(grpc_chttp2_transport* t);
-static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
- int is_continuation);
-static grpc_error* init_data_frame_parser(grpc_chttp2_transport* t);
-static grpc_error* init_rst_stream_parser(grpc_chttp2_transport* t);
-static grpc_error* init_settings_frame_parser(grpc_chttp2_transport* t);
-static grpc_error* init_window_update_frame_parser(grpc_chttp2_transport* t);
-static grpc_error* init_ping_parser(grpc_chttp2_transport* t);
-static grpc_error* init_goaway_parser(grpc_chttp2_transport* t);
-static grpc_error* init_skip_frame_parser(grpc_chttp2_transport* t,
- int is_header);
-
-static grpc_error* parse_frame_slice(grpc_chttp2_transport* t,
- const grpc_slice& slice, int is_last);
-
-grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
- const grpc_slice& slice) {
+using grpc_core::HPackParser;
+
+static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
+ int is_continuation);
+static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_window_update_frame_parser(
+ grpc_chttp2_transport* t);
+static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t);
+static grpc_error_handle init_non_header_skip_frame_parser(
+ grpc_chttp2_transport* t);
+
+static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
+ const grpc_slice& slice,
+ int is_last);
+
+grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
+ const grpc_slice& slice) {
const uint8_t* beg = GRPC_SLICE_START_PTR(slice);
const uint8_t* end = GRPC_SLICE_END_PTR(slice);
const uint8_t* cur = beg;
- grpc_error* err;
+ grpc_error_handle err;
if (cur == end) return GRPC_ERROR_NONE;
@@ -87,15 +90,13 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
case GRPC_DTS_CLIENT_PREFIX_23:
while (cur != end && t->deframe_state != GRPC_DTS_FH_0) {
if (*cur != GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state]) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
- "at byte %d",
- GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state],
- static_cast<int>(static_cast<uint8_t>(
- GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state])),
- *cur, static_cast<int>(*cur), t->deframe_state)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Connect string mismatch: expected '%c' (%d) got '%c' (%d) "
+ "at byte %d",
+ GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state],
+ static_cast<int>(static_cast<uint8_t>(
+ GRPC_CHTTP2_CLIENT_CONNECT_STRING[t->deframe_state])),
+ *cur, static_cast<int>(*cur), t->deframe_state));
}
++cur;
// NOLINTNEXTLINE(bugprone-misplaced-widening-cast)
@@ -105,8 +106,8 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
if (cur == end) {
return GRPC_ERROR_NONE;
}
- /* fallthrough */
dts_fh_0:
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_0:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size = (static_cast<uint32_t>(*cur)) << 16;
@@ -114,7 +115,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_1;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_1:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= (static_cast<uint32_t>(*cur)) << 8;
@@ -122,7 +123,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_2;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_2:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_size |= *cur;
@@ -130,7 +131,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_3;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_3:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_type = *cur;
@@ -138,7 +139,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_4;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_4:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_frame_flags = *cur;
@@ -146,7 +147,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_5;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_5:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id = ((static_cast<uint32_t>(*cur)) & 0x7f) << 24;
@@ -154,7 +155,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_6;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_6:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
@@ -162,7 +163,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_7;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_7:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
@@ -170,7 +171,7 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->deframe_state = GRPC_DTS_FH_8;
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_8:
GPR_DEBUG_ASSERT(cur < end);
t->incoming_stream_id |= (static_cast<uint32_t>(*cur));
@@ -194,17 +195,16 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size >
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Frame size %d is larger than max frame size %d",
t->incoming_frame_size,
t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE])
- .c_str());
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]));
}
if (++cur == end) {
return GRPC_ERROR_NONE;
}
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FRAME:
GPR_DEBUG_ASSERT(cur < end);
if (static_cast<uint32_t>(end - cur) == t->incoming_frame_size) {
@@ -244,36 +244,31 @@ grpc_error* grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size -= static_cast<uint32_t>(end - cur);
return GRPC_ERROR_NONE;
}
- GPR_UNREACHABLE_CODE(return nullptr);
+ GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
}
- GPR_UNREACHABLE_CODE(return nullptr);
+ GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
}
-static grpc_error* init_frame_parser(grpc_chttp2_transport* t) {
+static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t) {
if (t->is_first_frame &&
t->incoming_frame_type != GRPC_CHTTP2_FRAME_SETTINGS) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Expected SETTINGS frame as the first frame, got frame type ",
- t->incoming_frame_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Expected SETTINGS frame as the first frame, got frame type ",
+ t->incoming_frame_type));
}
t->is_first_frame = false;
if (t->expect_continuation_stream_id != 0) {
if (t->incoming_frame_type != GRPC_CHTTP2_FRAME_CONTINUATION) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Expected CONTINUATION frame, got frame type %02x",
- t->incoming_frame_type)
- .c_str());
+ t->incoming_frame_type));
}
if (t->expect_continuation_stream_id != t->incoming_stream_id) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
- "grpc_chttp2_stream %08x",
- t->expect_continuation_stream_id, t->incoming_stream_id)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Expected CONTINUATION frame for grpc_chttp2_stream %08x, got "
+ "grpc_chttp2_stream %08x",
+ t->expect_continuation_stream_id, t->incoming_stream_id));
}
return init_header_frame_parser(t, 1);
}
@@ -299,42 +294,74 @@ static grpc_error* init_frame_parser(grpc_chttp2_transport* t) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
gpr_log(GPR_ERROR, "Unknown frame type %02x", t->incoming_frame_type);
}
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
}
-static grpc_error* skip_parser(void* /*parser*/, grpc_chttp2_transport* /*t*/,
- grpc_chttp2_stream* /*s*/,
- const grpc_slice& /*slice*/, int /*is_last*/) {
+static grpc_error_handle skip_parser(void* /*parser*/,
+ grpc_chttp2_transport* /*t*/,
+ grpc_chttp2_stream* /*s*/,
+ const grpc_slice& /*slice*/,
+ int /*is_last*/) {
return GRPC_ERROR_NONE;
}
-static grpc_error* skip_header(void* /*tp*/, grpc_mdelem md) {
+grpc_error_handle skip_header(grpc_mdelem md) {
GRPC_MDELEM_UNREF(md);
return GRPC_ERROR_NONE;
}
-static grpc_error* init_skip_frame_parser(grpc_chttp2_transport* t,
- int is_header) {
- if (is_header) {
- uint8_t is_eoh = t->expect_continuation_stream_id != 0;
- t->parser = grpc_chttp2_header_parser_parse;
- t->parser_data = &t->hpack_parser;
- t->hpack_parser.on_header = skip_header;
- t->hpack_parser.on_header_user_data = nullptr;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
+static HPackParser::Boundary hpack_boundary_type(grpc_chttp2_transport* t,
+ bool is_eoh) {
+ if (is_eoh) {
+ if (t->header_eof) {
+ return HPackParser::Boundary::EndOfStream;
+ } else {
+ return HPackParser::Boundary::EndOfHeaders;
+ }
} else {
- t->parser = skip_parser;
+ return HPackParser::Boundary::None;
}
+}
+
+static HPackParser::LogInfo hpack_parser_log_info(
+ grpc_chttp2_transport* t, HPackParser::LogInfo::Type type) {
+ return HPackParser::LogInfo{
+ t->incoming_stream_id,
+ type,
+ t->is_client,
+ };
+}
+
+static grpc_error_handle init_header_skip_frame_parser(
+ grpc_chttp2_transport* t, HPackParser::Priority priority_type) {
+ bool is_eoh = t->expect_continuation_stream_id != 0;
+ t->parser = grpc_chttp2_header_parser_parse;
+ t->parser_data = &t->hpack_parser;
+ t->hpack_parser.BeginFrame(
+ nullptr,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
+ hpack_boundary_type(t, is_eoh), priority_type,
+ hpack_parser_log_info(t, HPackParser::LogInfo::kDontKnow));
+ return GRPC_ERROR_NONE;
+}
+
+static grpc_error_handle init_non_header_skip_frame_parser(
+ grpc_chttp2_transport* t) {
+ t->parser = skip_parser;
return GRPC_ERROR_NONE;
}
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t) {
- init_skip_frame_parser(t, t->parser == grpc_chttp2_header_parser_parse);
+ if (t->parser == grpc_chttp2_header_parser_parse) {
+ t->hpack_parser.StopBufferingFrame();
+ } else {
+ t->parser = skip_parser;
+ }
}
-static grpc_error* init_data_frame_parser(grpc_chttp2_transport* t) {
+static grpc_error_handle init_data_frame_parser(grpc_chttp2_transport* t) {
// Update BDP accounting since we have received a data frame.
grpc_core::BdpEstimator* bdp_est = t->flow_control->bdp_estimator();
if (bdp_est) {
@@ -347,7 +374,7 @@ static grpc_error* init_data_frame_parser(grpc_chttp2_transport* t) {
}
grpc_chttp2_stream* s =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
- grpc_error* err = GRPC_ERROR_NONE;
+ grpc_error_handle err = GRPC_ERROR_NONE;
grpc_core::chttp2::FlowControlAction action;
if (s == nullptr) {
err = t->flow_control->RecvData(t->incoming_frame_size);
@@ -361,12 +388,12 @@ static grpc_error* init_data_frame_parser(grpc_chttp2_transport* t) {
goto error_handler;
}
if (s == nullptr) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->received_bytes += t->incoming_frame_size;
s->stats.incoming.framing_bytes += 9;
if (err == GRPC_ERROR_NONE && s->read_closed) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
if (err == GRPC_ERROR_NONE) {
err = grpc_chttp2_data_parser_begin_frame(
@@ -389,177 +416,15 @@ error_handler:
grpc_chttp2_add_rst_stream_to_next_write(t, t->incoming_stream_id,
GRPC_HTTP2_PROTOCOL_ERROR,
&s->stats.outgoing);
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
} else {
return err;
}
}
-static void free_timeout(void* p) { gpr_free(p); }
-
-static bool md_key_cmp(grpc_mdelem md, const grpc_slice& reference) {
- GPR_DEBUG_ASSERT(grpc_slice_is_interned(GRPC_MDKEY(md)));
- return GRPC_MDKEY(md).refcount == reference.refcount;
-}
-
-static void GPR_ATTRIBUTE_NOINLINE on_initial_header_log(
- grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_mdelem md) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* value =
- grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "HTTP:%d:HDR:%s: %s: %s", s->id,
- t->is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
-}
-
-static grpc_error* GPR_ATTRIBUTE_NOINLINE handle_timeout(grpc_chttp2_stream* s,
- grpc_mdelem md) {
- grpc_millis* cached_timeout =
- static_cast<grpc_millis*>(grpc_mdelem_get_user_data(md, free_timeout));
- grpc_millis timeout;
- if (cached_timeout != nullptr) {
- timeout = *cached_timeout;
- } else {
- if (GPR_UNLIKELY(!grpc_http2_decode_timeout(GRPC_MDVALUE(md), &timeout))) {
- char* val = grpc_slice_to_c_string(GRPC_MDVALUE(md));
- gpr_log(GPR_ERROR, "Ignoring bad timeout value '%s'", val);
- gpr_free(val);
- timeout = GRPC_MILLIS_INF_FUTURE;
- }
- if (GRPC_MDELEM_IS_INTERNED(md)) {
- /* store the result */
- cached_timeout =
- static_cast<grpc_millis*>(gpr_malloc(sizeof(grpc_millis)));
- *cached_timeout = timeout;
- grpc_mdelem_set_user_data(md, free_timeout, cached_timeout);
- }
- }
- if (timeout != GRPC_MILLIS_INF_FUTURE) {
- grpc_chttp2_incoming_metadata_buffer_set_deadline(
- &s->metadata_buffer[0], grpc_core::ExecCtx::Get()->Now() + timeout);
- }
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* GPR_ATTRIBUTE_NOINLINE handle_metadata_size_limit_exceeded(
- grpc_chttp2_transport* t, grpc_chttp2_stream* s, grpc_mdelem md,
- size_t new_size, size_t metadata_size_limit) {
- gpr_log(GPR_DEBUG,
- "received initial metadata size exceeds limit (%" PRIuPTR
- " vs. %" PRIuPTR
- "). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
- new_size, metadata_size_limit);
- grpc_chttp2_cancel_stream(
- t, s,
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "received initial metadata size exceeds limit"),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_RESOURCE_EXHAUSTED));
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* GPR_ATTRIBUTE_NOINLINE
-handle_metadata_add_failure(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_mdelem md, grpc_error* error) {
- grpc_chttp2_cancel_stream(t, s, error);
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* on_initial_header(void* tp, grpc_mdelem md) {
- GPR_TIMER_SCOPE("on_initial_header", 0);
-
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- grpc_chttp2_stream* s = t->incoming_stream;
- GPR_DEBUG_ASSERT(s != nullptr);
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- on_initial_header_log(t, s, md);
- }
-
- if (md_key_cmp(md, GRPC_MDSTR_GRPC_TIMEOUT)) {
- return handle_timeout(s, md);
- }
-
- const size_t new_size = s->metadata_buffer[0].size + GRPC_MDELEM_LENGTH(md);
- const size_t metadata_size_limit =
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE];
- if (GPR_UNLIKELY(new_size > metadata_size_limit)) {
- return handle_metadata_size_limit_exceeded(t, s, md, new_size,
- metadata_size_limit);
- } else {
- grpc_error* error =
- grpc_chttp2_incoming_metadata_buffer_add(&s->metadata_buffer[0], md);
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- return handle_metadata_add_failure(t, s, md, error);
- }
- }
- // Not timeout-related metadata, and no error occurred.
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* on_trailing_header(void* tp, grpc_mdelem md) {
- GPR_TIMER_SCOPE("on_trailing_header", 0);
-
- grpc_chttp2_transport* t = static_cast<grpc_chttp2_transport*>(tp);
- grpc_chttp2_stream* s = t->incoming_stream;
- GPR_DEBUG_ASSERT(s != nullptr);
-
- if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
- char* value =
- grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- gpr_log(GPR_INFO, "HTTP:%d:TRL:%s: %s: %s", s->id,
- t->is_client ? "CLI" : "SVR", key, value);
- gpr_free(key);
- gpr_free(value);
- }
-
- const size_t new_size = s->metadata_buffer[1].size + GRPC_MDELEM_LENGTH(md);
- const size_t metadata_size_limit =
- t->settings[GRPC_ACKED_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE];
- if (new_size > metadata_size_limit) {
- gpr_log(GPR_DEBUG,
- "received trailing metadata size exceeds limit (%" PRIuPTR
- " vs. %" PRIuPTR
- "). Please note that the status is also included in the trailing "
- "metadata and a large status message can also trigger this. "
- "GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
- new_size, metadata_size_limit);
- grpc_chttp2_cancel_stream(
- t, s,
- grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "received trailing metadata size exceeds limit"),
- GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_RESOURCE_EXHAUSTED));
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- } else {
- grpc_error* error =
- grpc_chttp2_incoming_metadata_buffer_add(&s->metadata_buffer[1], md);
- if (error != GRPC_ERROR_NONE) {
- grpc_chttp2_cancel_stream(t, s, error);
- grpc_chttp2_parsing_become_skip_parser(t);
- s->seen_error = true;
- GRPC_MDELEM_UNREF(md);
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
- int is_continuation) {
- uint8_t is_eoh =
+static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
+ int is_continuation) {
+ const bool is_eoh =
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_HEADERS) != 0;
grpc_chttp2_stream* s;
@@ -576,6 +441,11 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
(t->incoming_frame_flags & GRPC_CHTTP2_DATA_FLAG_END_STREAM) != 0;
}
+ const auto priority_type = !is_continuation && (t->incoming_frame_flags &
+ GRPC_CHTTP2_FLAG_HAS_PRIORITY)
+ ? HPackParser::Priority::Included
+ : HPackParser::Priority::None;
+
t->ping_state.last_ping_sent_time = GRPC_MILLIS_INF_PAST;
/* could be a new grpc_chttp2_stream or an existing grpc_chttp2_stream */
@@ -585,7 +455,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR,
"grpc_chttp2_stream disbanded before CONTINUATION received"));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
if (t->is_client) {
if (GPR_LIKELY((t->incoming_stream_id & 1) &&
@@ -595,11 +465,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client"));
}
- grpc_error* err = init_skip_frame_parser(t, 1);
- if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY) {
- grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
- }
- return err;
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY(t->last_new_stream_id >= t->incoming_stream_id)) {
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
@@ -607,13 +473,13 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
"last grpc_chttp2_stream "
"id=%d, new grpc_chttp2_stream id=%d",
t->last_new_stream_id, t->incoming_stream_id));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY((t->incoming_stream_id & 1) == 0)) {
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
"ignoring grpc_chttp2_stream with non-client generated index %d",
t->incoming_stream_id));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
} else if (GPR_UNLIKELY(
grpc_chttp2_stream_map_size(&t->stream_map) >=
t->settings[GRPC_ACKED_SETTINGS]
@@ -626,7 +492,7 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
if (GPR_UNLIKELY(s == nullptr)) {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"));
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
if (t->channelz_socket != nullptr) {
t->channelz_socket->RecordStreamStartedFromRemote();
@@ -640,13 +506,15 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR, "skipping already closed grpc_chttp2_stream header"));
t->incoming_stream = nullptr;
- return init_skip_frame_parser(t, 1);
+ return init_header_skip_frame_parser(t, priority_type);
}
t->parser = grpc_chttp2_header_parser_parse;
t->parser_data = &t->hpack_parser;
if (t->header_eof) {
s->eos_received = true;
}
+ grpc_metadata_batch* incoming_metadata_buffer = nullptr;
+ HPackParser::LogInfo::Type frame_type = HPackParser::LogInfo::kDontKnow;
switch (s->header_frames_received) {
case 0:
if (t->is_client && t->header_eof) {
@@ -654,32 +522,35 @@ static grpc_error* init_header_frame_parser(grpc_chttp2_transport* t,
if (s->trailing_metadata_available != nullptr) {
*s->trailing_metadata_available = true;
}
- t->hpack_parser.on_header = on_trailing_header;
+ incoming_metadata_buffer = &s->trailing_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kTrailers;
} else {
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing initial_metadata"));
- t->hpack_parser.on_header = on_initial_header;
+ incoming_metadata_buffer = &s->initial_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kHeaders;
}
break;
case 1:
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "parsing trailing_metadata"));
- t->hpack_parser.on_header = on_trailing_header;
+ incoming_metadata_buffer = &s->trailing_metadata_buffer;
+ frame_type = HPackParser::LogInfo::kTrailers;
break;
case 2:
gpr_log(GPR_ERROR, "too many header frames received");
- return init_skip_frame_parser(t, 1);
- }
- t->hpack_parser.on_header_user_data = t;
- t->hpack_parser.is_boundary = is_eoh;
- t->hpack_parser.is_eof = static_cast<uint8_t>(is_eoh ? t->header_eof : 0);
- if (!is_continuation &&
- (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_HAS_PRIORITY)) {
- grpc_chttp2_hpack_parser_set_has_priority(&t->hpack_parser);
+ return init_header_skip_frame_parser(t, priority_type);
}
+ t->hpack_parser.BeginFrame(
+ incoming_metadata_buffer,
+ t->settings[GRPC_ACKED_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
+ hpack_boundary_type(t, is_eoh), priority_type,
+ hpack_parser_log_info(t, frame_type));
return GRPC_ERROR_NONE;
}
-static grpc_error* init_window_update_frame_parser(grpc_chttp2_transport* t) {
- grpc_error* err = grpc_chttp2_window_update_parser_begin_frame(
+static grpc_error_handle init_window_update_frame_parser(
+ grpc_chttp2_transport* t) {
+ grpc_error_handle err = grpc_chttp2_window_update_parser_begin_frame(
&t->simple.window_update, t->incoming_frame_size,
t->incoming_frame_flags);
if (err != GRPC_ERROR_NONE) return err;
@@ -687,7 +558,7 @@ static grpc_error* init_window_update_frame_parser(grpc_chttp2_transport* t) {
grpc_chttp2_stream* s = t->incoming_stream =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (s == nullptr) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->stats.incoming.framing_bytes += 9;
}
@@ -696,8 +567,8 @@ static grpc_error* init_window_update_frame_parser(grpc_chttp2_transport* t) {
return GRPC_ERROR_NONE;
}
-static grpc_error* init_ping_parser(grpc_chttp2_transport* t) {
- grpc_error* err = grpc_chttp2_ping_parser_begin_frame(
+static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t) {
+ grpc_error_handle err = grpc_chttp2_ping_parser_begin_frame(
&t->simple.ping, t->incoming_frame_size, t->incoming_frame_flags);
if (err != GRPC_ERROR_NONE) return err;
t->parser = grpc_chttp2_ping_parser_parse;
@@ -705,14 +576,14 @@ static grpc_error* init_ping_parser(grpc_chttp2_transport* t) {
return GRPC_ERROR_NONE;
}
-static grpc_error* init_rst_stream_parser(grpc_chttp2_transport* t) {
- grpc_error* err = grpc_chttp2_rst_stream_parser_begin_frame(
+static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t) {
+ grpc_error_handle err = grpc_chttp2_rst_stream_parser_begin_frame(
&t->simple.rst_stream, t->incoming_frame_size, t->incoming_frame_flags);
if (err != GRPC_ERROR_NONE) return err;
grpc_chttp2_stream* s = t->incoming_stream =
grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (!t->incoming_stream) {
- return init_skip_frame_parser(t, 0);
+ return init_non_header_skip_frame_parser(t);
}
s->stats.incoming.framing_bytes += 9;
t->parser = grpc_chttp2_rst_stream_parser_parse;
@@ -720,8 +591,8 @@ static grpc_error* init_rst_stream_parser(grpc_chttp2_transport* t) {
return GRPC_ERROR_NONE;
}
-static grpc_error* init_goaway_parser(grpc_chttp2_transport* t) {
- grpc_error* err = grpc_chttp2_goaway_parser_begin_frame(
+static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t) {
+ grpc_error_handle err = grpc_chttp2_goaway_parser_begin_frame(
&t->goaway_parser, t->incoming_frame_size, t->incoming_frame_flags);
if (err != GRPC_ERROR_NONE) return err;
t->parser = grpc_chttp2_goaway_parser_parse;
@@ -729,13 +600,13 @@ static grpc_error* init_goaway_parser(grpc_chttp2_transport* t) {
return GRPC_ERROR_NONE;
}
-static grpc_error* init_settings_frame_parser(grpc_chttp2_transport* t) {
+static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t) {
if (t->incoming_stream_id != 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Settings frame received for grpc_chttp2_stream");
}
- grpc_error* err = grpc_chttp2_settings_parser_begin_frame(
+ grpc_error_handle err = grpc_chttp2_settings_parser_begin_frame(
&t->simple.settings, t->incoming_frame_size, t->incoming_frame_flags,
t->settings[GRPC_PEER_SETTINGS]);
if (err != GRPC_ERROR_NONE) {
@@ -744,8 +615,7 @@ static grpc_error* init_settings_frame_parser(grpc_chttp2_transport* t) {
if (t->incoming_frame_flags & GRPC_CHTTP2_FLAG_ACK) {
memcpy(t->settings[GRPC_ACKED_SETTINGS], t->settings[GRPC_SENT_SETTINGS],
GRPC_CHTTP2_NUM_SETTINGS * sizeof(uint32_t));
- grpc_chttp2_hptbl_set_max_bytes(
- &t->hpack_parser.table,
+ t->hpack_parser.hpack_table()->SetMaxBytes(
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
t->sent_local_settings = false;
@@ -755,17 +625,17 @@ static grpc_error* init_settings_frame_parser(grpc_chttp2_transport* t) {
return GRPC_ERROR_NONE;
}
-static grpc_error* parse_frame_slice(grpc_chttp2_transport* t,
- const grpc_slice& slice, int is_last) {
+static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,
+ const grpc_slice& slice,
+ int is_last) {
grpc_chttp2_stream* s = t->incoming_stream;
- grpc_error* err = t->parser(t->parser_data, t, s, slice, is_last);
+ grpc_error_handle err = t->parser(t->parser_data, t, s, slice, is_last);
intptr_t unused;
if (GPR_LIKELY(err == GRPC_ERROR_NONE)) {
return err;
} else if (grpc_error_get_int(err, GRPC_ERROR_INT_STREAM_ID, &unused)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
- const char* msg = grpc_error_string(err);
- gpr_log(GPR_ERROR, "%s", msg);
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(err).c_str());
}
grpc_chttp2_parsing_become_skip_parser(t);
if (s) {
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/popularity_count.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/popularity_count.h
new file mode 100644
index 00000000000..3f4b4d11d8e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/popularity_count.h
@@ -0,0 +1,60 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_POPULARITY_COUNT_H
+#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_POPULARITY_COUNT_H
+
+#include <grpc/support/port_platform.h>
+
+namespace grpc_core {
+
+// filter tables for elems: this tables provides an approximate
+// popularity count for particular hashes, and are used to determine whether
+// a new literal should be added to the compression table or not.
+// They track a single integer that counts how often a particular value has
+// been seen. When that count reaches max (255), all values are halved. */
+template <uint8_t kElems>
+class PopularityCount {
+ public:
+ PopularityCount() : sum_{0}, elems_{} {}
+
+ // increment a filter count, halve all counts if one element reaches max
+ // return true if this element seems to be popular, false otherwise
+ bool AddElement(uint8_t idx) {
+ elems_[idx]++;
+ if (GPR_LIKELY(elems_[idx] < 255)) {
+ sum_++;
+ } else {
+ HalveFilter();
+ }
+ return elems_[idx] >= 2 * sum_ / kElems;
+ }
+
+ private:
+ // halve all counts because an element reached max
+ void HalveFilter() {
+ sum_ = 0;
+ for (int i = 0; i < kElems; i++) {
+ elems_[i] /= 2;
+ sum_ += elems_[i];
+ }
+ }
+
+ uint32_t sum_;
+ uint8_t elems_[kElems];
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_POPULARITY_COUNT_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
index db79899dedc..9c3c3e69220 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/stream_lists.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <grpc/support/log.h>
+
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
-#include <grpc/support/log.h>
-
static const char* stream_list_id_string(grpc_chttp2_stream_list_id id) {
switch (id) {
case GRPC_CHTTP2_LIST_WRITABLE:
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.cc
index d4b01788b94..21900098bee 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.cc
@@ -20,7 +20,11 @@
#include "src/core/ext/transport/chttp2/transport/varint.h"
-uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value) {
+#include "y_absl/base/attributes.h"
+
+namespace grpc_core {
+
+uint32_t VarintLength(uint32_t tail_value) {
if (tail_value < (1 << 7)) {
return 2;
} else if (tail_value < (1 << 14)) {
@@ -34,23 +38,25 @@ uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value) {
}
}
-void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
- uint32_t tail_length) {
+void VarintWriteTail(uint32_t tail_value, uint8_t* target,
+ uint32_t tail_length) {
switch (tail_length) {
case 5:
target[4] = static_cast<uint8_t>((tail_value >> 28) | 0x80);
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 4:
target[3] = static_cast<uint8_t>((tail_value >> 21) | 0x80);
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 3:
target[2] = static_cast<uint8_t>((tail_value >> 14) | 0x80);
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 2:
target[1] = static_cast<uint8_t>((tail_value >> 7) | 0x80);
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 1:
target[0] = static_cast<uint8_t>((tail_value) | 0x80);
}
target[tail_length - 1] &= 0x7f;
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.h b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.h
index 5a2b670f065..d4ba48756ad 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.h
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/varint.h
@@ -23,38 +23,49 @@
/* Helpers for hpack varint encoding */
+namespace grpc_core {
+
+/* maximum value that can be bitpacked with the opcode if the opcode has a
+ prefix of length prefix_bits */
+constexpr uint32_t MaxInVarintPrefix(uint8_t prefix_bits) {
+ return (1 << (8 - prefix_bits)) - 1;
+}
+
/* length of a value that needs varint tail encoding (it's bigger than can be
bitpacked into the opcode byte) - returned value includes the length of the
opcode byte */
-uint32_t grpc_chttp2_hpack_varint_length(uint32_t tail_value);
+uint32_t VarintLength(uint32_t tail_value);
+void VarintWriteTail(uint32_t tail_value, uint8_t* target,
+ uint32_t tail_length);
-void grpc_chttp2_hpack_write_varint_tail(uint32_t tail_value, uint8_t* target,
- uint32_t tail_length);
+template <uint8_t kPrefixBits>
+class VarintWriter {
+ public:
+ static constexpr uint32_t kMaxInPrefix = MaxInVarintPrefix(kPrefixBits);
-/* maximum value that can be bitpacked with the opcode if the opcode has a
- prefix
- of length prefix_bits */
-#define GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \
- ((uint32_t)((1 << (8 - (prefix_bits))) - 1))
-
-/* length required to bitpack a value */
-#define GRPC_CHTTP2_VARINT_LENGTH(n, prefix_bits) \
- ((n) < GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits) \
- ? 1u \
- : grpc_chttp2_hpack_varint_length( \
- (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits)))
-
-#define GRPC_CHTTP2_WRITE_VARINT(n, prefix_bits, prefix_or, target, length) \
- do { \
- uint8_t* tgt = target; \
- if ((length) == 1u) { \
- (tgt)[0] = (uint8_t)((prefix_or) | (n)); \
- } else { \
- (tgt)[0] = \
- (prefix_or) | (uint8_t)GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits); \
- grpc_chttp2_hpack_write_varint_tail( \
- (n)-GRPC_CHTTP2_MAX_IN_PREFIX(prefix_bits), (tgt) + 1, (length)-1); \
- } \
- } while (0)
+ explicit VarintWriter(uint32_t value)
+ : value_(value),
+ length_(value < kMaxInPrefix ? 1 : VarintLength(value - kMaxInPrefix)) {
+ }
+
+ uint32_t value() const { return value_; }
+ uint32_t length() const { return length_; }
+
+ void Write(uint8_t prefix, uint8_t* target) const {
+ if (length_ == 1) {
+ target[0] = prefix | value_;
+ } else {
+ target[0] = prefix | kMaxInPrefix;
+ VarintWriteTail(value_ - kMaxInPrefix, target + 1, length_ - 1);
+ }
+ }
+
+ private:
+ const uint32_t value_;
+ // length required to bitpack value_
+ const uint32_t length_;
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_VARINT_H */
diff --git a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
index 317afcc5103..bd8f555aeea 100644
--- a/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/chttp2/transport/writing.cc
@@ -18,14 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
-#include "src/core/ext/transport/chttp2/transport/context_list.h"
-#include "src/core/ext/transport/chttp2/transport/internal.h"
-
#include <limits.h>
#include <grpc/support/log.h>
+#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
+#include "src/core/ext/transport/chttp2/transport/context_list.h"
+#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/compression/stream_compression.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/profiling/timers.h"
@@ -39,7 +38,7 @@ static void add_to_write_list(grpc_chttp2_write_cb** list,
}
static void finish_write_cb(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
- grpc_chttp2_write_cb* cb, grpc_error* error) {
+ grpc_chttp2_write_cb* cb, grpc_error_handle error) {
grpc_chttp2_complete_closure_step(t, s, &cb->closure, error,
"finish_write_cb");
cb->next = t->write_cb_pool;
@@ -75,6 +74,10 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
}
return;
}
+ // InvalidateNow to avoid getting stuck re-initializing the ping timer
+ // in a loop while draining the currently-held combiner. Also see
+ // https://github.com/grpc/grpc/issues/26079.
+ grpc_core::ExecCtx::Get()->InvalidateNow();
grpc_millis now = grpc_core::ExecCtx::Get()->Now();
grpc_millis next_allowed_ping_interval =
@@ -134,7 +137,7 @@ static void maybe_initiate_ping(grpc_chttp2_transport* t) {
static bool update_list(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
int64_t send_bytes, grpc_chttp2_write_cb** list,
- int64_t* ctr, grpc_error* error) {
+ int64_t* ctr, grpc_error_handle error) {
bool sched_any = false;
grpc_chttp2_write_cb* cb = *list;
*list = nullptr;
@@ -174,11 +177,12 @@ static void report_stall(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
t->settings[GRPC_ACKED_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],
t->flow_control->remote_window(),
- static_cast<uint32_t> GPR_MAX(
- 0,
+ static_cast<uint32_t>(std::max(
+ int64_t(0),
s->flow_control->remote_window_delta() +
- (int64_t)t->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]),
+ static_cast<int64_t>(
+ t->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]))),
s->flow_control->remote_window_delta());
}
}
@@ -190,7 +194,8 @@ static uint32_t target_write_size(grpc_chttp2_transport* /*t*/) {
// Returns true if initial_metadata contains only default headers.
static bool is_default_initial_metadata(grpc_metadata_batch* initial_metadata) {
- return initial_metadata->list.default_count == initial_metadata->list.count;
+ return initial_metadata->default_count() ==
+ initial_metadata->non_deadline_count();
}
namespace {
@@ -255,8 +260,7 @@ class WriteContext {
}
void EnactHpackSettings() {
- grpc_chttp2_hpack_compressor_set_max_table_size(
- &t_->hpack_compressor,
+ t_->hpack_compressor.SetMaxTableSize(
t_->settings[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_HEADER_TABLE_SIZE]);
}
@@ -323,27 +327,30 @@ class DataSendContext {
sending_bytes_before_(s_->sending_bytes) {}
uint32_t stream_remote_window() const {
- return static_cast<uint32_t> GPR_MAX(
- 0, s_->flow_control->remote_window_delta() +
- (int64_t)t_->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]);
+ return static_cast<uint32_t>(std::max(
+ int64_t(0),
+ s_->flow_control->remote_window_delta() +
+ static_cast<int64_t>(
+ t_->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE])));
}
uint32_t max_outgoing() const {
- return static_cast<uint32_t> GPR_MIN(
+ return static_cast<uint32_t>(std::min(
t_->settings[GRPC_PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- GPR_MIN(stream_remote_window(), t_->flow_control->remote_window()));
+ static_cast<uint32_t>(std::min(int64_t(stream_remote_window()),
+ t_->flow_control->remote_window()))));
}
bool AnyOutgoing() const { return max_outgoing() > 0; }
void FlushUncompressedBytes() {
- uint32_t send_bytes = static_cast<uint32_t> GPR_MIN(
- max_outgoing(), s_->flow_controlled_buffer.length);
+ uint32_t send_bytes = static_cast<uint32_t>(
+ std::min(size_t(max_outgoing()), s_->flow_controlled_buffer.length));
is_last_frame_ = send_bytes == s_->flow_controlled_buffer.length &&
s_->fetching_send_message == nullptr &&
s_->send_trailing_metadata != nullptr &&
- grpc_metadata_batch_is_empty(s_->send_trailing_metadata);
+ s_->send_trailing_metadata->empty();
grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, send_bytes,
is_last_frame_, &s_->stats.outgoing, &t_->outbuf);
s_->flow_control->SentData(send_bytes);
@@ -354,8 +361,8 @@ class DataSendContext {
GPR_DEBUG_ASSERT(s_->stream_compression_method !=
GRPC_STREAM_COMPRESSION_IDENTITY_COMPRESS);
- uint32_t send_bytes = static_cast<uint32_t> GPR_MIN(
- max_outgoing(), s_->compressed_data_buffer.length);
+ uint32_t send_bytes = static_cast<uint32_t>(
+ std::min(size_t(max_outgoing()), s_->compressed_data_buffer.length));
bool is_last_data_frame =
(send_bytes == s_->compressed_data_buffer.length &&
s_->flow_controlled_buffer.length == 0 &&
@@ -378,7 +385,7 @@ class DataSendContext {
}
is_last_frame_ = is_last_data_frame &&
s_->send_trailing_metadata != nullptr &&
- grpc_metadata_batch_is_empty(s_->send_trailing_metadata);
+ s_->send_trailing_metadata->empty();
grpc_chttp2_encode_data(s_->id, &s_->compressed_data_buffer, send_bytes,
is_last_frame_, &s_->stats.outgoing, &t_->outbuf);
s_->flow_control->SentData(send_bytes);
@@ -453,18 +460,20 @@ class StreamWriteContext {
is_default_initial_metadata(s_->send_initial_metadata)) {
ConvertInitialMetadataToTrailingMetadata();
} else {
- grpc_encode_header_options hopt = {
- s_->id, // stream_id
- false, // is_eof
- t_->settings[GRPC_PEER_SETTINGS]
+ t_->hpack_compressor.EncodeHeaders(
+ grpc_core::HPackCompressor::EncodeHeaderOptions{
+ s_->id, // stream_id
+ false, // is_eof
+ t_->settings
+ [GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
- 0, // use_true_binary_metadata
- t_->settings[GRPC_PEER_SETTINGS]
- [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], // max_frame_size
- &s_->stats.outgoing // stats
- };
- grpc_chttp2_encode_header(&t_->hpack_compressor, nullptr, 0,
- s_->send_initial_metadata, &hopt, &t_->outbuf);
+ 0, // use_true_binary_metadata
+ t_->settings
+ [GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE], // max_frame_size
+ &s_->stats.outgoing // stats
+ },
+ *s_->send_initial_metadata, &t_->outbuf);
grpc_chttp2_reset_ping_clock(t_);
write_context_->IncInitialMetadataWrites();
}
@@ -557,22 +566,26 @@ class StreamWriteContext {
if (compressed_data_buffer_len() != 0) return;
GRPC_CHTTP2_IF_TRACING(gpr_log(GPR_INFO, "sending trailing_metadata"));
- if (grpc_metadata_batch_is_empty(s_->send_trailing_metadata)) {
+ if (s_->send_trailing_metadata->empty()) {
grpc_chttp2_encode_data(s_->id, &s_->flow_controlled_buffer, 0, true,
&s_->stats.outgoing, &t_->outbuf);
} else {
- grpc_encode_header_options hopt = {
- s_->id, true,
- t_->settings[GRPC_PEER_SETTINGS]
+ t_->hpack_compressor.EncodeHeaders(
+ grpc_core::HPackCompressor::EncodeHeaderOptions{
+ s_->id, true,
+ t_->settings
+ [GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_GRPC_ALLOW_TRUE_BINARY_METADATA] !=
- 0,
-
- t_->settings[GRPC_PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
- &s_->stats.outgoing};
- grpc_chttp2_encode_header(&t_->hpack_compressor,
- extra_headers_for_trailing_metadata_,
- num_extra_headers_for_trailing_metadata_,
- s_->send_trailing_metadata, &hopt, &t_->outbuf);
+ 0,
+ t_->settings[GRPC_PEER_SETTINGS]
+ [GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE],
+ &s_->stats.outgoing},
+ grpc_core::ConcatMetadata(
+ grpc_core::MetadataArray(
+ extra_headers_for_trailing_metadata_,
+ num_extra_headers_for_trailing_metadata_),
+ *s_->send_trailing_metadata),
+ &t_->outbuf);
}
write_context_->IncTrailingMetadataWrites();
grpc_chttp2_reset_ping_clock(t_);
@@ -592,15 +605,17 @@ class StreamWriteContext {
gpr_log(GPR_INFO, "not sending initial_metadata (Trailers-Only)"));
// When sending Trailers-Only, we need to move the :status and
// content-type headers to the trailers.
- if (s_->send_initial_metadata->idx.named.status != nullptr) {
+ if (s_->send_initial_metadata->legacy_index()->named.status != nullptr) {
extra_headers_for_trailing_metadata_
[num_extra_headers_for_trailing_metadata_++] =
- &s_->send_initial_metadata->idx.named.status->md;
+ &s_->send_initial_metadata->legacy_index()->named.status->md;
}
- if (s_->send_initial_metadata->idx.named.content_type != nullptr) {
+ if (s_->send_initial_metadata->legacy_index()->named.content_type !=
+ nullptr) {
extra_headers_for_trailing_metadata_
[num_extra_headers_for_trailing_metadata_++] =
- &s_->send_initial_metadata->idx.named.content_type->md;
+ &s_->send_initial_metadata->legacy_index()
+ ->named.content_type->md;
}
}
@@ -678,7 +693,7 @@ grpc_chttp2_begin_write_result grpc_chttp2_begin_write(
return ctx.Result();
}
-void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error* error) {
+void grpc_chttp2_end_write(grpc_chttp2_transport* t, grpc_error_handle error) {
GPR_TIMER_SCOPE("grpc_chttp2_end_write", 0);
grpc_chttp2_stream* s;
diff --git a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
index da2671037b4..144c630c8be 100644
--- a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
+++ b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.cc
@@ -18,18 +18,21 @@
#include <grpc/support/port_platform.h>
+#include "src/core/ext/transport/inproc/inproc_transport.h"
+
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <string.h>
-#include "src/core/ext/transport/inproc/inproc_transport.h"
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/error_utils.h"
@@ -50,15 +53,14 @@ grpc_slice g_fake_auth_key;
grpc_slice g_fake_auth_value;
struct inproc_stream;
-bool cancel_stream_locked(inproc_stream* s, grpc_error* error);
-void maybe_process_ops_locked(inproc_stream* s, grpc_error* error);
-void op_state_machine_locked(inproc_stream* s, grpc_error* error);
+bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error);
+void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error);
+void op_state_machine_locked(inproc_stream* s, grpc_error_handle error);
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
bool is_initial);
-grpc_error* fill_in_metadata(inproc_stream* s,
- const grpc_metadata_batch* metadata,
- uint32_t flags, grpc_metadata_batch* out_md,
- uint32_t* outflags, bool* markfilled);
+void fill_in_metadata(inproc_stream* s, const grpc_metadata_batch* metadata,
+ uint32_t flags, grpc_metadata_batch* out_md,
+ uint32_t* outflags, bool* markfilled);
struct shared_mu {
shared_mu() {
@@ -129,11 +131,6 @@ struct inproc_stream {
ref("inproc_init_stream:init");
ref("inproc_init_stream:list");
- grpc_metadata_batch_init(&to_read_initial_md);
- grpc_metadata_batch_init(&to_read_trailing_md);
- grpc_metadata_batch_init(&write_buffer_initial_md);
- grpc_metadata_batch_init(&write_buffer_trailing_md);
-
stream_list_prev = nullptr;
gpr_mu_lock(&t->mu->mu);
stream_list_next = t->stream_list;
@@ -169,18 +166,19 @@ struct inproc_stream {
// Now transfer from the other side's write_buffer if any to the to_read
// buffer
if (cs->write_buffer_initial_md_filled) {
- fill_in_metadata(this, &cs->write_buffer_initial_md,
- cs->write_buffer_initial_md_flags, &to_read_initial_md,
- &to_read_initial_md_flags, &to_read_initial_md_filled);
- deadline = GPR_MIN(deadline, cs->write_buffer_deadline);
- grpc_metadata_batch_clear(&cs->write_buffer_initial_md);
+ (void)fill_in_metadata(this, &cs->write_buffer_initial_md,
+ cs->write_buffer_initial_md_flags,
+ &to_read_initial_md, &to_read_initial_md_flags,
+ &to_read_initial_md_filled);
+ deadline = std::min(deadline, cs->write_buffer_deadline);
+ cs->write_buffer_initial_md.Clear();
cs->write_buffer_initial_md_filled = false;
}
if (cs->write_buffer_trailing_md_filled) {
- fill_in_metadata(this, &cs->write_buffer_trailing_md, 0,
- &to_read_trailing_md, nullptr,
- &to_read_trailing_md_filled);
- grpc_metadata_batch_clear(&cs->write_buffer_trailing_md);
+ (void)fill_in_metadata(this, &cs->write_buffer_trailing_md, 0,
+ &to_read_trailing_md, nullptr,
+ &to_read_trailing_md_filled);
+ cs->write_buffer_trailing_md.Clear();
cs->write_buffer_trailing_md_filled = false;
}
if (cs->write_buffer_cancel_error != GRPC_ERROR_NONE) {
@@ -225,28 +223,28 @@ struct inproc_stream {
#undef STREAM_UNREF
inproc_transport* t;
- grpc_metadata_batch to_read_initial_md;
+ grpc_stream_refcount* refs;
+ grpc_core::Arena* arena;
+
+ grpc_metadata_batch to_read_initial_md{arena};
uint32_t to_read_initial_md_flags = 0;
bool to_read_initial_md_filled = false;
- grpc_metadata_batch to_read_trailing_md;
+ grpc_metadata_batch to_read_trailing_md{arena};
bool to_read_trailing_md_filled = false;
bool ops_needed = false;
// Write buffer used only during gap at init time when client-side
// stream is set up but server side stream is not yet set up
- grpc_metadata_batch write_buffer_initial_md;
+ grpc_metadata_batch write_buffer_initial_md{arena};
bool write_buffer_initial_md_filled = false;
uint32_t write_buffer_initial_md_flags = 0;
grpc_millis write_buffer_deadline = GRPC_MILLIS_INF_FUTURE;
- grpc_metadata_batch write_buffer_trailing_md;
+ grpc_metadata_batch write_buffer_trailing_md{arena};
bool write_buffer_trailing_md_filled = false;
- grpc_error* write_buffer_cancel_error = GRPC_ERROR_NONE;
+ grpc_error_handle write_buffer_cancel_error = GRPC_ERROR_NONE;
struct inproc_stream* other_side;
bool other_side_closed = false; // won't talk anymore
bool write_buffer_other_side_closed = false; // on hold
- grpc_stream_refcount* refs;
-
- grpc_core::Arena* arena;
grpc_transport_stream_op_batch* send_message_op = nullptr;
grpc_transport_stream_op_batch* send_trailing_md_op = nullptr;
@@ -270,8 +268,8 @@ struct inproc_stream {
bool closed = false;
- grpc_error* cancel_self_error = GRPC_ERROR_NONE;
- grpc_error* cancel_other_error = GRPC_ERROR_NONE;
+ grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
+ grpc_error_handle cancel_other_error = GRPC_ERROR_NONE;
grpc_millis deadline = GRPC_MILLIS_INF_FUTURE;
@@ -282,21 +280,56 @@ struct inproc_stream {
void log_metadata(const grpc_metadata_batch* md_batch, bool is_client,
bool is_initial) {
- for (grpc_linked_mdelem* md = md_batch->list.head; md != nullptr;
- md = md->next) {
- char* key = grpc_slice_to_c_string(GRPC_MDKEY(md->md));
- char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md->md));
+ md_batch->ForEach([=](grpc_mdelem md) {
+ char* key = grpc_slice_to_c_string(GRPC_MDKEY(md));
+ char* value = grpc_slice_to_c_string(GRPC_MDVALUE(md));
gpr_log(GPR_INFO, "INPROC:%s:%s: %s: %s", is_initial ? "HDR" : "TRL",
is_client ? "CLI" : "SVR", key, value);
gpr_free(key);
gpr_free(value);
- }
+ });
}
-grpc_error* fill_in_metadata(inproc_stream* s,
- const grpc_metadata_batch* metadata,
- uint32_t flags, grpc_metadata_batch* out_md,
- uint32_t* outflags, bool* markfilled) {
+namespace {
+
+class CopySink {
+ public:
+ explicit CopySink(grpc_metadata_batch* dst) : dst_(dst) {}
+
+ void Encode(grpc_mdelem md) {
+ // Differently to grpc_metadata_batch_copy, we always copy slices here so
+ // that we don't need to deal with the plethora of edge cases in that world.
+ // TODO(ctiller): revisit this when deleting mdelem.
+ md = grpc_mdelem_from_slices(grpc_slice_intern(GRPC_MDKEY(md)),
+ grpc_slice_copy(GRPC_MDVALUE(md)));
+ // Error unused in non-debug builds.
+ grpc_error_handle GRPC_UNUSED error = dst_->Append(md);
+ // The only way that Append() can fail is if
+ // there's a duplicate entry for a callout. However, that can't be
+ // the case here, because we would not have been allowed to create
+ // a source batch that had that kind of conflict.
+ GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE);
+ }
+
+ template <class T, class V>
+ void Encode(T trait, V value) {
+ dst_->Set(trait, value);
+ }
+
+ template <class T>
+ void Encode(T trait, const grpc_core::Slice& value) {
+ dst_->Set(trait, value.AsOwned());
+ }
+
+ private:
+ grpc_metadata_batch* dst_;
+};
+
+} // namespace
+
+void fill_in_metadata(inproc_stream* s, const grpc_metadata_batch* metadata,
+ uint32_t flags, grpc_metadata_batch* out_md,
+ uint32_t* outflags, bool* markfilled) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_inproc_trace)) {
log_metadata(metadata, s->t->is_client, outflags != nullptr);
}
@@ -307,18 +340,13 @@ grpc_error* fill_in_metadata(inproc_stream* s,
if (markfilled != nullptr) {
*markfilled = true;
}
- grpc_error* error = GRPC_ERROR_NONE;
- for (grpc_linked_mdelem* elem = metadata->list.head;
- (elem != nullptr) && (error == GRPC_ERROR_NONE); elem = elem->next) {
- grpc_linked_mdelem* nelem =
- static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*nelem)));
- nelem->md =
- grpc_mdelem_from_slices(grpc_slice_intern(GRPC_MDKEY(elem->md)),
- grpc_slice_intern(GRPC_MDVALUE(elem->md)));
-
- error = grpc_metadata_batch_link_tail(out_md, nelem);
- }
- return error;
+
+ // TODO(ctiller): copy the metadata batch, don't rely on a bespoke copy
+ // function. Can only do this once mdelems are out of the way though, too many
+ // edge cases otherwise.
+ out_md->Clear();
+ CopySink sink(out_md);
+ metadata->Encode(&sink);
}
int init_stream(grpc_transport* gt, grpc_stream* gs,
@@ -333,8 +361,8 @@ int init_stream(grpc_transport* gt, grpc_stream* gs,
void close_stream_locked(inproc_stream* s) {
if (!s->closed) {
// Release the metadata that we would have written out
- grpc_metadata_batch_destroy(&s->write_buffer_initial_md);
- grpc_metadata_batch_destroy(&s->write_buffer_trailing_md);
+ s->write_buffer_initial_md.Clear();
+ s->write_buffer_trailing_md.Clear();
if (s->listed) {
inproc_stream* p = s->stream_list_prev;
@@ -359,8 +387,8 @@ void close_stream_locked(inproc_stream* s) {
void close_other_side_locked(inproc_stream* s, const char* reason) {
if (s->other_side != nullptr) {
// First release the metadata that came from the other side's arena
- grpc_metadata_batch_destroy(&s->to_read_initial_md);
- grpc_metadata_batch_destroy(&s->to_read_trailing_md);
+ s->to_read_initial_md.Clear();
+ s->to_read_trailing_md.Clear();
s->other_side->unref(reason);
s->other_side_closed = true;
@@ -374,7 +402,7 @@ void close_other_side_locked(inproc_stream* s, const char* reason) {
// this stream_op_batch is only one of the pending operations for this
// stream. This is called when one of the pending operations for the stream
// is done and about to be NULLed out
-void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
+void complete_if_batch_end_locked(inproc_stream* s, grpc_error_handle error,
grpc_transport_stream_op_batch* op,
const char* msg) {
int is_sm = static_cast<int>(op == s->send_message_op);
@@ -388,20 +416,21 @@ void complete_if_batch_end_locked(inproc_stream* s, grpc_error* error,
int is_rtm = static_cast<int>(op == s->recv_trailing_md_op);
if ((is_sm + is_stm + is_rim + is_rm + is_rtm) == 1) {
- INPROC_LOG(GPR_INFO, "%s %p %p %p", msg, s, op, error);
+ INPROC_LOG(GPR_INFO, "%s %p %p %s", msg, s, op,
+ grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
GRPC_ERROR_REF(error));
}
}
-void maybe_process_ops_locked(inproc_stream* s, grpc_error* error) {
+void maybe_process_ops_locked(inproc_stream* s, grpc_error_handle error) {
if (s && (error != GRPC_ERROR_NONE || s->ops_needed)) {
s->ops_needed = false;
op_state_machine_locked(s, error);
}
}
-void fail_helper_locked(inproc_stream* s, grpc_error* error) {
+void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
INPROC_LOG(GPR_INFO, "op_state_machine %p fail_helper", s);
// If we're failing this side, we need to make sure that
// we also send or have already sent trailing metadata
@@ -409,17 +438,14 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
// Send trailing md to the other side indicating cancellation
s->trailing_md_sent = true;
- grpc_metadata_batch fake_md;
- grpc_metadata_batch_init(&fake_md);
-
+ grpc_metadata_batch fake_md(s->arena);
inproc_stream* other = s->other_side;
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
- fill_in_metadata(s, &fake_md, 0, dest, nullptr, destfilled);
- grpc_metadata_batch_destroy(&fake_md);
+ (void)fill_in_metadata(s, &fake_md, 0, dest, nullptr, destfilled);
if (other != nullptr) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
@@ -431,30 +457,26 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
}
}
if (s->recv_initial_md_op) {
- grpc_error* err;
+ grpc_error_handle err;
if (!s->t->is_client) {
// If this is a server, provide initial metadata with a path and authority
// since it expects that as well as no error yet
- grpc_metadata_batch fake_md;
- grpc_metadata_batch_init(&fake_md);
+ grpc_metadata_batch fake_md(s->arena);
grpc_linked_mdelem* path_md =
static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*path_md)));
path_md->md = grpc_mdelem_from_slices(g_fake_path_key, g_fake_path_value);
- GPR_ASSERT(grpc_metadata_batch_link_tail(&fake_md, path_md) ==
- GRPC_ERROR_NONE);
+ GPR_ASSERT(fake_md.LinkTail(path_md) == GRPC_ERROR_NONE);
grpc_linked_mdelem* auth_md =
static_cast<grpc_linked_mdelem*>(s->arena->Alloc(sizeof(*auth_md)));
auth_md->md = grpc_mdelem_from_slices(g_fake_auth_key, g_fake_auth_value);
- GPR_ASSERT(grpc_metadata_batch_link_tail(&fake_md, auth_md) ==
- GRPC_ERROR_NONE);
+ GPR_ASSERT(fake_md.LinkTail(auth_md) == GRPC_ERROR_NONE);
- fill_in_metadata(
+ (void)fill_in_metadata(
s, &fake_md, 0,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata,
s->recv_initial_md_op->payload->recv_initial_metadata.recv_flags,
nullptr);
- grpc_metadata_batch_destroy(&fake_md);
err = GRPC_ERROR_NONE;
} else {
err = GRPC_ERROR_REF(error);
@@ -468,8 +490,9 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
.trailing_metadata_available = true;
}
INPROC_LOG(GPR_INFO,
- "fail_helper %p scheduling initial-metadata-ready %p %p", s,
- error, err);
+ "fail_helper %p scheduling initial-metadata-ready %s %s", s,
+ grpc_error_std_string(error).c_str(),
+ grpc_error_std_string(err).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_initial_md_op->payload->recv_initial_metadata
@@ -483,8 +506,13 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
s->recv_initial_md_op = nullptr;
}
if (s->recv_message_op) {
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %p", s,
- error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling message-ready %s", s,
+ grpc_error_std_string(error).c_str());
+ if (s->recv_message_op->payload->recv_message
+ .call_failed_before_recv_message != nullptr) {
+ *s->recv_message_op->payload->recv_message
+ .call_failed_before_recv_message = true;
+ }
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_message_op->payload->recv_message.recv_message_ready,
@@ -508,15 +536,15 @@ void fail_helper_locked(inproc_stream* s, grpc_error* error) {
s->send_trailing_md_op = nullptr;
}
if (s->recv_trailing_md_op) {
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %p",
- s, error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
GRPC_ERROR_REF(error));
- INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %p",
- s, error);
+ INPROC_LOG(GPR_INFO, "fail_helper %p scheduling trailing-md-on-complete %s",
+ s, grpc_error_std_string(error).c_str());
complete_if_batch_end_locked(
s, error, s->recv_trailing_md_op,
"fail_helper scheduling recv-trailing-metadata-on-complete");
@@ -550,7 +578,7 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
GPR_ASSERT(
sender->send_message_op->payload->send_message.send_message->Next(
SIZE_MAX, &unused));
- grpc_error* error =
+ grpc_error_handle error =
sender->send_message_op->payload->send_message.send_message->Pull(
&message_slice);
if (error != GRPC_ERROR_NONE) {
@@ -583,13 +611,13 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
sender->send_message_op = nullptr;
}
-void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
+void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
// This function gets called when we have contents in the unprocessed reads
// Get what we want based on our ops wanted
// Schedule our appropriate closures
// and then return to ops_needed state if still needed
- grpc_error* new_err = GRPC_ERROR_NONE;
+ grpc_error_handle new_err = GRPC_ERROR_NONE;
bool needs_close = false;
@@ -646,10 +674,11 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
goto done;
} else {
if (!other || !other->closed) {
- fill_in_metadata(s,
- s->send_trailing_md_op->payload->send_trailing_metadata
- .send_trailing_metadata,
- 0, dest, nullptr, destfilled);
+ (void)fill_in_metadata(
+ s,
+ s->send_trailing_md_op->payload->send_trailing_metadata
+ .send_trailing_metadata,
+ 0, dest, nullptr, destfilled);
}
s->trailing_md_sent = true;
if (s->send_trailing_md_op->payload->send_trailing_metadata.sent) {
@@ -685,50 +714,42 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
INPROC_LOG(
GPR_INFO,
"op_state_machine %p scheduling on_complete errors for already "
- "recvd initial md %p",
- s, new_err);
+ "recvd initial md %s",
+ s, grpc_error_std_string(new_err).c_str());
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
goto done;
}
if (s->to_read_initial_md_filled) {
s->initial_md_recvd = true;
- new_err = fill_in_metadata(
+ fill_in_metadata(
s, &s->to_read_initial_md, s->to_read_initial_md_flags,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata,
s->recv_initial_md_op->payload->recv_initial_metadata.recv_flags,
nullptr);
- s->recv_initial_md_op->payload->recv_initial_metadata
- .recv_initial_metadata->deadline = s->deadline;
+ if (s->deadline != GRPC_MILLIS_INF_FUTURE) {
+ s->recv_initial_md_op->payload->recv_initial_metadata
+ .recv_initial_metadata->Set(grpc_core::GrpcTimeoutMetadata(),
+ s->deadline);
+ }
if (s->recv_initial_md_op->payload->recv_initial_metadata
.trailing_metadata_available != nullptr) {
*s->recv_initial_md_op->payload->recv_initial_metadata
.trailing_metadata_available =
(other != nullptr && other->send_trailing_md_op != nullptr);
}
- grpc_metadata_batch_clear(&s->to_read_initial_md);
+ s->to_read_initial_md.Clear();
s->to_read_initial_md_filled = false;
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling initial-metadata-ready %p", s,
- new_err);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata_ready,
- GRPC_ERROR_REF(new_err));
+ GRPC_ERROR_NONE);
complete_if_batch_end_locked(
- s, new_err, s->recv_initial_md_op,
+ s, GRPC_ERROR_NONE, s->recv_initial_md_op,
"op_state_machine scheduling recv-initial-metadata-on-complete");
s->recv_initial_md_op = nullptr;
-
- if (new_err != GRPC_ERROR_NONE) {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling on_complete errors2 %p", s,
- new_err);
- fail_helper_locked(s, GRPC_ERROR_REF(new_err));
- goto done;
- }
}
}
if (s->recv_message_op) {
@@ -744,7 +765,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
"op_state_machine %p already implicitly received trailing "
"metadata, so ignoring new trailing metadata from client",
s);
- grpc_metadata_batch_clear(&s->to_read_trailing_md);
+ s->to_read_trailing_md.Clear();
s->to_read_trailing_md_filled = false;
s->trailing_md_recvd_implicit_only = false;
} else {
@@ -753,8 +774,8 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
INPROC_LOG(
GPR_INFO,
"op_state_machine %p scheduling on_complete errors for already "
- "recvd trailing md %p",
- s, new_err);
+ "recvd trailing md %s",
+ s, grpc_error_std_string(new_err).c_str());
fail_helper_locked(s, GRPC_ERROR_REF(new_err));
goto done;
}
@@ -786,12 +807,11 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
if (s->recv_trailing_md_op != nullptr) {
// We wanted trailing metadata and we got it
s->trailing_md_recvd = true;
- new_err =
- fill_in_metadata(s, &s->to_read_trailing_md, 0,
- s->recv_trailing_md_op->payload
- ->recv_trailing_metadata.recv_trailing_metadata,
- nullptr, nullptr);
- grpc_metadata_batch_clear(&s->to_read_trailing_md);
+ fill_in_metadata(s, &s->to_read_trailing_md, 0,
+ s->recv_trailing_md_op->payload->recv_trailing_metadata
+ .recv_trailing_metadata,
+ nullptr, nullptr);
+ s->to_read_trailing_md.Clear();
s->to_read_trailing_md_filled = false;
// We should schedule the recv_trailing_md_op completion if
@@ -800,24 +820,16 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
// (If the server hasn't already sent its trailing md, it doesn't have
// a final status, so don't mark this op complete)
if (s->t->is_client || s->trailing_md_sent) {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p scheduling trailing-md-on-complete %p",
- s, new_err);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
- GRPC_ERROR_REF(new_err));
+ GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
s->recv_trailing_md_op->on_complete,
- GRPC_ERROR_REF(new_err));
+ GRPC_ERROR_NONE);
s->recv_trailing_md_op = nullptr;
needs_close = s->trailing_md_sent;
- } else {
- INPROC_LOG(GPR_INFO,
- "op_state_machine %p server needs to delay handling "
- "trailing-md-on-complete %p",
- s, new_err);
}
} else if (!s->trailing_md_recvd) {
INPROC_LOG(
@@ -830,8 +842,8 @@ void op_state_machine_locked(inproc_stream* s, grpc_error* error) {
// In this case, we don't care to receive the write-close from the client
// because we have already sent status and the RPC is over as far as we
// are concerned.
- INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-ready %p",
- s, new_err);
+ INPROC_LOG(GPR_INFO, "op_state_machine %p scheduling trailing-md-ready %s",
+ s, grpc_error_std_string(new_err).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
@@ -887,9 +899,10 @@ done:
GRPC_ERROR_UNREF(new_err);
}
-bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
+bool cancel_stream_locked(inproc_stream* s, grpc_error_handle error) {
bool ret = false; // was the cancel accepted
- INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s, grpc_error_string(error));
+ INPROC_LOG(GPR_INFO, "cancel_stream %p with %s", s,
+ grpc_error_std_string(error).c_str());
if (s->cancel_self_error == GRPC_ERROR_NONE) {
ret = true;
s->cancel_self_error = GRPC_ERROR_REF(error);
@@ -900,16 +913,14 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
// already have
s->trailing_md_sent = true;
- grpc_metadata_batch cancel_md;
- grpc_metadata_batch_init(&cancel_md);
+ grpc_metadata_batch cancel_md(s->arena);
grpc_metadata_batch* dest = (other == nullptr)
? &s->write_buffer_trailing_md
: &other->to_read_trailing_md;
bool* destfilled = (other == nullptr) ? &s->write_buffer_trailing_md_filled
: &other->to_read_trailing_md_filled;
- fill_in_metadata(s, &cancel_md, 0, dest, nullptr, destfilled);
- grpc_metadata_batch_destroy(&cancel_md);
+ (void)fill_in_metadata(s, &cancel_md, 0, dest, nullptr, destfilled);
if (other != nullptr) {
if (other->cancel_other_error == GRPC_ERROR_NONE) {
@@ -943,7 +954,7 @@ bool cancel_stream_locked(inproc_stream* s, grpc_error* error) {
return ret;
}
-void do_nothing(void* /*arg*/, grpc_error* /*error*/) {}
+void do_nothing(void* /*arg*/, grpc_error_handle /*error*/) {}
void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
grpc_transport_stream_op_batch* op) {
@@ -962,7 +973,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
s->t->is_client, false);
}
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_closure* on_complete = op->on_complete;
// TODO(roth): This is a hack needed because we use data inside of the
// closure itself to do the barrier calculation (i.e., to ensure that
@@ -1014,7 +1025,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Extra initial metadata");
} else {
if (!s->other_side_closed) {
- fill_in_metadata(
+ (void)fill_in_metadata(
s, op->payload->send_initial_metadata.send_initial_metadata,
op->payload->send_initial_metadata.send_initial_metadata_flags,
dest, destflags, destfilled);
@@ -1022,8 +1033,10 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (s->t->is_client) {
grpc_millis* dl =
(other == nullptr) ? &s->write_buffer_deadline : &other->deadline;
- *dl = GPR_MIN(*dl, op->payload->send_initial_metadata
- .send_initial_metadata->deadline);
+ *dl = std::min(
+ *dl, op->payload->send_initial_metadata.send_initial_metadata
+ ->get(grpc_core::GrpcTimeoutMetadata())
+ .value_or(GRPC_MILLIS_INF_FUTURE));
s->initial_md_sent = true;
}
}
@@ -1090,8 +1103,8 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
}
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling initial-metadata-ready %p",
- s, error);
+ "perform_stream_op error %p scheduling initial-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_initial_metadata.recv_initial_metadata_ready,
@@ -1100,8 +1113,12 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (op->recv_message) {
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling recv message-ready %p", s,
- error);
+ "perform_stream_op error %p scheduling recv message-ready %s", s,
+ grpc_error_std_string(error).c_str());
+ if (op->payload->recv_message.call_failed_before_recv_message !=
+ nullptr) {
+ *op->payload->recv_message.call_failed_before_recv_message = true;
+ }
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
op->payload->recv_message.recv_message_ready,
GRPC_ERROR_REF(error));
@@ -1109,16 +1126,16 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
if (op->recv_trailing_metadata) {
INPROC_LOG(
GPR_INFO,
- "perform_stream_op error %p scheduling trailing-metadata-ready %p",
- s, error);
+ "perform_stream_op error %p scheduling trailing-metadata-ready %s",
+ s, grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
GRPC_ERROR_REF(error));
}
}
- INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %p", s,
- error);
+ INPROC_LOG(GPR_INFO, "perform_stream_op %p scheduling on_complete %s", s,
+ grpc_error_std_string(error).c_str());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_complete, GRPC_ERROR_REF(error));
}
gpr_mu_unlock(mu);
@@ -1264,46 +1281,48 @@ void grpc_inproc_transport_init(void) {
}
grpc_channel* grpc_inproc_channel_create(grpc_server* server,
- grpc_channel_args* args,
+ const grpc_channel_args* args,
void* /*reserved*/) {
GRPC_API_TRACE("grpc_inproc_channel_create(server=%p, args=%p)", 2,
(server, args));
grpc_core::ExecCtx exec_ctx;
+ grpc_core::Server* core_server = grpc_core::Server::FromC(server);
// Remove max_connection_idle and max_connection_age channel arguments since
// those do not apply to inproc transports.
const char* args_to_remove[] = {GRPC_ARG_MAX_CONNECTION_IDLE_MS,
GRPC_ARG_MAX_CONNECTION_AGE_MS};
const grpc_channel_args* server_args = grpc_channel_args_copy_and_remove(
- server->core_server->channel_args(), args_to_remove,
+ core_server->channel_args(), args_to_remove,
GPR_ARRAY_SIZE(args_to_remove));
-
// Add a default authority channel argument for the client
grpc_arg default_authority_arg;
default_authority_arg.type = GRPC_ARG_STRING;
default_authority_arg.key = const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY);
default_authority_arg.value.string = const_cast<char*>("inproc.authority");
- grpc_channel_args* client_args =
- grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
-
+ args = grpc_channel_args_copy_and_add(args, &default_authority_arg, 1);
+ const grpc_channel_args* client_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_channel_args_destroy(args);
grpc_transport* server_transport;
grpc_transport* client_transport;
inproc_transports_create(&server_transport, server_args, &client_transport,
client_args);
// TODO(ncteisen): design and support channelz GetSocket for inproc.
- grpc_error* error = server->core_server->SetupTransport(
+ grpc_error_handle error = core_server->SetupTransport(
server_transport, nullptr, server_args, nullptr);
grpc_channel* channel = nullptr;
if (error == GRPC_ERROR_NONE) {
channel =
grpc_channel_create("inproc", client_args, GRPC_CLIENT_DIRECT_CHANNEL,
- client_transport, nullptr, &error);
+ client_transport, &error);
if (error != GRPC_ERROR_NONE) {
GPR_ASSERT(!channel);
gpr_log(GPR_ERROR, "Failed to create client channel: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
intptr_t integer;
grpc_status_code status = GRPC_STATUS_INTERNAL;
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
@@ -1318,7 +1337,7 @@ grpc_channel* grpc_inproc_channel_create(grpc_server* server,
} else {
GPR_ASSERT(!channel);
gpr_log(GPR_ERROR, "Failed to create server channel: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
intptr_t integer;
grpc_status_code status = GRPC_STATUS_INTERNAL;
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &integer)) {
diff --git a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.h b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.h
index 049d1402afe..7a5b3bb627d 100644
--- a/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.h
+++ b/contrib/libs/grpc/src/core/ext/transport/inproc/inproc_transport.h
@@ -24,7 +24,7 @@
#include "src/core/lib/transport/transport_impl.h"
grpc_channel* grpc_inproc_channel_create(grpc_server* server,
- grpc_channel_args* args,
+ const grpc_channel_args* args,
void* reserved);
extern grpc_core::TraceFlag grpc_inproc_trace;
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
index d230ccb2ff6..25758a1d500 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/admin/v3/config_dump.upb.h"
#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
#include "google/protobuf/any.upb.h"
@@ -17,389 +17,421 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_admin_v3_ConfigDump_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ConfigDump_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ConfigDump__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ConfigDump_msginit = {
&envoy_admin_v3_ConfigDump_submsgs[0],
&envoy_admin_v3_ConfigDump__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_admin_v3_UpdateFailureState_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_UpdateFailureState_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_UpdateFailureState__fields[4] = {
- {1, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(24, 48), 2, 1, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit = {
&envoy_admin_v3_UpdateFailureState_submsgs[0],
&envoy_admin_v3_UpdateFailureState__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 64), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_admin_v3_BootstrapConfigDump_submsgs[2] = {
- &envoy_config_bootstrap_v3_Bootstrap_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_BootstrapConfigDump_submsgs[2] = {
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_BootstrapConfigDump__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_BootstrapConfigDump_msginit = {
&envoy_admin_v3_BootstrapConfigDump_submsgs[0],
&envoy_admin_v3_BootstrapConfigDump__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_submsgs[2] = {
- &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
- &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ListenersConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit},
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit = {
&envoy_admin_v3_ListenersConfigDump_submsgs[0],
&envoy_admin_v3_ListenersConfigDump__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_StaticListener__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ListenersConfigDump_StaticListener_msginit = {
&envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_StaticListener__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit = {
&envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_DynamicListenerState__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[2] = {
- &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
- &envoy_admin_v3_UpdateFailureState_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit},
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 0, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(28, 48), 4, 1, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 48), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit = {
&envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[0],
&envoy_admin_v3_ListenersConfigDump_DynamicListener__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(32, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_submsgs[2] = {
- &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
- &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ClustersConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit},
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit = {
&envoy_admin_v3_ClustersConfigDump_submsgs[0],
&envoy_admin_v3_ClustersConfigDump__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit = {
&envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[0],
&envoy_admin_v3_ClustersConfigDump_StaticCluster__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 32), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit = {
&envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[0],
&envoy_admin_v3_ClustersConfigDump_DynamicCluster__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(32, 48), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_submsgs[2] = {
- &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
- &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
+static const upb_msglayout_sub envoy_admin_v3_RoutesConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit},
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit},
};
static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit = {
&envoy_admin_v3_RoutesConfigDump_submsgs[0],
&envoy_admin_v3_RoutesConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit = {
&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[0],
&envoy_admin_v3_RoutesConfigDump_StaticRouteConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 32), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit = {
&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[0],
&envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(32, 48), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = {
- &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit},
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(32, 56), 0, 1, 11, 3},
- {4, UPB_SIZE(24, 40), 1, 2, 11, 1},
- {5, UPB_SIZE(28, 48), 2, 0, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(32, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 48), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit = {
&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[0],
&envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(40, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_submsgs[2] = {
- &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
- &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
+static const upb_msglayout_sub envoy_admin_v3_SecretsConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit},
+ {.submsg = &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit},
};
static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_SecretsConfigDump_msginit = {
&envoy_admin_v3_SecretsConfigDump_submsgs[0],
&envoy_admin_v3_SecretsConfigDump__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[6] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), 1, 2, 11, 1},
- {4, UPB_SIZE(28, 48), 2, 1, 11, 1},
- {5, UPB_SIZE(32, 56), 3, 0, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 40), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 56), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit = {
&envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[0],
&envoy_admin_v3_SecretsConfigDump_DynamicSecret__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(40, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit = {
&envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[0],
&envoy_admin_v3_SecretsConfigDump_StaticSecret__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_submsgs[2] = {
- &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
- &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
+static const upb_msglayout_sub envoy_admin_v3_EndpointsConfigDump_submsgs[2] = {
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit},
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit},
};
static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit = {
&envoy_admin_v3_EndpointsConfigDump_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit = {
&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = {
- &envoy_admin_v3_UpdateFailureState_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[5] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(20, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(24, 40), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 32), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit = {
&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[0],
&envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(32, 48), 5, _UPB_MSGEXT_NONE, 5, 255,
+};
+
+static const upb_msglayout *messages_layout[22] = {
+ &envoy_admin_v3_ConfigDump_msginit,
+ &envoy_admin_v3_UpdateFailureState_msginit,
+ &envoy_admin_v3_BootstrapConfigDump_msginit,
+ &envoy_admin_v3_ListenersConfigDump_msginit,
+ &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
+ &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
+ &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
+ &envoy_admin_v3_ClustersConfigDump_msginit,
+ &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
+ &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
+ &envoy_admin_v3_RoutesConfigDump_msginit,
+ &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
+ &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
+ &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
+ &envoy_admin_v3_SecretsConfigDump_msginit,
+ &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
+ &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
+ &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
+};
+
+const upb_msglayout_file envoy_admin_v3_config_dump_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 22,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
index 6f117c6659d..2cbd135b27f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_
#define ENVOY_ADMIN_V3_CONFIG_DUMP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -110,13 +110,19 @@ UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_new(upb_arena *a
UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ConfigDump *ret = envoy_admin_v3_ConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ConfigDump *envoy_admin_v3_ConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ConfigDump *ret = envoy_admin_v3_ConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ConfigDump_serialize(const envoy_admin_v3_ConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ConfigDump_msginit, arena, len);
@@ -147,13 +153,19 @@ UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_
UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_UpdateFailureState *ret = envoy_admin_v3_UpdateFailureState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_UpdateFailureState *envoy_admin_v3_UpdateFailureState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_UpdateFailureState *ret = envoy_admin_v3_UpdateFailureState_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_UpdateFailureState_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_UpdateFailureState_serialize(const envoy_admin_v3_UpdateFailureState *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, arena, len);
@@ -207,13 +219,19 @@ UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDum
UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_BootstrapConfigDump *ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_BootstrapConfigDump *envoy_admin_v3_BootstrapConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_BootstrapConfigDump *ret = envoy_admin_v3_BootstrapConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_BootstrapConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_BootstrapConfigDump_serialize(const envoy_admin_v3_BootstrapConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, arena, len);
@@ -259,13 +277,19 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDum
UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump *ret = envoy_admin_v3_ListenersConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ListenersConfigDump *envoy_admin_v3_ListenersConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump *ret = envoy_admin_v3_ListenersConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_serialize(const envoy_admin_v3_ListenersConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, arena, len);
@@ -315,13 +339,19 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_Lis
UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_ListenersConfigDump_StaticListener_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_StaticListener *ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener *envoy_admin_v3_ListenersConfigDump_StaticListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_StaticListener *ret = envoy_admin_v3_ListenersConfigDump_StaticListener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_StaticListener_serialize(const envoy_admin_v3_ListenersConfigDump_StaticListener *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, arena, len);
@@ -367,13 +397,19 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_
UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_DynamicListenerState *ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_DynamicListenerState *ret = envoy_admin_v3_ListenersConfigDump_DynamicListenerState_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_DynamicListenerState_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListenerState *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, arena, len);
@@ -423,13 +459,19 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_Li
UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_ListenersConfigDump_DynamicListener_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_DynamicListener *ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener *envoy_admin_v3_ListenersConfigDump_DynamicListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ListenersConfigDump_DynamicListener *ret = envoy_admin_v3_ListenersConfigDump_DynamicListener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ListenersConfigDump_DynamicListener_serialize(const envoy_admin_v3_ListenersConfigDump_DynamicListener *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, arena, len);
@@ -513,13 +555,19 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_
UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump *ret = envoy_admin_v3_ClustersConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ClustersConfigDump *envoy_admin_v3_ClustersConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump *ret = envoy_admin_v3_ClustersConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_serialize(const envoy_admin_v3_ClustersConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, arena, len);
@@ -584,13 +632,19 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_Clust
UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_ClustersConfigDump_StaticCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump_StaticCluster *ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster *envoy_admin_v3_ClustersConfigDump_StaticCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump_StaticCluster *ret = envoy_admin_v3_ClustersConfigDump_StaticCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_StaticCluster_serialize(const envoy_admin_v3_ClustersConfigDump_StaticCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, arena, len);
@@ -636,13 +690,19 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_Clus
UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump_DynamicCluster *ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster *envoy_admin_v3_ClustersConfigDump_DynamicCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ClustersConfigDump_DynamicCluster *ret = envoy_admin_v3_ClustersConfigDump_DynamicCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ClustersConfigDump_DynamicCluster_serialize(const envoy_admin_v3_ClustersConfigDump_DynamicCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, arena, len);
@@ -711,13 +771,19 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_new(
UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump *ret = envoy_admin_v3_RoutesConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_RoutesConfigDump *envoy_admin_v3_RoutesConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump *ret = envoy_admin_v3_RoutesConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_serialize(const envoy_admin_v3_RoutesConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, arena, len);
@@ -763,13 +829,19 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_Rou
UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, arena, len);
@@ -815,13 +887,19 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_Ro
UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *ret = envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_serialize(const envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, arena, len);
@@ -890,13 +968,19 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesCon
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump *ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump *envoy_admin_v3_ScopedRoutesConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump *ret = envoy_admin_v3_ScopedRoutesConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_serialize(const envoy_admin_v3_ScopedRoutesConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, arena, len);
@@ -942,13 +1026,19 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, arena, len);
@@ -998,13 +1088,19 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envo
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *ret = envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_serialize(const envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, arena, len);
@@ -1077,13 +1173,19 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_ne
UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump *ret = envoy_admin_v3_SecretsConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_SecretsConfigDump *envoy_admin_v3_SecretsConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump *ret = envoy_admin_v3_SecretsConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_serialize(const envoy_admin_v3_SecretsConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, arena, len);
@@ -1144,13 +1246,19 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_Secret
UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump_DynamicSecret *ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret *envoy_admin_v3_SecretsConfigDump_DynamicSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump_DynamicSecret *ret = envoy_admin_v3_SecretsConfigDump_DynamicSecret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_DynamicSecret_serialize(const envoy_admin_v3_SecretsConfigDump_DynamicSecret *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, arena, len);
@@ -1223,13 +1331,19 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_Secrets
UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_SecretsConfigDump_StaticSecret_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump_StaticSecret *ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret *envoy_admin_v3_SecretsConfigDump_StaticSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_SecretsConfigDump_StaticSecret *ret = envoy_admin_v3_SecretsConfigDump_StaticSecret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_SecretsConfigDump_StaticSecret_serialize(const envoy_admin_v3_SecretsConfigDump_StaticSecret *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, arena, len);
@@ -1279,13 +1393,19 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDum
UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDump_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump *ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_EndpointsConfigDump *envoy_admin_v3_EndpointsConfigDump_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump *ret = envoy_admin_v3_EndpointsConfigDump_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_serialize(const envoy_admin_v3_EndpointsConfigDump *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, arena, len);
@@ -1331,13 +1451,19 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_
UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, arena, len);
@@ -1383,13 +1509,19 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin
UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *ret = envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_serialize(const envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, arena, len);
@@ -1450,6 +1582,8 @@ UPB_INLINE void envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_cli
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+extern const upb_msglayout_file envoy_admin_v3_config_dump_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
index 007de310153..48264cb2b86 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c
@@ -7,11 +7,52 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/annotations/deprecation.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+const upb_msglayout_ext envoy_annotations_disallowed_by_default_ext = {
+ {189503207, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext envoy_annotations_deprecated_at_minor_version_ext = {
+ {157299826, 0, 0, 0, 9, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext envoy_annotations_disallowed_by_default_enum_ext = {
+ {70100853, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext envoy_annotations_deprecated_at_minor_version_enum_ext = {
+ {181198657, 0, 0, 0, 9, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = NULL},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[4] = {
+ &envoy_annotations_disallowed_by_default_ext,
+ &envoy_annotations_deprecated_at_minor_version_ext,
+ &envoy_annotations_disallowed_by_default_enum_ext,
+ &envoy_annotations_deprecated_at_minor_version_enum_ext,
+};
+
+const upb_msglayout_file envoy_annotations_deprecation_proto_upb_file_layout = {
+ NULL,
+ extensions_layout,
+ 0,
+ 4,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
index 1478843b590..8e667a521b7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
#define ENVOY_ANNOTATIONS_DEPRECATION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,24 @@
extern "C" {
#endif
+extern const upb_msglayout_ext envoy_annotations_disallowed_by_default_ext;
+extern const upb_msglayout_ext envoy_annotations_deprecated_at_minor_version_ext;
+extern const upb_msglayout_ext envoy_annotations_disallowed_by_default_enum_ext;
+extern const upb_msglayout_ext envoy_annotations_deprecated_at_minor_version_enum_ext;
+struct google_protobuf_EnumValueOptions;
+struct google_protobuf_FieldOptions;
+extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+
+UPB_INLINE bool envoy_annotations_has_disallowed_by_default(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &envoy_annotations_disallowed_by_default_ext) != NULL; }
+UPB_INLINE bool envoy_annotations_disallowed_by_default(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &envoy_annotations_disallowed_by_default_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &envoy_annotations_deprecated_at_minor_version_ext) != NULL; }
+UPB_INLINE upb_strview envoy_annotations_deprecated_at_minor_version(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &envoy_annotations_deprecated_at_minor_version_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, upb_strview) : upb_strview_make("", strlen("")); }
+UPB_INLINE bool envoy_annotations_has_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions *msg) { return _upb_msg_getext(msg, &envoy_annotations_disallowed_by_default_enum_ext) != NULL; }
+UPB_INLINE bool envoy_annotations_disallowed_by_default_enum(const struct google_protobuf_EnumValueOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &envoy_annotations_disallowed_by_default_enum_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+UPB_INLINE bool envoy_annotations_has_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions *msg) { return _upb_msg_getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext) != NULL; }
+UPB_INLINE upb_strview envoy_annotations_deprecated_at_minor_version_enum(const struct google_protobuf_EnumValueOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &envoy_annotations_deprecated_at_minor_version_enum_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, upb_strview) : upb_strview_make("", strlen("")); }
+extern const upb_msglayout_file envoy_annotations_deprecation_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
index 8f1877d1c6d..9e2695c86fd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.c
@@ -7,20 +7,44 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/annotations/resource.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_annotations_ResourceAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_annotations_ResourceAnnotation_msginit = {
NULL,
&envoy_annotations_ResourceAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_annotations_ResourceAnnotation_msginit,
+};
+
+extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
+extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
+const upb_msglayout_ext envoy_annotations_resource_ext = {
+ {265073217, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_ServiceOptions_msginit,
+ {.submsg = &envoy_annotations_ResourceAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &envoy_annotations_resource_ext,
+};
+
+const upb_msglayout_file envoy_annotations_resource_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 1,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
index 534eef36b8c..5b3e62fd002 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/annotations/resource.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
#define ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,6 +23,9 @@ extern "C" {
struct envoy_annotations_ResourceAnnotation;
typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation;
extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
+extern const upb_msglayout_ext envoy_annotations_resource_ext;
+struct google_protobuf_ServiceOptions;
+extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
/* envoy.annotations.ResourceAnnotation */
@@ -33,13 +36,19 @@ UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnot
UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_annotations_ResourceAnnotation *ret = envoy_annotations_ResourceAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_annotations_ResourceAnnotation *envoy_annotations_ResourceAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_annotations_ResourceAnnotation *ret = envoy_annotations_ResourceAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_annotations_ResourceAnnotation_serialize(const envoy_annotations_ResourceAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_annotations_ResourceAnnotation_msginit, arena, len);
@@ -51,6 +60,10 @@ UPB_INLINE void envoy_annotations_ResourceAnnotation_set_type(envoy_annotations_
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+UPB_INLINE bool envoy_annotations_has_resource(const struct google_protobuf_ServiceOptions *msg) { return _upb_msg_getext(msg, &envoy_annotations_resource_ext) != NULL; }
+UPB_INLINE const envoy_annotations_ResourceAnnotation* envoy_annotations_resource(const struct google_protobuf_ServiceOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &envoy_annotations_resource_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const envoy_annotations_ResourceAnnotation*); }
+extern const upb_msglayout_file envoy_annotations_resource_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
index fa6dcbc1fb9..ba9e103f357 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
@@ -21,222 +21,247 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_accesslog_v3_AccessLog_submsgs[2] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_AccessLog_submsgs[2] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_AccessLog__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit = {
&envoy_config_accesslog_v3_AccessLog_submsgs[0],
&envoy_config_accesslog_v3_AccessLog__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = {
- &envoy_config_accesslog_v3_AndFilter_msginit,
- &envoy_config_accesslog_v3_DurationFilter_msginit,
- &envoy_config_accesslog_v3_ExtensionFilter_msginit,
- &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
- &envoy_config_accesslog_v3_HeaderFilter_msginit,
- &envoy_config_accesslog_v3_MetadataFilter_msginit,
- &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
- &envoy_config_accesslog_v3_OrFilter_msginit,
- &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
- &envoy_config_accesslog_v3_RuntimeFilter_msginit,
- &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
- &envoy_config_accesslog_v3_TraceableFilter_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_AccessLogFilter_submsgs[12] = {
+ {.submsg = &envoy_config_accesslog_v3_AndFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_DurationFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_ExtensionFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_GrpcStatusFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_HeaderFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_MetadataFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_OrFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_ResponseFlagFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_RuntimeFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_StatusCodeFilter_msginit},
+ {.submsg = &envoy_config_accesslog_v3_TraceableFilter_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_AccessLogFilter__fields[12] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 10, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 11, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 9, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {12, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit = {
&envoy_config_accesslog_v3_AccessLogFilter_submsgs[0],
&envoy_config_accesslog_v3_AccessLogFilter__fields[0],
- UPB_SIZE(8, 16), 12, false, 255,
+ UPB_SIZE(8, 16), 12, _UPB_MSGEXT_NONE, 12, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
- &envoy_config_core_v3_RuntimeUInt32_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_RuntimeUInt32_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_ComparisonFilter__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit = {
&envoy_config_accesslog_v3_ComparisonFilter_submsgs[0],
&envoy_config_accesslog_v3_ComparisonFilter__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_StatusCodeFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit = {
&envoy_config_accesslog_v3_StatusCodeFilter_submsgs[0],
&envoy_config_accesslog_v3_StatusCodeFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_DurationFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_ComparisonFilter_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_DurationFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit = {
&envoy_config_accesslog_v3_DurationFilter_submsgs[0],
&envoy_config_accesslog_v3_DurationFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_RuntimeFilter__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit = {
&envoy_config_accesslog_v3_RuntimeFilter_submsgs[0],
&envoy_config_accesslog_v3_RuntimeFilter__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_AndFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_AndFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit = {
&envoy_config_accesslog_v3_AndFilter_submsgs[0],
&envoy_config_accesslog_v3_AndFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_OrFilter_submsgs[1] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_OrFilter__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit = {
&envoy_config_accesslog_v3_OrFilter_submsgs[0],
&envoy_config_accesslog_v3_OrFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_HeaderFilter__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit = {
&envoy_config_accesslog_v3_HeaderFilter_submsgs[0],
&envoy_config_accesslog_v3_HeaderFilter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit = {
NULL,
&envoy_config_accesslog_v3_ResponseFlagFilter__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 14, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 14, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit = {
NULL,
&envoy_config_accesslog_v3_GrpcStatusFilter__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_MetadataFilter__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit = {
&envoy_config_accesslog_v3_MetadataFilter_submsgs[0],
&envoy_config_accesslog_v3_MetadataFilter__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_accesslog_v3_ExtensionFilter__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit = {
&envoy_config_accesslog_v3_ExtensionFilter_submsgs[0],
&envoy_config_accesslog_v3_ExtensionFilter__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[15] = {
+ &envoy_config_accesslog_v3_AccessLog_msginit,
+ &envoy_config_accesslog_v3_AccessLogFilter_msginit,
+ &envoy_config_accesslog_v3_ComparisonFilter_msginit,
+ &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
+ &envoy_config_accesslog_v3_DurationFilter_msginit,
+ &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
+ &envoy_config_accesslog_v3_TraceableFilter_msginit,
+ &envoy_config_accesslog_v3_RuntimeFilter_msginit,
+ &envoy_config_accesslog_v3_AndFilter_msginit,
+ &envoy_config_accesslog_v3_OrFilter_msginit,
+ &envoy_config_accesslog_v3_HeaderFilter_msginit,
+ &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
+ &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
+ &envoy_config_accesslog_v3_MetadataFilter_msginit,
+ &envoy_config_accesslog_v3_ExtensionFilter_msginit,
+};
+
+const upb_msglayout_file envoy_config_accesslog_v3_accesslog_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 15,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
index 8e33c869c72..1db0c2a1512 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
#define ENVOY_CONFIG_ACCESSLOG_V3_ACCESSLOG_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -113,13 +113,19 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_Access
UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_AccessLog *ret = envoy_config_accesslog_v3_AccessLog_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_AccessLog *envoy_config_accesslog_v3_AccessLog_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_AccessLog *ret = envoy_config_accesslog_v3_AccessLog_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLog_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_AccessLog_serialize(const envoy_config_accesslog_v3_AccessLog *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, arena, len);
@@ -174,13 +180,19 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_
UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_AccessLogFilter *ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter *envoy_config_accesslog_v3_AccessLogFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_AccessLogFilter *ret = envoy_config_accesslog_v3_AccessLogFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AccessLogFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_AccessLogFilter_serialize(const envoy_config_accesslog_v3_AccessLogFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, arena, len);
@@ -381,13 +393,19 @@ UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3
UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_ComparisonFilter *ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter *envoy_config_accesslog_v3_ComparisonFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_ComparisonFilter *ret = envoy_config_accesslog_v3_ComparisonFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ComparisonFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_ComparisonFilter_serialize(const envoy_config_accesslog_v3_ComparisonFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, arena, len);
@@ -422,13 +440,19 @@ UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3
UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_StatusCodeFilter *ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter *envoy_config_accesslog_v3_StatusCodeFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_StatusCodeFilter *ret = envoy_config_accesslog_v3_StatusCodeFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_StatusCodeFilter_serialize(const envoy_config_accesslog_v3_StatusCodeFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, arena, len);
@@ -459,13 +483,19 @@ UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_D
UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_DurationFilter *ret = envoy_config_accesslog_v3_DurationFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_DurationFilter *envoy_config_accesslog_v3_DurationFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_DurationFilter *ret = envoy_config_accesslog_v3_DurationFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_DurationFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_DurationFilter_serialize(const envoy_config_accesslog_v3_DurationFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, arena, len);
@@ -496,13 +526,19 @@ UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslo
UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_NotHealthCheckFilter *ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter *envoy_config_accesslog_v3_NotHealthCheckFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_NotHealthCheckFilter *ret = envoy_config_accesslog_v3_NotHealthCheckFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_NotHealthCheckFilter_serialize(const envoy_config_accesslog_v3_NotHealthCheckFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, arena, len);
@@ -518,13 +554,19 @@ UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_
UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_TraceableFilter *ret = envoy_config_accesslog_v3_TraceableFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_TraceableFilter *envoy_config_accesslog_v3_TraceableFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_TraceableFilter *ret = envoy_config_accesslog_v3_TraceableFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_TraceableFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_TraceableFilter_serialize(const envoy_config_accesslog_v3_TraceableFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, arena, len);
@@ -540,13 +582,19 @@ UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_Ru
UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_RuntimeFilter *ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter *envoy_config_accesslog_v3_RuntimeFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_RuntimeFilter *ret = envoy_config_accesslog_v3_RuntimeFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_RuntimeFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_RuntimeFilter_serialize(const envoy_config_accesslog_v3_RuntimeFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, arena, len);
@@ -585,13 +633,19 @@ UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFil
UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_AndFilter *ret = envoy_config_accesslog_v3_AndFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_AndFilter *envoy_config_accesslog_v3_AndFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_AndFilter *ret = envoy_config_accesslog_v3_AndFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_AndFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_AndFilter_serialize(const envoy_config_accesslog_v3_AndFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, arena, len);
@@ -622,13 +676,19 @@ UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilte
UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_OrFilter *ret = envoy_config_accesslog_v3_OrFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_OrFilter *envoy_config_accesslog_v3_OrFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_OrFilter *ret = envoy_config_accesslog_v3_OrFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_OrFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_OrFilter_serialize(const envoy_config_accesslog_v3_OrFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, arena, len);
@@ -659,13 +719,19 @@ UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_Hea
UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_HeaderFilter *ret = envoy_config_accesslog_v3_HeaderFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_HeaderFilter *envoy_config_accesslog_v3_HeaderFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_HeaderFilter *ret = envoy_config_accesslog_v3_HeaderFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_HeaderFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_HeaderFilter_serialize(const envoy_config_accesslog_v3_HeaderFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, arena, len);
@@ -696,13 +762,19 @@ UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_
UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_ResponseFlagFilter *ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter *envoy_config_accesslog_v3_ResponseFlagFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_ResponseFlagFilter *ret = envoy_config_accesslog_v3_ResponseFlagFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_ResponseFlagFilter_serialize(const envoy_config_accesslog_v3_ResponseFlagFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, arena, len);
@@ -729,13 +801,19 @@ UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3
UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_GrpcStatusFilter *ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter *envoy_config_accesslog_v3_GrpcStatusFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_GrpcStatusFilter *ret = envoy_config_accesslog_v3_GrpcStatusFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_GrpcStatusFilter_serialize(const envoy_config_accesslog_v3_GrpcStatusFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, arena, len);
@@ -766,13 +844,19 @@ UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_M
UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_MetadataFilter *ret = envoy_config_accesslog_v3_MetadataFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_MetadataFilter *envoy_config_accesslog_v3_MetadataFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_MetadataFilter *ret = envoy_config_accesslog_v3_MetadataFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_MetadataFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_MetadataFilter_serialize(const envoy_config_accesslog_v3_MetadataFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, arena, len);
@@ -818,13 +902,19 @@ UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_
UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_accesslog_v3_ExtensionFilter *ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter *envoy_config_accesslog_v3_ExtensionFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_accesslog_v3_ExtensionFilter *ret = envoy_config_accesslog_v3_ExtensionFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_accesslog_v3_ExtensionFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_accesslog_v3_ExtensionFilter_serialize(const envoy_config_accesslog_v3_ExtensionFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, arena, len);
@@ -856,6 +946,8 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_accesslog_v3_ExtensionFilter
return sub;
}
+extern const upb_msglayout_file envoy_config_accesslog_v3_accesslog_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
index b7f9387b242..0d6f9580e74 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c
@@ -7,14 +7,16 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "envoy/config/cluster/v3/cluster.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/config_source.upb.h"
#include "envoy/config/core/v3/event_service_config.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/resolver.upb.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "envoy/config/listener/v3/listener.upb.h"
#include "envoy/config/metrics/v3/stats.upb.h"
@@ -25,6 +27,7 @@
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/security.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -33,317 +36,363 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_submsgs[19] = {
- &envoy_config_bootstrap_v3_Admin_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_msginit,
- &envoy_config_bootstrap_v3_FatalAction_msginit,
- &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
- &envoy_config_bootstrap_v3_Watchdog_msginit,
- &envoy_config_bootstrap_v3_Watchdogs_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_metrics_v3_StatsConfig_msginit,
- &envoy_config_metrics_v3_StatsSink_msginit,
- &envoy_config_overload_v3_OverloadManager_msginit,
- &envoy_config_trace_v3_Tracing_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt64Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap__fields[27] = {
- {1, UPB_SIZE(28, 56), 1, 11, 11, 1},
- {2, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {3, UPB_SIZE(36, 72), 3, 2, 11, 1},
- {4, UPB_SIZE(40, 80), 4, 4, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {6, UPB_SIZE(88, 176), 0, 14, 11, 3},
- {7, UPB_SIZE(44, 88), 5, 17, 11, 1},
- {8, UPB_SIZE(48, 96), 6, 7, 11, 1},
- {9, UPB_SIZE(52, 104), 7, 16, 11, 1},
- {12, UPB_SIZE(56, 112), 8, 0, 11, 1},
- {13, UPB_SIZE(60, 120), 9, 13, 11, 1},
- {14, UPB_SIZE(64, 128), 10, 9, 11, 1},
- {15, UPB_SIZE(68, 136), 11, 15, 11, 1},
- {16, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {17, UPB_SIZE(72, 144), 12, 6, 11, 1},
- {18, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {19, UPB_SIZE(76, 152), 13, 18, 11, 1},
- {20, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {21, UPB_SIZE(92, 184), 0, 12, 11, 3},
- {22, UPB_SIZE(96, 192), 0, 10, 11, 3},
- {23, UPB_SIZE(80, 160), 14, 10, 11, 1},
- {24, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {25, UPB_SIZE(100, 200), 0, 1, 11, _UPB_LABEL_MAP},
- {26, UPB_SIZE(104, 208), 0, 0, 9, 3},
- {27, UPB_SIZE(84, 168), 15, 8, 11, 1},
- {28, UPB_SIZE(108, 216), 0, 5, 11, 3},
- {29, UPB_SIZE(112, 224), UPB_SIZE(-117, -229), 0, 8, 1},
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Bootstrap_submsgs[21] = {
+ {.submsg = &envoy_config_bootstrap_v3_Admin_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_ClusterManager_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_CustomInlineHeader_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_FatalAction_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_LayeredRuntime_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_Watchdogs_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsConfig_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsSink_msginit},
+ {.submsg = &envoy_config_overload_v3_OverloadManager_msginit},
+ {.submsg = &envoy_config_trace_v3_Tracing_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap__fields[30] = {
+ {1, UPB_SIZE(32, 56), 1, 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(36, 64), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(40, 72), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(44, 80), 4, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(100, 192), 0, 16, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(48, 88), 5, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(52, 96), 6, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(56, 104), 7, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(60, 112), 8, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(64, 120), 9, 15, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(68, 128), 10, 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(72, 136), 11, 17, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(76, 144), 12, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(80, 152), 13, 20, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(104, 200), 0, 14, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(108, 208), 0, 11, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(84, 160), 14, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(24, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(112, 216), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(116, 224), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {27, UPB_SIZE(88, 168), 15, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {28, UPB_SIZE(120, 232), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {29, UPB_SIZE(128, 248), UPB_SIZE(-133, -253), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {30, UPB_SIZE(92, 176), 16, 12, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {31, UPB_SIZE(96, 184), 17, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {32, UPB_SIZE(124, 240), 0, 5, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap__fields[0],
- UPB_SIZE(120, 240), 27, false, 255,
+ UPB_SIZE(136, 256), 30, _UPB_MSGEXT_NONE, 9, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = {
- &envoy_config_cluster_v3_Cluster_msginit,
- &envoy_config_listener_v3_Listener_msginit,
- &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_Secret_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {3, UPB_SIZE(8, 16), 0, 2, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_StaticResources__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[2] = {
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[5] = {
- {1, UPB_SIZE(20, 40), 1, 1, 11, 1},
- {2, UPB_SIZE(24, 48), 2, 1, 11, 1},
- {3, UPB_SIZE(28, 56), 3, 0, 11, 1},
- {5, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(20, 40), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_DynamicResources__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit = {
&envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[0],
&envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Admin_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Admin_submsgs[3] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
};
-static const upb_msglayout_field envoy_config_bootstrap_v3_Admin__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {4, UPB_SIZE(24, 48), 0, 1, 11, 3},
+static const upb_msglayout_field envoy_config_bootstrap_v3_Admin__fields[5] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 48), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Admin_msginit = {
&envoy_config_bootstrap_v3_Admin_submsgs[0],
&envoy_config_bootstrap_v3_Admin__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = {
- &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = {
+ {.submsg = &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_BindConfig_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_ClusterManager__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 2, 11, 1},
- {4, UPB_SIZE(20, 40), 3, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_msginit = {
&envoy_config_bootstrap_v3_ClusterManager_submsgs[0],
&envoy_config_bootstrap_v3_ClusterManager__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit = {
&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[0],
&envoy_config_bootstrap_v3_ClusterManager_OutlierDetection__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdogs_submsgs[1] = {
- &envoy_config_bootstrap_v3_Watchdog_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Watchdogs_submsgs[1] = {
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdogs__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Watchdogs_msginit = {
&envoy_config_bootstrap_v3_Watchdogs_submsgs[0],
&envoy_config_bootstrap_v3_Watchdogs__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdog_submsgs[3] = {
- &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Watchdog_submsgs[3] = {
+ {.submsg = &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdog__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 2, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 2, 11, 1},
- {5, UPB_SIZE(20, 40), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 48), 6, 2, 11, 1},
- {7, UPB_SIZE(28, 56), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 48), 6, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Watchdog_msginit = {
&envoy_config_bootstrap_v3_Watchdog_submsgs[0],
&envoy_config_bootstrap_v3_Watchdog__fields[0],
- UPB_SIZE(32, 64), 7, false, 255,
+ UPB_SIZE(32, 64), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[2] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit = {
&envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[0],
&envoy_config_bootstrap_v3_Watchdog_WatchdogAction__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_FatalAction_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_FatalAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_FatalAction__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_FatalAction_msginit = {
&envoy_config_bootstrap_v3_FatalAction_submsgs[0],
&envoy_config_bootstrap_v3_FatalAction__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_Runtime_submsgs[1] = {
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_Runtime_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_Runtime__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {4, UPB_SIZE(28, 56), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_Runtime_msginit = {
&envoy_config_bootstrap_v3_Runtime_submsgs[0],
&envoy_config_bootstrap_v3_Runtime__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 64), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = {
- &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = {
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit},
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_msginit = {
&envoy_config_bootstrap_v3_RuntimeLayer_submsgs[0],
&envoy_config_bootstrap_v3_RuntimeLayer__fields[0],
- UPB_SIZE(16, 32), 5, false, 255,
+ UPB_SIZE(16, 32), 5, _UPB_MSGEXT_NONE, 5, 255,
};
static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit = {
NULL,
&envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit = {
&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[0],
&envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = {
- &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
+static const upb_msglayout_sub envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = {
+ {.submsg = &envoy_config_bootstrap_v3_RuntimeLayer_msginit},
};
static const upb_msglayout_field envoy_config_bootstrap_v3_LayeredRuntime__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit = {
&envoy_config_bootstrap_v3_LayeredRuntime_submsgs[0],
&envoy_config_bootstrap_v3_LayeredRuntime__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field envoy_config_bootstrap_v3_CustomInlineHeader__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_bootstrap_v3_CustomInlineHeader_msginit = {
+ NULL,
+ &envoy_config_bootstrap_v3_CustomInlineHeader__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[18] = {
+ &envoy_config_bootstrap_v3_Bootstrap_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
+ &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
+ &envoy_config_bootstrap_v3_Admin_msginit,
+ &envoy_config_bootstrap_v3_ClusterManager_msginit,
+ &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
+ &envoy_config_bootstrap_v3_Watchdogs_msginit,
+ &envoy_config_bootstrap_v3_Watchdog_msginit,
+ &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
+ &envoy_config_bootstrap_v3_FatalAction_msginit,
+ &envoy_config_bootstrap_v3_Runtime_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
+ &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
+ &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
+ &envoy_config_bootstrap_v3_CustomInlineHeader_msginit,
+};
+
+const upb_msglayout_file envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 18,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
index 42e4c8583d9..57254e67bfc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_
#define ENVOY_CONFIG_BOOTSTRAP_V3_BOOTSTRAP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,6 +37,7 @@ struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer;
struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer;
struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer;
struct envoy_config_bootstrap_v3_LayeredRuntime;
+struct envoy_config_bootstrap_v3_CustomInlineHeader;
typedef struct envoy_config_bootstrap_v3_Bootstrap envoy_config_bootstrap_v3_Bootstrap;
typedef struct envoy_config_bootstrap_v3_Bootstrap_StaticResources envoy_config_bootstrap_v3_Bootstrap_StaticResources;
typedef struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources envoy_config_bootstrap_v3_Bootstrap_DynamicResources;
@@ -54,6 +55,7 @@ typedef struct envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer envoy_config_boo
typedef struct envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer;
typedef struct envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer;
typedef struct envoy_config_bootstrap_v3_LayeredRuntime envoy_config_bootstrap_v3_LayeredRuntime;
+typedef struct envoy_config_bootstrap_v3_CustomInlineHeader envoy_config_bootstrap_v3_CustomInlineHeader;
extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit;
extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit;
extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit;
@@ -71,11 +73,14 @@ extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msgi
extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit;
extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit;
extern const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit;
+extern const upb_msglayout envoy_config_bootstrap_v3_CustomInlineHeader_msginit;
+struct envoy_config_accesslog_v3_AccessLog;
struct envoy_config_cluster_v3_Cluster;
struct envoy_config_core_v3_Address;
struct envoy_config_core_v3_ApiConfigSource;
struct envoy_config_core_v3_BindConfig;
struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_DnsResolutionConfig;
struct envoy_config_core_v3_EventServiceConfig;
struct envoy_config_core_v3_Node;
struct envoy_config_core_v3_SocketOption;
@@ -90,11 +95,13 @@ struct envoy_type_v3_Percent;
struct google_protobuf_Duration;
struct google_protobuf_Struct;
struct google_protobuf_UInt64Value;
+extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_msginit;
extern const upb_msglayout envoy_config_core_v3_Address_msginit;
extern const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit;
extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_DnsResolutionConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_Node_msginit;
extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
@@ -111,6 +118,13 @@ extern const upb_msglayout google_protobuf_Struct_msginit;
extern const upb_msglayout google_protobuf_UInt64Value_msginit;
typedef enum {
+ envoy_config_bootstrap_v3_CustomInlineHeader_REQUEST_HEADER = 0,
+ envoy_config_bootstrap_v3_CustomInlineHeader_REQUEST_TRAILER = 1,
+ envoy_config_bootstrap_v3_CustomInlineHeader_RESPONSE_HEADER = 2,
+ envoy_config_bootstrap_v3_CustomInlineHeader_RESPONSE_TRAILER = 3
+} envoy_config_bootstrap_v3_CustomInlineHeader_InlineHeaderType;
+
+typedef enum {
envoy_config_bootstrap_v3_Watchdog_WatchdogAction_UNKNOWN = 0,
envoy_config_bootstrap_v3_Watchdog_WatchdogAction_KILL = 1,
envoy_config_bootstrap_v3_Watchdog_WatchdogAction_MULTIKILL = 2,
@@ -127,13 +141,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootst
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootstrap_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap *ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap *envoy_config_bootstrap_v3_Bootstrap_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap *ret = envoy_config_bootstrap_v3_Bootstrap_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_serialize(const envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, arena, len);
@@ -143,62 +163,68 @@ typedef enum {
envoy_config_bootstrap_v3_Bootstrap_stats_flush_stats_flush_on_admin = 29,
envoy_config_bootstrap_v3_Bootstrap_stats_flush_NOT_SET = 0
} envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases;
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases envoy_config_bootstrap_v3_Bootstrap_stats_flush_case(const envoy_config_bootstrap_v3_Bootstrap* msg) { return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(116, 228), int32_t); }
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases envoy_config_bootstrap_v3_Bootstrap_stats_flush_case(const envoy_config_bootstrap_v3_Bootstrap* msg) { return (envoy_config_bootstrap_v3_Bootstrap_stats_flush_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(132, 252), int32_t); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_node(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_node(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_Node*); }
+UPB_INLINE const struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_node(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_config_core_v3_Node*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_static_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_static_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_config_bootstrap_v3_Bootstrap_StaticResources*); }
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_static_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 64), const envoy_config_bootstrap_v3_Bootstrap_StaticResources*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 72), const envoy_config_bootstrap_v3_Bootstrap_DynamicResources*); }
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 72), const envoy_config_bootstrap_v3_Bootstrap_DynamicResources*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 80), const envoy_config_bootstrap_v3_ClusterManager*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_flags_path(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 176)); }
-UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_accessor(msg, UPB_SIZE(88, 176), len); }
+UPB_INLINE const envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_cluster_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 80), const envoy_config_bootstrap_v3_ClusterManager*); }
+UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_flags_path(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 192)); }
+UPB_INLINE const struct envoy_config_metrics_v3_StatsSink* const* envoy_config_bootstrap_v3_Bootstrap_stats_sinks(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_metrics_v3_StatsSink* const*)_upb_array_accessor(msg, UPB_SIZE(100, 192), len); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 88), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdog(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_watchdog(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 96), const envoy_config_bootstrap_v3_Watchdog*); }
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_watchdog(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 96), const envoy_config_bootstrap_v3_Watchdog*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_tracing(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE const struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_tracing(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), const struct envoy_config_trace_v3_Tracing*); }
+UPB_INLINE const struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_tracing(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 104), const struct envoy_config_trace_v3_Tracing*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 112), const envoy_config_bootstrap_v3_Admin*); }
+UPB_INLINE const envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 112), const envoy_config_bootstrap_v3_Admin*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE const struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_stats_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), const struct envoy_config_metrics_v3_StatsConfig*); }
+UPB_INLINE const struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_stats_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 120), const struct envoy_config_metrics_v3_StatsConfig*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_hds_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_hds_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 128), const struct envoy_config_core_v3_ApiConfigSource*); }
+UPB_INLINE const struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_hds_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 128), const struct envoy_config_core_v3_ApiConfigSource*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_overload_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE const struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_overload_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 136), const struct envoy_config_overload_v3_OverloadManager*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
+UPB_INLINE const struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_overload_manager(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 136), const struct envoy_config_overload_v3_OverloadManager*); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_enable_dispatcher_stats(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE const envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 144), const envoy_config_bootstrap_v3_LayeredRuntime*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_header_prefix(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+UPB_INLINE const envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_layered_runtime(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 144), const envoy_config_bootstrap_v3_LayeredRuntime*); }
+UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_header_prefix(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 152), const struct google_protobuf_UInt64Value*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 184)); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(92, 184), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 192)); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_accessor(msg, UPB_SIZE(96, 192), len); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 152), const struct google_protobuf_UInt64Value*); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_use_tcp_for_dns_lookups(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 200)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_bootstrap_v3_Bootstrap_bootstrap_extensions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(104, 200), len); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 208)); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* const* envoy_config_bootstrap_v3_Bootstrap_config_sources(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const struct envoy_config_core_v3_ConfigSource* const*)_upb_array_accessor(msg, UPB_SIZE(108, 208), len); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_default_config_source(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_default_config_source(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 160), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE size_t envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(const envoy_config_bootstrap_v3_Bootstrap *msg) {return _upb_msg_map_size(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_get(const envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* *val) { return _upb_msg_map_get(msg, UPB_SIZE(100, 200), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_next(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(100, 200), iter); }
-UPB_INLINE upb_strview const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(104, 208), len); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_default_config_source(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 160), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE upb_strview envoy_config_bootstrap_v3_Bootstrap_default_socket_interface(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_certificate_provider_instances(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(112, 216)); }
+UPB_INLINE size_t envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_size(const envoy_config_bootstrap_v3_Bootstrap *msg) {return _upb_msg_map_size(msg, UPB_SIZE(112, 216)); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_get(const envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* *val) { return _upb_msg_map_get(msg, UPB_SIZE(112, 216), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_next(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (const envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(112, 216), iter); }
+UPB_INLINE upb_strview const* envoy_config_bootstrap_v3_Bootstrap_node_context_params(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(116, 224), len); }
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_watchdogs(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE const envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_watchdogs(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 168), const envoy_config_bootstrap_v3_Watchdogs*); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 216)); }
-UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_accessor(msg, UPB_SIZE(108, 216), len); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_getoneofcase(msg, UPB_SIZE(116, 228)) == 29; }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(112, 224), UPB_SIZE(116, 228), 29, false); }
+UPB_INLINE const envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_watchdogs(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 168), const envoy_config_bootstrap_v3_Watchdogs*); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(120, 232)); }
+UPB_INLINE const envoy_config_bootstrap_v3_FatalAction* const* envoy_config_bootstrap_v3_Bootstrap_fatal_actions(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const envoy_config_bootstrap_v3_FatalAction* const*)_upb_array_accessor(msg, UPB_SIZE(120, 232), len); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_getoneofcase(msg, UPB_SIZE(132, 252)) == 29; }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_stats_flush_on_admin(const envoy_config_bootstrap_v3_Bootstrap *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(128, 248), UPB_SIZE(132, 252), 29, false); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 16); }
+UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 176), const struct envoy_config_core_v3_DnsResolutionConfig*); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_hasbit(msg, 17); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(const envoy_config_bootstrap_v3_Bootstrap *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 184), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_has_inline_headers(const envoy_config_bootstrap_v3_Bootstrap *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(124, 240)); }
+UPB_INLINE const envoy_config_bootstrap_v3_CustomInlineHeader* const* envoy_config_bootstrap_v3_Bootstrap_inline_headers(const envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) { return (const envoy_config_bootstrap_v3_CustomInlineHeader* const*)_upb_array_accessor(msg, UPB_SIZE(124, 240), len); }
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_node(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_Node*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), struct envoy_config_core_v3_Node*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap_mutable_node(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_core_v3_Node* sub = (struct envoy_config_core_v3_Node*)envoy_config_bootstrap_v3_Bootstrap_node(msg);
@@ -211,7 +237,7 @@ UPB_INLINE struct envoy_config_core_v3_Node* envoy_config_bootstrap_v3_Bootstrap
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_static_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_StaticResources* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 64), envoy_config_bootstrap_v3_Bootstrap_StaticResources*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 64), envoy_config_bootstrap_v3_Bootstrap_StaticResources*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_bootstrap_v3_Bootstrap_mutable_static_resources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_StaticResources*)envoy_config_bootstrap_v3_Bootstrap_static_resources(msg);
@@ -224,7 +250,7 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_con
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Bootstrap_DynamicResources* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 72), envoy_config_bootstrap_v3_Bootstrap_DynamicResources*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 72), envoy_config_bootstrap_v3_Bootstrap_DynamicResources*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bootstrap_v3_Bootstrap_mutable_dynamic_resources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* sub = (struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources*)envoy_config_bootstrap_v3_Bootstrap_dynamic_resources(msg);
@@ -237,7 +263,7 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_co
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_cluster_manager(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_ClusterManager* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 80), envoy_config_bootstrap_v3_ClusterManager*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 80), envoy_config_bootstrap_v3_ClusterManager*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_Bootstrap_mutable_cluster_manager(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_ClusterManager* sub = (struct envoy_config_bootstrap_v3_ClusterManager*)envoy_config_bootstrap_v3_Bootstrap_cluster_manager(msg);
@@ -249,24 +275,24 @@ UPB_INLINE struct envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstr
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_flags_path(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
}
UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_mutable_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 176), len);
+ return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 192), len);
}
UPB_INLINE struct envoy_config_metrics_v3_StatsSink** envoy_config_bootstrap_v3_Bootstrap_resize_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_resize_accessor2(msg, UPB_SIZE(88, 176), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_metrics_v3_StatsSink**)_upb_array_resize_accessor2(msg, UPB_SIZE(100, 192), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_metrics_v3_StatsSink* envoy_config_bootstrap_v3_Bootstrap_add_stats_sinks(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_metrics_v3_StatsSink* sub = (struct envoy_config_metrics_v3_StatsSink*)_upb_msg_new(&envoy_config_metrics_v3_StatsSink_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(88, 176), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(100, 192), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 88), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 88), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_flush_interval(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_bootstrap_v3_Bootstrap_stats_flush_interval(msg);
@@ -279,7 +305,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_bootstrap_v3_Bootstrap_
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdog(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdog* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 96), envoy_config_bootstrap_v3_Watchdog*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 96), envoy_config_bootstrap_v3_Watchdog*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdog(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_Watchdog* sub = (struct envoy_config_bootstrap_v3_Watchdog*)envoy_config_bootstrap_v3_Bootstrap_watchdog(msg);
@@ -292,7 +318,7 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_tracing(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_trace_v3_Tracing* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 104), struct envoy_config_trace_v3_Tracing*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 104), struct envoy_config_trace_v3_Tracing*) = value;
}
UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Bootstrap_mutable_tracing(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_trace_v3_Tracing* sub = (struct envoy_config_trace_v3_Tracing*)envoy_config_bootstrap_v3_Bootstrap_tracing(msg);
@@ -305,7 +331,7 @@ UPB_INLINE struct envoy_config_trace_v3_Tracing* envoy_config_bootstrap_v3_Boots
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_admin(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Admin* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 112), envoy_config_bootstrap_v3_Admin*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 112), envoy_config_bootstrap_v3_Admin*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Bootstrap_mutable_admin(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_Admin* sub = (struct envoy_config_bootstrap_v3_Admin*)envoy_config_bootstrap_v3_Bootstrap_admin(msg);
@@ -318,7 +344,7 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Boo
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_metrics_v3_StatsConfig* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 120), struct envoy_config_metrics_v3_StatsConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 120), struct envoy_config_metrics_v3_StatsConfig*) = value;
}
UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_metrics_v3_StatsConfig* sub = (struct envoy_config_metrics_v3_StatsConfig*)envoy_config_bootstrap_v3_Bootstrap_stats_config(msg);
@@ -331,7 +357,7 @@ UPB_INLINE struct envoy_config_metrics_v3_StatsConfig* envoy_config_bootstrap_v3
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_hds_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ApiConfigSource* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 128), struct envoy_config_core_v3_ApiConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 128), struct envoy_config_core_v3_ApiConfigSource*) = value;
}
UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_hds_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_core_v3_ApiConfigSource* sub = (struct envoy_config_core_v3_ApiConfigSource*)envoy_config_bootstrap_v3_Bootstrap_hds_config(msg);
@@ -344,7 +370,7 @@ UPB_INLINE struct envoy_config_core_v3_ApiConfigSource* envoy_config_bootstrap_v
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_overload_manager(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_overload_v3_OverloadManager* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 136), struct envoy_config_overload_v3_OverloadManager*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 136), struct envoy_config_overload_v3_OverloadManager*) = value;
}
UPB_INLINE struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstrap_v3_Bootstrap_mutable_overload_manager(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_overload_v3_OverloadManager* sub = (struct envoy_config_overload_v3_OverloadManager*)envoy_config_bootstrap_v3_Bootstrap_overload_manager(msg);
@@ -356,11 +382,11 @@ UPB_INLINE struct envoy_config_overload_v3_OverloadManager* envoy_config_bootstr
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_enable_dispatcher_stats(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_layered_runtime(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_LayeredRuntime* value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 144), envoy_config_bootstrap_v3_LayeredRuntime*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 144), envoy_config_bootstrap_v3_LayeredRuntime*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_Bootstrap_mutable_layered_runtime(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_LayeredRuntime* sub = (struct envoy_config_bootstrap_v3_LayeredRuntime*)envoy_config_bootstrap_v3_Bootstrap_layered_runtime(msg);
@@ -372,11 +398,11 @@ UPB_INLINE struct envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstr
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_header_prefix(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap *msg, struct google_protobuf_UInt64Value* value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 152), struct google_protobuf_UInt64Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 152), struct google_protobuf_UInt64Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstrap_mutable_stats_server_version_override(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_bootstrap_v3_Bootstrap_stats_server_version_override(msg);
@@ -388,37 +414,37 @@ UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_bootstrap_v3_Bootstr
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_use_tcp_for_dns_lookups(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_mutable_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 184), len);
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(104, 200), len);
}
UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_bootstrap_v3_Bootstrap_resize_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(92, 184), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(104, 200), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_add_bootstrap_extensions(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(92, 184), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(104, 200), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_mutable_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (struct envoy_config_core_v3_ConfigSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 192), len);
+ return (struct envoy_config_core_v3_ConfigSource**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 208), len);
}
UPB_INLINE struct envoy_config_core_v3_ConfigSource** envoy_config_bootstrap_v3_Bootstrap_resize_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_ConfigSource**)_upb_array_resize_accessor2(msg, UPB_SIZE(96, 192), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_ConfigSource**)_upb_array_resize_accessor2(msg, UPB_SIZE(108, 208), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_add_config_sources(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(96, 192), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(108, 208), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_config_source(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 160), struct envoy_config_core_v3_ConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 160), struct envoy_config_core_v3_ConfigSource*) = value;
}
UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_Bootstrap_mutable_default_config_source(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_bootstrap_v3_Bootstrap_default_config_source(msg);
@@ -430,25 +456,25 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_bootstrap_v3_B
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_default_socket_interface(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), upb_strview) = value;
}
-UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap *msg) { _upb_msg_map_clear(msg, UPB_SIZE(100, 200)); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_set(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(100, 200), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_delete(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(100, 200), &key, 0); }
-UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_nextmutable(envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(100, 200), iter); }
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_clear(envoy_config_bootstrap_v3_Bootstrap *msg) { _upb_msg_map_clear(msg, UPB_SIZE(112, 216)); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_set(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key, struct envoy_config_core_v3_TypedExtensionConfig* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(112, 216), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_delete(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(112, 216), &key, 0); }
+UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry* envoy_config_bootstrap_v3_Bootstrap_certificate_provider_instances_nextmutable(envoy_config_bootstrap_v3_Bootstrap *msg, size_t* iter) { return (envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry*)_upb_msg_map_next(msg, UPB_SIZE(112, 216), iter); }
UPB_INLINE upb_strview* envoy_config_bootstrap_v3_Bootstrap_mutable_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(104, 208), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(116, 224), len);
}
UPB_INLINE upb_strview* envoy_config_bootstrap_v3_Bootstrap_resize_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(104, 208), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(116, 224), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_config_bootstrap_v3_Bootstrap_add_node_context_params(envoy_config_bootstrap_v3_Bootstrap *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(104, 208), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(116, 224), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_watchdogs(envoy_config_bootstrap_v3_Bootstrap *msg, envoy_config_bootstrap_v3_Watchdogs* value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 168), envoy_config_bootstrap_v3_Watchdogs*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 168), envoy_config_bootstrap_v3_Watchdogs*) = value;
}
UPB_INLINE struct envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Bootstrap_mutable_watchdogs(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_Watchdogs* sub = (struct envoy_config_bootstrap_v3_Watchdogs*)envoy_config_bootstrap_v3_Bootstrap_watchdogs(msg);
@@ -460,20 +486,59 @@ UPB_INLINE struct envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3
return sub;
}
UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_mutable_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
- return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 216), len);
+ return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(120, 232), len);
}
UPB_INLINE envoy_config_bootstrap_v3_FatalAction** envoy_config_bootstrap_v3_Bootstrap_resize_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
- return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(108, 216), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_bootstrap_v3_FatalAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(120, 232), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Bootstrap_add_fatal_actions(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
struct envoy_config_bootstrap_v3_FatalAction* sub = (struct envoy_config_bootstrap_v3_FatalAction*)_upb_msg_new(&envoy_config_bootstrap_v3_FatalAction_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(108, 216), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(120, 232), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_stats_flush_on_admin(envoy_config_bootstrap_v3_Bootstrap *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(112, 224), value, UPB_SIZE(116, 228), 29);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(128, 248), value, UPB_SIZE(132, 252), 29);
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) {
+ _upb_sethas(msg, 16);
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 176), struct envoy_config_core_v3_DnsResolutionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_dns_resolution_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_bootstrap_v3_Bootstrap_dns_resolution_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_msg_new(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_bootstrap_v3_Bootstrap_set_dns_resolution_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 17);
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 184), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_bootstrap_v3_Bootstrap_mutable_typed_dns_resolver_config(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_bootstrap_v3_Bootstrap_typed_dns_resolver_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_bootstrap_v3_Bootstrap_set_typed_dns_resolver_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_mutable_inline_headers(envoy_config_bootstrap_v3_Bootstrap *msg, size_t *len) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_array_mutable_accessor(msg, UPB_SIZE(124, 240), len);
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader** envoy_config_bootstrap_v3_Bootstrap_resize_inline_headers(envoy_config_bootstrap_v3_Bootstrap *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader**)_upb_array_resize_accessor2(msg, UPB_SIZE(124, 240), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_v3_Bootstrap_add_inline_headers(envoy_config_bootstrap_v3_Bootstrap *msg, upb_arena *arena) {
+ struct envoy_config_bootstrap_v3_CustomInlineHeader* sub = (struct envoy_config_bootstrap_v3_CustomInlineHeader*)_upb_msg_new(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(124, 240), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
}
/* envoy.config.bootstrap.v3.Bootstrap.StaticResources */
@@ -484,13 +549,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_boo
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap_StaticResources *ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources *envoy_config_bootstrap_v3_Bootstrap_StaticResources_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap_StaticResources *ret = envoy_config_bootstrap_v3_Bootstrap_StaticResources_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_StaticResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_StaticResources *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, arena, len);
@@ -551,13 +622,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bo
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap_DynamicResources *ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Bootstrap_DynamicResources *ret = envoy_config_bootstrap_v3_Bootstrap_DynamicResources_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Bootstrap_DynamicResources_serialize(const envoy_config_bootstrap_v3_Bootstrap_DynamicResources *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, arena, len);
@@ -644,13 +721,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_new(
UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Admin *ret = envoy_config_bootstrap_v3_Admin_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Admin *envoy_config_bootstrap_v3_Admin_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Admin *ret = envoy_config_bootstrap_v3_Admin_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Admin_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Admin_serialize(const envoy_config_bootstrap_v3_Admin *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, arena, len);
@@ -662,6 +745,8 @@ UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_address(const envoy_config_b
UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_bootstrap_v3_Admin_address(const envoy_config_bootstrap_v3_Admin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_config_core_v3_Address*); }
UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_socket_options(const envoy_config_bootstrap_v3_Admin *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_bootstrap_v3_Admin_socket_options(const envoy_config_bootstrap_v3_Admin *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_config_bootstrap_v3_Admin_has_access_log(const envoy_config_bootstrap_v3_Admin *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_bootstrap_v3_Admin_access_log(const envoy_config_bootstrap_v3_Admin *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
UPB_INLINE void envoy_config_bootstrap_v3_Admin_set_access_log_path(envoy_config_bootstrap_v3_Admin *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
@@ -695,6 +780,19 @@ UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_bootstrap_v3_A
if (!ok) return NULL;
return sub;
}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_mutable_access_log(envoy_config_bootstrap_v3_Admin *msg, size_t *len) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_bootstrap_v3_Admin_resize_access_log(envoy_config_bootstrap_v3_Admin *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_bootstrap_v3_Admin_add_access_log(envoy_config_bootstrap_v3_Admin *msg, upb_arena *arena) {
+ struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
/* envoy.config.bootstrap.v3.ClusterManager */
@@ -704,13 +802,19 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_C
UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_ClusterManager_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_ClusterManager *ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_ClusterManager *envoy_config_bootstrap_v3_ClusterManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_ClusterManager *ret = envoy_config_bootstrap_v3_ClusterManager_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_ClusterManager_serialize(const envoy_config_bootstrap_v3_ClusterManager *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, arena, len);
@@ -775,13 +879,19 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_conf
UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *ret = envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_serialize(const envoy_config_bootstrap_v3_ClusterManager_OutlierDetection *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, arena, len);
@@ -816,13 +926,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchd
UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchdogs_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdogs *ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Watchdogs *envoy_config_bootstrap_v3_Watchdogs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdogs *ret = envoy_config_bootstrap_v3_Watchdogs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdogs_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Watchdogs_serialize(const envoy_config_bootstrap_v3_Watchdogs *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, arena, len);
@@ -868,13 +984,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdo
UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdog_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdog *ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Watchdog *envoy_config_bootstrap_v3_Watchdog_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdog *ret = envoy_config_bootstrap_v3_Watchdog_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Watchdog_serialize(const envoy_config_bootstrap_v3_Watchdog *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, arena, len);
@@ -995,13 +1117,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_boots
UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdog_WatchdogAction *ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Watchdog_WatchdogAction *ret = envoy_config_bootstrap_v3_Watchdog_WatchdogAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Watchdog_WatchdogAction_serialize(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, arena, len);
@@ -1036,13 +1164,19 @@ UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_Fata
UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_FatalAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_FatalAction *ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_FatalAction *envoy_config_bootstrap_v3_FatalAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_FatalAction *ret = envoy_config_bootstrap_v3_FatalAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_FatalAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_FatalAction_serialize(const envoy_config_bootstrap_v3_FatalAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, arena, len);
@@ -1073,13 +1207,19 @@ UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_
UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_Runtime *ret = envoy_config_bootstrap_v3_Runtime_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_Runtime *envoy_config_bootstrap_v3_Runtime_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_Runtime *ret = envoy_config_bootstrap_v3_Runtime_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_Runtime_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_Runtime_serialize(const envoy_config_bootstrap_v3_Runtime *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, arena, len);
@@ -1122,13 +1262,19 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_Run
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_RuntimeLayer_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer *envoy_config_bootstrap_v3_RuntimeLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, arena, len);
@@ -1213,13 +1359,19 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootst
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, arena, len);
@@ -1247,13 +1399,19 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_boots
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, arena, len);
@@ -1269,13 +1427,19 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootst
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *ret = envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_serialize(const envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, arena, len);
@@ -1310,13 +1474,19 @@ UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_L
UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_LayeredRuntime_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_bootstrap_v3_LayeredRuntime *ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime *envoy_config_bootstrap_v3_LayeredRuntime_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_bootstrap_v3_LayeredRuntime *ret = envoy_config_bootstrap_v3_LayeredRuntime_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_bootstrap_v3_LayeredRuntime_serialize(const envoy_config_bootstrap_v3_LayeredRuntime *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, arena, len);
@@ -1339,6 +1509,44 @@ UPB_INLINE struct envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap
return sub;
}
+/* envoy.config.bootstrap.v3.CustomInlineHeader */
+
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader *envoy_config_bootstrap_v3_CustomInlineHeader_new(upb_arena *arena) {
+ return (envoy_config_bootstrap_v3_CustomInlineHeader *)_upb_msg_new(&envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena);
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader *envoy_config_bootstrap_v3_CustomInlineHeader_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_bootstrap_v3_CustomInlineHeader *ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader *envoy_config_bootstrap_v3_CustomInlineHeader_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_bootstrap_v3_CustomInlineHeader *ret = envoy_config_bootstrap_v3_CustomInlineHeader_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_bootstrap_v3_CustomInlineHeader_serialize(const envoy_config_bootstrap_v3_CustomInlineHeader *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_name(const envoy_config_bootstrap_v3_CustomInlineHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE int32_t envoy_config_bootstrap_v3_CustomInlineHeader_inline_header_type(const envoy_config_bootstrap_v3_CustomInlineHeader *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_name(envoy_config_bootstrap_v3_CustomInlineHeader *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_bootstrap_v3_CustomInlineHeader_set_inline_header_type(envoy_config_bootstrap_v3_CustomInlineHeader *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+extern const upb_msglayout_file envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
index b3f086de190..2efd1605b71 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/type/v3/percent.upb.h"
@@ -18,56 +18,69 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_submsgs[1] = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_CircuitBreakers_submsgs[1] = {
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit = {
&envoy_config_cluster_v3_CircuitBreakers_submsgs[0],
&envoy_config_cluster_v3_CircuitBreakers__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[2] = {
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[2] = {
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[8] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 2, 1, 11, 1},
- {4, UPB_SIZE(20, 32), 3, 1, 11, 1},
- {5, UPB_SIZE(24, 40), 4, 1, 11, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(28, 48), 5, 1, 11, 1},
- {8, UPB_SIZE(32, 56), 6, 0, 11, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 32), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(24, 40), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 48), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(32, 56), 6, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit = {
&envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[0],
&envoy_config_cluster_v3_CircuitBreakers_Thresholds__fields[0],
- UPB_SIZE(40, 64), 8, false, 255,
+ UPB_SIZE(40, 64), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit = {
&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[0],
&envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_config_cluster_v3_CircuitBreakers_msginit,
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
+ &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
+};
+
+const upb_msglayout_file envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
index 8d6099603de..f8e5f4e1fc6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_CIRCUIT_BREAKER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -43,13 +43,19 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_Circ
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers *ret = envoy_config_cluster_v3_CircuitBreakers_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers *envoy_config_cluster_v3_CircuitBreakers_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers *ret = envoy_config_cluster_v3_CircuitBreakers_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_serialize(const envoy_config_cluster_v3_CircuitBreakers *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, arena, len);
@@ -80,13 +86,19 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_clus
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers_Thresholds *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds *envoy_config_cluster_v3_CircuitBreakers_Thresholds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers_Thresholds *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, arena, len);
@@ -200,13 +212,19 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *ret = envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_serialize(const envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, arena, len);
@@ -244,6 +262,8 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_cluster_v3_CircuitBr
return sub;
}
+extern const upb_msglayout_file envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
index 8854ed024e3..15373f86259 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/cluster.upb.h"
#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
#include "envoy/config/cluster/v3/filter.upb.h"
@@ -18,6 +18,7 @@
#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/core/v3/health_check.upb.h"
#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/config/core/v3/resolver.upb.h"
#include "envoy/config/endpoint/v3/endpoint.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -25,6 +26,8 @@
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "xds/core/v3/collection_entry.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
+#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/security.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -32,421 +35,494 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
- &xds_core_v3_CollectionEntry_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_ClusterCollection_submsgs[1] = {
+ {.submsg = &xds_core_v3_CollectionEntry_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_ClusterCollection__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit = {
&envoy_config_cluster_v3_ClusterCollection_submsgs[0],
&envoy_config_cluster_v3_ClusterCollection__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_submsgs[32] = {
- &envoy_config_cluster_v3_CircuitBreakers_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit,
- &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit,
- &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit,
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
- &envoy_config_cluster_v3_Filter_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
- &envoy_config_cluster_v3_OutlierDetection_msginit,
- &envoy_config_cluster_v3_TrackClusterStats_msginit,
- &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_config_core_v3_HealthCheck_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster__fields[47] = {
- {1, UPB_SIZE(24, 24), 0, 0, 9, 1},
- {2, UPB_SIZE(160, 296), UPB_SIZE(-165, -305), 0, 14, 1},
- {3, UPB_SIZE(40, 56), 1, 3, 11, 1},
- {4, UPB_SIZE(44, 64), 2, 30, 11, 1},
- {5, UPB_SIZE(48, 72), 3, 31, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {8, UPB_SIZE(140, 256), 0, 21, 11, 3},
- {9, UPB_SIZE(52, 80), 4, 31, 11, 1},
- {10, UPB_SIZE(56, 88), 5, 0, 11, 1},
- {13, UPB_SIZE(60, 96), 6, 22, 11, 1},
- {14, UPB_SIZE(64, 104), 7, 23, 11, 1},
- {16, UPB_SIZE(68, 112), 8, 30, 11, 1},
- {17, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {18, UPB_SIZE(144, 264), 0, 18, 11, 3},
- {19, UPB_SIZE(72, 120), 9, 15, 11, 1},
- {20, UPB_SIZE(76, 128), 10, 30, 11, 1},
- {21, UPB_SIZE(80, 136), 11, 19, 11, 1},
- {22, UPB_SIZE(84, 144), 12, 4, 11, 1},
- {23, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 10, 11, 1},
- {24, UPB_SIZE(88, 152), 13, 26, 11, 1},
- {25, UPB_SIZE(92, 160), 14, 25, 11, 1},
- {26, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {27, UPB_SIZE(96, 168), 15, 1, 11, 1},
- {28, UPB_SIZE(32, 40), 0, 0, 9, 1},
- {29, UPB_SIZE(100, 176), 16, 24, 11, 1},
- {30, UPB_SIZE(104, 184), 17, 17, 11, 1},
- {31, UPB_SIZE(16, 16), 0, 0, 8, 1},
- {32, UPB_SIZE(17, 17), 0, 0, 8, 1},
- {33, UPB_SIZE(108, 192), 18, 29, 11, 1},
- {34, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 7, 11, 1},
- {36, UPB_SIZE(148, 272), 0, 12, 11, _UPB_LABEL_MAP},
- {37, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 5, 11, 1},
- {38, UPB_SIZE(160, 296), UPB_SIZE(-165, -305), 2, 11, 1},
- {39, UPB_SIZE(18, 18), 0, 0, 8, 1},
- {40, UPB_SIZE(152, 280), 0, 13, 11, 3},
- {41, UPB_SIZE(112, 200), 19, 14, 11, 1},
- {42, UPB_SIZE(116, 208), 20, 20, 11, 1},
- {43, UPB_SIZE(156, 288), 0, 11, 11, 3},
- {44, UPB_SIZE(120, 216), 21, 9, 11, 1},
- {45, UPB_SIZE(19, 19), 0, 0, 8, 1},
- {46, UPB_SIZE(124, 224), 22, 28, 11, 1},
- {47, UPB_SIZE(20, 20), 0, 0, 8, 1},
- {48, UPB_SIZE(128, 232), 23, 27, 11, 1},
- {49, UPB_SIZE(132, 240), 24, 16, 11, 1},
- {50, UPB_SIZE(136, 248), 25, 8, 11, 1},
- {51, UPB_SIZE(21, 21), 0, 0, 8, 1},
- {52, UPB_SIZE(168, 312), UPB_SIZE(-173, -321), 6, 11, 1},
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_submsgs[35] = {
+ {.submsg = &envoy_config_cluster_v3_CircuitBreakers_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RefreshRate_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit},
+ {.submsg = &envoy_config_cluster_v3_Filter_msginit},
+ {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_msginit},
+ {.submsg = &envoy_config_cluster_v3_OutlierDetection_msginit},
+ {.submsg = &envoy_config_cluster_v3_TrackClusterStats_msginit},
+ {.submsg = &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_BindConfig_msginit},
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolutionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster__fields[51] = {
+ {1, UPB_SIZE(24, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(172, 320), UPB_SIZE(-177, -329), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(40, 56), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(44, 64), 2, 33, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(48, 72), 3, 34, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(152, 280), 0, 23, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(52, 80), 4, 34, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(56, 88), 5, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(60, 96), 6, 24, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(64, 104), 7, 25, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(68, 112), 8, 33, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(156, 288), 0, 19, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(72, 120), 9, 16, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(76, 128), 10, 33, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(80, 136), 11, 20, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(84, 144), 12, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(180, 336), UPB_SIZE(-185, -345), 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(88, 152), 13, 28, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(92, 160), 14, 27, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(12, 12), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {27, UPB_SIZE(96, 168), 15, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {28, UPB_SIZE(32, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {29, UPB_SIZE(100, 176), 16, 26, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {30, UPB_SIZE(104, 184), 17, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {31, UPB_SIZE(16, 16), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {32, UPB_SIZE(17, 17), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {33, UPB_SIZE(108, 192), 18, 31, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {34, UPB_SIZE(180, 336), UPB_SIZE(-185, -345), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {36, UPB_SIZE(160, 296), 0, 13, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {37, UPB_SIZE(180, 336), UPB_SIZE(-185, -345), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {38, UPB_SIZE(172, 320), UPB_SIZE(-177, -329), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {39, UPB_SIZE(18, 18), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {40, UPB_SIZE(164, 304), 0, 14, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {41, UPB_SIZE(112, 200), 19, 15, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {42, UPB_SIZE(116, 208), 20, 21, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {43, UPB_SIZE(168, 312), 0, 12, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {44, UPB_SIZE(120, 216), 21, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {45, UPB_SIZE(19, 19), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {46, UPB_SIZE(124, 224), 22, 30, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {47, UPB_SIZE(20, 20), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {48, UPB_SIZE(128, 232), 23, 29, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {49, UPB_SIZE(132, 240), 24, 17, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {50, UPB_SIZE(136, 248), 25, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {51, UPB_SIZE(21, 21), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {52, UPB_SIZE(180, 336), UPB_SIZE(-185, -345), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {53, UPB_SIZE(140, 256), 26, 22, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {54, UPB_SIZE(144, 264), 27, 32, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {55, UPB_SIZE(148, 272), 28, 29, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {56, UPB_SIZE(180, 336), UPB_SIZE(-185, -345), 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_msginit = {
&envoy_config_cluster_v3_Cluster_submsgs[0],
&envoy_config_cluster_v3_Cluster__fields[0],
- UPB_SIZE(176, 336), 47, false, 255,
+ UPB_SIZE(192, 352), 51, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = {
- &envoy_config_core_v3_TransportSocket_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit = {
&envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[0],
&envoy_config_cluster_v3_Cluster_TransportSocketMatch__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CustomClusterType__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit = {
&envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[0],
&envoy_config_cluster_v3_Cluster_CustomClusterType__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit = {
&envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_EdsClusterConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = {
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[7] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(12, 16), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {5, UPB_SIZE(9, 9), 0, 0, 8, 1},
- {6, UPB_SIZE(10, 10), 0, 0, 8, 1},
- {7, UPB_SIZE(11, 11), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(9, 9), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(10, 10), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(11, 11), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit = {
&envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_LbSubsetConfig__fields[0],
- UPB_SIZE(24, 32), 7, false, 255,
+ UPB_SIZE(24, 32), 7, _UPB_MSGEXT_NONE, 7, 255,
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {3, UPB_SIZE(12, 16), 0, 0, 9, 3},
- {4, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit = {
NULL,
&envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[0],
- UPB_SIZE(16, 24), 4, false, 255,
+ UPB_SIZE(16, 24), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig__fields[0],
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[1] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit},
+};
+
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[1] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit = {
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[0],
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig__fields[0],
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[2] = {
- &envoy_config_core_v3_RuntimeDouble_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[3] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeDouble_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+static const upb_msglayout_field envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_LeastRequestLbConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[1] = {
- &google_protobuf_UInt64Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[3] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {4, UPB_SIZE(12, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_RingHashLbConfig__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
- &google_protobuf_UInt64Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_MaglevLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_MaglevLbConfig__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = {
NULL,
&envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[5] = {
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[5] = {
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit},
+ {.submsg = &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 4, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {7, UPB_SIZE(12, 24), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 2, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_CommonLbConfig__fields[0],
- UPB_SIZE(24, 48), 7, false, 255,
+ UPB_SIZE(24, 48), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt64Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[2] = {
- {1, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit = {
&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[0],
&envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_RefreshRate__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit = {
&envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[0],
&envoy_config_cluster_v3_Cluster_RefreshRate__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[1] = {
- &google_protobuf_DoubleValue_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[1] = {
+ {.submsg = &google_protobuf_DoubleValue_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit = {
&envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[0],
&envoy_config_cluster_v3_Cluster_PreconnectPolicy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit = {
&envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[0],
&envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[1] = {
+ {.submsg = &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit = {
&envoy_config_cluster_v3_LoadBalancingPolicy_submsgs[0],
&envoy_config_cluster_v3_LoadBalancingPolicy__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_msglayout_field envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[1] = {
+ {4, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit = {
&envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[0],
&envoy_config_cluster_v3_LoadBalancingPolicy_Policy__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
- &envoy_config_core_v3_Address_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_UpstreamBindConfig__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit = {
&envoy_config_cluster_v3_UpstreamBindConfig_submsgs[0],
&envoy_config_cluster_v3_UpstreamBindConfig__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
- &envoy_config_core_v3_TcpKeepalive_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TcpKeepalive_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_UpstreamConnectionOptions__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit = {
&envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[0],
&envoy_config_cluster_v3_UpstreamConnectionOptions__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_cluster_v3_TrackClusterStats__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit = {
NULL,
&envoy_config_cluster_v3_TrackClusterStats__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[25] = {
+ &envoy_config_cluster_v3_ClusterCollection_msginit,
+ &envoy_config_cluster_v3_Cluster_msginit,
+ &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit,
+ &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit,
+ &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit,
+ &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
+ &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
+ &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit,
+ &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
+ &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
+ &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
+ &envoy_config_cluster_v3_UpstreamBindConfig_msginit,
+ &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
+ &envoy_config_cluster_v3_TrackClusterStats_msginit,
+};
+
+const upb_msglayout_file envoy_config_cluster_v3_cluster_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 25,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
index da4d62066ab..c4be201c0f4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_CLUSTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,8 @@ struct envoy_config_cluster_v3_Cluster_CustomClusterType;
struct envoy_config_cluster_v3_Cluster_EdsClusterConfig;
struct envoy_config_cluster_v3_Cluster_LbSubsetConfig;
struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
+struct envoy_config_cluster_v3_Cluster_SlowStartConfig;
+struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig;
struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
struct envoy_config_cluster_v3_Cluster_RingHashLbConfig;
struct envoy_config_cluster_v3_Cluster_MaglevLbConfig;
@@ -50,6 +52,8 @@ typedef struct envoy_config_cluster_v3_Cluster_CustomClusterType envoy_config_cl
typedef struct envoy_config_cluster_v3_Cluster_EdsClusterConfig envoy_config_cluster_v3_Cluster_EdsClusterConfig;
typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig envoy_config_cluster_v3_Cluster_LbSubsetConfig;
typedef struct envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector;
+typedef struct envoy_config_cluster_v3_Cluster_SlowStartConfig envoy_config_cluster_v3_Cluster_SlowStartConfig;
+typedef struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig envoy_config_cluster_v3_Cluster_RoundRobinLbConfig;
typedef struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig envoy_config_cluster_v3_Cluster_LeastRequestLbConfig;
typedef struct envoy_config_cluster_v3_Cluster_RingHashLbConfig envoy_config_cluster_v3_Cluster_RingHashLbConfig;
typedef struct envoy_config_cluster_v3_Cluster_MaglevLbConfig envoy_config_cluster_v3_Cluster_MaglevLbConfig;
@@ -73,6 +77,8 @@ extern const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msg
extern const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit;
+extern const upb_msglayout envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit;
extern const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit;
@@ -95,6 +101,7 @@ struct envoy_config_cluster_v3_OutlierDetection;
struct envoy_config_core_v3_Address;
struct envoy_config_core_v3_BindConfig;
struct envoy_config_core_v3_ConfigSource;
+struct envoy_config_core_v3_DnsResolutionConfig;
struct envoy_config_core_v3_HealthCheck;
struct envoy_config_core_v3_Http1ProtocolOptions;
struct envoy_config_core_v3_Http2ProtocolOptions;
@@ -108,6 +115,7 @@ struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
struct envoy_config_endpoint_v3_ClusterLoadAssignment;
struct envoy_type_v3_Percent;
struct google_protobuf_Any;
+struct google_protobuf_BoolValue;
struct google_protobuf_DoubleValue;
struct google_protobuf_Duration;
struct google_protobuf_Struct;
@@ -120,6 +128,7 @@ extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
extern const upb_msglayout envoy_config_core_v3_Address_msginit;
extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_DnsResolutionConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
@@ -133,6 +142,7 @@ extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msgi
extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
extern const upb_msglayout envoy_type_v3_Percent_msginit;
extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
extern const upb_msglayout google_protobuf_DoubleValue_msginit;
extern const upb_msglayout google_protobuf_Duration_msginit;
extern const upb_msglayout google_protobuf_Struct_msginit;
@@ -156,7 +166,8 @@ typedef enum {
typedef enum {
envoy_config_cluster_v3_Cluster_AUTO = 0,
envoy_config_cluster_v3_Cluster_V4_ONLY = 1,
- envoy_config_cluster_v3_Cluster_V6_ONLY = 2
+ envoy_config_cluster_v3_Cluster_V6_ONLY = 2,
+ envoy_config_cluster_v3_Cluster_V4_PREFERRED = 3
} envoy_config_cluster_v3_Cluster_DnsLookupFamily;
typedef enum {
@@ -197,13 +208,19 @@ UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_Cl
UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_ClusterCollection *ret = envoy_config_cluster_v3_ClusterCollection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_ClusterCollection *envoy_config_cluster_v3_ClusterCollection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_ClusterCollection *ret = envoy_config_cluster_v3_ClusterCollection_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_ClusterCollection_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_ClusterCollection_serialize(const envoy_config_cluster_v3_ClusterCollection *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, arena, len);
@@ -234,13 +251,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_new(
UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster *ret = envoy_config_cluster_v3_Cluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster *envoy_config_cluster_v3_Cluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster *ret = envoy_config_cluster_v3_Cluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_serialize(const envoy_config_cluster_v3_Cluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_msginit, arena, len);
@@ -251,20 +274,21 @@ typedef enum {
envoy_config_cluster_v3_Cluster_cluster_discovery_type_cluster_type = 38,
envoy_config_cluster_v3_Cluster_cluster_discovery_type_NOT_SET = 0
} envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases;
-UPB_INLINE envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases envoy_config_cluster_v3_Cluster_cluster_discovery_type_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(164, 304), int32_t); }
+UPB_INLINE envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases envoy_config_cluster_v3_Cluster_cluster_discovery_type_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_cluster_discovery_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(176, 328), int32_t); }
typedef enum {
envoy_config_cluster_v3_Cluster_lb_config_ring_hash_lb_config = 23,
envoy_config_cluster_v3_Cluster_lb_config_maglev_lb_config = 52,
envoy_config_cluster_v3_Cluster_lb_config_original_dst_lb_config = 34,
envoy_config_cluster_v3_Cluster_lb_config_least_request_lb_config = 37,
+ envoy_config_cluster_v3_Cluster_lb_config_round_robin_lb_config = 56,
envoy_config_cluster_v3_Cluster_lb_config_NOT_SET = 0
} envoy_config_cluster_v3_Cluster_lb_config_oneofcases;
-UPB_INLINE envoy_config_cluster_v3_Cluster_lb_config_oneofcases envoy_config_cluster_v3_Cluster_lb_config_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(172, 320), int32_t); }
+UPB_INLINE envoy_config_cluster_v3_Cluster_lb_config_oneofcases envoy_config_cluster_v3_Cluster_lb_config_case(const envoy_config_cluster_v3_Cluster* msg) { return (envoy_config_cluster_v3_Cluster_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(184, 344), int32_t); }
UPB_INLINE upb_strview envoy_config_cluster_v3_Cluster_name(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(164, 304)) == 2; }
-UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(160, 296), UPB_SIZE(164, 304), 2, 0); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 328)) == 2; }
+UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(172, 320), UPB_SIZE(176, 328), 2, 0); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluster_v3_Cluster_eds_cluster_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 56), const envoy_config_cluster_v3_Cluster_EdsClusterConfig*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_connect_timeout(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 2); }
@@ -272,8 +296,8 @@ UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluste
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_per_connection_buffer_limit_bytes(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 72), const struct google_protobuf_UInt32Value*); }
UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_lb_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_health_checks(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(140, 256)); }
-UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_accessor(msg, UPB_SIZE(140, 256), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_health_checks(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 280)); }
+UPB_INLINE const struct envoy_config_core_v3_HealthCheck* const* envoy_config_cluster_v3_Cluster_health_checks(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_HealthCheck* const*)_upb_array_accessor(msg, UPB_SIZE(152, 280), len); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_max_requests_per_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_circuit_breakers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 5); }
@@ -285,8 +309,8 @@ UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_config_
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_dns_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_Duration*); }
UPB_INLINE int32_t envoy_config_cluster_v3_Cluster_dns_lookup_family(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(144, 264)); }
-UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(144, 264), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(156, 288)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_cluster_v3_Cluster_dns_resolvers(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(156, 288), len); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 9); }
UPB_INLINE const struct envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Cluster_outlier_detection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), const struct envoy_config_cluster_v3_OutlierDetection*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cleanup_interval(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 10); }
@@ -295,8 +319,8 @@ UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_upstream_bind_config(const e
UPB_INLINE const struct envoy_config_core_v3_BindConfig* envoy_config_cluster_v3_Cluster_upstream_bind_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const struct envoy_config_core_v3_BindConfig*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 12); }
UPB_INLINE const envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_v3_Cluster_lb_subset_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const envoy_config_cluster_v3_Cluster_LbSubsetConfig*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(172, 320)) == 23; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(168, 312), UPB_SIZE(172, 320), 23, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 344)) == 23; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_ring_hash_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 336), UPB_SIZE(184, 344), 23, NULL); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 13); }
UPB_INLINE const struct envoy_config_core_v3_TransportSocket* envoy_config_cluster_v3_Cluster_transport_socket(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 152), const struct envoy_config_core_v3_TransportSocket*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_metadata(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 14); }
@@ -313,25 +337,25 @@ UPB_INLINE bool envoy_config_cluster_v3_Cluster_close_connections_on_host_health
UPB_INLINE bool envoy_config_cluster_v3_Cluster_ignore_health_on_host_removal(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(17, 17), bool); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 18); }
UPB_INLINE const struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_cluster_v3_Cluster_load_assignment(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 192), const struct envoy_config_endpoint_v3_ClusterLoadAssignment*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(172, 320)) == 34; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(168, 312), UPB_SIZE(172, 320), 34, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(148, 272)); }
-UPB_INLINE size_t envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(const envoy_config_cluster_v3_Cluster *msg) {return _upb_msg_map_size(msg, UPB_SIZE(148, 272)); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(148, 272), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_next(const envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(148, 272), iter); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(172, 320)) == 37; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(168, 312), UPB_SIZE(172, 320), 37, NULL); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(164, 304)) == 38; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(160, 296), UPB_SIZE(164, 304), 38, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 344)) == 34; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_original_dst_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 336), UPB_SIZE(184, 344), 34, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_extension_protocol_options(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(160, 296)); }
+UPB_INLINE size_t envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_size(const envoy_config_cluster_v3_Cluster *msg) {return _upb_msg_map_size(msg, UPB_SIZE(160, 296)); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_get(const envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(160, 296), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_next(const envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (const envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(160, 296), iter); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 344)) == 37; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_least_request_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 336), UPB_SIZE(184, 344), 37, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(176, 328)) == 38; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_cluster_type(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(172, 320), UPB_SIZE(176, 328), 38, NULL); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_respect_dns_ttl(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_filters(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 280)); }
-UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(152, 280), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_filters(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(164, 304)); }
+UPB_INLINE const struct envoy_config_cluster_v3_Filter* const* envoy_config_cluster_v3_Cluster_filters(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const struct envoy_config_cluster_v3_Filter* const*)_upb_array_accessor(msg, UPB_SIZE(164, 304), len); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 19); }
UPB_INLINE const envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_Cluster_load_balancing_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 200), const envoy_config_cluster_v3_LoadBalancingPolicy*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 20); }
UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Cluster_lrs_server(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const struct envoy_config_core_v3_ConfigSource*); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(156, 288)); }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_accessor(msg, UPB_SIZE(156, 288), len); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(168, 312)); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const* envoy_config_cluster_v3_Cluster_transport_socket_matches(const envoy_config_cluster_v3_Cluster *msg, size_t *len) { return (const envoy_config_cluster_v3_Cluster_TransportSocketMatch* const*)_upb_array_accessor(msg, UPB_SIZE(168, 312), len); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 21); }
UPB_INLINE const envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_Cluster_dns_failure_refresh_rate(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const envoy_config_cluster_v3_Cluster_RefreshRate*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_use_tcp_for_dns_lookups(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(19, 19), bool); }
@@ -345,14 +369,22 @@ UPB_INLINE const envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster
UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_preconnect_policy(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 25); }
UPB_INLINE const envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluster_v3_Cluster_preconnect_policy(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(136, 248), const envoy_config_cluster_v3_Cluster_PreconnectPolicy*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_connection_pool_per_downstream_connection(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(172, 320)) == 52; }
-UPB_INLINE const envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(168, 312), UPB_SIZE(172, 320), 52, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 344)) == 52; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_maglev_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 336), UPB_SIZE(184, 344), 52, NULL); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_dns_resolution_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 26); }
+UPB_INLINE const struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_dns_resolution_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(140, 256), const struct envoy_config_core_v3_DnsResolutionConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 27); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(144, 264), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_hasbit(msg, 28); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_typed_dns_resolver_config(const envoy_config_cluster_v3_Cluster *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(148, 272), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_has_round_robin_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return _upb_getoneofcase(msg, UPB_SIZE(184, 344)) == 56; }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_round_robin_lb_config(const envoy_config_cluster_v3_Cluster *msg) { return UPB_READ_ONEOF(msg, const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(180, 336), UPB_SIZE(184, 344), 56, NULL); }
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_name(envoy_config_cluster_v3_Cluster *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), upb_strview) = value;
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_type(envoy_config_cluster_v3_Cluster *msg, int32_t value) {
- UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(160, 296), value, UPB_SIZE(164, 304), 2);
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(172, 320), value, UPB_SIZE(176, 328), 2);
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_eds_cluster_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_EdsClusterConfig* value) {
_upb_sethas(msg, 1);
@@ -397,15 +429,15 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_lb_policy(envoy_config_clust
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_mutable_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_core_v3_HealthCheck**)_upb_array_mutable_accessor(msg, UPB_SIZE(140, 256), len);
+ return (struct envoy_config_core_v3_HealthCheck**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 280), len);
}
UPB_INLINE struct envoy_config_core_v3_HealthCheck** envoy_config_cluster_v3_Cluster_resize_health_checks(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HealthCheck**)_upb_array_resize_accessor2(msg, UPB_SIZE(140, 256), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_HealthCheck**)_upb_array_resize_accessor2(msg, UPB_SIZE(152, 280), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_HealthCheck* envoy_config_cluster_v3_Cluster_add_health_checks(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_core_v3_HealthCheck* sub = (struct envoy_config_core_v3_HealthCheck*)_upb_msg_new(&envoy_config_core_v3_HealthCheck_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(140, 256), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(152, 280), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -478,15 +510,15 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_lookup_family(envoy_conf
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_mutable_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(144, 264), len);
+ return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(156, 288), len);
}
UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_cluster_v3_Cluster_resize_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor2(msg, UPB_SIZE(144, 264), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor2(msg, UPB_SIZE(156, 288), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_cluster_v3_Cluster_add_dns_resolvers(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(144, 264), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(156, 288), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -543,7 +575,7 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_c
return sub;
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(168, 312), value, UPB_SIZE(172, 320), 23);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RingHashLbConfig*, UPB_SIZE(180, 336), value, UPB_SIZE(184, 344), 23);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluster_v3_Cluster_mutable_ring_hash_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_RingHashLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RingHashLbConfig*)envoy_config_cluster_v3_Cluster_ring_hash_lb_config(msg);
@@ -645,7 +677,7 @@ UPB_INLINE struct envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_c
return sub;
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(168, 312), value, UPB_SIZE(172, 320), 34);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*, UPB_SIZE(180, 336), value, UPB_SIZE(184, 344), 34);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_cluster_v3_Cluster_mutable_original_dst_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig*)envoy_config_cluster_v3_Cluster_original_dst_lb_config(msg);
@@ -656,12 +688,12 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_con
}
return sub;
}
-UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster *msg) { _upb_msg_map_clear(msg, UPB_SIZE(148, 272)); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(148, 272), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_delete(envoy_config_cluster_v3_Cluster *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(148, 272), &key, 0); }
-UPB_INLINE envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_nextmutable(envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(148, 272), iter); }
+UPB_INLINE void envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_clear(envoy_config_cluster_v3_Cluster *msg) { _upb_msg_map_clear(msg, UPB_SIZE(160, 296)); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_set(envoy_config_cluster_v3_Cluster *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(160, 296), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_delete(envoy_config_cluster_v3_Cluster *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(160, 296), &key, 0); }
+UPB_INLINE envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry* envoy_config_cluster_v3_Cluster_typed_extension_protocol_options_nextmutable(envoy_config_cluster_v3_Cluster *msg, size_t* iter) { return (envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry*)_upb_msg_map_next(msg, UPB_SIZE(160, 296), iter); }
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(168, 312), value, UPB_SIZE(172, 320), 37);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*, UPB_SIZE(180, 336), value, UPB_SIZE(184, 344), 37);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cluster_v3_Cluster_mutable_least_request_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig*)envoy_config_cluster_v3_Cluster_least_request_lb_config(msg);
@@ -673,7 +705,7 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_co
return sub;
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_cluster_type(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_CustomClusterType* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(160, 296), value, UPB_SIZE(164, 304), 38);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_CustomClusterType*, UPB_SIZE(172, 320), value, UPB_SIZE(176, 328), 38);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_cluster_v3_Cluster_mutable_cluster_type(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_CustomClusterType* sub = (struct envoy_config_cluster_v3_Cluster_CustomClusterType*)envoy_config_cluster_v3_Cluster_cluster_type(msg);
@@ -688,15 +720,15 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_respect_dns_ttl(envoy_config
*UPB_PTR_AT(msg, UPB_SIZE(18, 18), bool) = value;
}
UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_mutable_filters(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (struct envoy_config_cluster_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 280), len);
+ return (struct envoy_config_cluster_v3_Filter**)_upb_array_mutable_accessor(msg, UPB_SIZE(164, 304), len);
}
UPB_INLINE struct envoy_config_cluster_v3_Filter** envoy_config_cluster_v3_Cluster_resize_filters(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_cluster_v3_Filter**)_upb_array_resize_accessor2(msg, UPB_SIZE(152, 280), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_cluster_v3_Filter**)_upb_array_resize_accessor2(msg, UPB_SIZE(164, 304), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Cluster_add_filters(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Filter* sub = (struct envoy_config_cluster_v3_Filter*)_upb_msg_new(&envoy_config_cluster_v3_Filter_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(152, 280), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(164, 304), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -727,15 +759,15 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_cluster_v3_Clu
return sub;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_mutable_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t *len) {
- return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(156, 288), len);
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_mutable_accessor(msg, UPB_SIZE(168, 312), len);
}
UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch** envoy_config_cluster_v3_Cluster_resize_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, size_t len, upb_arena *arena) {
- return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_resize_accessor2(msg, UPB_SIZE(156, 288), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_cluster_v3_Cluster_TransportSocketMatch**)_upb_array_resize_accessor2(msg, UPB_SIZE(168, 312), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cluster_v3_Cluster_add_transport_socket_matches(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_TransportSocketMatch* sub = (struct envoy_config_cluster_v3_Cluster_TransportSocketMatch*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(156, 288), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(168, 312), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -814,7 +846,7 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_set_connection_pool_per_downstre
*UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
}
UPB_INLINE void envoy_config_cluster_v3_Cluster_set_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(168, 312), value, UPB_SIZE(172, 320), 52);
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_MaglevLbConfig*, UPB_SIZE(180, 336), value, UPB_SIZE(184, 344), 52);
}
UPB_INLINE struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_v3_Cluster_mutable_maglev_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_MaglevLbConfig*)envoy_config_cluster_v3_Cluster_maglev_lb_config(msg);
@@ -825,6 +857,57 @@ UPB_INLINE struct envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_c
}
return sub;
}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_dns_resolution_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_DnsResolutionConfig* value) {
+ _upb_sethas(msg, 26);
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 256), struct envoy_config_core_v3_DnsResolutionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolutionConfig* envoy_config_cluster_v3_Cluster_mutable_dns_resolution_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DnsResolutionConfig* sub = (struct envoy_config_core_v3_DnsResolutionConfig*)envoy_config_cluster_v3_Cluster_dns_resolution_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolutionConfig*)_upb_msg_new(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_dns_resolution_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 27);
+ *UPB_PTR_AT(msg, UPB_SIZE(144, 264), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_cluster_v3_Cluster_mutable_wait_for_warm_on_init(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_cluster_v3_Cluster_wait_for_warm_on_init(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_wait_for_warm_on_init(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 28);
+ *UPB_PTR_AT(msg, UPB_SIZE(148, 272), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_Cluster_mutable_typed_dns_resolver_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_Cluster_typed_dns_resolver_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_typed_dns_resolver_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(envoy_config_cluster_v3_Cluster *msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*, UPB_SIZE(180, 336), value, UPB_SIZE(184, 344), 56);
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_cluster_v3_Cluster_mutable_round_robin_lb_config(envoy_config_cluster_v3_Cluster *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)envoy_config_cluster_v3_Cluster_round_robin_lb_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_RoundRobinLbConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_set_round_robin_lb_config(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.cluster.v3.Cluster.TransportSocketMatch */
@@ -834,13 +917,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cl
UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_TransportSocketMatch *ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch *envoy_config_cluster_v3_Cluster_TransportSocketMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_TransportSocketMatch *ret = envoy_config_cluster_v3_Cluster_TransportSocketMatch_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_TransportSocketMatch_serialize(const envoy_config_cluster_v3_Cluster_TransportSocketMatch *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, arena, len);
@@ -890,13 +979,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_clust
UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CustomClusterType *ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType *envoy_config_cluster_v3_Cluster_CustomClusterType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CustomClusterType *ret = envoy_config_cluster_v3_Cluster_CustomClusterType_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_CustomClusterType_serialize(const envoy_config_cluster_v3_Cluster_CustomClusterType *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, arena, len);
@@ -931,13 +1026,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluste
UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_EdsClusterConfig *ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig *envoy_config_cluster_v3_Cluster_EdsClusterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_EdsClusterConfig *ret = envoy_config_cluster_v3_Cluster_EdsClusterConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_EdsClusterConfig_serialize(const envoy_config_cluster_v3_Cluster_EdsClusterConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, arena, len);
@@ -972,13 +1073,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_
UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LbSubsetConfig *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig *envoy_config_cluster_v3_Cluster_LbSubsetConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LbSubsetConfig *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, arena, len);
@@ -1044,13 +1151,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envo
UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *ret = envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_serialize(const envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, arena, len);
@@ -1088,6 +1201,107 @@ UPB_INLINE void envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
+/* envoy.config.cluster.v3.Cluster.SlowStartConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig *envoy_config_cluster_v3_Cluster_SlowStartConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_SlowStartConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig *envoy_config_cluster_v3_Cluster_SlowStartConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_SlowStartConfig *ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig *envoy_config_cluster_v3_Cluster_SlowStartConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_SlowStartConfig *ret = envoy_config_cluster_v3_Cluster_SlowStartConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_SlowStartConfig_serialize(const envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(const envoy_config_cluster_v3_Cluster_SlowStartConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_SlowStartConfig_has_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(const envoy_config_cluster_v3_Cluster_SlowStartConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_slow_start_window(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_cluster_v3_Cluster_SlowStartConfig_slow_start_window(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_SlowStartConfig_set_slow_start_window(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, struct envoy_config_core_v3_RuntimeDouble* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_core_v3_RuntimeDouble*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_SlowStartConfig_mutable_aggression(envoy_config_cluster_v3_Cluster_SlowStartConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeDouble* sub = (struct envoy_config_core_v3_RuntimeDouble*)envoy_config_cluster_v3_Cluster_SlowStartConfig_aggression(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeDouble*)_upb_msg_new(&envoy_config_core_v3_RuntimeDouble_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_SlowStartConfig_set_aggression(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.cluster.v3.Cluster.RoundRobinLbConfig */
+
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(upb_arena *arena) {
+ return (envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *)_upb_msg_new(&envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *ret = envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_cluster_v3_Cluster_SlowStartConfig*); }
+
+UPB_INLINE void envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_RoundRobinLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_slow_start_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_set_slow_start_config(msg, sub);
+ }
+ return sub;
+}
+
/* envoy.config.cluster.v3.Cluster.LeastRequestLbConfig */
UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(upb_arena *arena) {
@@ -1096,13 +1310,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cl
UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *ret = envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_serialize(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, arena, len);
@@ -1112,6 +1332,8 @@ UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_choice_
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_choice_count(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_active_request_bias(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_core_v3_RuntimeDouble*); }
+UPB_INLINE bool envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_has_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(const envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_config_cluster_v3_Cluster_SlowStartConfig*); }
UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_choice_count(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
@@ -1139,6 +1361,19 @@ UPB_INLINE struct envoy_config_core_v3_RuntimeDouble* envoy_config_cluster_v3_Cl
}
return sub;
}
+UPB_INLINE void envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, envoy_config_cluster_v3_Cluster_SlowStartConfig* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), envoy_config_cluster_v3_Cluster_SlowStartConfig*) = value;
+}
+UPB_INLINE struct envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_mutable_slow_start_config(envoy_config_cluster_v3_Cluster_LeastRequestLbConfig *msg, upb_arena *arena) {
+ struct envoy_config_cluster_v3_Cluster_SlowStartConfig* sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_slow_start_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_cluster_v3_Cluster_SlowStartConfig*)_upb_msg_new(&envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_set_slow_start_config(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.cluster.v3.Cluster.RingHashLbConfig */
@@ -1148,13 +1383,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluste
UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_RingHashLbConfig *ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig *envoy_config_cluster_v3_Cluster_RingHashLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_RingHashLbConfig *ret = envoy_config_cluster_v3_Cluster_RingHashLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_RingHashLbConfig_serialize(const envoy_config_cluster_v3_Cluster_RingHashLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, arena, len);
@@ -1204,13 +1445,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_
UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_MaglevLbConfig *ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig *envoy_config_cluster_v3_Cluster_MaglevLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_MaglevLbConfig *ret = envoy_config_cluster_v3_Cluster_MaglevLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_MaglevLbConfig_serialize(const envoy_config_cluster_v3_Cluster_MaglevLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, arena, len);
@@ -1241,13 +1488,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_clu
UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *ret = envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_serialize(const envoy_config_cluster_v3_Cluster_OriginalDstLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, arena, len);
@@ -1267,13 +1520,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, arena, len);
@@ -1377,13 +1636,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *env
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, arena, len);
@@ -1433,13 +1698,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConf
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, arena, len);
@@ -1455,13 +1726,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbCon
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *ret = envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_serialize(const envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, arena, len);
@@ -1496,13 +1773,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_
UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_RefreshRate *ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate *envoy_config_cluster_v3_Cluster_RefreshRate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_RefreshRate *ret = envoy_config_cluster_v3_Cluster_RefreshRate_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_RefreshRate_serialize(const envoy_config_cluster_v3_Cluster_RefreshRate *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, arena, len);
@@ -1548,13 +1831,19 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluste
UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Cluster_PreconnectPolicy *ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy *envoy_config_cluster_v3_Cluster_PreconnectPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Cluster_PreconnectPolicy *ret = envoy_config_cluster_v3_Cluster_PreconnectPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Cluster_PreconnectPolicy_serialize(const envoy_config_cluster_v3_Cluster_PreconnectPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, arena, len);
@@ -1618,13 +1907,19 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_
UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_LoadBalancingPolicy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy *envoy_config_cluster_v3_LoadBalancingPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_LoadBalancingPolicy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, arena, len);
@@ -1655,35 +1950,37 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_clus
UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_LoadBalancingPolicy_Policy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_LoadBalancingPolicy_Policy *ret = envoy_config_cluster_v3_LoadBalancingPolicy_Policy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_LoadBalancingPolicy_Policy_serialize(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, arena, len);
}
-UPB_INLINE upb_strview envoy_config_cluster_v3_LoadBalancingPolicy_Policy_name(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Any*); }
+UPB_INLINE bool envoy_config_cluster_v3_LoadBalancingPolicy_Policy_has_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(const envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_name(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct google_protobuf_Any* value) {
+UPB_INLINE void envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Any*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_config(msg);
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_cluster_v3_LoadBalancingPolicy_Policy_mutable_typed_extension_config(envoy_config_cluster_v3_LoadBalancingPolicy_Policy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_cluster_v3_LoadBalancingPolicy_Policy_typed_extension_config(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
if (!sub) return NULL;
- envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_config(msg, sub);
+ envoy_config_cluster_v3_LoadBalancingPolicy_Policy_set_typed_extension_config(msg, sub);
}
return sub;
}
@@ -1696,13 +1993,19 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_U
UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_UpstreamBindConfig *ret = envoy_config_cluster_v3_UpstreamBindConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig *envoy_config_cluster_v3_UpstreamBindConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_UpstreamBindConfig *ret = envoy_config_cluster_v3_UpstreamBindConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_UpstreamBindConfig_serialize(const envoy_config_cluster_v3_UpstreamBindConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, arena, len);
@@ -1733,13 +2036,19 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_clust
UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_UpstreamConnectionOptions *ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions *envoy_config_cluster_v3_UpstreamConnectionOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_UpstreamConnectionOptions *ret = envoy_config_cluster_v3_UpstreamConnectionOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_UpstreamConnectionOptions_serialize(const envoy_config_cluster_v3_UpstreamConnectionOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, arena, len);
@@ -1770,13 +2079,19 @@ UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_Tr
UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_TrackClusterStats *ret = envoy_config_cluster_v3_TrackClusterStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_TrackClusterStats *envoy_config_cluster_v3_TrackClusterStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_TrackClusterStats *ret = envoy_config_cluster_v3_TrackClusterStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_TrackClusterStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_TrackClusterStats_serialize(const envoy_config_cluster_v3_TrackClusterStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, arena, len);
@@ -1792,6 +2107,8 @@ UPB_INLINE void envoy_config_cluster_v3_TrackClusterStats_set_request_response_s
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+extern const upb_msglayout_file envoy_config_cluster_v3_cluster_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
index 14230149e51..87bc9447ab4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/filter.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,30 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_Filter_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_Filter_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_Filter__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_Filter_msginit = {
&envoy_config_cluster_v3_Filter_submsgs[0],
&envoy_config_cluster_v3_Filter__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_cluster_v3_Filter_msginit,
+};
+
+const upb_msglayout_file envoy_config_cluster_v3_filter_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
index 1850b2a5504..45c5c86b30a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_FILTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_new(up
UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_Filter *ret = envoy_config_cluster_v3_Filter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_Filter *envoy_config_cluster_v3_Filter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_Filter *ret = envoy_config_cluster_v3_Filter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_Filter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_Filter_serialize(const envoy_config_cluster_v3_Filter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_Filter_msginit, arena, len);
@@ -68,6 +74,8 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_cluster_v3_Filter_mutable_ty
return sub;
}
+extern const upb_msglayout_file envoy_config_cluster_v3_filter_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
index f90563f1e70..953e0718c8e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/cluster/v3/outlier_detection.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -17,39 +17,50 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_cluster_v3_OutlierDetection_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_cluster_v3_OutlierDetection_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_cluster_v3_OutlierDetection__fields[21] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 48), 6, 1, 11, 1},
- {7, UPB_SIZE(28, 56), 7, 1, 11, 1},
- {8, UPB_SIZE(32, 64), 8, 1, 11, 1},
- {9, UPB_SIZE(36, 72), 9, 1, 11, 1},
- {10, UPB_SIZE(40, 80), 10, 1, 11, 1},
- {11, UPB_SIZE(44, 88), 11, 1, 11, 1},
- {12, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {13, UPB_SIZE(48, 96), 12, 1, 11, 1},
- {14, UPB_SIZE(52, 104), 13, 1, 11, 1},
- {15, UPB_SIZE(56, 112), 14, 1, 11, 1},
- {16, UPB_SIZE(60, 120), 15, 1, 11, 1},
- {17, UPB_SIZE(64, 128), 16, 1, 11, 1},
- {18, UPB_SIZE(68, 136), 17, 1, 11, 1},
- {19, UPB_SIZE(72, 144), 18, 1, 11, 1},
- {20, UPB_SIZE(76, 152), 19, 1, 11, 1},
- {21, UPB_SIZE(80, 160), 20, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 48), 6, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 56), 7, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(32, 64), 8, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(36, 72), 9, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(40, 80), 10, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(44, 88), 11, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(48, 96), 12, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(52, 104), 13, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(56, 112), 14, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(60, 120), 15, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(64, 128), 16, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(68, 136), 17, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(72, 144), 18, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(76, 152), 19, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(80, 160), 20, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit = {
&envoy_config_cluster_v3_OutlierDetection_submsgs[0],
&envoy_config_cluster_v3_OutlierDetection__fields[0],
- UPB_SIZE(88, 168), 21, false, 255,
+ UPB_SIZE(88, 168), 21, _UPB_MSGEXT_NONE, 21, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_cluster_v3_OutlierDetection_msginit,
+};
+
+const upb_msglayout_file envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
index 70b76232628..ff3e3beb5a0 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
#define ENVOY_CONFIG_CLUSTER_V3_OUTLIER_DETECTION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,13 +37,19 @@ UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_Out
UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_cluster_v3_OutlierDetection *ret = envoy_config_cluster_v3_OutlierDetection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_cluster_v3_OutlierDetection *envoy_config_cluster_v3_OutlierDetection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_cluster_v3_OutlierDetection *ret = envoy_config_cluster_v3_OutlierDetection_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_cluster_v3_OutlierDetection_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_cluster_v3_OutlierDetection_serialize(const envoy_config_cluster_v3_OutlierDetection *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, arena, len);
@@ -355,6 +361,8 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_cluster_v3_OutlierDetec
return sub;
}
+extern const upb_msglayout_file envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
index 048fc05035d..b76faf92db9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -18,106 +18,123 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_config_core_v3_Pipe__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Pipe_msginit = {
NULL,
&envoy_config_core_v3_Pipe__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit = {
NULL,
&envoy_config_core_v3_EnvoyInternalAddress__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_SocketAddress__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 13, 1},
- {4, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 9, 1},
- {5, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(-33, -57), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_SocketAddress_msginit = {
NULL,
&envoy_config_core_v3_SocketAddress__fields[0],
- UPB_SIZE(40, 64), 6, false, 255,
+ UPB_SIZE(40, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_TcpKeepalive_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_TcpKeepalive_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_TcpKeepalive__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit = {
&envoy_config_core_v3_TcpKeepalive_submsgs[0],
&envoy_config_core_v3_TcpKeepalive__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_BindConfig_submsgs[3] = {
- &envoy_config_core_v3_SocketAddress_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_BindConfig_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_SocketAddress_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_BindConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 1, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_BindConfig_msginit = {
&envoy_config_core_v3_BindConfig_submsgs[0],
&envoy_config_core_v3_BindConfig__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Address_submsgs[3] = {
- &envoy_config_core_v3_EnvoyInternalAddress_msginit,
- &envoy_config_core_v3_Pipe_msginit,
- &envoy_config_core_v3_SocketAddress_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Address_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_EnvoyInternalAddress_msginit},
+ {.submsg = &envoy_config_core_v3_Pipe_msginit},
+ {.submsg = &envoy_config_core_v3_SocketAddress_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Address__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Address_msginit = {
&envoy_config_core_v3_Address_submsgs[0],
&envoy_config_core_v3_Address__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_CidrRange_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_CidrRange_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_CidrRange__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_CidrRange_msginit = {
&envoy_config_core_v3_CidrRange_submsgs[0],
&envoy_config_core_v3_CidrRange__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[7] = {
+ &envoy_config_core_v3_Pipe_msginit,
+ &envoy_config_core_v3_EnvoyInternalAddress_msginit,
+ &envoy_config_core_v3_SocketAddress_msginit,
+ &envoy_config_core_v3_TcpKeepalive_msginit,
+ &envoy_config_core_v3_BindConfig_msginit,
+ &envoy_config_core_v3_Address_msginit,
+ &envoy_config_core_v3_CidrRange_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_address_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 7,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
index c8fdbee29ee..cdaf559fde5 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_ADDRESS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -62,13 +62,19 @@ UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_new(upb_arena *a
UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Pipe *ret = envoy_config_core_v3_Pipe_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Pipe *envoy_config_core_v3_Pipe_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Pipe *ret = envoy_config_core_v3_Pipe_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Pipe_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Pipe_serialize(const envoy_config_core_v3_Pipe *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Pipe_msginit, arena, len);
@@ -92,13 +98,19 @@ UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_Envoy
UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_EnvoyInternalAddress *ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress *envoy_config_core_v3_EnvoyInternalAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_EnvoyInternalAddress *ret = envoy_config_core_v3_EnvoyInternalAddress_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_EnvoyInternalAddress_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_EnvoyInternalAddress_serialize(const envoy_config_core_v3_EnvoyInternalAddress *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, arena, len);
@@ -125,13 +137,19 @@ UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddres
UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_SocketAddress *ret = envoy_config_core_v3_SocketAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_SocketAddress *envoy_config_core_v3_SocketAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_SocketAddress *ret = envoy_config_core_v3_SocketAddress_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_SocketAddress_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_SocketAddress_serialize(const envoy_config_core_v3_SocketAddress *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_SocketAddress_msginit, arena, len);
@@ -180,13 +198,19 @@ UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_
UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_TcpKeepalive *ret = envoy_config_core_v3_TcpKeepalive_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_TcpKeepalive *envoy_config_core_v3_TcpKeepalive_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_TcpKeepalive *ret = envoy_config_core_v3_TcpKeepalive_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_TcpKeepalive_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_TcpKeepalive_serialize(const envoy_config_core_v3_TcpKeepalive *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, arena, len);
@@ -247,13 +271,19 @@ UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_new(
UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_BindConfig *ret = envoy_config_core_v3_BindConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_BindConfig *envoy_config_core_v3_BindConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_BindConfig *ret = envoy_config_core_v3_BindConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_BindConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_BindConfig_serialize(const envoy_config_core_v3_BindConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_BindConfig_msginit, arena, len);
@@ -314,13 +344,19 @@ UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_new(upb_ar
UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Address *ret = envoy_config_core_v3_Address_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Address *envoy_config_core_v3_Address_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Address *ret = envoy_config_core_v3_Address_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Address_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Address_serialize(const envoy_config_core_v3_Address *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Address_msginit, arena, len);
@@ -386,13 +422,19 @@ UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_new(up
UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_CidrRange *ret = envoy_config_core_v3_CidrRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_CidrRange *envoy_config_core_v3_CidrRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_CidrRange *ret = envoy_config_core_v3_CidrRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_CidrRange_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_CidrRange_serialize(const envoy_config_core_v3_CidrRange *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_CidrRange_msginit, arena, len);
@@ -419,6 +461,8 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_CidrRange_mu
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_address_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
index 8e1174d7a9f..7df834afe64 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/backoff.upb.h"
#include "google/protobuf/duration.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,30 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_BackoffStrategy_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_BackoffStrategy_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_BackoffStrategy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit = {
&envoy_config_core_v3_BackoffStrategy_submsgs[0],
&envoy_config_core_v3_BackoffStrategy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_BackoffStrategy_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_backoff_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
index 3601c66cf9d..af78f064d2b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_BACKOFF_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStr
UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_BackoffStrategy *ret = envoy_config_core_v3_BackoffStrategy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_BackoffStrategy *envoy_config_core_v3_BackoffStrategy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_BackoffStrategy *ret = envoy_config_core_v3_BackoffStrategy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_BackoffStrategy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_BackoffStrategy_serialize(const envoy_config_core_v3_BackoffStrategy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, arena, len);
@@ -79,6 +85,8 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_BackoffStrategy
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_backoff_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
index 0baf9e98b6f..f8e37c8d65f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/backoff.upb.h"
@@ -17,6 +17,8 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/struct.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "xds/core/v3/context_params.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -25,309 +27,389 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_config_core_v3_Locality__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Locality_msginit = {
NULL,
&envoy_config_core_v3_Locality__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_BuildVersion_submsgs[2] = {
- &envoy_type_v3_SemanticVersion_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_BuildVersion_submsgs[2] = {
+ {.submsg = &envoy_type_v3_SemanticVersion_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_BuildVersion__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_BuildVersion_msginit = {
&envoy_config_core_v3_BuildVersion_submsgs[0],
&envoy_config_core_v3_BuildVersion__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Extension_submsgs[1] = {
- &envoy_config_core_v3_BuildVersion_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Extension_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_BuildVersion_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Extension__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {4, UPB_SIZE(28, 56), 1, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Extension_msginit = {
&envoy_config_core_v3_Extension_submsgs[0],
&envoy_config_core_v3_Extension__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Node_submsgs[5] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_BuildVersion_msginit,
- &envoy_config_core_v3_Extension_msginit,
- &envoy_config_core_v3_Locality_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Node_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_BuildVersion_msginit},
+ {.submsg = &envoy_config_core_v3_Extension_msginit},
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_core_v3_Node_DynamicParametersEntry_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Node__fields[10] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 56), 1, 4, 11, 1},
- {4, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {7, UPB_SIZE(48, 96), UPB_SIZE(-57, -113), 0, 9, 1},
- {8, UPB_SIZE(48, 96), UPB_SIZE(-57, -113), 1, 11, 1},
- {9, UPB_SIZE(36, 72), 0, 2, 11, 3},
- {10, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {11, UPB_SIZE(44, 88), 0, 0, 11, 3},
+static const upb_msglayout_field envoy_config_core_v3_Node__fields[11] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), 1, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 64), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(52, 104), UPB_SIZE(-61, -121), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(52, 104), UPB_SIZE(-61, -121), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(36, 72), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(40, 80), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(44, 88), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(48, 96), 0, 4, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Node_msginit = {
&envoy_config_core_v3_Node_submsgs[0],
&envoy_config_core_v3_Node__fields[0],
- UPB_SIZE(64, 128), 10, false, 255,
+ UPB_SIZE(64, 128), 11, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Metadata_submsgs[1] = {
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Node_DynamicParametersEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_Node_DynamicParametersEntry_msginit = {
+ &envoy_config_core_v3_Node_DynamicParametersEntry_submsgs[0],
+ &envoy_config_core_v3_Node_DynamicParametersEntry__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_Metadata_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Metadata__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+static const upb_msglayout_field envoy_config_core_v3_Metadata__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Metadata_msginit = {
&envoy_config_core_v3_Metadata_submsgs[0],
&envoy_config_core_v3_Metadata__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit = {
&envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[0],
&envoy_config_core_v3_Metadata_FilterMetadataEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit = {
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_submsgs[0],
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_RuntimeUInt32__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit = {
NULL,
&envoy_config_core_v3_RuntimeUInt32__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimePercent_submsgs[1] = {
- &envoy_type_v3_Percent_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RuntimePercent_submsgs[1] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RuntimePercent__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RuntimePercent_msginit = {
&envoy_config_core_v3_RuntimePercent_submsgs[0],
&envoy_config_core_v3_RuntimePercent__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_RuntimeDouble__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit = {
NULL,
&envoy_config_core_v3_RuntimeDouble__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RuntimeFeatureFlag_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RuntimeFeatureFlag__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit = {
&envoy_config_core_v3_RuntimeFeatureFlag_submsgs[0],
&envoy_config_core_v3_RuntimeFeatureFlag__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_QueryParameter__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_QueryParameter_msginit = {
+ NULL,
+ &envoy_config_core_v3_QueryParameter__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_HeaderValue__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HeaderValue_msginit = {
NULL,
&envoy_config_core_v3_HeaderValue__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_HeaderValueOption_submsgs[2] = {
- &envoy_config_core_v3_HeaderValue_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HeaderValueOption_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_HeaderValue_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HeaderValueOption__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+static const upb_msglayout_field envoy_config_core_v3_HeaderValueOption__fields[3] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit = {
&envoy_config_core_v3_HeaderValueOption_submsgs[0],
&envoy_config_core_v3_HeaderValueOption__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_HeaderMap_submsgs[1] = {
- &envoy_config_core_v3_HeaderValue_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HeaderMap_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_HeaderValue_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_HeaderMap__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HeaderMap_msginit = {
&envoy_config_core_v3_HeaderMap_submsgs[0],
&envoy_config_core_v3_HeaderMap__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_WatchedDirectory__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_WatchedDirectory_msginit = {
NULL,
&envoy_config_core_v3_WatchedDirectory__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_DataSource__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_DataSource_msginit = {
NULL,
&envoy_config_core_v3_DataSource__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RetryPolicy_submsgs[2] = {
- &envoy_config_core_v3_BackoffStrategy_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RetryPolicy_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_BackoffStrategy_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RetryPolicy__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit = {
&envoy_config_core_v3_RetryPolicy_submsgs[0],
&envoy_config_core_v3_RetryPolicy__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RemoteDataSource_submsgs[2] = {
- &envoy_config_core_v3_HttpUri_msginit,
- &envoy_config_core_v3_RetryPolicy_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RemoteDataSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_HttpUri_msginit},
+ {.submsg = &envoy_config_core_v3_RetryPolicy_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RemoteDataSource__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit = {
&envoy_config_core_v3_RemoteDataSource_submsgs[0],
&envoy_config_core_v3_RemoteDataSource__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_AsyncDataSource_submsgs[2] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_RemoteDataSource_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_AsyncDataSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_RemoteDataSource_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_AsyncDataSource__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit = {
&envoy_config_core_v3_AsyncDataSource_submsgs[0],
&envoy_config_core_v3_AsyncDataSource__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_TransportSocket_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_TransportSocket_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_TransportSocket__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_TransportSocket_msginit = {
&envoy_config_core_v3_TransportSocket_submsgs[0],
&envoy_config_core_v3_TransportSocket__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RuntimeFractionalPercent__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit = {
&envoy_config_core_v3_RuntimeFractionalPercent_submsgs[0],
&envoy_config_core_v3_RuntimeFractionalPercent__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_ControlPlane__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_ControlPlane_msginit = {
NULL,
&envoy_config_core_v3_ControlPlane__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[24] = {
+ &envoy_config_core_v3_Locality_msginit,
+ &envoy_config_core_v3_BuildVersion_msginit,
+ &envoy_config_core_v3_Extension_msginit,
+ &envoy_config_core_v3_Node_msginit,
+ &envoy_config_core_v3_Node_DynamicParametersEntry_msginit,
+ &envoy_config_core_v3_Metadata_msginit,
+ &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
+ &envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit,
+ &envoy_config_core_v3_RuntimeUInt32_msginit,
+ &envoy_config_core_v3_RuntimePercent_msginit,
+ &envoy_config_core_v3_RuntimeDouble_msginit,
+ &envoy_config_core_v3_RuntimeFeatureFlag_msginit,
+ &envoy_config_core_v3_QueryParameter_msginit,
+ &envoy_config_core_v3_HeaderValue_msginit,
+ &envoy_config_core_v3_HeaderValueOption_msginit,
+ &envoy_config_core_v3_HeaderMap_msginit,
+ &envoy_config_core_v3_WatchedDirectory_msginit,
+ &envoy_config_core_v3_DataSource_msginit,
+ &envoy_config_core_v3_RetryPolicy_msginit,
+ &envoy_config_core_v3_RemoteDataSource_msginit,
+ &envoy_config_core_v3_AsyncDataSource_msginit,
+ &envoy_config_core_v3_TransportSocket_msginit,
+ &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
+ &envoy_config_core_v3_ControlPlane_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_base_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 24,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
index bfb4fd4d58f..7ef26d51443 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_BASE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,12 +24,15 @@ struct envoy_config_core_v3_Locality;
struct envoy_config_core_v3_BuildVersion;
struct envoy_config_core_v3_Extension;
struct envoy_config_core_v3_Node;
+struct envoy_config_core_v3_Node_DynamicParametersEntry;
struct envoy_config_core_v3_Metadata;
struct envoy_config_core_v3_Metadata_FilterMetadataEntry;
+struct envoy_config_core_v3_Metadata_TypedFilterMetadataEntry;
struct envoy_config_core_v3_RuntimeUInt32;
struct envoy_config_core_v3_RuntimePercent;
struct envoy_config_core_v3_RuntimeDouble;
struct envoy_config_core_v3_RuntimeFeatureFlag;
+struct envoy_config_core_v3_QueryParameter;
struct envoy_config_core_v3_HeaderValue;
struct envoy_config_core_v3_HeaderValueOption;
struct envoy_config_core_v3_HeaderMap;
@@ -45,12 +48,15 @@ typedef struct envoy_config_core_v3_Locality envoy_config_core_v3_Locality;
typedef struct envoy_config_core_v3_BuildVersion envoy_config_core_v3_BuildVersion;
typedef struct envoy_config_core_v3_Extension envoy_config_core_v3_Extension;
typedef struct envoy_config_core_v3_Node envoy_config_core_v3_Node;
+typedef struct envoy_config_core_v3_Node_DynamicParametersEntry envoy_config_core_v3_Node_DynamicParametersEntry;
typedef struct envoy_config_core_v3_Metadata envoy_config_core_v3_Metadata;
typedef struct envoy_config_core_v3_Metadata_FilterMetadataEntry envoy_config_core_v3_Metadata_FilterMetadataEntry;
+typedef struct envoy_config_core_v3_Metadata_TypedFilterMetadataEntry envoy_config_core_v3_Metadata_TypedFilterMetadataEntry;
typedef struct envoy_config_core_v3_RuntimeUInt32 envoy_config_core_v3_RuntimeUInt32;
typedef struct envoy_config_core_v3_RuntimePercent envoy_config_core_v3_RuntimePercent;
typedef struct envoy_config_core_v3_RuntimeDouble envoy_config_core_v3_RuntimeDouble;
typedef struct envoy_config_core_v3_RuntimeFeatureFlag envoy_config_core_v3_RuntimeFeatureFlag;
+typedef struct envoy_config_core_v3_QueryParameter envoy_config_core_v3_QueryParameter;
typedef struct envoy_config_core_v3_HeaderValue envoy_config_core_v3_HeaderValue;
typedef struct envoy_config_core_v3_HeaderValueOption envoy_config_core_v3_HeaderValueOption;
typedef struct envoy_config_core_v3_HeaderMap envoy_config_core_v3_HeaderMap;
@@ -66,12 +72,15 @@ extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
extern const upb_msglayout envoy_config_core_v3_BuildVersion_msginit;
extern const upb_msglayout envoy_config_core_v3_Extension_msginit;
extern const upb_msglayout envoy_config_core_v3_Node_msginit;
+extern const upb_msglayout envoy_config_core_v3_Node_DynamicParametersEntry_msginit;
extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
extern const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit;
+extern const upb_msglayout envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_msginit;
extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
extern const upb_msglayout envoy_config_core_v3_RuntimePercent_msginit;
extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
extern const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit;
+extern const upb_msglayout envoy_config_core_v3_QueryParameter_msginit;
extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
extern const upb_msglayout envoy_config_core_v3_HeaderMap_msginit;
@@ -93,6 +102,7 @@ struct google_protobuf_Any;
struct google_protobuf_BoolValue;
struct google_protobuf_Struct;
struct google_protobuf_UInt32Value;
+struct xds_core_v3_ContextParams;
extern const upb_msglayout envoy_config_core_v3_Address_msginit;
extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
@@ -103,6 +113,13 @@ extern const upb_msglayout google_protobuf_Any_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
extern const upb_msglayout google_protobuf_Struct_msginit;
extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+extern const upb_msglayout xds_core_v3_ContextParams_msginit;
+
+typedef enum {
+ envoy_config_core_v3_HeaderValueOption_APPEND_IF_EXISTS_OR_ADD = 0,
+ envoy_config_core_v3_HeaderValueOption_ADD_IF_ABSENT = 1,
+ envoy_config_core_v3_HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD = 2
+} envoy_config_core_v3_HeaderValueOption_HeaderAppendAction;
typedef enum {
envoy_config_core_v3_METHOD_UNSPECIFIED = 0,
@@ -137,13 +154,19 @@ UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_new(upb_
UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Locality *ret = envoy_config_core_v3_Locality_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Locality *envoy_config_core_v3_Locality_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Locality *ret = envoy_config_core_v3_Locality_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Locality_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Locality_serialize(const envoy_config_core_v3_Locality *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Locality_msginit, arena, len);
@@ -171,13 +194,19 @@ UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_
UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_BuildVersion *ret = envoy_config_core_v3_BuildVersion_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_BuildVersion *envoy_config_core_v3_BuildVersion_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_BuildVersion *ret = envoy_config_core_v3_BuildVersion_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_BuildVersion_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_BuildVersion_serialize(const envoy_config_core_v3_BuildVersion *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_BuildVersion_msginit, arena, len);
@@ -223,13 +252,19 @@ UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_new(up
UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Extension *ret = envoy_config_core_v3_Extension_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Extension *envoy_config_core_v3_Extension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Extension *ret = envoy_config_core_v3_Extension_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Extension_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Extension_serialize(const envoy_config_core_v3_Extension *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Extension_msginit, arena, len);
@@ -276,13 +311,19 @@ UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_new(upb_arena *a
UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Node *ret = envoy_config_core_v3_Node_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Node *envoy_config_core_v3_Node_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Node *ret = envoy_config_core_v3_Node_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Node_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Node_serialize(const envoy_config_core_v3_Node *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Node_msginit, arena, len);
@@ -293,7 +334,7 @@ typedef enum {
envoy_config_core_v3_Node_user_agent_version_type_user_agent_build_version = 8,
envoy_config_core_v3_Node_user_agent_version_type_NOT_SET = 0
} envoy_config_core_v3_Node_user_agent_version_type_oneofcases;
-UPB_INLINE envoy_config_core_v3_Node_user_agent_version_type_oneofcases envoy_config_core_v3_Node_user_agent_version_type_case(const envoy_config_core_v3_Node* msg) { return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(56, 112), int32_t); }
+UPB_INLINE envoy_config_core_v3_Node_user_agent_version_type_oneofcases envoy_config_core_v3_Node_user_agent_version_type_case(const envoy_config_core_v3_Node* msg) { return (envoy_config_core_v3_Node_user_agent_version_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(60, 120), int32_t); }
UPB_INLINE upb_strview envoy_config_core_v3_Node_id(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE upb_strview envoy_config_core_v3_Node_cluster(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
@@ -302,15 +343,19 @@ UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_Node_metada
UPB_INLINE bool envoy_config_core_v3_Node_has_locality(const envoy_config_core_v3_Node *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const envoy_config_core_v3_Locality* envoy_config_core_v3_Node_locality(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 64), const envoy_config_core_v3_Locality*); }
UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_name(const envoy_config_core_v3_Node *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(56, 112)) == 7; }
-UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(48, 96), UPB_SIZE(56, 112), 7, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(56, 112)) == 8; }
-UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_BuildVersion*, UPB_SIZE(48, 96), UPB_SIZE(56, 112), 8, NULL); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(60, 120)) == 7; }
+UPB_INLINE upb_strview envoy_config_core_v3_Node_user_agent_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(52, 104), UPB_SIZE(60, 120), 7, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return _upb_getoneofcase(msg, UPB_SIZE(60, 120)) == 8; }
+UPB_INLINE const envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_user_agent_build_version(const envoy_config_core_v3_Node *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_BuildVersion*, UPB_SIZE(52, 104), UPB_SIZE(60, 120), 8, NULL); }
UPB_INLINE bool envoy_config_core_v3_Node_has_extensions(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
UPB_INLINE const envoy_config_core_v3_Extension* const* envoy_config_core_v3_Node_extensions(const envoy_config_core_v3_Node *msg, size_t *len) { return (const envoy_config_core_v3_Extension* const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
UPB_INLINE upb_strview const* envoy_config_core_v3_Node_client_features(const envoy_config_core_v3_Node *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
UPB_INLINE bool envoy_config_core_v3_Node_has_listening_addresses(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_Node_listening_addresses(const envoy_config_core_v3_Node *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(44, 88), len); }
+UPB_INLINE bool envoy_config_core_v3_Node_has_dynamic_parameters(const envoy_config_core_v3_Node *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE size_t envoy_config_core_v3_Node_dynamic_parameters_size(const envoy_config_core_v3_Node *msg) {return _upb_msg_map_size(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_get(const envoy_config_core_v3_Node *msg, upb_strview key, struct xds_core_v3_ContextParams* *val) { return _upb_msg_map_get(msg, UPB_SIZE(48, 96), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_next(const envoy_config_core_v3_Node *msg, size_t* iter) { return (const envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(48, 96), iter); }
UPB_INLINE void envoy_config_core_v3_Node_set_id(envoy_config_core_v3_Node *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
@@ -348,10 +393,10 @@ UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_name(envoy_config_core_
*UPB_PTR_AT(msg, UPB_SIZE(20, 40), upb_strview) = value;
}
UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_version(envoy_config_core_v3_Node *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(48, 96), value, UPB_SIZE(56, 112), 7);
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(52, 104), value, UPB_SIZE(60, 120), 7);
}
UPB_INLINE void envoy_config_core_v3_Node_set_user_agent_build_version(envoy_config_core_v3_Node *msg, envoy_config_core_v3_BuildVersion* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(48, 96), value, UPB_SIZE(56, 112), 8);
+ UPB_WRITE_ONEOF(msg, envoy_config_core_v3_BuildVersion*, UPB_SIZE(52, 104), value, UPB_SIZE(60, 120), 8);
}
UPB_INLINE struct envoy_config_core_v3_BuildVersion* envoy_config_core_v3_Node_mutable_user_agent_build_version(envoy_config_core_v3_Node *msg, upb_arena *arena) {
struct envoy_config_core_v3_BuildVersion* sub = (struct envoy_config_core_v3_BuildVersion*)envoy_config_core_v3_Node_user_agent_build_version(msg);
@@ -398,6 +443,28 @@ UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_Node_add_li
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_core_v3_Node_dynamic_parameters_clear(envoy_config_core_v3_Node *msg) { _upb_msg_map_clear(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_set(envoy_config_core_v3_Node *msg, upb_strview key, struct xds_core_v3_ContextParams* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(48, 96), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_core_v3_Node_dynamic_parameters_delete(envoy_config_core_v3_Node *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(48, 96), &key, 0); }
+UPB_INLINE envoy_config_core_v3_Node_DynamicParametersEntry* envoy_config_core_v3_Node_dynamic_parameters_nextmutable(envoy_config_core_v3_Node *msg, size_t* iter) { return (envoy_config_core_v3_Node_DynamicParametersEntry*)_upb_msg_map_next(msg, UPB_SIZE(48, 96), iter); }
+
+/* envoy.config.core.v3.Node.DynamicParametersEntry */
+
+UPB_INLINE upb_strview envoy_config_core_v3_Node_DynamicParametersEntry_key(const envoy_config_core_v3_Node_DynamicParametersEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_core_v3_Node_DynamicParametersEntry_has_value(const envoy_config_core_v3_Node_DynamicParametersEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct xds_core_v3_ContextParams* envoy_config_core_v3_Node_DynamicParametersEntry_value(const envoy_config_core_v3_Node_DynamicParametersEntry *msg) {
+ struct xds_core_v3_ContextParams* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_core_v3_Node_DynamicParametersEntry_set_value(envoy_config_core_v3_Node_DynamicParametersEntry *msg, struct xds_core_v3_ContextParams* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct xds_core_v3_ContextParams*));
+}
/* envoy.config.core.v3.Metadata */
@@ -407,13 +474,19 @@ UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_new(upb_
UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Metadata *ret = envoy_config_core_v3_Metadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Metadata *envoy_config_core_v3_Metadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Metadata *ret = envoy_config_core_v3_Metadata_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Metadata_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Metadata_serialize(const envoy_config_core_v3_Metadata *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Metadata_msginit, arena, len);
@@ -423,11 +496,19 @@ UPB_INLINE bool envoy_config_core_v3_Metadata_has_filter_metadata(const envoy_co
UPB_INLINE size_t envoy_config_core_v3_Metadata_filter_metadata_size(const envoy_config_core_v3_Metadata *msg) {return _upb_msg_map_size(msg, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_get(const envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* *val) { return _upb_msg_map_get(msg, UPB_SIZE(0, 0), &key, 0, val, sizeof(*val)); }
UPB_INLINE const envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_next(const envoy_config_core_v3_Metadata *msg, size_t* iter) { return (const envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_has_typed_filter_metadata(const envoy_config_core_v3_Metadata *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE size_t envoy_config_core_v3_Metadata_typed_filter_metadata_size(const envoy_config_core_v3_Metadata *msg) {return _upb_msg_map_size(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_get(const envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(4, 8), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_next(const envoy_config_core_v3_Metadata *msg, size_t* iter) { return (const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); }
UPB_INLINE void envoy_config_core_v3_Metadata_filter_metadata_clear(envoy_config_core_v3_Metadata *msg) { _upb_msg_map_clear(msg, UPB_SIZE(0, 0)); }
UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_set(envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Struct* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(0, 0), &key, 0, &val, sizeof(val), a); }
UPB_INLINE bool envoy_config_core_v3_Metadata_filter_metadata_delete(envoy_config_core_v3_Metadata *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(0, 0), &key, 0); }
UPB_INLINE envoy_config_core_v3_Metadata_FilterMetadataEntry* envoy_config_core_v3_Metadata_filter_metadata_nextmutable(envoy_config_core_v3_Metadata *msg, size_t* iter) { return (envoy_config_core_v3_Metadata_FilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(0, 0), iter); }
+UPB_INLINE void envoy_config_core_v3_Metadata_typed_filter_metadata_clear(envoy_config_core_v3_Metadata *msg) { _upb_msg_map_clear(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_set(envoy_config_core_v3_Metadata *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(4, 8), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_core_v3_Metadata_typed_filter_metadata_delete(envoy_config_core_v3_Metadata *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(4, 8), &key, 0); }
+UPB_INLINE envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* envoy_config_core_v3_Metadata_typed_filter_metadata_nextmutable(envoy_config_core_v3_Metadata *msg, size_t* iter) { return (envoy_config_core_v3_Metadata_TypedFilterMetadataEntry*)_upb_msg_map_next(msg, UPB_SIZE(4, 8), iter); }
/* envoy.config.core.v3.Metadata.FilterMetadataEntry */
@@ -447,6 +528,24 @@ UPB_INLINE void envoy_config_core_v3_Metadata_FilterMetadataEntry_set_value(envo
_upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Struct*));
}
+/* envoy.config.core.v3.Metadata.TypedFilterMetadataEntry */
+
+UPB_INLINE upb_strview envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_key(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE bool envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_has_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct google_protobuf_Any* envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_value(const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg) {
+ struct google_protobuf_Any* ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_set_value(envoy_config_core_v3_Metadata_TypedFilterMetadataEntry *msg, struct google_protobuf_Any* value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(struct google_protobuf_Any*));
+}
+
/* envoy.config.core.v3.RuntimeUInt32 */
UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_new(upb_arena *arena) {
@@ -455,13 +554,19 @@ UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt3
UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RuntimeUInt32 *ret = envoy_config_core_v3_RuntimeUInt32_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RuntimeUInt32 *envoy_config_core_v3_RuntimeUInt32_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RuntimeUInt32 *ret = envoy_config_core_v3_RuntimeUInt32_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeUInt32_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RuntimeUInt32_serialize(const envoy_config_core_v3_RuntimeUInt32 *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, arena, len);
@@ -485,13 +590,19 @@ UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePerc
UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePercent_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RuntimePercent *ret = envoy_config_core_v3_RuntimePercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RuntimePercent *envoy_config_core_v3_RuntimePercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RuntimePercent *ret = envoy_config_core_v3_RuntimePercent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimePercent_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RuntimePercent_serialize(const envoy_config_core_v3_RuntimePercent *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, arena, len);
@@ -526,13 +637,19 @@ UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDoubl
UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RuntimeDouble *ret = envoy_config_core_v3_RuntimeDouble_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RuntimeDouble *envoy_config_core_v3_RuntimeDouble_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RuntimeDouble *ret = envoy_config_core_v3_RuntimeDouble_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeDouble_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RuntimeDouble_serialize(const envoy_config_core_v3_RuntimeDouble *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, arena, len);
@@ -556,13 +673,19 @@ UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_Runtime
UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RuntimeFeatureFlag *ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag *envoy_config_core_v3_RuntimeFeatureFlag_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RuntimeFeatureFlag *ret = envoy_config_core_v3_RuntimeFeatureFlag_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RuntimeFeatureFlag_serialize(const envoy_config_core_v3_RuntimeFeatureFlag *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena, len);
@@ -589,6 +712,42 @@ UPB_INLINE void envoy_config_core_v3_RuntimeFeatureFlag_set_runtime_key(envoy_co
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
+/* envoy.config.core.v3.QueryParameter */
+
+UPB_INLINE envoy_config_core_v3_QueryParameter *envoy_config_core_v3_QueryParameter_new(upb_arena *arena) {
+ return (envoy_config_core_v3_QueryParameter *)_upb_msg_new(&envoy_config_core_v3_QueryParameter_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_QueryParameter *envoy_config_core_v3_QueryParameter_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_QueryParameter *ret = envoy_config_core_v3_QueryParameter_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_QueryParameter *envoy_config_core_v3_QueryParameter_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_QueryParameter *ret = envoy_config_core_v3_QueryParameter_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_QueryParameter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_QueryParameter_serialize(const envoy_config_core_v3_QueryParameter *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_QueryParameter_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_QueryParameter_key(const envoy_config_core_v3_QueryParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_config_core_v3_QueryParameter_value(const envoy_config_core_v3_QueryParameter *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_config_core_v3_QueryParameter_set_key(envoy_config_core_v3_QueryParameter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_QueryParameter_set_value(envoy_config_core_v3_QueryParameter *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
/* envoy.config.core.v3.HeaderValue */
UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_new(upb_arena *arena) {
@@ -597,13 +756,19 @@ UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_ne
UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HeaderValue *ret = envoy_config_core_v3_HeaderValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HeaderValue *envoy_config_core_v3_HeaderValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HeaderValue *ret = envoy_config_core_v3_HeaderValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HeaderValue_serialize(const envoy_config_core_v3_HeaderValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HeaderValue_msginit, arena, len);
@@ -627,26 +792,33 @@ UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderVa
UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HeaderValueOption *ret = envoy_config_core_v3_HeaderValueOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HeaderValueOption *envoy_config_core_v3_HeaderValueOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HeaderValueOption *ret = envoy_config_core_v3_HeaderValueOption_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderValueOption_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HeaderValueOption_serialize(const envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, arena, len);
}
UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_header(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_HeaderValue*); }
+UPB_INLINE const envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_header(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const envoy_config_core_v3_HeaderValue*); }
UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_append(const envoy_config_core_v3_HeaderValueOption *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_append(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_append(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE int32_t envoy_config_core_v3_HeaderValueOption_append_action(const envoy_config_core_v3_HeaderValueOption *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_header(envoy_config_core_v3_HeaderValueOption *msg, envoy_config_core_v3_HeaderValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_HeaderValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), envoy_config_core_v3_HeaderValue*) = value;
}
UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValueOption_mutable_header(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
struct envoy_config_core_v3_HeaderValue* sub = (struct envoy_config_core_v3_HeaderValue*)envoy_config_core_v3_HeaderValueOption_header(msg);
@@ -659,7 +831,7 @@ UPB_INLINE struct envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderV
}
UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append(envoy_config_core_v3_HeaderValueOption *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 16), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOption_mutable_append(envoy_config_core_v3_HeaderValueOption *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_HeaderValueOption_append(msg);
@@ -670,6 +842,9 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_HeaderValueOpt
}
return sub;
}
+UPB_INLINE void envoy_config_core_v3_HeaderValueOption_set_append_action(envoy_config_core_v3_HeaderValueOption *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
/* envoy.config.core.v3.HeaderMap */
@@ -679,13 +854,19 @@ UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_new(up
UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HeaderMap *ret = envoy_config_core_v3_HeaderMap_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HeaderMap *envoy_config_core_v3_HeaderMap_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HeaderMap *ret = envoy_config_core_v3_HeaderMap_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HeaderMap_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HeaderMap_serialize(const envoy_config_core_v3_HeaderMap *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HeaderMap_msginit, arena, len);
@@ -716,13 +897,19 @@ UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDi
UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDirectory_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_WatchedDirectory *ret = envoy_config_core_v3_WatchedDirectory_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_WatchedDirectory *envoy_config_core_v3_WatchedDirectory_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_WatchedDirectory *ret = envoy_config_core_v3_WatchedDirectory_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_WatchedDirectory_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_WatchedDirectory_serialize(const envoy_config_core_v3_WatchedDirectory *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, arena, len);
@@ -742,13 +929,19 @@ UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_new(
UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_DataSource *ret = envoy_config_core_v3_DataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_DataSource *envoy_config_core_v3_DataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_DataSource *ret = envoy_config_core_v3_DataSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_DataSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_DataSource_serialize(const envoy_config_core_v3_DataSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_DataSource_msginit, arena, len);
@@ -787,13 +980,19 @@ UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_ne
UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RetryPolicy *ret = envoy_config_core_v3_RetryPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RetryPolicy *envoy_config_core_v3_RetryPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RetryPolicy *ret = envoy_config_core_v3_RetryPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RetryPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RetryPolicy_serialize(const envoy_config_core_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, arena, len);
@@ -839,13 +1038,19 @@ UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDat
UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RemoteDataSource *ret = envoy_config_core_v3_RemoteDataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RemoteDataSource *envoy_config_core_v3_RemoteDataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RemoteDataSource *ret = envoy_config_core_v3_RemoteDataSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RemoteDataSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RemoteDataSource_serialize(const envoy_config_core_v3_RemoteDataSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, arena, len);
@@ -895,13 +1100,19 @@ UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataS
UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_AsyncDataSource *ret = envoy_config_core_v3_AsyncDataSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_AsyncDataSource *envoy_config_core_v3_AsyncDataSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_AsyncDataSource *ret = envoy_config_core_v3_AsyncDataSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_AsyncDataSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_AsyncDataSource_serialize(const envoy_config_core_v3_AsyncDataSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, arena, len);
@@ -952,13 +1163,19 @@ UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportS
UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_TransportSocket *ret = envoy_config_core_v3_TransportSocket_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_TransportSocket *envoy_config_core_v3_TransportSocket_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_TransportSocket *ret = envoy_config_core_v3_TransportSocket_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_TransportSocket_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_TransportSocket_serialize(const envoy_config_core_v3_TransportSocket *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_TransportSocket_msginit, arena, len);
@@ -998,13 +1215,19 @@ UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_R
UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RuntimeFractionalPercent *ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent *envoy_config_core_v3_RuntimeFractionalPercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RuntimeFractionalPercent *ret = envoy_config_core_v3_RuntimeFractionalPercent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RuntimeFractionalPercent_serialize(const envoy_config_core_v3_RuntimeFractionalPercent *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, arena, len);
@@ -1039,13 +1262,19 @@ UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_
UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_ControlPlane *ret = envoy_config_core_v3_ControlPlane_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_ControlPlane *envoy_config_core_v3_ControlPlane_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_ControlPlane *ret = envoy_config_core_v3_ControlPlane_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_ControlPlane_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_ControlPlane_serialize(const envoy_config_core_v3_ControlPlane *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_ControlPlane_msginit, arena, len);
@@ -1057,6 +1286,8 @@ UPB_INLINE void envoy_config_core_v3_ControlPlane_set_identifier(envoy_config_co
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+extern const upb_msglayout_file envoy_config_core_v3_base_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
index 30a2e754e92..f5aa413611f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/config_source.upb.h"
#include "envoy/config/core/v3/grpc_service.upb.h"
#include "google/protobuf/duration.upb.h"
@@ -20,83 +20,98 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_ApiConfigSource_submsgs[3] = {
- &envoy_config_core_v3_GrpcService_msginit,
- &envoy_config_core_v3_RateLimitSettings_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_ApiConfigSource_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
+ {.submsg = &envoy_config_core_v3_RateLimitSettings_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_ApiConfigSource__fields[8] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(28, 40), 0, 0, 9, 3},
- {3, UPB_SIZE(16, 16), 1, 2, 11, 1},
- {4, UPB_SIZE(32, 48), 0, 0, 11, 3},
- {5, UPB_SIZE(20, 24), 2, 2, 11, 1},
- {6, UPB_SIZE(24, 32), 3, 1, 11, 1},
- {7, UPB_SIZE(12, 12), 0, 0, 8, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 14, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(28, 40), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 48), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 24), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 32), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 12), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit = {
&envoy_config_core_v3_ApiConfigSource_submsgs[0],
&envoy_config_core_v3_ApiConfigSource__fields[0],
- UPB_SIZE(40, 56), 8, false, 255,
+ UPB_SIZE(40, 56), 8, _UPB_MSGEXT_NONE, 8, 255,
};
const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field envoy_config_core_v3_SelfConfigSource__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit = {
NULL,
&envoy_config_core_v3_SelfConfigSource__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
- &google_protobuf_DoubleValue_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_RateLimitSettings_submsgs[2] = {
+ {.submsg = &google_protobuf_DoubleValue_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_RateLimitSettings__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit = {
&envoy_config_core_v3_RateLimitSettings_submsgs[0],
&envoy_config_core_v3_RateLimitSettings__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_ConfigSource_submsgs[5] = {
- &envoy_config_core_v3_AggregatedConfigSource_msginit,
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_SelfConfigSource_msginit,
- &google_protobuf_Duration_msginit,
- &xds_core_v3_Authority_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_ConfigSource_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_AggregatedConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_ApiConfigSource_msginit},
+ {.submsg = &envoy_config_core_v3_SelfConfigSource_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &xds_core_v3_Authority_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_ConfigSource__fields[7] = {
- {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
- {2, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
- {3, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 11, 1},
- {4, UPB_SIZE(8, 8), 1, 3, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 2, 11, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {7, UPB_SIZE(12, 16), 0, 4, 11, 3},
+ {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 16), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_ConfigSource_msginit = {
&envoy_config_core_v3_ConfigSource_submsgs[0],
&envoy_config_core_v3_ConfigSource__fields[0],
- UPB_SIZE(32, 48), 7, false, 255,
+ UPB_SIZE(32, 48), 7, _UPB_MSGEXT_NONE, 7, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &envoy_config_core_v3_ApiConfigSource_msginit,
+ &envoy_config_core_v3_AggregatedConfigSource_msginit,
+ &envoy_config_core_v3_SelfConfigSource_msginit,
+ &envoy_config_core_v3_RateLimitSettings_msginit,
+ &envoy_config_core_v3_ConfigSource_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_config_source_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
index 1fc85348903..189f6ceca00 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_CONFIG_SOURCE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -70,13 +70,19 @@ UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigS
UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_ApiConfigSource *ret = envoy_config_core_v3_ApiConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_ApiConfigSource *envoy_config_core_v3_ApiConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_ApiConfigSource *ret = envoy_config_core_v3_ApiConfigSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_ApiConfigSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_ApiConfigSource_serialize(const envoy_config_core_v3_ApiConfigSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, arena, len);
@@ -175,13 +181,19 @@ UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_Agg
UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_AggregatedConfigSource *ret = envoy_config_core_v3_AggregatedConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_AggregatedConfigSource *envoy_config_core_v3_AggregatedConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_AggregatedConfigSource *ret = envoy_config_core_v3_AggregatedConfigSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_AggregatedConfigSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_AggregatedConfigSource_serialize(const envoy_config_core_v3_AggregatedConfigSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, arena, len);
@@ -197,13 +209,19 @@ UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfi
UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_SelfConfigSource *ret = envoy_config_core_v3_SelfConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_SelfConfigSource *envoy_config_core_v3_SelfConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_SelfConfigSource *ret = envoy_config_core_v3_SelfConfigSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_SelfConfigSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_SelfConfigSource_serialize(const envoy_config_core_v3_SelfConfigSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, arena, len);
@@ -223,13 +241,19 @@ UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimi
UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_RateLimitSettings *ret = envoy_config_core_v3_RateLimitSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_RateLimitSettings *envoy_config_core_v3_RateLimitSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_RateLimitSettings *ret = envoy_config_core_v3_RateLimitSettings_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_RateLimitSettings_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_RateLimitSettings_serialize(const envoy_config_core_v3_RateLimitSettings *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, arena, len);
@@ -275,13 +299,19 @@ UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_
UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_ConfigSource *ret = envoy_config_core_v3_ConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_ConfigSource *envoy_config_core_v3_ConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_ConfigSource *ret = envoy_config_core_v3_ConfigSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_ConfigSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_ConfigSource_serialize(const envoy_config_core_v3_ConfigSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_ConfigSource_msginit, arena, len);
@@ -379,6 +409,8 @@ UPB_INLINE struct xds_core_v3_Authority* envoy_config_core_v3_ConfigSource_add_a
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_config_source_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
index 3f89247a7a5..86f8a00dfd7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/event_service_config.upb.h"
#include "envoy/config/core/v3/grpc_service.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,18 +16,29 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_EventServiceConfig_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_EventServiceConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_EventServiceConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit = {
&envoy_config_core_v3_EventServiceConfig_submsgs[0],
&envoy_config_core_v3_EventServiceConfig__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_EventServiceConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_event_service_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
index 3069f4c3c77..fbda48a837e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_EVENT_SERVICE_CONFIG_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventSe
UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_EventServiceConfig *ret = envoy_config_core_v3_EventServiceConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_EventServiceConfig *envoy_config_core_v3_EventServiceConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_EventServiceConfig *ret = envoy_config_core_v3_EventServiceConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_EventServiceConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_EventServiceConfig_serialize(const envoy_config_core_v3_EventServiceConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, arena, len);
@@ -69,6 +75,8 @@ UPB_INLINE struct envoy_config_core_v3_GrpcService* envoy_config_core_v3_EventSe
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_event_service_config_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
index 47b8b32ecbd..bdba178248b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/core/v3/config_source.upb.h"
#include "google/protobuf/any.upb.h"
@@ -16,37 +16,49 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_TypedExtensionConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_TypedExtensionConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit = {
&envoy_config_core_v3_TypedExtensionConfig_submsgs[0],
&envoy_config_core_v3_TypedExtensionConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_ExtensionConfigSource__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit = {
&envoy_config_core_v3_ExtensionConfigSource_submsgs[0],
&envoy_config_core_v3_ExtensionConfigSource__fields[0],
- UPB_SIZE(16, 32), 4, false, 255,
+ UPB_SIZE(16, 32), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_config_core_v3_TypedExtensionConfig_msginit,
+ &envoy_config_core_v3_ExtensionConfigSource_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_extension_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
index 8499bfc26ce..f92952d0091 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_EXTENSION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -40,13 +40,19 @@ UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_Typed
UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_TypedExtensionConfig *ret = envoy_config_core_v3_TypedExtensionConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_TypedExtensionConfig *envoy_config_core_v3_TypedExtensionConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_TypedExtensionConfig *ret = envoy_config_core_v3_TypedExtensionConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_TypedExtensionConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_TypedExtensionConfig_serialize(const envoy_config_core_v3_TypedExtensionConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, arena, len);
@@ -81,13 +87,19 @@ UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_Exte
UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_ExtensionConfigSource *ret = envoy_config_core_v3_ExtensionConfigSource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_ExtensionConfigSource *envoy_config_core_v3_ExtensionConfigSource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_ExtensionConfigSource *ret = envoy_config_core_v3_ExtensionConfigSource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_ExtensionConfigSource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_ExtensionConfigSource_serialize(const envoy_config_core_v3_ExtensionConfigSource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, arena, len);
@@ -140,6 +152,8 @@ UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_add_type_urls(envoy_c
arena);
}
+extern const upb_msglayout_file envoy_config_core_v3_extension_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
index b2e99df0649..3c61bffb589 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/grpc_service.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "google/protobuf/any.upb.h"
@@ -22,219 +22,243 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_submsgs[4] = {
- &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
- &envoy_config_core_v3_HeaderValue_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService__fields[4] = {
- {1, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1},
- {2, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
- {3, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {5, UPB_SIZE(8, 16), 0, 2, 11, 3},
+ {1, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_msginit = {
&envoy_config_core_v3_GrpcService_submsgs[0],
&envoy_config_core_v3_GrpcService__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
- &google_protobuf_Struct_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc__fields[8] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), 1, 2, 11, 1},
- {3, UPB_SIZE(44, 88), 0, 0, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(32, 64), 2, 3, 11, 1},
- {7, UPB_SIZE(36, 72), 3, 4, 11, 1},
- {8, UPB_SIZE(40, 80), 4, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(28, 56), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(44, 88), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(32, 64), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(36, 72), 3, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(40, 80), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc__fields[0],
- UPB_SIZE(48, 96), 8, false, 255,
+ UPB_SIZE(48, 96), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
- &google_protobuf_Empty_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit},
+ {.submsg = &google_protobuf_Empty_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit,
- &google_protobuf_Empty_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit},
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit},
+ {.submsg = &google_protobuf_Empty_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[7] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials__fields[0],
- UPB_SIZE(16, 32), 7, false, 255,
+ UPB_SIZE(16, 32), 7, _UPB_MSGEXT_NONE, 7, 255,
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 1},
- {4, UPB_SIZE(24, 48), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 64), 0, 0, 9, 1},
- {6, UPB_SIZE(40, 80), 0, 0, 9, 1},
- {7, UPB_SIZE(48, 96), 0, 0, 9, 1},
- {8, UPB_SIZE(56, 112), 0, 0, 9, 1},
- {9, UPB_SIZE(64, 128), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 48), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 64), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 80), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(48, 96), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(56, 112), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(64, 128), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[0],
- UPB_SIZE(72, 144), 9, false, 255,
+ UPB_SIZE(72, 144), 9, _UPB_MSGEXT_NONE, 9, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit = {
NULL,
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = {
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit = {
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[0],
&envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[14] = {
+ &envoy_config_core_v3_GrpcService_msginit,
+ &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
+ &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_grpc_service_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 14,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
index dd9913debf3..b3f6be2efe7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_GRPC_SERVICE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -86,13 +86,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_ne
UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService *ret = envoy_config_core_v3_GrpcService_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService *envoy_config_core_v3_GrpcService_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService *ret = envoy_config_core_v3_GrpcService_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_serialize(const envoy_config_core_v3_GrpcService *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_msginit, arena, len);
@@ -173,13 +179,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_Grpc
UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_EnvoyGrpc *ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc *envoy_config_core_v3_GrpcService_EnvoyGrpc_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_EnvoyGrpc *ret = envoy_config_core_v3_GrpcService_EnvoyGrpc_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_EnvoyGrpc_serialize(const envoy_config_core_v3_GrpcService_EnvoyGrpc *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, arena, len);
@@ -203,13 +215,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_Grp
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc *envoy_config_core_v3_GrpcService_GoogleGrpc_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, arena, len);
@@ -312,13 +330,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_con
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, arena, len);
@@ -379,13 +403,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *e
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, arena, len);
@@ -401,13 +431,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, arena, len);
@@ -473,13 +509,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_co
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, arena, len);
@@ -587,13 +629,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAc
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, arena, len);
@@ -617,13 +665,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAM
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, arena, len);
@@ -647,13 +701,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataC
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, arena, len);
@@ -693,13 +753,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsServic
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, arena, len);
@@ -751,13 +817,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, arena, len);
@@ -781,13 +853,19 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *ret = envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_serialize(const envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, arena, len);
@@ -830,6 +908,8 @@ UPB_INLINE void envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntr
_upb_msg_map_set_value(msg, &value, sizeof(envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value*));
}
+extern const upb_msglayout_file envoy_config_core_v3_grpc_service_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
index b0a5a642885..e3431fb8b24 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/health_check.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/event_service_config.upb.h"
@@ -24,146 +24,165 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_submsgs[10] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_Struct_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HealthCheck_submsgs[10] = {
+ {.submsg = &envoy_config_core_v3_EventServiceConfig_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_TlsOptions_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck__fields[23] = {
- {1, UPB_SIZE(20, 32), 1, 7, 11, 1},
- {2, UPB_SIZE(24, 40), 2, 7, 11, 1},
- {3, UPB_SIZE(28, 48), 3, 7, 11, 1},
- {4, UPB_SIZE(32, 56), 4, 9, 11, 1},
- {5, UPB_SIZE(36, 64), 5, 9, 11, 1},
- {6, UPB_SIZE(40, 72), 6, 9, 11, 1},
- {7, UPB_SIZE(44, 80), 7, 6, 11, 1},
- {8, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 3, 11, 1},
- {9, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 4, 11, 1},
- {11, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 2, 11, 1},
- {12, UPB_SIZE(48, 88), 8, 7, 11, 1},
- {13, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 1, 11, 1},
- {14, UPB_SIZE(52, 96), 9, 7, 11, 1},
- {15, UPB_SIZE(56, 104), 10, 7, 11, 1},
- {16, UPB_SIZE(60, 112), 11, 7, 11, 1},
- {17, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {18, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {19, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {20, UPB_SIZE(64, 120), 12, 7, 11, 1},
- {21, UPB_SIZE(68, 128), 13, 5, 11, 1},
- {22, UPB_SIZE(72, 136), 14, 0, 11, 1},
- {23, UPB_SIZE(76, 144), 15, 8, 11, 1},
- {24, UPB_SIZE(80, 152), 16, 7, 11, 1},
+ {1, UPB_SIZE(20, 32), 1, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 40), 2, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 48), 3, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 56), 4, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(36, 64), 5, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 72), 6, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(44, 80), 7, 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(48, 88), 8, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(84, 160), UPB_SIZE(-89, -169), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(52, 96), 9, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(56, 104), 10, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(60, 112), 11, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(64, 120), 12, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(68, 128), 13, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(72, 136), 14, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(76, 144), 15, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(80, 152), 16, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_msginit = {
&envoy_config_core_v3_HealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck__fields[0],
- UPB_SIZE(96, 176), 23, false, 255,
+ UPB_SIZE(96, 176), 23, _UPB_MSGEXT_NONE, 9, 255,
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_Payload__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_Payload__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[4] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_v3_Int64Range_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_v3_Int64Range_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[9] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(24, 40), 1, 1, 11, 1},
- {4, UPB_SIZE(28, 48), 2, 1, 11, 1},
- {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
- {8, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {9, UPB_SIZE(44, 80), 0, 3, 11, 3},
- {10, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {11, UPB_SIZE(32, 56), 3, 2, 11, 1},
+static const upb_msglayout_field envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[10] = {
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 40), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(36, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(40, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(44, 80), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(32, 56), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(48, 88), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit = {
&envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck_HttpHealthCheck__fields[0],
- UPB_SIZE(48, 96), 9, false, 255,
+ UPB_SIZE(56, 96), 10, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[1] = {
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_HealthCheck_Payload_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit = {
&envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck_TcpHealthCheck__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_GrpcHealthCheck__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit = {
&envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[0],
&envoy_config_core_v3_HealthCheck_CustomHealthCheck__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit = {
NULL,
&envoy_config_core_v3_HealthCheck_TlsOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[8] = {
+ &envoy_config_core_v3_HealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_Payload_msginit,
+ &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
+ &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_health_check_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 8,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
index e4a803ab253..77ae69e7903 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_HEALTH_CHECK_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -81,13 +81,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_ne
UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck *ret = envoy_config_core_v3_HealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck *envoy_config_core_v3_HealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck *ret = envoy_config_core_v3_HealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_serialize(const envoy_config_core_v3_HealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_msginit, arena, len);
@@ -420,13 +426,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_Health
UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_Payload *ret = envoy_config_core_v3_HealthCheck_Payload_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_Payload *envoy_config_core_v3_HealthCheck_Payload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_Payload *ret = envoy_config_core_v3_HealthCheck_Payload_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_Payload_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_Payload_serialize(const envoy_config_core_v3_HealthCheck_Payload *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, arena, len);
@@ -459,13 +471,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v
UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_HttpHealthCheck *ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck *envoy_config_core_v3_HealthCheck_HttpHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_HttpHealthCheck *ret = envoy_config_core_v3_HealthCheck_HttpHealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_HttpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, arena, len);
@@ -485,6 +503,8 @@ UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_He
UPB_INLINE int32_t envoy_config_core_v3_HealthCheck_HttpHealthCheck_codec_client_type(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_HealthCheck_HttpHealthCheck_service_name_matcher(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const struct envoy_type_matcher_v3_StringMatcher*); }
+UPB_INLINE bool envoy_config_core_v3_HealthCheck_HttpHealthCheck_has_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 88)); }
+UPB_INLINE const struct envoy_type_v3_Int64Range* const* envoy_config_core_v3_HealthCheck_HttpHealthCheck_retriable_statuses(const envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) { return (const struct envoy_type_v3_Int64Range* const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
UPB_INLINE void envoy_config_core_v3_HealthCheck_HttpHealthCheck_set_host(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
@@ -570,6 +590,19 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_core_v3_Heal
}
return sub;
}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_mutable_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t *len) {
+ return (struct envoy_type_v3_Int64Range**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 88), len);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range** envoy_config_core_v3_HealthCheck_HttpHealthCheck_resize_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_v3_Int64Range**)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 88), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_v3_Int64Range* envoy_config_core_v3_HealthCheck_HttpHealthCheck_add_retriable_statuses(envoy_config_core_v3_HealthCheck_HttpHealthCheck *msg, upb_arena *arena) {
+ struct envoy_type_v3_Int64Range* sub = (struct envoy_type_v3_Int64Range*)_upb_msg_new(&envoy_type_v3_Int64Range_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(48, 88), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
/* envoy.config.core.v3.HealthCheck.TcpHealthCheck */
@@ -579,13 +612,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3
UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_TcpHealthCheck *ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck *envoy_config_core_v3_HealthCheck_TcpHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_TcpHealthCheck *ret = envoy_config_core_v3_HealthCheck_TcpHealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_TcpHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_TcpHealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, arena, len);
@@ -631,13 +670,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_
UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_RedisHealthCheck *ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck *envoy_config_core_v3_HealthCheck_RedisHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_RedisHealthCheck *ret = envoy_config_core_v3_HealthCheck_RedisHealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_RedisHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_RedisHealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, arena, len);
@@ -657,13 +702,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v
UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_GrpcHealthCheck *ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_GrpcHealthCheck *ret = envoy_config_core_v3_HealthCheck_GrpcHealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_GrpcHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_GrpcHealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, arena, len);
@@ -687,13 +738,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core
UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_CustomHealthCheck *ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck *envoy_config_core_v3_HealthCheck_CustomHealthCheck_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_CustomHealthCheck *ret = envoy_config_core_v3_HealthCheck_CustomHealthCheck_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_CustomHealthCheck_serialize(const envoy_config_core_v3_HealthCheck_CustomHealthCheck *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, arena, len);
@@ -733,13 +790,19 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_Hea
UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HealthCheck_TlsOptions *ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions *envoy_config_core_v3_HealthCheck_TlsOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HealthCheck_TlsOptions *ret = envoy_config_core_v3_HealthCheck_TlsOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HealthCheck_TlsOptions_serialize(const envoy_config_core_v3_HealthCheck_TlsOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, arena, len);
@@ -758,6 +821,8 @@ UPB_INLINE bool envoy_config_core_v3_HealthCheck_TlsOptions_add_alpn_protocols(e
arena);
}
+extern const upb_msglayout_file envoy_config_core_v3_health_check_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
index c39ebef4c8c..abfaeb3b0dd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/http_uri.upb.h"
#include "google/protobuf/duration.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,20 +16,31 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_HttpUri_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_HttpUri_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_HttpUri__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HttpUri_msginit = {
&envoy_config_core_v3_HttpUri_submsgs[0],
&envoy_config_core_v3_HttpUri__fields[0],
- UPB_SIZE(32, 64), 3, false, 255,
+ UPB_SIZE(32, 64), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_HttpUri_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_http_uri_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
index c49eec1f998..393d44b02b3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_HTTP_URI_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_new(upb_ar
UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HttpUri *ret = envoy_config_core_v3_HttpUri_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HttpUri *envoy_config_core_v3_HttpUri_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HttpUri *ret = envoy_config_core_v3_HttpUri_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HttpUri_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HttpUri_serialize(const envoy_config_core_v3_HttpUri *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HttpUri_msginit, arena, len);
@@ -79,6 +85,8 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpUri_mutable
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_http_uri_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
index 67c9b102b48..c16eff0d3de 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c
@@ -7,11 +7,14 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/protocol.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
@@ -21,161 +24,244 @@
const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout_field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+static const upb_msglayout_sub envoy_config_core_v3_QuicProtocolOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_QuicProtocolOptions__fields[3] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_QuicProtocolOptions_msginit = {
+ &envoy_config_core_v3_QuicProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_QuicProtocolOptions__fields[0],
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[3] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = {
NULL,
&envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout *const envoy_config_core_v3_HttpProtocolOptions_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_field envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[3] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
-static const upb_msglayout_field envoy_config_core_v3_HttpProtocolOptions__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(20, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 14, 1},
+const upb_msglayout envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit = {
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[0],
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions__fields[0],
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_HttpProtocolOptions_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_HttpProtocolOptions__fields[6] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 32), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 40), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit = {
&envoy_config_core_v3_HttpProtocolOptions_submsgs[0],
&envoy_config_core_v3_HttpProtocolOptions__fields[0],
- UPB_SIZE(24, 40), 5, false, 255,
+ UPB_SIZE(32, 48), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_submsgs[2] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Http1ProtocolOptions_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions__fields[7] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {7, UPB_SIZE(20, 40), 3, 1, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(20, 40), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit = {
&envoy_config_core_v3_Http1ProtocolOptions_submsgs[0],
&envoy_config_core_v3_Http1ProtocolOptions__fields[0],
- UPB_SIZE(24, 48), 7, false, 255,
+ UPB_SIZE(24, 48), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[1] = {
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+static const upb_msglayout_field envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[2] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit = {
&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[0],
&envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 1, 255,
};
const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_KeepaliveSettings_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_KeepaliveSettings_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_core_v3_KeepaliveSettings__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+static const upb_msglayout_field envoy_config_core_v3_KeepaliveSettings__fields[4] = {
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit = {
&envoy_config_core_v3_KeepaliveSettings_submsgs[0],
&envoy_config_core_v3_KeepaliveSettings__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_submsgs[4] = {
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
- &envoy_config_core_v3_KeepaliveSettings_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Http2ProtocolOptions_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit},
+ {.submsg = &envoy_config_core_v3_KeepaliveSettings_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions__fields[15] = {
- {1, UPB_SIZE(8, 8), 1, 3, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 3, 11, 1},
- {4, UPB_SIZE(20, 32), 4, 3, 11, 1},
- {5, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {7, UPB_SIZE(24, 40), 5, 3, 11, 1},
- {8, UPB_SIZE(28, 48), 6, 3, 11, 1},
- {9, UPB_SIZE(32, 56), 7, 3, 11, 1},
- {10, UPB_SIZE(36, 64), 8, 3, 11, 1},
- {11, UPB_SIZE(40, 72), 9, 3, 11, 1},
- {12, UPB_SIZE(4, 4), 0, 0, 8, 1},
- {13, UPB_SIZE(52, 96), 0, 0, 11, 3},
- {14, UPB_SIZE(44, 80), 10, 2, 11, 1},
- {15, UPB_SIZE(48, 88), 11, 1, 11, 1},
+ {1, UPB_SIZE(8, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 3, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 32), 4, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 40), 5, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 48), 6, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 56), 7, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(36, 64), 8, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(40, 72), 9, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(52, 96), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(44, 80), 10, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(48, 88), 11, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit = {
&envoy_config_core_v3_Http2ProtocolOptions_submsgs[0],
&envoy_config_core_v3_Http2ProtocolOptions__fields[0],
- UPB_SIZE(56, 104), 15, false, 255,
+ UPB_SIZE(56, 104), 15, _UPB_MSGEXT_NONE, 15, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit = {
&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_submsgs[0],
&envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_GrpcProtocolOptions__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit = {
&envoy_config_core_v3_GrpcProtocolOptions_submsgs[0],
&envoy_config_core_v3_GrpcProtocolOptions__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_Http3ProtocolOptions_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_Http3ProtocolOptions__fields[3] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit = {
+ &envoy_config_core_v3_Http3ProtocolOptions_submsgs[0],
+ &envoy_config_core_v3_Http3ProtocolOptions__fields[0],
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_field envoy_config_core_v3_SchemeHeaderTransformation__fields[1] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_SchemeHeaderTransformation_msginit = {
NULL,
+ &envoy_config_core_v3_SchemeHeaderTransformation__fields[0],
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[14] = {
+ &envoy_config_core_v3_TcpProtocolOptions_msginit,
+ &envoy_config_core_v3_QuicProtocolOptions_msginit,
+ &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
+ &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit,
+ &envoy_config_core_v3_HttpProtocolOptions_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
+ &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
+ &envoy_config_core_v3_KeepaliveSettings_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_msginit,
+ &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
+ &envoy_config_core_v3_GrpcProtocolOptions_msginit,
+ &envoy_config_core_v3_Http3ProtocolOptions_msginit,
+ &envoy_config_core_v3_SchemeHeaderTransformation_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_protocol_proto_upb_file_layout = {
+ messages_layout,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 14,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
index 8bfcae6c317..d69d795e497 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -21,7 +21,9 @@ extern "C" {
#endif
struct envoy_config_core_v3_TcpProtocolOptions;
+struct envoy_config_core_v3_QuicProtocolOptions;
struct envoy_config_core_v3_UpstreamHttpProtocolOptions;
+struct envoy_config_core_v3_AlternateProtocolsCacheOptions;
struct envoy_config_core_v3_HttpProtocolOptions;
struct envoy_config_core_v3_Http1ProtocolOptions;
struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
@@ -31,8 +33,11 @@ struct envoy_config_core_v3_Http2ProtocolOptions;
struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
struct envoy_config_core_v3_GrpcProtocolOptions;
struct envoy_config_core_v3_Http3ProtocolOptions;
+struct envoy_config_core_v3_SchemeHeaderTransformation;
typedef struct envoy_config_core_v3_TcpProtocolOptions envoy_config_core_v3_TcpProtocolOptions;
+typedef struct envoy_config_core_v3_QuicProtocolOptions envoy_config_core_v3_QuicProtocolOptions;
typedef struct envoy_config_core_v3_UpstreamHttpProtocolOptions envoy_config_core_v3_UpstreamHttpProtocolOptions;
+typedef struct envoy_config_core_v3_AlternateProtocolsCacheOptions envoy_config_core_v3_AlternateProtocolsCacheOptions;
typedef struct envoy_config_core_v3_HttpProtocolOptions envoy_config_core_v3_HttpProtocolOptions;
typedef struct envoy_config_core_v3_Http1ProtocolOptions envoy_config_core_v3_Http1ProtocolOptions;
typedef struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat;
@@ -42,8 +47,11 @@ typedef struct envoy_config_core_v3_Http2ProtocolOptions envoy_config_core_v3_Ht
typedef struct envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter;
typedef struct envoy_config_core_v3_GrpcProtocolOptions envoy_config_core_v3_GrpcProtocolOptions;
typedef struct envoy_config_core_v3_Http3ProtocolOptions envoy_config_core_v3_Http3ProtocolOptions;
+typedef struct envoy_config_core_v3_SchemeHeaderTransformation envoy_config_core_v3_SchemeHeaderTransformation;
extern const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_QuicProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit;
@@ -53,10 +61,13 @@ extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit;
extern const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_SchemeHeaderTransformation_msginit;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_type_v3_Percent;
struct google_protobuf_BoolValue;
struct google_protobuf_Duration;
struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_type_v3_Percent_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
extern const upb_msglayout google_protobuf_Duration_msginit;
@@ -77,13 +88,19 @@ UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProt
UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_TcpProtocolOptions *ret = envoy_config_core_v3_TcpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_TcpProtocolOptions *envoy_config_core_v3_TcpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_TcpProtocolOptions *ret = envoy_config_core_v3_TcpProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_TcpProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_TcpProtocolOptions_serialize(const envoy_config_core_v3_TcpProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, arena, len);
@@ -91,6 +108,79 @@ UPB_INLINE char *envoy_config_core_v3_TcpProtocolOptions_serialize(const envoy_c
+/* envoy.config.core.v3.QuicProtocolOptions */
+
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions *envoy_config_core_v3_QuicProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_QuicProtocolOptions *)_upb_msg_new(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions *envoy_config_core_v3_QuicProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_QuicProtocolOptions *ret = envoy_config_core_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_QuicProtocolOptions *envoy_config_core_v3_QuicProtocolOptions_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_QuicProtocolOptions *ret = envoy_config_core_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_QuicProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_QuicProtocolOptions_serialize(const envoy_config_core_v3_QuicProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(const envoy_config_core_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(const envoy_config_core_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
+
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_max_concurrent_streams(envoy_config_core_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_max_concurrent_streams(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_max_concurrent_streams(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_stream_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_stream_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_initial_stream_window_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_QuicProtocolOptions_mutable_initial_connection_window_size(envoy_config_core_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_QuicProtocolOptions_initial_connection_window_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_QuicProtocolOptions_set_initial_connection_window_size(msg, sub);
+ }
+ return sub;
+}
+
/* envoy.config.core.v3.UpstreamHttpProtocolOptions */
UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_new(upb_arena *arena) {
@@ -99,13 +189,19 @@ UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v
UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_UpstreamHttpProtocolOptions *ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions *envoy_config_core_v3_UpstreamHttpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_UpstreamHttpProtocolOptions *ret = envoy_config_core_v3_UpstreamHttpProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, arena, len);
@@ -113,6 +209,7 @@ UPB_INLINE char *envoy_config_core_v3_UpstreamHttpProtocolOptions_serialize(cons
UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_sni(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
UPB_INLINE bool envoy_config_core_v3_UpstreamHttpProtocolOptions_auto_san_validation(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+UPB_INLINE upb_strview envoy_config_core_v3_UpstreamHttpProtocolOptions_override_auto_sni_header(const envoy_config_core_v3_UpstreamHttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
@@ -120,6 +217,71 @@ UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_sni(en
UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_auto_san_validation(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+UPB_INLINE void envoy_config_core_v3_UpstreamHttpProtocolOptions_set_override_auto_sni_header(envoy_config_core_v3_UpstreamHttpProtocolOptions *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+
+/* envoy.config.core.v3.AlternateProtocolsCacheOptions */
+
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions *envoy_config_core_v3_AlternateProtocolsCacheOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_AlternateProtocolsCacheOptions *)_upb_msg_new(&envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions *envoy_config_core_v3_AlternateProtocolsCacheOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions *ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions *envoy_config_core_v3_AlternateProtocolsCacheOptions_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_AlternateProtocolsCacheOptions *ret = envoy_config_core_v3_AlternateProtocolsCacheOptions_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_AlternateProtocolsCacheOptions_serialize(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_config_core_v3_AlternateProtocolsCacheOptions_name(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_core_v3_AlternateProtocolsCacheOptions_has_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(const envoy_config_core_v3_AlternateProtocolsCacheOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_name(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_max_entries(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_AlternateProtocolsCacheOptions_max_entries(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_set_max_entries(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_AlternateProtocolsCacheOptions_mutable_key_value_store_config(envoy_config_core_v3_AlternateProtocolsCacheOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_AlternateProtocolsCacheOptions_key_value_store_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_AlternateProtocolsCacheOptions_set_key_value_store_config(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.core.v3.HttpProtocolOptions */
@@ -129,13 +291,19 @@ UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpPr
UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_HttpProtocolOptions *ret = envoy_config_core_v3_HttpProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_HttpProtocolOptions *envoy_config_core_v3_HttpProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_HttpProtocolOptions *ret = envoy_config_core_v3_HttpProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_HttpProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_HttpProtocolOptions_serialize(const envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, arena, len);
@@ -150,6 +318,8 @@ UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProto
UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct google_protobuf_Duration*); }
UPB_INLINE int32_t envoy_config_core_v3_HttpProtocolOptions_headers_with_underscores_action(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(const envoy_config_core_v3_HttpProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct google_protobuf_UInt32Value*); }
UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_idle_timeout(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
@@ -206,6 +376,19 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_HttpProtocolOpt
UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_headers_with_underscores_action(envoy_config_core_v3_HttpProtocolOptions *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+UPB_INLINE void envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_core_v3_HttpProtocolOptions_mutable_max_requests_per_connection(envoy_config_core_v3_HttpProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_core_v3_HttpProtocolOptions_max_requests_per_connection(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_HttpProtocolOptions_set_max_requests_per_connection(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.core.v3.Http1ProtocolOptions */
@@ -215,13 +398,19 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions *ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions *envoy_config_core_v3_Http1ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions *ret = envoy_config_core_v3_Http1ProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_serialize(const envoy_config_core_v3_Http1ProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, arena, len);
@@ -298,13 +487,19 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_conf
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, arena, len);
@@ -312,12 +507,15 @@ UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_seria
typedef enum {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_proper_case_words = 1,
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_stateful_formatter = 8,
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_NOT_SET = 0
} envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases;
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_case(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* msg) { return (envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
UPB_INLINE const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_proper_case_words(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return UPB_READ_ONEOF(msg, const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_has_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 8; }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 8, NULL); }
UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_proper_case_words(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords* value) {
UPB_WRITE_ONEOF(msg, envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
@@ -331,6 +529,18 @@ UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_Prop
}
return sub;
}
+UPB_INLINE void envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 8);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_mutable_stateful_formatter(envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_stateful_formatter(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_set_stateful_formatter(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords */
@@ -340,13 +550,19 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseW
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *ret = envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_serialize(const envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, arena, len);
@@ -362,13 +578,19 @@ UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_Keepaliv
UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_KeepaliveSettings *ret = envoy_config_core_v3_KeepaliveSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_KeepaliveSettings *envoy_config_core_v3_KeepaliveSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_KeepaliveSettings *ret = envoy_config_core_v3_KeepaliveSettings_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_KeepaliveSettings_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_KeepaliveSettings_serialize(const envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, arena, len);
@@ -380,6 +602,8 @@ UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_timeout(const envoy_c
UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_timeout(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_interval_jitter(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_v3_Percent*); }
+UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(const envoy_config_core_v3_KeepaliveSettings *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct google_protobuf_Duration*); }
UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
@@ -420,6 +644,19 @@ UPB_INLINE struct envoy_type_v3_Percent* envoy_config_core_v3_KeepaliveSettings_
}
return sub;
}
+UPB_INLINE void envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_core_v3_KeepaliveSettings_mutable_connection_idle_interval(envoy_config_core_v3_KeepaliveSettings *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_core_v3_KeepaliveSettings_connection_idle_interval(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_KeepaliveSettings_set_connection_idle_interval(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.core.v3.Http2ProtocolOptions */
@@ -429,13 +666,19 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2
UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http2ProtocolOptions *ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions *envoy_config_core_v3_Http2ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http2ProtocolOptions *ret = envoy_config_core_v3_Http2ProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_serialize(const envoy_config_core_v3_Http2ProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, arena, len);
@@ -643,13 +886,19 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_co
UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *ret = envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_serialize(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, arena, len);
@@ -695,13 +944,19 @@ UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcPr
UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_GrpcProtocolOptions *ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions *envoy_config_core_v3_GrpcProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_GrpcProtocolOptions *ret = envoy_config_core_v3_GrpcProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_GrpcProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_GrpcProtocolOptions_serialize(const envoy_config_core_v3_GrpcProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, arena, len);
@@ -732,19 +987,100 @@ UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3
UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3ProtocolOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_Http3ProtocolOptions *ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions *envoy_config_core_v3_Http3ProtocolOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_Http3ProtocolOptions *ret = envoy_config_core_v3_Http3ProtocolOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_Http3ProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_Http3ProtocolOptions_serialize(const envoy_config_core_v3_Http3ProtocolOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, arena, len);
}
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_QuicProtocolOptions*); }
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(const envoy_config_core_v3_Http3ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_allow_extended_connect(const envoy_config_core_v3_Http3ProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions *msg, envoy_config_core_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_QuicProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_Http3ProtocolOptions_mutable_quic_protocol_options(envoy_config_core_v3_Http3ProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_core_v3_Http3ProtocolOptions_quic_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http3ProtocolOptions_set_quic_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_Http3ProtocolOptions_mutable_override_stream_error_on_invalid_http_message(envoy_config_core_v3_Http3ProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_Http3ProtocolOptions_override_stream_error_on_invalid_http_message(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_Http3ProtocolOptions_set_override_stream_error_on_invalid_http_message(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_Http3ProtocolOptions_set_allow_extended_connect(envoy_config_core_v3_Http3ProtocolOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.core.v3.SchemeHeaderTransformation */
+
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation *envoy_config_core_v3_SchemeHeaderTransformation_new(upb_arena *arena) {
+ return (envoy_config_core_v3_SchemeHeaderTransformation *)_upb_msg_new(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation *envoy_config_core_v3_SchemeHeaderTransformation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_SchemeHeaderTransformation *ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation *envoy_config_core_v3_SchemeHeaderTransformation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_SchemeHeaderTransformation *ret = envoy_config_core_v3_SchemeHeaderTransformation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_SchemeHeaderTransformation_serialize(const envoy_config_core_v3_SchemeHeaderTransformation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_config_core_v3_SchemeHeaderTransformation_transformation_scheme_to_overwrite = 1,
+ envoy_config_core_v3_SchemeHeaderTransformation_transformation_NOT_SET = 0
+} envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases;
+UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases envoy_config_core_v3_SchemeHeaderTransformation_transformation_case(const envoy_config_core_v3_SchemeHeaderTransformation* msg) { return (envoy_config_core_v3_SchemeHeaderTransformation_transformation_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool envoy_config_core_v3_SchemeHeaderTransformation_has_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE upb_strview envoy_config_core_v3_SchemeHeaderTransformation_scheme_to_overwrite(const envoy_config_core_v3_SchemeHeaderTransformation *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void envoy_config_core_v3_SchemeHeaderTransformation_set_scheme_to_overwrite(envoy_config_core_v3_SchemeHeaderTransformation *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+extern const upb_msglayout_file envoy_config_core_v3_protocol_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
index 4c56e07b7f1..44a20555ea2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c
@@ -7,20 +7,31 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/proxy_protocol.upb.h"
#include "udpa/annotations/status.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_config_core_v3_ProxyProtocolConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit = {
NULL,
&envoy_config_core_v3_ProxyProtocolConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_ProxyProtocolConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_proxy_protocol_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
index bd56a644def..4bfe2a52957 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_PROXY_PROTOCOL_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyP
UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_ProxyProtocolConfig *ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig *envoy_config_core_v3_ProxyProtocolConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_ProxyProtocolConfig *ret = envoy_config_core_v3_ProxyProtocolConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_ProxyProtocolConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_ProxyProtocolConfig_serialize(const envoy_config_core_v3_ProxyProtocolConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, arena, len);
@@ -56,6 +62,8 @@ UPB_INLINE void envoy_config_core_v3_ProxyProtocolConfig_set_version(envoy_confi
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
+extern const upb_msglayout_file envoy_config_core_v3_proxy_protocol_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c
new file mode 100644
index 00000000000..f1d4b688dbd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c
@@ -0,0 +1,58 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/core/v3/resolver.upb.h"
+#include "envoy/config/core/v3/address.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field envoy_config_core_v3_DnsResolverOptions__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_DnsResolverOptions_msginit = {
+ NULL,
+ &envoy_config_core_v3_DnsResolverOptions__fields[0],
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_core_v3_DnsResolutionConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_DnsResolverOptions_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_DnsResolutionConfig__fields[2] = {
+ {1, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_DnsResolutionConfig_msginit = {
+ &envoy_config_core_v3_DnsResolutionConfig_submsgs[0],
+ &envoy_config_core_v3_DnsResolutionConfig__fields[0],
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_config_core_v3_DnsResolverOptions_msginit,
+ &envoy_config_core_v3_DnsResolutionConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_resolver_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h
new file mode 100644
index 00000000000..3db9b973ca8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h
@@ -0,0 +1,135 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_DnsResolverOptions;
+struct envoy_config_core_v3_DnsResolutionConfig;
+typedef struct envoy_config_core_v3_DnsResolverOptions envoy_config_core_v3_DnsResolverOptions;
+typedef struct envoy_config_core_v3_DnsResolutionConfig envoy_config_core_v3_DnsResolutionConfig;
+extern const upb_msglayout envoy_config_core_v3_DnsResolverOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_DnsResolutionConfig_msginit;
+struct envoy_config_core_v3_Address;
+extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+
+
+/* envoy.config.core.v3.DnsResolverOptions */
+
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions *envoy_config_core_v3_DnsResolverOptions_new(upb_arena *arena) {
+ return (envoy_config_core_v3_DnsResolverOptions *)_upb_msg_new(&envoy_config_core_v3_DnsResolverOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions *envoy_config_core_v3_DnsResolverOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_DnsResolverOptions *ret = envoy_config_core_v3_DnsResolverOptions_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_DnsResolverOptions *envoy_config_core_v3_DnsResolverOptions_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_DnsResolverOptions *ret = envoy_config_core_v3_DnsResolverOptions_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_DnsResolverOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_DnsResolverOptions_serialize(const envoy_config_core_v3_DnsResolverOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_use_tcp_for_dns_lookups(const envoy_config_core_v3_DnsResolverOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+UPB_INLINE bool envoy_config_core_v3_DnsResolverOptions_no_default_search_domain(const envoy_config_core_v3_DnsResolverOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
+
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_use_tcp_for_dns_lookups(envoy_config_core_v3_DnsResolverOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolverOptions_set_no_default_search_domain(envoy_config_core_v3_DnsResolverOptions *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+/* envoy.config.core.v3.DnsResolutionConfig */
+
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig *envoy_config_core_v3_DnsResolutionConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_DnsResolutionConfig *)_upb_msg_new(&envoy_config_core_v3_DnsResolutionConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig *envoy_config_core_v3_DnsResolutionConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_DnsResolutionConfig *ret = envoy_config_core_v3_DnsResolutionConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_DnsResolutionConfig *envoy_config_core_v3_DnsResolutionConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_DnsResolutionConfig *ret = envoy_config_core_v3_DnsResolutionConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_DnsResolutionConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_DnsResolutionConfig_serialize(const envoy_config_core_v3_DnsResolutionConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_resolvers(const envoy_config_core_v3_DnsResolutionConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
+UPB_INLINE const struct envoy_config_core_v3_Address* const* envoy_config_core_v3_DnsResolutionConfig_resolvers(const envoy_config_core_v3_DnsResolutionConfig *msg, size_t *len) { return (const struct envoy_config_core_v3_Address* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_config_core_v3_DnsResolutionConfig_has_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(const envoy_config_core_v3_DnsResolutionConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_config_core_v3_DnsResolverOptions*); }
+
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_mutable_resolvers(envoy_config_core_v3_DnsResolutionConfig *msg, size_t *len) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE struct envoy_config_core_v3_Address** envoy_config_core_v3_DnsResolutionConfig_resize_resolvers(envoy_config_core_v3_DnsResolutionConfig *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_Address**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_core_v3_DnsResolutionConfig_add_resolvers(envoy_config_core_v3_DnsResolutionConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)_upb_msg_new(&envoy_config_core_v3_Address_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig *msg, envoy_config_core_v3_DnsResolverOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_config_core_v3_DnsResolverOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsResolutionConfig_mutable_dns_resolver_options(envoy_config_core_v3_DnsResolutionConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_DnsResolverOptions* sub = (struct envoy_config_core_v3_DnsResolverOptions*)envoy_config_core_v3_DnsResolutionConfig_dns_resolver_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_DnsResolverOptions*)_upb_msg_new(&envoy_config_core_v3_DnsResolverOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_DnsResolutionConfig_set_dns_resolver_options(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_config_core_v3_resolver_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
index d4c2ea14006..4f384c3c0c4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -16,18 +16,29 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_config_core_v3_SocketOption__fields[6] = {
- {1, UPB_SIZE(20, 24), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {4, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 3, 1},
- {5, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 12, 1},
- {6, UPB_SIZE(16, 16), 0, 0, 14, 1},
+ {1, UPB_SIZE(20, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 40), UPB_SIZE(-41, -57), 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(16, 16), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_SocketOption_msginit = {
NULL,
&envoy_config_core_v3_SocketOption__fields[0],
- UPB_SIZE(48, 64), 6, false, 255,
+ UPB_SIZE(48, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_SocketOption_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_socket_option_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
index 0347443069d..d6b120aa69c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_SOCKET_OPTION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,13 +39,19 @@ UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_
UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_SocketOption *envoy_config_core_v3_SocketOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_SocketOption *ret = envoy_config_core_v3_SocketOption_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_SocketOption_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_SocketOption_serialize(const envoy_config_core_v3_SocketOption *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_SocketOption_msginit, arena, len);
@@ -86,6 +92,8 @@ UPB_INLINE void envoy_config_core_v3_SocketOption_set_state(envoy_config_core_v3
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
}
+extern const upb_msglayout_file envoy_config_core_v3_socket_option_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
index 71781640be7..f7363d68e25 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c
@@ -7,35 +7,47 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/core/v3/substitution_format_string.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
#include "google/protobuf/struct.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_core_v3_SubstitutionFormatString_submsgs[3] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_core_v3_SubstitutionFormatString_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_core_v3_SubstitutionFormatString__fields[6] = {
- {1, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, 1},
- {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 2, 11, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {4, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {5, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 11, 1},
- {6, UPB_SIZE(12, 24), 0, 1, 11, 3},
+ {1, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 32), UPB_SIZE(-25, -49), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit = {
&envoy_config_core_v3_SubstitutionFormatString_submsgs[0],
&envoy_config_core_v3_SubstitutionFormatString__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(32, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_SubstitutionFormatString_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_substitution_format_string_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
index 3f450e9ad17..03aca0ebfc1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
#define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,13 +39,19 @@ UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_S
UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_core_v3_SubstitutionFormatString_serialize(const envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, len);
@@ -117,6 +123,8 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v
return sub;
}
+extern const upb_msglayout_file envoy_config_core_v3_substitution_format_string_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c
new file mode 100644
index 00000000000..ddcd00e9958
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c
@@ -0,0 +1,46 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub envoy_config_core_v3_UdpSocketConfig_submsgs[2] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_core_v3_UdpSocketConfig__fields[2] = {
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_core_v3_UdpSocketConfig_msginit = {
+ &envoy_config_core_v3_UdpSocketConfig_submsgs[0],
+ &envoy_config_core_v3_UdpSocketConfig__fields[0],
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_core_v3_UdpSocketConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_core_v3_udp_socket_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h
new file mode 100644
index 00000000000..f1d21eeab87
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h
@@ -0,0 +1,98 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_core_v3_UdpSocketConfig;
+typedef struct envoy_config_core_v3_UdpSocketConfig envoy_config_core_v3_UdpSocketConfig;
+extern const upb_msglayout envoy_config_core_v3_UdpSocketConfig_msginit;
+struct google_protobuf_BoolValue;
+struct google_protobuf_UInt64Value;
+extern const upb_msglayout google_protobuf_BoolValue_msginit;
+extern const upb_msglayout google_protobuf_UInt64Value_msginit;
+
+
+/* envoy.config.core.v3.UdpSocketConfig */
+
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig *envoy_config_core_v3_UdpSocketConfig_new(upb_arena *arena) {
+ return (envoy_config_core_v3_UdpSocketConfig *)_upb_msg_new(&envoy_config_core_v3_UdpSocketConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig *envoy_config_core_v3_UdpSocketConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_core_v3_UdpSocketConfig *ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_core_v3_UdpSocketConfig *envoy_config_core_v3_UdpSocketConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_core_v3_UdpSocketConfig *ret = envoy_config_core_v3_UdpSocketConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_core_v3_UdpSocketConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_core_v3_UdpSocketConfig_serialize(const envoy_config_core_v3_UdpSocketConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(const envoy_config_core_v3_UdpSocketConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_UInt64Value*); }
+UPB_INLINE bool envoy_config_core_v3_UdpSocketConfig_has_prefer_gro(const envoy_config_core_v3_UdpSocketConfig *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_prefer_gro(const envoy_config_core_v3_UdpSocketConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_BoolValue*); }
+
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_UInt64Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_UInt64Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt64Value* envoy_config_core_v3_UdpSocketConfig_mutable_max_rx_datagram_size(envoy_config_core_v3_UdpSocketConfig *msg, upb_arena *arena) {
+ struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_config_core_v3_UdpSocketConfig_max_rx_datagram_size(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt64Value*)_upb_msg_new(&google_protobuf_UInt64Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_UdpSocketConfig_set_max_rx_datagram_size(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(envoy_config_core_v3_UdpSocketConfig *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_core_v3_UdpSocketConfig_mutable_prefer_gro(envoy_config_core_v3_UdpSocketConfig *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_core_v3_UdpSocketConfig_prefer_gro(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_core_v3_UdpSocketConfig_set_prefer_gro(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_config_core_v3_udp_socket_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
index 3f9c789bf8d..5c37ce16ec6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/endpoint/v3/endpoint.upb.h"
#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
#include "envoy/type/v3/percent.upb.h"
@@ -19,71 +19,85 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
- &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 2, 11, 3},
- {4, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit = {
&envoy_config_endpoint_v3_ClusterLoadAssignment_submsgs[0],
&envoy_config_endpoint_v3_ClusterLoadAssignment__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[3] = {
- {2, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit = {
&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[0],
&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit = {
&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[0],
&envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
- &envoy_config_endpoint_v3_Endpoint_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = {
+ {.submsg = &envoy_config_endpoint_v3_Endpoint_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit = {
&envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[0],
&envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[4] = {
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
+ &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
+};
+
+const upb_msglayout_file envoy_config_endpoint_v3_endpoint_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 4,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
index c89e4a45721..26dcd8d26b2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -52,13 +52,19 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment *envoy_config_endpoint_v3_ClusterLoadAssignment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, arena, len);
@@ -116,13 +122,19 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_e
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, arena, len);
@@ -183,13 +195,19 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *e
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *ret = envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_serialize(const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, arena, len);
@@ -234,6 +252,8 @@ UPB_INLINE void envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEnt
_upb_msg_map_set_value(msg, &value, sizeof(struct envoy_config_endpoint_v3_Endpoint*));
}
+extern const upb_msglayout_file envoy_config_endpoint_v3_endpoint_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
index f12e49bdafc..ca6ab92928c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c
@@ -7,10 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/config_source.upb.h"
#include "envoy/config/core/v3/health_check.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -19,72 +20,121 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_endpoint_v3_Endpoint_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_Endpoint_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit = {
&envoy_config_endpoint_v3_Endpoint_submsgs[0],
&envoy_config_endpoint_v3_Endpoint__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = {
NULL,
&envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_endpoint_v3_Endpoint_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_endpoint_v3_Endpoint_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_LbEndpoint__fields[5] = {
- {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {3, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {4, UPB_SIZE(12, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, 1},
+ {1, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 16), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 24), UPB_SIZE(-25, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit = {
&envoy_config_endpoint_v3_LbEndpoint_submsgs[0],
&envoy_config_endpoint_v3_LbEndpoint__fields[0],
- UPB_SIZE(32, 48), 5, false, 255,
+ UPB_SIZE(32, 48), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[3] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_endpoint_v3_LbEndpoint_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[2] = {
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit = {
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[0],
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit},
+ {.submsg = &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(20, 32), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {6, UPB_SIZE(16, 24), 3, 2, 11, 1},
+static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints__fields[7] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 32), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 2, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(16, 24), 3, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit = {
&envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[0],
&envoy_config_endpoint_v3_LocalityLbEndpoints__fields[0],
- UPB_SIZE(24, 40), 5, false, 255,
+ UPB_SIZE(32, 56), 7, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_sub envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[1] = {
+ {.submsg = &envoy_config_endpoint_v3_LbEndpoint_msginit},
+};
+
+static const upb_msglayout_field envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit = {
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_submsgs[0],
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[6] = {
+ &envoy_config_endpoint_v3_Endpoint_msginit,
+ &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
+ &envoy_config_endpoint_v3_LbEndpoint_msginit,
+ &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit,
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
+ &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit,
+};
+
+const upb_msglayout_file envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 6,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
index b6ad981cacc..aceb34a1f08 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
#define ENVOY_CONFIG_ENDPOINT_V3_ENDPOINT_COMPONENTS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,20 +23,28 @@ extern "C" {
struct envoy_config_endpoint_v3_Endpoint;
struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
struct envoy_config_endpoint_v3_LbEndpoint;
+struct envoy_config_endpoint_v3_LedsClusterLocalityConfig;
struct envoy_config_endpoint_v3_LocalityLbEndpoints;
+struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList;
typedef struct envoy_config_endpoint_v3_Endpoint envoy_config_endpoint_v3_Endpoint;
typedef struct envoy_config_endpoint_v3_Endpoint_HealthCheckConfig envoy_config_endpoint_v3_Endpoint_HealthCheckConfig;
typedef struct envoy_config_endpoint_v3_LbEndpoint envoy_config_endpoint_v3_LbEndpoint;
+typedef struct envoy_config_endpoint_v3_LedsClusterLocalityConfig envoy_config_endpoint_v3_LedsClusterLocalityConfig;
typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints envoy_config_endpoint_v3_LocalityLbEndpoints;
+typedef struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList;
extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit;
extern const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit;
extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
+extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit;
struct envoy_config_core_v3_Address;
+struct envoy_config_core_v3_ConfigSource;
struct envoy_config_core_v3_Locality;
struct envoy_config_core_v3_Metadata;
struct google_protobuf_UInt32Value;
extern const upb_msglayout envoy_config_core_v3_Address_msginit;
+extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
extern const upb_msglayout google_protobuf_UInt32Value_msginit;
@@ -50,13 +58,19 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_
UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_Endpoint *ret = envoy_config_endpoint_v3_Endpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_Endpoint *envoy_config_endpoint_v3_Endpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_Endpoint *ret = envoy_config_endpoint_v3_Endpoint_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_serialize(const envoy_config_endpoint_v3_Endpoint *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, arena, len);
@@ -106,13 +120,19 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_end
UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *ret = envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_serialize(const envoy_config_endpoint_v3_Endpoint_HealthCheckConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, arena, len);
@@ -136,13 +156,19 @@ UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpo
UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_LbEndpoint *ret = envoy_config_endpoint_v3_LbEndpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_LbEndpoint *envoy_config_endpoint_v3_LbEndpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_LbEndpoint *ret = envoy_config_endpoint_v3_LbEndpoint_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LbEndpoint_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_LbEndpoint_serialize(const envoy_config_endpoint_v3_LbEndpoint *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, arena, len);
@@ -210,6 +236,53 @@ UPB_INLINE void envoy_config_endpoint_v3_LbEndpoint_set_endpoint_name(envoy_conf
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 24), value, UPB_SIZE(24, 40), 5);
}
+/* envoy.config.endpoint.v3.LedsClusterLocalityConfig */
+
+UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig *envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LedsClusterLocalityConfig *)_upb_msg_new(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig *envoy_config_endpoint_v3_LedsClusterLocalityConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig *ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig *envoy_config_endpoint_v3_LedsClusterLocalityConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig *ret = envoy_config_endpoint_v3_LedsClusterLocalityConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_LedsClusterLocalityConfig_serialize(const envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_LedsClusterLocalityConfig_has_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE upb_strview envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_collection_name(const envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, struct envoy_config_core_v3_ConfigSource* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_endpoint_v3_LedsClusterLocalityConfig_mutable_leds_config(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_config_endpoint_v3_LedsClusterLocalityConfig_leds_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_ConfigSource*)_upb_msg_new(&envoy_config_core_v3_ConfigSource_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LedsClusterLocalityConfig_set_leds_collection_name(envoy_config_endpoint_v3_LedsClusterLocalityConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+
/* envoy.config.endpoint.v3.LocalityLbEndpoints */
UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_new(upb_arena *arena) {
@@ -218,18 +291,31 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v
UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_LocalityLbEndpoints *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints *envoy_config_endpoint_v3_LocalityLbEndpoints_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_LocalityLbEndpoints *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_LocalityLbEndpoints_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, arena, len);
}
+typedef enum {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_load_balancer_endpoints = 7,
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_leds_cluster_locality_config = 8,
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_NOT_SET = 0
+} envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases;
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_case(const envoy_config_endpoint_v3_LocalityLbEndpoints* msg) { return (envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(28, 48), int32_t); }
+
UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct envoy_config_core_v3_Locality* envoy_config_endpoint_v3_LocalityLbEndpoints_locality(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_config_core_v3_Locality*); }
UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 32)); }
@@ -239,6 +325,10 @@ UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_Lo
UPB_INLINE uint32_t envoy_config_endpoint_v3_LocalityLbEndpoints_priority(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t); }
UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_LocalityLbEndpoints_proximity(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 7; }
+UPB_INLINE const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 7, NULL); }
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_has_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return _upb_getoneofcase(msg, UPB_SIZE(28, 48)) == 8; }
+UPB_INLINE const envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(const envoy_config_endpoint_v3_LocalityLbEndpoints *msg) { return UPB_READ_ONEOF(msg, const envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(24, 40), UPB_SIZE(28, 48), 8, NULL); }
UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_locality(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, struct envoy_config_core_v3_Locality* value) {
_upb_sethas(msg, 1);
@@ -295,6 +385,75 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_endpoint_v3_Locality
}
return sub;
}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 7);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_load_balancer_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancer_endpoints(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList*)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_load_balancer_endpoints(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_endpoint_v3_LedsClusterLocalityConfig*, UPB_SIZE(24, 40), value, UPB_SIZE(28, 48), 8);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endpoint_v3_LocalityLbEndpoints_mutable_leds_cluster_locality_config(envoy_config_endpoint_v3_LocalityLbEndpoints *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_LedsClusterLocalityConfig* sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)envoy_config_endpoint_v3_LocalityLbEndpoints_leds_cluster_locality_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_endpoint_v3_LedsClusterLocalityConfig*)_upb_msg_new(&envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_endpoint_v3_LocalityLbEndpoints_set_leds_cluster_locality_config(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList */
+
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *)_upb_msg_new(&envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena);
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *ret = envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_serialize(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_has_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_config_endpoint_v3_LbEndpoint* const* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_lb_endpoints(const envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg, size_t *len) { return (const envoy_config_endpoint_v3_LbEndpoint* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_mutable_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg, size_t *len) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_config_endpoint_v3_LbEndpoint** envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_resize_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_endpoint_v3_LbEndpoint**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_add_lb_endpoints(envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList *msg, upb_arena *arena) {
+ struct envoy_config_endpoint_v3_LbEndpoint* sub = (struct envoy_config_endpoint_v3_LbEndpoint*)_upb_msg_new(&envoy_config_endpoint_v3_LbEndpoint_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
index 560826ed31b..83ff7eb268b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/endpoint/v3/load_report.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
@@ -19,93 +19,108 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Locality_msginit},
+ {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit},
+ {.submsg = &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamLocalityStats__fields[8] = {
- {1, UPB_SIZE(44, 48), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 4, 1},
- {5, UPB_SIZE(48, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(40, 40), 0, 0, 13, 1},
- {7, UPB_SIZE(52, 64), 0, 2, 11, 3},
- {8, UPB_SIZE(32, 32), 0, 0, 4, 1},
+ {1, UPB_SIZE(44, 48), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 24), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(48, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 40), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(52, 64), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(32, 32), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit = {
&envoy_config_endpoint_v3_UpstreamLocalityStats_submsgs[0],
&envoy_config_endpoint_v3_UpstreamLocalityStats__fields[0],
- UPB_SIZE(56, 72), 8, false, 255,
+ UPB_SIZE(56, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = {
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_UpstreamEndpointStats__fields[7] = {
- {1, UPB_SIZE(40, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 4, 1},
- {5, UPB_SIZE(48, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(44, 48), 2, 2, 11, 1},
- {7, UPB_SIZE(32, 32), 0, 0, 4, 1},
+ {1, UPB_SIZE(40, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 24), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(48, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(44, 48), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 32), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit = {
&envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[0],
&envoy_config_endpoint_v3_UpstreamEndpointStats__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(56, 64), 7, _UPB_MSGEXT_NONE, 7, 255,
};
static const upb_msglayout_field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 1, 1},
+ {1, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = {
NULL,
&envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0],
- UPB_SIZE(24, 32), 3, false, 255,
+ UPB_SIZE(24, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_endpoint_v3_ClusterStats_submsgs[3] = {
- &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
- &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_endpoint_v3_ClusterStats_submsgs[3] = {
+ {.submsg = &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit},
+ {.submsg = &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats__fields[6] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(36, 56), 0, 1, 11, 3},
- {3, UPB_SIZE(8, 8), 0, 0, 4, 1},
- {4, UPB_SIZE(32, 48), 1, 2, 11, 1},
- {5, UPB_SIZE(40, 64), 0, 0, 11, 3},
- {6, UPB_SIZE(24, 32), 0, 0, 9, 1},
+ {1, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(36, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 48), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit = {
&envoy_config_endpoint_v3_ClusterStats_submsgs[0],
&envoy_config_endpoint_v3_ClusterStats__fields[0],
- UPB_SIZE(48, 80), 6, false, 255,
+ UPB_SIZE(48, 80), 6, _UPB_MSGEXT_NONE, 6, 255,
};
static const upb_msglayout_field envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit = {
NULL,
&envoy_config_endpoint_v3_ClusterStats_DroppedRequests__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
+ &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
+ &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
+ &envoy_config_endpoint_v3_ClusterStats_msginit,
+ &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
+};
+
+const upb_msglayout_file envoy_config_endpoint_v3_load_report_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
index d986e182407..283741b8b5c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
#define ENVOY_CONFIG_ENDPOINT_V3_LOAD_REPORT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -53,13 +53,19 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint
UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_UpstreamLocalityStats *ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats *envoy_config_endpoint_v3_UpstreamLocalityStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_UpstreamLocalityStats *ret = envoy_config_endpoint_v3_UpstreamLocalityStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_UpstreamLocalityStats_serialize(const envoy_config_endpoint_v3_UpstreamLocalityStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, arena, len);
@@ -140,13 +146,19 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint
UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_UpstreamEndpointStats *ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats *envoy_config_endpoint_v3_UpstreamEndpointStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_UpstreamEndpointStats *ret = envoy_config_endpoint_v3_UpstreamEndpointStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_UpstreamEndpointStats_serialize(const envoy_config_endpoint_v3_UpstreamEndpointStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, arena, len);
@@ -223,13 +235,19 @@ UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoi
UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_EndpointLoadMetricStats *ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats *envoy_config_endpoint_v3_EndpointLoadMetricStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_EndpointLoadMetricStats *ret = envoy_config_endpoint_v3_EndpointLoadMetricStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_EndpointLoadMetricStats_serialize(const envoy_config_endpoint_v3_EndpointLoadMetricStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, arena, len);
@@ -257,13 +275,19 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_Clust
UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_ClusterStats *ret = envoy_config_endpoint_v3_ClusterStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_ClusterStats *envoy_config_endpoint_v3_ClusterStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_ClusterStats *ret = envoy_config_endpoint_v3_ClusterStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_serialize(const envoy_config_endpoint_v3_ClusterStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, arena, len);
@@ -336,13 +360,19 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_e
UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_endpoint_v3_ClusterStats_DroppedRequests *ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_endpoint_v3_ClusterStats_DroppedRequests *ret = envoy_config_endpoint_v3_ClusterStats_DroppedRequests_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_endpoint_v3_ClusterStats_DroppedRequests_serialize(const envoy_config_endpoint_v3_ClusterStats_DroppedRequests *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, arena, len);
@@ -358,6 +388,8 @@ UPB_INLINE void envoy_config_endpoint_v3_ClusterStats_DroppedRequests_set_droppe
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
}
+extern const upb_msglayout_file envoy_config_endpoint_v3_load_report_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
index e016fffa22a..998c04f8309 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/api_listener.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -15,18 +15,29 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_ApiListener_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_ApiListener_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_ApiListener__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_ApiListener_msginit = {
&envoy_config_listener_v3_ApiListener_submsgs[0],
&envoy_config_listener_v3_ApiListener__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_listener_v3_ApiListener_msginit,
+};
+
+const upb_msglayout_file envoy_config_listener_v3_api_listener_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
index 9d1372b4e82..f2092168f4a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
#define ENVOY_CONFIG_LISTENER_V3_API_LISTENER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiLis
UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ApiListener *ret = envoy_config_listener_v3_ApiListener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ApiListener *envoy_config_listener_v3_ApiListener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ApiListener *ret = envoy_config_listener_v3_ApiListener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ApiListener_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ApiListener_serialize(const envoy_config_listener_v3_ApiListener *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ApiListener_msginit, arena, len);
@@ -64,6 +70,8 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_ApiListener_muta
return sub;
}
+extern const upb_msglayout_file envoy_config_listener_v3_api_listener_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
index e7e0cad8756..1eecd6ffc58 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c
@@ -7,12 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/listener.upb.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
-#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/core/v3/socket_option.upb.h"
#include "envoy/config/listener/v3/api_listener.upb.h"
#include "envoy/config/listener/v3/listener_components.upb.h"
@@ -20,6 +19,7 @@
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "xds/core/v3/collection_entry.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/security.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -27,103 +27,127 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
- &xds_core_v3_CollectionEntry_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_ListenerCollection_submsgs[1] = {
+ {.submsg = &xds_core_v3_CollectionEntry_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_ListenerCollection__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit = {
&envoy_config_listener_v3_ListenerCollection_submsgs[0],
&envoy_config_listener_v3_ListenerCollection__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_submsgs[14] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_SocketOption_msginit,
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_listener_v3_ApiListener_msginit,
- &envoy_config_listener_v3_FilterChain_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
- &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
- &envoy_config_listener_v3_ListenerFilter_msginit,
- &envoy_config_listener_v3_UdpListenerConfig_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_listener_v3_Listener__fields[25] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 32), 1, 1, 11, 1},
- {3, UPB_SIZE(88, 160), 0, 6, 11, 3},
- {4, UPB_SIZE(28, 40), 2, 11, 11, 1},
- {5, UPB_SIZE(32, 48), 3, 13, 11, 1},
- {6, UPB_SIZE(36, 56), 4, 2, 11, 1},
- {7, UPB_SIZE(40, 64), 5, 8, 11, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {9, UPB_SIZE(92, 168), 0, 9, 11, 3},
- {10, UPB_SIZE(44, 72), 6, 11, 11, 1},
- {11, UPB_SIZE(48, 80), 7, 11, 11, 1},
- {12, UPB_SIZE(52, 88), 8, 13, 11, 1},
- {13, UPB_SIZE(96, 176), 0, 3, 11, 3},
- {15, UPB_SIZE(56, 96), 9, 12, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(12, 12), 0, 0, 8, 1},
- {18, UPB_SIZE(60, 104), 10, 10, 11, 1},
- {19, UPB_SIZE(64, 112), 11, 5, 11, 1},
- {20, UPB_SIZE(68, 120), 12, 7, 11, 1},
- {21, UPB_SIZE(13, 13), 0, 0, 8, 1},
- {22, UPB_SIZE(100, 184), 0, 0, 11, 3},
- {23, UPB_SIZE(72, 128), 13, 4, 11, 1},
- {24, UPB_SIZE(76, 136), 14, 13, 11, 1},
- {25, UPB_SIZE(80, 144), 15, 6, 11, 1},
- {26, UPB_SIZE(84, 152), 16, 11, 11, 1},
+static const upb_msglayout_sub envoy_config_listener_v3_Listener_submsgs[14] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_core_v3_SocketOption_msginit},
+ {.submsg = &envoy_config_listener_v3_ApiListener_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChain_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_DeprecatedV1_msginit},
+ {.submsg = &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilter_msginit},
+ {.submsg = &envoy_config_listener_v3_UdpListenerConfig_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_Listener__fields[27] = {
+ {1, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 48), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(96, 176), 0, 5, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(36, 56), 2, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 64), 3, 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(44, 72), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(48, 80), 5, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(100, 184), 0, 9, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(52, 88), 6, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(56, 96), 7, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(60, 104), 8, 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(104, 192), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(64, 112), 9, 12, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(12, 12), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(68, 120), 10, 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(72, 128), 11, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(76, 136), 12, 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(13, 13), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(108, 200), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(80, 144), 13, 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(84, 152), 14, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(88, 160), 15, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {27, UPB_SIZE(112, 208), UPB_SIZE(-117, -217), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {28, UPB_SIZE(24, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {29, UPB_SIZE(92, 168), 16, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_Listener_msginit = {
&envoy_config_listener_v3_Listener_submsgs[0],
&envoy_config_listener_v3_Listener__fields[0],
- UPB_SIZE(104, 192), 25, false, 255,
+ UPB_SIZE(120, 224), 27, _UPB_MSGEXT_NONE, 13, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_Listener_DeprecatedV1__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit = {
&envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[0],
&envoy_config_listener_v3_Listener_DeprecatedV1__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = {
+ {.submsg = &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit = {
&envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[0],
&envoy_config_listener_v3_Listener_ConnectionBalanceConfig__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+const upb_msglayout envoy_config_listener_v3_Listener_InternalListenerConfig_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[6] = {
+ &envoy_config_listener_v3_ListenerCollection_msginit,
+ &envoy_config_listener_v3_Listener_msginit,
+ &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
+ &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
+ &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_listener_v3_listener_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 6,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
index 1d133733cba..fb39fe2458f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
#define ENVOY_CONFIG_LISTENER_V3_LISTENER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,21 +25,23 @@ struct envoy_config_listener_v3_Listener;
struct envoy_config_listener_v3_Listener_DeprecatedV1;
struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
+struct envoy_config_listener_v3_Listener_InternalListenerConfig;
typedef struct envoy_config_listener_v3_ListenerCollection envoy_config_listener_v3_ListenerCollection;
typedef struct envoy_config_listener_v3_Listener envoy_config_listener_v3_Listener;
typedef struct envoy_config_listener_v3_Listener_DeprecatedV1 envoy_config_listener_v3_Listener_DeprecatedV1;
typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig envoy_config_listener_v3_Listener_ConnectionBalanceConfig;
typedef struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance;
+typedef struct envoy_config_listener_v3_Listener_InternalListenerConfig envoy_config_listener_v3_Listener_InternalListenerConfig;
extern const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit;
extern const upb_msglayout envoy_config_listener_v3_Listener_msginit;
extern const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit;
extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit;
extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit;
+extern const upb_msglayout envoy_config_listener_v3_Listener_InternalListenerConfig_msginit;
struct envoy_config_accesslog_v3_AccessLog;
struct envoy_config_core_v3_Address;
struct envoy_config_core_v3_Metadata;
struct envoy_config_core_v3_SocketOption;
-struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_listener_v3_ApiListener;
struct envoy_config_listener_v3_FilterChain;
struct envoy_config_listener_v3_ListenerFilter;
@@ -52,7 +54,6 @@ extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
extern const upb_msglayout envoy_config_core_v3_Address_msginit;
extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
@@ -76,13 +77,19 @@ UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3
UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ListenerCollection *ret = envoy_config_listener_v3_ListenerCollection_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ListenerCollection *envoy_config_listener_v3_ListenerCollection_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ListenerCollection *ret = envoy_config_listener_v3_ListenerCollection_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerCollection_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ListenerCollection_serialize(const envoy_config_listener_v3_ListenerCollection *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, arena, len);
@@ -113,70 +120,85 @@ UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_
UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_Listener *ret = envoy_config_listener_v3_Listener_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_Listener *envoy_config_listener_v3_Listener_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_Listener *ret = envoy_config_listener_v3_Listener_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_Listener_serialize(const envoy_config_listener_v3_Listener *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_Listener_msginit, arena, len);
}
+typedef enum {
+ envoy_config_listener_v3_Listener_listener_specifier_internal_listener = 27,
+ envoy_config_listener_v3_Listener_listener_specifier_NOT_SET = 0
+} envoy_config_listener_v3_Listener_listener_specifier_oneofcases;
+UPB_INLINE envoy_config_listener_v3_Listener_listener_specifier_oneofcases envoy_config_listener_v3_Listener_listener_specifier_case(const envoy_config_listener_v3_Listener* msg) { return (envoy_config_listener_v3_Listener_listener_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(116, 216), int32_t); }
+
UPB_INLINE upb_strview envoy_config_listener_v3_Listener_name(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_address(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_address(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), const struct envoy_config_core_v3_Address*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chains(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(88, 160)); }
-UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_accessor(msg, UPB_SIZE(88, 160), len); }
+UPB_INLINE const struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_address(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const struct envoy_config_core_v3_Address*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_filter_chains(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 176)); }
+UPB_INLINE const struct envoy_config_listener_v3_FilterChain* const* envoy_config_listener_v3_Listener_filter_chains(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_FilterChain* const*)_upb_array_accessor(msg, UPB_SIZE(96, 176), len); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_use_original_dst(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_use_original_dst(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_use_original_dst(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_metadata(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_metadata(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_metadata(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct envoy_config_core_v3_Metadata*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const envoy_config_listener_v3_Listener_DeprecatedV1*); }
+UPB_INLINE const envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_deprecated_v1(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const envoy_config_listener_v3_Listener_DeprecatedV1*); }
UPB_INLINE int32_t envoy_config_listener_v3_Listener_drain_type(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(92, 168)); }
-UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_accessor(msg, UPB_SIZE(92, 168), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); }
+UPB_INLINE const struct envoy_config_listener_v3_ListenerFilter* const* envoy_config_listener_v3_Listener_listener_filters(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_listener_v3_ListenerFilter* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_transparent(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_transparent(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_transparent(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_freebind(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_freebind(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_freebind(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 88), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_socket_options(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(96, 176)); }
-UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(96, 176), len); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_socket_options(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(104, 192)); }
+UPB_INLINE const struct envoy_config_core_v3_SocketOption* const* envoy_config_listener_v3_Listener_socket_options(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_core_v3_SocketOption* const*)_upb_array_accessor(msg, UPB_SIZE(104, 192), len); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_Listener_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 96), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_Listener_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), const struct google_protobuf_Duration*); }
UPB_INLINE int32_t envoy_config_listener_v3_Listener_traffic_direction(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE bool envoy_config_listener_v3_Listener_continue_on_listener_filters_timeout(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE const struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 104), const struct envoy_config_listener_v3_UdpListenerConfig*); }
+UPB_INLINE const struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_udp_listener_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const struct envoy_config_listener_v3_UdpListenerConfig*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_api_listener(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE const struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_api_listener(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 112), const struct envoy_config_listener_v3_ApiListener*); }
+UPB_INLINE const struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_api_listener(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const struct envoy_config_listener_v3_ApiListener*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_has_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 120), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*); }
+UPB_INLINE const envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_connection_balance_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const envoy_config_listener_v3_Listener_ConnectionBalanceConfig*); }
UPB_INLINE bool envoy_config_listener_v3_Listener_reuse_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_access_log(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(100, 184)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(100, 184), len); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_udp_writer_config(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 128), const struct envoy_config_core_v3_TypedExtensionConfig*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const struct google_protobuf_UInt32Value*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE const struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const struct envoy_config_listener_v3_FilterChain*); }
-UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_access_log(const envoy_config_listener_v3_Listener *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(108, 200)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_config_listener_v3_Listener_access_log(const envoy_config_listener_v3_Listener *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(108, 200), len); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 13); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_tcp_backlog_size(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 144), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 14); }
+UPB_INLINE const struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_default_filter_chain(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 152), const struct envoy_config_listener_v3_FilterChain*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 15); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_bind_to_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 160), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_internal_listener(const envoy_config_listener_v3_Listener *msg) { return _upb_getoneofcase(msg, UPB_SIZE(116, 216)) == 27; }
+UPB_INLINE const envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_internal_listener(const envoy_config_listener_v3_Listener *msg) { return UPB_READ_ONEOF(msg, const envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(112, 208), UPB_SIZE(116, 216), 27, NULL); }
+UPB_INLINE upb_strview envoy_config_listener_v3_Listener_stat_prefix(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_strview); }
+UPB_INLINE bool envoy_config_listener_v3_Listener_has_enable_reuse_port(const envoy_config_listener_v3_Listener *msg) { return _upb_hasbit(msg, 16); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_enable_reuse_port(const envoy_config_listener_v3_Listener *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 168), const struct google_protobuf_BoolValue*); }
UPB_INLINE void envoy_config_listener_v3_Listener_set_name(envoy_config_listener_v3_Listener *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_address(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Address* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(24, 32), struct envoy_config_core_v3_Address*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct envoy_config_core_v3_Address*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listener_mutable_address(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_core_v3_Address* sub = (struct envoy_config_core_v3_Address*)envoy_config_listener_v3_Listener_address(msg);
@@ -188,21 +210,21 @@ UPB_INLINE struct envoy_config_core_v3_Address* envoy_config_listener_v3_Listene
return sub;
}
UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_mutable_filter_chains(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_listener_v3_FilterChain**)_upb_array_mutable_accessor(msg, UPB_SIZE(88, 160), len);
+ return (struct envoy_config_listener_v3_FilterChain**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 176), len);
}
UPB_INLINE struct envoy_config_listener_v3_FilterChain** envoy_config_listener_v3_Listener_resize_filter_chains(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_listener_v3_FilterChain**)_upb_array_resize_accessor2(msg, UPB_SIZE(88, 160), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_listener_v3_FilterChain**)_upb_array_resize_accessor2(msg, UPB_SIZE(96, 176), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_add_filter_chains(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)_upb_msg_new(&envoy_config_listener_v3_FilterChain_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(88, 160), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(96, 176), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_use_original_dst(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(28, 40), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_use_original_dst(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_use_original_dst(msg);
@@ -215,7 +237,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 48), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), struct google_protobuf_UInt32Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_per_connection_buffer_limit_bytes(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_per_connection_buffer_limit_bytes(msg);
@@ -228,7 +250,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_metadata(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(36, 56), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct envoy_config_core_v3_Metadata*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listener_mutable_metadata(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_listener_v3_Listener_metadata(msg);
@@ -241,7 +263,7 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_listener_v3_Listen
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_deprecated_v1(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_DeprecatedV1* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 64), envoy_config_listener_v3_Listener_DeprecatedV1*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), envoy_config_listener_v3_Listener_DeprecatedV1*) = value;
}
UPB_INLINE struct envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener_v3_Listener_mutable_deprecated_v1(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_Listener_DeprecatedV1* sub = (struct envoy_config_listener_v3_Listener_DeprecatedV1*)envoy_config_listener_v3_Listener_deprecated_v1(msg);
@@ -256,21 +278,21 @@ UPB_INLINE void envoy_config_listener_v3_Listener_set_drain_type(envoy_config_li
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_mutable_listener_filters(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(92, 168), len);
+ return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 184), len);
}
UPB_INLINE struct envoy_config_listener_v3_ListenerFilter** envoy_config_listener_v3_Listener_resize_listener_filters(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_resize_accessor2(msg, UPB_SIZE(92, 168), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_listener_v3_ListenerFilter**)_upb_array_resize_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Listener_add_listener_filters(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_ListenerFilter* sub = (struct envoy_config_listener_v3_ListenerFilter*)_upb_msg_new(&envoy_config_listener_v3_ListenerFilter_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(92, 168), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_transparent(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 88), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_transparent(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_transparent(msg);
@@ -283,7 +305,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_freebind(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_freebind(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_freebind(msg);
@@ -296,7 +318,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 88), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct google_protobuf_UInt32Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_fast_open_queue_length(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_fast_open_queue_length(msg);
@@ -308,21 +330,21 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener
return sub;
}
UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_mutable_socket_options(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(96, 176), len);
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(104, 192), len);
}
UPB_INLINE struct envoy_config_core_v3_SocketOption** envoy_config_listener_v3_Listener_resize_socket_options(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(96, 176), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_SocketOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(104, 192), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_SocketOption* envoy_config_listener_v3_Listener_add_socket_options(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_core_v3_SocketOption* sub = (struct envoy_config_core_v3_SocketOption*)_upb_msg_new(&envoy_config_core_v3_SocketOption_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(96, 176), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(104, 192), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 96), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_Listener_mutable_listener_filters_timeout(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_Listener_listener_filters_timeout(msg);
@@ -341,7 +363,7 @@ UPB_INLINE void envoy_config_listener_v3_Listener_set_continue_on_listener_filte
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_listener_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_UdpListenerConfig* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 104), struct envoy_config_listener_v3_UdpListenerConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 120), struct envoy_config_listener_v3_UdpListenerConfig*) = value;
}
UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_Listener_mutable_udp_listener_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_UdpListenerConfig* sub = (struct envoy_config_listener_v3_UdpListenerConfig*)envoy_config_listener_v3_Listener_udp_listener_config(msg);
@@ -354,7 +376,7 @@ UPB_INLINE struct envoy_config_listener_v3_UdpListenerConfig* envoy_config_liste
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_api_listener(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_ApiListener* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 112), struct envoy_config_listener_v3_ApiListener*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 128), struct envoy_config_listener_v3_ApiListener*) = value;
}
UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_Listener_mutable_api_listener(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_ApiListener* sub = (struct envoy_config_listener_v3_ApiListener*)envoy_config_listener_v3_Listener_api_listener(msg);
@@ -367,7 +389,7 @@ UPB_INLINE struct envoy_config_listener_v3_ApiListener* envoy_config_listener_v3
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_connection_balance_config(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_ConnectionBalanceConfig* value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 120), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 136), envoy_config_listener_v3_Listener_ConnectionBalanceConfig*) = value;
}
UPB_INLINE struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_config_listener_v3_Listener_mutable_connection_balance_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig* sub = (struct envoy_config_listener_v3_Listener_ConnectionBalanceConfig*)envoy_config_listener_v3_Listener_connection_balance_config(msg);
@@ -382,34 +404,21 @@ UPB_INLINE void envoy_config_listener_v3_Listener_set_reuse_port(envoy_config_li
*UPB_PTR_AT(msg, UPB_SIZE(13, 13), bool) = value;
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_mutable_access_log(envoy_config_listener_v3_Listener *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(100, 184), len);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(108, 200), len);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_config_listener_v3_Listener_resize_access_log(envoy_config_listener_v3_Listener *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(100, 184), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(108, 200), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_config_listener_v3_Listener_add_access_log(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(100, 184), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(108, 200), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
-UPB_INLINE void envoy_config_listener_v3_Listener_set_udp_writer_config(envoy_config_listener_v3_Listener *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
- _upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 128), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
-}
-UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_Listener_mutable_udp_writer_config(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
- struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_Listener_udp_writer_config(msg);
- if (sub == NULL) {
- sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
- if (!sub) return NULL;
- envoy_config_listener_v3_Listener_set_udp_writer_config(msg, sub);
- }
- return sub;
-}
UPB_INLINE void envoy_config_listener_v3_Listener_set_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, struct google_protobuf_UInt32Value* value) {
- _upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 136), struct google_protobuf_UInt32Value*) = value;
+ _upb_sethas(msg, 13);
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 144), struct google_protobuf_UInt32Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener_mutable_tcp_backlog_size(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_Listener_tcp_backlog_size(msg);
@@ -421,8 +430,8 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_Listener
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_default_filter_chain(envoy_config_listener_v3_Listener *msg, struct envoy_config_listener_v3_FilterChain* value) {
- _upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 144), struct envoy_config_listener_v3_FilterChain*) = value;
+ _upb_sethas(msg, 14);
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 152), struct envoy_config_listener_v3_FilterChain*) = value;
}
UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Listener_mutable_default_filter_chain(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct envoy_config_listener_v3_FilterChain* sub = (struct envoy_config_listener_v3_FilterChain*)envoy_config_listener_v3_Listener_default_filter_chain(msg);
@@ -434,8 +443,8 @@ UPB_INLINE struct envoy_config_listener_v3_FilterChain* envoy_config_listener_v3
return sub;
}
UPB_INLINE void envoy_config_listener_v3_Listener_set_bind_to_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
- _upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 152), struct google_protobuf_BoolValue*) = value;
+ _upb_sethas(msg, 15);
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 160), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_bind_to_port(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_bind_to_port(msg);
@@ -446,6 +455,34 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_m
}
return sub;
}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_internal_listener(envoy_config_listener_v3_Listener *msg, envoy_config_listener_v3_Listener_InternalListenerConfig* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_listener_v3_Listener_InternalListenerConfig*, UPB_SIZE(112, 208), value, UPB_SIZE(116, 216), 27);
+}
+UPB_INLINE struct envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_config_listener_v3_Listener_mutable_internal_listener(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_Listener_InternalListenerConfig* sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)envoy_config_listener_v3_Listener_internal_listener(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_listener_v3_Listener_InternalListenerConfig*)_upb_msg_new(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_internal_listener(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_stat_prefix(envoy_config_listener_v3_Listener *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_config_listener_v3_Listener_set_enable_reuse_port(envoy_config_listener_v3_Listener *msg, struct google_protobuf_BoolValue* value) {
+ _upb_sethas(msg, 16);
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 168), struct google_protobuf_BoolValue*) = value;
+}
+UPB_INLINE struct google_protobuf_BoolValue* envoy_config_listener_v3_Listener_mutable_enable_reuse_port(envoy_config_listener_v3_Listener *msg, upb_arena *arena) {
+ struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_config_listener_v3_Listener_enable_reuse_port(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_Listener_set_enable_reuse_port(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.listener.v3.Listener.DeprecatedV1 */
@@ -455,13 +492,19 @@ UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener
UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_Listener_DeprecatedV1 *ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1 *envoy_config_listener_v3_Listener_DeprecatedV1_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_Listener_DeprecatedV1 *ret = envoy_config_listener_v3_Listener_DeprecatedV1_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_Listener_DeprecatedV1_serialize(const envoy_config_listener_v3_Listener_DeprecatedV1 *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, arena, len);
@@ -492,13 +535,19 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_conf
UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_Listener_ConnectionBalanceConfig *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_Listener_ConnectionBalanceConfig *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, arena, len);
@@ -534,13 +583,19 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalanc
UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *ret = envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_serialize(const envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, arena, len);
@@ -548,6 +603,36 @@ UPB_INLINE char *envoy_config_listener_v3_Listener_ConnectionBalanceConfig_Exact
+/* envoy.config.listener.v3.Listener.InternalListenerConfig */
+
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig *envoy_config_listener_v3_Listener_InternalListenerConfig_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_Listener_InternalListenerConfig *)_upb_msg_new(&envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig *envoy_config_listener_v3_Listener_InternalListenerConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener_InternalListenerConfig *ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig *envoy_config_listener_v3_Listener_InternalListenerConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_listener_v3_Listener_InternalListenerConfig *ret = envoy_config_listener_v3_Listener_InternalListenerConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_listener_v3_Listener_InternalListenerConfig_serialize(const envoy_config_listener_v3_Listener_InternalListenerConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, arena, len);
+}
+
+
+
+extern const upb_msglayout_file envoy_config_listener_v3_listener_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
index 303b6ab7410..89dc479ae33 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/listener_components.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/config/core/v3/base.upb.h"
@@ -16,143 +16,162 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_Filter_submsgs[2] = {
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_Filter_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_Filter__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_Filter_msginit = {
&envoy_config_listener_v3_Filter_submsgs[0],
&envoy_config_listener_v3_Filter__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChainMatch_submsgs[2] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_FilterChainMatch_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_listener_v3_FilterChainMatch__fields[10] = {
- {3, UPB_SIZE(32, 56), 0, 0, 11, 3},
- {4, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {5, UPB_SIZE(24, 40), 1, 1, 11, 1},
- {6, UPB_SIZE(36, 64), 0, 0, 11, 3},
- {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_LABEL_PACKED},
- {8, UPB_SIZE(28, 48), 2, 1, 11, 1},
- {9, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {10, UPB_SIZE(44, 80), 0, 0, 9, 3},
- {11, UPB_SIZE(48, 88), 0, 0, 9, 3},
- {12, UPB_SIZE(4, 4), 0, 0, 14, 1},
+static const upb_msglayout_field envoy_config_listener_v3_FilterChainMatch__fields[11] = {
+ {3, UPB_SIZE(32, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(24, 40), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(36, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(40, 72), 0, 0, 13, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(44, 80), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(48, 88), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(52, 96), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit = {
&envoy_config_listener_v3_FilterChainMatch_submsgs[0],
&envoy_config_listener_v3_FilterChainMatch__fields[0],
- UPB_SIZE(56, 96), 10, false, 255,
+ UPB_SIZE(56, 112), 11, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_submsgs[7] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_listener_v3_Filter_msginit,
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
- &envoy_config_listener_v3_FilterChainMatch_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_FilterChain_submsgs[7] = {
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_core_v3_TransportSocket_msginit},
+ {.submsg = &envoy_config_listener_v3_Filter_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit},
+ {.submsg = &envoy_config_listener_v3_FilterChainMatch_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_FilterChain__fields[8] = {
- {1, UPB_SIZE(12, 24), 1, 4, 11, 1},
- {3, UPB_SIZE(36, 72), 0, 2, 11, 3},
- {4, UPB_SIZE(16, 32), 2, 5, 11, 1},
- {5, UPB_SIZE(20, 40), 3, 0, 11, 1},
- {6, UPB_SIZE(24, 48), 4, 1, 11, 1},
- {7, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {8, UPB_SIZE(28, 56), 5, 3, 11, 1},
- {9, UPB_SIZE(32, 64), 6, 6, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(36, 72), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 48), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 56), 5, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 64), 6, 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_FilterChain_msginit = {
&envoy_config_listener_v3_FilterChain_submsgs[0],
&envoy_config_listener_v3_FilterChain__fields[0],
- UPB_SIZE(40, 80), 8, false, 255,
+ UPB_SIZE(40, 80), 8, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit = {
&envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[0],
&envoy_config_listener_v3_FilterChain_OnDemandConfiguration__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[3] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
- &envoy_type_v3_Int32Range_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[3] = {
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit},
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit},
+ {.submsg = &envoy_type_v3_Int32Range_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[5] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit = {
&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[0],
&envoy_config_listener_v3_ListenerFilterChainMatchPredicate__fields[0],
- UPB_SIZE(8, 16), 5, false, 255,
+ UPB_SIZE(8, 16), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = {
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit = {
&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[0],
&envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_listener_v3_ListenerFilter_submsgs[2] = {
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_ListenerFilter_submsgs[2] = {
+ {.submsg = &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_ListenerFilter__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, 1},
- {4, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit = {
&envoy_config_listener_v3_ListenerFilter_submsgs[0],
&envoy_config_listener_v3_ListenerFilter__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[7] = {
+ &envoy_config_listener_v3_Filter_msginit,
+ &envoy_config_listener_v3_FilterChainMatch_msginit,
+ &envoy_config_listener_v3_FilterChain_msginit,
+ &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
+ &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
+ &envoy_config_listener_v3_ListenerFilter_msginit,
+};
+
+const upb_msglayout_file envoy_config_listener_v3_listener_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 7,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
index b8ef3826e3c..ab7d020f490 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
#define ENVOY_CONFIG_LISTENER_V3_LISTENER_COMPONENTS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -75,13 +75,19 @@ UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_new(
UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_Filter *ret = envoy_config_listener_v3_Filter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_Filter *envoy_config_listener_v3_Filter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_Filter *ret = envoy_config_listener_v3_Filter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_Filter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_Filter_serialize(const envoy_config_listener_v3_Filter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_Filter_msginit, arena, len);
@@ -136,13 +142,19 @@ UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_F
UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_FilterChainMatch *ret = envoy_config_listener_v3_FilterChainMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_FilterChainMatch *envoy_config_listener_v3_FilterChainMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_FilterChainMatch *ret = envoy_config_listener_v3_FilterChainMatch_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChainMatch_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_FilterChainMatch_serialize(const envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, arena, len);
@@ -162,6 +174,8 @@ UPB_INLINE upb_strview envoy_config_listener_v3_FilterChainMatch_transport_proto
UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_application_protocols(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
UPB_INLINE upb_strview const* envoy_config_listener_v3_FilterChainMatch_server_names(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(48, 88), len); }
UPB_INLINE int32_t envoy_config_listener_v3_FilterChainMatch_source_type(const envoy_config_listener_v3_FilterChainMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_has_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 96)); }
+UPB_INLINE const struct envoy_config_core_v3_CidrRange* const* envoy_config_listener_v3_FilterChainMatch_direct_source_prefix_ranges(const envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) { return (const struct envoy_config_core_v3_CidrRange* const*)_upb_array_accessor(msg, UPB_SIZE(52, 96), len); }
UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
@@ -254,6 +268,19 @@ UPB_INLINE bool envoy_config_listener_v3_FilterChainMatch_add_server_names(envoy
UPB_INLINE void envoy_config_listener_v3_FilterChainMatch_set_source_type(envoy_config_listener_v3_FilterChainMatch *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_mutable_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t *len) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 96), len);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange** envoy_config_listener_v3_FilterChainMatch_resize_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_CidrRange**)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 96), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_CidrRange* envoy_config_listener_v3_FilterChainMatch_add_direct_source_prefix_ranges(envoy_config_listener_v3_FilterChainMatch *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_CidrRange* sub = (struct envoy_config_core_v3_CidrRange*)_upb_msg_new(&envoy_config_core_v3_CidrRange_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(52, 96), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
/* envoy.config.listener.v3.FilterChain */
@@ -263,13 +290,19 @@ UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_Filter
UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_FilterChain *ret = envoy_config_listener_v3_FilterChain_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_FilterChain *envoy_config_listener_v3_FilterChain_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_FilterChain *ret = envoy_config_listener_v3_FilterChain_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_FilterChain_serialize(const envoy_config_listener_v3_FilterChain *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_FilterChain_msginit, arena, len);
@@ -394,13 +427,19 @@ UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_con
UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_FilterChain_OnDemandConfiguration *ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_FilterChain_OnDemandConfiguration *ret = envoy_config_listener_v3_FilterChain_OnDemandConfiguration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_FilterChain_OnDemandConfiguration_serialize(const envoy_config_listener_v3_FilterChain_OnDemandConfiguration *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, arena, len);
@@ -431,13 +470,19 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_con
UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ListenerFilterChainMatchPredicate *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ListenerFilterChainMatchPredicate *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, arena, len);
@@ -524,13 +569,19 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *
UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *ret = envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_serialize(const envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, arena, len);
@@ -561,13 +612,19 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_Lis
UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ListenerFilter *ret = envoy_config_listener_v3_ListenerFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ListenerFilter *envoy_config_listener_v3_ListenerFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ListenerFilter *ret = envoy_config_listener_v3_ListenerFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ListenerFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ListenerFilter_serialize(const envoy_config_listener_v3_ListenerFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, arena, len);
@@ -614,6 +671,8 @@ UPB_INLINE struct envoy_config_listener_v3_ListenerFilterChainMatchPredicate* en
return sub;
}
+extern const upb_msglayout_file envoy_config_listener_v3_listener_components_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c
new file mode 100644
index 00000000000..4f5d6d4a549
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c
@@ -0,0 +1,59 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/config/listener/v3/quic_config.upb.h"
+#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
+#include "envoy/config/core/v3/protocol.upb.h"
+#include "google/protobuf/duration.upb.h"
+#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "udpa/annotations/versioning.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub envoy_config_listener_v3_QuicProtocolOptions_submsgs[5] = {
+ {.submsg = &envoy_config_core_v3_QuicProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_RuntimeFeatureFlag_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_listener_v3_QuicProtocolOptions__fields[7] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 5, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 48), 6, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 56), 7, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_listener_v3_QuicProtocolOptions_msginit = {
+ &envoy_config_listener_v3_QuicProtocolOptions_submsgs[0],
+ &envoy_config_listener_v3_QuicProtocolOptions__fields[0],
+ UPB_SIZE(32, 64), 7, _UPB_MSGEXT_NONE, 7, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_config_listener_v3_QuicProtocolOptions_msginit,
+};
+
+const upb_msglayout_file envoy_config_listener_v3_quic_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h
new file mode 100644
index 00000000000..259b366d69c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h
@@ -0,0 +1,179 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_
+#define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_config_listener_v3_QuicProtocolOptions;
+typedef struct envoy_config_listener_v3_QuicProtocolOptions envoy_config_listener_v3_QuicProtocolOptions;
+extern const upb_msglayout envoy_config_listener_v3_QuicProtocolOptions_msginit;
+struct envoy_config_core_v3_QuicProtocolOptions;
+struct envoy_config_core_v3_RuntimeFeatureFlag;
+struct envoy_config_core_v3_TypedExtensionConfig;
+struct google_protobuf_Duration;
+struct google_protobuf_UInt32Value;
+extern const upb_msglayout envoy_config_core_v3_QuicProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_UInt32Value_msginit;
+
+
+/* envoy.config.listener.v3.QuicProtocolOptions */
+
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions *envoy_config_listener_v3_QuicProtocolOptions_new(upb_arena *arena) {
+ return (envoy_config_listener_v3_QuicProtocolOptions *)_upb_msg_new(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena);
+}
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions *envoy_config_listener_v3_QuicProtocolOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_listener_v3_QuicProtocolOptions *ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions *envoy_config_listener_v3_QuicProtocolOptions_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_listener_v3_QuicProtocolOptions *ret = envoy_config_listener_v3_QuicProtocolOptions_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_QuicProtocolOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_listener_v3_QuicProtocolOptions_serialize(const envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_QuicProtocolOptions*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_enabled(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 4); }
+UPB_INLINE const struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_enabled(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_RuntimeFeatureFlag*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return _upb_hasbit(msg, 7); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(const envoy_config_listener_v3_QuicProtocolOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_QuicProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_QuicProtocolOptions* envoy_config_listener_v3_QuicProtocolOptions_mutable_quic_protocol_options(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_QuicProtocolOptions* sub = (struct envoy_config_core_v3_QuicProtocolOptions*)envoy_config_listener_v3_QuicProtocolOptions_quic_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_QuicProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_QuicProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_quic_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_idle_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_idle_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_handshake_timeout(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_listener_v3_QuicProtocolOptions_crypto_handshake_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_crypto_handshake_timeout(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_enabled(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_RuntimeFeatureFlag* value) {
+ _upb_sethas(msg, 4);
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_RuntimeFeatureFlag*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_listener_v3_QuicProtocolOptions_mutable_enabled(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_RuntimeFeatureFlag* sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)envoy_config_listener_v3_QuicProtocolOptions_enabled(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_RuntimeFeatureFlag*)_upb_msg_new(&envoy_config_core_v3_RuntimeFeatureFlag_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_enabled(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions *msg, struct google_protobuf_UInt32Value* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
+}
+UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_listener_v3_QuicProtocolOptions_mutable_packets_to_read_to_connection_count_ratio(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_listener_v3_QuicProtocolOptions_packets_to_read_to_connection_count_ratio(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_UInt32Value*)_upb_msg_new(&google_protobuf_UInt32Value_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_packets_to_read_to_connection_count_ratio(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_crypto_stream_config(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_crypto_stream_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_crypto_stream_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 7);
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 56), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_listener_v3_QuicProtocolOptions_mutable_proof_source_config(envoy_config_listener_v3_QuicProtocolOptions *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_listener_v3_QuicProtocolOptions_proof_source_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_QuicProtocolOptions_set_proof_source_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_config_listener_v3_quic_config_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
index 34696f6c0a4..2616e8e6fa7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c
@@ -7,33 +7,47 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-#include "google/protobuf/any.upb.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+#include "envoy/config/listener/v3/quic_config.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_listener_v3_UdpListenerConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_listener_v3_UdpListenerConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_UdpSocketConfig_msginit},
+ {.submsg = &envoy_config_listener_v3_QuicProtocolOptions_msginit},
};
static const upb_msglayout_field envoy_config_listener_v3_UdpListenerConfig__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {5, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit = {
&envoy_config_listener_v3_UdpListenerConfig_submsgs[0],
&envoy_config_listener_v3_UdpListenerConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_config_listener_v3_UdpListenerConfig_msginit,
+ &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
index 3de7e08d3b5..f60bdedddc9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
#define ENVOY_CONFIG_LISTENER_V3_UDP_LISTENER_CONFIG_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -26,8 +26,10 @@ typedef struct envoy_config_listener_v3_UdpListenerConfig envoy_config_listener_
typedef struct envoy_config_listener_v3_ActiveRawUdpListenerConfig envoy_config_listener_v3_ActiveRawUdpListenerConfig;
extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
extern const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
-struct google_protobuf_Any;
-extern const upb_msglayout google_protobuf_Any_msginit;
+struct envoy_config_core_v3_UdpSocketConfig;
+struct envoy_config_listener_v3_QuicProtocolOptions;
+extern const upb_msglayout envoy_config_core_v3_UdpSocketConfig_msginit;
+extern const upb_msglayout envoy_config_listener_v3_QuicProtocolOptions_msginit;
/* envoy.config.listener.v3.UdpListenerConfig */
@@ -38,40 +40,52 @@ UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_
UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_UdpListenerConfig *ret = envoy_config_listener_v3_UdpListenerConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_UdpListenerConfig *envoy_config_listener_v3_UdpListenerConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_UdpListenerConfig *ret = envoy_config_listener_v3_UdpListenerConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_UdpListenerConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_UdpListenerConfig_serialize(const envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, arena, len);
}
-typedef enum {
- envoy_config_listener_v3_UdpListenerConfig_config_type_typed_config = 3,
- envoy_config_listener_v3_UdpListenerConfig_config_type_NOT_SET = 0
-} envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases;
-UPB_INLINE envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases envoy_config_listener_v3_UdpListenerConfig_config_type_case(const envoy_config_listener_v3_UdpListenerConfig* msg) { return (envoy_config_listener_v3_UdpListenerConfig_config_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(12, 24), int32_t); }
-
-UPB_INLINE upb_strview envoy_config_listener_v3_UdpListenerConfig_udp_listener_name(const envoy_config_listener_v3_UdpListenerConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
-UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
-UPB_INLINE const struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_typed_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(8, 16), UPB_SIZE(12, 24), 3, NULL); }
+UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_UdpSocketConfig*); }
+UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_quic_options(const envoy_config_listener_v3_UdpListenerConfig *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_quic_options(const envoy_config_listener_v3_UdpListenerConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_config_listener_v3_QuicProtocolOptions*); }
-UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_udp_listener_name(envoy_config_listener_v3_UdpListenerConfig *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_core_v3_UdpSocketConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_UdpSocketConfig*) = value;
}
-UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, struct google_protobuf_Any* value) {
- UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(8, 16), value, UPB_SIZE(12, 24), 3);
+UPB_INLINE struct envoy_config_core_v3_UdpSocketConfig* envoy_config_listener_v3_UdpListenerConfig_mutable_downstream_socket_config(envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_UdpSocketConfig* sub = (struct envoy_config_core_v3_UdpSocketConfig*)envoy_config_listener_v3_UdpListenerConfig_downstream_socket_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_UdpSocketConfig*)_upb_msg_new(&envoy_config_core_v3_UdpSocketConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_listener_v3_UdpListenerConfig_set_downstream_socket_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_listener_v3_UdpListenerConfig_set_quic_options(envoy_config_listener_v3_UdpListenerConfig *msg, struct envoy_config_listener_v3_QuicProtocolOptions* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_config_listener_v3_QuicProtocolOptions*) = value;
}
-UPB_INLINE struct google_protobuf_Any* envoy_config_listener_v3_UdpListenerConfig_mutable_typed_config(envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena) {
- struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_config_listener_v3_UdpListenerConfig_typed_config(msg);
+UPB_INLINE struct envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v3_UdpListenerConfig_mutable_quic_options(envoy_config_listener_v3_UdpListenerConfig *msg, upb_arena *arena) {
+ struct envoy_config_listener_v3_QuicProtocolOptions* sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)envoy_config_listener_v3_UdpListenerConfig_quic_options(msg);
if (sub == NULL) {
- sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ sub = (struct envoy_config_listener_v3_QuicProtocolOptions*)_upb_msg_new(&envoy_config_listener_v3_QuicProtocolOptions_msginit, arena);
if (!sub) return NULL;
- envoy_config_listener_v3_UdpListenerConfig_set_typed_config(msg, sub);
+ envoy_config_listener_v3_UdpListenerConfig_set_quic_options(msg, sub);
}
return sub;
}
@@ -84,13 +98,19 @@ UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_lis
UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_listener_v3_ActiveRawUdpListenerConfig *ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig *envoy_config_listener_v3_ActiveRawUdpListenerConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_listener_v3_ActiveRawUdpListenerConfig *ret = envoy_config_listener_v3_ActiveRawUdpListenerConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize(const envoy_config_listener_v3_ActiveRawUdpListenerConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, arena, len);
@@ -98,6 +118,8 @@ UPB_INLINE char *envoy_config_listener_v3_ActiveRawUdpListenerConfig_serialize(c
+extern const upb_msglayout_file envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
index 26d00f14ea8..c74342d6d2f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/metrics/v3/stats.upb.h"
#include "envoy/config/core/v3/address.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
@@ -19,125 +19,143 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_metrics_v3_StatsSink_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_StatsSink_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_StatsSink__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit = {
&envoy_config_metrics_v3_StatsSink_submsgs[0],
&envoy_config_metrics_v3_StatsSink__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsConfig_submsgs[4] = {
- &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
- &envoy_config_metrics_v3_StatsMatcher_msginit,
- &envoy_config_metrics_v3_TagSpecifier_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_StatsConfig_submsgs[4] = {
+ {.submsg = &envoy_config_metrics_v3_HistogramBucketSettings_msginit},
+ {.submsg = &envoy_config_metrics_v3_StatsMatcher_msginit},
+ {.submsg = &envoy_config_metrics_v3_TagSpecifier_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_StatsConfig__fields[4] = {
- {1, UPB_SIZE(12, 24), 0, 2, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {3, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {1, UPB_SIZE(12, 24), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit = {
&envoy_config_metrics_v3_StatsConfig_submsgs[0],
&envoy_config_metrics_v3_StatsConfig__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_ListStringMatcher_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_StatsMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_ListStringMatcher_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_StatsMatcher__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_StatsMatcher_msginit = {
&envoy_config_metrics_v3_StatsMatcher_submsgs[0],
&envoy_config_metrics_v3_StatsMatcher__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field envoy_config_metrics_v3_TagSpecifier__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_TagSpecifier_msginit = {
NULL,
&envoy_config_metrics_v3_TagSpecifier__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_HistogramBucketSettings__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, _UPB_LABEL_PACKED},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 1, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_HistogramBucketSettings_msginit = {
&envoy_config_metrics_v3_HistogramBucketSettings_submsgs[0],
&envoy_config_metrics_v3_HistogramBucketSettings__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_metrics_v3_StatsdSink_submsgs[1] = {
- &envoy_config_core_v3_Address_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_StatsdSink_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_StatsdSink__fields[3] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 11, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-17, -33), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_StatsdSink_msginit = {
&envoy_config_metrics_v3_StatsdSink_submsgs[0],
&envoy_config_metrics_v3_StatsdSink__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = {
- &envoy_config_core_v3_Address_msginit,
- &google_protobuf_UInt64Value_msginit,
+static const upb_msglayout_sub envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Address_msginit},
+ {.submsg = &google_protobuf_UInt64Value_msginit},
};
static const upb_msglayout_field envoy_config_metrics_v3_DogStatsdSink__fields[3] = {
- {1, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), 1, 1, 11, 1},
+ {1, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_DogStatsdSink_msginit = {
&envoy_config_metrics_v3_DogStatsdSink_submsgs[0],
&envoy_config_metrics_v3_DogStatsdSink__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_metrics_v3_HystrixSink__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_metrics_v3_HystrixSink_msginit = {
NULL,
&envoy_config_metrics_v3_HystrixSink__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[8] = {
+ &envoy_config_metrics_v3_StatsSink_msginit,
+ &envoy_config_metrics_v3_StatsConfig_msginit,
+ &envoy_config_metrics_v3_StatsMatcher_msginit,
+ &envoy_config_metrics_v3_TagSpecifier_msginit,
+ &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
+ &envoy_config_metrics_v3_StatsdSink_msginit,
+ &envoy_config_metrics_v3_DogStatsdSink_msginit,
+ &envoy_config_metrics_v3_HystrixSink_msginit,
+};
+
+const upb_msglayout_file envoy_config_metrics_v3_stats_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 8,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
index dab0415ed60..423292364ba 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_
#define ENVOY_CONFIG_METRICS_V3_STATS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -66,13 +66,19 @@ UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_
UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_StatsSink *ret = envoy_config_metrics_v3_StatsSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_StatsSink *envoy_config_metrics_v3_StatsSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_StatsSink *ret = envoy_config_metrics_v3_StatsSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsSink_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_StatsSink_serialize(const envoy_config_metrics_v3_StatsSink *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, arena, len);
@@ -112,13 +118,19 @@ UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsCon
UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_StatsConfig *ret = envoy_config_metrics_v3_StatsConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_StatsConfig *envoy_config_metrics_v3_StatsConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_StatsConfig *ret = envoy_config_metrics_v3_StatsConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_StatsConfig_serialize(const envoy_config_metrics_v3_StatsConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, arena, len);
@@ -194,13 +206,19 @@ UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMa
UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_StatsMatcher *ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_StatsMatcher *envoy_config_metrics_v3_StatsMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_StatsMatcher *ret = envoy_config_metrics_v3_StatsMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_StatsMatcher_serialize(const envoy_config_metrics_v3_StatsMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, arena, len);
@@ -257,13 +275,19 @@ UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpec
UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpecifier_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_TagSpecifier *ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_TagSpecifier *envoy_config_metrics_v3_TagSpecifier_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_TagSpecifier *ret = envoy_config_metrics_v3_TagSpecifier_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_TagSpecifier_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_TagSpecifier_serialize(const envoy_config_metrics_v3_TagSpecifier *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, arena, len);
@@ -300,13 +324,19 @@ UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics
UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics_v3_HistogramBucketSettings_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_HistogramBucketSettings *ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings *envoy_config_metrics_v3_HistogramBucketSettings_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_HistogramBucketSettings *ret = envoy_config_metrics_v3_HistogramBucketSettings_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_HistogramBucketSettings_serialize(const envoy_config_metrics_v3_HistogramBucketSettings *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, arena, len);
@@ -348,13 +378,19 @@ UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSin
UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSink_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_StatsdSink *ret = envoy_config_metrics_v3_StatsdSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_StatsdSink *envoy_config_metrics_v3_StatsdSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_StatsdSink *ret = envoy_config_metrics_v3_StatsdSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_StatsdSink_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_StatsdSink_serialize(const envoy_config_metrics_v3_StatsdSink *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, arena, len);
@@ -400,13 +436,19 @@ UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogSta
UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogStatsdSink_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_DogStatsdSink *ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_DogStatsdSink *envoy_config_metrics_v3_DogStatsdSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_DogStatsdSink *ret = envoy_config_metrics_v3_DogStatsdSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_DogStatsdSink_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_DogStatsdSink_serialize(const envoy_config_metrics_v3_DogStatsdSink *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, arena, len);
@@ -461,13 +503,19 @@ UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixS
UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixSink_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_metrics_v3_HystrixSink *ret = envoy_config_metrics_v3_HystrixSink_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_metrics_v3_HystrixSink *envoy_config_metrics_v3_HystrixSink_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_metrics_v3_HystrixSink *ret = envoy_config_metrics_v3_HystrixSink_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_metrics_v3_HystrixSink_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_metrics_v3_HystrixSink_serialize(const envoy_config_metrics_v3_HystrixSink *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, arena, len);
@@ -479,6 +527,8 @@ UPB_INLINE void envoy_config_metrics_v3_HystrixSink_set_num_buckets(envoy_config
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
+extern const upb_msglayout_file envoy_config_metrics_v3_stats_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
index a306e71e8ac..50e7f42f0fa 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/overload/v3/overload.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -18,123 +18,154 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_overload_v3_ResourceMonitor_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_overload_v3_ResourceMonitor_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_overload_v3_ResourceMonitor__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit = {
&envoy_config_overload_v3_ResourceMonitor_submsgs[0],
&envoy_config_overload_v3_ResourceMonitor__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_overload_v3_ThresholdTrigger__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit = {
NULL,
&envoy_config_overload_v3_ThresholdTrigger__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_overload_v3_ScaledTrigger__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit = {
NULL,
&envoy_config_overload_v3_ScaledTrigger__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_overload_v3_Trigger_submsgs[2] = {
- &envoy_config_overload_v3_ScaledTrigger_msginit,
- &envoy_config_overload_v3_ThresholdTrigger_msginit,
+static const upb_msglayout_sub envoy_config_overload_v3_Trigger_submsgs[2] = {
+ {.submsg = &envoy_config_overload_v3_ScaledTrigger_msginit},
+ {.submsg = &envoy_config_overload_v3_ThresholdTrigger_msginit},
};
static const upb_msglayout_field envoy_config_overload_v3_Trigger__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_Trigger_msginit = {
&envoy_config_overload_v3_Trigger_submsgs[0],
&envoy_config_overload_v3_Trigger__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = {
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
+static const upb_msglayout_sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = {
+ {.submsg = &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit},
};
static const upb_msglayout_field envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit = {
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[0],
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = {
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = {
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, 1},
- {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit = {
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[0],
&envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_overload_v3_OverloadAction_submsgs[2] = {
- &envoy_config_overload_v3_Trigger_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_overload_v3_OverloadAction_submsgs[2] = {
+ {.submsg = &envoy_config_overload_v3_Trigger_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_overload_v3_OverloadAction__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit = {
&envoy_config_overload_v3_OverloadAction_submsgs[0],
&envoy_config_overload_v3_OverloadAction__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_overload_v3_OverloadManager_submsgs[3] = {
- &envoy_config_overload_v3_OverloadAction_msginit,
- &envoy_config_overload_v3_ResourceMonitor_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_field envoy_config_overload_v3_BufferFactoryConfig__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_overload_v3_BufferFactoryConfig_msginit = {
+ NULL,
+ &envoy_config_overload_v3_BufferFactoryConfig__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_config_overload_v3_OverloadManager_submsgs[4] = {
+ {.submsg = &envoy_config_overload_v3_BufferFactoryConfig_msginit},
+ {.submsg = &envoy_config_overload_v3_OverloadAction_msginit},
+ {.submsg = &envoy_config_overload_v3_ResourceMonitor_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
-static const upb_msglayout_field envoy_config_overload_v3_OverloadManager__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+static const upb_msglayout_field envoy_config_overload_v3_OverloadManager__fields[4] = {
+ {1, UPB_SIZE(4, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit = {
&envoy_config_overload_v3_OverloadManager_submsgs[0],
&envoy_config_overload_v3_OverloadManager__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[9] = {
+ &envoy_config_overload_v3_ResourceMonitor_msginit,
+ &envoy_config_overload_v3_ThresholdTrigger_msginit,
+ &envoy_config_overload_v3_ScaledTrigger_msginit,
+ &envoy_config_overload_v3_Trigger_msginit,
+ &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit,
+ &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
+ &envoy_config_overload_v3_OverloadAction_msginit,
+ &envoy_config_overload_v3_BufferFactoryConfig_msginit,
+ &envoy_config_overload_v3_OverloadManager_msginit,
+};
+
+const upb_msglayout_file envoy_config_overload_v3_overload_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 9,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
index d800aa9736f..d0139273c21 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_
#define ENVOY_CONFIG_OVERLOAD_V3_OVERLOAD_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,7 @@ struct envoy_config_overload_v3_Trigger;
struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig;
struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer;
struct envoy_config_overload_v3_OverloadAction;
+struct envoy_config_overload_v3_BufferFactoryConfig;
struct envoy_config_overload_v3_OverloadManager;
typedef struct envoy_config_overload_v3_ResourceMonitor envoy_config_overload_v3_ResourceMonitor;
typedef struct envoy_config_overload_v3_ThresholdTrigger envoy_config_overload_v3_ThresholdTrigger;
@@ -35,6 +36,7 @@ typedef struct envoy_config_overload_v3_Trigger envoy_config_overload_v3_Trigger
typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig envoy_config_overload_v3_ScaleTimersOverloadActionConfig;
typedef struct envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer;
typedef struct envoy_config_overload_v3_OverloadAction envoy_config_overload_v3_OverloadAction;
+typedef struct envoy_config_overload_v3_BufferFactoryConfig envoy_config_overload_v3_BufferFactoryConfig;
typedef struct envoy_config_overload_v3_OverloadManager envoy_config_overload_v3_OverloadManager;
extern const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit;
extern const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit;
@@ -43,6 +45,7 @@ extern const upb_msglayout envoy_config_overload_v3_Trigger_msginit;
extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit;
extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit;
extern const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit;
+extern const upb_msglayout envoy_config_overload_v3_BufferFactoryConfig_msginit;
extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit;
struct envoy_type_v3_Percent;
struct google_protobuf_Any;
@@ -67,13 +70,19 @@ UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_Re
UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_ResourceMonitor *ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_ResourceMonitor *envoy_config_overload_v3_ResourceMonitor_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_ResourceMonitor *ret = envoy_config_overload_v3_ResourceMonitor_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ResourceMonitor_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_ResourceMonitor_serialize(const envoy_config_overload_v3_ResourceMonitor *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, arena, len);
@@ -113,13 +122,19 @@ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_T
UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_ThresholdTrigger *ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_ThresholdTrigger *envoy_config_overload_v3_ThresholdTrigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_ThresholdTrigger *ret = envoy_config_overload_v3_ThresholdTrigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ThresholdTrigger_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_ThresholdTrigger_serialize(const envoy_config_overload_v3_ThresholdTrigger *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, arena, len);
@@ -139,13 +154,19 @@ UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_Scal
UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_ScaledTrigger *ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_ScaledTrigger *envoy_config_overload_v3_ScaledTrigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_ScaledTrigger *ret = envoy_config_overload_v3_ScaledTrigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaledTrigger_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_ScaledTrigger_serialize(const envoy_config_overload_v3_ScaledTrigger *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, arena, len);
@@ -169,13 +190,19 @@ UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_ne
UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_Trigger *ret = envoy_config_overload_v3_Trigger_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_Trigger *envoy_config_overload_v3_Trigger_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_Trigger *ret = envoy_config_overload_v3_Trigger_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_Trigger_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_Trigger_serialize(const envoy_config_overload_v3_Trigger *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_Trigger_msginit, arena, len);
@@ -230,13 +257,19 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_confi
UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, arena, len);
@@ -267,13 +300,19 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *
UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *ret = envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_serialize(const envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, arena, len);
@@ -328,13 +367,19 @@ UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_Ove
UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_OverloadAction *ret = envoy_config_overload_v3_OverloadAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_OverloadAction *envoy_config_overload_v3_OverloadAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_OverloadAction *ret = envoy_config_overload_v3_OverloadAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_OverloadAction_serialize(const envoy_config_overload_v3_OverloadAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, arena, len);
@@ -376,6 +421,38 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_overload_v3_OverloadAction_m
return sub;
}
+/* envoy.config.overload.v3.BufferFactoryConfig */
+
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig *envoy_config_overload_v3_BufferFactoryConfig_new(upb_arena *arena) {
+ return (envoy_config_overload_v3_BufferFactoryConfig *)_upb_msg_new(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena);
+}
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig *envoy_config_overload_v3_BufferFactoryConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_overload_v3_BufferFactoryConfig *ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig *envoy_config_overload_v3_BufferFactoryConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_overload_v3_BufferFactoryConfig *ret = envoy_config_overload_v3_BufferFactoryConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_BufferFactoryConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_overload_v3_BufferFactoryConfig_serialize(const envoy_config_overload_v3_BufferFactoryConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, arena, len);
+}
+
+UPB_INLINE uint32_t envoy_config_overload_v3_BufferFactoryConfig_minimum_account_to_track_power_of_two(const envoy_config_overload_v3_BufferFactoryConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t); }
+
+UPB_INLINE void envoy_config_overload_v3_BufferFactoryConfig_set_minimum_account_to_track_power_of_two(envoy_config_overload_v3_BufferFactoryConfig *msg, uint32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = value;
+}
+
/* envoy.config.overload.v3.OverloadManager */
UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_new(upb_arena *arena) {
@@ -384,13 +461,19 @@ UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_Ov
UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_overload_v3_OverloadManager *envoy_config_overload_v3_OverloadManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_overload_v3_OverloadManager *ret = envoy_config_overload_v3_OverloadManager_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_overload_v3_OverloadManager_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_overload_v3_OverloadManager_serialize(const envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, arena, len);
@@ -398,10 +481,12 @@ UPB_INLINE char *envoy_config_overload_v3_OverloadManager_serialize(const envoy_
UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct google_protobuf_Duration* envoy_config_overload_v3_OverloadManager_refresh_interval(const envoy_config_overload_v3_OverloadManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
-UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
-UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_config_overload_v3_ResourceMonitor* const* envoy_config_overload_v3_OverloadManager_resource_monitors(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_ResourceMonitor* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_actions(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(16, 32)); }
+UPB_INLINE const envoy_config_overload_v3_OverloadAction* const* envoy_config_overload_v3_OverloadManager_actions(const envoy_config_overload_v3_OverloadManager *msg, size_t *len) { return (const envoy_config_overload_v3_OverloadAction* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
+UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_buffer_factory_config(const envoy_config_overload_v3_OverloadManager *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_buffer_factory_config(const envoy_config_overload_v3_OverloadManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_overload_v3_BufferFactoryConfig*); }
UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_refresh_interval(envoy_config_overload_v3_OverloadManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
@@ -417,31 +502,46 @@ UPB_INLINE struct google_protobuf_Duration* envoy_config_overload_v3_OverloadMan
return sub;
}
UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_mutable_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t *len) {
- return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+ return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
UPB_INLINE envoy_config_overload_v3_ResourceMonitor** envoy_config_overload_v3_OverloadManager_resize_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_overload_v3_ResourceMonitor**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_OverloadManager_add_resource_monitors(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
struct envoy_config_overload_v3_ResourceMonitor* sub = (struct envoy_config_overload_v3_ResourceMonitor*)_upb_msg_new(&envoy_config_overload_v3_ResourceMonitor_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_mutable_actions(envoy_config_overload_v3_OverloadManager *msg, size_t *len) {
- return (envoy_config_overload_v3_OverloadAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+ return (envoy_config_overload_v3_OverloadAction**)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 32), len);
}
UPB_INLINE envoy_config_overload_v3_OverloadAction** envoy_config_overload_v3_OverloadManager_resize_actions(envoy_config_overload_v3_OverloadManager *msg, size_t len, upb_arena *arena) {
- return (envoy_config_overload_v3_OverloadAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_overload_v3_OverloadAction**)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 32), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_OverloadManager_add_actions(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
struct envoy_config_overload_v3_OverloadAction* sub = (struct envoy_config_overload_v3_OverloadAction*)_upb_msg_new(&envoy_config_overload_v3_OverloadAction_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(16, 32), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
+UPB_INLINE void envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, envoy_config_overload_v3_BufferFactoryConfig* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), envoy_config_overload_v3_BufferFactoryConfig*) = value;
+}
+UPB_INLINE struct envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v3_OverloadManager_mutable_buffer_factory_config(envoy_config_overload_v3_OverloadManager *msg, upb_arena *arena) {
+ struct envoy_config_overload_v3_BufferFactoryConfig* sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)envoy_config_overload_v3_OverloadManager_buffer_factory_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_overload_v3_BufferFactoryConfig*)_upb_msg_new(&envoy_config_overload_v3_BufferFactoryConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_overload_v3_OverloadManager_set_buffer_factory_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_config_overload_v3_overload_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
index f8ac2daa4fb..ea3e730504b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c
@@ -7,15 +7,18 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/rbac/v3/rbac.upb.h"
#include "envoy/config/core/v3/address.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "envoy/type/matcher/v3/metadata.upb.h"
#include "envoy/type/matcher/v3/path.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
+#include "envoy/type/v3/range.upb.h"
#include "google/api/expr/v1alpha1/checked.upb.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -23,155 +26,177 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_rbac_v3_RBAC_submsgs[1] = {
- &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_RBAC_submsgs[1] = {
+ {.submsg = &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_RBAC__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_RBAC_msginit = {
&envoy_config_rbac_v3_RBAC_submsgs[0],
&envoy_config_rbac_v3_RBAC__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
- &envoy_config_rbac_v3_Policy_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = {
+ {.submsg = &envoy_config_rbac_v3_Policy_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit = {
&envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[0],
&envoy_config_rbac_v3_RBAC_PoliciesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Policy_submsgs[4] = {
- &envoy_config_rbac_v3_Permission_msginit,
- &envoy_config_rbac_v3_Principal_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_msginit,
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_Policy_submsgs[4] = {
+ {.submsg = &envoy_config_rbac_v3_Permission_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_msginit},
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_Policy__fields[4] = {
- {1, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {2, UPB_SIZE(16, 32), 0, 1, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 3, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 2, 11, 1},
+ {1, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Policy_msginit = {
&envoy_config_rbac_v3_Policy_submsgs[0],
&envoy_config_rbac_v3_Policy__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_submsgs[7] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &envoy_config_rbac_v3_Permission_msginit,
- &envoy_config_rbac_v3_Permission_Set_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_PathMatcher_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
-};
-
-static const upb_msglayout_field envoy_config_rbac_v3_Permission__fields[10] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 13, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout_sub envoy_config_rbac_v3_Permission_submsgs[9] = {
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_rbac_v3_Permission_msginit},
+ {.submsg = &envoy_config_rbac_v3_Permission_Set_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_v3_Int32Range_msginit},
+};
+
+static const upb_msglayout_field envoy_config_rbac_v3_Permission__fields[12] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Permission_msginit = {
&envoy_config_rbac_v3_Permission_submsgs[0],
&envoy_config_rbac_v3_Permission__fields[0],
- UPB_SIZE(8, 16), 10, false, 255,
+ UPB_SIZE(8, 16), 12, _UPB_MSGEXT_NONE, 12, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Permission_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_Permission_Set_submsgs[1] = {
+ {.submsg = &envoy_config_rbac_v3_Permission_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_Permission_Set__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Permission_Set_msginit = {
&envoy_config_rbac_v3_Permission_Set_submsgs[0],
&envoy_config_rbac_v3_Permission_Set__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_submsgs[7] = {
- &envoy_config_core_v3_CidrRange_msginit,
- &envoy_config_rbac_v3_Principal_msginit,
- &envoy_config_rbac_v3_Principal_Authenticated_msginit,
- &envoy_config_rbac_v3_Principal_Set_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_PathMatcher_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_Principal_submsgs[7] = {
+ {.submsg = &envoy_config_core_v3_CidrRange_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_Authenticated_msginit},
+ {.submsg = &envoy_config_rbac_v3_Principal_Set_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_PathMatcher_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_Principal__fields[11] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Principal_msginit = {
&envoy_config_rbac_v3_Principal_submsgs[0],
&envoy_config_rbac_v3_Principal__fields[0],
- UPB_SIZE(8, 16), 11, false, 255,
+ UPB_SIZE(8, 16), 11, _UPB_MSGEXT_NONE, 11, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
- &envoy_config_rbac_v3_Principal_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_Principal_Set_submsgs[1] = {
+ {.submsg = &envoy_config_rbac_v3_Principal_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_Principal_Set__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit = {
&envoy_config_rbac_v3_Principal_Set_submsgs[0],
&envoy_config_rbac_v3_Principal_Set__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_msglayout_sub envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
static const upb_msglayout_field envoy_config_rbac_v3_Principal_Authenticated__fields[1] = {
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit = {
&envoy_config_rbac_v3_Principal_Authenticated_submsgs[0],
&envoy_config_rbac_v3_Principal_Authenticated__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[8] = {
+ &envoy_config_rbac_v3_RBAC_msginit,
+ &envoy_config_rbac_v3_RBAC_PoliciesEntry_msginit,
+ &envoy_config_rbac_v3_Policy_msginit,
+ &envoy_config_rbac_v3_Permission_msginit,
+ &envoy_config_rbac_v3_Permission_Set_msginit,
+ &envoy_config_rbac_v3_Principal_msginit,
+ &envoy_config_rbac_v3_Principal_Set_msginit,
+ &envoy_config_rbac_v3_Principal_Authenticated_msginit,
+};
+
+const upb_msglayout_file envoy_config_rbac_v3_rbac_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 8,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
index befa31f625e..75f97dc072e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
#define ENVOY_CONFIG_RBAC_V3_RBAC_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -45,17 +45,21 @@ extern const upb_msglayout envoy_config_rbac_v3_Principal_msginit;
extern const upb_msglayout envoy_config_rbac_v3_Principal_Set_msginit;
extern const upb_msglayout envoy_config_rbac_v3_Principal_Authenticated_msginit;
struct envoy_config_core_v3_CidrRange;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_route_v3_HeaderMatcher;
struct envoy_type_matcher_v3_MetadataMatcher;
struct envoy_type_matcher_v3_PathMatcher;
struct envoy_type_matcher_v3_StringMatcher;
+struct envoy_type_v3_Int32Range;
struct google_api_expr_v1alpha1_CheckedExpr;
struct google_api_expr_v1alpha1_Expr;
extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
+extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_Expr_msginit;
@@ -74,13 +78,19 @@ UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_new(upb_arena *a
UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_RBAC *ret = envoy_config_rbac_v3_RBAC_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_RBAC *envoy_config_rbac_v3_RBAC_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_RBAC *ret = envoy_config_rbac_v3_RBAC_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_RBAC_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_RBAC_serialize(const envoy_config_rbac_v3_RBAC *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_RBAC_msginit, arena, len);
@@ -126,13 +136,19 @@ UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_new(upb_aren
UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Policy *ret = envoy_config_rbac_v3_Policy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Policy *envoy_config_rbac_v3_Policy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Policy *ret = envoy_config_rbac_v3_Policy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Policy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Policy_serialize(const envoy_config_rbac_v3_Policy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Policy_msginit, arena, len);
@@ -208,13 +224,19 @@ UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_new(
UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Permission *ret = envoy_config_rbac_v3_Permission_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Permission *envoy_config_rbac_v3_Permission_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Permission *ret = envoy_config_rbac_v3_Permission_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Permission_serialize(const envoy_config_rbac_v3_Permission *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Permission_msginit, arena, len);
@@ -228,9 +250,11 @@ typedef enum {
envoy_config_rbac_v3_Permission_rule_url_path = 10,
envoy_config_rbac_v3_Permission_rule_destination_ip = 5,
envoy_config_rbac_v3_Permission_rule_destination_port = 6,
+ envoy_config_rbac_v3_Permission_rule_destination_port_range = 11,
envoy_config_rbac_v3_Permission_rule_metadata = 7,
envoy_config_rbac_v3_Permission_rule_not_rule = 8,
envoy_config_rbac_v3_Permission_rule_requested_server_name = 9,
+ envoy_config_rbac_v3_Permission_rule_matcher = 12,
envoy_config_rbac_v3_Permission_rule_NOT_SET = 0
} envoy_config_rbac_v3_Permission_rule_oneofcases;
UPB_INLINE envoy_config_rbac_v3_Permission_rule_oneofcases envoy_config_rbac_v3_Permission_rule_case(const envoy_config_rbac_v3_Permission* msg) { return (envoy_config_rbac_v3_Permission_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
@@ -255,6 +279,10 @@ UPB_INLINE bool envoy_config_rbac_v3_Permission_has_requested_server_name(const
UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Permission_requested_server_name(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 9, NULL); }
UPB_INLINE bool envoy_config_rbac_v3_Permission_has_url_path(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 10; }
UPB_INLINE const struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permission_url_path(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_PathMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 10, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_destination_port_range(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 11; }
+UPB_INLINE const struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_destination_port_range(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 11, NULL); }
+UPB_INLINE bool envoy_config_rbac_v3_Permission_has_matcher(const envoy_config_rbac_v3_Permission *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 12; }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_matcher(const envoy_config_rbac_v3_Permission *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 12, NULL); }
UPB_INLINE void envoy_config_rbac_v3_Permission_set_and_rules(envoy_config_rbac_v3_Permission *msg, envoy_config_rbac_v3_Permission_Set* value) {
UPB_WRITE_ONEOF(msg, envoy_config_rbac_v3_Permission_Set*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
@@ -358,6 +386,30 @@ UPB_INLINE struct envoy_type_matcher_v3_PathMatcher* envoy_config_rbac_v3_Permis
}
return sub;
}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_destination_port_range(envoy_config_rbac_v3_Permission *msg, struct envoy_type_v3_Int32Range* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_v3_Int32Range*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 11);
+}
+UPB_INLINE struct envoy_type_v3_Int32Range* envoy_config_rbac_v3_Permission_mutable_destination_port_range(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_type_v3_Int32Range* sub = (struct envoy_type_v3_Int32Range*)envoy_config_rbac_v3_Permission_destination_port_range(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_v3_Int32Range*)_upb_msg_new(&envoy_type_v3_Int32Range_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_destination_port_range(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_config_rbac_v3_Permission_set_matcher(envoy_config_rbac_v3_Permission *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_TypedExtensionConfig*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 12);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_rbac_v3_Permission_mutable_matcher(envoy_config_rbac_v3_Permission *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_rbac_v3_Permission_matcher(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_rbac_v3_Permission_set_matcher(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.rbac.v3.Permission.Set */
@@ -367,13 +419,19 @@ UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_
UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Permission_Set *ret = envoy_config_rbac_v3_Permission_Set_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Permission_Set *envoy_config_rbac_v3_Permission_Set_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Permission_Set *ret = envoy_config_rbac_v3_Permission_Set_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Permission_Set_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Permission_Set_serialize(const envoy_config_rbac_v3_Permission_Set *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, arena, len);
@@ -404,13 +462,19 @@ UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_new(up
UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Principal *ret = envoy_config_rbac_v3_Principal_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Principal *envoy_config_rbac_v3_Principal_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Principal *ret = envoy_config_rbac_v3_Principal_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Principal_serialize(const envoy_config_rbac_v3_Principal *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Principal_msginit, arena, len);
@@ -587,13 +651,19 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Se
UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Principal_Set *ret = envoy_config_rbac_v3_Principal_Set_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Principal_Set *envoy_config_rbac_v3_Principal_Set_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Principal_Set *ret = envoy_config_rbac_v3_Principal_Set_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Set_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Principal_Set_serialize(const envoy_config_rbac_v3_Principal_Set *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, arena, len);
@@ -624,13 +694,19 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Pr
UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_rbac_v3_Principal_Authenticated *ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated *envoy_config_rbac_v3_Principal_Authenticated_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_rbac_v3_Principal_Authenticated *ret = envoy_config_rbac_v3_Principal_Authenticated_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_rbac_v3_Principal_Authenticated_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_rbac_v3_Principal_Authenticated_serialize(const envoy_config_rbac_v3_Principal_Authenticated *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, arena, len);
@@ -653,6 +729,8 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_rbac_v3_Prin
return sub;
}
+extern const upb_msglayout_file envoy_config_rbac_v3_rbac_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
index d34e1c50507..eba8b9a0911 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c
@@ -7,10 +7,11 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/route/v3/route.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/config_source.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -19,46 +20,75 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_route_v3_RouteConfiguration_submsgs[5] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_route_v3_Vhds_msginit,
- &envoy_config_route_v3_VirtualHost_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteConfiguration_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_ClusterSpecifierPlugin_msginit},
+ {.submsg = &envoy_config_route_v3_Vhds_msginit},
+ {.submsg = &envoy_config_route_v3_VirtualHost_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_RouteConfiguration__fields[11] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 2, 11, 3},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(32, 64), 0, 0, 11, 3},
- {5, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {6, UPB_SIZE(40, 80), 0, 0, 11, 3},
- {7, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {8, UPB_SIZE(44, 88), 0, 0, 9, 3},
- {9, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {10, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {11, UPB_SIZE(20, 40), 3, 4, 11, 1},
+static const upb_msglayout_field envoy_config_route_v3_RouteConfiguration__fields[12] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(36, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 80), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 24), 1, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(44, 88), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(16, 32), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(20, 40), 3, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(48, 96), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit = {
&envoy_config_route_v3_RouteConfiguration_submsgs[0],
&envoy_config_route_v3_RouteConfiguration__fields[0],
- UPB_SIZE(48, 96), 11, false, 255,
+ UPB_SIZE(56, 112), 12, _UPB_MSGEXT_NONE, 12, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+};
+
+static const upb_msglayout_field envoy_config_route_v3_ClusterSpecifierPlugin__fields[1] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_config_route_v3_ClusterSpecifierPlugin_msginit = {
+ &envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[0],
+ &envoy_config_route_v3_ClusterSpecifierPlugin__fields[0],
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_Vhds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_Vhds_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_Vhds__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_Vhds_msginit = {
&envoy_config_route_v3_Vhds_submsgs[0],
&envoy_config_route_v3_Vhds__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_config_route_v3_RouteConfiguration_msginit,
+ &envoy_config_route_v3_ClusterSpecifierPlugin_msginit,
+ &envoy_config_route_v3_Vhds_msginit,
+};
+
+const upb_msglayout_file envoy_config_route_v3_route_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
index b8d009fdbc8..d88ba383628 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
#define ENVOY_CONFIG_ROUTE_V3_ROUTE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -21,18 +21,23 @@ extern "C" {
#endif
struct envoy_config_route_v3_RouteConfiguration;
+struct envoy_config_route_v3_ClusterSpecifierPlugin;
struct envoy_config_route_v3_Vhds;
typedef struct envoy_config_route_v3_RouteConfiguration envoy_config_route_v3_RouteConfiguration;
+typedef struct envoy_config_route_v3_ClusterSpecifierPlugin envoy_config_route_v3_ClusterSpecifierPlugin;
typedef struct envoy_config_route_v3_Vhds envoy_config_route_v3_Vhds;
extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
+extern const upb_msglayout envoy_config_route_v3_ClusterSpecifierPlugin_msginit;
extern const upb_msglayout envoy_config_route_v3_Vhds_msginit;
struct envoy_config_core_v3_ConfigSource;
struct envoy_config_core_v3_HeaderValueOption;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_route_v3_VirtualHost;
struct google_protobuf_BoolValue;
struct google_protobuf_UInt32Value;
extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
extern const upb_msglayout google_protobuf_UInt32Value_msginit;
@@ -46,13 +51,19 @@ UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_Route
UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteConfiguration *ret = envoy_config_route_v3_RouteConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteConfiguration *envoy_config_route_v3_RouteConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteConfiguration *ret = envoy_config_route_v3_RouteConfiguration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteConfiguration_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteConfiguration_serialize(const envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, arena, len);
@@ -75,6 +86,8 @@ UPB_INLINE const envoy_config_route_v3_Vhds* envoy_config_route_v3_RouteConfigur
UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_most_specific_header_mutations_wins(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfiguration_max_direct_response_body_size_bytes(const envoy_config_route_v3_RouteConfiguration *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE bool envoy_config_route_v3_RouteConfiguration_has_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 96)); }
+UPB_INLINE const envoy_config_route_v3_ClusterSpecifierPlugin* const* envoy_config_route_v3_RouteConfiguration_cluster_specifier_plugins(const envoy_config_route_v3_RouteConfiguration *msg, size_t *len) { return (const envoy_config_route_v3_ClusterSpecifierPlugin* const*)_upb_array_accessor(msg, UPB_SIZE(48, 96), len); }
UPB_INLINE void envoy_config_route_v3_RouteConfiguration_set_name(envoy_config_route_v3_RouteConfiguration *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
@@ -190,6 +203,62 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_RouteConfig
}
return sub;
}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_mutable_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration *msg, size_t *len) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 96), len);
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin** envoy_config_route_v3_RouteConfiguration_resize_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration *msg, size_t len, upb_arena *arena) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin**)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 96), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_RouteConfiguration_add_cluster_specifier_plugins(envoy_config_route_v3_RouteConfiguration *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_ClusterSpecifierPlugin* sub = (struct envoy_config_route_v3_ClusterSpecifierPlugin*)_upb_msg_new(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(48, 96), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.config.route.v3.ClusterSpecifierPlugin */
+
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin *envoy_config_route_v3_ClusterSpecifierPlugin_new(upb_arena *arena) {
+ return (envoy_config_route_v3_ClusterSpecifierPlugin *)_upb_msg_new(&envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin *envoy_config_route_v3_ClusterSpecifierPlugin_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_ClusterSpecifierPlugin *ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin *envoy_config_route_v3_ClusterSpecifierPlugin_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_route_v3_ClusterSpecifierPlugin *ret = envoy_config_route_v3_ClusterSpecifierPlugin_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_route_v3_ClusterSpecifierPlugin_serialize(const envoy_config_route_v3_ClusterSpecifierPlugin *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_config_route_v3_ClusterSpecifierPlugin_has_extension(const envoy_config_route_v3_ClusterSpecifierPlugin *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_extension(const envoy_config_route_v3_ClusterSpecifierPlugin *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+
+UPB_INLINE void envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(envoy_config_route_v3_ClusterSpecifierPlugin *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_ClusterSpecifierPlugin_mutable_extension(envoy_config_route_v3_ClusterSpecifierPlugin *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_config_route_v3_ClusterSpecifierPlugin_extension(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_ClusterSpecifierPlugin_set_extension(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.route.v3.Vhds */
@@ -199,13 +268,19 @@ UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_new(upb_arena
UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_Vhds *ret = envoy_config_route_v3_Vhds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_Vhds *envoy_config_route_v3_Vhds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_Vhds *ret = envoy_config_route_v3_Vhds_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_Vhds_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_Vhds_serialize(const envoy_config_route_v3_Vhds *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_Vhds_msginit, arena, len);
@@ -228,6 +303,8 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_config_route_v3_Vhds_
return sub;
}
+extern const upb_msglayout_file envoy_config_route_v3_route_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
index a5c1d65da07..7201061b51e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c
@@ -7,11 +7,12 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/config/core/v3/proxy_protocol.upb.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
#include "envoy/type/matcher/v3/regex.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "envoy/type/metadata/v3/metadata.upb.h"
@@ -29,912 +30,993 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_submsgs[10] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_Route_msginit,
- &envoy_config_route_v3_VirtualCluster_msginit,
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_VirtualHost_submsgs[10] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_route_v3_CorsPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_HedgePolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_Route_msginit},
+ {.submsg = &envoy_config_route_v3_VirtualCluster_msginit},
+ {.submsg = &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_VirtualHost__fields[18] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {3, UPB_SIZE(44, 80), 0, 5, 11, 3},
- {4, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {5, UPB_SIZE(48, 88), 0, 6, 11, 3},
- {6, UPB_SIZE(52, 96), 0, 3, 11, 3},
- {7, UPB_SIZE(56, 104), 0, 0, 11, 3},
- {8, UPB_SIZE(20, 32), 1, 1, 11, 1},
- {10, UPB_SIZE(60, 112), 0, 0, 11, 3},
- {11, UPB_SIZE(64, 120), 0, 0, 9, 3},
- {13, UPB_SIZE(68, 128), 0, 0, 9, 3},
- {14, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {15, UPB_SIZE(72, 136), 0, 7, 11, _UPB_LABEL_MAP},
- {16, UPB_SIZE(24, 40), 2, 4, 11, 1},
- {17, UPB_SIZE(28, 48), 3, 2, 11, 1},
- {18, UPB_SIZE(32, 56), 4, 9, 11, 1},
- {19, UPB_SIZE(9, 9), 0, 0, 8, 1},
- {20, UPB_SIZE(36, 64), 5, 8, 11, 1},
+ {1, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(40, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(44, 80), 0, 5, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(48, 88), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 96), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 104), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(20, 32), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(60, 112), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(64, 120), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(68, 128), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(72, 136), 0, 7, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(24, 40), 2, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(28, 48), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(32, 56), 4, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(9, 9), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(36, 64), 5, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_VirtualHost_msginit = {
&envoy_config_route_v3_VirtualHost_submsgs[0],
&envoy_config_route_v3_VirtualHost__fields[0],
- UPB_SIZE(80, 144), 18, false, 255,
+ UPB_SIZE(80, 144), 18, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit = {
&envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[0],
&envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_FilterAction_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_FilterAction_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_FilterAction__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_FilterAction_msginit = {
&envoy_config_route_v3_FilterAction_submsgs[0],
&envoy_config_route_v3_FilterAction__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_Route_submsgs[11] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_Decorator_msginit,
- &envoy_config_route_v3_DirectResponseAction_msginit,
- &envoy_config_route_v3_FilterAction_msginit,
- &envoy_config_route_v3_RedirectAction_msginit,
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_RouteAction_msginit,
- &envoy_config_route_v3_RouteMatch_msginit,
- &envoy_config_route_v3_Tracing_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_Route__fields[15] = {
- {1, UPB_SIZE(12, 24), 1, 8, 11, 1},
- {2, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 7, 11, 1},
- {3, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 5, 11, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {5, UPB_SIZE(20, 40), 3, 2, 11, 1},
- {7, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 3, 11, 1},
- {9, UPB_SIZE(32, 64), 0, 0, 11, 3},
- {10, UPB_SIZE(36, 72), 0, 0, 11, 3},
- {11, UPB_SIZE(40, 80), 0, 0, 9, 3},
- {12, UPB_SIZE(44, 88), 0, 0, 9, 3},
- {13, UPB_SIZE(48, 96), 0, 6, 11, _UPB_LABEL_MAP},
- {14, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {15, UPB_SIZE(24, 48), 4, 9, 11, 1},
- {16, UPB_SIZE(28, 56), 5, 10, 11, 1},
- {17, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 4, 11, 1},
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_Route_submsgs[12] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_route_v3_Decorator_msginit},
+ {.submsg = &envoy_config_route_v3_DirectResponseAction_msginit},
+ {.submsg = &envoy_config_route_v3_FilterAction_msginit},
+ {.submsg = &envoy_config_route_v3_NonForwardingAction_msginit},
+ {.submsg = &envoy_config_route_v3_RedirectAction_msginit},
+ {.submsg = &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_msginit},
+ {.submsg = &envoy_config_route_v3_Tracing_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_route_v3_Route__fields[16] = {
+ {1, UPB_SIZE(12, 24), 1, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(36, 72), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(40, 80), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(44, 88), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(48, 96), 0, 7, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(24, 48), 4, 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(28, 56), 5, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(52, 104), UPB_SIZE(-57, -113), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_Route_msginit = {
&envoy_config_route_v3_Route_submsgs[0],
&envoy_config_route_v3_Route__fields[0],
- UPB_SIZE(64, 128), 15, false, 255,
+ UPB_SIZE(64, 128), 16, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit = {
&envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[0],
&envoy_config_route_v3_Route_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_submsgs[2] = {
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_WeightedCluster_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_WeightedCluster__fields[3] = {
- {1, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+ {1, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit = {
&envoy_config_route_v3_WeightedCluster_submsgs[0],
&envoy_config_route_v3_WeightedCluster__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[4] = {
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[8] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 1, 11, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {5, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {6, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {9, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {10, UPB_SIZE(36, 72), 0, 2, 11, _UPB_LABEL_MAP},
+static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[10] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 40), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 48), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 64), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(36, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(40, 80), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(44, 88), 0, 2, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(48, 96), UPB_SIZE(-57, -113), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit = {
&envoy_config_route_v3_WeightedCluster_ClusterWeight_submsgs[0],
&envoy_config_route_v3_WeightedCluster_ClusterWeight__fields[0],
- UPB_SIZE(40, 80), 8, false, 255,
+ UPB_SIZE(64, 128), 10, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit = {
&envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[0],
&envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteMatch_submsgs[8] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_QueryParameterMatcher_msginit,
- &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
- &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteMatch__fields[10] = {
- {1, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {2, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {4, UPB_SIZE(4, 8), 1, 7, 11, 1},
- {6, UPB_SIZE(20, 40), 0, 1, 11, 3},
- {7, UPB_SIZE(24, 48), 0, 2, 11, 3},
- {8, UPB_SIZE(8, 16), 2, 4, 11, 1},
- {9, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {10, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 6, 11, 1},
- {11, UPB_SIZE(16, 32), 4, 5, 11, 1},
- {12, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 3, 11, 1},
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_RouteMatch_submsgs[9] = {
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_QueryParameterMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit},
+ {.submsg = &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit},
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteMatch__fields[11] = {
+ {1, UPB_SIZE(32, 64), UPB_SIZE(-41, -81), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 64), UPB_SIZE(-41, -81), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 8), 1, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(20, 40), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 48), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(8, 16), 2, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(32, 64), UPB_SIZE(-41, -81), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(16, 32), 4, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(32, 64), UPB_SIZE(-41, -81), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(28, 56), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteMatch_msginit = {
&envoy_config_route_v3_RouteMatch_submsgs[0],
&envoy_config_route_v3_RouteMatch__fields[0],
- UPB_SIZE(40, 80), 10, false, 255,
+ UPB_SIZE(48, 96), 11, _UPB_MSGEXT_NONE, 2, 255,
};
const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit = {
&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[0],
&envoy_config_route_v3_RouteMatch_TlsContextMatchOptions__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_CorsPolicy_submsgs[3] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_CorsPolicy_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_CorsPolicy__fields[8] = {
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(28, 56), 0, 0, 9, 1},
- {6, UPB_SIZE(36, 72), 1, 2, 11, 1},
- {9, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 0, 11, 1},
- {10, UPB_SIZE(40, 80), 2, 0, 11, 1},
- {11, UPB_SIZE(44, 88), 0, 1, 11, 3},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(36, 72), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(48, 96), UPB_SIZE(-53, -105), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(40, 80), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(44, 88), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit = {
&envoy_config_route_v3_CorsPolicy_submsgs[0],
&envoy_config_route_v3_CorsPolicy__fields[0],
- UPB_SIZE(56, 112), 8, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_submsgs[16] = {
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_InternalRedirectPolicy_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
- &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
- &envoy_config_route_v3_WeightedCluster_msginit,
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RouteAction__fields[29] = {
- {1, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, 1},
- {2, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, 1},
- {3, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 10, 11, 1},
- {4, UPB_SIZE(24, 32), 1, 0, 11, 1},
- {5, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {6, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, 1},
- {7, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 13, 11, 1},
- {8, UPB_SIZE(28, 40), 2, 14, 11, 1},
- {9, UPB_SIZE(32, 48), 3, 5, 11, 1},
- {11, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {13, UPB_SIZE(80, 144), 0, 4, 11, 3},
- {14, UPB_SIZE(36, 56), 4, 13, 11, 1},
- {15, UPB_SIZE(84, 152), 0, 6, 11, 3},
- {17, UPB_SIZE(40, 64), 5, 1, 11, 1},
- {20, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {23, UPB_SIZE(44, 72), 6, 14, 11, 1},
- {24, UPB_SIZE(48, 80), 7, 14, 11, 1},
- {25, UPB_SIZE(88, 160), 0, 9, 11, 3},
- {26, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {27, UPB_SIZE(52, 88), 8, 2, 11, 1},
- {28, UPB_SIZE(56, 96), 9, 14, 11, 1},
- {29, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, 1},
- {30, UPB_SIZE(92, 168), 0, 8, 11, 3},
- {31, UPB_SIZE(60, 104), 10, 15, 11, 1},
- {32, UPB_SIZE(64, 112), 11, 11, 11, 1},
- {33, UPB_SIZE(68, 120), 12, 12, 11, 1},
- {34, UPB_SIZE(72, 128), 13, 3, 11, 1},
- {35, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 11, 11, 1},
- {36, UPB_SIZE(76, 136), 14, 7, 11, 1},
+ UPB_SIZE(56, 112), 8, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_submsgs[16] = {
+ {.submsg = &envoy_config_core_v3_Metadata_msginit},
+ {.submsg = &envoy_config_route_v3_CorsPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_HedgePolicy_msginit},
+ {.submsg = &envoy_config_route_v3_InternalRedirectPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit},
+ {.submsg = &envoy_config_route_v3_WeightedCluster_msginit},
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RouteAction__fields[30] = {
+ {1, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 32), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 40), 2, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 48), 3, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(80, 144), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(36, 56), 4, 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(84, 152), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(40, 64), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(44, 72), 6, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(48, 80), 7, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(88, 160), 0, 9, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(12, 12), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {27, UPB_SIZE(52, 88), 8, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {28, UPB_SIZE(56, 96), 9, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {29, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {30, UPB_SIZE(92, 168), 0, 8, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {31, UPB_SIZE(60, 104), 10, 15, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {32, UPB_SIZE(64, 112), 11, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {33, UPB_SIZE(68, 120), 12, 12, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {34, UPB_SIZE(72, 128), 13, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {35, UPB_SIZE(108, 200), UPB_SIZE(-117, -217), 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {36, UPB_SIZE(76, 136), 14, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {37, UPB_SIZE(96, 176), UPB_SIZE(-105, -193), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_msginit = {
&envoy_config_route_v3_RouteAction_submsgs[0],
&envoy_config_route_v3_RouteAction__fields[0],
- UPB_SIZE(120, 224), 29, false, 255,
+ UPB_SIZE(120, 224), 30, _UPB_MSGEXT_NONE, 9, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = {
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_RuntimeFractionalPercent_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit = {
&envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[0],
&envoy_config_route_v3_RouteAction_RequestMirrorPolicy__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = {
- &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = {
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit},
+ {.submsg = &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy__fields[6] = {
- {1, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 3, 11, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, 1},
- {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, 1},
- {4, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {5, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 4, 11, 1},
- {6, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 2, 11, 1},
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 8), UPB_SIZE(-9, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit = {
&envoy_config_route_v3_RouteAction_HashPolicy_submsgs[0],
&envoy_config_route_v3_RouteAction_HashPolicy__fields[0],
- UPB_SIZE(16, 24), 6, false, 255,
+ UPB_SIZE(16, 24), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit = {
&envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[0],
&envoy_config_route_v3_RouteAction_HashPolicy_Header__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit = {
&envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[0],
&envoy_config_route_v3_RouteAction_HashPolicy_Cookie__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = {
NULL,
&envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = {
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit = {
&envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[0],
&envoy_config_route_v3_RouteAction_UpgradeConfig__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
- &envoy_config_core_v3_ProxyProtocolConfig_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ProxyProtocolConfig_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit = {
&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[0],
&envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit = {
&envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[0],
&envoy_config_route_v3_RouteAction_MaxStreamDuration__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
-};
-
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_submsgs[7] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_config_route_v3_RetryPolicy__fields[11] = {
- {1, UPB_SIZE(16, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 32), 1, 6, 11, 1},
- {3, UPB_SIZE(28, 40), 2, 5, 11, 1},
- {4, UPB_SIZE(32, 48), 3, 4, 11, 1},
- {5, UPB_SIZE(44, 72), 0, 3, 11, 3},
- {6, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {7, UPB_SIZE(48, 80), 0, 0, 13, _UPB_LABEL_PACKED},
- {8, UPB_SIZE(36, 56), 4, 2, 11, 1},
- {9, UPB_SIZE(52, 88), 0, 0, 11, 3},
- {10, UPB_SIZE(56, 96), 0, 0, 11, 3},
- {11, UPB_SIZE(40, 64), 5, 1, 11, 1},
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_RetryPolicy_submsgs[8] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit},
+ {.submsg = &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_config_route_v3_RetryPolicy__fields[13] = {
+ {1, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 32), 1, 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 40), 2, 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 48), 3, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(48, 80), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(52, 88), 0, 0, 13, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(36, 56), 4, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(56, 96), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(60, 104), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(40, 64), 5, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(64, 112), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(44, 72), 6, 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit = {
&envoy_config_route_v3_RetryPolicy_submsgs[0],
&envoy_config_route_v3_RetryPolicy__fields[0],
- UPB_SIZE(64, 112), 11, false, 255,
+ UPB_SIZE(72, 128), 13, _UPB_MSGEXT_NONE, 13, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryPriority__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit = {
&envoy_config_route_v3_RetryPolicy_RetryPriority_submsgs[0],
&envoy_config_route_v3_RetryPolicy_RetryPriority__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit = {
&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[0],
&envoy_config_route_v3_RetryPolicy_RetryHostPredicate__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit = {
&envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[0],
&envoy_config_route_v3_RetryPolicy_RetryBackOff__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = {
NULL,
&envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = {
- &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 1, 11, 1},
+ {1, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit = {
&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[0],
&envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_HedgePolicy_submsgs[2] = {
- &envoy_type_v3_FractionalPercent_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_HedgePolicy_submsgs[2] = {
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_HedgePolicy__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit = {
&envoy_config_route_v3_HedgePolicy_submsgs[0],
&envoy_config_route_v3_HedgePolicy__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RedirectAction_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RedirectAction_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RedirectAction__fields[9] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {4, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 8, 1},
- {5, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 9, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {9, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 11, 1},
+ {1, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 56), UPB_SIZE(-41, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(20, 32), UPB_SIZE(-29, -49), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RedirectAction_msginit = {
&envoy_config_route_v3_RedirectAction_submsgs[0],
&envoy_config_route_v3_RedirectAction__fields[0],
- UPB_SIZE(48, 80), 9, false, 255,
+ UPB_SIZE(48, 80), 9, _UPB_MSGEXT_NONE, 9, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_DirectResponseAction_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_DirectResponseAction__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {2, UPB_SIZE(8, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit = {
&envoy_config_route_v3_DirectResponseAction_submsgs[0],
&envoy_config_route_v3_DirectResponseAction__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_Decorator_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+const upb_msglayout envoy_config_route_v3_NonForwardingAction_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout_sub envoy_config_route_v3_Decorator_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_Decorator__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_Decorator_msginit = {
&envoy_config_route_v3_Decorator_submsgs[0],
&envoy_config_route_v3_Decorator__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_Tracing_submsgs[2] = {
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_Tracing_submsgs[2] = {
+ {.submsg = &envoy_type_tracing_v3_CustomTag_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_Tracing__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_Tracing_msginit = {
&envoy_config_route_v3_Tracing_submsgs[0],
&envoy_config_route_v3_Tracing__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_VirtualCluster_submsgs[1] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_VirtualCluster_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_VirtualCluster__fields[2] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {4, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit = {
&envoy_config_route_v3_VirtualCluster_submsgs[0],
&envoy_config_route_v3_VirtualCluster__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_submsgs[3] = {
- &envoy_config_route_v3_RateLimit_Action_msginit,
- &envoy_config_route_v3_RateLimit_Override_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_submsgs[3] = {
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Override_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit__fields[4] = {
- {1, UPB_SIZE(12, 24), 1, 2, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_msginit = {
&envoy_config_route_v3_RateLimit_submsgs[0],
&envoy_config_route_v3_RateLimit__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_submsgs[9] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
- &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
- &envoy_config_route_v3_RateLimit_Action_MetaData_msginit,
- &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
- &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
- &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Action_submsgs[9] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_MetaData_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit},
+ {.submsg = &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action__fields[9] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit = {
&envoy_config_route_v3_RateLimit_Action_submsgs[0],
&envoy_config_route_v3_RateLimit_Action__fields[0],
- UPB_SIZE(8, 16), 9, false, 255,
+ UPB_SIZE(8, 16), 9, _UPB_MSGEXT_NONE, 9, 255,
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = {
NULL,
&envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = {
NULL,
&envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit = {
&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[0],
&envoy_config_route_v3_RateLimit_Action_HeaderValueMatch__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit = {
&envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[0],
&envoy_config_route_v3_RateLimit_Action_DynamicMetaData__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Action_MetaData__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Action_MetaData_msginit = {
&envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[0],
&envoy_config_route_v3_RateLimit_Action_MetaData__fields[0],
- UPB_SIZE(32, 48), 4, false, 255,
+ UPB_SIZE(32, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Override_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit = {
&envoy_config_route_v3_RateLimit_Override_submsgs[0],
&envoy_config_route_v3_RateLimit_Override__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit = {
&envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[0],
&envoy_config_route_v3_RateLimit_Override_DynamicMetadata__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_HeaderMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &envoy_type_v3_Int64Range_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_HeaderMatcher_submsgs[3] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_v3_Int64Range_msginit},
};
-static const upb_msglayout_field envoy_config_route_v3_HeaderMatcher__fields[9] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {6, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 1, 11, 1},
- {7, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 8, 1},
- {8, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {9, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {10, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
- {11, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, 1},
- {12, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, 1},
+static const upb_msglayout_field envoy_config_route_v3_HeaderMatcher__fields[10] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(12, 24), UPB_SIZE(-21, -41), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit = {
&envoy_config_route_v3_HeaderMatcher_submsgs[0],
&envoy_config_route_v3_HeaderMatcher__fields[0],
- UPB_SIZE(24, 48), 9, false, 255,
+ UPB_SIZE(24, 48), 10, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_QueryParameterMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_QueryParameterMatcher__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit = {
&envoy_config_route_v3_QueryParameterMatcher_submsgs[0],
&envoy_config_route_v3_QueryParameterMatcher__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_InternalRedirectPolicy__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 13, _UPB_LABEL_PACKED},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
- {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 13, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit = {
&envoy_config_route_v3_InternalRedirectPolicy_submsgs[0],
&envoy_config_route_v3_InternalRedirectPolicy__fields[0],
- UPB_SIZE(16, 32), 4, false, 255,
+ UPB_SIZE(16, 32), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_FilterConfig_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_FilterConfig_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_FilterConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_FilterConfig_msginit = {
&envoy_config_route_v3_FilterConfig_submsgs[0],
&envoy_config_route_v3_FilterConfig__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[53] = {
+ &envoy_config_route_v3_VirtualHost_msginit,
+ &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_FilterAction_msginit,
+ &envoy_config_route_v3_Route_msginit,
+ &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_WeightedCluster_msginit,
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
+ &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
+ &envoy_config_route_v3_RouteMatch_msginit,
+ &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
+ &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
+ &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
+ &envoy_config_route_v3_CorsPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_msginit,
+ &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
+ &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
+ &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
+ &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
+ &envoy_config_route_v3_RetryPolicy_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
+ &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
+ &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
+ &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
+ &envoy_config_route_v3_HedgePolicy_msginit,
+ &envoy_config_route_v3_RedirectAction_msginit,
+ &envoy_config_route_v3_DirectResponseAction_msginit,
+ &envoy_config_route_v3_NonForwardingAction_msginit,
+ &envoy_config_route_v3_Decorator_msginit,
+ &envoy_config_route_v3_Tracing_msginit,
+ &envoy_config_route_v3_VirtualCluster_msginit,
+ &envoy_config_route_v3_RateLimit_msginit,
+ &envoy_config_route_v3_RateLimit_Action_msginit,
+ &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
+ &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
+ &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
+ &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
+ &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
+ &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
+ &envoy_config_route_v3_RateLimit_Action_MetaData_msginit,
+ &envoy_config_route_v3_RateLimit_Override_msginit,
+ &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
+ &envoy_config_route_v3_HeaderMatcher_msginit,
+ &envoy_config_route_v3_QueryParameterMatcher_msginit,
+ &envoy_config_route_v3_InternalRedirectPolicy_msginit,
+ &envoy_config_route_v3_FilterConfig_msginit,
+};
+
+const upb_msglayout_file envoy_config_route_v3_route_components_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 53,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
index 4f98c01552c..155ca8bafb3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
#define ENVOY_CONFIG_ROUTE_V3_ROUTE_COMPONENTS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -53,6 +53,7 @@ struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff;
struct envoy_config_route_v3_HedgePolicy;
struct envoy_config_route_v3_RedirectAction;
struct envoy_config_route_v3_DirectResponseAction;
+struct envoy_config_route_v3_NonForwardingAction;
struct envoy_config_route_v3_Decorator;
struct envoy_config_route_v3_Tracing;
struct envoy_config_route_v3_VirtualCluster;
@@ -105,6 +106,7 @@ typedef struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff envoy_c
typedef struct envoy_config_route_v3_HedgePolicy envoy_config_route_v3_HedgePolicy;
typedef struct envoy_config_route_v3_RedirectAction envoy_config_route_v3_RedirectAction;
typedef struct envoy_config_route_v3_DirectResponseAction envoy_config_route_v3_DirectResponseAction;
+typedef struct envoy_config_route_v3_NonForwardingAction envoy_config_route_v3_NonForwardingAction;
typedef struct envoy_config_route_v3_Decorator envoy_config_route_v3_Decorator;
typedef struct envoy_config_route_v3_Tracing envoy_config_route_v3_Tracing;
typedef struct envoy_config_route_v3_VirtualCluster envoy_config_route_v3_VirtualCluster;
@@ -157,6 +159,7 @@ extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBac
extern const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit;
extern const upb_msglayout envoy_config_route_v3_RedirectAction_msginit;
extern const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit;
+extern const upb_msglayout envoy_config_route_v3_NonForwardingAction_msginit;
extern const upb_msglayout envoy_config_route_v3_Decorator_msginit;
extern const upb_msglayout envoy_config_route_v3_Tracing_msginit;
extern const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit;
@@ -182,6 +185,7 @@ struct envoy_config_core_v3_Metadata;
struct envoy_config_core_v3_ProxyProtocolConfig;
struct envoy_config_core_v3_RuntimeFractionalPercent;
struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_type_matcher_v3_MetadataMatcher;
struct envoy_type_matcher_v3_RegexMatchAndSubstitute;
struct envoy_type_matcher_v3_RegexMatcher;
struct envoy_type_matcher_v3_StringMatcher;
@@ -199,6 +203,7 @@ extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
@@ -254,13 +259,19 @@ UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_
UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_VirtualHost *ret = envoy_config_route_v3_VirtualHost_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_VirtualHost *envoy_config_route_v3_VirtualHost_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_VirtualHost *ret = envoy_config_route_v3_VirtualHost_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualHost_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_VirtualHost_serialize(const envoy_config_route_v3_VirtualHost *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_VirtualHost_msginit, arena, len);
@@ -501,13 +512,19 @@ UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterActio
UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_FilterAction *ret = envoy_config_route_v3_FilterAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_FilterAction *envoy_config_route_v3_FilterAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_FilterAction *ret = envoy_config_route_v3_FilterAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_FilterAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_FilterAction_serialize(const envoy_config_route_v3_FilterAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_FilterAction_msginit, arena, len);
@@ -538,13 +555,19 @@ UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_new(upb_aren
UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_Route *ret = envoy_config_route_v3_Route_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_Route *envoy_config_route_v3_Route_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_Route *ret = envoy_config_route_v3_Route_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_Route_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_Route_serialize(const envoy_config_route_v3_Route *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_Route_msginit, arena, len);
@@ -555,6 +578,7 @@ typedef enum {
envoy_config_route_v3_Route_action_redirect = 3,
envoy_config_route_v3_Route_action_direct_response = 7,
envoy_config_route_v3_Route_action_filter_action = 17,
+ envoy_config_route_v3_Route_action_non_forwarding_action = 18,
envoy_config_route_v3_Route_action_NOT_SET = 0
} envoy_config_route_v3_Route_action_oneofcases;
UPB_INLINE envoy_config_route_v3_Route_action_oneofcases envoy_config_route_v3_Route_action_case(const envoy_config_route_v3_Route* msg) { return (envoy_config_route_v3_Route_action_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(56, 112), int32_t); }
@@ -588,6 +612,8 @@ UPB_INLINE bool envoy_config_route_v3_Route_has_per_request_buffer_limit_bytes(c
UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_Route_per_request_buffer_limit_bytes(const envoy_config_route_v3_Route *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 56), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_config_route_v3_Route_has_filter_action(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(56, 112)) == 17; }
UPB_INLINE const envoy_config_route_v3_FilterAction* envoy_config_route_v3_Route_filter_action(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_FilterAction*, UPB_SIZE(52, 104), UPB_SIZE(56, 112), 17, NULL); }
+UPB_INLINE bool envoy_config_route_v3_Route_has_non_forwarding_action(const envoy_config_route_v3_Route *msg) { return _upb_getoneofcase(msg, UPB_SIZE(56, 112)) == 18; }
+UPB_INLINE const envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_non_forwarding_action(const envoy_config_route_v3_Route *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(52, 104), UPB_SIZE(56, 112), 18, NULL); }
UPB_INLINE void envoy_config_route_v3_Route_set_match(envoy_config_route_v3_Route *msg, envoy_config_route_v3_RouteMatch* value) {
_upb_sethas(msg, 1);
@@ -755,6 +781,18 @@ UPB_INLINE struct envoy_config_route_v3_FilterAction* envoy_config_route_v3_Rout
}
return sub;
}
+UPB_INLINE void envoy_config_route_v3_Route_set_non_forwarding_action(envoy_config_route_v3_Route *msg, envoy_config_route_v3_NonForwardingAction* value) {
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_NonForwardingAction*, UPB_SIZE(52, 104), value, UPB_SIZE(56, 112), 18);
+}
+UPB_INLINE struct envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_Route_mutable_non_forwarding_action(envoy_config_route_v3_Route *msg, upb_arena *arena) {
+ struct envoy_config_route_v3_NonForwardingAction* sub = (struct envoy_config_route_v3_NonForwardingAction*)envoy_config_route_v3_Route_non_forwarding_action(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_route_v3_NonForwardingAction*)_upb_msg_new(&envoy_config_route_v3_NonForwardingAction_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_Route_set_non_forwarding_action(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.route.v3.Route.TypedPerFilterConfigEntry */
@@ -782,13 +820,19 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_Weighted
UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_WeightedCluster *ret = envoy_config_route_v3_WeightedCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_WeightedCluster *envoy_config_route_v3_WeightedCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_WeightedCluster *ret = envoy_config_route_v3_WeightedCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_WeightedCluster_serialize(const envoy_config_route_v3_WeightedCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, arena, len);
@@ -838,40 +882,55 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_rou
UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_WeightedCluster_ClusterWeight *ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight *envoy_config_route_v3_WeightedCluster_ClusterWeight_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_WeightedCluster_ClusterWeight *ret = envoy_config_route_v3_WeightedCluster_ClusterWeight_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_WeightedCluster_ClusterWeight_serialize(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, arena, len);
}
+typedef enum {
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_host_rewrite_literal = 11,
+ envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_NOT_SET = 0
+} envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases;
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_case(const envoy_config_route_v3_WeightedCluster_ClusterWeight* msg) { return (envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(56, 112), int32_t); }
+
UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_name(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_Metadata*); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
-UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE size_t envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) {return _upb_msg_map_size(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(36, 72), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(36, 72), iter); }
+UPB_INLINE const struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 48), const struct envoy_config_core_v3_Metadata*); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct envoy_config_core_v3_HeaderValueOption* const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_add(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (const struct envoy_config_core_v3_HeaderValueOption* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_response_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 72), len); }
+UPB_INLINE upb_strview const* envoy_config_route_v3_WeightedCluster_ClusterWeight_request_headers_to_remove(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 80), len); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_typed_per_filter_config(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE size_t envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_size(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) {return _upb_msg_map_size(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_get(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* *val) { return _upb_msg_map_get(msg, UPB_SIZE(44, 88), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_next(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (const envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_has_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return _upb_getoneofcase(msg, UPB_SIZE(56, 112)) == 11; }
+UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_literal(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(48, 96), UPB_SIZE(56, 112), 11, upb_strview_make("", strlen(""))); }
+UPB_INLINE upb_strview envoy_config_route_v3_WeightedCluster_ClusterWeight_cluster_header(const envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_name(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct google_protobuf_UInt32Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_weight(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(msg);
@@ -884,7 +943,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_config_route_v3_WeightedClu
}
UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, struct envoy_config_core_v3_Metadata* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(16, 32), struct envoy_config_core_v3_Metadata*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 48), struct envoy_config_core_v3_Metadata*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_metadata_match(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
struct envoy_config_core_v3_Metadata* sub = (struct envoy_config_core_v3_Metadata*)envoy_config_route_v3_WeightedCluster_ClusterWeight_metadata_match(msg);
@@ -896,55 +955,61 @@ UPB_INLINE struct envoy_config_core_v3_Metadata* envoy_config_route_v3_WeightedC
return sub;
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption** envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_core_v3_HeaderValueOption**)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_core_v3_HeaderValueOption* envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_add(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_arena *arena) {
struct envoy_config_core_v3_HeaderValueOption* sub = (struct envoy_config_core_v3_HeaderValueOption*)_upb_msg_new(&envoy_config_core_v3_HeaderValueOption_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 72), len);
}
UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(36, 72), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_response_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(36, 72), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_mutable_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 80), len);
}
UPB_INLINE upb_strview* envoy_config_route_v3_WeightedCluster_ClusterWeight_resize_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(40, 80), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_add_request_headers_to_remove(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(32, 64), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(40, 80), UPB_SIZE(3, 4), &val,
arena);
}
-UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { _upb_msg_map_clear(msg, UPB_SIZE(36, 72)); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(36, 72), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(36, 72), &key, 0); }
-UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_nextmutable(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(36, 72), iter); }
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_clear(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg) { _upb_msg_map_clear(msg, UPB_SIZE(44, 88)); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_set(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key, struct google_protobuf_Any* val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(44, 88), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_delete(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(44, 88), &key, 0); }
+UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry* envoy_config_route_v3_WeightedCluster_ClusterWeight_typed_per_filter_config_nextmutable(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, size_t* iter) { return (envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry*)_upb_msg_map_next(msg, UPB_SIZE(44, 88), iter); }
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_host_rewrite_literal(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(48, 96), value, UPB_SIZE(56, 112), 11);
+}
+UPB_INLINE void envoy_config_route_v3_WeightedCluster_ClusterWeight_set_cluster_header(envoy_config_route_v3_WeightedCluster_ClusterWeight *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
/* envoy.config.route.v3.WeightedCluster.ClusterWeight.TypedPerFilterConfigEntry */
@@ -972,13 +1037,19 @@ UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_ne
UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteMatch *ret = envoy_config_route_v3_RouteMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteMatch *envoy_config_route_v3_RouteMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteMatch *ret = envoy_config_route_v3_RouteMatch_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteMatch_serialize(const envoy_config_route_v3_RouteMatch *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteMatch_msginit, arena, len);
@@ -991,12 +1062,12 @@ typedef enum {
envoy_config_route_v3_RouteMatch_path_specifier_connect_matcher = 12,
envoy_config_route_v3_RouteMatch_path_specifier_NOT_SET = 0
} envoy_config_route_v3_RouteMatch_path_specifier_oneofcases;
-UPB_INLINE envoy_config_route_v3_RouteMatch_path_specifier_oneofcases envoy_config_route_v3_RouteMatch_path_specifier_case(const envoy_config_route_v3_RouteMatch* msg) { return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
+UPB_INLINE envoy_config_route_v3_RouteMatch_path_specifier_oneofcases envoy_config_route_v3_RouteMatch_path_specifier_case(const envoy_config_route_v3_RouteMatch* msg) { return (envoy_config_route_v3_RouteMatch_path_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 80), int32_t); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 1; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 1, upb_strview_make("", strlen(""))); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 2; }
-UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 2, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_prefix(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 1; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_prefix(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(32, 64), UPB_SIZE(40, 80), 1, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_path(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 2; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteMatch_path(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(32, 64), UPB_SIZE(40, 80), 2, upb_strview_make("", strlen(""))); }
UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct google_protobuf_BoolValue* envoy_config_route_v3_RouteMatch_case_sensitive(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_headers(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
@@ -1007,18 +1078,20 @@ UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_grpc(const envoy_config_rou
UPB_INLINE const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_route_v3_RouteMatch_grpc(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions*); }
UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_route_v3_RouteMatch_runtime_fraction(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_RuntimeFractionalPercent*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 10; }
-UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 10, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 10; }
+UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_safe_regex(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(32, 64), UPB_SIZE(40, 80), 10, NULL); }
UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config_route_v3_RouteMatch_tls_context(const envoy_config_route_v3_RouteMatch *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions*); }
-UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 12; }
-UPB_INLINE const envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 12, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 12; }
+UPB_INLINE const envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_connect_matcher(const envoy_config_route_v3_RouteMatch *msg) { return UPB_READ_ONEOF(msg, const envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(32, 64), UPB_SIZE(40, 80), 12, NULL); }
+UPB_INLINE bool envoy_config_route_v3_RouteMatch_has_dynamic_metadata(const envoy_config_route_v3_RouteMatch *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
+UPB_INLINE const struct envoy_type_matcher_v3_MetadataMatcher* const* envoy_config_route_v3_RouteMatch_dynamic_metadata(const envoy_config_route_v3_RouteMatch *msg, size_t *len) { return (const struct envoy_type_matcher_v3_MetadataMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_prefix(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 1);
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(32, 64), value, UPB_SIZE(40, 80), 1);
}
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_path(envoy_config_route_v3_RouteMatch *msg, upb_strview value) {
- UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 2);
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(32, 64), value, UPB_SIZE(40, 80), 2);
}
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_case_sensitive(envoy_config_route_v3_RouteMatch *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
@@ -1086,7 +1159,7 @@ UPB_INLINE struct envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_ro
return sub;
}
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_safe_regex(envoy_config_route_v3_RouteMatch *msg, struct envoy_type_matcher_v3_RegexMatcher* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 10);
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(32, 64), value, UPB_SIZE(40, 80), 10);
}
UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_RouteMatch_mutable_safe_regex(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
struct envoy_type_matcher_v3_RegexMatcher* sub = (struct envoy_type_matcher_v3_RegexMatcher*)envoy_config_route_v3_RouteMatch_safe_regex(msg);
@@ -1111,7 +1184,7 @@ UPB_INLINE struct envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy
return sub;
}
UPB_INLINE void envoy_config_route_v3_RouteMatch_set_connect_matcher(envoy_config_route_v3_RouteMatch *msg, envoy_config_route_v3_RouteMatch_ConnectMatcher* value) {
- UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 12);
+ UPB_WRITE_ONEOF(msg, envoy_config_route_v3_RouteMatch_ConnectMatcher*, UPB_SIZE(32, 64), value, UPB_SIZE(40, 80), 12);
}
UPB_INLINE struct envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v3_RouteMatch_mutable_connect_matcher(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
struct envoy_config_route_v3_RouteMatch_ConnectMatcher* sub = (struct envoy_config_route_v3_RouteMatch_ConnectMatcher*)envoy_config_route_v3_RouteMatch_connect_matcher(msg);
@@ -1122,6 +1195,19 @@ UPB_INLINE struct envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_
}
return sub;
}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_mutable_dynamic_metadata(envoy_config_route_v3_RouteMatch *msg, size_t *len) {
+ return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher** envoy_config_route_v3_RouteMatch_resize_dynamic_metadata(envoy_config_route_v3_RouteMatch *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_type_matcher_v3_MetadataMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_matcher_v3_MetadataMatcher* envoy_config_route_v3_RouteMatch_add_dynamic_metadata(envoy_config_route_v3_RouteMatch *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_MetadataMatcher* sub = (struct envoy_type_matcher_v3_MetadataMatcher*)_upb_msg_new(&envoy_type_matcher_v3_MetadataMatcher_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
/* envoy.config.route.v3.RouteMatch.GrpcRouteMatchOptions */
@@ -1131,13 +1217,19 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_
UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *ret = envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, arena, len);
@@ -1153,13 +1245,19 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config
UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *ret = envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_serialize(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, arena, len);
@@ -1205,13 +1303,19 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v
UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteMatch_ConnectMatcher *ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher *envoy_config_route_v3_RouteMatch_ConnectMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteMatch_ConnectMatcher *ret = envoy_config_route_v3_RouteMatch_ConnectMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteMatch_ConnectMatcher_serialize(const envoy_config_route_v3_RouteMatch_ConnectMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, arena, len);
@@ -1227,13 +1331,19 @@ UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_ne
UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_CorsPolicy *ret = envoy_config_route_v3_CorsPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_CorsPolicy *envoy_config_route_v3_CorsPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_CorsPolicy *ret = envoy_config_route_v3_CorsPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_CorsPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_CorsPolicy_serialize(const envoy_config_route_v3_CorsPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, arena, len);
@@ -1330,13 +1440,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_
UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction *ret = envoy_config_route_v3_RouteAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction *envoy_config_route_v3_RouteAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction *ret = envoy_config_route_v3_RouteAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_serialize(const envoy_config_route_v3_RouteAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_msginit, arena, len);
@@ -1346,6 +1462,7 @@ typedef enum {
envoy_config_route_v3_RouteAction_cluster_specifier_cluster = 1,
envoy_config_route_v3_RouteAction_cluster_specifier_cluster_header = 2,
envoy_config_route_v3_RouteAction_cluster_specifier_weighted_clusters = 3,
+ envoy_config_route_v3_RouteAction_cluster_specifier_cluster_specifier_plugin = 37,
envoy_config_route_v3_RouteAction_cluster_specifier_NOT_SET = 0
} envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases;
UPB_INLINE envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases envoy_config_route_v3_RouteAction_cluster_specifier_case(const envoy_config_route_v3_RouteAction* msg) { return (envoy_config_route_v3_RouteAction_cluster_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(104, 192), int32_t); }
@@ -1413,6 +1530,8 @@ UPB_INLINE bool envoy_config_route_v3_RouteAction_has_host_rewrite_path_regex(co
UPB_INLINE const struct envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_config_route_v3_RouteAction_host_rewrite_path_regex(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*, UPB_SIZE(108, 200), UPB_SIZE(116, 216), 35, NULL); }
UPB_INLINE bool envoy_config_route_v3_RouteAction_has_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return _upb_hasbit(msg, 14); }
UPB_INLINE const envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_route_v3_RouteAction_max_stream_duration(const envoy_config_route_v3_RouteAction *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 136), const envoy_config_route_v3_RouteAction_MaxStreamDuration*); }
+UPB_INLINE bool envoy_config_route_v3_RouteAction_has_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction *msg) { return _upb_getoneofcase(msg, UPB_SIZE(104, 192)) == 37; }
+UPB_INLINE upb_strview envoy_config_route_v3_RouteAction_cluster_specifier_plugin(const envoy_config_route_v3_RouteAction *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(96, 176), UPB_SIZE(104, 192), 37, upb_strview_make("", strlen(""))); }
UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(96, 176), value, UPB_SIZE(104, 192), 1);
@@ -1708,6 +1827,9 @@ UPB_INLINE struct envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_con
}
return sub;
}
+UPB_INLINE void envoy_config_route_v3_RouteAction_set_cluster_specifier_plugin(envoy_config_route_v3_RouteAction *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(96, 176), value, UPB_SIZE(104, 192), 37);
+}
/* envoy.config.route.v3.RouteAction.RequestMirrorPolicy */
@@ -1717,13 +1839,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_r
UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_RequestMirrorPolicy *ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_RequestMirrorPolicy *ret = envoy_config_route_v3_RouteAction_RequestMirrorPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_RequestMirrorPolicy_serialize(const envoy_config_route_v3_RouteAction_RequestMirrorPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, arena, len);
@@ -1773,13 +1901,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_R
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy *ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy *envoy_config_route_v3_RouteAction_HashPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy *ret = envoy_config_route_v3_RouteAction_HashPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_serialize(const envoy_config_route_v3_RouteAction_HashPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, arena, len);
@@ -1879,13 +2013,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_rou
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_Header *ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header *envoy_config_route_v3_RouteAction_HashPolicy_Header_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_Header *ret = envoy_config_route_v3_RouteAction_HashPolicy_Header_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Header_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Header *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, arena, len);
@@ -1920,13 +2060,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_rou
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_Cookie *ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_Cookie *ret = envoy_config_route_v3_RouteAction_HashPolicy_Cookie_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_Cookie_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_Cookie *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, arena, len);
@@ -1965,13 +2111,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *en
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *ret = envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, arena, len);
@@ -1991,13 +2143,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_co
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *ret = envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, arena, len);
@@ -2017,13 +2175,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_confi
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_FilterState *ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_HashPolicy_FilterState *ret = envoy_config_route_v3_RouteAction_HashPolicy_FilterState_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_HashPolicy_FilterState_serialize(const envoy_config_route_v3_RouteAction_HashPolicy_FilterState *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, arena, len);
@@ -2043,13 +2207,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v
UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_UpgradeConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_UpgradeConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, arena, len);
@@ -2099,13 +2269,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_
UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *ret = envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_serialize(const envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, arena, len);
@@ -2140,13 +2316,19 @@ UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_rou
UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RouteAction_MaxStreamDuration *ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration *envoy_config_route_v3_RouteAction_MaxStreamDuration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RouteAction_MaxStreamDuration *ret = envoy_config_route_v3_RouteAction_MaxStreamDuration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RouteAction_MaxStreamDuration_serialize(const envoy_config_route_v3_RouteAction_MaxStreamDuration *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, arena, len);
@@ -2207,13 +2389,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_
UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy *ret = envoy_config_route_v3_RetryPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy *envoy_config_route_v3_RetryPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy *ret = envoy_config_route_v3_RetryPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_serialize(const envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, arena, len);
@@ -2226,18 +2414,22 @@ UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_timeout(const envo
UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 40), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v3_RetryPolicy_retry_priority(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), const envoy_config_route_v3_RetryPolicy_RetryPriority*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 72)); }
-UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(44, 72), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(48, 80)); }
+UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const* envoy_config_route_v3_RetryPolicy_retry_host_predicate(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_RetryPolicy_RetryHostPredicate* const*)_upb_array_accessor(msg, UPB_SIZE(48, 80), len); }
UPB_INLINE int64_t envoy_config_route_v3_RetryPolicy_host_selection_retry_max_attempts(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
-UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 80), len); }
+UPB_INLINE uint32_t const* envoy_config_route_v3_RetryPolicy_retriable_status_codes(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 88), len); }
UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3_RetryPolicy_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 56), const envoy_config_route_v3_RetryPolicy_RetryBackOff*); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(52, 88)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(52, 88), len); }
-UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 96)); }
-UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(56, 96), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(56, 96)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(56, 96), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(60, 104)); }
+UPB_INLINE const envoy_config_route_v3_HeaderMatcher* const* envoy_config_route_v3_RetryPolicy_retriable_request_headers(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const envoy_config_route_v3_HeaderMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(60, 104), len); }
UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_config_route_v3_RetryPolicy_rate_limited_retry_back_off(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff*); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_retry_options_predicates(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(64, 112)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_route_v3_RetryPolicy_retry_options_predicates(const envoy_config_route_v3_RetryPolicy *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(64, 112), len); }
+UPB_INLINE bool envoy_config_route_v3_RetryPolicy_has_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_per_try_idle_timeout(const envoy_config_route_v3_RetryPolicy *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_Duration*); }
UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_on(envoy_config_route_v3_RetryPolicy *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
@@ -2282,15 +2474,15 @@ UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_
return sub;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_mutable_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 72), len);
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 80), len);
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate** envoy_config_route_v3_RetryPolicy_resize_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_resize_accessor2(msg, UPB_SIZE(44, 72), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_route_v3_RetryPolicy_RetryHostPredicate**)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 80), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_route_v3_RetryPolicy_add_retry_host_predicate(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate* sub = (struct envoy_config_route_v3_RetryPolicy_RetryHostPredicate*)_upb_msg_new(&envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(44, 72), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(48, 80), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -2298,13 +2490,13 @@ UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_host_selection_retry_max_a
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
}
UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_mutable_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 80), len);
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 88), len);
}
UPB_INLINE uint32_t* envoy_config_route_v3_RetryPolicy_resize_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 80), len, 2, arena);
+ return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 88), len, 2, arena);
}
UPB_INLINE bool envoy_config_route_v3_RetryPolicy_add_retriable_status_codes(envoy_config_route_v3_RetryPolicy *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 80), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 88), 2, &val,
arena);
}
UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_retry_back_off(envoy_config_route_v3_RetryPolicy *msg, envoy_config_route_v3_RetryPolicy_RetryBackOff* value) {
@@ -2321,28 +2513,28 @@ UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_r
return sub;
}
UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 88), len);
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 96), len);
}
UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 88), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 96), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(52, 88), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(56, 96), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_mutable_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 96), len);
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(60, 104), len);
}
UPB_INLINE envoy_config_route_v3_HeaderMatcher** envoy_config_route_v3_RetryPolicy_resize_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
- return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 96), len, UPB_SIZE(2, 3), arena);
+ return (envoy_config_route_v3_HeaderMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(60, 104), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_RetryPolicy_add_retriable_request_headers(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
struct envoy_config_route_v3_HeaderMatcher* sub = (struct envoy_config_route_v3_HeaderMatcher*)_upb_msg_new(&envoy_config_route_v3_HeaderMatcher_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(56, 96), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(60, 104), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -2359,6 +2551,32 @@ UPB_INLINE struct envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* env
}
return sub;
}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_mutable_retry_options_predicates(envoy_config_route_v3_RetryPolicy *msg, size_t *len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(64, 112), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_route_v3_RetryPolicy_resize_retry_options_predicates(envoy_config_route_v3_RetryPolicy *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(64, 112), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_route_v3_RetryPolicy_add_retry_options_predicates(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(64, 112), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy *msg, struct google_protobuf_Duration* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Duration*) = value;
+}
+UPB_INLINE struct google_protobuf_Duration* envoy_config_route_v3_RetryPolicy_mutable_per_try_idle_timeout(envoy_config_route_v3_RetryPolicy *msg, upb_arena *arena) {
+ struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_config_route_v3_RetryPolicy_per_try_idle_timeout(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_RetryPolicy_set_per_try_idle_timeout(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.route.v3.RetryPolicy.RetryPriority */
@@ -2368,13 +2586,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryPriority *ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority *envoy_config_route_v3_RetryPolicy_RetryPriority_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryPriority *ret = envoy_config_route_v3_RetryPolicy_RetryPriority_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryPriority_serialize(const envoy_config_route_v3_RetryPolicy_RetryPriority *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, arena, len);
@@ -2414,13 +2638,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_ro
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryHostPredicate *ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryHostPredicate *ret = envoy_config_route_v3_RetryPolicy_RetryHostPredicate_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryHostPredicate_serialize(const envoy_config_route_v3_RetryPolicy_RetryHostPredicate *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, arena, len);
@@ -2460,13 +2690,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff *envoy_config_route_v3_RetryPolicy_RetryBackOff_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RetryBackOff_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RetryBackOff *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, arena, len);
@@ -2512,13 +2748,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_
UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_ResetHeader *ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader *envoy_config_route_v3_RetryPolicy_ResetHeader_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_ResetHeader *ret = envoy_config_route_v3_RetryPolicy_ResetHeader_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_ResetHeader_serialize(const envoy_config_route_v3_RetryPolicy_ResetHeader *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, arena, len);
@@ -2542,13 +2784,19 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_conf
UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *ret = envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_serialize(const envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, arena, len);
@@ -2594,13 +2842,19 @@ UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_
UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_HedgePolicy *ret = envoy_config_route_v3_HedgePolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_HedgePolicy *envoy_config_route_v3_HedgePolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_HedgePolicy *ret = envoy_config_route_v3_HedgePolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_HedgePolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_HedgePolicy_serialize(const envoy_config_route_v3_HedgePolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, arena, len);
@@ -2650,13 +2904,19 @@ UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectA
UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RedirectAction *ret = envoy_config_route_v3_RedirectAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RedirectAction *envoy_config_route_v3_RedirectAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RedirectAction *ret = envoy_config_route_v3_RedirectAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RedirectAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RedirectAction_serialize(const envoy_config_route_v3_RedirectAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RedirectAction_msginit, arena, len);
@@ -2737,13 +2997,19 @@ UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_Dir
UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_DirectResponseAction *ret = envoy_config_route_v3_DirectResponseAction_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_DirectResponseAction *envoy_config_route_v3_DirectResponseAction_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_DirectResponseAction *ret = envoy_config_route_v3_DirectResponseAction_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_DirectResponseAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_DirectResponseAction_serialize(const envoy_config_route_v3_DirectResponseAction *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, arena, len);
@@ -2770,6 +3036,34 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_route_v3_DirectR
return sub;
}
+/* envoy.config.route.v3.NonForwardingAction */
+
+UPB_INLINE envoy_config_route_v3_NonForwardingAction *envoy_config_route_v3_NonForwardingAction_new(upb_arena *arena) {
+ return (envoy_config_route_v3_NonForwardingAction *)_upb_msg_new(&envoy_config_route_v3_NonForwardingAction_msginit, arena);
+}
+UPB_INLINE envoy_config_route_v3_NonForwardingAction *envoy_config_route_v3_NonForwardingAction_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_config_route_v3_NonForwardingAction *ret = envoy_config_route_v3_NonForwardingAction_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_config_route_v3_NonForwardingAction *envoy_config_route_v3_NonForwardingAction_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_config_route_v3_NonForwardingAction *ret = envoy_config_route_v3_NonForwardingAction_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_NonForwardingAction_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_config_route_v3_NonForwardingAction_serialize(const envoy_config_route_v3_NonForwardingAction *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, arena, len);
+}
+
+
+
/* envoy.config.route.v3.Decorator */
UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_new(upb_arena *arena) {
@@ -2778,13 +3072,19 @@ UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_new(
UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_Decorator *ret = envoy_config_route_v3_Decorator_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_Decorator *envoy_config_route_v3_Decorator_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_Decorator *ret = envoy_config_route_v3_Decorator_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_Decorator_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_Decorator_serialize(const envoy_config_route_v3_Decorator *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_Decorator_msginit, arena, len);
@@ -2819,13 +3119,19 @@ UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_new(upb_
UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_Tracing *ret = envoy_config_route_v3_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_Tracing *envoy_config_route_v3_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_Tracing *ret = envoy_config_route_v3_Tracing_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_Tracing_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_Tracing_serialize(const envoy_config_route_v3_Tracing *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_Tracing_msginit, arena, len);
@@ -2901,13 +3207,19 @@ UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCl
UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_VirtualCluster *ret = envoy_config_route_v3_VirtualCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_VirtualCluster *envoy_config_route_v3_VirtualCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_VirtualCluster *ret = envoy_config_route_v3_VirtualCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_VirtualCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_VirtualCluster_serialize(const envoy_config_route_v3_VirtualCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, arena, len);
@@ -2942,13 +3254,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_new(
UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit *ret = envoy_config_route_v3_RateLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit *envoy_config_route_v3_RateLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit *ret = envoy_config_route_v3_RateLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_serialize(const envoy_config_route_v3_RateLimit *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_msginit, arena, len);
@@ -3013,13 +3331,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLim
UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action *ret = envoy_config_route_v3_RateLimit_Action_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action *envoy_config_route_v3_RateLimit_Action_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action *ret = envoy_config_route_v3_RateLimit_Action_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_serialize(const envoy_config_route_v3_RateLimit_Action *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, arena, len);
@@ -3175,13 +3499,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_ro
UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_SourceCluster *ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster *envoy_config_route_v3_RateLimit_Action_SourceCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_SourceCluster *ret = envoy_config_route_v3_RateLimit_Action_SourceCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_SourceCluster_serialize(const envoy_config_route_v3_RateLimit_Action_SourceCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, arena, len);
@@ -3197,13 +3527,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_conf
UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_DestinationCluster *ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster *envoy_config_route_v3_RateLimit_Action_DestinationCluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_DestinationCluster *ret = envoy_config_route_v3_RateLimit_Action_DestinationCluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DestinationCluster_serialize(const envoy_config_route_v3_RateLimit_Action_DestinationCluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, arena, len);
@@ -3219,13 +3555,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_r
UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_RequestHeaders *ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders *envoy_config_route_v3_RateLimit_Action_RequestHeaders_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_RequestHeaders *ret = envoy_config_route_v3_RateLimit_Action_RequestHeaders_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RequestHeaders_serialize(const envoy_config_route_v3_RateLimit_Action_RequestHeaders *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, arena, len);
@@ -3253,13 +3595,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_ro
UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_RemoteAddress *ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress *envoy_config_route_v3_RateLimit_Action_RemoteAddress_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_RemoteAddress *ret = envoy_config_route_v3_RateLimit_Action_RemoteAddress_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_RemoteAddress_serialize(const envoy_config_route_v3_RateLimit_Action_RemoteAddress *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, arena, len);
@@ -3275,13 +3623,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route
UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_GenericKey *ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey *envoy_config_route_v3_RateLimit_Action_GenericKey_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_GenericKey *ret = envoy_config_route_v3_RateLimit_Action_GenericKey_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_GenericKey_serialize(const envoy_config_route_v3_RateLimit_Action_GenericKey *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, arena, len);
@@ -3305,13 +3659,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config
UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *ret = envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_serialize(const envoy_config_route_v3_RateLimit_Action_HeaderValueMatch *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, arena, len);
@@ -3361,13 +3721,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_
UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_DynamicMetaData *ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_DynamicMetaData *ret = envoy_config_route_v3_RateLimit_Action_DynamicMetaData_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_DynamicMetaData_serialize(const envoy_config_route_v3_RateLimit_Action_DynamicMetaData *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, arena, len);
@@ -3406,13 +3772,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v
UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v3_RateLimit_Action_MetaData_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_MetaData *ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData *envoy_config_route_v3_RateLimit_Action_MetaData_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Action_MetaData *ret = envoy_config_route_v3_RateLimit_Action_MetaData_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Action_MetaData_serialize(const envoy_config_route_v3_RateLimit_Action_MetaData *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, arena, len);
@@ -3455,13 +3827,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateL
UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Override *ret = envoy_config_route_v3_RateLimit_Override_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Override *envoy_config_route_v3_RateLimit_Override_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Override *ret = envoy_config_route_v3_RateLimit_Override_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_serialize(const envoy_config_route_v3_RateLimit_Override *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, arena, len);
@@ -3497,13 +3875,19 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_confi
UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_RateLimit_Override_DynamicMetadata *ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_RateLimit_Override_DynamicMetadata *ret = envoy_config_route_v3_RateLimit_Override_DynamicMetadata_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_RateLimit_Override_DynamicMetadata_serialize(const envoy_config_route_v3_RateLimit_Override_DynamicMetadata *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, arena, len);
@@ -3534,13 +3918,19 @@ UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatc
UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_HeaderMatcher *ret = envoy_config_route_v3_HeaderMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_HeaderMatcher *envoy_config_route_v3_HeaderMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_HeaderMatcher *ret = envoy_config_route_v3_HeaderMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_HeaderMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_HeaderMatcher_serialize(const envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, arena, len);
@@ -3554,6 +3944,7 @@ typedef enum {
envoy_config_route_v3_HeaderMatcher_header_match_specifier_prefix_match = 9,
envoy_config_route_v3_HeaderMatcher_header_match_specifier_suffix_match = 10,
envoy_config_route_v3_HeaderMatcher_header_match_specifier_contains_match = 12,
+ envoy_config_route_v3_HeaderMatcher_header_match_specifier_string_match = 13,
envoy_config_route_v3_HeaderMatcher_header_match_specifier_NOT_SET = 0
} envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases;
UPB_INLINE envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases envoy_config_route_v3_HeaderMatcher_header_match_specifier_case(const envoy_config_route_v3_HeaderMatcher* msg) { return (envoy_config_route_v3_HeaderMatcher_header_match_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
@@ -3574,6 +3965,8 @@ UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(const e
UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_HeaderMatcher_safe_regex_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 11, NULL); }
UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 12; }
UPB_INLINE upb_strview envoy_config_route_v3_HeaderMatcher_contains_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 12, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool envoy_config_route_v3_HeaderMatcher_has_string_match(const envoy_config_route_v3_HeaderMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 13; }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_string_match(const envoy_config_route_v3_HeaderMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 13, NULL); }
UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_name(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
@@ -3620,6 +4013,18 @@ UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher* envoy_config_route_v3_Head
UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_contains_match(envoy_config_route_v3_HeaderMatcher *msg, upb_strview value) {
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 12);
}
+UPB_INLINE void envoy_config_route_v3_HeaderMatcher_set_string_match(envoy_config_route_v3_HeaderMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
+ UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 13);
+}
+UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_config_route_v3_HeaderMatcher_mutable_string_match(envoy_config_route_v3_HeaderMatcher *msg, upb_arena *arena) {
+ struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_config_route_v3_HeaderMatcher_string_match(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
+ if (!sub) return NULL;
+ envoy_config_route_v3_HeaderMatcher_set_string_match(msg, sub);
+ }
+ return sub;
+}
/* envoy.config.route.v3.QueryParameterMatcher */
@@ -3629,13 +4034,19 @@ UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_Qu
UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_QueryParameterMatcher *ret = envoy_config_route_v3_QueryParameterMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_QueryParameterMatcher *envoy_config_route_v3_QueryParameterMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_QueryParameterMatcher *ret = envoy_config_route_v3_QueryParameterMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_QueryParameterMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_QueryParameterMatcher_serialize(const envoy_config_route_v3_QueryParameterMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, arena, len);
@@ -3681,13 +4092,19 @@ UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_I
UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_InternalRedirectPolicy *ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy *envoy_config_route_v3_InternalRedirectPolicy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_InternalRedirectPolicy *ret = envoy_config_route_v3_InternalRedirectPolicy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_InternalRedirectPolicy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_InternalRedirectPolicy_serialize(const envoy_config_route_v3_InternalRedirectPolicy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, arena, len);
@@ -3748,13 +4165,19 @@ UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfi
UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_FilterConfig *ret = envoy_config_route_v3_FilterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_FilterConfig *envoy_config_route_v3_FilterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_FilterConfig *ret = envoy_config_route_v3_FilterConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_FilterConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_FilterConfig_serialize(const envoy_config_route_v3_FilterConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_FilterConfig_msginit, arena, len);
@@ -3781,6 +4204,8 @@ UPB_INLINE void envoy_config_route_v3_FilterConfig_set_is_optional(envoy_config_
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+extern const upb_msglayout_file envoy_config_route_v3_route_components_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
index 301441e3c42..10ddd34397e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/route/v3/scoped_route.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,45 +15,58 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_ScopedRouteConfiguration_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {4, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit = {
&envoy_config_route_v3_ScopedRouteConfiguration_submsgs[0],
&envoy_config_route_v3_ScopedRouteConfiguration__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
+static const upb_msglayout_sub envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit},
};
static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit = {
&envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[0],
&envoy_config_route_v3_ScopedRouteConfiguration_Key__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = {
NULL,
&envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
+ &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
+};
+
+const upb_msglayout_file envoy_config_route_v3_scoped_route_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
index 72d1622841f..1c80c9e5e24 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
#define ENVOY_CONFIG_ROUTE_V3_SCOPED_ROUTE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,13 +39,19 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration *ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration *envoy_config_route_v3_ScopedRouteConfiguration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration *ret = envoy_config_route_v3_ScopedRouteConfiguration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_serialize(const envoy_config_route_v3_ScopedRouteConfiguration *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, arena, len);
@@ -88,13 +94,19 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_rout
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration_Key *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key *envoy_config_route_v3_ScopedRouteConfiguration_Key_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration_Key *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, arena, len);
@@ -125,13 +137,19 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_co
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *ret = envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_serialize(const envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, arena, len);
@@ -150,6 +168,8 @@ UPB_INLINE void envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_set_
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
}
+extern const upb_msglayout_file envoy_config_route_v3_scoped_route_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
index 52cb6b72ba0..fd93ebd1de2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/config/trace/v3/http_tracer.upb.h"
#include "google/protobuf/any.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,33 +16,45 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_config_trace_v3_Tracing_submsgs[1] = {
- &envoy_config_trace_v3_Tracing_Http_msginit,
+static const upb_msglayout_sub envoy_config_trace_v3_Tracing_submsgs[1] = {
+ {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit},
};
static const upb_msglayout_field envoy_config_trace_v3_Tracing__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_trace_v3_Tracing_msginit = {
&envoy_config_trace_v3_Tracing_submsgs[0],
&envoy_config_trace_v3_Tracing__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_config_trace_v3_Tracing_Http_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_config_trace_v3_Tracing_Http__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit = {
&envoy_config_trace_v3_Tracing_Http_submsgs[0],
&envoy_config_trace_v3_Tracing_Http__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_config_trace_v3_Tracing_msginit,
+ &envoy_config_trace_v3_Tracing_Http_msginit,
+};
+
+const upb_msglayout_file envoy_config_trace_v3_http_tracer_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
index 21240fa0e48..4416397e1e7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
#define ENVOY_CONFIG_TRACE_V3_HTTP_TRACER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_new(upb_
UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_trace_v3_Tracing *ret = envoy_config_trace_v3_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_trace_v3_Tracing *envoy_config_trace_v3_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_trace_v3_Tracing *ret = envoy_config_trace_v3_Tracing_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_trace_v3_Tracing_serialize(const envoy_config_trace_v3_Tracing *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_trace_v3_Tracing_msginit, arena, len);
@@ -75,13 +81,19 @@ UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Htt
UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_config_trace_v3_Tracing_Http *ret = envoy_config_trace_v3_Tracing_Http_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_config_trace_v3_Tracing_Http *envoy_config_trace_v3_Tracing_Http_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_config_trace_v3_Tracing_Http *ret = envoy_config_trace_v3_Tracing_Http_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_config_trace_v3_Tracing_Http_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_config_trace_v3_Tracing_Http_serialize(const envoy_config_trace_v3_Tracing_Http *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, arena, len);
@@ -113,6 +125,8 @@ UPB_INLINE struct google_protobuf_Any* envoy_config_trace_v3_Tracing_Http_mutabl
return sub;
}
+extern const upb_msglayout_file envoy_config_trace_v3_http_tracer_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
index 308e8b53388..a885ac69c87 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -16,13 +16,24 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = {
NULL,
&envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
index ffa4ccbca29..4b992fba2d4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_CLUSTERS_AGGREGATE_V3_CLUSTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extension
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig *envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_clusters_aggregate_v3_ClusterConfig *ret = envoy_extensions_clusters_aggregate_v3_ClusterConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_clusters_aggregate_v3_ClusterConfig_serialize(const envoy_extensions_clusters_aggregate_v3_ClusterConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, arena, len);
@@ -58,6 +64,8 @@ UPB_INLINE bool envoy_extensions_clusters_aggregate_v3_ClusterConfig_add_cluster
arena);
}
+extern const upb_msglayout_file envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
index 5f92b8d00b2..c0be9946224 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/duration.upb.h"
@@ -17,62 +17,77 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = {
- &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[3] = {
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultDelay__fields[3] = {
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {4, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit = {
&envoy_extensions_filters_common_fault_v3_FaultDelay_submsgs[0],
&envoy_extensions_filters_common_fault_v3_FaultDelay__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = {
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = {
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[3] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {2, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit = {
&envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[0],
&envoy_extensions_filters_common_fault_v3_FaultRateLimit__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit = {
NULL,
&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
+ &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
index 8c609170d4e..5b0d3a2641c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -53,13 +53,19 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena, len);
@@ -125,13 +131,19 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envo
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena, len);
@@ -147,13 +159,19 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extens
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena, len);
@@ -219,13 +237,19 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *e
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena, len);
@@ -245,13 +269,19 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena, len);
@@ -259,6 +289,8 @@ UPB_INLINE char *envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderL
+extern const upb_msglayout_file envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
index ca5144c5dcf..e616f084748 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/http/fault/v3/fault.upb.h"
#include "envoy/config/route/v3/route_components.upb.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
@@ -19,59 +19,73 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = {
- &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[2] = {
+ {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit},
+ {.submsg = &envoy_type_v3_FractionalPercent_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_http_fault_v3_FaultAbort__fields[4] = {
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, 1},
- {3, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, 1},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_msginit = {
&envoy_extensions_filters_http_fault_v3_FaultAbort_submsgs[0],
&envoy_extensions_filters_http_fault_v3_FaultAbort__fields[0],
- UPB_SIZE(16, 32), 4, false, 255,
+ UPB_SIZE(16, 32), 4, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = {
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
- &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = {
+ {.submsg = &envoy_config_route_v3_HeaderMatcher_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit},
+ {.submsg = &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit},
+ {.submsg = &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_http_fault_v3_HTTPFault__fields[14] = {
- {1, UPB_SIZE(68, 136), 1, 1, 11, 1},
- {2, UPB_SIZE(72, 144), 2, 3, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(84, 168), 0, 0, 11, 3},
- {5, UPB_SIZE(88, 176), 0, 0, 9, 3},
- {6, UPB_SIZE(76, 152), 3, 4, 11, 1},
- {7, UPB_SIZE(80, 160), 4, 2, 11, 1},
- {8, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {9, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {10, UPB_SIZE(28, 56), 0, 0, 9, 1},
- {11, UPB_SIZE(36, 72), 0, 0, 9, 1},
- {12, UPB_SIZE(44, 88), 0, 0, 9, 1},
- {13, UPB_SIZE(52, 104), 0, 0, 9, 1},
- {14, UPB_SIZE(60, 120), 0, 0, 9, 1},
+static const upb_msglayout_field envoy_extensions_filters_http_fault_v3_HTTPFault__fields[15] = {
+ {1, UPB_SIZE(68, 136), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(72, 144), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(84, 168), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(88, 176), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(76, 152), 3, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(80, 160), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(36, 72), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(44, 88), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(52, 104), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(60, 120), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_http_fault_v3_HTTPFault_msginit = {
&envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[0],
&envoy_extensions_filters_http_fault_v3_HTTPFault__fields[0],
- UPB_SIZE(96, 192), 14, false, 255,
+ UPB_SIZE(96, 192), 15, _UPB_MSGEXT_NONE, 15, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
+ &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
+ &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
index fc618c9a53e..817e9999acc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_FAULT_V3_FAULT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -49,13 +49,19 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_f
UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_FaultAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_FaultAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_http_fault_v3_FaultAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, arena, len);
@@ -118,13 +124,19 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_
UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *ret = envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_serialize(const envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, arena, len);
@@ -140,13 +152,19 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_fi
UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_filters_http_fault_v3_HTTPFault_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_HTTPFault *ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault *envoy_extensions_filters_http_fault_v3_HTTPFault_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_http_fault_v3_HTTPFault *ret = envoy_extensions_filters_http_fault_v3_HTTPFault_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_http_fault_v3_HTTPFault_serialize(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, arena, len);
@@ -171,6 +189,7 @@ UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_abort_ht
UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 88), upb_strview); }
UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_response_rate_limit_percent_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 104), upb_strview); }
UPB_INLINE upb_strview envoy_extensions_filters_http_fault_v3_HTTPFault_abort_grpc_status_runtime(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_http_fault_v3_HTTPFault_disable_downstream_cluster_stats(const envoy_extensions_filters_http_fault_v3_HTTPFault *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_delay(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, struct envoy_extensions_filters_common_fault_v3_FaultDelay* value) {
_upb_sethas(msg, 1);
@@ -271,6 +290,11 @@ UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_response_ra
UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_abort_grpc_status_runtime(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(60, 120), upb_strview) = value;
}
+UPB_INLINE void envoy_extensions_filters_http_fault_v3_HTTPFault_set_disable_downstream_cluster_stats(envoy_extensions_filters_http_fault_v3_HTTPFault *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
+
+extern const upb_msglayout_file envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
index 8e6ff697fc5..cea9a7a0d31 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "google/protobuf/wrappers.upb.h"
@@ -17,24 +17,36 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_http_router_v3_Router_submsgs[2] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_http_router_v3_Router_submsgs[2] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_http_router_v3_Router__fields[6] = {
- {1, UPB_SIZE(4, 8), 1, 1, 11, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {3, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {5, UPB_SIZE(12, 24), 0, 0, 9, 3},
- {6, UPB_SIZE(3, 3), 0, 0, 8, 1},
+static const upb_msglayout_field envoy_extensions_filters_http_router_v3_Router__fields[7] = {
+ {1, UPB_SIZE(8, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit = {
&envoy_extensions_filters_http_router_v3_Router_submsgs[0],
&envoy_extensions_filters_http_router_v3_Router__fields[0],
- UPB_SIZE(16, 32), 6, false, 255,
+ UPB_SIZE(24, 32), 7, _UPB_MSGEXT_NONE, 7, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_extensions_filters_http_router_v3_Router_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
index 2e7084ac970..43a344b3d36 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,30 +37,37 @@ UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filt
UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_http_router_v3_Router_serialize(const envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, len);
}
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_start_child_span(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
-UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 16)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(12, 16), len); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
-UPB_INLINE upb_strview const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
+UPB_INLINE upb_strview const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(16, 24), len); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
+UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_grpc_request_failure_code_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_mutable_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_http_router_v3_Router_dynamic_stats(msg);
@@ -75,15 +82,15 @@ UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_start_child_s
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 16), len);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 16), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_http_router_v3_Router_add_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena) {
struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(12, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -91,18 +98,23 @@ UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_envo
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(16, 24), len);
}
UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(16, 24), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_add_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(16, 24), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_respect_expected_rq_timeout(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
+UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_grpc_request_failure_code_stats(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+
+extern const upb_msglayout_file envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
index 6b2b6c15bb9..bb36936867b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "envoy/config/core/v3/base.upb.h"
@@ -18,6 +18,7 @@
#include "envoy/config/route/v3/route.upb.h"
#include "envoy/config/route/v3/scoped_route.upb.h"
#include "envoy/config/trace/v3/http_tracer.upb.h"
+#include "envoy/type/http/v3/path_transformation.upb.h"
#include "envoy/type/tracing/v3/custom_tag.upb.h"
#include "envoy/type/v3/percent.upb.h"
#include "google/protobuf/any.upb.h"
@@ -31,331 +32,400 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[17] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_route_v3_RouteConfiguration_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
- &google_protobuf_UInt32Value_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[40] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(28, 32), 0, 0, 9, 1},
- {3, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 11, 11, 1},
- {4, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 4, 11, 1},
- {5, UPB_SIZE(128, 232), 0, 9, 11, 3},
- {6, UPB_SIZE(52, 80), 1, 14, 11, 1},
- {7, UPB_SIZE(56, 88), 2, 7, 11, 1},
- {8, UPB_SIZE(60, 96), 3, 1, 11, 1},
- {9, UPB_SIZE(64, 104), 4, 2, 11, 1},
- {10, UPB_SIZE(36, 48), 0, 0, 9, 1},
- {12, UPB_SIZE(68, 112), 5, 15, 11, 1},
- {13, UPB_SIZE(132, 240), 0, 0, 11, 3},
- {14, UPB_SIZE(72, 120), 6, 14, 11, 1},
- {15, UPB_SIZE(76, 128), 7, 14, 11, 1},
- {16, UPB_SIZE(8, 8), 0, 0, 14, 1},
- {17, UPB_SIZE(80, 136), 8, 6, 11, 1},
- {18, UPB_SIZE(20, 20), 0, 0, 8, 1},
- {19, UPB_SIZE(16, 16), 0, 0, 13, 1},
- {20, UPB_SIZE(21, 21), 0, 0, 8, 1},
- {21, UPB_SIZE(22, 22), 0, 0, 8, 1},
- {22, UPB_SIZE(44, 64), 0, 0, 9, 1},
- {23, UPB_SIZE(136, 248), 0, 8, 11, 3},
- {24, UPB_SIZE(84, 144), 9, 15, 11, 1},
- {25, UPB_SIZE(88, 152), 10, 5, 11, 1},
- {26, UPB_SIZE(92, 160), 11, 15, 11, 1},
- {28, UPB_SIZE(96, 168), 12, 15, 11, 1},
- {29, UPB_SIZE(100, 176), 13, 16, 11, 1},
- {30, UPB_SIZE(104, 184), 14, 14, 11, 1},
- {31, UPB_SIZE(140, 256), UPB_SIZE(-145, -265), 13, 11, 1},
- {32, UPB_SIZE(23, 23), 0, 0, 8, 1},
- {33, UPB_SIZE(24, 24), 0, 0, 8, 1},
- {34, UPB_SIZE(12, 12), 0, 0, 14, 1},
- {35, UPB_SIZE(108, 192), 15, 3, 11, 1},
- {36, UPB_SIZE(112, 200), 16, 12, 11, 1},
- {37, UPB_SIZE(25, 25), 0, 0, 8, 1},
- {38, UPB_SIZE(116, 208), 17, 10, 11, 1},
- {39, UPB_SIZE(26, 26), 0, 0, 8, 1},
- {40, UPB_SIZE(120, 216), 18, 14, 11, 1},
- {41, UPB_SIZE(124, 224), 19, 15, 11, 1},
- {42, UPB_SIZE(148, 268), UPB_SIZE(-153, -273), 0, 8, 1},
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[21] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLog_msginit},
+ {.submsg = &envoy_config_core_v3_Http1ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http2ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_Http3ProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_HttpProtocolOptions_msginit},
+ {.submsg = &envoy_config_core_v3_SchemeHeaderTransformation_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_route_v3_RouteConfiguration_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[46] = {
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(160, 288), UPB_SIZE(-165, -297), 15, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(160, 288), UPB_SIZE(-165, -297), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(144, 256), 0, 13, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(56, 80), 1, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(60, 88), 2, 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(64, 96), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(68, 104), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(40, 48), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(72, 112), 5, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(148, 264), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(76, 120), 6, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(80, 128), 7, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(84, 136), 8, 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(24, 24), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(20, 20), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(25, 25), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(26, 26), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(48, 64), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(152, 272), 0, 12, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(88, 144), 9, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(92, 152), 10, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(96, 160), 11, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {28, UPB_SIZE(100, 168), 12, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {29, UPB_SIZE(104, 176), 13, 20, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {30, UPB_SIZE(108, 184), 14, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {31, UPB_SIZE(160, 288), UPB_SIZE(-165, -297), 17, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {32, UPB_SIZE(27, 27), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {33, UPB_SIZE(28, 28), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {34, UPB_SIZE(12, 12), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {35, UPB_SIZE(112, 192), 15, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {36, UPB_SIZE(116, 200), 16, 16, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {37, UPB_SIZE(29, 29), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {38, UPB_SIZE(120, 208), 17, 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {39, UPB_SIZE(30, 30), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {40, UPB_SIZE(124, 216), 18, 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {41, UPB_SIZE(128, 224), 19, 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {42, UPB_SIZE(168, 300), UPB_SIZE(-173, -305), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {43, UPB_SIZE(132, 232), 20, 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {44, UPB_SIZE(136, 240), 21, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {45, UPB_SIZE(16, 16), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {46, UPB_SIZE(156, 280), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {47, UPB_SIZE(31, 31), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {48, UPB_SIZE(140, 248), 22, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager__fields[0],
- UPB_SIZE(160, 288), 40, false, 255,
+ UPB_SIZE(176, 320), 46, _UPB_MSGEXT_NONE, 10, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[4] = {
- &envoy_config_trace_v3_Tracing_Http_msginit,
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_v3_Percent_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[4] = {
+ {.submsg = &envoy_config_trace_v3_Tracing_Http_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_msginit},
+ {.submsg = &envoy_type_v3_Percent_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[7] = {
- {3, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {4, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {5, UPB_SIZE(12, 24), 3, 2, 11, 1},
- {6, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {7, UPB_SIZE(16, 32), 4, 3, 11, 1},
- {8, UPB_SIZE(24, 48), 0, 1, 11, 3},
- {9, UPB_SIZE(20, 40), 5, 0, 11, 1},
+ {3, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(12, 24), 3, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(16, 32), 4, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 48), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(20, 40), 5, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing__fields[0],
- UPB_SIZE(32, 56), 7, false, 255,
+ UPB_SIZE(32, 56), 7, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit = {
NULL,
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = {
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
- {5, UPB_SIZE(3, 3), 0, 0, 8, 1},
- {6, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(3, 3), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails__fields[0],
- UPB_SIZE(16, 16), 5, false, 255,
+ UPB_SIZE(16, 16), 5, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = {
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[1] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_msginit},
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[2] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions__fields[0],
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = {
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = {
+ {.submsg = &envoy_config_accesslog_v3_AccessLogFilter_msginit},
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_HeaderValueOption_msginit},
+ {.submsg = &envoy_config_core_v3_SubstitutionFormatString_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[5] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 4, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 3, 11, 1},
- {5, UPB_SIZE(20, 40), 0, 2, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper__fields[0],
- UPB_SIZE(24, 48), 5, false, 255,
+ UPB_SIZE(24, 48), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_Rds__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = {
+ {.submsg = &envoy_config_route_v3_ScopedRouteConfiguration_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = {
- &envoy_config_core_v3_ConfigSource_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit},
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[5] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 3, 11, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {4, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 2, 11, 1},
- {5, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), UPB_SIZE(-25, -49), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 13, 1},
- {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), UPB_SIZE(-21, -41), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit = {
NULL,
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
-static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[2] = {
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = {
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ExtensionConfigSource_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {4, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, 1},
- {5, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(12, 24), UPB_SIZE(-17, -33), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit = {
&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[0],
&envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[1] = {
+ {.submsg = &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit},
+};
+
+static const upb_msglayout_field envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[1] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[0],
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager__fields[0],
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[19] = {
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
+ &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 19,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
index 668fa854854..b1188e7fe89 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_NETWORK_HTTP_CONNECTION_MANAGER_V3_HTTP_CONNECTION_MANAGER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,6 +25,7 @@ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectio
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
+struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions;
struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
struct envoy_extensions_filters_network_http_connection_manager_v3_Rds;
@@ -37,11 +38,13 @@ struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_
struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
+struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Rds envoy_extensions_filters_network_http_connection_manager_v3_Rds;
@@ -54,11 +57,13 @@ typedef struct envoy_extensions_filters_network_http_connection_manager_v3_Scope
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter;
typedef struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension;
+typedef struct envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit;
@@ -71,6 +76,7 @@ extern const upb_msglayout envoy_extensions_filters_network_http_connection_mana
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit;
extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit;
+extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit;
struct envoy_config_accesslog_v3_AccessLog;
struct envoy_config_accesslog_v3_AccessLogFilter;
struct envoy_config_core_v3_ConfigSource;
@@ -79,11 +85,15 @@ struct envoy_config_core_v3_ExtensionConfigSource;
struct envoy_config_core_v3_HeaderValueOption;
struct envoy_config_core_v3_Http1ProtocolOptions;
struct envoy_config_core_v3_Http2ProtocolOptions;
+struct envoy_config_core_v3_Http3ProtocolOptions;
struct envoy_config_core_v3_HttpProtocolOptions;
+struct envoy_config_core_v3_SchemeHeaderTransformation;
struct envoy_config_core_v3_SubstitutionFormatString;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_route_v3_RouteConfiguration;
struct envoy_config_route_v3_ScopedRouteConfiguration;
struct envoy_config_trace_v3_Tracing_Http;
+struct envoy_type_http_v3_PathTransformation;
struct envoy_type_tracing_v3_CustomTag;
struct envoy_type_v3_Percent;
struct google_protobuf_Any;
@@ -98,11 +108,15 @@ extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit;
extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
+extern const upb_msglayout envoy_config_core_v3_SchemeHeaderTransformation_msginit;
extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
+extern const upb_msglayout envoy_type_http_v3_PathTransformation_msginit;
extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
extern const upb_msglayout envoy_type_v3_Percent_msginit;
extern const upb_msglayout google_protobuf_Any_msginit;
@@ -126,6 +140,14 @@ typedef enum {
} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ForwardClientCertDetails;
typedef enum {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_IMPLEMENTATION_SPECIFIC_DEFAULT = 0,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_KEEP_UNCHANGED = 1,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_REJECT_REQUEST = 2,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UNESCAPE_AND_REDIRECT = 3,
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UNESCAPE_AND_FORWARD = 4
+} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathWithEscapedSlashesAction;
+
+typedef enum {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_OVERWRITE = 0,
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_APPEND_IF_ABSENT = 1,
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PASS_THROUGH = 2
@@ -145,13 +167,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena, len);
@@ -163,89 +191,99 @@ typedef enum {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_scoped_routes = 31,
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_NOT_SET = 0
} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(144, 264), int32_t); }
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(164, 296), int32_t); }
typedef enum {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_strip_any_host_port = 42,
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_NOT_SET = 0
} envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases;
-UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(152, 272), int32_t); }
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_case(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* msg) { return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_port_mode_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(172, 304), int32_t); }
UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_codec_type(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(144, 264)) == 3; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(140, 256), UPB_SIZE(144, 264), 3, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(144, 264)) == 4; }
-UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(140, 256), UPB_SIZE(144, 264), 4, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(128, 232)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(128, 232), len); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stat_prefix(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(164, 296)) == 3; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(160, 288), UPB_SIZE(164, 296), 3, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(164, 296)) == 4; }
+UPB_INLINE const struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(160, 288), UPB_SIZE(164, 296), 4, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(144, 256)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_filters(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* const*)_upb_array_accessor(msg, UPB_SIZE(144, 256), len); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 80), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 2); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 88), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 3); }
-UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 96), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
+UPB_INLINE const struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), const struct envoy_config_core_v3_Http1ProtocolOptions*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 104), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview); }
+UPB_INLINE const struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), const struct envoy_config_core_v3_Http2ProtocolOptions*); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_name(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 112), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(132, 240)); }
-UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(132, 240), len); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 112), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(148, 264)); }
+UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_access_log(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(148, 264), len); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(72, 120), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 120), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(76, 128), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 128), const struct google_protobuf_BoolValue*); }
UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_forward_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 8); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(80, 136), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool); }
-UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool); }
-UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(136, 248)); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(136, 248), len); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 136), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_proxy_100_continue(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE uint32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_xff_num_trusted_hops(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_skip_xff_append(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_via(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(152, 272)); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_upgrade_configs(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* const*)_upb_array_accessor(msg, UPB_SIZE(152, 272), len); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 9); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(84, 144), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 144), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 10); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(88, 152), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 152), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 11); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(92, 160), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 160), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 12); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(96, 168), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 168), const struct google_protobuf_Duration*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 13); }
-UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(100, 176), const struct google_protobuf_UInt32Value*); }
+UPB_INLINE const struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 176), const struct google_protobuf_UInt32Value*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 14); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(104, 184), const struct google_protobuf_BoolValue*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(144, 264)) == 31; }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(140, 256), UPB_SIZE(144, 264), 31, NULL); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 184), const struct google_protobuf_BoolValue*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(164, 296)) == 31; }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(160, 288), UPB_SIZE(164, 296), 31, NULL); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_preserve_external_request_id(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_merge_slashes(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool); }
UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_server_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 15); }
-UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(108, 192), const struct envoy_config_core_v3_HttpProtocolOptions*); }
+UPB_INLINE const struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 192), const struct envoy_config_core_v3_HttpProtocolOptions*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 16); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(112, 200), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 200), const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_always_set_request_id_in_response(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 17); }
-UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(116, 208), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 208), const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_matching_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 18); }
-UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(120, 216), const struct google_protobuf_BoolValue*); }
+UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 216), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 19); }
-UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(124, 224), const struct google_protobuf_Duration*); }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(152, 272)) == 42; }
-UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(148, 268), UPB_SIZE(152, 272), 42, false); }
+UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(128, 224), const struct google_protobuf_Duration*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_getoneofcase(msg, UPB_SIZE(172, 304)) == 42; }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_any_host_port(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(168, 300), UPB_SIZE(172, 304), 42, false); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 20); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(132, 232), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 21); }
+UPB_INLINE const struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(136, 240), const struct envoy_config_core_v3_Http3ProtocolOptions*); }
+UPB_INLINE int32_t envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_with_escaped_slashes_action(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(156, 280)); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_original_ip_detection_extensions(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(156, 280), len); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_strip_trailing_host_dot(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return _upb_hasbit(msg, 22); }
+UPB_INLINE const struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(140, 248), const struct envoy_config_core_v3_SchemeHeaderTransformation*); }
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_codec_type(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stat_prefix(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(28, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(140, 256), value, UPB_SIZE(144, 264), 3);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_Rds*, UPB_SIZE(160, 288), value, UPB_SIZE(164, 296), 3);
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_rds(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_Rds* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_Rds*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_rds(msg);
@@ -257,7 +295,7 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Rd
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_route_v3_RouteConfiguration* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(140, 256), value, UPB_SIZE(144, 264), 4);
+ UPB_WRITE_ONEOF(msg, struct envoy_config_route_v3_RouteConfiguration*, UPB_SIZE(160, 288), value, UPB_SIZE(164, 296), 4);
}
UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_route_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_config_route_v3_RouteConfiguration* sub = (struct envoy_config_route_v3_RouteConfiguration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(msg);
@@ -269,21 +307,21 @@ UPB_INLINE struct envoy_config_route_v3_RouteConfiguration* envoy_extensions_fil
return sub;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(128, 232), len);
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_mutable_accessor(msg, UPB_SIZE(144, 256), len);
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor2(msg, UPB_SIZE(128, 232), len, UPB_SIZE(2, 3), arena);
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter**)_upb_array_resize_accessor2(msg, UPB_SIZE(144, 256), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_http_filters(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(128, 232), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(144, 256), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(52, 80), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(56, 80), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_add_user_agent(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_user_agent(msg);
@@ -296,7 +334,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* value) {
_upb_sethas(msg, 2);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 88), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 88), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*) = value;
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_tracing(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_tracing(msg);
@@ -309,7 +347,7 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http1ProtocolOptions* value) {
_upb_sethas(msg, 3);
- *UPB_PTR_AT(msg, UPB_SIZE(60, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(64, 96), struct envoy_config_core_v3_Http1ProtocolOptions*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_config_core_v3_Http1ProtocolOptions* sub = (struct envoy_config_core_v3_Http1ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http_protocol_options(msg);
@@ -322,7 +360,7 @@ UPB_INLINE struct envoy_config_core_v3_Http1ProtocolOptions* envoy_extensions_fi
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http2ProtocolOptions* value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 104), struct envoy_config_core_v3_Http2ProtocolOptions*) = value;
}
UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http2_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_config_core_v3_Http2ProtocolOptions* sub = (struct envoy_config_core_v3_Http2ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http2_protocol_options(msg);
@@ -334,11 +372,11 @@ UPB_INLINE struct envoy_config_core_v3_Http2ProtocolOptions* envoy_extensions_fi
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_name(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(36, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(68, 112), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(72, 112), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_drain_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_drain_timeout(msg);
@@ -350,21 +388,21 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
return sub;
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(132, 240), len);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(148, 264), len);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(132, 240), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(148, 264), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_access_log(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(132, 240), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(148, 264), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(72, 120), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(76, 120), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_use_remote_address(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_use_remote_address(msg);
@@ -377,7 +415,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(76, 128), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(80, 128), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_generate_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_generate_request_id(msg);
@@ -393,7 +431,7 @@ UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_Http
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* value) {
_upb_sethas(msg, 8);
- *UPB_PTR_AT(msg, UPB_SIZE(80, 136), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(84, 136), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*) = value;
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_set_current_client_cert_details(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_current_client_cert_details(msg);
@@ -405,36 +443,36 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Ht
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_proxy_100_continue(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(20, 20), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_xff_num_trusted_hops(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, uint32_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_represent_ipv4_remote_address_as_ipv4_mapped_ipv6(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(21, 21), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_skip_xff_append(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(22, 22), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_via(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(44, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(136, 248), len);
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(152, 272), len);
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
- return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(136, 248), len, UPB_SIZE(2, 3), arena);
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(152, 272), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_upgrade_configs(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(136, 248), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(152, 272), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 9);
- *UPB_PTR_AT(msg, UPB_SIZE(84, 144), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(88, 144), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_idle_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_idle_timeout(msg);
@@ -447,7 +485,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* value) {
_upb_sethas(msg, 10);
- *UPB_PTR_AT(msg, UPB_SIZE(88, 152), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(92, 152), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*) = value;
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_internal_address_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_internal_address_config(msg);
@@ -460,7 +498,7 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 11);
- *UPB_PTR_AT(msg, UPB_SIZE(92, 160), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(96, 160), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_delayed_close_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_delayed_close_timeout(msg);
@@ -473,7 +511,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 12);
- *UPB_PTR_AT(msg, UPB_SIZE(96, 168), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(100, 168), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_timeout(msg);
@@ -486,7 +524,7 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_UInt32Value* value) {
_upb_sethas(msg, 13);
- *UPB_PTR_AT(msg, UPB_SIZE(100, 176), struct google_protobuf_UInt32Value*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(104, 176), struct google_protobuf_UInt32Value*) = value;
}
UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_max_request_headers_kb(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_UInt32Value* sub = (struct google_protobuf_UInt32Value*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_max_request_headers_kb(msg);
@@ -499,7 +537,7 @@ UPB_INLINE struct google_protobuf_UInt32Value* envoy_extensions_filters_network_
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 14);
- *UPB_PTR_AT(msg, UPB_SIZE(104, 184), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(108, 184), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_normalize_path(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_normalize_path(msg);
@@ -511,7 +549,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(140, 256), value, UPB_SIZE(144, 264), 31);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*, UPB_SIZE(160, 288), value, UPB_SIZE(164, 296), 31);
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scoped_routes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scoped_routes(msg);
@@ -523,17 +561,17 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Sc
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_preserve_external_request_id(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(23, 23), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(27, 27), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_merge_slashes(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 28), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_server_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
*UPB_PTR_AT(msg, UPB_SIZE(12, 12), int32_t) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_HttpProtocolOptions* value) {
_upb_sethas(msg, 15);
- *UPB_PTR_AT(msg, UPB_SIZE(108, 192), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(112, 192), struct envoy_config_core_v3_HttpProtocolOptions*) = value;
}
UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_common_http_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_config_core_v3_HttpProtocolOptions* sub = (struct envoy_config_core_v3_HttpProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_common_http_protocol_options(msg);
@@ -546,7 +584,7 @@ UPB_INLINE struct envoy_config_core_v3_HttpProtocolOptions* envoy_extensions_fil
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* value) {
_upb_sethas(msg, 16);
- *UPB_PTR_AT(msg, UPB_SIZE(112, 200), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(116, 200), envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*) = value;
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_id_extension(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_id_extension(msg);
@@ -558,11 +596,11 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Re
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_always_set_request_id_in_response(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(29, 29), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* value) {
_upb_sethas(msg, 17);
- *UPB_PTR_AT(msg, UPB_SIZE(116, 208), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(120, 208), envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*) = value;
}
UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_local_reply_config(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_local_reply_config(msg);
@@ -574,11 +612,11 @@ UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_Lo
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_matching_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- *UPB_PTR_AT(msg, UPB_SIZE(26, 26), bool) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(30, 30), bool) = value;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 18);
- *UPB_PTR_AT(msg, UPB_SIZE(120, 216), struct google_protobuf_BoolValue*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(124, 216), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_stream_error_on_invalid_http_message(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_stream_error_on_invalid_http_message(msg);
@@ -591,7 +629,7 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 19);
- *UPB_PTR_AT(msg, UPB_SIZE(124, 224), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(128, 224), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_request_headers_timeout(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_request_headers_timeout(msg);
@@ -603,7 +641,65 @@ UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_network_htt
return sub;
}
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_any_host_port(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(148, 268), value, UPB_SIZE(152, 272), 42);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(168, 300), value, UPB_SIZE(172, 304), 42);
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* value) {
+ _upb_sethas(msg, 20);
+ *UPB_PTR_AT(msg, UPB_SIZE(132, 232), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_path_normalization_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_path_normalization_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_normalization_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_Http3ProtocolOptions* value) {
+ _upb_sethas(msg, 21);
+ *UPB_PTR_AT(msg, UPB_SIZE(136, 240), struct envoy_config_core_v3_Http3ProtocolOptions*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_Http3ProtocolOptions* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_http3_protocol_options(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_Http3ProtocolOptions* sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_http3_protocol_options(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_Http3ProtocolOptions*)_upb_msg_new(&envoy_config_core_v3_Http3ProtocolOptions_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_http3_protocol_options(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_path_with_escaped_slashes_action(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t *len) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(156, 280), len);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_resize_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, size_t len, upb_arena *arena) {
+ return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(156, 280), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_add_original_ip_detection_extensions(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(156, 280), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_strip_trailing_host_dot(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(31, 31), bool) = value;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, struct envoy_config_core_v3_SchemeHeaderTransformation* value) {
+ _upb_sethas(msg, 22);
+ *UPB_PTR_AT(msg, UPB_SIZE(140, 248), struct envoy_config_core_v3_SchemeHeaderTransformation*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_SchemeHeaderTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_mutable_scheme_header_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_SchemeHeaderTransformation* sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_scheme_header_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_SchemeHeaderTransformation*)_upb_msg_new(&envoy_config_core_v3_SchemeHeaderTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_set_scheme_header_transformation(msg, sub);
+ }
+ return sub;
}
/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.Tracing */
@@ -614,13 +710,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, arena, len);
@@ -730,13 +832,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, arena, len);
@@ -756,13 +864,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, arena, len);
@@ -809,13 +923,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, arena, len);
@@ -857,6 +977,64 @@ UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_network_ht
return sub;
}
+/* envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_http_v3_PathTransformation*); }
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_has_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct envoy_type_http_v3_PathTransformation*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_http_v3_PathTransformation*) = value;
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_forwarding_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, upb_arena *arena) {
+ struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_forwarding_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation*)_upb_msg_new(&envoy_type_http_v3_PathTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_forwarding_transformation(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, struct envoy_type_http_v3_PathTransformation* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct envoy_type_http_v3_PathTransformation*) = value;
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation* envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_mutable_http_filter_transformation(envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions *msg, upb_arena *arena) {
+ struct envoy_type_http_v3_PathTransformation* sub = (struct envoy_type_http_v3_PathTransformation*)envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_http_filter_transformation(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation*)_upb_msg_new(&envoy_type_http_v3_PathTransformation_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_set_http_filter_transformation(msg, sub);
+ }
+ return sub;
+}
+
/* envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig */
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(upb_arena *arena) {
@@ -865,13 +1043,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalRepl
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *ret = envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, arena, len);
@@ -917,13 +1101,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseM
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *ret = envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, arena, len);
@@ -1014,13 +1204,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envo
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_Rds *ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds *envoy_extensions_filters_network_http_connection_manager_v3_Rds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_Rds *ret = envoy_extensions_filters_network_http_connection_manager_v3_Rds_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_Rds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_Rds *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, arena, len);
@@ -1055,13 +1251,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, arena, len);
@@ -1092,13 +1294,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, arena, len);
@@ -1183,13 +1391,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, arena, len);
@@ -1220,13 +1434,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, arena, len);
@@ -1262,13 +1482,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, arena, len);
@@ -1318,13 +1544,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, arena, len);
@@ -1348,24 +1580,31 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *ret = envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, arena, len);
}
UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_has_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE const struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_config_core_v3_ConfigSource*); }
+UPB_INLINE upb_strview envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_srds_resources_locator(const envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, struct envoy_config_core_v3_ConfigSource* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_config_core_v3_ConfigSource*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct envoy_config_core_v3_ConfigSource*) = value;
}
UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_mutable_scoped_rds_config_source(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_arena *arena) {
struct envoy_config_core_v3_ConfigSource* sub = (struct envoy_config_core_v3_ConfigSource*)envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_scoped_rds_config_source(msg);
@@ -1376,6 +1615,9 @@ UPB_INLINE struct envoy_config_core_v3_ConfigSource* envoy_extensions_filters_ne
}
return sub;
}
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_set_srds_resources_locator(envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
/* envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter */
@@ -1385,13 +1627,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilte
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *ret = envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, arena, len);
@@ -1450,13 +1698,19 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestID
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *ret = envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, arena, len);
@@ -1479,6 +1733,51 @@ UPB_INLINE struct google_protobuf_Any* envoy_extensions_filters_network_http_con
return sub;
}
+/* envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager */
+
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(upb_arena *arena) {
+ return (envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, arena);
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *ret = envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_serialize(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_has_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(const envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*); }
+
+UPB_INLINE void envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg, envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*) = value;
+}
+UPB_INLINE struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_mutable_config(envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager *msg, upb_arena *arena) {
+ struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager* sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*)_upb_msg_new(&envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_set_config(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
index 44d63a49387..0d0c1b537f2 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
@@ -15,5 +15,12 @@
#include "upb/port_def.inc"
+const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ 0,
+ 0,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
index f1b24af9e65..3f3091fb2ce 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
@@ -9,15 +9,15 @@
#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_CERT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
/* Public Imports. */
-#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
-#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
#include "upb/port_def.inc"
@@ -26,6 +26,8 @@ extern "C" {
#endif
+extern const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
index 247f262ea0c..ae40fb9f04b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@@ -7,12 +7,14 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
#include "envoy/config/core/v3/base.upb.h"
+#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "google/protobuf/any.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "udpa/annotations/migrate.upb.h"
#include "udpa/annotations/sensitive.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -21,92 +23,123 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[4] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 16), 0, 0, 9, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit = {
NULL,
&envoy_extensions_transport_sockets_tls_v3_TlsParameters__fields[0],
- UPB_SIZE(16, 24), 4, false, 255,
+ UPB_SIZE(16, 24), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit = {
&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[3] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[7] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 0, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(28, 56), 0, 0, 11, 3},
- {6, UPB_SIZE(20, 40), 5, 2, 11, 1},
- {7, UPB_SIZE(24, 48), 6, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(20, 40), 5, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 48), 6, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit = {
&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_TlsCertificate__fields[0],
- UPB_SIZE(32, 64), 7, false, 255,
+ UPB_SIZE(32, 64), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit = {
&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit = {
+ NULL,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[4] = {
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &google_protobuf_BoolValue_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[6] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_config_core_v3_WatchedDirectory_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
};
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[9] = {
- {1, UPB_SIZE(12, 16), 1, 0, 11, 1},
- {2, UPB_SIZE(28, 48), 0, 0, 9, 3},
- {3, UPB_SIZE(32, 56), 0, 0, 9, 3},
- {6, UPB_SIZE(16, 24), 2, 3, 11, 1},
- {7, UPB_SIZE(20, 32), 3, 0, 11, 1},
- {8, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {9, UPB_SIZE(36, 64), 0, 2, 11, 3},
- {10, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {11, UPB_SIZE(24, 40), 4, 1, 11, 1},
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[11] = {
+ {1, UPB_SIZE(12, 16), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(36, 64), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(40, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(16, 24), 2, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(20, 32), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(44, 80), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(24, 40), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(28, 48), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(32, 56), 6, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit = {
&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext__fields[0],
- UPB_SIZE(40, 72), 9, false, 255,
+ UPB_SIZE(48, 88), 11, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[6] = {
+ &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 6,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
index 73b534aa25e..a3e4e8e099d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_COMMON_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -24,23 +24,28 @@ struct envoy_extensions_transport_sockets_tls_v3_TlsParameters;
struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance;
struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
typedef struct envoy_extensions_transport_sockets_tls_v3_TlsParameters envoy_extensions_transport_sockets_tls_v3_TlsParameters;
typedef struct envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider;
typedef struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
typedef struct envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys;
+typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance;
typedef struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
struct envoy_config_core_v3_DataSource;
+struct envoy_config_core_v3_TypedExtensionConfig;
struct envoy_config_core_v3_WatchedDirectory;
struct envoy_type_matcher_v3_StringMatcher;
struct google_protobuf_Any;
struct google_protobuf_BoolValue;
extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
+extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
extern const upb_msglayout envoy_config_core_v3_WatchedDirectory_msginit;
extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
extern const upb_msglayout google_protobuf_Any_msginit;
@@ -68,13 +73,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extens
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsParameters *ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters *envoy_extensions_transport_sockets_tls_v3_TlsParameters_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsParameters *ret = envoy_extensions_transport_sockets_tls_v3_TlsParameters_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsParameters_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsParameters *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, arena, len);
@@ -120,13 +131,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_e
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *ret = envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, arena, len);
@@ -166,13 +183,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_exten
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsCertificate *ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsCertificate *ret = envoy_extensions_transport_sockets_tls_v3_TlsCertificate_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsCertificate_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsCertificate *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena, len);
@@ -293,13 +316,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *ret = envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_serialize(const envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, arena, len);
@@ -322,6 +351,42 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_so
return sub;
}
+/* envoy.extensions.transport_sockets.tls.v3.CertificateProviderPluginInstance */
+
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(upb_arena *arena) {
+ return (envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *ret = envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_serialize(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_instance_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_certificate_name(const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
+
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_instance_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_set_certificate_name(envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
+}
+
/* envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext */
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(upb_arena *arena) {
@@ -330,13 +395,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContex
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, arena, len);
@@ -344,18 +415,22 @@ UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CertificateValidation
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trusted_ca(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 16), const struct envoy_config_core_v3_DataSource*); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 48), len); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(32, 56), len); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(40, 72), len); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_crl(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 32), const struct envoy_config_core_v3_DataSource*); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_allow_expired_certificate(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(36, 64)); }
-UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(36, 64), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 80)); }
+UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* const* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) { return (const struct envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(44, 80), len); }
UPB_INLINE int32_t envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_trust_chain_verification(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_watched_directory(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 40), const struct envoy_config_core_v3_WatchedDirectory*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 48), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 56), const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*); }
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_trusted_ca(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_DataSource* value) {
_upb_sethas(msg, 1);
@@ -371,23 +446,23 @@ UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_extensions_transport_so
return sub;
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 48), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 48), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_hash(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 48), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(36, 64), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 56), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(40, 72), len);
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 56), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(40, 72), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_verify_certificate_spki(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(32, 56), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(40, 72), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_require_signed_certificate_timestamp(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct google_protobuf_BoolValue* value) {
@@ -420,15 +495,15 @@ UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationC
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), bool) = value;
}
UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t *len) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(36, 64), len);
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 80), len);
}
UPB_INLINE struct envoy_type_matcher_v3_StringMatcher** envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_resize_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(36, 64), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(44, 80), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_add_match_subject_alt_names(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(36, 64), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(44, 80), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
@@ -448,6 +523,34 @@ UPB_INLINE struct envoy_config_core_v3_WatchedDirectory* envoy_extensions_transp
}
return sub;
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, struct envoy_config_core_v3_TypedExtensionConfig* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(28, 48), struct envoy_config_core_v3_TypedExtensionConfig*) = value;
+}
+UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_custom_validator_config(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_custom_validator_config(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_custom_validator_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 56), envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_mutable_ca_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_set_ca_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
index 6717a17a024..06b42902ca4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/core/v3/config_source.upb.h"
@@ -19,54 +19,67 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = {
- &envoy_config_core_v3_DataSource_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_DataSource_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit = {
&envoy_extensions_transport_sockets_tls_v3_GenericSecret_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_GenericSecret__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = {
- &envoy_config_core_v3_ConfigSource_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_ConfigSource_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit = {
&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = {
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_Secret__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit = {
&envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_Secret__fields[0],
- UPB_SIZE(16, 32), 5, false, 255,
+ UPB_SIZE(16, 32), 5, _UPB_MSGEXT_NONE, 5, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
index c576e0adcee..75271a2fcad 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_SECRET_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -49,13 +49,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extens
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_GenericSecret *ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret *envoy_extensions_transport_sockets_tls_v3_GenericSecret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_GenericSecret *ret = envoy_extensions_transport_sockets_tls_v3_GenericSecret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_GenericSecret_serialize(const envoy_extensions_transport_sockets_tls_v3_GenericSecret *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, arena, len);
@@ -86,13 +92,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_exte
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *ret = envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_serialize(const envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena, len);
@@ -127,13 +139,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_tr
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_Secret *ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret *envoy_extensions_transport_sockets_tls_v3_Secret_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_Secret *ret = envoy_extensions_transport_sockets_tls_v3_Secret_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_Secret_serialize(const envoy_extensions_transport_sockets_tls_v3_Secret *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, arena, len);
@@ -210,6 +228,8 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy
return sub;
}
+extern const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
index ad5494ce2e6..23e1f9a67f4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c
@@ -7,139 +7,157 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
#include "envoy/config/core/v3/extension.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
-#include "udpa/annotations/migrate.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[2] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit},
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[4] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(16, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit = {
&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[5] = {
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[5] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit},
+ {.submsg = &google_protobuf_BoolValue_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[8] = {
- {1, UPB_SIZE(8, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(12, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(16, 24), 3, 3, 11, 1},
- {4, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 2, 11, 1},
- {5, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 1, 11, 1},
- {6, UPB_SIZE(20, 32), 4, 4, 11, 1},
- {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 0, 8, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 3, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(20, 32), 4, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 40), UPB_SIZE(-29, -49), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit = {
&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext__fields[0],
- UPB_SIZE(32, 56), 8, false, 255,
-};
-
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[8] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
-};
-
-static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[12] = {
- {1, UPB_SIZE(4, 8), 1, 7, 11, 1},
- {2, UPB_SIZE(20, 40), 0, 6, 11, 3},
- {3, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 1, 11, 1},
- {4, UPB_SIZE(24, 48), 0, 0, 9, 3},
- {6, UPB_SIZE(28, 56), 0, 5, 11, 3},
- {7, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 5, 11, 1},
- {8, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 4, 11, 1},
- {9, UPB_SIZE(8, 16), 2, 2, 11, 1},
- {10, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 2, 11, 1},
- {11, UPB_SIZE(12, 24), 3, 3, 11, 1},
- {12, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 3, 11, 1},
- {13, UPB_SIZE(16, 32), 4, 0, 11, 1},
+ UPB_SIZE(32, 56), 8, _UPB_MSGEXT_NONE, 8, 255,
+};
+
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[9] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit},
+};
+
+static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[13] = {
+ {1, UPB_SIZE(4, 8), 1, 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 0, 7, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(36, 72), UPB_SIZE(-41, -81), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(32, 64), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(36, 72), UPB_SIZE(-41, -81), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(36, 72), UPB_SIZE(-41, -81), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(8, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(36, 72), UPB_SIZE(-41, -81), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(12, 24), 3, 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(36, 72), UPB_SIZE(-41, -81), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(16, 32), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(20, 40), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit = {
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext__fields[0],
- UPB_SIZE(40, 80), 12, false, 255,
+ UPB_SIZE(48, 88), 13, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[1] = {
+ {.submsg = &envoy_config_core_v3_TypedExtensionConfig_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit = {
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit = {
NULL,
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = {
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
+static const upb_msglayout_sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = {
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit},
+ {.submsg = &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit},
};
static const upb_msglayout_field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[4] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 3, 11, 1},
- {3, UPB_SIZE(12, 24), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 32), 4, 2, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 32), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit = {
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[0],
&envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[6] = {
+ &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
+ &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit,
+};
+
+const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 6,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
index 8a8ba90b7b2..c0df20b43b1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_TRANSPORT_SOCKETS_TLS_V3_TLS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,6 +39,7 @@ extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsCo
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit;
struct envoy_config_core_v3_TypedExtensionConfig;
+struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance;
struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext;
struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig;
struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate;
@@ -48,6 +49,7 @@ struct google_protobuf_BoolValue;
struct google_protobuf_Duration;
struct google_protobuf_UInt32Value;
extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
+extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
@@ -72,13 +74,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_e
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, arena, len);
@@ -132,13 +140,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, arena, len);
@@ -259,13 +273,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_ext
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, arena, len);
@@ -279,31 +299,33 @@ typedef enum {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context_certificate_provider_instance = 12,
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_NOT_SET = 0
} envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases;
-UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
+UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_case(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* msg) { return (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(40, 80), int32_t); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_params(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_extensions_transport_sockets_tls_v3_TlsParameters*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_accessor(msg, UPB_SIZE(20, 40), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 3; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 3, NULL); }
-UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 56)); }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 7; }
-UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 7, NULL); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 8; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 8, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificates(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 3; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(36, 72), UPB_SIZE(40, 80), 3, NULL); }
+UPB_INLINE upb_strview const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_alpn_protocols(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(28, 56), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(32, 64)); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_sds_secret_configs(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) { return (const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* const*)_upb_array_accessor(msg, UPB_SIZE(32, 64), len); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 7; }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(36, 72), UPB_SIZE(40, 80), 7, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 8; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(36, 72), UPB_SIZE(40, 80), 8, NULL); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 10; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 10, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 10; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(36, 72), UPB_SIZE(40, 80), 10, NULL); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*); }
-UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 12; }
-UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(32, 64), UPB_SIZE(36, 72), 12, NULL); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_getoneofcase(msg, UPB_SIZE(40, 80)) == 12; }
+UPB_INLINE const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return UPB_READ_ONEOF(msg, const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(36, 72), UPB_SIZE(40, 80), 12, NULL); }
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_custom_handshaker(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), const struct envoy_config_core_v3_TypedExtensionConfig*); }
+UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*); }
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_params(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* value) {
_upb_sethas(msg, 1);
@@ -319,20 +341,20 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy
return sub;
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(20, 40), len);
+ return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_resize_accessor2(msg, UPB_SIZE(20, 40), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificates(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate* sub = (struct envoy_extensions_transport_sockets_tls_v3_TlsCertificate*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(20, 40), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 3);
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*, UPB_SIZE(36, 72), value, UPB_SIZE(40, 80), 3);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(msg);
@@ -344,30 +366,30 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateValidatio
return sub;
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
}
UPB_INLINE upb_strview* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_alpn_protocols(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 56), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t *len) {
- return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 56), len);
+ return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 64), len);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig** envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_resize_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, size_t len, upb_arena *arena) {
- return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 56), len, UPB_SIZE(2, 3), arena);
+ return (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 64), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_add_tls_certificate_sds_secret_configs(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, arena);
bool ok = _upb_array_append_accessor2(
- msg, UPB_SIZE(28, 56), UPB_SIZE(2, 3), &sub, arena);
+ msg, UPB_SIZE(32, 64), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* value) {
- UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 7);
+ UPB_WRITE_ONEOF(msg, struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*, UPB_SIZE(36, 72), value, UPB_SIZE(40, 80), 7);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_sds_secret_config(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* sub = (struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_sds_secret_config(msg);
@@ -379,7 +401,7 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* env
return sub;
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 8);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*, UPB_SIZE(36, 72), value, UPB_SIZE(40, 80), 8);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_combined_validation_context(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(msg);
@@ -404,7 +426,7 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Cer
return sub;
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 10);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*, UPB_SIZE(36, 72), value, UPB_SIZE(40, 80), 10);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider(msg);
@@ -429,7 +451,7 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Cer
return sub;
}
UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* value) {
- UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(32, 64), value, UPB_SIZE(36, 72), 12);
+ UPB_WRITE_ONEOF(msg, envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*, UPB_SIZE(36, 72), value, UPB_SIZE(40, 80), 12);
}
UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_validation_context_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_certificate_provider_instance(msg);
@@ -453,6 +475,19 @@ UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_extensions_tr
}
return sub;
}
+UPB_INLINE void envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*) = value;
+}
+UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_mutable_tls_certificate_provider_instance(envoy_extensions_transport_sockets_tls_v3_CommonTlsContext *msg, upb_arena *arena) {
+ struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance* sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*)_upb_msg_new(&envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, arena);
+ if (!sub) return NULL;
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_set_tls_certificate_provider_instance(msg, sub);
+ }
+ return sub;
+}
/* envoy.extensions.transport_sockets.tls.v3.CommonTlsContext.CertificateProvider */
@@ -462,13 +497,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, arena, len);
@@ -508,13 +549,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, arena, len);
@@ -538,13 +585,19 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCe
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *ret = envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_serialize(const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, arena, len);
@@ -612,6 +665,8 @@ UPB_INLINE struct envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Cer
return sub;
}
+extern const upb_msglayout_file envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
index cc8dcc4f567..95ee068ef98 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/cluster/v3/cds.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "google/api/annotations.upb.h"
@@ -20,7 +20,18 @@
const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_cluster_v3_CdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_cluster_v3_cds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
index 86fa3022b25..b78b3c79f37 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/cluster/v3/cds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
#define ENVOY_SERVICE_CLUSTER_V3_CDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_
UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_cluster_v3_CdsDummy *ret = envoy_service_cluster_v3_CdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_cluster_v3_CdsDummy *envoy_service_cluster_v3_CdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_cluster_v3_CdsDummy *ret = envoy_service_cluster_v3_CdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_cluster_v3_CdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_cluster_v3_CdsDummy_serialize(const envoy_service_cluster_v3_CdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_cluster_v3_CdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_cluster_v3_CdsDummy_serialize(const envoy_service
+extern const upb_msglayout_file envoy_service_cluster_v3_cds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
index 7fb8ac990da..bbdde9f6414 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/discovery/v3/ads.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -18,7 +18,18 @@
const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_discovery_v3_AdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_discovery_v3_ads_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
index 0d26bd97dc5..8b114bb3873 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
#define ENVOY_SERVICE_DISCOVERY_V3_ADS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDu
UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_AdsDummy *ret = envoy_service_discovery_v3_AdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_AdsDummy *envoy_service_discovery_v3_AdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_AdsDummy *ret = envoy_service_discovery_v3_AdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_AdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_AdsDummy_serialize(const envoy_service_discovery_v3_AdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_discovery_v3_AdsDummy_serialize(const envoy_servi
+extern const upb_msglayout_file envoy_service_discovery_v3_ads_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
index a5b6ac46aa3..6f9268c3f30 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "google/protobuf/any.upb.h"
@@ -18,128 +18,145 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &google_rpc_Status_msginit,
+static const upb_msglayout_sub envoy_service_discovery_v3_DiscoveryRequest_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &google_rpc_Status_msginit},
};
static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryRequest__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), 1, 0, 11, 1},
- {3, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(32, 64), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(36, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(32, 64), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit = {
&envoy_service_discovery_v3_DiscoveryRequest_submsgs[0],
&envoy_service_discovery_v3_DiscoveryRequest__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 80), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = {
- &envoy_config_core_v3_ControlPlane_msginit,
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ControlPlane_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field envoy_service_discovery_v3_DiscoveryResponse__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(32, 64), 0, 1, 11, 3},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(28, 56), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 64), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit = {
&envoy_service_discovery_v3_DiscoveryResponse_submsgs[0],
&envoy_service_discovery_v3_DiscoveryResponse__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 80), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[3] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
- &google_rpc_Status_msginit,
+static const upb_msglayout_sub envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit},
+ {.submsg = &google_rpc_Status_msginit},
};
static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[7] = {
- {1, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {5, UPB_SIZE(36, 72), 0, 1, 11, _UPB_LABEL_MAP},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {7, UPB_SIZE(24, 48), 2, 2, 11, 1},
+ {1, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 64), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(36, 72), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 48), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit = {
&envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[0],
&envoy_service_discovery_v3_DeltaDiscoveryRequest__fields[0],
- UPB_SIZE(40, 80), 7, false, 255,
+ UPB_SIZE(40, 80), 7, _UPB_MSGEXT_NONE, 7, 255,
};
static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit = {
NULL,
&envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
- &envoy_config_core_v3_ControlPlane_msginit,
- &envoy_service_discovery_v3_Resource_msginit,
+static const upb_msglayout_sub envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_ControlPlane_msginit},
+ {.submsg = &envoy_service_discovery_v3_Resource_msginit},
};
static const upb_msglayout_field envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(32, 64), 0, 1, 11, 3},
- {4, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {5, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {6, UPB_SIZE(36, 72), 0, 0, 9, 3},
- {7, UPB_SIZE(28, 56), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 64), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(36, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit = {
&envoy_service_discovery_v3_DeltaDiscoveryResponse_submsgs[0],
&envoy_service_discovery_v3_DeltaDiscoveryResponse__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 80), 6, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_service_discovery_v3_Resource_submsgs[3] = {
- &envoy_service_discovery_v3_Resource_CacheControl_msginit,
- &google_protobuf_Any_msginit,
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_service_discovery_v3_Resource_submsgs[3] = {
+ {.submsg = &envoy_service_discovery_v3_Resource_CacheControl_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_service_discovery_v3_Resource__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 1, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(32, 64), 0, 0, 9, 3},
- {6, UPB_SIZE(24, 48), 2, 2, 11, 1},
- {7, UPB_SIZE(28, 56), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 40), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 64), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 48), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 56), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_Resource_msginit = {
&envoy_service_discovery_v3_Resource_submsgs[0],
&envoy_service_discovery_v3_Resource__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 80), 6, _UPB_MSGEXT_NONE, 4, 255,
};
static const upb_msglayout_field envoy_service_discovery_v3_Resource_CacheControl__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_discovery_v3_Resource_CacheControl_msginit = {
NULL,
&envoy_service_discovery_v3_Resource_CacheControl__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[7] = {
+ &envoy_service_discovery_v3_DiscoveryRequest_msginit,
+ &envoy_service_discovery_v3_DiscoveryResponse_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
+ &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit,
+ &envoy_service_discovery_v3_Resource_msginit,
+ &envoy_service_discovery_v3_Resource_CacheControl_msginit,
+};
+
+const upb_msglayout_file envoy_service_discovery_v3_discovery_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 7,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
index def27876393..6e679ad860f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
#define ENVOY_SERVICE_DISCOVERY_V3_DISCOVERY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -61,13 +61,19 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_
UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_DiscoveryRequest *ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest *envoy_service_discovery_v3_DiscoveryRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_DiscoveryRequest *ret = envoy_service_discovery_v3_DiscoveryRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_DiscoveryRequest_serialize(const envoy_service_discovery_v3_DiscoveryRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, arena, len);
@@ -136,13 +142,19 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery
UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_DiscoveryResponse *ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse *envoy_service_discovery_v3_DiscoveryResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_DiscoveryResponse *ret = envoy_service_discovery_v3_DiscoveryResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_DiscoveryResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_DiscoveryResponse_serialize(const envoy_service_discovery_v3_DiscoveryResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, arena, len);
@@ -204,13 +216,19 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_disco
UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_DeltaDiscoveryRequest *ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest *envoy_service_discovery_v3_DeltaDiscoveryRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_DeltaDiscoveryRequest *ret = envoy_service_discovery_v3_DeltaDiscoveryRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryRequest_serialize(const envoy_service_discovery_v3_DeltaDiscoveryRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, arena, len);
@@ -311,13 +329,19 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_disc
UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_DeltaDiscoveryResponse *ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse *envoy_service_discovery_v3_DeltaDiscoveryResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_DeltaDiscoveryResponse *ret = envoy_service_discovery_v3_DeltaDiscoveryResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_DeltaDiscoveryResponse_serialize(const envoy_service_discovery_v3_DeltaDiscoveryResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, arena, len);
@@ -386,13 +410,19 @@ UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resou
UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_Resource *ret = envoy_service_discovery_v3_Resource_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_Resource *envoy_service_discovery_v3_Resource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_Resource *ret = envoy_service_discovery_v3_Resource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_Resource_serialize(const envoy_service_discovery_v3_Resource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_Resource_msginit, arena, len);
@@ -472,13 +502,19 @@ UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_disco
UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_discovery_v3_Resource_CacheControl_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_discovery_v3_Resource_CacheControl *ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl *envoy_service_discovery_v3_Resource_CacheControl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_discovery_v3_Resource_CacheControl *ret = envoy_service_discovery_v3_Resource_CacheControl_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_discovery_v3_Resource_CacheControl_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_discovery_v3_Resource_CacheControl_serialize(const envoy_service_discovery_v3_Resource_CacheControl *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, arena, len);
@@ -490,6 +526,8 @@ UPB_INLINE void envoy_service_discovery_v3_Resource_CacheControl_set_do_not_cach
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
}
+extern const upb_msglayout_file envoy_service_discovery_v3_discovery_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
index 0af0480487f..299d2244299 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/endpoint/v3/eds.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "google/api/annotations.upb.h"
@@ -20,7 +20,18 @@
const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_endpoint_v3_EdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_endpoint_v3_eds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
index 1b1fd3d0a17..e9a7f86aa33 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/endpoint/v3/eds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
#define ENVOY_SERVICE_ENDPOINT_V3_EDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDumm
UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_endpoint_v3_EdsDummy *ret = envoy_service_endpoint_v3_EdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_endpoint_v3_EdsDummy *envoy_service_endpoint_v3_EdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_endpoint_v3_EdsDummy *ret = envoy_service_endpoint_v3_EdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_endpoint_v3_EdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_endpoint_v3_EdsDummy_serialize(const envoy_service_endpoint_v3_EdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_endpoint_v3_EdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_endpoint_v3_EdsDummy_serialize(const envoy_servic
+extern const upb_msglayout_file envoy_service_endpoint_v3_eds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
index 404bfa414ff..3bbe77f73c4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/listener/v3/lds.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "google/api/annotations.upb.h"
@@ -20,7 +20,18 @@
const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_listener_v3_LdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_listener_v3_lds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
index 9b8988c1adf..b82f317d253 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/listener/v3/lds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
#define ENVOY_SERVICE_LISTENER_V3_LDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDumm
UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_listener_v3_LdsDummy *ret = envoy_service_listener_v3_LdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_listener_v3_LdsDummy *envoy_service_listener_v3_LdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_listener_v3_LdsDummy *ret = envoy_service_listener_v3_LdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_listener_v3_LdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_listener_v3_LdsDummy_serialize(const envoy_service_listener_v3_LdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_listener_v3_LdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_listener_v3_LdsDummy_serialize(const envoy_servic
+extern const upb_msglayout_file envoy_service_listener_v3_lds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
index 68fe078f090..c12464cd3dc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/load_stats/v3/lrs.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/config/endpoint/v3/load_report.upb.h"
@@ -17,37 +17,49 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_endpoint_v3_ClusterStats_msginit,
+static const upb_msglayout_sub envoy_service_load_stats_v3_LoadStatsRequest_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_config_endpoint_v3_ClusterStats_msginit},
};
static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsRequest__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit = {
&envoy_service_load_stats_v3_LoadStatsRequest_submsgs[0],
&envoy_service_load_stats_v3_LoadStatsRequest__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field envoy_service_load_stats_v3_LoadStatsResponse__fields[4] = {
- {1, UPB_SIZE(8, 16), 0, 0, 9, 3},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {4, UPB_SIZE(2, 2), 0, 0, 8, 1},
+ {1, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(2, 2), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit = {
&envoy_service_load_stats_v3_LoadStatsResponse_submsgs[0],
&envoy_service_load_stats_v3_LoadStatsResponse__fields[0],
- UPB_SIZE(16, 24), 4, false, 255,
+ UPB_SIZE(16, 24), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_service_load_stats_v3_LoadStatsRequest_msginit,
+ &envoy_service_load_stats_v3_LoadStatsResponse_msginit,
+};
+
+const upb_msglayout_file envoy_service_load_stats_v3_lrs_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
index f74a023120a..7a4271ce9e8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
#define ENVOY_SERVICE_LOAD_STATS_V3_LRS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -42,13 +42,19 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stat
UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_load_stats_v3_LoadStatsRequest *ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest *envoy_service_load_stats_v3_LoadStatsRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_load_stats_v3_LoadStatsRequest *ret = envoy_service_load_stats_v3_LoadStatsRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsRequest_serialize(const envoy_service_load_stats_v3_LoadStatsRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, arena, len);
@@ -94,13 +100,19 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_sta
UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_load_stats_v3_LoadStatsResponse *ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse *envoy_service_load_stats_v3_LoadStatsResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_load_stats_v3_LoadStatsResponse *ret = envoy_service_load_stats_v3_LoadStatsResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_load_stats_v3_LoadStatsResponse_serialize(const envoy_service_load_stats_v3_LoadStatsResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, arena, len);
@@ -142,6 +154,8 @@ UPB_INLINE void envoy_service_load_stats_v3_LoadStatsResponse_set_send_all_clust
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
+extern const upb_msglayout_file envoy_service_load_stats_v3_lrs_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
index 07d17f61278..e75381cf660 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/route/v3/rds.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "google/api/annotations.upb.h"
@@ -20,7 +20,18 @@
const upb_msglayout envoy_service_route_v3_RdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_route_v3_RdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_route_v3_rds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
index 40a6d42563f..e97fea50e7a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
#define ENVOY_SERVICE_ROUTE_V3_RDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_new(
UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_route_v3_RdsDummy *ret = envoy_service_route_v3_RdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_route_v3_RdsDummy *envoy_service_route_v3_RdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_route_v3_RdsDummy *ret = envoy_service_route_v3_RdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_route_v3_RdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_route_v3_RdsDummy_serialize(const envoy_service_route_v3_RdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_route_v3_RdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_route_v3_RdsDummy_serialize(const envoy_service_r
+extern const upb_msglayout_file envoy_service_route_v3_rds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
index 6dbaa817c95..1b82ba4e731 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/route/v3/srds.upb.h"
#include "envoy/service/discovery/v3/discovery.upb.h"
#include "google/api/annotations.upb.h"
@@ -20,7 +20,18 @@
const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_service_route_v3_SrdsDummy_msginit,
+};
+
+const upb_msglayout_file envoy_service_route_v3_srds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
index e86154b742e..c7f10c3358d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
#define ENVOY_SERVICE_ROUTE_V3_SRDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_ne
UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_route_v3_SrdsDummy *ret = envoy_service_route_v3_SrdsDummy_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_route_v3_SrdsDummy *envoy_service_route_v3_SrdsDummy_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_route_v3_SrdsDummy *ret = envoy_service_route_v3_SrdsDummy_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_route_v3_SrdsDummy_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_route_v3_SrdsDummy_serialize(const envoy_service_route_v3_SrdsDummy *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_route_v3_SrdsDummy_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *envoy_service_route_v3_SrdsDummy_serialize(const envoy_service_
+extern const upb_msglayout_file envoy_service_route_v3_srds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
index 40e086cba51..8271c8a0039 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c
@@ -7,86 +7,129 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/service/status/v3/csds.upb.h"
#include "envoy/admin/v3/config_dump.upb.h"
#include "envoy/config/core/v3/base.upb.h"
#include "envoy/type/matcher/v3/node.upb.h"
#include "google/api/annotations.upb.h"
-#include "udpa/annotations/migrate.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/timestamp.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_service_status_v3_ClientStatusRequest_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_type_matcher_v3_NodeMatcher_msginit,
+static const upb_msglayout_sub envoy_service_status_v3_ClientStatusRequest_submsgs[2] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_type_matcher_v3_NodeMatcher_msginit},
};
static const upb_msglayout_field envoy_service_status_v3_ClientStatusRequest__fields[2] = {
- {1, UPB_SIZE(8, 16), 0, 1, 11, 3},
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit = {
&envoy_service_status_v3_ClientStatusRequest_submsgs[0],
&envoy_service_status_v3_ClientStatusRequest__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_service_status_v3_PerXdsConfig_submsgs[5] = {
- &envoy_admin_v3_ClustersConfigDump_msginit,
- &envoy_admin_v3_EndpointsConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_msginit,
- &envoy_admin_v3_RoutesConfigDump_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
+static const upb_msglayout_sub envoy_service_status_v3_PerXdsConfig_submsgs[5] = {
+ {.submsg = &envoy_admin_v3_ClustersConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_EndpointsConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_ListenersConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_RoutesConfigDump_msginit},
+ {.submsg = &envoy_admin_v3_ScopedRoutesConfigDump_msginit},
};
static const upb_msglayout_field envoy_service_status_v3_PerXdsConfig__fields[7] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, 1},
- {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, 1},
- {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, 1},
- {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, 1},
- {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, 1},
- {7, UPB_SIZE(4, 4), 0, 0, 14, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit = {
&envoy_service_status_v3_PerXdsConfig_submsgs[0],
&envoy_service_status_v3_PerXdsConfig__fields[0],
- UPB_SIZE(16, 24), 7, false, 255,
+ UPB_SIZE(16, 24), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const envoy_service_status_v3_ClientConfig_submsgs[2] = {
- &envoy_config_core_v3_Node_msginit,
- &envoy_service_status_v3_PerXdsConfig_msginit,
+static const upb_msglayout_sub envoy_service_status_v3_ClientConfig_submsgs[3] = {
+ {.submsg = &envoy_config_core_v3_Node_msginit},
+ {.submsg = &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit},
+ {.submsg = &envoy_service_status_v3_PerXdsConfig_msginit},
};
-static const upb_msglayout_field envoy_service_status_v3_ClientConfig__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+static const upb_msglayout_field envoy_service_status_v3_ClientConfig__fields[3] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_status_v3_ClientConfig_msginit = {
&envoy_service_status_v3_ClientConfig_submsgs[0],
&envoy_service_status_v3_ClientConfig__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_service_status_v3_ClientStatusResponse_submsgs[1] = {
- &envoy_service_status_v3_ClientConfig_msginit,
+static const upb_msglayout_sub envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[3] = {
+ {.submsg = &envoy_admin_v3_UpdateFailureState_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
+};
+
+static const upb_msglayout_field envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[9] = {
+ {1, UPB_SIZE(16, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(32, 48), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(40, 64), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(44, 72), 2, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(8, 8), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 80), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(12, 12), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit = {
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[0],
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig__fields[0],
+ UPB_SIZE(56, 96), 9, _UPB_MSGEXT_NONE, 9, 255,
+};
+
+static const upb_msglayout_sub envoy_service_status_v3_ClientStatusResponse_submsgs[1] = {
+ {.submsg = &envoy_service_status_v3_ClientConfig_msginit},
};
static const upb_msglayout_field envoy_service_status_v3_ClientStatusResponse__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit = {
&envoy_service_status_v3_ClientStatusResponse_submsgs[0],
&envoy_service_status_v3_ClientStatusResponse__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &envoy_service_status_v3_ClientStatusRequest_msginit,
+ &envoy_service_status_v3_PerXdsConfig_msginit,
+ &envoy_service_status_v3_ClientConfig_msginit,
+ &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit,
+ &envoy_service_status_v3_ClientStatusResponse_msginit,
+};
+
+const upb_msglayout_file envoy_service_status_v3_csds_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
index 87f807cdf1a..5be2688b2ab 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_
#define ENVOY_SERVICE_STATUS_V3_CSDS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,29 +23,38 @@ extern "C" {
struct envoy_service_status_v3_ClientStatusRequest;
struct envoy_service_status_v3_PerXdsConfig;
struct envoy_service_status_v3_ClientConfig;
+struct envoy_service_status_v3_ClientConfig_GenericXdsConfig;
struct envoy_service_status_v3_ClientStatusResponse;
typedef struct envoy_service_status_v3_ClientStatusRequest envoy_service_status_v3_ClientStatusRequest;
typedef struct envoy_service_status_v3_PerXdsConfig envoy_service_status_v3_PerXdsConfig;
typedef struct envoy_service_status_v3_ClientConfig envoy_service_status_v3_ClientConfig;
+typedef struct envoy_service_status_v3_ClientConfig_GenericXdsConfig envoy_service_status_v3_ClientConfig_GenericXdsConfig;
typedef struct envoy_service_status_v3_ClientStatusResponse envoy_service_status_v3_ClientStatusResponse;
extern const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit;
extern const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit;
extern const upb_msglayout envoy_service_status_v3_ClientConfig_msginit;
+extern const upb_msglayout envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit;
extern const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit;
struct envoy_admin_v3_ClustersConfigDump;
struct envoy_admin_v3_EndpointsConfigDump;
struct envoy_admin_v3_ListenersConfigDump;
struct envoy_admin_v3_RoutesConfigDump;
struct envoy_admin_v3_ScopedRoutesConfigDump;
+struct envoy_admin_v3_UpdateFailureState;
struct envoy_config_core_v3_Node;
struct envoy_type_matcher_v3_NodeMatcher;
+struct google_protobuf_Any;
+struct google_protobuf_Timestamp;
extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit;
extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit;
extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit;
extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit;
extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit;
+extern const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit;
extern const upb_msglayout envoy_config_core_v3_Node_msginit;
extern const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit;
+extern const upb_msglayout google_protobuf_Any_msginit;
+extern const upb_msglayout google_protobuf_Timestamp_msginit;
typedef enum {
envoy_service_status_v3_CLIENT_UNKNOWN = 0,
@@ -71,13 +80,19 @@ UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_
UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_ClientStatusRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_status_v3_ClientStatusRequest *ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_status_v3_ClientStatusRequest *envoy_service_status_v3_ClientStatusRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_status_v3_ClientStatusRequest *ret = envoy_service_status_v3_ClientStatusRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_status_v3_ClientStatusRequest_serialize(const envoy_service_status_v3_ClientStatusRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, arena, len);
@@ -123,13 +138,19 @@ UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsC
UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_status_v3_PerXdsConfig *ret = envoy_service_status_v3_PerXdsConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_status_v3_PerXdsConfig *envoy_service_status_v3_PerXdsConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_status_v3_PerXdsConfig *ret = envoy_service_status_v3_PerXdsConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_status_v3_PerXdsConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_status_v3_PerXdsConfig_serialize(const envoy_service_status_v3_PerXdsConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, arena, len);
@@ -233,13 +254,19 @@ UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientC
UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientConfig_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_status_v3_ClientConfig *ret = envoy_service_status_v3_ClientConfig_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_status_v3_ClientConfig *envoy_service_status_v3_ClientConfig_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_status_v3_ClientConfig *ret = envoy_service_status_v3_ClientConfig_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_status_v3_ClientConfig_serialize(const envoy_service_status_v3_ClientConfig *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_status_v3_ClientConfig_msginit, arena, len);
@@ -249,6 +276,8 @@ UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_node(const envoy_servic
UPB_INLINE const struct envoy_config_core_v3_Node* envoy_service_status_v3_ClientConfig_node(const envoy_service_status_v3_ClientConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_config_core_v3_Node*); }
UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_xds_config(const envoy_service_status_v3_ClientConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
UPB_INLINE const envoy_service_status_v3_PerXdsConfig* const* envoy_service_status_v3_ClientConfig_xds_config(const envoy_service_status_v3_ClientConfig *msg, size_t *len) { return (const envoy_service_status_v3_PerXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_generic_xds_configs(const envoy_service_status_v3_ClientConfig *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
+UPB_INLINE const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const* envoy_service_status_v3_ClientConfig_generic_xds_configs(const envoy_service_status_v3_ClientConfig *msg, size_t *len) { return (const envoy_service_status_v3_ClientConfig_GenericXdsConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
UPB_INLINE void envoy_service_status_v3_ClientConfig_set_node(envoy_service_status_v3_ClientConfig *msg, struct envoy_config_core_v3_Node* value) {
_upb_sethas(msg, 1);
@@ -276,6 +305,116 @@ UPB_INLINE struct envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_
if (!ok) return NULL;
return sub;
}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_mutable_generic_xds_configs(envoy_service_status_v3_ClientConfig *msg, size_t *len) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig** envoy_service_status_v3_ClientConfig_resize_generic_xds_configs(envoy_service_status_v3_ClientConfig *msg, size_t len, upb_arena *arena) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_status_v3_ClientConfig_add_generic_xds_configs(envoy_service_status_v3_ClientConfig *msg, upb_arena *arena) {
+ struct envoy_service_status_v3_ClientConfig_GenericXdsConfig* sub = (struct envoy_service_status_v3_ClientConfig_GenericXdsConfig*)_upb_msg_new(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.service.status.v3.ClientConfig.GenericXdsConfig */
+
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig *envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(upb_arena *arena) {
+ return (envoy_service_status_v3_ClientConfig_GenericXdsConfig *)_upb_msg_new(&envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena);
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig *envoy_service_status_v3_ClientConfig_GenericXdsConfig_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig *ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig *envoy_service_status_v3_ClientConfig_GenericXdsConfig_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig *ret = envoy_service_status_v3_ClientConfig_GenericXdsConfig_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_service_status_v3_ClientConfig_GenericXdsConfig_serialize(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview envoy_service_status_v3_ClientConfig_GenericXdsConfig_type_url(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview); }
+UPB_INLINE upb_strview envoy_service_status_v3_ClientConfig_GenericXdsConfig_name(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_strview); }
+UPB_INLINE upb_strview envoy_service_status_v3_ClientConfig_GenericXdsConfig_version_info(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_strview); }
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 64), const struct google_protobuf_Any*); }
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 72), const struct google_protobuf_Timestamp*); }
+UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_config_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t); }
+UPB_INLINE int32_t envoy_service_status_v3_ClientConfig_GenericXdsConfig_client_status(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_has_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return _upb_hasbit(msg, 3); }
+UPB_INLINE const struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 80), const struct envoy_admin_v3_UpdateFailureState*); }
+UPB_INLINE bool envoy_service_status_v3_ClientConfig_GenericXdsConfig_is_static_resource(const envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool); }
+
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_type_url(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_name(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 32), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_version_info(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 48), upb_strview) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Any* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(40, 64), struct google_protobuf_Any*) = value;
+}
+UPB_INLINE struct google_protobuf_Any* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_xds_config(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_xds_config(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_xds_config(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct google_protobuf_Timestamp* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 72), struct google_protobuf_Timestamp*) = value;
+}
+UPB_INLINE struct google_protobuf_Timestamp* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_last_updated(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_arena *arena) {
+ struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_last_updated(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_config_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_client_status(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, struct envoy_admin_v3_UpdateFailureState* value) {
+ _upb_sethas(msg, 3);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 80), struct envoy_admin_v3_UpdateFailureState*) = value;
+}
+UPB_INLINE struct envoy_admin_v3_UpdateFailureState* envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_error_state(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, upb_arena *arena) {
+ struct envoy_admin_v3_UpdateFailureState* sub = (struct envoy_admin_v3_UpdateFailureState*)envoy_service_status_v3_ClientConfig_GenericXdsConfig_error_state(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_admin_v3_UpdateFailureState*)_upb_msg_new(&envoy_admin_v3_UpdateFailureState_msginit, arena);
+ if (!sub) return NULL;
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_is_static_resource(envoy_service_status_v3_ClientConfig_GenericXdsConfig *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 12), bool) = value;
+}
/* envoy.service.status.v3.ClientStatusResponse */
@@ -285,13 +424,19 @@ UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3
UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3_ClientStatusResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_service_status_v3_ClientStatusResponse *ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_service_status_v3_ClientStatusResponse *envoy_service_status_v3_ClientStatusResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_service_status_v3_ClientStatusResponse *ret = envoy_service_status_v3_ClientStatusResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_service_status_v3_ClientStatusResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_service_status_v3_ClientStatusResponse_serialize(const envoy_service_status_v3_ClientStatusResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, arena, len);
@@ -314,6 +459,8 @@ UPB_INLINE struct envoy_service_status_v3_ClientConfig* envoy_service_status_v3_
return sub;
}
+extern const upb_msglayout_file envoy_service_status_v3_csds_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
new file mode 100644
index 00000000000..7ac11b6eb6b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c
@@ -0,0 +1,74 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "envoy/type/http/v3/path_transformation.upb.h"
+#include "udpa/annotations/status.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub envoy_type_http_v3_PathTransformation_submsgs[1] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_msginit},
+};
+
+static const upb_msglayout_field envoy_type_http_v3_PathTransformation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_type_http_v3_PathTransformation_msginit = {
+ &envoy_type_http_v3_PathTransformation_submsgs[0],
+ &envoy_type_http_v3_PathTransformation__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub envoy_type_http_v3_PathTransformation_Operation_submsgs[2] = {
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit},
+ {.submsg = &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit},
+};
+
+static const upb_msglayout_field envoy_type_http_v3_PathTransformation_Operation__fields[2] = {
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_msginit = {
+ &envoy_type_http_v3_PathTransformation_Operation_submsgs[0],
+ &envoy_type_http_v3_PathTransformation_Operation__fields[0],
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[4] = {
+ &envoy_type_http_v3_PathTransformation_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit,
+ &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit,
+};
+
+const upb_msglayout_file envoy_type_http_v3_path_transformation_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 4,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h
new file mode 100644
index 00000000000..ce5120f29dd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h
@@ -0,0 +1,207 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_
+#define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct envoy_type_http_v3_PathTransformation;
+struct envoy_type_http_v3_PathTransformation_Operation;
+struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986;
+struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes;
+typedef struct envoy_type_http_v3_PathTransformation envoy_type_http_v3_PathTransformation;
+typedef struct envoy_type_http_v3_PathTransformation_Operation envoy_type_http_v3_PathTransformation_Operation;
+typedef struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986;
+typedef struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes envoy_type_http_v3_PathTransformation_Operation_MergeSlashes;
+extern const upb_msglayout envoy_type_http_v3_PathTransformation_msginit;
+extern const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_msginit;
+extern const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit;
+extern const upb_msglayout envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit;
+
+
+/* envoy.type.http.v3.PathTransformation */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation *envoy_type_http_v3_PathTransformation_new(upb_arena *arena) {
+ return (envoy_type_http_v3_PathTransformation *)_upb_msg_new(&envoy_type_http_v3_PathTransformation_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation *envoy_type_http_v3_PathTransformation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation *ret = envoy_type_http_v3_PathTransformation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation *envoy_type_http_v3_PathTransformation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation *ret = envoy_type_http_v3_PathTransformation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_type_http_v3_PathTransformation_serialize(const envoy_type_http_v3_PathTransformation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_http_v3_PathTransformation_msginit, arena, len);
+}
+
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_has_operations(const envoy_type_http_v3_PathTransformation *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation* const* envoy_type_http_v3_PathTransformation_operations(const envoy_type_http_v3_PathTransformation *msg, size_t *len) { return (const envoy_type_http_v3_PathTransformation_Operation* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_mutable_operations(envoy_type_http_v3_PathTransformation *msg, size_t *len) {
+ return (envoy_type_http_v3_PathTransformation_Operation**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation** envoy_type_http_v3_PathTransformation_resize_operations(envoy_type_http_v3_PathTransformation *msg, size_t len, upb_arena *arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_PathTransformation_add_operations(envoy_type_http_v3_PathTransformation *msg, upb_arena *arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation* sub = (struct envoy_type_http_v3_PathTransformation_Operation*)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* envoy.type.http.v3.PathTransformation.Operation */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation *envoy_type_http_v3_PathTransformation_Operation_new(upb_arena *arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation *)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation *envoy_type_http_v3_PathTransformation_Operation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation *ret = envoy_type_http_v3_PathTransformation_Operation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation *envoy_type_http_v3_PathTransformation_Operation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation *ret = envoy_type_http_v3_PathTransformation_Operation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_type_http_v3_PathTransformation_Operation_serialize(const envoy_type_http_v3_PathTransformation_Operation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, arena, len);
+}
+
+typedef enum {
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_normalize_path_rfc_3986 = 2,
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_merge_slashes = 3,
+ envoy_type_http_v3_PathTransformation_Operation_operation_specifier_NOT_SET = 0
+} envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases;
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases envoy_type_http_v3_PathTransformation_Operation_operation_specifier_case(const envoy_type_http_v3_PathTransformation_Operation* msg) { return (envoy_type_http_v3_PathTransformation_Operation_operation_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(const envoy_type_http_v3_PathTransformation_Operation *msg) { return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool envoy_type_http_v3_PathTransformation_Operation_has_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_merge_slashes(const envoy_type_http_v3_PathTransformation_Operation *msg) { return UPB_READ_ONEOF(msg, const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* envoy_type_http_v3_PathTransformation_Operation_mutable_normalize_path_rfc_3986(envoy_type_http_v3_PathTransformation_Operation *msg, upb_arena *arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)envoy_type_http_v3_PathTransformation_Operation_normalize_path_rfc_3986(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986*)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_http_v3_PathTransformation_Operation_set_normalize_path_rfc_3986(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(envoy_type_http_v3_PathTransformation_Operation *msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* value) {
+ UPB_WRITE_ONEOF(msg, envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_type_http_v3_PathTransformation_Operation_mutable_merge_slashes(envoy_type_http_v3_PathTransformation_Operation *msg, upb_arena *arena) {
+ struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)envoy_type_http_v3_PathTransformation_Operation_merge_slashes(msg);
+ if (sub == NULL) {
+ sub = (struct envoy_type_http_v3_PathTransformation_Operation_MergeSlashes*)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena);
+ if (!sub) return NULL;
+ envoy_type_http_v3_PathTransformation_Operation_set_merge_slashes(msg, sub);
+ }
+ return sub;
+}
+
+/* envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986 */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(upb_arena *arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *ret = envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_serialize(const envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986 *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, arena, len);
+}
+
+
+
+/* envoy.type.http.v3.PathTransformation.Operation.MergeSlashes */
+
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(upb_arena *arena) {
+ return (envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *)_upb_msg_new(&envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena);
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *ret = envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_serialize(const envoy_type_http_v3_PathTransformation_Operation_MergeSlashes *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, arena, len);
+}
+
+
+
+extern const upb_msglayout_file envoy_type_http_v3_path_transformation_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
index 7fdf5b9fea7..40046d4e36f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/metadata.upb.h"
#include "envoy/type/matcher/v3/value.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,31 +16,44 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
- &envoy_type_matcher_v3_ValueMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_MetadataMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit},
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit},
};
-static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 1, 1, 11, 1},
+static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher__fields[4] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit = {
&envoy_type_matcher_v3_MetadataMatcher_submsgs[0],
&envoy_type_matcher_v3_MetadataMatcher__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
static const upb_msglayout_field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = {
NULL,
&envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_type_matcher_v3_MetadataMatcher_msginit,
+ &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_metadata_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
index a7f17c14488..4913f5c536c 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_METADATA_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_Metadata
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_MetadataMatcher *ret = envoy_type_matcher_v3_MetadataMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher *envoy_type_matcher_v3_MetadataMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_MetadataMatcher *ret = envoy_type_matcher_v3_MetadataMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_serialize(const envoy_type_matcher_v3_MetadataMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, arena, len);
@@ -55,6 +61,7 @@ UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_path(const envoy_type_
UPB_INLINE const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const* envoy_type_matcher_v3_MetadataMatcher_path(const envoy_type_matcher_v3_MetadataMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_MetadataMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(16, 32), len); }
UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_has_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_MetadataMatcher_value(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct envoy_type_matcher_v3_ValueMatcher*); }
+UPB_INLINE bool envoy_type_matcher_v3_MetadataMatcher_invert(const envoy_type_matcher_v3_MetadataMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_filter(envoy_type_matcher_v3_MetadataMatcher *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
@@ -85,6 +92,9 @@ UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_Meta
}
return sub;
}
+UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_set_invert(envoy_type_matcher_v3_MetadataMatcher *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
+}
/* envoy.type.matcher.v3.MetadataMatcher.PathSegment */
@@ -94,13 +104,19 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_MetadataMatcher_PathSegment *ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment *envoy_type_matcher_v3_MetadataMatcher_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_MetadataMatcher_PathSegment *ret = envoy_type_matcher_v3_MetadataMatcher_PathSegment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_MetadataMatcher_PathSegment_serialize(const envoy_type_matcher_v3_MetadataMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, arena, len);
@@ -119,6 +135,8 @@ UPB_INLINE void envoy_type_matcher_v3_MetadataMatcher_PathSegment_set_key(envoy_
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
}
+extern const upb_msglayout_file envoy_type_matcher_v3_metadata_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
index 8ef51fb91ec..54d1aaf4f11 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/node.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "envoy/type/matcher/v3/struct.upb.h"
@@ -16,20 +16,31 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_NodeMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_StructMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_NodeMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StructMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_NodeMatcher__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 1, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit = {
&envoy_type_matcher_v3_NodeMatcher_submsgs[0],
&envoy_type_matcher_v3_NodeMatcher__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_type_matcher_v3_NodeMatcher_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_node_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
index 94e2257fdfc..a5d30832bf6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_NODE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,13 +37,19 @@ UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_
UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_NodeMatcher *ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_NodeMatcher *envoy_type_matcher_v3_NodeMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_NodeMatcher *ret = envoy_type_matcher_v3_NodeMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_NodeMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_NodeMatcher_serialize(const envoy_type_matcher_v3_NodeMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, arena, len);
@@ -81,6 +87,8 @@ UPB_INLINE struct envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_Nod
return sub;
}
+extern const upb_msglayout_file envoy_type_matcher_v3_node_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
index 516755b0bf7..282279abe5a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/number.upb.h"
#include "envoy/type/v3/range.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,19 +16,30 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = {
- &envoy_type_v3_DoubleRange_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_DoubleMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_v3_DoubleRange_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_DoubleMatcher__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 1, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -9), 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit = {
&envoy_type_matcher_v3_DoubleMatcher_submsgs[0],
&envoy_type_matcher_v3_DoubleMatcher__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_type_matcher_v3_DoubleMatcher_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_number_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
index ebca3037aa5..4196550ded5 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_NUMBER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatc
UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_DoubleMatcher *ret = envoy_type_matcher_v3_DoubleMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_DoubleMatcher *envoy_type_matcher_v3_DoubleMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_DoubleMatcher *ret = envoy_type_matcher_v3_DoubleMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_DoubleMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_DoubleMatcher_serialize(const envoy_type_matcher_v3_DoubleMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, arena, len);
@@ -75,6 +81,8 @@ UPB_INLINE void envoy_type_matcher_v3_DoubleMatcher_set_exact(envoy_type_matcher
UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 8), 2);
}
+extern const upb_msglayout_file envoy_type_matcher_v3_number_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
index caef3395638..0e7d029a432 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/path.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,18 +16,29 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_PathMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_PathMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_PathMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit = {
&envoy_type_matcher_v3_PathMatcher_submsgs[0],
&envoy_type_matcher_v3_PathMatcher__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_type_matcher_v3_PathMatcher_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_path_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
index defbcf02640..cb954cc4704 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_
UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, arena, len);
@@ -69,6 +75,8 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_Pat
return sub;
}
+extern const upb_msglayout_file envoy_type_matcher_v3_path_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
index 1e4232bca08..76b5930eda3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c
@@ -7,57 +7,71 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/regex.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "envoy/annotations/deprecation.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_RegexMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher__fields[2] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit = {
&envoy_type_matcher_v3_RegexMatcher_submsgs[0],
&envoy_type_matcher_v3_RegexMatcher__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
- &google_protobuf_UInt32Value_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = {
+ {.submsg = &google_protobuf_UInt32Value_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit = {
&envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[0],
&envoy_type_matcher_v3_RegexMatcher_GoogleRE2__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[2] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit = {
&envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[0],
&envoy_type_matcher_v3_RegexMatchAndSubstitute__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_type_matcher_v3_RegexMatcher_msginit,
+ &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
+ &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_regex_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
index 5e00d13f189..4951474344f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_REGEX_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -41,13 +41,19 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatche
UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_RegexMatcher *envoy_type_matcher_v3_RegexMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_RegexMatcher *ret = envoy_type_matcher_v3_RegexMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_serialize(const envoy_type_matcher_v3_RegexMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, arena, len);
@@ -87,13 +93,19 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_R
UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *ret = envoy_type_matcher_v3_RegexMatcher_GoogleRE2_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_RegexMatcher_GoogleRE2_serialize(const envoy_type_matcher_v3_RegexMatcher_GoogleRE2 *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, arena, len);
@@ -124,13 +136,19 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_
UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute *envoy_type_matcher_v3_RegexMatchAndSubstitute_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_RegexMatchAndSubstitute *ret = envoy_type_matcher_v3_RegexMatchAndSubstitute_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_RegexMatchAndSubstitute_serialize(const envoy_type_matcher_v3_RegexMatchAndSubstitute *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, arena, len);
@@ -157,6 +175,8 @@ UPB_INLINE void envoy_type_matcher_v3_RegexMatchAndSubstitute_set_substitution(e
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
+extern const upb_msglayout_file envoy_type_matcher_v3_regex_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
index e84e4f7c928..7e256dfe771 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/string.upb.h"
#include "envoy/type/matcher/v3/regex.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,37 +16,49 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_StringMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_StringMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_RegexMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_StringMatcher__fields[6] = {
- {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {3, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {5, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 11, 1},
- {6, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {7, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit = {
&envoy_type_matcher_v3_StringMatcher_submsgs[0],
&envoy_type_matcher_v3_StringMatcher__fields[0],
- UPB_SIZE(16, 32), 6, false, 255,
+ UPB_SIZE(16, 32), 6, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_ListStringMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_ListStringMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit = {
&envoy_type_matcher_v3_ListStringMatcher_submsgs[0],
&envoy_type_matcher_v3_ListStringMatcher__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_type_matcher_v3_StringMatcher_msginit,
+ &envoy_type_matcher_v3_ListStringMatcher_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_string_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
index 4bce450ca8b..77f65322343 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatc
UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_StringMatcher *ret = envoy_type_matcher_v3_StringMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_StringMatcher *envoy_type_matcher_v3_StringMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_StringMatcher *ret = envoy_type_matcher_v3_StringMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, arena, len);
@@ -108,13 +114,19 @@ UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListSt
UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_ListStringMatcher *ret = envoy_type_matcher_v3_ListStringMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_ListStringMatcher *envoy_type_matcher_v3_ListStringMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_ListStringMatcher *ret = envoy_type_matcher_v3_ListStringMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_ListStringMatcher_serialize(const envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, len);
@@ -137,6 +149,8 @@ UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_Lis
return sub;
}
+extern const upb_msglayout_file envoy_type_matcher_v3_string_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
index 05ea6a3ffcb..b2f866bc760 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/struct.upb.h"
#include "envoy/type/matcher/v3/value.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,30 +16,42 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_StructMatcher_submsgs[2] = {
- &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
- &envoy_type_matcher_v3_ValueMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_StructMatcher_submsgs[2] = {
+ {.submsg = &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit},
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_StructMatcher__fields[2] = {
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
- {3, UPB_SIZE(4, 8), 1, 1, 11, 1},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit = {
&envoy_type_matcher_v3_StructMatcher_submsgs[0],
&envoy_type_matcher_v3_StructMatcher__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit = {
NULL,
&envoy_type_matcher_v3_StructMatcher_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_type_matcher_v3_StructMatcher_msginit,
+ &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
index 53e521385de..d6535258cee 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatc
UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, arena, len);
@@ -90,13 +96,19 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, len);
@@ -115,6 +127,8 @@ UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_ty
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
}
+extern const upb_msglayout_file envoy_type_matcher_v3_struct_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
index 0195307d0cd..f70e99f1606 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/matcher/v3/value.upb.h"
#include "envoy/type/matcher/v3/number.upb.h"
#include "envoy/type/matcher/v3/string.upb.h"
@@ -17,46 +17,59 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_matcher_v3_ValueMatcher_submsgs[4] = {
- &envoy_type_matcher_v3_DoubleMatcher_msginit,
- &envoy_type_matcher_v3_ListMatcher_msginit,
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_ValueMatcher_submsgs[4] = {
+ {.submsg = &envoy_type_matcher_v3_DoubleMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_ListMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_StringMatcher_msginit},
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_ValueMatcher__fields[6] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit = {
&envoy_type_matcher_v3_ValueMatcher_submsgs[0],
&envoy_type_matcher_v3_ValueMatcher__fields[0],
- UPB_SIZE(8, 16), 6, false, 255,
+ UPB_SIZE(8, 16), 6, _UPB_MSGEXT_NONE, 6, 255,
};
const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
- &envoy_type_matcher_v3_ValueMatcher_msginit,
+static const upb_msglayout_sub envoy_type_matcher_v3_ListMatcher_submsgs[1] = {
+ {.submsg = &envoy_type_matcher_v3_ValueMatcher_msginit},
};
static const upb_msglayout_field envoy_type_matcher_v3_ListMatcher__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit = {
&envoy_type_matcher_v3_ListMatcher_submsgs[0],
&envoy_type_matcher_v3_ListMatcher__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_type_matcher_v3_ValueMatcher_msginit,
+ &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
+ &envoy_type_matcher_v3_ListMatcher_msginit,
+};
+
+const upb_msglayout_file envoy_type_matcher_v3_value_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
index dc44445f8f3..04ed6f76148 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
#define ENVOY_TYPE_MATCHER_V3_VALUE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -43,13 +43,19 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatche
UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_ValueMatcher *ret = envoy_type_matcher_v3_ValueMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_ValueMatcher *envoy_type_matcher_v3_ValueMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_ValueMatcher *ret = envoy_type_matcher_v3_ValueMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_serialize(const envoy_type_matcher_v3_ValueMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, arena, len);
@@ -142,13 +148,19 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_V
UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_ValueMatcher_NullMatch *ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch *envoy_type_matcher_v3_ValueMatcher_NullMatch_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_ValueMatcher_NullMatch *ret = envoy_type_matcher_v3_ValueMatcher_NullMatch_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_ValueMatcher_NullMatch_serialize(const envoy_type_matcher_v3_ValueMatcher_NullMatch *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, arena, len);
@@ -164,13 +176,19 @@ UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_
UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_matcher_v3_ListMatcher *ret = envoy_type_matcher_v3_ListMatcher_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_matcher_v3_ListMatcher *envoy_type_matcher_v3_ListMatcher_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_matcher_v3_ListMatcher *ret = envoy_type_matcher_v3_ListMatcher_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListMatcher_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_matcher_v3_ListMatcher_serialize(const envoy_type_matcher_v3_ListMatcher *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, arena, len);
@@ -198,6 +216,8 @@ UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_List
return sub;
}
+extern const upb_msglayout_file envoy_type_matcher_v3_value_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
index e692eda96f3..1e66959653a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/metadata/v3/metadata.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,73 +15,90 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_metadata_v3_MetadataKey_submsgs[1] = {
- &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
+static const upb_msglayout_sub envoy_type_metadata_v3_MetadataKey_submsgs[1] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit},
};
static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit = {
&envoy_type_metadata_v3_MetadataKey_submsgs[0],
&envoy_type_metadata_v3_MetadataKey__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = {
NULL,
&envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0],
- UPB_SIZE(16, 32), 1, false, 255,
+ UPB_SIZE(16, 32), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const envoy_type_metadata_v3_MetadataKind_submsgs[4] = {
- &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
- &envoy_type_metadata_v3_MetadataKind_Host_msginit,
- &envoy_type_metadata_v3_MetadataKind_Request_msginit,
- &envoy_type_metadata_v3_MetadataKind_Route_msginit,
+static const upb_msglayout_sub envoy_type_metadata_v3_MetadataKind_submsgs[4] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Cluster_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Host_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Request_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_Route_msginit},
};
static const upb_msglayout_field envoy_type_metadata_v3_MetadataKind__fields[4] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit = {
&envoy_type_metadata_v3_MetadataKind_submsgs[0],
&envoy_type_metadata_v3_MetadataKind__fields[0],
- UPB_SIZE(8, 16), 4, false, 255,
+ UPB_SIZE(8, 16), 4, _UPB_MSGEXT_NONE, 4, 255,
};
const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[7] = {
+ &envoy_type_metadata_v3_MetadataKey_msginit,
+ &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
+ &envoy_type_metadata_v3_MetadataKind_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Request_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Route_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
+ &envoy_type_metadata_v3_MetadataKind_Host_msginit,
+};
+
+const upb_msglayout_file envoy_type_metadata_v3_metadata_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 7,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
index 83ac93cf529..d35bcb1b57d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
#define ENVOY_TYPE_METADATA_V3_METADATA_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -51,13 +51,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKe
UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKey *ret = envoy_type_metadata_v3_MetadataKey_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKey *envoy_type_metadata_v3_MetadataKey_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKey *ret = envoy_type_metadata_v3_MetadataKey_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_serialize(const envoy_type_metadata_v3_MetadataKey *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, arena, len);
@@ -92,13 +98,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v
UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKey_PathSegment *ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment *envoy_type_metadata_v3_MetadataKey_PathSegment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKey_PathSegment *ret = envoy_type_metadata_v3_MetadataKey_PathSegment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKey_PathSegment_serialize(const envoy_type_metadata_v3_MetadataKey_PathSegment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, arena, len);
@@ -125,13 +137,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataK
UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind *ret = envoy_type_metadata_v3_MetadataKind_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKind *envoy_type_metadata_v3_MetadataKind_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind *ret = envoy_type_metadata_v3_MetadataKind_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_serialize(const envoy_type_metadata_v3_MetadataKind *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, arena, len);
@@ -212,13 +230,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_M
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Request *ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request *envoy_type_metadata_v3_MetadataKind_Request_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Request *ret = envoy_type_metadata_v3_MetadataKind_Request_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Request_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Request_serialize(const envoy_type_metadata_v3_MetadataKind_Request *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, arena, len);
@@ -234,13 +258,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_Met
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Route *ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route *envoy_type_metadata_v3_MetadataKind_Route_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Route *ret = envoy_type_metadata_v3_MetadataKind_Route_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Route_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Route_serialize(const envoy_type_metadata_v3_MetadataKind_Route *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, arena, len);
@@ -256,13 +286,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_M
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Cluster *ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster *envoy_type_metadata_v3_MetadataKind_Cluster_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Cluster *ret = envoy_type_metadata_v3_MetadataKind_Cluster_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Cluster_serialize(const envoy_type_metadata_v3_MetadataKind_Cluster *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, arena, len);
@@ -278,13 +314,19 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_Meta
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Host *ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host *envoy_type_metadata_v3_MetadataKind_Host_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_metadata_v3_MetadataKind_Host *ret = envoy_type_metadata_v3_MetadataKind_Host_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_metadata_v3_MetadataKind_Host_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Host_serialize(const envoy_type_metadata_v3_MetadataKind_Host *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, arena, len);
@@ -292,6 +334,8 @@ UPB_INLINE char *envoy_type_metadata_v3_MetadataKind_Host_serialize(const envoy_
+extern const upb_msglayout_file envoy_type_metadata_v3_metadata_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
index fa53e431e69..cc5e7abafac 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/tracing/v3/custom_tag.upb.h"
#include "envoy/type/metadata/v3/metadata.upb.h"
#include "udpa/annotations/status.upb.h"
@@ -16,74 +16,89 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_submsgs[4] = {
- &envoy_type_tracing_v3_CustomTag_Environment_msginit,
- &envoy_type_tracing_v3_CustomTag_Header_msginit,
- &envoy_type_tracing_v3_CustomTag_Literal_msginit,
- &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
+static const upb_msglayout_sub envoy_type_tracing_v3_CustomTag_submsgs[4] = {
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Environment_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Header_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Literal_msginit},
+ {.submsg = &envoy_type_tracing_v3_CustomTag_Metadata_msginit},
};
static const upb_msglayout_field envoy_type_tracing_v3_CustomTag__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit = {
&envoy_type_tracing_v3_CustomTag_submsgs[0],
&envoy_type_tracing_v3_CustomTag__fields[0],
- UPB_SIZE(16, 32), 5, false, 255,
+ UPB_SIZE(16, 32), 5, _UPB_MSGEXT_NONE, 5, 255,
};
static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Literal__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Environment__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Header__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit = {
NULL,
&envoy_type_tracing_v3_CustomTag_Header__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
- &envoy_type_metadata_v3_MetadataKind_msginit,
+static const upb_msglayout_sub envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = {
+ {.submsg = &envoy_type_metadata_v3_MetadataKey_msginit},
+ {.submsg = &envoy_type_metadata_v3_MetadataKind_msginit},
};
static const upb_msglayout_field envoy_type_tracing_v3_CustomTag_Metadata__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit = {
&envoy_type_tracing_v3_CustomTag_Metadata_submsgs[0],
&envoy_type_tracing_v3_CustomTag_Metadata__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &envoy_type_tracing_v3_CustomTag_msginit,
+ &envoy_type_tracing_v3_CustomTag_Literal_msginit,
+ &envoy_type_tracing_v3_CustomTag_Environment_msginit,
+ &envoy_type_tracing_v3_CustomTag_Header_msginit,
+ &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
+};
+
+const upb_msglayout_file envoy_type_tracing_v3_custom_tag_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
index 666ed7b11db..07efd898780 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
#define ENVOY_TYPE_TRACING_V3_CUSTOM_TAG_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -49,13 +49,19 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_new(
UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_tracing_v3_CustomTag *ret = envoy_type_tracing_v3_CustomTag_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_tracing_v3_CustomTag *envoy_type_tracing_v3_CustomTag_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_tracing_v3_CustomTag *ret = envoy_type_tracing_v3_CustomTag_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_tracing_v3_CustomTag_serialize(const envoy_type_tracing_v3_CustomTag *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, arena, len);
@@ -140,13 +146,19 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_Custom
UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Literal *ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal *envoy_type_tracing_v3_CustomTag_Literal_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Literal *ret = envoy_type_tracing_v3_CustomTag_Literal_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Literal_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Literal_serialize(const envoy_type_tracing_v3_CustomTag_Literal *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, arena, len);
@@ -166,13 +178,19 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_Cu
UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Environment *ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment *envoy_type_tracing_v3_CustomTag_Environment_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Environment *ret = envoy_type_tracing_v3_CustomTag_Environment_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Environment_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Environment_serialize(const envoy_type_tracing_v3_CustomTag_Environment *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, arena, len);
@@ -196,13 +214,19 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomT
UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Header *ret = envoy_type_tracing_v3_CustomTag_Header_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_tracing_v3_CustomTag_Header *envoy_type_tracing_v3_CustomTag_Header_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Header *ret = envoy_type_tracing_v3_CustomTag_Header_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Header_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Header_serialize(const envoy_type_tracing_v3_CustomTag_Header *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, arena, len);
@@ -226,13 +250,19 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_Custo
UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Metadata *ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata *envoy_type_tracing_v3_CustomTag_Metadata_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_tracing_v3_CustomTag_Metadata *ret = envoy_type_tracing_v3_CustomTag_Metadata_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_tracing_v3_CustomTag_Metadata_serialize(const envoy_type_tracing_v3_CustomTag_Metadata *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, arena, len);
@@ -274,6 +304,8 @@ UPB_INLINE void envoy_type_tracing_v3_CustomTag_Metadata_set_default_value(envoy
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
+extern const upb_msglayout_file envoy_type_tracing_v3_custom_tag_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
index c4a03ae8cad..74eec3e780d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.c
@@ -7,11 +7,18 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/http.upb.h"
#include "udpa/annotations/status.upb.h"
#include "upb/port_def.inc"
+const upb_msglayout_file envoy_type_v3_http_proto_upb_file_layout = {
+ NULL,
+ NULL,
+ 0,
+ 0,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
index 25b033f214c..56d440a4e9f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/http.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
#define ENVOY_TYPE_V3_HTTP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -27,6 +27,8 @@ typedef enum {
} envoy_type_v3_CodecClientType;
+extern const upb_msglayout_file envoy_type_v3_http_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
index 9e4a87c341a..5d527efe4e7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/percent.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -16,24 +16,36 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_type_v3_Percent__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_Percent_msginit = {
NULL,
&envoy_type_v3_Percent__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field envoy_type_v3_FractionalPercent__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_FractionalPercent_msginit = {
NULL,
&envoy_type_v3_FractionalPercent__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &envoy_type_v3_Percent_msginit,
+ &envoy_type_v3_FractionalPercent_msginit,
+};
+
+const upb_msglayout_file envoy_type_v3_percent_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
index 6155e2391d2..6a879d05513 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
#define ENVOY_TYPE_V3_PERCENT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -42,13 +42,19 @@ UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_new(upb_arena *arena) {
UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_Percent *envoy_type_v3_Percent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_Percent *ret = envoy_type_v3_Percent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_Percent_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_Percent_serialize(const envoy_type_v3_Percent *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_Percent_msginit, arena, len);
@@ -68,13 +74,19 @@ UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_new(
UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_FractionalPercent *envoy_type_v3_FractionalPercent_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_FractionalPercent *ret = envoy_type_v3_FractionalPercent_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_FractionalPercent_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_FractionalPercent_serialize(const envoy_type_v3_FractionalPercent *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_FractionalPercent_msginit, arena, len);
@@ -90,6 +102,8 @@ UPB_INLINE void envoy_type_v3_FractionalPercent_set_denominator(envoy_type_v3_Fr
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
+extern const upb_msglayout_file envoy_type_v3_percent_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
index e4222bef5c9..60437083dd8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/range.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,36 +15,49 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_type_v3_Int64Range__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 3, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_Int64Range_msginit = {
NULL,
&envoy_type_v3_Int64Range__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_type_v3_Int32Range__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 5, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_Int32Range_msginit = {
NULL,
&envoy_type_v3_Int32Range__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field envoy_type_v3_DoubleRange__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_DoubleRange_msginit = {
NULL,
&envoy_type_v3_DoubleRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &envoy_type_v3_Int64Range_msginit,
+ &envoy_type_v3_Int32Range_msginit,
+ &envoy_type_v3_DoubleRange_msginit,
+};
+
+const upb_msglayout_file envoy_type_v3_range_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
index 9ff396d9ce2..9db602f9a5d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/range.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
#define ENVOY_TYPE_V3_RANGE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,13 +39,19 @@ UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_new(upb_arena *are
UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_Int64Range *ret = envoy_type_v3_Int64Range_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_Int64Range *envoy_type_v3_Int64Range_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_Int64Range *ret = envoy_type_v3_Int64Range_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_Int64Range_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_Int64Range_serialize(const envoy_type_v3_Int64Range *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_Int64Range_msginit, arena, len);
@@ -69,13 +75,19 @@ UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_new(upb_arena *are
UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_Int32Range *ret = envoy_type_v3_Int32Range_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_Int32Range *envoy_type_v3_Int32Range_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_Int32Range *ret = envoy_type_v3_Int32Range_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_Int32Range_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_Int32Range_serialize(const envoy_type_v3_Int32Range *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_Int32Range_msginit, arena, len);
@@ -99,13 +111,19 @@ UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_new(upb_arena *a
UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_DoubleRange *ret = envoy_type_v3_DoubleRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_DoubleRange *envoy_type_v3_DoubleRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_DoubleRange *ret = envoy_type_v3_DoubleRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_DoubleRange_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_DoubleRange_serialize(const envoy_type_v3_DoubleRange *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_DoubleRange_msginit, arena, len);
@@ -121,6 +139,8 @@ UPB_INLINE void envoy_type_v3_DoubleRange_set_end(envoy_type_v3_DoubleRange *msg
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
}
+extern const upb_msglayout_file envoy_type_v3_range_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
index 8984ac7fbdc..9806cbd4cc5 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "envoy/type/v3/semantic_version.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
@@ -15,15 +15,26 @@
#include "upb/port_def.inc"
static const upb_msglayout_field envoy_type_v3_SemanticVersion__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {3, UPB_SIZE(8, 8), 0, 0, 13, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout envoy_type_v3_SemanticVersion_msginit = {
NULL,
&envoy_type_v3_SemanticVersion__fields[0],
- UPB_SIZE(16, 16), 3, false, 255,
+ UPB_SIZE(16, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &envoy_type_v3_SemanticVersion_msginit,
+};
+
+const upb_msglayout_file envoy_type_v3_semantic_version_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
index e1dd3297202..f89b3e50170 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h
@@ -9,7 +9,7 @@
#ifndef ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
#define ENVOY_TYPE_V3_SEMANTIC_VERSION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_new(upb_
UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_type_v3_SemanticVersion *ret = envoy_type_v3_SemanticVersion_new(arena);
- return (ret && upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE envoy_type_v3_SemanticVersion *envoy_type_v3_SemanticVersion_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
envoy_type_v3_SemanticVersion *ret = envoy_type_v3_SemanticVersion_new(arena);
- return (ret && _upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &envoy_type_v3_SemanticVersion_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *envoy_type_v3_SemanticVersion_serialize(const envoy_type_v3_SemanticVersion *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_type_v3_SemanticVersion_msginit, arena, len);
@@ -59,6 +65,8 @@ UPB_INLINE void envoy_type_v3_SemanticVersion_set_patch(envoy_type_v3_SemanticVe
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint32_t) = value;
}
+extern const upb_msglayout_file envoy_type_v3_semantic_version_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
index a1385cc3e70..147fbcf03b1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.c
@@ -7,12 +7,32 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/annotations.upb.h"
#include "google/api/http.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_msglayout google_api_HttpRule_msginit;
+extern const upb_msglayout google_protobuf_MethodOptions_msginit;
+const upb_msglayout_ext google_api_http_ext = {
+ {72295728, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_MethodOptions_msginit,
+ {.submsg = &google_api_HttpRule_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &google_api_http_ext,
+};
+
+const upb_msglayout_file google_api_annotations_proto_upb_file_layout = {
+ NULL,
+ extensions_layout,
+ 0,
+ 1,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
index fcbe640dbed..07ebb9623d8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/annotations.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_
#define GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,13 @@
extern "C" {
#endif
+extern const upb_msglayout_ext google_api_http_ext;
+struct google_protobuf_MethodOptions;
+extern const upb_msglayout google_protobuf_MethodOptions_msginit;
+
+UPB_INLINE bool google_api_has_http(const struct google_protobuf_MethodOptions *msg) { return _upb_msg_getext(msg, &google_api_http_ext) != NULL; }
+UPB_INLINE const struct google_api_HttpRule* google_api_http(const struct google_protobuf_MethodOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &google_api_http_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const struct google_api_HttpRule*); }
+extern const upb_msglayout_file google_api_annotations_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
index 16fd52a0739..0f26bbfc605 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/expr/v1alpha1/checked.upb.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "google/protobuf/empty.upb.h"
@@ -15,227 +15,250 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = {
- &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
- &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
- &google_api_expr_v1alpha1_Expr_msginit,
- &google_api_expr_v1alpha1_SourceInfo_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_CheckedExpr_submsgs[4] = {
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr__fields[4] = {
- {2, UPB_SIZE(12, 24), 0, 0, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(16, 32), 0, 1, 11, _UPB_LABEL_MAP},
- {4, UPB_SIZE(4, 8), 1, 2, 11, 1},
- {5, UPB_SIZE(8, 16), 2, 3, 11, 1},
+ {2, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 8), 1, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), 2, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_msginit = {
&google_api_expr_v1alpha1_CheckedExpr_submsgs[0],
&google_api_expr_v1alpha1_CheckedExpr__fields[0],
- UPB_SIZE(24, 40), 4, false, 255,
+ UPB_SIZE(24, 40), 4, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Reference_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Reference_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit = {
&google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[0],
&google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit = {
&google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_submsgs[0],
&google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_submsgs[6] = {
- &google_api_expr_v1alpha1_Type_msginit,
- &google_api_expr_v1alpha1_Type_AbstractType_msginit,
- &google_api_expr_v1alpha1_Type_FunctionType_msginit,
- &google_api_expr_v1alpha1_Type_ListType_msginit,
- &google_api_expr_v1alpha1_Type_MapType_msginit,
- &google_protobuf_Empty_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Type_submsgs[6] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_AbstractType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_FunctionType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_ListType_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_MapType_msginit},
+ {.submsg = &google_protobuf_Empty_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Type__fields[13] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {10, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {11, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {12, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, 1},
- {14, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Type_msginit = {
&google_api_expr_v1alpha1_Type_submsgs[0],
&google_api_expr_v1alpha1_Type__fields[0],
- UPB_SIZE(16, 32), 13, false, 255,
+ UPB_SIZE(16, 32), 13, _UPB_MSGEXT_NONE, 12, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Type_ListType_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Type_ListType__fields[1] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Type_ListType_msginit = {
&google_api_expr_v1alpha1_Type_ListType_submsgs[0],
&google_api_expr_v1alpha1_Type_ListType__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_MapType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Type_MapType_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Type_MapType__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Type_MapType_msginit = {
&google_api_expr_v1alpha1_Type_MapType_submsgs[0],
&google_api_expr_v1alpha1_Type_MapType__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_FunctionType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Type_FunctionType_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Type_FunctionType__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Type_FunctionType_msginit = {
&google_api_expr_v1alpha1_Type_FunctionType_submsgs[0],
&google_api_expr_v1alpha1_Type_FunctionType__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Type_AbstractType__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Type_AbstractType_msginit = {
&google_api_expr_v1alpha1_Type_AbstractType_submsgs[0],
&google_api_expr_v1alpha1_Type_AbstractType__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_submsgs[2] = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
- &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Decl_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Decl_IdentDecl_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Decl__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Decl_msginit = {
&google_api_expr_v1alpha1_Decl_submsgs[0],
&google_api_expr_v1alpha1_Decl__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = {
- &google_api_expr_v1alpha1_Constant_msginit,
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Decl_IdentDecl__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(16, 32), 2, 0, 11, 1},
- {3, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Decl_IdentDecl_msginit = {
&google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[0],
&google_api_expr_v1alpha1_Decl_IdentDecl__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
- &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_msginit = {
&google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[0],
&google_api_expr_v1alpha1_Decl_FunctionDecl__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[1] = {
- &google_api_expr_v1alpha1_Type_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Type_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[6] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {3, UPB_SIZE(28, 56), 0, 0, 9, 3},
- {4, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 0, 0, 8, 1},
- {6, UPB_SIZE(12, 24), 0, 0, 9, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit = {
&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[0],
&google_api_expr_v1alpha1_Decl_FunctionDecl_Overload__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(32, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Reference_submsgs[1] = {
- &google_api_expr_v1alpha1_Constant_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Reference_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Reference__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 9, 3},
- {4, UPB_SIZE(12, 24), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Reference_msginit = {
&google_api_expr_v1alpha1_Reference_submsgs[0],
&google_api_expr_v1alpha1_Reference__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[13] = {
+ &google_api_expr_v1alpha1_CheckedExpr_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_msginit,
+ &google_api_expr_v1alpha1_CheckedExpr_TypeMapEntry_msginit,
+ &google_api_expr_v1alpha1_Type_msginit,
+ &google_api_expr_v1alpha1_Type_ListType_msginit,
+ &google_api_expr_v1alpha1_Type_MapType_msginit,
+ &google_api_expr_v1alpha1_Type_FunctionType_msginit,
+ &google_api_expr_v1alpha1_Type_AbstractType_msginit,
+ &google_api_expr_v1alpha1_Decl_msginit,
+ &google_api_expr_v1alpha1_Decl_IdentDecl_msginit,
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit,
+ &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit,
+ &google_api_expr_v1alpha1_Reference_msginit,
+};
+
+const upb_msglayout_file google_api_expr_v1alpha1_checked_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 13,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
index 43a88f708bf..1299def4019 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_CHECKED_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -94,13 +94,19 @@ UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_Checke
UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_CheckedExpr *ret = google_api_expr_v1alpha1_CheckedExpr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_CheckedExpr *google_api_expr_v1alpha1_CheckedExpr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_CheckedExpr *ret = google_api_expr_v1alpha1_CheckedExpr_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_CheckedExpr_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_CheckedExpr_serialize(const google_api_expr_v1alpha1_CheckedExpr *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, arena, len);
@@ -198,13 +204,19 @@ UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_new(upb_
UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Type *ret = google_api_expr_v1alpha1_Type_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Type *google_api_expr_v1alpha1_Type_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Type *ret = google_api_expr_v1alpha1_Type_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Type_serialize(const google_api_expr_v1alpha1_Type *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Type_msginit, arena, len);
@@ -366,13 +378,19 @@ UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type
UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Type_ListType *ret = google_api_expr_v1alpha1_Type_ListType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Type_ListType *google_api_expr_v1alpha1_Type_ListType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Type_ListType *ret = google_api_expr_v1alpha1_Type_ListType_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_ListType_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Type_ListType_serialize(const google_api_expr_v1alpha1_Type_ListType *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, arena, len);
@@ -403,13 +421,19 @@ UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_
UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Type_MapType *ret = google_api_expr_v1alpha1_Type_MapType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Type_MapType *google_api_expr_v1alpha1_Type_MapType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Type_MapType *ret = google_api_expr_v1alpha1_Type_MapType_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_MapType_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Type_MapType_serialize(const google_api_expr_v1alpha1_Type_MapType *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, arena, len);
@@ -455,13 +479,19 @@ UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_
UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Type_FunctionType *ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType *google_api_expr_v1alpha1_Type_FunctionType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Type_FunctionType *ret = google_api_expr_v1alpha1_Type_FunctionType_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_FunctionType_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Type_FunctionType_serialize(const google_api_expr_v1alpha1_Type_FunctionType *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, arena, len);
@@ -507,13 +537,19 @@ UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_
UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Type_AbstractType *ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType *google_api_expr_v1alpha1_Type_AbstractType_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Type_AbstractType *ret = google_api_expr_v1alpha1_Type_AbstractType_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Type_AbstractType_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Type_AbstractType_serialize(const google_api_expr_v1alpha1_Type_AbstractType *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, arena, len);
@@ -548,13 +584,19 @@ UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_new(upb_
UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Decl *ret = google_api_expr_v1alpha1_Decl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Decl *google_api_expr_v1alpha1_Decl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Decl *ret = google_api_expr_v1alpha1_Decl_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Decl_serialize(const google_api_expr_v1alpha1_Decl *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Decl_msginit, arena, len);
@@ -609,13 +651,19 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Dec
UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Decl_IdentDecl *ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl *google_api_expr_v1alpha1_Decl_IdentDecl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Decl_IdentDecl *ret = google_api_expr_v1alpha1_Decl_IdentDecl_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Decl_IdentDecl_serialize(const google_api_expr_v1alpha1_Decl_IdentDecl *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, arena, len);
@@ -665,13 +713,19 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_
UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Decl_FunctionDecl *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl *google_api_expr_v1alpha1_Decl_FunctionDecl_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Decl_FunctionDecl *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, arena, len);
@@ -702,13 +756,19 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_
UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *ret = google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_serialize(const google_api_expr_v1alpha1_Decl_FunctionDecl_Overload *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, arena, len);
@@ -777,13 +837,19 @@ UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Referenc
UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Reference *ret = google_api_expr_v1alpha1_Reference_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Reference *google_api_expr_v1alpha1_Reference_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Reference *ret = google_api_expr_v1alpha1_Reference_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Reference_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Reference_serialize(const google_api_expr_v1alpha1_Reference *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Reference_msginit, arena, len);
@@ -821,6 +887,8 @@ UPB_INLINE struct google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Re
return sub;
}
+extern const upb_msglayout_file google_api_expr_v1alpha1_checked_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c
new file mode 100644
index 00000000000..11b1c0e7078
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c
@@ -0,0 +1,102 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/eval.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "google/api/expr/v1alpha1/eval.upb.h"
+#include "google/api/expr/v1alpha1/value.upb.h"
+#include "google/rpc/status.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_EvalState_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_EvalState_Result_msginit},
+ {.submsg = &google_api_expr_v1alpha1_ExprValue_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_EvalState__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_EvalState_msginit = {
+ &google_api_expr_v1alpha1_EvalState_submsgs[0],
+ &google_api_expr_v1alpha1_EvalState__fields[0],
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_EvalState_Result__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_EvalState_Result_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_EvalState_Result__fields[0],
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_ExprValue_submsgs[3] = {
+ {.submsg = &google_api_expr_v1alpha1_ErrorSet_msginit},
+ {.submsg = &google_api_expr_v1alpha1_UnknownSet_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Value_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_ExprValue__fields[3] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_ExprValue_msginit = {
+ &google_api_expr_v1alpha1_ExprValue_submsgs[0],
+ &google_api_expr_v1alpha1_ExprValue__fields[0],
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_ErrorSet_submsgs[1] = {
+ {.submsg = &google_rpc_Status_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_ErrorSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_ErrorSet_msginit = {
+ &google_api_expr_v1alpha1_ErrorSet_submsgs[0],
+ &google_api_expr_v1alpha1_ErrorSet__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_UnknownSet__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_UnknownSet_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_UnknownSet__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &google_api_expr_v1alpha1_EvalState_msginit,
+ &google_api_expr_v1alpha1_EvalState_Result_msginit,
+ &google_api_expr_v1alpha1_ExprValue_msginit,
+ &google_api_expr_v1alpha1_ErrorSet_msginit,
+ &google_api_expr_v1alpha1_UnknownSet_msginit,
+};
+
+const upb_msglayout_file google_api_expr_v1alpha1_eval_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h
new file mode 100644
index 00000000000..8a3cd017804
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.h
@@ -0,0 +1,306 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/eval.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_EXPR_V1ALPHA1_EVAL_PROTO_UPB_H_
+#define GOOGLE_API_EXPR_V1ALPHA1_EVAL_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_expr_v1alpha1_EvalState;
+struct google_api_expr_v1alpha1_EvalState_Result;
+struct google_api_expr_v1alpha1_ExprValue;
+struct google_api_expr_v1alpha1_ErrorSet;
+struct google_api_expr_v1alpha1_UnknownSet;
+typedef struct google_api_expr_v1alpha1_EvalState google_api_expr_v1alpha1_EvalState;
+typedef struct google_api_expr_v1alpha1_EvalState_Result google_api_expr_v1alpha1_EvalState_Result;
+typedef struct google_api_expr_v1alpha1_ExprValue google_api_expr_v1alpha1_ExprValue;
+typedef struct google_api_expr_v1alpha1_ErrorSet google_api_expr_v1alpha1_ErrorSet;
+typedef struct google_api_expr_v1alpha1_UnknownSet google_api_expr_v1alpha1_UnknownSet;
+extern const upb_msglayout google_api_expr_v1alpha1_EvalState_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_EvalState_Result_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_ExprValue_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_ErrorSet_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_UnknownSet_msginit;
+struct google_api_expr_v1alpha1_Value;
+struct google_rpc_Status;
+extern const upb_msglayout google_api_expr_v1alpha1_Value_msginit;
+extern const upb_msglayout google_rpc_Status_msginit;
+
+
+/* google.api.expr.v1alpha1.EvalState */
+
+UPB_INLINE google_api_expr_v1alpha1_EvalState *google_api_expr_v1alpha1_EvalState_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_EvalState *)_upb_msg_new(&google_api_expr_v1alpha1_EvalState_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState *google_api_expr_v1alpha1_EvalState_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EvalState *ret = google_api_expr_v1alpha1_EvalState_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EvalState_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState *google_api_expr_v1alpha1_EvalState_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EvalState *ret = google_api_expr_v1alpha1_EvalState_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EvalState_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_EvalState_serialize(const google_api_expr_v1alpha1_EvalState *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_EvalState_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_EvalState_has_values(const google_api_expr_v1alpha1_EvalState *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_ExprValue* const* google_api_expr_v1alpha1_EvalState_values(const google_api_expr_v1alpha1_EvalState *msg, size_t *len) { return (const google_api_expr_v1alpha1_ExprValue* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+UPB_INLINE bool google_api_expr_v1alpha1_EvalState_has_results(const google_api_expr_v1alpha1_EvalState *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_EvalState_Result* const* google_api_expr_v1alpha1_EvalState_results(const google_api_expr_v1alpha1_EvalState *msg, size_t *len) { return (const google_api_expr_v1alpha1_EvalState_Result* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE google_api_expr_v1alpha1_ExprValue** google_api_expr_v1alpha1_EvalState_mutable_values(google_api_expr_v1alpha1_EvalState *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_ExprValue**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_ExprValue** google_api_expr_v1alpha1_EvalState_resize_values(google_api_expr_v1alpha1_EvalState *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_ExprValue**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_ExprValue* google_api_expr_v1alpha1_EvalState_add_values(google_api_expr_v1alpha1_EvalState *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_ExprValue* sub = (struct google_api_expr_v1alpha1_ExprValue*)_upb_msg_new(&google_api_expr_v1alpha1_ExprValue_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState_Result** google_api_expr_v1alpha1_EvalState_mutable_results(google_api_expr_v1alpha1_EvalState *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_EvalState_Result**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState_Result** google_api_expr_v1alpha1_EvalState_resize_results(google_api_expr_v1alpha1_EvalState *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_EvalState_Result**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_EvalState_Result* google_api_expr_v1alpha1_EvalState_add_results(google_api_expr_v1alpha1_EvalState *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_EvalState_Result* sub = (struct google_api_expr_v1alpha1_EvalState_Result*)_upb_msg_new(&google_api_expr_v1alpha1_EvalState_Result_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.EvalState.Result */
+
+UPB_INLINE google_api_expr_v1alpha1_EvalState_Result *google_api_expr_v1alpha1_EvalState_Result_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_EvalState_Result *)_upb_msg_new(&google_api_expr_v1alpha1_EvalState_Result_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState_Result *google_api_expr_v1alpha1_EvalState_Result_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EvalState_Result *ret = google_api_expr_v1alpha1_EvalState_Result_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EvalState_Result_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_EvalState_Result *google_api_expr_v1alpha1_EvalState_Result_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EvalState_Result *ret = google_api_expr_v1alpha1_EvalState_Result_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EvalState_Result_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_EvalState_Result_serialize(const google_api_expr_v1alpha1_EvalState_Result *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_EvalState_Result_msginit, arena, len);
+}
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_EvalState_Result_expr(const google_api_expr_v1alpha1_EvalState_Result *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int64_t google_api_expr_v1alpha1_EvalState_Result_value(const google_api_expr_v1alpha1_EvalState_Result *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
+
+UPB_INLINE void google_api_expr_v1alpha1_EvalState_Result_set_expr(google_api_expr_v1alpha1_EvalState_Result *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_EvalState_Result_set_value(google_api_expr_v1alpha1_EvalState_Result *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
+}
+
+/* google.api.expr.v1alpha1.ExprValue */
+
+UPB_INLINE google_api_expr_v1alpha1_ExprValue *google_api_expr_v1alpha1_ExprValue_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_ExprValue *)_upb_msg_new(&google_api_expr_v1alpha1_ExprValue_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_ExprValue *google_api_expr_v1alpha1_ExprValue_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ExprValue *ret = google_api_expr_v1alpha1_ExprValue_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ExprValue_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_ExprValue *google_api_expr_v1alpha1_ExprValue_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ExprValue *ret = google_api_expr_v1alpha1_ExprValue_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ExprValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_ExprValue_serialize(const google_api_expr_v1alpha1_ExprValue *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_ExprValue_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_ExprValue_kind_value = 1,
+ google_api_expr_v1alpha1_ExprValue_kind_error = 2,
+ google_api_expr_v1alpha1_ExprValue_kind_unknown = 3,
+ google_api_expr_v1alpha1_ExprValue_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_ExprValue_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_ExprValue_kind_oneofcases google_api_expr_v1alpha1_ExprValue_kind_case(const google_api_expr_v1alpha1_ExprValue* msg) { return (google_api_expr_v1alpha1_ExprValue_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
+
+UPB_INLINE bool google_api_expr_v1alpha1_ExprValue_has_value(const google_api_expr_v1alpha1_ExprValue *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
+UPB_INLINE const struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_ExprValue_value(const google_api_expr_v1alpha1_ExprValue *msg) { return UPB_READ_ONEOF(msg, const struct google_api_expr_v1alpha1_Value*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_ExprValue_has_error(const google_api_expr_v1alpha1_ExprValue *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
+UPB_INLINE const google_api_expr_v1alpha1_ErrorSet* google_api_expr_v1alpha1_ExprValue_error(const google_api_expr_v1alpha1_ExprValue *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_ErrorSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_ExprValue_has_unknown(const google_api_expr_v1alpha1_ExprValue *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
+UPB_INLINE const google_api_expr_v1alpha1_UnknownSet* google_api_expr_v1alpha1_ExprValue_unknown(const google_api_expr_v1alpha1_ExprValue *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_UnknownSet*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
+
+UPB_INLINE void google_api_expr_v1alpha1_ExprValue_set_value(google_api_expr_v1alpha1_ExprValue *msg, struct google_api_expr_v1alpha1_Value* value) {
+ UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_Value*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_ExprValue_mutable_value(google_api_expr_v1alpha1_ExprValue *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)google_api_expr_v1alpha1_ExprValue_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_ExprValue_set_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_ExprValue_set_error(google_api_expr_v1alpha1_ExprValue *msg, google_api_expr_v1alpha1_ErrorSet* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_ErrorSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_ErrorSet* google_api_expr_v1alpha1_ExprValue_mutable_error(google_api_expr_v1alpha1_ExprValue *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_ErrorSet* sub = (struct google_api_expr_v1alpha1_ErrorSet*)google_api_expr_v1alpha1_ExprValue_error(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_ErrorSet*)_upb_msg_new(&google_api_expr_v1alpha1_ErrorSet_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_ExprValue_set_error(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_ExprValue_set_unknown(google_api_expr_v1alpha1_ExprValue *msg, google_api_expr_v1alpha1_UnknownSet* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_UnknownSet*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_UnknownSet* google_api_expr_v1alpha1_ExprValue_mutable_unknown(google_api_expr_v1alpha1_ExprValue *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_UnknownSet* sub = (struct google_api_expr_v1alpha1_UnknownSet*)google_api_expr_v1alpha1_ExprValue_unknown(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_UnknownSet*)_upb_msg_new(&google_api_expr_v1alpha1_UnknownSet_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_ExprValue_set_unknown(msg, sub);
+ }
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.ErrorSet */
+
+UPB_INLINE google_api_expr_v1alpha1_ErrorSet *google_api_expr_v1alpha1_ErrorSet_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_ErrorSet *)_upb_msg_new(&google_api_expr_v1alpha1_ErrorSet_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_ErrorSet *google_api_expr_v1alpha1_ErrorSet_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ErrorSet *ret = google_api_expr_v1alpha1_ErrorSet_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ErrorSet_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_ErrorSet *google_api_expr_v1alpha1_ErrorSet_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ErrorSet *ret = google_api_expr_v1alpha1_ErrorSet_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ErrorSet_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_ErrorSet_serialize(const google_api_expr_v1alpha1_ErrorSet *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_ErrorSet_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_ErrorSet_has_errors(const google_api_expr_v1alpha1_ErrorSet *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_rpc_Status* const* google_api_expr_v1alpha1_ErrorSet_errors(const google_api_expr_v1alpha1_ErrorSet *msg, size_t *len) { return (const struct google_rpc_Status* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE struct google_rpc_Status** google_api_expr_v1alpha1_ErrorSet_mutable_errors(google_api_expr_v1alpha1_ErrorSet *msg, size_t *len) {
+ return (struct google_rpc_Status**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct google_rpc_Status** google_api_expr_v1alpha1_ErrorSet_resize_errors(google_api_expr_v1alpha1_ErrorSet *msg, size_t len, upb_arena *arena) {
+ return (struct google_rpc_Status**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_rpc_Status* google_api_expr_v1alpha1_ErrorSet_add_errors(google_api_expr_v1alpha1_ErrorSet *msg, upb_arena *arena) {
+ struct google_rpc_Status* sub = (struct google_rpc_Status*)_upb_msg_new(&google_rpc_Status_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.UnknownSet */
+
+UPB_INLINE google_api_expr_v1alpha1_UnknownSet *google_api_expr_v1alpha1_UnknownSet_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_UnknownSet *)_upb_msg_new(&google_api_expr_v1alpha1_UnknownSet_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_UnknownSet *google_api_expr_v1alpha1_UnknownSet_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_UnknownSet *ret = google_api_expr_v1alpha1_UnknownSet_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_UnknownSet_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_UnknownSet *google_api_expr_v1alpha1_UnknownSet_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_UnknownSet *ret = google_api_expr_v1alpha1_UnknownSet_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_UnknownSet_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_UnknownSet_serialize(const google_api_expr_v1alpha1_UnknownSet *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_UnknownSet_msginit, arena, len);
+}
+
+UPB_INLINE int64_t const* google_api_expr_v1alpha1_UnknownSet_exprs(const google_api_expr_v1alpha1_UnknownSet *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE int64_t* google_api_expr_v1alpha1_UnknownSet_mutable_exprs(google_api_expr_v1alpha1_UnknownSet *msg, size_t *len) {
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE int64_t* google_api_expr_v1alpha1_UnknownSet_resize_exprs(google_api_expr_v1alpha1_UnknownSet *msg, size_t len, upb_arena *arena) {
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, 3, arena);
+}
+UPB_INLINE bool google_api_expr_v1alpha1_UnknownSet_add_exprs(google_api_expr_v1alpha1_UnknownSet *msg, int64_t val, upb_arena *arena) {
+ return _upb_array_append_accessor2(msg, UPB_SIZE(0, 0), 3, &val,
+ arena);
+}
+
+extern const upb_msglayout_file google_api_expr_v1alpha1_eval_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_EXPR_V1ALPHA1_EVAL_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c
new file mode 100644
index 00000000000..266694d620b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c
@@ -0,0 +1,56 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/explain.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "google/api/expr/v1alpha1/explain.upb.h"
+#include "google/api/expr/v1alpha1/value.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_Explain_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Explain_ExprStep_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Value_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Explain__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Explain_msginit = {
+ &google_api_expr_v1alpha1_Explain_submsgs[0],
+ &google_api_expr_v1alpha1_Explain__fields[0],
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Explain_ExprStep__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Explain_ExprStep_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_Explain_ExprStep__fields[0],
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &google_api_expr_v1alpha1_Explain_msginit,
+ &google_api_expr_v1alpha1_Explain_ExprStep_msginit,
+};
+
+const upb_msglayout_file google_api_expr_v1alpha1_explain_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h
new file mode 100644
index 00000000000..ddc2431822d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.h
@@ -0,0 +1,135 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/explain.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_PROTO_UPB_H_
+#define GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_expr_v1alpha1_Explain;
+struct google_api_expr_v1alpha1_Explain_ExprStep;
+typedef struct google_api_expr_v1alpha1_Explain google_api_expr_v1alpha1_Explain;
+typedef struct google_api_expr_v1alpha1_Explain_ExprStep google_api_expr_v1alpha1_Explain_ExprStep;
+extern const upb_msglayout google_api_expr_v1alpha1_Explain_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_Explain_ExprStep_msginit;
+struct google_api_expr_v1alpha1_Value;
+extern const upb_msglayout google_api_expr_v1alpha1_Value_msginit;
+
+
+/* google.api.expr.v1alpha1.Explain */
+
+UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Explain *)_upb_msg_new(&google_api_expr_v1alpha1_Explain_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Explain *ret = google_api_expr_v1alpha1_Explain_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Explain *ret = google_api_expr_v1alpha1_Explain_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Explain_serialize(const google_api_expr_v1alpha1_Explain *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Explain_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_Explain_has_values(const google_api_expr_v1alpha1_Explain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const struct google_api_expr_v1alpha1_Value* const* google_api_expr_v1alpha1_Explain_values(const google_api_expr_v1alpha1_Explain *msg, size_t *len) { return (const struct google_api_expr_v1alpha1_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+UPB_INLINE bool google_api_expr_v1alpha1_Explain_has_expr_steps(const google_api_expr_v1alpha1_Explain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
+UPB_INLINE const google_api_expr_v1alpha1_Explain_ExprStep* const* google_api_expr_v1alpha1_Explain_expr_steps(const google_api_expr_v1alpha1_Explain *msg, size_t *len) { return (const google_api_expr_v1alpha1_Explain_ExprStep* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
+
+UPB_INLINE struct google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_Explain_mutable_values(google_api_expr_v1alpha1_Explain *msg, size_t *len) {
+ return (struct google_api_expr_v1alpha1_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_Explain_resize_values(google_api_expr_v1alpha1_Explain *msg, size_t len, upb_arena *arena) {
+ return (struct google_api_expr_v1alpha1_Value**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_Explain_add_values(google_api_expr_v1alpha1_Explain *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep** google_api_expr_v1alpha1_Explain_mutable_expr_steps(google_api_expr_v1alpha1_Explain *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Explain_ExprStep**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep** google_api_expr_v1alpha1_Explain_resize_expr_steps(google_api_expr_v1alpha1_Explain *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Explain_ExprStep**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Explain_ExprStep* google_api_expr_v1alpha1_Explain_add_expr_steps(google_api_expr_v1alpha1_Explain *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Explain_ExprStep* sub = (struct google_api_expr_v1alpha1_Explain_ExprStep*)_upb_msg_new(&google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.Explain.ExprStep */
+
+UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Explain_ExprStep *)_upb_msg_new(&google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Explain_ExprStep *ret = google_api_expr_v1alpha1_Explain_ExprStep_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Explain_ExprStep *ret = google_api_expr_v1alpha1_Explain_ExprStep_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Explain_ExprStep_serialize(const google_api_expr_v1alpha1_Explain_ExprStep *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena, len);
+}
+
+UPB_INLINE int64_t google_api_expr_v1alpha1_Explain_ExprStep_id(const google_api_expr_v1alpha1_Explain_ExprStep *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Explain_ExprStep_value_index(const google_api_expr_v1alpha1_Explain_ExprStep *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Explain_ExprStep_set_id(google_api_expr_v1alpha1_Explain_ExprStep *msg, int64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Explain_ExprStep_set_value_index(google_api_expr_v1alpha1_Explain_ExprStep *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
+}
+
+extern const upb_msglayout_file google_api_expr_v1alpha1_explain_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
index 4bbf5758615..5d1c3518245 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/struct.upb.h"
@@ -15,236 +15,260 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = {
- &google_api_expr_v1alpha1_Expr_msginit,
- &google_api_expr_v1alpha1_SourceInfo_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_ParsedExpr_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_ParsedExpr__fields[2] = {
- {2, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 2, 1, 11, 1},
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_ParsedExpr_msginit = {
&google_api_expr_v1alpha1_ParsedExpr_submsgs[0],
&google_api_expr_v1alpha1_ParsedExpr__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_submsgs[7] = {
- &google_api_expr_v1alpha1_Constant_msginit,
- &google_api_expr_v1alpha1_Expr_Call_msginit,
- &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
- &google_api_expr_v1alpha1_Expr_CreateList_msginit,
- &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
- &google_api_expr_v1alpha1_Expr_Ident_msginit,
- &google_api_expr_v1alpha1_Expr_Select_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_submsgs[7] = {
+ {.submsg = &google_api_expr_v1alpha1_Constant_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Call_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Comprehension_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_CreateList_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Ident_msginit},
+ {.submsg = &google_api_expr_v1alpha1_Expr_Select_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr__fields[8] = {
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, 1},
- {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 5, 11, 1},
- {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 6, 11, 1},
- {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, 1},
- {7, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, 1},
- {8, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, 1},
- {9, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(8, 8), UPB_SIZE(-13, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_msginit = {
&google_api_expr_v1alpha1_Expr_submsgs[0],
&google_api_expr_v1alpha1_Expr__fields[0],
- UPB_SIZE(16, 24), 8, false, 255,
+ UPB_SIZE(16, 24), 8, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Ident__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_Ident_msginit = {
NULL,
&google_api_expr_v1alpha1_Expr_Ident__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_Select_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Select__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_Select_msginit = {
&google_api_expr_v1alpha1_Expr_Select_submsgs[0],
&google_api_expr_v1alpha1_Expr_Select__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Call_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_Call_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Call__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 0, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 11, 3},
+ {1, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_Call_msginit = {
&google_api_expr_v1alpha1_Expr_Call_submsgs[0],
&google_api_expr_v1alpha1_Expr_Call__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_CreateList_msginit = {
&google_api_expr_v1alpha1_Expr_CreateList_submsgs[0],
&google_api_expr_v1alpha1_Expr_CreateList__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_msginit = {
&google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[0],
&google_api_expr_v1alpha1_Expr_CreateStruct__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {2, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 9, 1},
- {3, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 11, 1},
- {4, UPB_SIZE(16, 16), 1, 0, 11, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 24), UPB_SIZE(-29, -41), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit = {
&google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[0],
&google_api_expr_v1alpha1_Expr_CreateStruct_Entry__fields[0],
- UPB_SIZE(32, 48), 4, false, 255,
+ UPB_SIZE(32, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Expr_Comprehension_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Expr_Comprehension_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Expr_Comprehension__fields[7] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 40), 1, 0, 11, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(24, 48), 2, 0, 11, 1},
- {5, UPB_SIZE(28, 56), 3, 0, 11, 1},
- {6, UPB_SIZE(32, 64), 4, 0, 11, 1},
- {7, UPB_SIZE(36, 72), 5, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 48), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(32, 64), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(36, 72), 5, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Expr_Comprehension_msginit = {
&google_api_expr_v1alpha1_Expr_Comprehension_submsgs[0],
&google_api_expr_v1alpha1_Expr_Comprehension__fields[0],
- UPB_SIZE(40, 80), 7, false, 255,
+ UPB_SIZE(40, 80), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_Constant_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_Constant_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_Constant__fields[9] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 4, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, 1},
- {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_Constant_msginit = {
&google_api_expr_v1alpha1_Constant_submsgs[0],
&google_api_expr_v1alpha1_Constant__fields[0],
- UPB_SIZE(16, 32), 9, false, 255,
+ UPB_SIZE(16, 32), 9, _UPB_MSGEXT_NONE, 9, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_submsgs[2] = {
- &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit,
- &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_SourceInfo_submsgs[2] = {
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit},
+ {.submsg = &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 0, 0, 5, _UPB_LABEL_PACKED},
- {4, UPB_SIZE(20, 40), 0, 1, 11, _UPB_LABEL_MAP},
- {5, UPB_SIZE(24, 48), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 0, 0, 5, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(24, 48), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_SourceInfo_msginit = {
&google_api_expr_v1alpha1_SourceInfo_submsgs[0],
&google_api_expr_v1alpha1_SourceInfo__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 5, 255,
};
static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 5, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit = {
NULL,
&google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = {
- &google_api_expr_v1alpha1_Expr_msginit,
+static const upb_msglayout_sub google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Expr_msginit},
};
static const upb_msglayout_field google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit = {
&google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_submsgs[0],
&google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field google_api_expr_v1alpha1_SourcePosition__fields[4] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 5, 1},
- {4, UPB_SIZE(8, 8), 0, 0, 5, 1},
+ {1, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 4), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_expr_v1alpha1_SourcePosition_msginit = {
NULL,
&google_api_expr_v1alpha1_SourcePosition__fields[0],
- UPB_SIZE(24, 32), 4, false, 255,
+ UPB_SIZE(24, 32), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[14] = {
+ &google_api_expr_v1alpha1_ParsedExpr_msginit,
+ &google_api_expr_v1alpha1_Expr_msginit,
+ &google_api_expr_v1alpha1_Expr_Ident_msginit,
+ &google_api_expr_v1alpha1_Expr_Select_msginit,
+ &google_api_expr_v1alpha1_Expr_Call_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateList_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateStruct_msginit,
+ &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit,
+ &google_api_expr_v1alpha1_Expr_Comprehension_msginit,
+ &google_api_expr_v1alpha1_Constant_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_PositionsEntry_msginit,
+ &google_api_expr_v1alpha1_SourceInfo_MacroCallsEntry_msginit,
+ &google_api_expr_v1alpha1_SourcePosition_msginit,
+};
+
+const upb_msglayout_file google_api_expr_v1alpha1_syntax_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 14,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
index ffa7925ab35..c9325219ae4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_SYNTAX_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -76,13 +76,19 @@ UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedE
UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_ParsedExpr *ret = google_api_expr_v1alpha1_ParsedExpr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_ParsedExpr *google_api_expr_v1alpha1_ParsedExpr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_ParsedExpr *ret = google_api_expr_v1alpha1_ParsedExpr_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ParsedExpr_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_ParsedExpr_serialize(const google_api_expr_v1alpha1_ParsedExpr *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, arena, len);
@@ -128,13 +134,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_new(upb_
UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr *ret = google_api_expr_v1alpha1_Expr_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr *google_api_expr_v1alpha1_Expr_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr *ret = google_api_expr_v1alpha1_Expr_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_serialize(const google_api_expr_v1alpha1_Expr *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_msginit, arena, len);
@@ -264,13 +276,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Id
UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Ident *ret = google_api_expr_v1alpha1_Expr_Ident_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_Ident *google_api_expr_v1alpha1_Expr_Ident_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Ident *ret = google_api_expr_v1alpha1_Expr_Ident_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Ident_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_Ident_serialize(const google_api_expr_v1alpha1_Expr_Ident *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, arena, len);
@@ -290,13 +308,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_S
UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Select *ret = google_api_expr_v1alpha1_Expr_Select_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_Select *google_api_expr_v1alpha1_Expr_Select_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Select *ret = google_api_expr_v1alpha1_Expr_Select_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Select_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_Select_serialize(const google_api_expr_v1alpha1_Expr_Select *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, arena, len);
@@ -335,13 +359,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Cal
UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Call *ret = google_api_expr_v1alpha1_Expr_Call_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_Call *google_api_expr_v1alpha1_Expr_Call_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Call *ret = google_api_expr_v1alpha1_Expr_Call_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Call_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_Call_serialize(const google_api_expr_v1alpha1_Expr_Call *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, arena, len);
@@ -391,13 +421,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Ex
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateList *ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList *google_api_expr_v1alpha1_Expr_CreateList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateList *ret = google_api_expr_v1alpha1_Expr_CreateList_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateList_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateList_serialize(const google_api_expr_v1alpha1_Expr_CreateList *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, arena, len);
@@ -428,13 +464,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateStruct *ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct *google_api_expr_v1alpha1_Expr_CreateStruct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateStruct *ret = google_api_expr_v1alpha1_Expr_CreateStruct_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, arena, len);
@@ -469,13 +511,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1a
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateStruct_Entry *ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_CreateStruct_Entry *ret = google_api_expr_v1alpha1_Expr_CreateStruct_Entry_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_CreateStruct_Entry_serialize(const google_api_expr_v1alpha1_Expr_CreateStruct_Entry *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, arena, len);
@@ -536,13 +584,19 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1
UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Comprehension *ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension *google_api_expr_v1alpha1_Expr_Comprehension_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Expr_Comprehension *ret = google_api_expr_v1alpha1_Expr_Comprehension_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Expr_Comprehension_serialize(const google_api_expr_v1alpha1_Expr_Comprehension *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, arena, len);
@@ -641,13 +695,19 @@ UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_
UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_Constant *ret = google_api_expr_v1alpha1_Constant_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Constant *google_api_expr_v1alpha1_Constant_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_Constant *ret = google_api_expr_v1alpha1_Constant_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Constant_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Constant_serialize(const google_api_expr_v1alpha1_Constant *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_Constant_msginit, arena, len);
@@ -740,13 +800,19 @@ UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceI
UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_SourceInfo *ret = google_api_expr_v1alpha1_SourceInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_SourceInfo *google_api_expr_v1alpha1_SourceInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_SourceInfo *ret = google_api_expr_v1alpha1_SourceInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourceInfo_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_SourceInfo_serialize(const google_api_expr_v1alpha1_SourceInfo *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, arena, len);
@@ -832,13 +898,19 @@ UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_Sou
UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_expr_v1alpha1_SourcePosition *ret = google_api_expr_v1alpha1_SourcePosition_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_expr_v1alpha1_SourcePosition *google_api_expr_v1alpha1_SourcePosition_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_expr_v1alpha1_SourcePosition *ret = google_api_expr_v1alpha1_SourcePosition_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_SourcePosition_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_SourcePosition_serialize(const google_api_expr_v1alpha1_SourcePosition *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, arena, len);
@@ -862,6 +934,8 @@ UPB_INLINE void google_api_expr_v1alpha1_SourcePosition_set_column(google_api_ex
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_msglayout_file google_api_expr_v1alpha1_syntax_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c
new file mode 100644
index 00000000000..1a2469510cf
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c
@@ -0,0 +1,115 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/value.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "google/api/expr/v1alpha1/value.upb.h"
+#include "google/protobuf/any.upb.h"
+#include "google/protobuf/struct.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_Value_submsgs[4] = {
+ {.submsg = &google_api_expr_v1alpha1_EnumValue_msginit},
+ {.submsg = &google_api_expr_v1alpha1_ListValue_msginit},
+ {.submsg = &google_api_expr_v1alpha1_MapValue_msginit},
+ {.submsg = &google_protobuf_Any_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_Value__fields[12] = {
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_Value_msginit = {
+ &google_api_expr_v1alpha1_Value_submsgs[0],
+ &google_api_expr_v1alpha1_Value__fields[0],
+ UPB_SIZE(16, 32), 12, _UPB_MSGEXT_NONE, 7, 255,
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_EnumValue__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_EnumValue_msginit = {
+ NULL,
+ &google_api_expr_v1alpha1_EnumValue__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_ListValue_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Value_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_ListValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_ListValue_msginit = {
+ &google_api_expr_v1alpha1_ListValue_submsgs[0],
+ &google_api_expr_v1alpha1_ListValue__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_MapValue_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_MapValue_Entry_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_MapValue__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_MapValue_msginit = {
+ &google_api_expr_v1alpha1_MapValue_submsgs[0],
+ &google_api_expr_v1alpha1_MapValue__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_sub google_api_expr_v1alpha1_MapValue_Entry_submsgs[1] = {
+ {.submsg = &google_api_expr_v1alpha1_Value_msginit},
+};
+
+static const upb_msglayout_field google_api_expr_v1alpha1_MapValue_Entry__fields[2] = {
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout google_api_expr_v1alpha1_MapValue_Entry_msginit = {
+ &google_api_expr_v1alpha1_MapValue_Entry_submsgs[0],
+ &google_api_expr_v1alpha1_MapValue_Entry__fields[0],
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[5] = {
+ &google_api_expr_v1alpha1_Value_msginit,
+ &google_api_expr_v1alpha1_EnumValue_msginit,
+ &google_api_expr_v1alpha1_ListValue_msginit,
+ &google_api_expr_v1alpha1_MapValue_msginit,
+ &google_api_expr_v1alpha1_MapValue_Entry_msginit,
+};
+
+const upb_msglayout_file google_api_expr_v1alpha1_value_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 5,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h
new file mode 100644
index 00000000000..994e37654a4
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.h
@@ -0,0 +1,371 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * google/api/expr/v1alpha1/value.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_
+#define GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct google_api_expr_v1alpha1_Value;
+struct google_api_expr_v1alpha1_EnumValue;
+struct google_api_expr_v1alpha1_ListValue;
+struct google_api_expr_v1alpha1_MapValue;
+struct google_api_expr_v1alpha1_MapValue_Entry;
+typedef struct google_api_expr_v1alpha1_Value google_api_expr_v1alpha1_Value;
+typedef struct google_api_expr_v1alpha1_EnumValue google_api_expr_v1alpha1_EnumValue;
+typedef struct google_api_expr_v1alpha1_ListValue google_api_expr_v1alpha1_ListValue;
+typedef struct google_api_expr_v1alpha1_MapValue google_api_expr_v1alpha1_MapValue;
+typedef struct google_api_expr_v1alpha1_MapValue_Entry google_api_expr_v1alpha1_MapValue_Entry;
+extern const upb_msglayout google_api_expr_v1alpha1_Value_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_EnumValue_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_ListValue_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_MapValue_msginit;
+extern const upb_msglayout google_api_expr_v1alpha1_MapValue_Entry_msginit;
+struct google_protobuf_Any;
+extern const upb_msglayout google_protobuf_Any_msginit;
+
+
+/* google.api.expr.v1alpha1.Value */
+
+UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Value *)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Value *ret = google_api_expr_v1alpha1_Value_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Value_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_Value *ret = google_api_expr_v1alpha1_Value_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_Value_serialize(const google_api_expr_v1alpha1_Value *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_Value_msginit, arena, len);
+}
+
+typedef enum {
+ google_api_expr_v1alpha1_Value_kind_null_value = 1,
+ google_api_expr_v1alpha1_Value_kind_bool_value = 2,
+ google_api_expr_v1alpha1_Value_kind_int64_value = 3,
+ google_api_expr_v1alpha1_Value_kind_uint64_value = 4,
+ google_api_expr_v1alpha1_Value_kind_double_value = 5,
+ google_api_expr_v1alpha1_Value_kind_string_value = 6,
+ google_api_expr_v1alpha1_Value_kind_bytes_value = 7,
+ google_api_expr_v1alpha1_Value_kind_enum_value = 9,
+ google_api_expr_v1alpha1_Value_kind_object_value = 10,
+ google_api_expr_v1alpha1_Value_kind_map_value = 11,
+ google_api_expr_v1alpha1_Value_kind_list_value = 12,
+ google_api_expr_v1alpha1_Value_kind_type_value = 15,
+ google_api_expr_v1alpha1_Value_kind_NOT_SET = 0
+} google_api_expr_v1alpha1_Value_kind_oneofcases;
+UPB_INLINE google_api_expr_v1alpha1_Value_kind_oneofcases google_api_expr_v1alpha1_Value_kind_case(const google_api_expr_v1alpha1_Value* msg) { return (google_api_expr_v1alpha1_Value_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
+
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_null_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
+UPB_INLINE int32_t google_api_expr_v1alpha1_Value_null_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_bool_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_bool_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, false); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_int64_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
+UPB_INLINE int64_t google_api_expr_v1alpha1_Value_int64_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_uint64_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
+UPB_INLINE uint64_t google_api_expr_v1alpha1_Value_uint64_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_double_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
+UPB_INLINE double google_api_expr_v1alpha1_Value_double_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_string_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_string_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_bytes_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_bytes_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, upb_strview_make("", strlen(""))); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_enum_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
+UPB_INLINE const google_api_expr_v1alpha1_EnumValue* google_api_expr_v1alpha1_Value_enum_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_EnumValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_object_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 10; }
+UPB_INLINE const struct google_protobuf_Any* google_api_expr_v1alpha1_Value_object_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 10, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_map_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 11; }
+UPB_INLINE const google_api_expr_v1alpha1_MapValue* google_api_expr_v1alpha1_Value_map_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_MapValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 11, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_list_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 12; }
+UPB_INLINE const google_api_expr_v1alpha1_ListValue* google_api_expr_v1alpha1_Value_list_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_ListValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 12, NULL); }
+UPB_INLINE bool google_api_expr_v1alpha1_Value_has_type_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 15; }
+UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_type_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 15, upb_strview_make("", strlen(""))); }
+
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_null_value(google_api_expr_v1alpha1_Value *msg, int32_t value) {
+ UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_bool_value(google_api_expr_v1alpha1_Value *msg, bool value) {
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_int64_value(google_api_expr_v1alpha1_Value *msg, int64_t value) {
+ UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_uint64_value(google_api_expr_v1alpha1_Value *msg, uint64_t value) {
+ UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_double_value(google_api_expr_v1alpha1_Value *msg, double value) {
+ UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_string_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_bytes_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_enum_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_EnumValue* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_EnumValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_EnumValue* google_api_expr_v1alpha1_Value_mutable_enum_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_EnumValue* sub = (struct google_api_expr_v1alpha1_EnumValue*)google_api_expr_v1alpha1_Value_enum_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_EnumValue*)_upb_msg_new(&google_api_expr_v1alpha1_EnumValue_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Value_set_enum_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_object_value(google_api_expr_v1alpha1_Value *msg, struct google_protobuf_Any* value) {
+ UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 10);
+}
+UPB_INLINE struct google_protobuf_Any* google_api_expr_v1alpha1_Value_mutable_object_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
+ struct google_protobuf_Any* sub = (struct google_protobuf_Any*)google_api_expr_v1alpha1_Value_object_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Value_set_object_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_map_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_MapValue* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_MapValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 11);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_MapValue* google_api_expr_v1alpha1_Value_mutable_map_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_MapValue* sub = (struct google_api_expr_v1alpha1_MapValue*)google_api_expr_v1alpha1_Value_map_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_MapValue*)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Value_set_map_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_list_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_ListValue* value) {
+ UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_ListValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 12);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_ListValue* google_api_expr_v1alpha1_Value_mutable_list_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_ListValue* sub = (struct google_api_expr_v1alpha1_ListValue*)google_api_expr_v1alpha1_Value_list_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_ListValue*)_upb_msg_new(&google_api_expr_v1alpha1_ListValue_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_Value_set_list_value(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_Value_set_type_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
+ UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 15);
+}
+
+/* google.api.expr.v1alpha1.EnumValue */
+
+UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_EnumValue *)_upb_msg_new(&google_api_expr_v1alpha1_EnumValue_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EnumValue *ret = google_api_expr_v1alpha1_EnumValue_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EnumValue_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_EnumValue *ret = google_api_expr_v1alpha1_EnumValue_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EnumValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_EnumValue_serialize(const google_api_expr_v1alpha1_EnumValue *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_EnumValue_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview google_api_expr_v1alpha1_EnumValue_type(const google_api_expr_v1alpha1_EnumValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE int32_t google_api_expr_v1alpha1_EnumValue_value(const google_api_expr_v1alpha1_EnumValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void google_api_expr_v1alpha1_EnumValue_set_type(google_api_expr_v1alpha1_EnumValue *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void google_api_expr_v1alpha1_EnumValue_set_value(google_api_expr_v1alpha1_EnumValue *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+/* google.api.expr.v1alpha1.ListValue */
+
+UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_ListValue *)_upb_msg_new(&google_api_expr_v1alpha1_ListValue_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ListValue *ret = google_api_expr_v1alpha1_ListValue_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ListValue_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_ListValue *ret = google_api_expr_v1alpha1_ListValue_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ListValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_ListValue_serialize(const google_api_expr_v1alpha1_ListValue *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_ListValue_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_ListValue_has_values(const google_api_expr_v1alpha1_ListValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_Value* const* google_api_expr_v1alpha1_ListValue_values(const google_api_expr_v1alpha1_ListValue *msg, size_t *len) { return (const google_api_expr_v1alpha1_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_ListValue_mutable_values(google_api_expr_v1alpha1_ListValue *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_ListValue_resize_values(google_api_expr_v1alpha1_ListValue *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_Value**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_ListValue_add_values(google_api_expr_v1alpha1_ListValue *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.MapValue */
+
+UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_MapValue *)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_MapValue *ret = google_api_expr_v1alpha1_MapValue_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_MapValue *ret = google_api_expr_v1alpha1_MapValue_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_MapValue_serialize(const google_api_expr_v1alpha1_MapValue *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_MapValue_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_MapValue_has_entries(const google_api_expr_v1alpha1_MapValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
+UPB_INLINE const google_api_expr_v1alpha1_MapValue_Entry* const* google_api_expr_v1alpha1_MapValue_entries(const google_api_expr_v1alpha1_MapValue *msg, size_t *len) { return (const google_api_expr_v1alpha1_MapValue_Entry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
+
+UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry** google_api_expr_v1alpha1_MapValue_mutable_entries(google_api_expr_v1alpha1_MapValue *msg, size_t *len) {
+ return (google_api_expr_v1alpha1_MapValue_Entry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
+}
+UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry** google_api_expr_v1alpha1_MapValue_resize_entries(google_api_expr_v1alpha1_MapValue *msg, size_t len, upb_arena *arena) {
+ return (google_api_expr_v1alpha1_MapValue_Entry**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
+}
+UPB_INLINE struct google_api_expr_v1alpha1_MapValue_Entry* google_api_expr_v1alpha1_MapValue_add_entries(google_api_expr_v1alpha1_MapValue *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_MapValue_Entry* sub = (struct google_api_expr_v1alpha1_MapValue_Entry*)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_Entry_msginit, arena);
+ bool ok = _upb_array_append_accessor2(
+ msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
+ if (!ok) return NULL;
+ return sub;
+}
+
+/* google.api.expr.v1alpha1.MapValue.Entry */
+
+UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_new(upb_arena *arena) {
+ return (google_api_expr_v1alpha1_MapValue_Entry *)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_Entry_msginit, arena);
+}
+UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_MapValue_Entry *ret = google_api_expr_v1alpha1_MapValue_Entry_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_Entry_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ google_api_expr_v1alpha1_MapValue_Entry *ret = google_api_expr_v1alpha1_MapValue_Entry_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_Entry_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *google_api_expr_v1alpha1_MapValue_Entry_serialize(const google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &google_api_expr_v1alpha1_MapValue_Entry_msginit, arena, len);
+}
+
+UPB_INLINE bool google_api_expr_v1alpha1_MapValue_Entry_has_key(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_key(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Value*); }
+UPB_INLINE bool google_api_expr_v1alpha1_MapValue_Entry_has_value(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return _upb_hasbit(msg, 2); }
+UPB_INLINE const google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_value(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Value*); }
+
+UPB_INLINE void google_api_expr_v1alpha1_MapValue_Entry_set_key(google_api_expr_v1alpha1_MapValue_Entry *msg, google_api_expr_v1alpha1_Value* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Value*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_mutable_key(google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)google_api_expr_v1alpha1_MapValue_Entry_key(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_MapValue_Entry_set_key(msg, sub);
+ }
+ return sub;
+}
+UPB_INLINE void google_api_expr_v1alpha1_MapValue_Entry_set_value(google_api_expr_v1alpha1_MapValue_Entry *msg, google_api_expr_v1alpha1_Value* value) {
+ _upb_sethas(msg, 2);
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Value*) = value;
+}
+UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_mutable_value(google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena) {
+ struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)google_api_expr_v1alpha1_MapValue_Entry_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
+ if (!sub) return NULL;
+ google_api_expr_v1alpha1_MapValue_Entry_set_value(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file google_api_expr_v1alpha1_value_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c
index f17613acb98..3b79662d7a4 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.c
@@ -7,59 +7,72 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/api/http.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_api_Http_submsgs[1] = {
- &google_api_HttpRule_msginit,
+static const upb_msglayout_sub google_api_Http_submsgs[1] = {
+ {.submsg = &google_api_HttpRule_msginit},
};
static const upb_msglayout_field google_api_Http__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 11, 3},
- {2, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_Http_msginit = {
&google_api_Http_submsgs[0],
&google_api_Http__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_api_HttpRule_submsgs[2] = {
- &google_api_CustomHttpPattern_msginit,
- &google_api_HttpRule_msginit,
+static const upb_msglayout_sub google_api_HttpRule_submsgs[2] = {
+ {.submsg = &google_api_CustomHttpPattern_msginit},
+ {.submsg = &google_api_HttpRule_msginit},
};
static const upb_msglayout_field google_api_HttpRule__fields[10] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {3, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {4, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {5, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {6, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, 1},
- {7, UPB_SIZE(8, 16), 0, 0, 9, 1},
- {8, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 11, 1},
- {11, UPB_SIZE(24, 48), 0, 1, 11, 3},
- {12, UPB_SIZE(16, 32), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 56), UPB_SIZE(-37, -73), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(24, 48), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(16, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_HttpRule_msginit = {
&google_api_HttpRule_submsgs[0],
&google_api_HttpRule__fields[0],
- UPB_SIZE(40, 80), 10, false, 255,
+ UPB_SIZE(40, 80), 10, _UPB_MSGEXT_NONE, 8, 255,
};
static const upb_msglayout_field google_api_CustomHttpPattern__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_api_CustomHttpPattern_msginit = {
NULL,
&google_api_CustomHttpPattern__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &google_api_Http_msginit,
+ &google_api_HttpRule_msginit,
+ &google_api_CustomHttpPattern_msginit,
+};
+
+const upb_msglayout_file google_api_http_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
index ed4e6d10dce..163fb713467 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/api/http.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_API_HTTP_PROTO_UPB_H_
#define GOOGLE_API_HTTP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -39,13 +39,19 @@ UPB_INLINE google_api_Http *google_api_Http_new(upb_arena *arena) {
UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_Http *ret = google_api_Http_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_Http *google_api_Http_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_Http *ret = google_api_Http_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_Http_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_Http_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_Http_msginit, arena, len);
@@ -80,13 +86,19 @@ UPB_INLINE google_api_HttpRule *google_api_HttpRule_new(upb_arena *arena) {
UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_HttpRule *ret = google_api_HttpRule_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_HttpRule *ret = google_api_HttpRule_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_HttpRule_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_HttpRule_msginit, arena, len);
@@ -179,13 +191,19 @@ UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_new(upb_ar
UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
upb_arena *arena) {
google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
@@ -201,6 +219,8 @@ UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPatte
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
}
+extern const upb_msglayout_file google_api_http_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
index 93eaa603e32..0a314de3268 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
@@ -7,20 +7,31 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/any.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field google_protobuf_Any__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 12, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Any_msginit = {
NULL,
&google_protobuf_Any__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &google_protobuf_Any_msginit,
+};
+
+const upb_msglayout_file google_protobuf_any_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
index 2bd44f76852..9ac65c5c4d9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_ANY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE google_protobuf_Any *google_protobuf_Any_new(upb_arena *arena) {
UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Any *ret = google_protobuf_Any_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Any *google_protobuf_Any_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Any *ret = google_protobuf_Any_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Any_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Any_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Any_serialize(const google_protobuf_Any *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Any_msginit, arena, len);
@@ -55,6 +61,8 @@ UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_strv
*UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
}
+extern const upb_msglayout_file google_protobuf_any_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
index 339fafac090..fc0e4698199 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c
@@ -7,479 +7,516 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_protobuf_FileDescriptorSet_submsgs[1] = {
- &google_protobuf_FileDescriptorProto_msginit,
+static const upb_msglayout_sub google_protobuf_FileDescriptorSet_submsgs[1] = {
+ {.submsg = &google_protobuf_FileDescriptorProto_msginit},
};
static const upb_msglayout_field google_protobuf_FileDescriptorSet__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FileDescriptorSet_msginit = {
&google_protobuf_FileDescriptorSet_submsgs[0],
&google_protobuf_FileDescriptorSet__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_protobuf_FileDescriptorProto_submsgs[6] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_FileOptions_msginit,
- &google_protobuf_ServiceDescriptorProto_msginit,
- &google_protobuf_SourceCodeInfo_msginit,
+static const upb_msglayout_sub google_protobuf_FileDescriptorProto_submsgs[6] = {
+ {.submsg = &google_protobuf_DescriptorProto_msginit},
+ {.submsg = &google_protobuf_EnumDescriptorProto_msginit},
+ {.submsg = &google_protobuf_FieldDescriptorProto_msginit},
+ {.submsg = &google_protobuf_FileOptions_msginit},
+ {.submsg = &google_protobuf_ServiceDescriptorProto_msginit},
+ {.submsg = &google_protobuf_SourceCodeInfo_msginit},
};
static const upb_msglayout_field google_protobuf_FileDescriptorProto__fields[12] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {3, UPB_SIZE(36, 72), 0, 0, 12, 3},
- {4, UPB_SIZE(40, 80), 0, 0, 11, 3},
- {5, UPB_SIZE(44, 88), 0, 1, 11, 3},
- {6, UPB_SIZE(48, 96), 0, 4, 11, 3},
- {7, UPB_SIZE(52, 104), 0, 2, 11, 3},
- {8, UPB_SIZE(28, 56), 3, 3, 11, 1},
- {9, UPB_SIZE(32, 64), 4, 5, 11, 1},
- {10, UPB_SIZE(56, 112), 0, 0, 5, 3},
- {11, UPB_SIZE(60, 120), 0, 0, 5, 3},
- {12, UPB_SIZE(20, 40), 5, 0, 12, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 2, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(36, 72), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(40, 80), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(44, 88), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(48, 96), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(52, 104), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 56), 3, 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 64), 4, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(56, 112), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(60, 120), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(20, 40), 5, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FileDescriptorProto_msginit = {
&google_protobuf_FileDescriptorProto_submsgs[0],
&google_protobuf_FileDescriptorProto__fields[0],
- UPB_SIZE(64, 128), 12, false, 255,
+ UPB_SIZE(64, 128), 12, _UPB_MSGEXT_NONE, 12, 255,
};
-static const upb_msglayout *const google_protobuf_DescriptorProto_submsgs[7] = {
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_DescriptorProto_ExtensionRange_msginit,
- &google_protobuf_DescriptorProto_ReservedRange_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_MessageOptions_msginit,
- &google_protobuf_OneofDescriptorProto_msginit,
+static const upb_msglayout_sub google_protobuf_DescriptorProto_submsgs[7] = {
+ {.submsg = &google_protobuf_DescriptorProto_msginit},
+ {.submsg = &google_protobuf_DescriptorProto_ExtensionRange_msginit},
+ {.submsg = &google_protobuf_DescriptorProto_ReservedRange_msginit},
+ {.submsg = &google_protobuf_EnumDescriptorProto_msginit},
+ {.submsg = &google_protobuf_FieldDescriptorProto_msginit},
+ {.submsg = &google_protobuf_MessageOptions_msginit},
+ {.submsg = &google_protobuf_OneofDescriptorProto_msginit},
};
static const upb_msglayout_field google_protobuf_DescriptorProto__fields[10] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(16, 32), 0, 4, 11, 3},
- {3, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {4, UPB_SIZE(24, 48), 0, 3, 11, 3},
- {5, UPB_SIZE(28, 56), 0, 1, 11, 3},
- {6, UPB_SIZE(32, 64), 0, 4, 11, 3},
- {7, UPB_SIZE(12, 24), 2, 5, 11, 1},
- {8, UPB_SIZE(36, 72), 0, 6, 11, 3},
- {9, UPB_SIZE(40, 80), 0, 2, 11, 3},
- {10, UPB_SIZE(44, 88), 0, 0, 12, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 48), 0, 3, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(32, 64), 0, 4, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(12, 24), 2, 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(36, 72), 0, 6, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(40, 80), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(44, 88), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_DescriptorProto_msginit = {
&google_protobuf_DescriptorProto_submsgs[0],
&google_protobuf_DescriptorProto__fields[0],
- UPB_SIZE(48, 96), 10, false, 255,
+ UPB_SIZE(48, 96), 10, _UPB_MSGEXT_NONE, 10, 255,
};
-static const upb_msglayout *const google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
- &google_protobuf_ExtensionRangeOptions_msginit,
+static const upb_msglayout_sub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = {
+ {.submsg = &google_protobuf_ExtensionRangeOptions_msginit},
};
static const upb_msglayout_field google_protobuf_DescriptorProto_ExtensionRange__fields[3] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
- {3, UPB_SIZE(12, 16), 3, 0, 11, 1},
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit = {
&google_protobuf_DescriptorProto_ExtensionRange_submsgs[0],
&google_protobuf_DescriptorProto_ExtensionRange__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field google_protobuf_DescriptorProto_ReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit = {
NULL,
&google_protobuf_DescriptorProto_ReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_protobuf_ExtensionRangeOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_ExtensionRangeOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_ExtensionRangeOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {999, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit = {
&google_protobuf_ExtensionRangeOptions_submsgs[0],
&google_protobuf_ExtensionRangeOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_EXTENDABLE, 0, 255,
};
-static const upb_msglayout *const google_protobuf_FieldDescriptorProto_submsgs[1] = {
- &google_protobuf_FieldOptions_msginit,
+static const upb_msglayout_sub google_protobuf_FieldDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_FieldOptions_msginit},
};
static const upb_msglayout_field google_protobuf_FieldDescriptorProto__fields[11] = {
- {1, UPB_SIZE(24, 24), 1, 0, 12, 1},
- {2, UPB_SIZE(32, 40), 2, 0, 12, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 5, 1},
- {4, UPB_SIZE(4, 4), 4, 0, 14, 1},
- {5, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {6, UPB_SIZE(40, 56), 6, 0, 12, 1},
- {7, UPB_SIZE(48, 72), 7, 0, 12, 1},
- {8, UPB_SIZE(64, 104), 8, 0, 11, 1},
- {9, UPB_SIZE(16, 16), 9, 0, 5, 1},
- {10, UPB_SIZE(56, 88), 10, 0, 12, 1},
- {17, UPB_SIZE(20, 20), 11, 0, 8, 1},
+ {1, UPB_SIZE(24, 24), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 40), 2, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 4), 4, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 8), 5, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 56), 6, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(48, 72), 7, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(64, 104), 8, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(16, 16), 9, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(56, 88), 10, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(20, 20), 11, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FieldDescriptorProto_msginit = {
&google_protobuf_FieldDescriptorProto_submsgs[0],
&google_protobuf_FieldDescriptorProto__fields[0],
- UPB_SIZE(72, 112), 11, false, 255,
+ UPB_SIZE(72, 112), 11, _UPB_MSGEXT_NONE, 10, 255,
};
-static const upb_msglayout *const google_protobuf_OneofDescriptorProto_submsgs[1] = {
- &google_protobuf_OneofOptions_msginit,
+static const upb_msglayout_sub google_protobuf_OneofDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_OneofOptions_msginit},
};
static const upb_msglayout_field google_protobuf_OneofDescriptorProto__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_OneofDescriptorProto_msginit = {
&google_protobuf_OneofDescriptorProto_submsgs[0],
&google_protobuf_OneofDescriptorProto__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_protobuf_EnumDescriptorProto_submsgs[3] = {
- &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
- &google_protobuf_EnumOptions_msginit,
- &google_protobuf_EnumValueDescriptorProto_msginit,
+static const upb_msglayout_sub google_protobuf_EnumDescriptorProto_submsgs[3] = {
+ {.submsg = &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit},
+ {.submsg = &google_protobuf_EnumOptions_msginit},
+ {.submsg = &google_protobuf_EnumValueDescriptorProto_msginit},
};
static const upb_msglayout_field google_protobuf_EnumDescriptorProto__fields[5] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(16, 32), 0, 2, 11, 3},
- {3, UPB_SIZE(12, 24), 2, 1, 11, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 11, 3},
- {5, UPB_SIZE(24, 48), 0, 0, 12, 3},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 2, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(24, 48), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_EnumDescriptorProto_msginit = {
&google_protobuf_EnumDescriptorProto_submsgs[0],
&google_protobuf_EnumDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 5, 255,
};
static const upb_msglayout_field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = {
NULL,
&google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
- &google_protobuf_EnumValueOptions_msginit,
+static const upb_msglayout_sub google_protobuf_EnumValueDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_EnumValueOptions_msginit},
};
static const upb_msglayout_field google_protobuf_EnumValueDescriptorProto__fields[3] = {
- {1, UPB_SIZE(8, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {3, UPB_SIZE(16, 24), 3, 0, 11, 1},
+ {1, UPB_SIZE(8, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit = {
&google_protobuf_EnumValueDescriptorProto_submsgs[0],
&google_protobuf_EnumValueDescriptorProto__fields[0],
- UPB_SIZE(24, 32), 3, false, 255,
+ UPB_SIZE(24, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_protobuf_ServiceDescriptorProto_submsgs[2] = {
- &google_protobuf_MethodDescriptorProto_msginit,
- &google_protobuf_ServiceOptions_msginit,
+static const upb_msglayout_sub google_protobuf_ServiceDescriptorProto_submsgs[2] = {
+ {.submsg = &google_protobuf_MethodDescriptorProto_msginit},
+ {.submsg = &google_protobuf_ServiceOptions_msginit},
};
static const upb_msglayout_field google_protobuf_ServiceDescriptorProto__fields[3] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(16, 32), 0, 0, 11, 3},
- {3, UPB_SIZE(12, 24), 2, 1, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 32), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit = {
&google_protobuf_ServiceDescriptorProto_submsgs[0],
&google_protobuf_ServiceDescriptorProto__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const google_protobuf_MethodDescriptorProto_submsgs[1] = {
- &google_protobuf_MethodOptions_msginit,
+static const upb_msglayout_sub google_protobuf_MethodDescriptorProto_submsgs[1] = {
+ {.submsg = &google_protobuf_MethodOptions_msginit},
};
static const upb_msglayout_field google_protobuf_MethodDescriptorProto__fields[6] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {2, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {3, UPB_SIZE(20, 40), 3, 0, 12, 1},
- {4, UPB_SIZE(28, 56), 4, 0, 11, 1},
- {5, UPB_SIZE(1, 1), 5, 0, 8, 1},
- {6, UPB_SIZE(2, 2), 6, 0, 8, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 2, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 3, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(1, 1), 5, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(2, 2), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_MethodDescriptorProto_msginit = {
&google_protobuf_MethodDescriptorProto_submsgs[0],
&google_protobuf_MethodDescriptorProto__fields[0],
- UPB_SIZE(32, 64), 6, false, 255,
+ UPB_SIZE(32, 64), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const google_protobuf_FileOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_FileOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_FileOptions__fields[21] = {
- {1, UPB_SIZE(20, 24), 1, 0, 12, 1},
- {8, UPB_SIZE(28, 40), 2, 0, 12, 1},
- {9, UPB_SIZE(4, 4), 3, 0, 14, 1},
- {10, UPB_SIZE(8, 8), 4, 0, 8, 1},
- {11, UPB_SIZE(36, 56), 5, 0, 12, 1},
- {16, UPB_SIZE(9, 9), 6, 0, 8, 1},
- {17, UPB_SIZE(10, 10), 7, 0, 8, 1},
- {18, UPB_SIZE(11, 11), 8, 0, 8, 1},
- {20, UPB_SIZE(12, 12), 9, 0, 8, 1},
- {23, UPB_SIZE(13, 13), 10, 0, 8, 1},
- {27, UPB_SIZE(14, 14), 11, 0, 8, 1},
- {31, UPB_SIZE(15, 15), 12, 0, 8, 1},
- {36, UPB_SIZE(44, 72), 13, 0, 12, 1},
- {37, UPB_SIZE(52, 88), 14, 0, 12, 1},
- {39, UPB_SIZE(60, 104), 15, 0, 12, 1},
- {40, UPB_SIZE(68, 120), 16, 0, 12, 1},
- {41, UPB_SIZE(76, 136), 17, 0, 12, 1},
- {42, UPB_SIZE(16, 16), 18, 0, 8, 1},
- {44, UPB_SIZE(84, 152), 19, 0, 12, 1},
- {45, UPB_SIZE(92, 168), 20, 0, 12, 1},
- {999, UPB_SIZE(100, 184), 0, 0, 11, 3},
+ {1, UPB_SIZE(20, 24), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 40), 2, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(4, 4), 3, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(8, 8), 4, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(36, 56), 5, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(9, 9), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(10, 10), 7, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(11, 11), 8, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(12, 12), 9, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(13, 13), 10, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {27, UPB_SIZE(14, 14), 11, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {31, UPB_SIZE(15, 15), 12, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {36, UPB_SIZE(44, 72), 13, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {37, UPB_SIZE(52, 88), 14, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {39, UPB_SIZE(60, 104), 15, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {40, UPB_SIZE(68, 120), 16, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {41, UPB_SIZE(76, 136), 17, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {42, UPB_SIZE(16, 16), 18, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {44, UPB_SIZE(84, 152), 19, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {45, UPB_SIZE(92, 168), 20, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(100, 184), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FileOptions_msginit = {
&google_protobuf_FileOptions_submsgs[0],
&google_protobuf_FileOptions__fields[0],
- UPB_SIZE(104, 192), 21, false, 255,
+ UPB_SIZE(104, 192), 21, _UPB_MSGEXT_EXTENDABLE, 1, 255,
};
-static const upb_msglayout *const google_protobuf_MessageOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_MessageOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_MessageOptions__fields[5] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {3, UPB_SIZE(3, 3), 3, 0, 8, 1},
- {7, UPB_SIZE(4, 4), 4, 0, 8, 1},
- {999, UPB_SIZE(8, 8), 0, 0, 11, 3},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(2, 2), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(3, 3), 3, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 4), 4, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(8, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_MessageOptions_msginit = {
&google_protobuf_MessageOptions_submsgs[0],
&google_protobuf_MessageOptions__fields[0],
- UPB_SIZE(16, 16), 5, false, 255,
+ UPB_SIZE(16, 16), 5, _UPB_MSGEXT_EXTENDABLE, 3, 255,
};
-static const upb_msglayout *const google_protobuf_FieldOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_FieldOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_FieldOptions__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 14, 1},
- {2, UPB_SIZE(12, 12), 2, 0, 8, 1},
- {3, UPB_SIZE(13, 13), 3, 0, 8, 1},
- {5, UPB_SIZE(14, 14), 4, 0, 8, 1},
- {6, UPB_SIZE(8, 8), 5, 0, 14, 1},
- {10, UPB_SIZE(15, 15), 6, 0, 8, 1},
- {999, UPB_SIZE(16, 16), 0, 0, 11, 3},
+ {1, UPB_SIZE(4, 4), 1, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 12), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(13, 13), 3, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(14, 14), 4, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), 5, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(15, 15), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(16, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FieldOptions_msginit = {
&google_protobuf_FieldOptions_submsgs[0],
&google_protobuf_FieldOptions__fields[0],
- UPB_SIZE(24, 24), 7, false, 255,
+ UPB_SIZE(24, 24), 7, _UPB_MSGEXT_EXTENDABLE, 3, 255,
};
-static const upb_msglayout *const google_protobuf_OneofOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_OneofOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_OneofOptions__fields[1] = {
- {999, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {999, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_OneofOptions_msginit = {
&google_protobuf_OneofOptions_submsgs[0],
&google_protobuf_OneofOptions__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_EXTENDABLE, 0, 255,
};
-static const upb_msglayout *const google_protobuf_EnumOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_EnumOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_EnumOptions__fields[3] = {
- {2, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {3, UPB_SIZE(2, 2), 2, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {2, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(2, 2), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_EnumOptions_msginit = {
&google_protobuf_EnumOptions_submsgs[0],
&google_protobuf_EnumOptions__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_EXTENDABLE, 0, 255,
};
-static const upb_msglayout *const google_protobuf_EnumValueOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_EnumValueOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_EnumValueOptions__fields[2] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_EnumValueOptions_msginit = {
&google_protobuf_EnumValueOptions_submsgs[0],
&google_protobuf_EnumValueOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_EXTENDABLE, 1, 255,
};
-static const upb_msglayout *const google_protobuf_ServiceOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_ServiceOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_ServiceOptions__fields[2] = {
- {33, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {999, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {33, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_ServiceOptions_msginit = {
&google_protobuf_ServiceOptions_submsgs[0],
&google_protobuf_ServiceOptions__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_EXTENDABLE, 0, 255,
};
-static const upb_msglayout *const google_protobuf_MethodOptions_submsgs[1] = {
- &google_protobuf_UninterpretedOption_msginit,
+static const upb_msglayout_sub google_protobuf_MethodOptions_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_msginit},
};
static const upb_msglayout_field google_protobuf_MethodOptions__fields[3] = {
- {33, UPB_SIZE(8, 8), 1, 0, 8, 1},
- {34, UPB_SIZE(4, 4), 2, 0, 14, 1},
- {999, UPB_SIZE(12, 16), 0, 0, 11, 3},
+ {33, UPB_SIZE(8, 8), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {34, UPB_SIZE(4, 4), 2, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {999, UPB_SIZE(12, 16), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_MethodOptions_msginit = {
&google_protobuf_MethodOptions_submsgs[0],
&google_protobuf_MethodOptions__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_EXTENDABLE, 0, 255,
};
-static const upb_msglayout *const google_protobuf_UninterpretedOption_submsgs[1] = {
- &google_protobuf_UninterpretedOption_NamePart_msginit,
+static const upb_msglayout_sub google_protobuf_UninterpretedOption_submsgs[1] = {
+ {.submsg = &google_protobuf_UninterpretedOption_NamePart_msginit},
};
static const upb_msglayout_field google_protobuf_UninterpretedOption__fields[7] = {
- {2, UPB_SIZE(56, 80), 0, 0, 11, 3},
- {3, UPB_SIZE(32, 32), 1, 0, 12, 1},
- {4, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {5, UPB_SIZE(16, 16), 3, 0, 3, 1},
- {6, UPB_SIZE(24, 24), 4, 0, 1, 1},
- {7, UPB_SIZE(40, 48), 5, 0, 12, 1},
- {8, UPB_SIZE(48, 64), 6, 0, 12, 1},
+ {2, UPB_SIZE(56, 80), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(32, 32), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 16), 3, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 24), 4, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(40, 48), 5, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 64), 6, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_UninterpretedOption_msginit = {
&google_protobuf_UninterpretedOption_submsgs[0],
&google_protobuf_UninterpretedOption__fields[0],
- UPB_SIZE(64, 96), 7, false, 255,
+ UPB_SIZE(64, 96), 7, _UPB_MSGEXT_NONE, 0, 255,
};
static const upb_msglayout_field google_protobuf_UninterpretedOption_NamePart__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 12, 2},
- {2, UPB_SIZE(1, 1), 2, 0, 8, 2},
+ {1, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit = {
NULL,
&google_protobuf_UninterpretedOption_NamePart__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_protobuf_SourceCodeInfo_submsgs[1] = {
- &google_protobuf_SourceCodeInfo_Location_msginit,
+static const upb_msglayout_sub google_protobuf_SourceCodeInfo_submsgs[1] = {
+ {.submsg = &google_protobuf_SourceCodeInfo_Location_msginit},
};
static const upb_msglayout_field google_protobuf_SourceCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_SourceCodeInfo_msginit = {
&google_protobuf_SourceCodeInfo_submsgs[0],
&google_protobuf_SourceCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_SourceCodeInfo_Location__fields[5] = {
- {1, UPB_SIZE(20, 40), 0, 0, 5, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(24, 48), 0, 0, 5, _UPB_LABEL_PACKED},
- {3, UPB_SIZE(4, 8), 1, 0, 12, 1},
- {4, UPB_SIZE(12, 24), 2, 0, 12, 1},
- {6, UPB_SIZE(28, 56), 0, 0, 12, 3},
+ {1, UPB_SIZE(20, 40), 0, 0, 5, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(24, 48), 0, 0, 5, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 8), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 2, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 56), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit = {
NULL,
&google_protobuf_SourceCodeInfo_Location__fields[0],
- UPB_SIZE(32, 64), 5, false, 255,
+ UPB_SIZE(32, 64), 5, _UPB_MSGEXT_NONE, 4, 255,
};
-static const upb_msglayout *const google_protobuf_GeneratedCodeInfo_submsgs[1] = {
- &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
+static const upb_msglayout_sub google_protobuf_GeneratedCodeInfo_submsgs[1] = {
+ {.submsg = &google_protobuf_GeneratedCodeInfo_Annotation_msginit},
};
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit = {
&google_protobuf_GeneratedCodeInfo_submsgs[0],
&google_protobuf_GeneratedCodeInfo__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = {
- {1, UPB_SIZE(20, 32), 0, 0, 5, _UPB_LABEL_PACKED},
- {2, UPB_SIZE(12, 16), 1, 0, 12, 1},
- {3, UPB_SIZE(4, 4), 2, 0, 5, 1},
- {4, UPB_SIZE(8, 8), 3, 0, 5, 1},
+ {1, UPB_SIZE(20, 32), 0, 0, 5, _UPB_MODE_ARRAY | _UPB_MODE_IS_PACKED | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 16), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 4), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 8), 3, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit = {
NULL,
&google_protobuf_GeneratedCodeInfo_Annotation__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[27] = {
+ &google_protobuf_FileDescriptorSet_msginit,
+ &google_protobuf_FileDescriptorProto_msginit,
+ &google_protobuf_DescriptorProto_msginit,
+ &google_protobuf_DescriptorProto_ExtensionRange_msginit,
+ &google_protobuf_DescriptorProto_ReservedRange_msginit,
+ &google_protobuf_ExtensionRangeOptions_msginit,
+ &google_protobuf_FieldDescriptorProto_msginit,
+ &google_protobuf_OneofDescriptorProto_msginit,
+ &google_protobuf_EnumDescriptorProto_msginit,
+ &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
+ &google_protobuf_EnumValueDescriptorProto_msginit,
+ &google_protobuf_ServiceDescriptorProto_msginit,
+ &google_protobuf_MethodDescriptorProto_msginit,
+ &google_protobuf_FileOptions_msginit,
+ &google_protobuf_MessageOptions_msginit,
+ &google_protobuf_FieldOptions_msginit,
+ &google_protobuf_OneofOptions_msginit,
+ &google_protobuf_EnumOptions_msginit,
+ &google_protobuf_EnumValueOptions_msginit,
+ &google_protobuf_ServiceOptions_msginit,
+ &google_protobuf_MethodOptions_msginit,
+ &google_protobuf_UninterpretedOption_msginit,
+ &google_protobuf_UninterpretedOption_NamePart_msginit,
+ &google_protobuf_SourceCodeInfo_msginit,
+ &google_protobuf_SourceCodeInfo_Location_msginit,
+ &google_protobuf_GeneratedCodeInfo_msginit,
+ &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
+};
+
+const upb_msglayout_file google_protobuf_descriptor_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 27,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
index a8ed71a688c..2416bc1060b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -162,13 +162,19 @@ UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FileDescriptorSet *google_protobuf_FileDescriptorSet_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FileDescriptorSet *ret = google_protobuf_FileDescriptorSet_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FileDescriptorSet_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FileDescriptorSet_serialize(const google_protobuf_FileDescriptorSet *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FileDescriptorSet_msginit, arena, len);
@@ -199,13 +205,19 @@ UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorPr
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FileDescriptorProto *google_protobuf_FileDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FileDescriptorProto *ret = google_protobuf_FileDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FileDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FileDescriptorProto_serialize(const google_protobuf_FileDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FileDescriptorProto_msginit, arena, len);
@@ -362,13 +374,19 @@ UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_new(
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_DescriptorProto *google_protobuf_DescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_DescriptorProto *ret = google_protobuf_DescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_DescriptorProto_serialize(const google_protobuf_DescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_DescriptorProto_msginit, arena, len);
@@ -521,13 +539,19 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_Descr
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange *google_protobuf_DescriptorProto_ExtensionRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_DescriptorProto_ExtensionRange *ret = google_protobuf_DescriptorProto_ExtensionRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ExtensionRange_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_DescriptorProto_ExtensionRange_serialize(const google_protobuf_DescriptorProto_ExtensionRange *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, arena, len);
@@ -570,13 +594,19 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_Descri
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_DescriptorProto_ReservedRange *google_protobuf_DescriptorProto_ReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_DescriptorProto_ReservedRange *ret = google_protobuf_DescriptorProto_ReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_DescriptorProto_ReservedRange_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_DescriptorProto_ReservedRange_serialize(const google_protobuf_DescriptorProto_ReservedRange *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, arena, len);
@@ -604,13 +634,19 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRange
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_ExtensionRangeOptions *google_protobuf_ExtensionRangeOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_ExtensionRangeOptions *ret = google_protobuf_ExtensionRangeOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_ExtensionRangeOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_ExtensionRangeOptions_serialize(const google_protobuf_ExtensionRangeOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, arena, len);
@@ -641,13 +677,19 @@ UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptor
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FieldDescriptorProto *google_protobuf_FieldDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FieldDescriptorProto *ret = google_protobuf_FieldDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FieldDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FieldDescriptorProto_serialize(const google_protobuf_FieldDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FieldDescriptorProto_msginit, arena, len);
@@ -738,13 +780,19 @@ UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptor
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_OneofDescriptorProto *google_protobuf_OneofDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_OneofDescriptorProto *ret = google_protobuf_OneofDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_OneofDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_OneofDescriptorProto_serialize(const google_protobuf_OneofDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_OneofDescriptorProto_msginit, arena, len);
@@ -781,13 +829,19 @@ UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorPr
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_EnumDescriptorProto *google_protobuf_EnumDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_EnumDescriptorProto *ret = google_protobuf_EnumDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_EnumDescriptorProto_serialize(const google_protobuf_EnumDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_EnumDescriptorProto_msginit, arena, len);
@@ -865,13 +919,19 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobu
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange *google_protobuf_EnumDescriptorProto_EnumReservedRange_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_EnumDescriptorProto_EnumReservedRange *ret = google_protobuf_EnumDescriptorProto_EnumReservedRange_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_EnumDescriptorProto_EnumReservedRange_serialize(const google_protobuf_EnumDescriptorProto_EnumReservedRange *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, arena, len);
@@ -899,13 +959,19 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDe
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_EnumValueDescriptorProto *google_protobuf_EnumValueDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_EnumValueDescriptorProto *ret = google_protobuf_EnumValueDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_EnumValueDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_EnumValueDescriptorProto_serialize(const google_protobuf_EnumValueDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, arena, len);
@@ -948,13 +1014,19 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescri
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_ServiceDescriptorProto *google_protobuf_ServiceDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_ServiceDescriptorProto *ret = google_protobuf_ServiceDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_ServiceDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_ServiceDescriptorProto_serialize(const google_protobuf_ServiceDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, arena, len);
@@ -1006,13 +1078,19 @@ UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescript
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_MethodDescriptorProto *google_protobuf_MethodDescriptorProto_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_MethodDescriptorProto *ret = google_protobuf_MethodDescriptorProto_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_MethodDescriptorProto_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_MethodDescriptorProto_serialize(const google_protobuf_MethodDescriptorProto *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_MethodDescriptorProto_msginit, arena, len);
@@ -1073,13 +1151,19 @@ UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_new(upb_aren
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FileOptions *google_protobuf_FileOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FileOptions *ret = google_protobuf_FileOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FileOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FileOptions_serialize(const google_protobuf_FileOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FileOptions_msginit, arena, len);
@@ -1230,13 +1314,19 @@ UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_new(up
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_MessageOptions *google_protobuf_MessageOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_MessageOptions *ret = google_protobuf_MessageOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_MessageOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_MessageOptions_serialize(const google_protobuf_MessageOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_MessageOptions_msginit, arena, len);
@@ -1291,13 +1381,19 @@ UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_new(upb_ar
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FieldOptions *google_protobuf_FieldOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FieldOptions *ret = google_protobuf_FieldOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FieldOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FieldOptions_serialize(const google_protobuf_FieldOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FieldOptions_msginit, arena, len);
@@ -1364,13 +1460,19 @@ UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_new(upb_ar
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_OneofOptions *google_protobuf_OneofOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_OneofOptions *ret = google_protobuf_OneofOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_OneofOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_OneofOptions_serialize(const google_protobuf_OneofOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_OneofOptions_msginit, arena, len);
@@ -1401,13 +1503,19 @@ UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_new(upb_aren
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_EnumOptions *google_protobuf_EnumOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_EnumOptions *ret = google_protobuf_EnumOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_EnumOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_EnumOptions_serialize(const google_protobuf_EnumOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_EnumOptions_msginit, arena, len);
@@ -1450,13 +1558,19 @@ UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_ne
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_EnumValueOptions *google_protobuf_EnumValueOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_EnumValueOptions *ret = google_protobuf_EnumValueOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_EnumValueOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_EnumValueOptions_serialize(const google_protobuf_EnumValueOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_EnumValueOptions_msginit, arena, len);
@@ -1493,13 +1607,19 @@ UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_new(up
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_ServiceOptions *google_protobuf_ServiceOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_ServiceOptions *ret = google_protobuf_ServiceOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_ServiceOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_ServiceOptions_serialize(const google_protobuf_ServiceOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_ServiceOptions_msginit, arena, len);
@@ -1536,13 +1656,19 @@ UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_new(upb_
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_MethodOptions *google_protobuf_MethodOptions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_MethodOptions *ret = google_protobuf_MethodOptions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_MethodOptions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_MethodOptions_serialize(const google_protobuf_MethodOptions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_MethodOptions_msginit, arena, len);
@@ -1585,13 +1711,19 @@ UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOpt
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_UninterpretedOption *google_protobuf_UninterpretedOption_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_UninterpretedOption *ret = google_protobuf_UninterpretedOption_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_UninterpretedOption_serialize(const google_protobuf_UninterpretedOption *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_UninterpretedOption_msginit, arena, len);
@@ -1658,13 +1790,19 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_Uninter
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_UninterpretedOption_NamePart *google_protobuf_UninterpretedOption_NamePart_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_UninterpretedOption_NamePart *ret = google_protobuf_UninterpretedOption_NamePart_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_UninterpretedOption_NamePart_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_UninterpretedOption_NamePart_serialize(const google_protobuf_UninterpretedOption_NamePart *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, arena, len);
@@ -1692,13 +1830,19 @@ UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_new(up
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_SourceCodeInfo *google_protobuf_SourceCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_SourceCodeInfo *ret = google_protobuf_SourceCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_SourceCodeInfo_serialize(const google_protobuf_SourceCodeInfo *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_SourceCodeInfo_msginit, arena, len);
@@ -1729,13 +1873,19 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeIn
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_SourceCodeInfo_Location *google_protobuf_SourceCodeInfo_Location_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_SourceCodeInfo_Location *ret = google_protobuf_SourceCodeInfo_Location_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_SourceCodeInfo_Location_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_SourceCodeInfo_Location_serialize(const google_protobuf_SourceCodeInfo_Location *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, arena, len);
@@ -1796,13 +1946,19 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_GeneratedCodeInfo *google_protobuf_GeneratedCodeInfo_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_GeneratedCodeInfo *ret = google_protobuf_GeneratedCodeInfo_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_GeneratedCodeInfo_serialize(const google_protobuf_GeneratedCodeInfo *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, arena, len);
@@ -1833,13 +1989,19 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_Generat
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation *google_protobuf_GeneratedCodeInfo_Annotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_GeneratedCodeInfo_Annotation *ret = google_protobuf_GeneratedCodeInfo_Annotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_GeneratedCodeInfo_Annotation_serialize(const google_protobuf_GeneratedCodeInfo_Annotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, arena, len);
@@ -1876,6 +2038,8 @@ UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_set_end(google_prot
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_msglayout_file google_protobuf_descriptor_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
index 03d463a05ee..8c06eed89d8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.c
@@ -7,20 +7,31 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/duration.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field google_protobuf_Duration__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 5, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Duration_msginit = {
NULL,
&google_protobuf_Duration__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &google_protobuf_Duration_msginit,
+};
+
+const upb_msglayout_file google_protobuf_duration_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
index 4692fd70be9..d89957e0284 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/duration.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_DURATION_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_new(upb_arena *are
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Duration *ret = google_protobuf_Duration_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Duration *google_protobuf_Duration_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Duration *ret = google_protobuf_Duration_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Duration_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Duration_serialize(const google_protobuf_Duration *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Duration_msginit, arena, len);
@@ -55,6 +61,8 @@ UPB_INLINE void google_protobuf_Duration_set_nanos(google_protobuf_Duration *msg
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_msglayout_file google_protobuf_duration_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
index f634b2bed69..9dac89dbcb5 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/empty.upb.h"
#include "upb/port_def.inc"
@@ -15,7 +15,18 @@
const upb_msglayout google_protobuf_Empty_msginit = {
NULL,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &google_protobuf_Empty_msginit,
+};
+
+const upb_msglayout_file google_protobuf_empty_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
index 9202b832e19..6a0a46051c3 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/empty.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_EMPTY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_new(upb_arena *arena) {
UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Empty *ret = google_protobuf_Empty_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Empty *google_protobuf_Empty_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Empty *ret = google_protobuf_Empty_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Empty_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Empty_serialize(const google_protobuf_Empty *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Empty_msginit, arena, len);
@@ -47,6 +53,8 @@ UPB_INLINE char *google_protobuf_Empty_serialize(const google_protobuf_Empty *ms
+extern const upb_msglayout_file google_protobuf_empty_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
index 04b916703cc..492c0e952a9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.c
@@ -7,72 +7,86 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/struct.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_protobuf_Struct_submsgs[1] = {
- &google_protobuf_Struct_FieldsEntry_msginit,
+static const upb_msglayout_sub google_protobuf_Struct_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_FieldsEntry_msginit},
};
static const upb_msglayout_field google_protobuf_Struct__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Struct_msginit = {
&google_protobuf_Struct_submsgs[0],
&google_protobuf_Struct__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const google_protobuf_Struct_FieldsEntry_submsgs[1] = {
- &google_protobuf_Value_msginit,
+static const upb_msglayout_sub google_protobuf_Struct_FieldsEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Value_msginit},
};
static const upb_msglayout_field google_protobuf_Struct_FieldsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit = {
&google_protobuf_Struct_FieldsEntry_submsgs[0],
&google_protobuf_Struct_FieldsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const google_protobuf_Value_submsgs[2] = {
- &google_protobuf_ListValue_msginit,
- &google_protobuf_Struct_msginit,
+static const upb_msglayout_sub google_protobuf_Value_submsgs[2] = {
+ {.submsg = &google_protobuf_ListValue_msginit},
+ {.submsg = &google_protobuf_Struct_msginit},
};
static const upb_msglayout_field google_protobuf_Value__fields[6] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
- {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, 1},
- {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, 1},
- {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Value_msginit = {
&google_protobuf_Value_submsgs[0],
&google_protobuf_Value__fields[0],
- UPB_SIZE(16, 32), 6, false, 255,
+ UPB_SIZE(16, 32), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const google_protobuf_ListValue_submsgs[1] = {
- &google_protobuf_Value_msginit,
+static const upb_msglayout_sub google_protobuf_ListValue_submsgs[1] = {
+ {.submsg = &google_protobuf_Value_msginit},
};
static const upb_msglayout_field google_protobuf_ListValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_ListValue_msginit = {
&google_protobuf_ListValue_submsgs[0],
&google_protobuf_ListValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[4] = {
+ &google_protobuf_Struct_msginit,
+ &google_protobuf_Struct_FieldsEntry_msginit,
+ &google_protobuf_Value_msginit,
+ &google_protobuf_ListValue_msginit,
+};
+
+const upb_msglayout_file google_protobuf_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 4,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
index 29fec82b577..aeee93636dc 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/struct.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -46,13 +46,19 @@ UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_new(upb_arena *arena)
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Struct *ret = google_protobuf_Struct_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Struct *google_protobuf_Struct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Struct *ret = google_protobuf_Struct_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Struct_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Struct_serialize(const google_protobuf_Struct *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Struct_msginit, arena, len);
@@ -94,13 +100,19 @@ UPB_INLINE google_protobuf_Value *google_protobuf_Value_new(upb_arena *arena) {
UPB_INLINE google_protobuf_Value *google_protobuf_Value_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Value *ret = google_protobuf_Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Value *google_protobuf_Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Value *ret = google_protobuf_Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Value_serialize(const google_protobuf_Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Value_msginit, arena, len);
@@ -175,13 +187,19 @@ UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_new(upb_arena *a
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_ListValue *ret = google_protobuf_ListValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_ListValue *google_protobuf_ListValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_ListValue *ret = google_protobuf_ListValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_ListValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_ListValue_serialize(const google_protobuf_ListValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_ListValue_msginit, arena, len);
@@ -204,6 +222,8 @@ UPB_INLINE struct google_protobuf_Value* google_protobuf_ListValue_add_values(go
return sub;
}
+extern const upb_msglayout_file google_protobuf_struct_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
index 718ce3b9dbb..feaec43d0d9 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c
@@ -7,20 +7,31 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/timestamp.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field google_protobuf_Timestamp__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 5, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Timestamp_msginit = {
NULL,
&google_protobuf_Timestamp__fields[0],
- UPB_SIZE(16, 16), 2, false, 255,
+ UPB_SIZE(16, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &google_protobuf_Timestamp_msginit,
+};
+
+const upb_msglayout_file google_protobuf_timestamp_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
index 31c1145adc9..d0c50212f92 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_TIMESTAMP_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_new(upb_arena *a
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Timestamp *ret = google_protobuf_Timestamp_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Timestamp *google_protobuf_Timestamp_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Timestamp *ret = google_protobuf_Timestamp_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Timestamp_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Timestamp_serialize(const google_protobuf_Timestamp *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Timestamp_msginit, arena, len);
@@ -55,6 +61,8 @@ UPB_INLINE void google_protobuf_Timestamp_set_nanos(google_protobuf_Timestamp *m
*UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}
+extern const upb_msglayout_file google_protobuf_timestamp_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
index aabc1740129..7c18483aa15 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c
@@ -7,99 +7,118 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/protobuf/wrappers.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field google_protobuf_DoubleValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_DoubleValue_msginit = {
NULL,
&google_protobuf_DoubleValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_FloatValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 2, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_FloatValue_msginit = {
NULL,
&google_protobuf_FloatValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_Int64Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Int64Value_msginit = {
NULL,
&google_protobuf_Int64Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_UInt64Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 4, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_UInt64Value_msginit = {
NULL,
&google_protobuf_UInt64Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_Int32Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_Int32Value_msginit = {
NULL,
&google_protobuf_Int32Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_UInt32Value__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_UInt32Value_msginit = {
NULL,
&google_protobuf_UInt32Value__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_BoolValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_BoolValue_msginit = {
NULL,
&google_protobuf_BoolValue__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_StringValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_StringValue_msginit = {
NULL,
&google_protobuf_StringValue__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field google_protobuf_BytesValue__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 12, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout google_protobuf_BytesValue_msginit = {
NULL,
&google_protobuf_BytesValue__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[9] = {
+ &google_protobuf_DoubleValue_msginit,
+ &google_protobuf_FloatValue_msginit,
+ &google_protobuf_Int64Value_msginit,
+ &google_protobuf_UInt64Value_msginit,
+ &google_protobuf_Int32Value_msginit,
+ &google_protobuf_UInt32Value_msginit,
+ &google_protobuf_BoolValue_msginit,
+ &google_protobuf_StringValue_msginit,
+ &google_protobuf_BytesValue_msginit,
+};
+
+const upb_msglayout_file google_protobuf_wrappers_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 9,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
index c184b805064..025b46c1b9d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
#define GOOGLE_PROTOBUF_WRAPPERS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -57,13 +57,19 @@ UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_new(upb_aren
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_DoubleValue *google_protobuf_DoubleValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_DoubleValue *ret = google_protobuf_DoubleValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_DoubleValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_DoubleValue_serialize(const google_protobuf_DoubleValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_DoubleValue_msginit, arena, len);
@@ -83,13 +89,19 @@ UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_new(upb_arena
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_FloatValue *google_protobuf_FloatValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_FloatValue *ret = google_protobuf_FloatValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_FloatValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_FloatValue_serialize(const google_protobuf_FloatValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_FloatValue_msginit, arena, len);
@@ -109,13 +121,19 @@ UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_new(upb_arena
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Int64Value *google_protobuf_Int64Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Int64Value *ret = google_protobuf_Int64Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Int64Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Int64Value_serialize(const google_protobuf_Int64Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Int64Value_msginit, arena, len);
@@ -135,13 +153,19 @@ UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_new(upb_aren
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_UInt64Value *google_protobuf_UInt64Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_UInt64Value *ret = google_protobuf_UInt64Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_UInt64Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_UInt64Value_serialize(const google_protobuf_UInt64Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_UInt64Value_msginit, arena, len);
@@ -161,13 +185,19 @@ UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_new(upb_arena
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_Int32Value *google_protobuf_Int32Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_Int32Value *ret = google_protobuf_Int32Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_Int32Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_Int32Value_serialize(const google_protobuf_Int32Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_Int32Value_msginit, arena, len);
@@ -187,13 +217,19 @@ UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_new(upb_aren
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_UInt32Value *google_protobuf_UInt32Value_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_UInt32Value *ret = google_protobuf_UInt32Value_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_UInt32Value_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_UInt32Value_serialize(const google_protobuf_UInt32Value *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_UInt32Value_msginit, arena, len);
@@ -213,13 +249,19 @@ UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_new(upb_arena *a
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_BoolValue *google_protobuf_BoolValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_BoolValue *ret = google_protobuf_BoolValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_BoolValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_BoolValue_serialize(const google_protobuf_BoolValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_BoolValue_msginit, arena, len);
@@ -239,13 +281,19 @@ UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_new(upb_aren
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_StringValue *google_protobuf_StringValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_StringValue *ret = google_protobuf_StringValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_StringValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_StringValue_serialize(const google_protobuf_StringValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_StringValue_msginit, arena, len);
@@ -265,13 +313,19 @@ UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_new(upb_arena
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse(const char *buf, size_t size,
upb_arena *arena) {
google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_protobuf_BytesValue *google_protobuf_BytesValue_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_protobuf_BytesValue *ret = google_protobuf_BytesValue_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_protobuf_BytesValue_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_protobuf_BytesValue_serialize(const google_protobuf_BytesValue *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_protobuf_BytesValue_msginit, arena, len);
@@ -283,6 +337,8 @@ UPB_INLINE void google_protobuf_BytesValue_set_value(google_protobuf_BytesValue
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+extern const upb_msglayout_file google_protobuf_wrappers_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
index e276a0dc1f1..613d2cdad05 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
@@ -7,26 +7,37 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "google/rpc/status.upb.h"
#include "google/protobuf/any.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const google_rpc_Status_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub google_rpc_Status_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field google_rpc_Status__fields[3] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout google_rpc_Status_msginit = {
&google_rpc_Status_submsgs[0],
&google_rpc_Status__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &google_rpc_Status_msginit,
+};
+
+const upb_msglayout_file google_rpc_status_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
index 4cc29b3dc26..7b36a310b17 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.h
@@ -9,7 +9,7 @@
#ifndef GOOGLE_RPC_STATUS_PROTO_UPB_H_
#define GOOGLE_RPC_STATUS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE google_rpc_Status *google_rpc_Status_new(upb_arena *arena) {
UPB_INLINE google_rpc_Status *google_rpc_Status_parse(const char *buf, size_t size,
upb_arena *arena) {
google_rpc_Status *ret = google_rpc_Status_new(arena);
- return (ret && upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE google_rpc_Status *google_rpc_Status_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
google_rpc_Status *ret = google_rpc_Status_new(arena);
- return (ret && _upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &google_rpc_Status_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *google_rpc_Status_serialize(const google_rpc_Status *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &google_rpc_Status_msginit, arena, len);
@@ -72,6 +78,8 @@ UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_
return sub;
}
+extern const upb_msglayout_file google_rpc_status_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
index 8b6de3fb468..4fd83b25a55 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c
@@ -7,42 +7,54 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/altscontext.upb.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_gcp_AltsContext_submsgs[2] = {
- &grpc_gcp_AltsContext_PeerAttributesEntry_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_msglayout_sub grpc_gcp_AltsContext_submsgs[2] = {
+ {.submsg = &grpc_gcp_AltsContext_PeerAttributesEntry_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
static const upb_msglayout_field grpc_gcp_AltsContext__fields[7] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {4, UPB_SIZE(24, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 56), 0, 0, 9, 1},
- {6, UPB_SIZE(40, 72), 1, 1, 11, 1},
- {7, UPB_SIZE(44, 80), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 56), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(40, 72), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(44, 80), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_AltsContext_msginit = {
&grpc_gcp_AltsContext_submsgs[0],
&grpc_gcp_AltsContext__fields[0],
- UPB_SIZE(48, 96), 7, false, 255,
+ UPB_SIZE(48, 96), 7, _UPB_MSGEXT_NONE, 7, 255,
};
static const upb_msglayout_field grpc_gcp_AltsContext_PeerAttributesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_AltsContext_PeerAttributesEntry_msginit = {
NULL,
&grpc_gcp_AltsContext_PeerAttributesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &grpc_gcp_AltsContext_msginit,
+ &grpc_gcp_AltsContext_PeerAttributesEntry_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_gcp_altscontext_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
index 3a91b53d000..eb033570b2e 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_ALTSCONTEXT_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -38,13 +38,19 @@ UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_new(upb_arena *arena) {
UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_AltsContext *grpc_gcp_AltsContext_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_AltsContext *ret = grpc_gcp_AltsContext_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_AltsContext_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_AltsContext_serialize(const grpc_gcp_AltsContext *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_AltsContext_msginit, arena, len);
@@ -112,6 +118,8 @@ UPB_INLINE void grpc_gcp_AltsContext_PeerAttributesEntry_set_value(grpc_gcp_Alts
_upb_msg_map_set_value(msg, &value, 0);
}
+extern const upb_msglayout_file src_proto_grpc_gcp_altscontext_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
index 998f2d81c2c..d8d2b1af4d8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c
@@ -7,205 +7,227 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/handshaker.upb.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field grpc_gcp_Endpoint__fields[3] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 5, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_Endpoint_msginit = {
NULL,
&grpc_gcp_Endpoint__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const grpc_gcp_Identity_submsgs[1] = {
- &grpc_gcp_Identity_AttributesEntry_msginit,
+static const upb_msglayout_sub grpc_gcp_Identity_submsgs[1] = {
+ {.submsg = &grpc_gcp_Identity_AttributesEntry_msginit},
};
static const upb_msglayout_field grpc_gcp_Identity__fields[3] = {
- {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, 1},
- {3, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), UPB_SIZE(-13, -25), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_Identity_msginit = {
&grpc_gcp_Identity_submsgs[0],
&grpc_gcp_Identity__fields[0],
- UPB_SIZE(16, 32), 3, false, 255,
+ UPB_SIZE(16, 32), 3, _UPB_MSGEXT_NONE, 3, 255,
};
static const upb_msglayout_field grpc_gcp_Identity_AttributesEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_Identity_AttributesEntry_msginit = {
NULL,
&grpc_gcp_Identity_AttributesEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const grpc_gcp_StartClientHandshakeReq_submsgs[3] = {
- &grpc_gcp_Endpoint_msginit,
- &grpc_gcp_Identity_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_msglayout_sub grpc_gcp_StartClientHandshakeReq_submsgs[3] = {
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
static const upb_msglayout_field grpc_gcp_StartClientHandshakeReq__fields[10] = {
- {1, UPB_SIZE(4, 4), 0, 0, 14, 1},
- {2, UPB_SIZE(36, 64), 0, 0, 9, 3},
- {3, UPB_SIZE(40, 72), 0, 0, 9, 3},
- {4, UPB_SIZE(44, 80), 0, 1, 11, 3},
- {5, UPB_SIZE(20, 32), 1, 1, 11, 1},
- {6, UPB_SIZE(24, 40), 2, 0, 11, 1},
- {7, UPB_SIZE(28, 48), 3, 0, 11, 1},
- {8, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {9, UPB_SIZE(32, 56), 4, 2, 11, 1},
- {10, UPB_SIZE(8, 8), 0, 0, 13, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(36, 64), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(40, 72), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(44, 80), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 32), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 40), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(28, 48), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(32, 56), 4, 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(8, 8), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_StartClientHandshakeReq_msginit = {
&grpc_gcp_StartClientHandshakeReq_submsgs[0],
&grpc_gcp_StartClientHandshakeReq__fields[0],
- UPB_SIZE(48, 96), 10, false, 255,
+ UPB_SIZE(48, 96), 10, _UPB_MSGEXT_NONE, 10, 255,
};
-static const upb_msglayout *const grpc_gcp_ServerHandshakeParameters_submsgs[1] = {
- &grpc_gcp_Identity_msginit,
+static const upb_msglayout_sub grpc_gcp_ServerHandshakeParameters_submsgs[1] = {
+ {.submsg = &grpc_gcp_Identity_msginit},
};
static const upb_msglayout_field grpc_gcp_ServerHandshakeParameters__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 3},
- {2, UPB_SIZE(4, 8), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_ServerHandshakeParameters_msginit = {
&grpc_gcp_ServerHandshakeParameters_submsgs[0],
&grpc_gcp_ServerHandshakeParameters__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_submsgs[3] = {
- &grpc_gcp_Endpoint_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
- &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
+static const upb_msglayout_sub grpc_gcp_StartServerHandshakeReq_submsgs[3] = {
+ {.submsg = &grpc_gcp_Endpoint_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
+ {.submsg = &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit},
};
static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq__fields[7] = {
- {1, UPB_SIZE(28, 48), 0, 0, 9, 3},
- {2, UPB_SIZE(32, 56), 0, 2, 11, _UPB_LABEL_MAP},
- {3, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {4, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {5, UPB_SIZE(20, 32), 2, 0, 11, 1},
- {6, UPB_SIZE(24, 40), 3, 1, 11, 1},
- {7, UPB_SIZE(4, 4), 0, 0, 13, 1},
+ {1, UPB_SIZE(28, 48), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(32, 56), 0, 2, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 8), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 40), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_StartServerHandshakeReq_msginit = {
&grpc_gcp_StartServerHandshakeReq_submsgs[0],
&grpc_gcp_StartServerHandshakeReq__fields[0],
- UPB_SIZE(40, 64), 7, false, 255,
+ UPB_SIZE(40, 64), 7, _UPB_MSGEXT_NONE, 7, 255,
};
-static const upb_msglayout *const grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = {
- &grpc_gcp_ServerHandshakeParameters_msginit,
+static const upb_msglayout_sub grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = {
+ {.submsg = &grpc_gcp_ServerHandshakeParameters_msginit},
};
static const upb_msglayout_field grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 11, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit = {
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[0],
&grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field grpc_gcp_NextHandshakeMessageReq__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 12, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_NextHandshakeMessageReq_msginit = {
NULL,
&grpc_gcp_NextHandshakeMessageReq__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
-static const upb_msglayout *const grpc_gcp_HandshakerReq_submsgs[3] = {
- &grpc_gcp_NextHandshakeMessageReq_msginit,
- &grpc_gcp_StartClientHandshakeReq_msginit,
- &grpc_gcp_StartServerHandshakeReq_msginit,
+static const upb_msglayout_sub grpc_gcp_HandshakerReq_submsgs[3] = {
+ {.submsg = &grpc_gcp_NextHandshakeMessageReq_msginit},
+ {.submsg = &grpc_gcp_StartClientHandshakeReq_msginit},
+ {.submsg = &grpc_gcp_StartServerHandshakeReq_msginit},
};
static const upb_msglayout_field grpc_gcp_HandshakerReq__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_HandshakerReq_msginit = {
&grpc_gcp_HandshakerReq_submsgs[0],
&grpc_gcp_HandshakerReq__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const grpc_gcp_HandshakerResult_submsgs[2] = {
- &grpc_gcp_Identity_msginit,
- &grpc_gcp_RpcProtocolVersions_msginit,
+static const upb_msglayout_sub grpc_gcp_HandshakerResult_submsgs[2] = {
+ {.submsg = &grpc_gcp_Identity_msginit},
+ {.submsg = &grpc_gcp_RpcProtocolVersions_msginit},
};
static const upb_msglayout_field grpc_gcp_HandshakerResult__fields[8] = {
- {1, UPB_SIZE(12, 16), 0, 0, 9, 1},
- {2, UPB_SIZE(20, 32), 0, 0, 9, 1},
- {3, UPB_SIZE(28, 48), 0, 0, 12, 1},
- {4, UPB_SIZE(36, 64), 1, 0, 11, 1},
- {5, UPB_SIZE(40, 72), 2, 0, 11, 1},
- {6, UPB_SIZE(8, 8), 0, 0, 8, 1},
- {7, UPB_SIZE(44, 80), 3, 1, 11, 1},
- {8, UPB_SIZE(4, 4), 0, 0, 13, 1},
+ {1, UPB_SIZE(12, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(20, 32), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(28, 48), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(36, 64), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 72), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 8), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(44, 80), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_HandshakerResult_msginit = {
&grpc_gcp_HandshakerResult_submsgs[0],
&grpc_gcp_HandshakerResult__fields[0],
- UPB_SIZE(48, 96), 8, false, 255,
+ UPB_SIZE(48, 96), 8, _UPB_MSGEXT_NONE, 8, 255,
};
static const upb_msglayout_field grpc_gcp_HandshakerStatus__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_HandshakerStatus_msginit = {
NULL,
&grpc_gcp_HandshakerStatus__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const grpc_gcp_HandshakerResp_submsgs[2] = {
- &grpc_gcp_HandshakerResult_msginit,
- &grpc_gcp_HandshakerStatus_msginit,
+static const upb_msglayout_sub grpc_gcp_HandshakerResp_submsgs[2] = {
+ {.submsg = &grpc_gcp_HandshakerResult_msginit},
+ {.submsg = &grpc_gcp_HandshakerStatus_msginit},
};
static const upb_msglayout_field grpc_gcp_HandshakerResp__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
- {3, UPB_SIZE(16, 24), 1, 0, 11, 1},
- {4, UPB_SIZE(20, 32), 2, 1, 11, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 32), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_HandshakerResp_msginit = {
&grpc_gcp_HandshakerResp_submsgs[0],
&grpc_gcp_HandshakerResp__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[12] = {
+ &grpc_gcp_Endpoint_msginit,
+ &grpc_gcp_Identity_msginit,
+ &grpc_gcp_Identity_AttributesEntry_msginit,
+ &grpc_gcp_StartClientHandshakeReq_msginit,
+ &grpc_gcp_ServerHandshakeParameters_msginit,
+ &grpc_gcp_StartServerHandshakeReq_msginit,
+ &grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_msginit,
+ &grpc_gcp_NextHandshakeMessageReq_msginit,
+ &grpc_gcp_HandshakerReq_msginit,
+ &grpc_gcp_HandshakerResult_msginit,
+ &grpc_gcp_HandshakerStatus_msginit,
+ &grpc_gcp_HandshakerResp_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_gcp_handshaker_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 12,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
index e4c5bf63bea..67585c9b2fa 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_HANDSHAKER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -80,13 +80,19 @@ UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_new(upb_arena *arena) {
UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_Endpoint *ret = grpc_gcp_Endpoint_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_Endpoint *grpc_gcp_Endpoint_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_Endpoint *ret = grpc_gcp_Endpoint_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_Endpoint_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_Endpoint_serialize(const grpc_gcp_Endpoint *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_Endpoint_msginit, arena, len);
@@ -114,13 +120,19 @@ UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_new(upb_arena *arena) {
UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_Identity *ret = grpc_gcp_Identity_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_Identity *grpc_gcp_Identity_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_Identity *ret = grpc_gcp_Identity_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_Identity_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_Identity_serialize(const grpc_gcp_Identity *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_Identity_msginit, arena, len);
@@ -178,13 +190,19 @@ UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_ne
UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_StartClientHandshakeReq *ret = grpc_gcp_StartClientHandshakeReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_StartClientHandshakeReq *grpc_gcp_StartClientHandshakeReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_StartClientHandshakeReq *ret = grpc_gcp_StartClientHandshakeReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_StartClientHandshakeReq_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_StartClientHandshakeReq_serialize(const grpc_gcp_StartClientHandshakeReq *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, arena, len);
@@ -309,13 +327,19 @@ UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameter
UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_ServerHandshakeParameters *ret = grpc_gcp_ServerHandshakeParameters_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_ServerHandshakeParameters *grpc_gcp_ServerHandshakeParameters_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_ServerHandshakeParameters *ret = grpc_gcp_ServerHandshakeParameters_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_ServerHandshakeParameters_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_ServerHandshakeParameters_serialize(const grpc_gcp_ServerHandshakeParameters *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, arena, len);
@@ -357,13 +381,19 @@ UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_ne
UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_StartServerHandshakeReq *ret = grpc_gcp_StartServerHandshakeReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_StartServerHandshakeReq *grpc_gcp_StartServerHandshakeReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_StartServerHandshakeReq *ret = grpc_gcp_StartServerHandshakeReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_StartServerHandshakeReq_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_StartServerHandshakeReq_serialize(const grpc_gcp_StartServerHandshakeReq *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, arena, len);
@@ -469,13 +499,19 @@ UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_ne
UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_NextHandshakeMessageReq *ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_NextHandshakeMessageReq *grpc_gcp_NextHandshakeMessageReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_NextHandshakeMessageReq *ret = grpc_gcp_NextHandshakeMessageReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_NextHandshakeMessageReq_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_NextHandshakeMessageReq_serialize(const grpc_gcp_NextHandshakeMessageReq *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, arena, len);
@@ -495,13 +531,19 @@ UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_new(upb_arena *arena)
UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_HandshakerReq *ret = grpc_gcp_HandshakerReq_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_HandshakerReq *grpc_gcp_HandshakerReq_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_HandshakerReq *ret = grpc_gcp_HandshakerReq_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_HandshakerReq_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_HandshakerReq_serialize(const grpc_gcp_HandshakerReq *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_HandshakerReq_msginit, arena, len);
@@ -567,13 +609,19 @@ UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_new(upb_arena *a
UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_HandshakerResult *ret = grpc_gcp_HandshakerResult_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_HandshakerResult *grpc_gcp_HandshakerResult_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_HandshakerResult *ret = grpc_gcp_HandshakerResult_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_HandshakerResult_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_HandshakerResult_serialize(const grpc_gcp_HandshakerResult *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_HandshakerResult_msginit, arena, len);
@@ -654,13 +702,19 @@ UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_new(upb_arena *a
UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_HandshakerStatus *ret = grpc_gcp_HandshakerStatus_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_HandshakerStatus *grpc_gcp_HandshakerStatus_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_HandshakerStatus *ret = grpc_gcp_HandshakerStatus_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_HandshakerStatus_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_HandshakerStatus_serialize(const grpc_gcp_HandshakerStatus *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_HandshakerStatus_msginit, arena, len);
@@ -684,13 +738,19 @@ UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_new(upb_arena *arena
UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_HandshakerResp *ret = grpc_gcp_HandshakerResp_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_HandshakerResp *grpc_gcp_HandshakerResp_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_HandshakerResp *ret = grpc_gcp_HandshakerResp_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_HandshakerResp_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_HandshakerResp_serialize(const grpc_gcp_HandshakerResp *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_HandshakerResp_msginit, arena, len);
@@ -736,6 +796,8 @@ UPB_INLINE struct grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerResp_mutable_sta
return sub;
}
+extern const upb_msglayout_file src_proto_grpc_gcp_handshaker_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
index 136c30da0e0..80d43451f5a 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c
@@ -7,35 +7,47 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/gcp/transport_security_common.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_gcp_RpcProtocolVersions_submsgs[1] = {
- &grpc_gcp_RpcProtocolVersions_Version_msginit,
+static const upb_msglayout_sub grpc_gcp_RpcProtocolVersions_submsgs[1] = {
+ {.submsg = &grpc_gcp_RpcProtocolVersions_Version_msginit},
};
static const upb_msglayout_field grpc_gcp_RpcProtocolVersions__fields[2] = {
- {1, UPB_SIZE(4, 8), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 16), 2, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_RpcProtocolVersions_msginit = {
&grpc_gcp_RpcProtocolVersions_submsgs[0],
&grpc_gcp_RpcProtocolVersions__fields[0],
- UPB_SIZE(16, 24), 2, false, 255,
+ UPB_SIZE(16, 24), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field grpc_gcp_RpcProtocolVersions_Version__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 13, 1},
- {2, UPB_SIZE(4, 4), 0, 0, 13, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 4), 0, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_gcp_RpcProtocolVersions_Version_msginit = {
NULL,
&grpc_gcp_RpcProtocolVersions_Version__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &grpc_gcp_RpcProtocolVersions_msginit,
+ &grpc_gcp_RpcProtocolVersions_Version_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
index 9e02e0b57b4..b6a3e0730fb 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_
#define SRC_PROTO_GRPC_GCP_TRANSPORT_SECURITY_COMMON_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -42,13 +42,19 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_new(upb_ar
UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_RpcProtocolVersions *grpc_gcp_RpcProtocolVersions_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_RpcProtocolVersions *ret = grpc_gcp_RpcProtocolVersions_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_RpcProtocolVersions_serialize(const grpc_gcp_RpcProtocolVersions *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, arena, len);
@@ -94,13 +100,19 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Ve
UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_gcp_RpcProtocolVersions_Version *grpc_gcp_RpcProtocolVersions_Version_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_gcp_RpcProtocolVersions_Version *ret = grpc_gcp_RpcProtocolVersions_Version_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_gcp_RpcProtocolVersions_Version_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_gcp_RpcProtocolVersions_Version_serialize(const grpc_gcp_RpcProtocolVersions_Version *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, arena, len);
@@ -116,6 +128,8 @@ UPB_INLINE void grpc_gcp_RpcProtocolVersions_Version_set_minor(grpc_gcp_RpcProto
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), uint32_t) = value;
}
+extern const upb_msglayout_file src_proto_grpc_gcp_transport_security_common_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
index df8d846627e..c0f5a7748ad 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c
@@ -7,29 +7,41 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/health/v1/health.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field grpc_health_v1_HealthCheckRequest__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_health_v1_HealthCheckRequest_msginit = {
NULL,
&grpc_health_v1_HealthCheckRequest__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field grpc_health_v1_HealthCheckResponse__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_health_v1_HealthCheckResponse_msginit = {
NULL,
&grpc_health_v1_HealthCheckResponse__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &grpc_health_v1_HealthCheckRequest_msginit,
+ &grpc_health_v1_HealthCheckResponse_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_health_v1_health_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
index 361b221ffea..c08fae2a3d7 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_
#define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -43,13 +43,19 @@ UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_
UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, arena, len);
@@ -69,13 +75,19 @@ UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckRespons
UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, arena, len);
@@ -87,6 +99,8 @@ UPB_INLINE void grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_Hea
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
+extern const upb_msglayout_file src_proto_grpc_health_v1_health_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
index 3ecf09f145d..cda0e1cc888 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c
@@ -7,134 +7,152 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "src/proto/grpc/lb/v1/load_balancer.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/timestamp.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const grpc_lb_v1_LoadBalanceRequest_submsgs[2] = {
- &grpc_lb_v1_ClientStats_msginit,
- &grpc_lb_v1_InitialLoadBalanceRequest_msginit,
+static const upb_msglayout_sub grpc_lb_v1_LoadBalanceRequest_submsgs[2] = {
+ {.submsg = &grpc_lb_v1_ClientStats_msginit},
+ {.submsg = &grpc_lb_v1_InitialLoadBalanceRequest_msginit},
};
static const upb_msglayout_field grpc_lb_v1_LoadBalanceRequest__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_LoadBalanceRequest_msginit = {
&grpc_lb_v1_LoadBalanceRequest_submsgs[0],
&grpc_lb_v1_LoadBalanceRequest__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_InitialLoadBalanceRequest_msginit = {
NULL,
&grpc_lb_v1_InitialLoadBalanceRequest__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field grpc_lb_v1_ClientStatsPerToken__fields[2] = {
- {1, UPB_SIZE(8, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 3, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_ClientStatsPerToken_msginit = {
NULL,
&grpc_lb_v1_ClientStatsPerToken__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const grpc_lb_v1_ClientStats_submsgs[2] = {
- &google_protobuf_Timestamp_msginit,
- &grpc_lb_v1_ClientStatsPerToken_msginit,
+static const upb_msglayout_sub grpc_lb_v1_ClientStats_submsgs[2] = {
+ {.submsg = &google_protobuf_Timestamp_msginit},
+ {.submsg = &grpc_lb_v1_ClientStatsPerToken_msginit},
};
static const upb_msglayout_field grpc_lb_v1_ClientStats__fields[6] = {
- {1, UPB_SIZE(40, 40), 1, 0, 11, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 3, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 3, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 3, 1},
- {7, UPB_SIZE(32, 32), 0, 0, 3, 1},
- {8, UPB_SIZE(44, 48), 0, 1, 11, 3},
+ {1, UPB_SIZE(40, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 24), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 32), 0, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(44, 48), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_ClientStats_msginit = {
&grpc_lb_v1_ClientStats_submsgs[0],
&grpc_lb_v1_ClientStats__fields[0],
- UPB_SIZE(48, 56), 6, false, 255,
+ UPB_SIZE(48, 56), 6, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const grpc_lb_v1_LoadBalanceResponse_submsgs[3] = {
- &grpc_lb_v1_FallbackResponse_msginit,
- &grpc_lb_v1_InitialLoadBalanceResponse_msginit,
- &grpc_lb_v1_ServerList_msginit,
+static const upb_msglayout_sub grpc_lb_v1_LoadBalanceResponse_submsgs[3] = {
+ {.submsg = &grpc_lb_v1_FallbackResponse_msginit},
+ {.submsg = &grpc_lb_v1_InitialLoadBalanceResponse_msginit},
+ {.submsg = &grpc_lb_v1_ServerList_msginit},
};
static const upb_msglayout_field grpc_lb_v1_LoadBalanceResponse__fields[3] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, 1},
- {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit = {
&grpc_lb_v1_LoadBalanceResponse_submsgs[0],
&grpc_lb_v1_LoadBalanceResponse__fields[0],
- UPB_SIZE(8, 16), 3, false, 255,
+ UPB_SIZE(8, 16), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+const upb_msglayout grpc_lb_v1_FallbackResponse_msginit = {
+ NULL,
+ NULL,
+ UPB_SIZE(0, 0), 0, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout_field grpc_lb_v1_InitialLoadBalanceResponse__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
+static const upb_msglayout_sub grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+};
+
+static const upb_msglayout_field grpc_lb_v1_InitialLoadBalanceResponse__fields[1] = {
+ {2, UPB_SIZE(4, 8), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_InitialLoadBalanceResponse_msginit = {
&grpc_lb_v1_InitialLoadBalanceResponse_submsgs[0],
&grpc_lb_v1_InitialLoadBalanceResponse__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 0, 255,
};
-static const upb_msglayout *const grpc_lb_v1_ServerList_submsgs[1] = {
- &grpc_lb_v1_Server_msginit,
+static const upb_msglayout_sub grpc_lb_v1_ServerList_submsgs[1] = {
+ {.submsg = &grpc_lb_v1_Server_msginit},
};
static const upb_msglayout_field grpc_lb_v1_ServerList__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_ServerList_msginit = {
&grpc_lb_v1_ServerList_submsgs[0],
&grpc_lb_v1_ServerList__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field grpc_lb_v1_Server__fields[4] = {
- {1, UPB_SIZE(8, 8), 0, 0, 12, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 5, 1},
- {3, UPB_SIZE(16, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(4, 4), 0, 0, 8, 1},
+ {1, UPB_SIZE(8, 8), 0, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout grpc_lb_v1_Server_msginit = {
NULL,
&grpc_lb_v1_Server__fields[0],
- UPB_SIZE(24, 48), 4, false, 255,
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 4, 255,
};
-const upb_msglayout grpc_lb_v1_FallbackResponse_msginit = {
- NULL,
+static const upb_msglayout *messages_layout[9] = {
+ &grpc_lb_v1_LoadBalanceRequest_msginit,
+ &grpc_lb_v1_InitialLoadBalanceRequest_msginit,
+ &grpc_lb_v1_ClientStatsPerToken_msginit,
+ &grpc_lb_v1_ClientStats_msginit,
+ &grpc_lb_v1_LoadBalanceResponse_msginit,
+ &grpc_lb_v1_FallbackResponse_msginit,
+ &grpc_lb_v1_InitialLoadBalanceResponse_msginit,
+ &grpc_lb_v1_ServerList_msginit,
+ &grpc_lb_v1_Server_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout = {
+ messages_layout,
NULL,
- UPB_SIZE(0, 0), 0, false, 255,
+ 9,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
index c8c352ce989..d646946f96d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h
@@ -9,7 +9,7 @@
#ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
#define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -25,28 +25,28 @@ struct grpc_lb_v1_InitialLoadBalanceRequest;
struct grpc_lb_v1_ClientStatsPerToken;
struct grpc_lb_v1_ClientStats;
struct grpc_lb_v1_LoadBalanceResponse;
+struct grpc_lb_v1_FallbackResponse;
struct grpc_lb_v1_InitialLoadBalanceResponse;
struct grpc_lb_v1_ServerList;
struct grpc_lb_v1_Server;
-struct grpc_lb_v1_FallbackResponse;
typedef struct grpc_lb_v1_LoadBalanceRequest grpc_lb_v1_LoadBalanceRequest;
typedef struct grpc_lb_v1_InitialLoadBalanceRequest grpc_lb_v1_InitialLoadBalanceRequest;
typedef struct grpc_lb_v1_ClientStatsPerToken grpc_lb_v1_ClientStatsPerToken;
typedef struct grpc_lb_v1_ClientStats grpc_lb_v1_ClientStats;
typedef struct grpc_lb_v1_LoadBalanceResponse grpc_lb_v1_LoadBalanceResponse;
+typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
typedef struct grpc_lb_v1_InitialLoadBalanceResponse grpc_lb_v1_InitialLoadBalanceResponse;
typedef struct grpc_lb_v1_ServerList grpc_lb_v1_ServerList;
typedef struct grpc_lb_v1_Server grpc_lb_v1_Server;
-typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
extern const upb_msglayout grpc_lb_v1_LoadBalanceRequest_msginit;
extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceRequest_msginit;
extern const upb_msglayout grpc_lb_v1_ClientStatsPerToken_msginit;
extern const upb_msglayout grpc_lb_v1_ClientStats_msginit;
extern const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit;
+extern const upb_msglayout grpc_lb_v1_FallbackResponse_msginit;
extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceResponse_msginit;
extern const upb_msglayout grpc_lb_v1_ServerList_msginit;
extern const upb_msglayout grpc_lb_v1_Server_msginit;
-extern const upb_msglayout grpc_lb_v1_FallbackResponse_msginit;
struct google_protobuf_Duration;
struct google_protobuf_Timestamp;
extern const upb_msglayout google_protobuf_Duration_msginit;
@@ -61,13 +61,19 @@ UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_new(upb_
UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_LoadBalanceRequest_serialize(const grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, arena, len);
@@ -118,13 +124,19 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRe
UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, len);
@@ -144,13 +156,19 @@ UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_new(up
UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_ClientStatsPerToken *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, len);
@@ -174,13 +192,19 @@ UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_new(upb_arena *arena)
UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_ClientStats_msginit, arena, len);
@@ -242,13 +266,19 @@ UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_new(up
UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, arena, len);
@@ -306,6 +336,34 @@ UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mu
return sub;
}
+/* grpc.lb.v1.FallbackResponse */
+
+UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_new(upb_arena *arena) {
+ return (grpc_lb_v1_FallbackResponse *)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
+}
+UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &grpc_lb_v1_FallbackResponse_msginit, arena, len);
+}
+
+
+
/* grpc.lb.v1.InitialLoadBalanceResponse */
UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_new(upb_arena *arena) {
@@ -314,28 +372,30 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceR
UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, len);
}
-UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
+UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_Duration*); }
-UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_load_balancer_delegate(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, struct google_protobuf_Duration* value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_Duration*) = value;
}
UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_mutable_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(msg);
@@ -355,13 +415,19 @@ UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_new(upb_arena *arena) {
UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_ServerList_msginit, arena, len);
@@ -392,13 +458,19 @@ UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_new(upb_arena *arena) {
UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse(const char *buf, size_t size,
upb_arena *arena) {
grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &grpc_lb_v1_Server_msginit, arena, len);
@@ -422,27 +494,7 @@ UPB_INLINE void grpc_lb_v1_Server_set_drop(grpc_lb_v1_Server *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
}
-/* grpc.lb.v1.FallbackResponse */
-
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_new(upb_arena *arena) {
- return (grpc_lb_v1_FallbackResponse *)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
-}
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse(const char *buf, size_t size,
- upb_arena *arena) {
- grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
- return (ret && upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
- return (ret && _upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &grpc_lb_v1_FallbackResponse_msginit, arena, len);
-}
-
-
+extern const upb_msglayout_file src_proto_grpc_lb_v1_load_balancer_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
new file mode 100644
index 00000000000..26769cb7c09
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c
@@ -0,0 +1,68 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "src/proto/grpc/lookup/v1/rls.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub grpc_lookup_v1_RouteLookupRequest_submsgs[1] = {
+ {.submsg = &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit},
+};
+
+static const upb_msglayout_field grpc_lookup_v1_RouteLookupRequest__fields[4] = {
+ {3, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout grpc_lookup_v1_RouteLookupRequest_msginit = {
+ &grpc_lookup_v1_RouteLookupRequest_submsgs[0],
+ &grpc_lookup_v1_RouteLookupRequest__fields[0],
+ UPB_SIZE(24, 48), 4, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout_field grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit = {
+ NULL,
+ &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_field grpc_lookup_v1_RouteLookupResponse__fields[2] = {
+ {2, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout grpc_lookup_v1_RouteLookupResponse_msginit = {
+ NULL,
+ &grpc_lookup_v1_RouteLookupResponse__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &grpc_lookup_v1_RouteLookupRequest_msginit,
+ &grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit,
+ &grpc_lookup_v1_RouteLookupResponse_msginit,
+};
+
+const upb_msglayout_file src_proto_grpc_lookup_v1_rls_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
new file mode 100644
index 00000000000..42bf664febc
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h
@@ -0,0 +1,156 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * src/proto/grpc/lookup/v1/rls.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_
+#define SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct grpc_lookup_v1_RouteLookupRequest;
+struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry;
+struct grpc_lookup_v1_RouteLookupResponse;
+typedef struct grpc_lookup_v1_RouteLookupRequest grpc_lookup_v1_RouteLookupRequest;
+typedef struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry grpc_lookup_v1_RouteLookupRequest_KeyMapEntry;
+typedef struct grpc_lookup_v1_RouteLookupResponse grpc_lookup_v1_RouteLookupResponse;
+extern const upb_msglayout grpc_lookup_v1_RouteLookupRequest_msginit;
+extern const upb_msglayout grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_msginit;
+extern const upb_msglayout grpc_lookup_v1_RouteLookupResponse_msginit;
+
+typedef enum {
+ grpc_lookup_v1_RouteLookupRequest_REASON_UNKNOWN = 0,
+ grpc_lookup_v1_RouteLookupRequest_REASON_MISS = 1,
+ grpc_lookup_v1_RouteLookupRequest_REASON_STALE = 2
+} grpc_lookup_v1_RouteLookupRequest_Reason;
+
+
+/* grpc.lookup.v1.RouteLookupRequest */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest *grpc_lookup_v1_RouteLookupRequest_new(upb_arena *arena) {
+ return (grpc_lookup_v1_RouteLookupRequest *)_upb_msg_new(&grpc_lookup_v1_RouteLookupRequest_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest *grpc_lookup_v1_RouteLookupRequest_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ grpc_lookup_v1_RouteLookupRequest *ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest *grpc_lookup_v1_RouteLookupRequest_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ grpc_lookup_v1_RouteLookupRequest *ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lookup_v1_RouteLookupRequest_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *grpc_lookup_v1_RouteLookupRequest_serialize(const grpc_lookup_v1_RouteLookupRequest *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview grpc_lookup_v1_RouteLookupRequest_target_type(const grpc_lookup_v1_RouteLookupRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_has_key_map(const grpc_lookup_v1_RouteLookupRequest *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE size_t grpc_lookup_v1_RouteLookupRequest_key_map_size(const grpc_lookup_v1_RouteLookupRequest *msg) {return _upb_msg_map_size(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_get(const grpc_lookup_v1_RouteLookupRequest *msg, upb_strview key, upb_strview *val) { return _upb_msg_map_get(msg, UPB_SIZE(20, 40), &key, 0, val, 0); }
+UPB_INLINE const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_next(const grpc_lookup_v1_RouteLookupRequest *msg, size_t* iter) { return (const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
+UPB_INLINE int32_t grpc_lookup_v1_RouteLookupRequest_reason(const grpc_lookup_v1_RouteLookupRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+UPB_INLINE upb_strview grpc_lookup_v1_RouteLookupRequest_stale_header_data(const grpc_lookup_v1_RouteLookupRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_target_type(grpc_lookup_v1_RouteLookupRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest *msg) { _upb_msg_map_clear(msg, UPB_SIZE(20, 40)); }
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_set(grpc_lookup_v1_RouteLookupRequest *msg, upb_strview key, upb_strview val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(20, 40), &key, 0, &val, 0, a); }
+UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_delete(grpc_lookup_v1_RouteLookupRequest *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(20, 40), &key, 0); }
+UPB_INLINE grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_nextmutable(grpc_lookup_v1_RouteLookupRequest *msg, size_t* iter) { return (grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_msg_map_next(msg, UPB_SIZE(20, 40), iter); }
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_reason(grpc_lookup_v1_RouteLookupRequest *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(grpc_lookup_v1_RouteLookupRequest *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
+}
+
+/* grpc.lookup.v1.RouteLookupRequest.KeyMapEntry */
+
+UPB_INLINE upb_strview grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_key(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE upb_strview grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_value(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_value(msg, &ret, 0);
+ return ret;
+}
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_set_value(grpc_lookup_v1_RouteLookupRequest_KeyMapEntry *msg, upb_strview value) {
+ _upb_msg_map_set_value(msg, &value, 0);
+}
+
+/* grpc.lookup.v1.RouteLookupResponse */
+
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse *grpc_lookup_v1_RouteLookupResponse_new(upb_arena *arena) {
+ return (grpc_lookup_v1_RouteLookupResponse *)_upb_msg_new(&grpc_lookup_v1_RouteLookupResponse_msginit, arena);
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse *grpc_lookup_v1_RouteLookupResponse_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ grpc_lookup_v1_RouteLookupResponse *ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE grpc_lookup_v1_RouteLookupResponse *grpc_lookup_v1_RouteLookupResponse_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ grpc_lookup_v1_RouteLookupResponse *ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &grpc_lookup_v1_RouteLookupResponse_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *grpc_lookup_v1_RouteLookupResponse_serialize(const grpc_lookup_v1_RouteLookupResponse *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview grpc_lookup_v1_RouteLookupResponse_header_data(const grpc_lookup_v1_RouteLookupResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
+UPB_INLINE upb_strview const* grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
+
+UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_set_header_data(grpc_lookup_v1_RouteLookupResponse *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
+}
+UPB_INLINE upb_strview* grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse *msg, size_t *len) {
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
+}
+UPB_INLINE upb_strview* grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse *msg, size_t len, upb_arena *arena) {
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(3, 4), arena);
+}
+UPB_INLINE bool grpc_lookup_v1_RouteLookupResponse_add_targets(grpc_lookup_v1_RouteLookupResponse *msg, upb_strview val, upb_arena *arena) {
+ return _upb_array_append_accessor2(msg, UPB_SIZE(8, 16), UPB_SIZE(3, 4), &val,
+ arena);
+}
+
+extern const upb_msglayout_file src_proto_grpc_lookup_v1_rls_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
index 5f5f1edd030..8b9ed246691 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c
@@ -7,41 +7,101 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/migrate.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field udpa_annotations_MigrateAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_MigrateAnnotation_msginit = {
NULL,
&udpa_annotations_MigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field udpa_annotations_FieldMigrateAnnotation__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit = {
NULL,
&udpa_annotations_FieldMigrateAnnotation__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
};
static const upb_msglayout_field udpa_annotations_FileMigrateAnnotation__fields[1] = {
- {2, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {2, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit = {
NULL,
&udpa_annotations_FileMigrateAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 0, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &udpa_annotations_MigrateAnnotation_msginit,
+ &udpa_annotations_FieldMigrateAnnotation_msginit,
+ &udpa_annotations_FileMigrateAnnotation_msginit,
+};
+
+extern const upb_msglayout google_protobuf_EnumOptions_msginit;
+extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
+extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
+extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
+const upb_msglayout_ext udpa_annotations_message_migrate_ext = {
+ {171962766, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_msglayout_ext udpa_annotations_field_migrate_ext = {
+ {171962766, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &udpa_annotations_FieldMigrateAnnotation_msginit},
+
+};
+const upb_msglayout_ext udpa_annotations_enum_migrate_ext = {
+ {171962766, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_EnumOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_msglayout_ext udpa_annotations_enum_value_migrate_ext = {
+ {171962766, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_EnumValueOptions_msginit,
+ {.submsg = &udpa_annotations_MigrateAnnotation_msginit},
+
+};
+const upb_msglayout_ext udpa_annotations_file_migrate_ext = {
+ {171962766, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &udpa_annotations_FileMigrateAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[5] = {
+ &udpa_annotations_message_migrate_ext,
+ &udpa_annotations_field_migrate_ext,
+ &udpa_annotations_enum_migrate_ext,
+ &udpa_annotations_enum_value_migrate_ext,
+ &udpa_annotations_file_migrate_ext,
+};
+
+const upb_msglayout_file udpa_annotations_migrate_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 3,
+ 5,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
index 8d55a775b8a..b879f250afe 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_MIGRATE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -29,6 +29,21 @@ typedef struct udpa_annotations_FileMigrateAnnotation udpa_annotations_FileMigra
extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
+extern const upb_msglayout_ext udpa_annotations_message_migrate_ext;
+extern const upb_msglayout_ext udpa_annotations_field_migrate_ext;
+extern const upb_msglayout_ext udpa_annotations_enum_migrate_ext;
+extern const upb_msglayout_ext udpa_annotations_enum_value_migrate_ext;
+extern const upb_msglayout_ext udpa_annotations_file_migrate_ext;
+struct google_protobuf_EnumOptions;
+struct google_protobuf_EnumValueOptions;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_FileOptions;
+struct google_protobuf_MessageOptions;
+extern const upb_msglayout google_protobuf_EnumOptions_msginit;
+extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
/* udpa.annotations.MigrateAnnotation */
@@ -39,13 +54,19 @@ UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotatio
UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_MigrateAnnotation *ret = udpa_annotations_MigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_MigrateAnnotation *udpa_annotations_MigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_MigrateAnnotation *ret = udpa_annotations_MigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_MigrateAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_MigrateAnnotation_serialize(const udpa_annotations_MigrateAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_MigrateAnnotation_msginit, arena, len);
@@ -65,13 +86,19 @@ UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrat
UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_FieldMigrateAnnotation *ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_FieldMigrateAnnotation *udpa_annotations_FieldMigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_FieldMigrateAnnotation *ret = udpa_annotations_FieldMigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_FieldMigrateAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_FieldMigrateAnnotation_serialize(const udpa_annotations_FieldMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, arena, len);
@@ -95,13 +122,19 @@ UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateA
UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_FileMigrateAnnotation *ret = udpa_annotations_FileMigrateAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_FileMigrateAnnotation *udpa_annotations_FileMigrateAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_FileMigrateAnnotation *ret = udpa_annotations_FileMigrateAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_FileMigrateAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_FileMigrateAnnotation_serialize(const udpa_annotations_FileMigrateAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, arena, len);
@@ -113,6 +146,18 @@ UPB_INLINE void udpa_annotations_FileMigrateAnnotation_set_move_to_package(udpa_
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+UPB_INLINE bool udpa_annotations_has_message_migrate(const struct google_protobuf_MessageOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_message_migrate_ext) != NULL; }
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_message_migrate(const struct google_protobuf_MessageOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_message_migrate_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); }
+UPB_INLINE bool udpa_annotations_has_field_migrate(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_field_migrate_ext) != NULL; }
+UPB_INLINE const udpa_annotations_FieldMigrateAnnotation* udpa_annotations_field_migrate(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_field_migrate_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*); }
+UPB_INLINE bool udpa_annotations_has_enum_migrate(const struct google_protobuf_EnumOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_enum_migrate_ext) != NULL; }
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_migrate(const struct google_protobuf_EnumOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_enum_migrate_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); }
+UPB_INLINE bool udpa_annotations_has_enum_value_migrate(const struct google_protobuf_EnumValueOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_enum_value_migrate_ext) != NULL; }
+UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_value_migrate(const struct google_protobuf_EnumValueOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_enum_value_migrate_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_MigrateAnnotation*); }
+UPB_INLINE bool udpa_annotations_has_file_migrate(const struct google_protobuf_FileOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_file_migrate_ext) != NULL; }
+UPB_INLINE const udpa_annotations_FileMigrateAnnotation* udpa_annotations_file_migrate(const struct google_protobuf_FileOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_file_migrate_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FileMigrateAnnotation*); }
+extern const upb_msglayout_file udpa_annotations_migrate_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
index d135d4f73be..51555c4ac22 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.c
@@ -7,24 +7,46 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/security.upb.h"
#include "udpa/annotations/status.upb.h"
-#include "google/protobuf/any.upb.h"
#include "google/protobuf/descriptor.upb.h"
-#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field udpa_annotations_FieldSecurityAnnotation__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 8, 1},
- {2, UPB_SIZE(1, 1), 0, 0, 8, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(1, 1), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit = {
NULL,
&udpa_annotations_FieldSecurityAnnotation__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &udpa_annotations_FieldSecurityAnnotation_msginit,
+};
+
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
+const upb_msglayout_ext udpa_annotations_security_ext = {
+ {11122993, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &udpa_annotations_FieldSecurityAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &udpa_annotations_security_ext,
+};
+
+const upb_msglayout_file udpa_annotations_security_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 1,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
index 415ba045bdf..239f4901be8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/security.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_SECURITY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,6 +23,9 @@ extern "C" {
struct udpa_annotations_FieldSecurityAnnotation;
typedef struct udpa_annotations_FieldSecurityAnnotation udpa_annotations_FieldSecurityAnnotation;
extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
+extern const upb_msglayout_ext udpa_annotations_security_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
/* udpa.annotations.FieldSecurityAnnotation */
@@ -33,13 +36,19 @@ UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecur
UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_FieldSecurityAnnotation *ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_FieldSecurityAnnotation *udpa_annotations_FieldSecurityAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_FieldSecurityAnnotation *ret = udpa_annotations_FieldSecurityAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_FieldSecurityAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_FieldSecurityAnnotation_serialize(const udpa_annotations_FieldSecurityAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, arena, len);
@@ -55,6 +64,10 @@ UPB_INLINE void udpa_annotations_FieldSecurityAnnotation_set_configure_for_untru
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
+UPB_INLINE bool udpa_annotations_has_security(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_security_ext) != NULL; }
+UPB_INLINE const udpa_annotations_FieldSecurityAnnotation* udpa_annotations_security(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_security_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*); }
+extern const upb_msglayout_file udpa_annotations_security_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
index ca1fcb59aed..9836b5e93d8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c
@@ -7,11 +7,30 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/sensitive.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+const upb_msglayout_ext udpa_annotations_sensitive_ext = {
+ {76569463, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = NULL},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &udpa_annotations_sensitive_ext,
+};
+
+const upb_msglayout_file udpa_annotations_sensitive_proto_upb_file_layout = {
+ NULL,
+ extensions_layout,
+ 0,
+ 1,
+};
+
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
index 69f2a862967..ca73cdca8c8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_SENSITIVE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -20,6 +20,13 @@
extern "C" {
#endif
+extern const upb_msglayout_ext udpa_annotations_sensitive_ext;
+struct google_protobuf_FieldOptions;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+
+UPB_INLINE bool udpa_annotations_has_sensitive(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_sensitive_ext) != NULL; }
+UPB_INLINE bool udpa_annotations_sensitive(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_sensitive_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+extern const upb_msglayout_file udpa_annotations_sensitive_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
index 16b0181ab80..a9bd5697b3f 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.c
@@ -7,21 +7,45 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/status.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field udpa_annotations_StatusAnnotation__fields[2] = {
- {1, UPB_SIZE(4, 4), 0, 0, 8, 1},
- {2, UPB_SIZE(0, 0), 0, 0, 14, 1},
+ {1, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_StatusAnnotation_msginit = {
NULL,
&udpa_annotations_StatusAnnotation__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &udpa_annotations_StatusAnnotation_msginit,
+};
+
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
+extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
+const upb_msglayout_ext udpa_annotations_file_status_ext = {
+ {222707719, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &udpa_annotations_StatusAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &udpa_annotations_file_status_ext,
+};
+
+const upb_msglayout_file udpa_annotations_status_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 1,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
index a55570df678..986d0d07aef 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/status.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_STATUS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,6 +23,9 @@ extern "C" {
struct udpa_annotations_StatusAnnotation;
typedef struct udpa_annotations_StatusAnnotation udpa_annotations_StatusAnnotation;
extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
+extern const upb_msglayout_ext udpa_annotations_file_status_ext;
+struct google_protobuf_FileOptions;
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
typedef enum {
udpa_annotations_UNKNOWN = 0,
@@ -40,13 +43,19 @@ UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_
UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_StatusAnnotation *ret = udpa_annotations_StatusAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_StatusAnnotation *udpa_annotations_StatusAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_StatusAnnotation *ret = udpa_annotations_StatusAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_StatusAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_StatusAnnotation_serialize(const udpa_annotations_StatusAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_StatusAnnotation_msginit, arena, len);
@@ -62,6 +71,10 @@ UPB_INLINE void udpa_annotations_StatusAnnotation_set_package_version_status(udp
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}
+UPB_INLINE bool udpa_annotations_has_file_status(const struct google_protobuf_FileOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_file_status_ext) != NULL; }
+UPB_INLINE const udpa_annotations_StatusAnnotation* udpa_annotations_file_status(const struct google_protobuf_FileOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_file_status_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_StatusAnnotation*); }
+extern const upb_msglayout_file udpa_annotations_status_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
index 253afc858b6..facdbd01c7d 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
@@ -7,20 +7,44 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "udpa/annotations/versioning.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field udpa_annotations_VersioningAnnotation__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout udpa_annotations_VersioningAnnotation_msginit = {
NULL,
&udpa_annotations_VersioningAnnotation__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &udpa_annotations_VersioningAnnotation_msginit,
+};
+
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
+const upb_msglayout_ext udpa_annotations_versioning_ext = {
+ {7881811, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &udpa_annotations_VersioningAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[1] = {
+ &udpa_annotations_versioning_ext,
+};
+
+const upb_msglayout_file udpa_annotations_versioning_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 1,
+ 1,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
index e39f8c397c7..8e5da862893 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
@@ -9,7 +9,7 @@
#ifndef UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
#define UDPA_ANNOTATIONS_VERSIONING_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -23,6 +23,9 @@ extern "C" {
struct udpa_annotations_VersioningAnnotation;
typedef struct udpa_annotations_VersioningAnnotation udpa_annotations_VersioningAnnotation;
extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
+extern const upb_msglayout_ext udpa_annotations_versioning_ext;
+struct google_protobuf_MessageOptions;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
/* udpa.annotations.VersioningAnnotation */
@@ -33,13 +36,19 @@ UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnn
UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_annotations_VersioningAnnotation *ret = udpa_annotations_VersioningAnnotation_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE udpa_annotations_VersioningAnnotation *udpa_annotations_VersioningAnnotation_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
udpa_annotations_VersioningAnnotation *ret = udpa_annotations_VersioningAnnotation_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &udpa_annotations_VersioningAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *udpa_annotations_VersioningAnnotation_serialize(const udpa_annotations_VersioningAnnotation *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_annotations_VersioningAnnotation_msginit, arena, len);
@@ -51,6 +60,10 @@ UPB_INLINE void udpa_annotations_VersioningAnnotation_set_previous_message_type(
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+UPB_INLINE bool udpa_annotations_has_versioning(const struct google_protobuf_MessageOptions *msg) { return _upb_msg_getext(msg, &udpa_annotations_versioning_ext) != NULL; }
+UPB_INLINE const udpa_annotations_VersioningAnnotation* udpa_annotations_versioning(const struct google_protobuf_MessageOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &udpa_annotations_versioning_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const udpa_annotations_VersioningAnnotation*); }
+extern const upb_msglayout_file udpa_annotations_versioning_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
deleted file mode 100644
index e5069b7f13b..00000000000
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/data/orca/v1/orca_load_report.upb.h"
-#include "validate/validate.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_data_orca_v1_OrcaLoadReport_submsgs[2] = {
- &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit,
- &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit,
-};
-
-static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport__fields[5] = {
- {1, UPB_SIZE(0, 0), 0, 0, 1, 1},
- {2, UPB_SIZE(8, 8), 0, 0, 1, 1},
- {3, UPB_SIZE(16, 16), 0, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 0, 0, 11, _UPB_LABEL_MAP},
- {5, UPB_SIZE(28, 32), 0, 1, 11, _UPB_LABEL_MAP},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit = {
- &udpa_data_orca_v1_OrcaLoadReport_submsgs[0],
- &udpa_data_orca_v1_OrcaLoadReport__fields[0],
- UPB_SIZE(32, 40), 5, false, 255,
-};
-
-static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit = {
- NULL,
- &udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-static const upb_msglayout_field udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 1, 1},
-};
-
-const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit = {
- NULL,
- &udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
deleted file mode 100644
index e5923cc5e12..00000000000
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/data/orca/v1/orca_load_report.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
-#define UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_data_orca_v1_OrcaLoadReport;
-struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
-struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
-typedef struct udpa_data_orca_v1_OrcaLoadReport udpa_data_orca_v1_OrcaLoadReport;
-typedef struct udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry;
-typedef struct udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_msginit;
-extern const upb_msglayout udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_msginit;
-
-
-/* udpa.data.orca.v1.OrcaLoadReport */
-
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_new(upb_arena *arena) {
- return (udpa_data_orca_v1_OrcaLoadReport *)_upb_msg_new(&udpa_data_orca_v1_OrcaLoadReport_msginit, arena);
-}
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport *udpa_data_orca_v1_OrcaLoadReport_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_data_orca_v1_OrcaLoadReport *ret = udpa_data_orca_v1_OrcaLoadReport_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *udpa_data_orca_v1_OrcaLoadReport_serialize(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_data_orca_v1_OrcaLoadReport_msginit, arena, len);
-}
-
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_cpu_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_mem_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
-UPB_INLINE uint64_t udpa_data_orca_v1_OrcaLoadReport_rps(const udpa_data_orca_v1_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_request_cost(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_request_cost_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(24, 24), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_has_utilization(const udpa_data_orca_v1_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE size_t udpa_data_orca_v1_OrcaLoadReport_utilization_size(const udpa_data_orca_v1_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_get(const udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 32), &key, 0, val, sizeof(*val)); }
-UPB_INLINE const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_next(const udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
-
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_cpu_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
-}
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_mem_utilization(udpa_data_orca_v1_OrcaLoadReport *msg, double value) {
- *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
-}
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_set_rps(udpa_data_orca_v1_OrcaLoadReport *msg, uint64_t value) {
- *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
-}
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_request_cost_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 24)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(24, 24), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_request_cost_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(24, 24), &key, 0); }
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry* udpa_data_orca_v1_OrcaLoadReport_request_cost_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_utilization_clear(udpa_data_orca_v1_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 32)); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_set(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 32), &key, 0, &val, sizeof(val), a); }
-UPB_INLINE bool udpa_data_orca_v1_OrcaLoadReport_utilization_delete(udpa_data_orca_v1_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 32), &key, 0); }
-UPB_INLINE udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry* udpa_data_orca_v1_OrcaLoadReport_utilization_nextmutable(udpa_data_orca_v1_OrcaLoadReport *msg, size_t* iter) { return (udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
-
-/* udpa.data.orca.v1.OrcaLoadReport.RequestCostEntry */
-
-UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_key(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_value(const udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg) {
- double ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_RequestCostEntry *msg, double value) {
- _upb_msg_map_set_value(msg, &value, sizeof(double));
-}
-
-/* udpa.data.orca.v1.OrcaLoadReport.UtilizationEntry */
-
-UPB_INLINE upb_strview udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_key(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
- upb_strview ret;
- _upb_msg_map_key(msg, &ret, 0);
- return ret;
-}
-UPB_INLINE double udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_value(const udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg) {
- double ret;
- _upb_msg_map_value(msg, &ret, sizeof(ret));
- return ret;
-}
-
-UPB_INLINE void udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry_set_value(udpa_data_orca_v1_OrcaLoadReport_UtilizationEntry *msg, double value) {
- _upb_msg_map_set_value(msg, &value, sizeof(double));
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_DATA_ORCA_V1_ORCA_LOAD_REPORT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
deleted file mode 100644
index 24407fa6eac..00000000000
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include <stddef.h>
-#include "upb/msg.h"
-#include "udpa/type/v1/typed_struct.upb.h"
-#include "validate/validate.upb.h"
-#include "google/protobuf/struct.upb.h"
-
-#include "upb/port_def.inc"
-
-static const upb_msglayout *const udpa_type_v1_TypedStruct_submsgs[1] = {
- &google_protobuf_Struct_msginit,
-};
-
-static const upb_msglayout_field udpa_type_v1_TypedStruct__fields[2] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 1, 0, 11, 1},
-};
-
-const upb_msglayout udpa_type_v1_TypedStruct_msginit = {
- &udpa_type_v1_TypedStruct_submsgs[0],
- &udpa_type_v1_TypedStruct__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
-};
-
-#include "upb/port_undef.inc"
-
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
deleted file mode 100644
index 2dd03ff12d7..00000000000
--- a/contrib/libs/grpc/src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
-#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
-
-#include "upb/msg.h"
-#include "upb/decode.h"
-#include "upb/decode_fast.h"
-#include "upb/encode.h"
-
-#include "upb/port_def.inc"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct udpa_type_v1_TypedStruct;
-typedef struct udpa_type_v1_TypedStruct udpa_type_v1_TypedStruct;
-extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
-struct google_protobuf_Struct;
-extern const upb_msglayout google_protobuf_Struct_msginit;
-
-
-/* udpa.type.v1.TypedStruct */
-
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_new(upb_arena *arena) {
- return (udpa_type_v1_TypedStruct *)_upb_msg_new(&udpa_type_v1_TypedStruct_msginit, arena);
-}
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse(const char *buf, size_t size,
- upb_arena *arena) {
- udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
- return (ret && upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena)) ? ret : NULL;
-}
-UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
- udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
- return (ret && _upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena, options))
- ? ret : NULL;
-}
-UPB_INLINE char *udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len) {
- return upb_encode(msg, &udpa_type_v1_TypedStruct_msginit, arena, len);
-}
-
-UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
-UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE const struct google_protobuf_Struct* udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
-
-UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value) {
- *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
-}
-UPB_INLINE void udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct *msg, struct google_protobuf_Struct* value) {
- _upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
-}
-UPB_INLINE struct google_protobuf_Struct* udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct *msg, upb_arena *arena) {
- struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)udpa_type_v1_TypedStruct_value(msg);
- if (sub == NULL) {
- sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
- if (!sub) return NULL;
- udpa_type_v1_TypedStruct_set_value(msg, sub);
- }
- return sub;
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
index ec2888eeac1..9fdfae872de 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.c
@@ -7,7 +7,7 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "validate/validate.upb.h"
#include "google/protobuf/descriptor.upb.h"
#include "google/protobuf/duration.upb.h"
@@ -15,433 +15,518 @@
#include "upb/port_def.inc"
-static const upb_msglayout *const validate_FieldRules_submsgs[22] = {
- &validate_AnyRules_msginit,
- &validate_BoolRules_msginit,
- &validate_BytesRules_msginit,
- &validate_DoubleRules_msginit,
- &validate_DurationRules_msginit,
- &validate_EnumRules_msginit,
- &validate_Fixed32Rules_msginit,
- &validate_Fixed64Rules_msginit,
- &validate_FloatRules_msginit,
- &validate_Int32Rules_msginit,
- &validate_Int64Rules_msginit,
- &validate_MapRules_msginit,
- &validate_MessageRules_msginit,
- &validate_RepeatedRules_msginit,
- &validate_SFixed32Rules_msginit,
- &validate_SFixed64Rules_msginit,
- &validate_SInt32Rules_msginit,
- &validate_SInt64Rules_msginit,
- &validate_StringRules_msginit,
- &validate_TimestampRules_msginit,
- &validate_UInt32Rules_msginit,
- &validate_UInt64Rules_msginit,
+static const upb_msglayout_sub validate_FieldRules_submsgs[22] = {
+ {.submsg = &validate_AnyRules_msginit},
+ {.submsg = &validate_BoolRules_msginit},
+ {.submsg = &validate_BytesRules_msginit},
+ {.submsg = &validate_DoubleRules_msginit},
+ {.submsg = &validate_DurationRules_msginit},
+ {.submsg = &validate_EnumRules_msginit},
+ {.submsg = &validate_Fixed32Rules_msginit},
+ {.submsg = &validate_Fixed64Rules_msginit},
+ {.submsg = &validate_FloatRules_msginit},
+ {.submsg = &validate_Int32Rules_msginit},
+ {.submsg = &validate_Int64Rules_msginit},
+ {.submsg = &validate_MapRules_msginit},
+ {.submsg = &validate_MessageRules_msginit},
+ {.submsg = &validate_RepeatedRules_msginit},
+ {.submsg = &validate_SFixed32Rules_msginit},
+ {.submsg = &validate_SFixed64Rules_msginit},
+ {.submsg = &validate_SInt32Rules_msginit},
+ {.submsg = &validate_SInt64Rules_msginit},
+ {.submsg = &validate_StringRules_msginit},
+ {.submsg = &validate_TimestampRules_msginit},
+ {.submsg = &validate_UInt32Rules_msginit},
+ {.submsg = &validate_UInt64Rules_msginit},
};
static const upb_msglayout_field validate_FieldRules__fields[22] = {
- {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 8, 11, 1},
- {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, 1},
- {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 9, 11, 1},
- {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 10, 11, 1},
- {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 20, 11, 1},
- {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 21, 11, 1},
- {7, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 16, 11, 1},
- {8, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 17, 11, 1},
- {9, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 6, 11, 1},
- {10, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 7, 11, 1},
- {11, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 14, 11, 1},
- {12, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 15, 11, 1},
- {13, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, 1},
- {14, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 18, 11, 1},
- {15, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, 1},
- {16, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 5, 11, 1},
- {17, UPB_SIZE(4, 8), 1, 12, 11, 1},
- {18, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 13, 11, 1},
- {19, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 11, 11, 1},
- {20, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, 1},
- {21, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 4, 11, 1},
- {22, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 19, 11, 1},
+ {1, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 8, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 3, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 9, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 10, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 20, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 21, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 16, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 17, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 6, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 7, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 14, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 15, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 18, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 2, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 5, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(4, 8), 1, 12, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 13, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 11, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 4, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(8, 16), UPB_SIZE(-13, -25), 19, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_FieldRules_msginit = {
&validate_FieldRules_submsgs[0],
&validate_FieldRules__fields[0],
- UPB_SIZE(16, 32), 22, false, 255,
+ UPB_SIZE(16, 32), 22, _UPB_MSGEXT_NONE, 22, 255,
};
-static const upb_msglayout_field validate_FloatRules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 2, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 2, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 2, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 2, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 2, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 2, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 2, 3},
+static const upb_msglayout_field validate_FloatRules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 2, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 2, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 2, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_FloatRules_msginit = {
NULL,
&validate_FloatRules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_DoubleRules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 1, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 1, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 1, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 1, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 1, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 1, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 1, 3},
+static const upb_msglayout_field validate_DoubleRules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 1, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 1, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_DoubleRules_msginit = {
NULL,
&validate_DoubleRules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_Int32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 5, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 5, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 5, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 5, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 5, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 5, 3},
+static const upb_msglayout_field validate_Int32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_Int32Rules_msginit = {
NULL,
&validate_Int32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_Int64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 3, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 3, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 3, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 3, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 3, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 3, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 3, 3},
+static const upb_msglayout_field validate_Int64Rules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 3, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 3, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 3, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_Int64Rules_msginit = {
NULL,
&validate_Int64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_UInt32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 13, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 13, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 13, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 13, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 13, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 13, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 13, 3},
+static const upb_msglayout_field validate_UInt32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 13, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 13, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 13, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_UInt32Rules_msginit = {
NULL,
&validate_UInt32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_UInt64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 4, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 4, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 4, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 4, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 4, 3},
+static const upb_msglayout_field validate_UInt64Rules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 4, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 4, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_UInt64Rules_msginit = {
NULL,
&validate_UInt64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_SInt32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 17, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 17, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 17, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 17, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 17, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 17, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 17, 3},
+static const upb_msglayout_field validate_SInt32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 17, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 17, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 17, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 17, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 17, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 17, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 17, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_SInt32Rules_msginit = {
NULL,
&validate_SInt32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_SInt64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 18, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 18, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 18, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 18, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 18, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 18, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 18, 3},
+static const upb_msglayout_field validate_SInt64Rules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 18, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 18, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 18, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 18, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 18, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 18, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 18, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_SInt64Rules_msginit = {
NULL,
&validate_SInt64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_Fixed32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 7, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 7, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 7, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 7, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 7, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 7, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 7, 3},
+static const upb_msglayout_field validate_Fixed32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 7, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 7, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 7, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 7, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 7, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 7, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 7, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_Fixed32Rules_msginit = {
NULL,
&validate_Fixed32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_Fixed64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 6, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 6, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 6, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 6, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 6, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 6, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 6, 3},
+static const upb_msglayout_field validate_Fixed64Rules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 6, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 6, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 6, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 6, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 6, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 6, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 6, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_Fixed64Rules_msginit = {
NULL,
&validate_Fixed64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_SFixed32Rules__fields[7] = {
- {1, UPB_SIZE(4, 4), 1, 0, 15, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 15, 1},
- {3, UPB_SIZE(12, 12), 3, 0, 15, 1},
- {4, UPB_SIZE(16, 16), 4, 0, 15, 1},
- {5, UPB_SIZE(20, 20), 5, 0, 15, 1},
- {6, UPB_SIZE(24, 24), 0, 0, 15, 3},
- {7, UPB_SIZE(28, 32), 0, 0, 15, 3},
+static const upb_msglayout_field validate_SFixed32Rules__fields[8] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 15, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 15, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 12), 3, 0, 15, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 16), 4, 0, 15, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 20), 5, 0, 15, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 32), 0, 0, 15, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(32, 40), 0, 0, 15, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(24, 24), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_SFixed32Rules_msginit = {
NULL,
&validate_SFixed32Rules__fields[0],
- UPB_SIZE(32, 40), 7, false, 255,
+ UPB_SIZE(40, 48), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout_field validate_SFixed64Rules__fields[7] = {
- {1, UPB_SIZE(8, 8), 1, 0, 16, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 16, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 16, 1},
- {4, UPB_SIZE(32, 32), 4, 0, 16, 1},
- {5, UPB_SIZE(40, 40), 5, 0, 16, 1},
- {6, UPB_SIZE(48, 48), 0, 0, 16, 3},
- {7, UPB_SIZE(52, 56), 0, 0, 16, 3},
+static const upb_msglayout_field validate_SFixed64Rules__fields[8] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 16, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 16, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 16, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(32, 32), 4, 0, 16, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(40, 40), 5, 0, 16, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(52, 56), 0, 0, 16, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(56, 64), 0, 0, 16, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(48, 48), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_SFixed64Rules_msginit = {
NULL,
&validate_SFixed64Rules__fields[0],
- UPB_SIZE(56, 64), 7, false, 255,
+ UPB_SIZE(64, 72), 8, _UPB_MSGEXT_NONE, 8, 255,
};
static const upb_msglayout_field validate_BoolRules__fields[1] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_BoolRules_msginit = {
NULL,
&validate_BoolRules__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
-};
-
-static const upb_msglayout_field validate_StringRules__fields[25] = {
- {1, UPB_SIZE(60, 64), 1, 0, 12, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 3, 0, 4, 1},
- {4, UPB_SIZE(24, 24), 4, 0, 4, 1},
- {5, UPB_SIZE(32, 32), 5, 0, 4, 1},
- {6, UPB_SIZE(68, 80), 6, 0, 12, 1},
- {7, UPB_SIZE(76, 96), 7, 0, 12, 1},
- {8, UPB_SIZE(84, 112), 8, 0, 12, 1},
- {9, UPB_SIZE(92, 128), 9, 0, 12, 1},
- {10, UPB_SIZE(108, 160), 0, 0, 12, 3},
- {11, UPB_SIZE(112, 168), 0, 0, 12, 3},
- {12, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {13, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {14, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {15, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {16, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {17, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {18, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {19, UPB_SIZE(40, 40), 10, 0, 4, 1},
- {20, UPB_SIZE(48, 48), 11, 0, 4, 1},
- {21, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {22, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, 1},
- {23, UPB_SIZE(100, 144), 12, 0, 12, 1},
- {24, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 14, 1},
- {25, UPB_SIZE(56, 56), 13, 0, 8, 1},
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field validate_StringRules__fields[26] = {
+ {1, UPB_SIZE(60, 64), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 3, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 24), 4, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 32), 5, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(68, 80), 6, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(76, 96), 7, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(84, 112), 8, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(92, 128), 9, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(108, 160), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(112, 168), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {15, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {16, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {17, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {18, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {19, UPB_SIZE(40, 40), 10, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {20, UPB_SIZE(48, 48), 11, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {21, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {22, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {23, UPB_SIZE(100, 144), 12, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {24, UPB_SIZE(116, 176), UPB_SIZE(-121, -181), 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {25, UPB_SIZE(56, 56), 13, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {26, UPB_SIZE(57, 57), 14, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_StringRules_msginit = {
NULL,
&validate_StringRules__fields[0],
- UPB_SIZE(128, 192), 25, false, 255,
-};
-
-static const upb_msglayout_field validate_BytesRules__fields[13] = {
- {1, UPB_SIZE(32, 32), 1, 0, 12, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 4, 1},
- {3, UPB_SIZE(16, 16), 3, 0, 4, 1},
- {4, UPB_SIZE(40, 48), 4, 0, 12, 1},
- {5, UPB_SIZE(48, 64), 5, 0, 12, 1},
- {6, UPB_SIZE(56, 80), 6, 0, 12, 1},
- {7, UPB_SIZE(64, 96), 7, 0, 12, 1},
- {8, UPB_SIZE(72, 112), 0, 0, 12, 3},
- {9, UPB_SIZE(76, 120), 0, 0, 12, 3},
- {10, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {11, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {12, UPB_SIZE(80, 128), UPB_SIZE(-85, -133), 0, 8, 1},
- {13, UPB_SIZE(24, 24), 8, 0, 4, 1},
+ UPB_SIZE(128, 192), 26, _UPB_MSGEXT_NONE, 26, 255,
+};
+
+static const upb_msglayout_field validate_BytesRules__fields[14] = {
+ {1, UPB_SIZE(36, 40), 1, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 3, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(44, 56), 4, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(52, 72), 5, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(60, 88), 6, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(68, 104), 7, 0, 12, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(76, 120), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(80, 128), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {10, UPB_SIZE(84, 136), UPB_SIZE(-89, -141), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {11, UPB_SIZE(84, 136), UPB_SIZE(-89, -141), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {12, UPB_SIZE(84, 136), UPB_SIZE(-89, -141), 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {13, UPB_SIZE(24, 24), 8, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {14, UPB_SIZE(32, 32), 9, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_BytesRules_msginit = {
NULL,
&validate_BytesRules__fields[0],
- UPB_SIZE(88, 144), 13, false, 255,
+ UPB_SIZE(96, 144), 14, _UPB_MSGEXT_NONE, 14, 255,
};
static const upb_msglayout_field validate_EnumRules__fields[4] = {
- {1, UPB_SIZE(4, 4), 1, 0, 5, 1},
- {2, UPB_SIZE(8, 8), 2, 0, 8, 1},
- {3, UPB_SIZE(12, 16), 0, 0, 5, 3},
- {4, UPB_SIZE(16, 24), 0, 0, 5, 3},
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 24), 0, 0, 5, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_EnumRules_msginit = {
NULL,
&validate_EnumRules__fields[0],
- UPB_SIZE(24, 32), 4, false, 255,
+ UPB_SIZE(24, 32), 4, _UPB_MSGEXT_NONE, 4, 255,
};
static const upb_msglayout_field validate_MessageRules__fields[2] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(2, 2), 2, 0, 8, 1},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(2, 2), 2, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_MessageRules_msginit = {
NULL,
&validate_MessageRules__fields[0],
- UPB_SIZE(8, 8), 2, false, 255,
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const validate_RepeatedRules_submsgs[1] = {
- &validate_FieldRules_msginit,
+static const upb_msglayout_sub validate_RepeatedRules_submsgs[1] = {
+ {.submsg = &validate_FieldRules_msginit},
};
-static const upb_msglayout_field validate_RepeatedRules__fields[4] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 8, 1},
- {4, UPB_SIZE(28, 32), 4, 0, 11, 1},
+static const upb_msglayout_field validate_RepeatedRules__fields[5] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 32), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(25, 25), 5, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_RepeatedRules_msginit = {
&validate_RepeatedRules_submsgs[0],
&validate_RepeatedRules__fields[0],
- UPB_SIZE(32, 40), 4, false, 255,
+ UPB_SIZE(32, 40), 5, _UPB_MSGEXT_NONE, 5, 255,
};
-static const upb_msglayout *const validate_MapRules_submsgs[1] = {
- &validate_FieldRules_msginit,
+static const upb_msglayout_sub validate_MapRules_submsgs[1] = {
+ {.submsg = &validate_FieldRules_msginit},
};
-static const upb_msglayout_field validate_MapRules__fields[5] = {
- {1, UPB_SIZE(8, 8), 1, 0, 4, 1},
- {2, UPB_SIZE(16, 16), 2, 0, 4, 1},
- {3, UPB_SIZE(24, 24), 3, 0, 8, 1},
- {4, UPB_SIZE(28, 32), 4, 0, 11, 1},
- {5, UPB_SIZE(32, 40), 5, 0, 11, 1},
+static const upb_msglayout_field validate_MapRules__fields[6] = {
+ {1, UPB_SIZE(8, 8), 1, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(16, 16), 2, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(24, 24), 3, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 32), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 40), 5, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(25, 25), 6, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_MapRules_msginit = {
&validate_MapRules_submsgs[0],
&validate_MapRules__fields[0],
- UPB_SIZE(40, 48), 5, false, 255,
+ UPB_SIZE(40, 48), 6, _UPB_MSGEXT_NONE, 6, 255,
};
static const upb_msglayout_field validate_AnyRules__fields[3] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 12, 3},
- {3, UPB_SIZE(8, 16), 0, 0, 12, 3},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 0, 0, 12, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_AnyRules_msginit = {
NULL,
&validate_AnyRules__fields[0],
- UPB_SIZE(16, 24), 3, false, 255,
+ UPB_SIZE(16, 24), 3, _UPB_MSGEXT_NONE, 3, 255,
};
-static const upb_msglayout *const validate_DurationRules_submsgs[1] = {
- &google_protobuf_Duration_msginit,
+static const upb_msglayout_sub validate_DurationRules_submsgs[1] = {
+ {.submsg = &google_protobuf_Duration_msginit},
};
static const upb_msglayout_field validate_DurationRules__fields[8] = {
- {1, UPB_SIZE(1, 1), 1, 0, 8, 1},
- {2, UPB_SIZE(4, 8), 2, 0, 11, 1},
- {3, UPB_SIZE(8, 16), 3, 0, 11, 1},
- {4, UPB_SIZE(12, 24), 4, 0, 11, 1},
- {5, UPB_SIZE(16, 32), 5, 0, 11, 1},
- {6, UPB_SIZE(20, 40), 6, 0, 11, 1},
- {7, UPB_SIZE(24, 48), 0, 0, 11, 3},
- {8, UPB_SIZE(28, 56), 0, 0, 11, 3},
+ {1, UPB_SIZE(1, 1), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(8, 16), 3, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(12, 24), 4, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(16, 32), 5, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(20, 40), 6, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(24, 48), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(28, 56), 0, 0, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_DurationRules_msginit = {
&validate_DurationRules_submsgs[0],
&validate_DurationRules__fields[0],
- UPB_SIZE(32, 64), 8, false, 255,
+ UPB_SIZE(32, 64), 8, _UPB_MSGEXT_NONE, 8, 255,
};
-static const upb_msglayout *const validate_TimestampRules_submsgs[2] = {
- &google_protobuf_Duration_msginit,
- &google_protobuf_Timestamp_msginit,
+static const upb_msglayout_sub validate_TimestampRules_submsgs[2] = {
+ {.submsg = &google_protobuf_Duration_msginit},
+ {.submsg = &google_protobuf_Timestamp_msginit},
};
static const upb_msglayout_field validate_TimestampRules__fields[9] = {
- {1, UPB_SIZE(2, 2), 1, 0, 8, 1},
- {2, UPB_SIZE(8, 8), 2, 1, 11, 1},
- {3, UPB_SIZE(12, 16), 3, 1, 11, 1},
- {4, UPB_SIZE(16, 24), 4, 1, 11, 1},
- {5, UPB_SIZE(20, 32), 5, 1, 11, 1},
- {6, UPB_SIZE(24, 40), 6, 1, 11, 1},
- {7, UPB_SIZE(3, 3), 7, 0, 8, 1},
- {8, UPB_SIZE(4, 4), 8, 0, 8, 1},
- {9, UPB_SIZE(28, 48), 9, 0, 11, 1},
+ {1, UPB_SIZE(2, 2), 1, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 2, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 16), 3, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(16, 24), 4, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(20, 32), 5, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(24, 40), 6, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {7, UPB_SIZE(3, 3), 7, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {8, UPB_SIZE(4, 4), 8, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {9, UPB_SIZE(28, 48), 9, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout validate_TimestampRules_msginit = {
&validate_TimestampRules_submsgs[0],
&validate_TimestampRules__fields[0],
- UPB_SIZE(32, 56), 9, false, 255,
+ UPB_SIZE(32, 56), 9, _UPB_MSGEXT_NONE, 9, 255,
+};
+
+static const upb_msglayout *messages_layout[23] = {
+ &validate_FieldRules_msginit,
+ &validate_FloatRules_msginit,
+ &validate_DoubleRules_msginit,
+ &validate_Int32Rules_msginit,
+ &validate_Int64Rules_msginit,
+ &validate_UInt32Rules_msginit,
+ &validate_UInt64Rules_msginit,
+ &validate_SInt32Rules_msginit,
+ &validate_SInt64Rules_msginit,
+ &validate_Fixed32Rules_msginit,
+ &validate_Fixed64Rules_msginit,
+ &validate_SFixed32Rules_msginit,
+ &validate_SFixed64Rules_msginit,
+ &validate_BoolRules_msginit,
+ &validate_StringRules_msginit,
+ &validate_BytesRules_msginit,
+ &validate_EnumRules_msginit,
+ &validate_MessageRules_msginit,
+ &validate_RepeatedRules_msginit,
+ &validate_MapRules_msginit,
+ &validate_AnyRules_msginit,
+ &validate_DurationRules_msginit,
+ &validate_TimestampRules_msginit,
+};
+
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+extern const upb_msglayout google_protobuf_OneofOptions_msginit;
+extern const upb_msglayout validate_FieldRules_msginit;
+const upb_msglayout_ext validate_disabled_ext = {
+ {1071, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext validate_ignored_ext = {
+ {1072, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext validate_required_ext = {
+ {1071, 0, 0, 0, 8, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ &google_protobuf_OneofOptions_msginit,
+ {.submsg = NULL},
+
+};
+const upb_msglayout_ext validate_rules_ext = {
+ {1071, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &validate_FieldRules_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[4] = {
+ &validate_disabled_ext,
+ &validate_ignored_ext,
+ &validate_required_ext,
+ &validate_rules_ext,
+};
+
+const upb_msglayout_file validate_validate_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 23,
+ 4,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
index dcde0a9b4f4..f74e0501074 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/validate/validate.upb.h
@@ -9,7 +9,7 @@
#ifndef VALIDATE_VALIDATE_PROTO_UPB_H_
#define VALIDATE_VALIDATE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -89,9 +89,19 @@ extern const upb_msglayout validate_MapRules_msginit;
extern const upb_msglayout validate_AnyRules_msginit;
extern const upb_msglayout validate_DurationRules_msginit;
extern const upb_msglayout validate_TimestampRules_msginit;
+extern const upb_msglayout_ext validate_disabled_ext;
+extern const upb_msglayout_ext validate_ignored_ext;
+extern const upb_msglayout_ext validate_required_ext;
+extern const upb_msglayout_ext validate_rules_ext;
struct google_protobuf_Duration;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_MessageOptions;
+struct google_protobuf_OneofOptions;
struct google_protobuf_Timestamp;
extern const upb_msglayout google_protobuf_Duration_msginit;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+extern const upb_msglayout google_protobuf_OneofOptions_msginit;
extern const upb_msglayout google_protobuf_Timestamp_msginit;
typedef enum {
@@ -109,13 +119,19 @@ UPB_INLINE validate_FieldRules *validate_FieldRules_new(upb_arena *arena) {
UPB_INLINE validate_FieldRules *validate_FieldRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_FieldRules *ret = validate_FieldRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_FieldRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_FieldRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_FieldRules *validate_FieldRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_FieldRules *ret = validate_FieldRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_FieldRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_FieldRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_FieldRules_serialize(const validate_FieldRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_FieldRules_msginit, arena, len);
@@ -466,13 +482,19 @@ UPB_INLINE validate_FloatRules *validate_FloatRules_new(upb_arena *arena) {
UPB_INLINE validate_FloatRules *validate_FloatRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_FloatRules *ret = validate_FloatRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_FloatRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_FloatRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_FloatRules *validate_FloatRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_FloatRules *ret = validate_FloatRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_FloatRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_FloatRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_FloatRules_serialize(const validate_FloatRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_FloatRules_msginit, arena, len);
@@ -488,8 +510,10 @@ UPB_INLINE bool validate_FloatRules_has_gt(const validate_FloatRules *msg) { ret
UPB_INLINE float validate_FloatRules_gt(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), float); }
UPB_INLINE bool validate_FloatRules_has_gte(const validate_FloatRules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE float validate_FloatRules_gte(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), float); }
-UPB_INLINE float const* validate_FloatRules_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE float const* validate_FloatRules_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE float const* validate_FloatRules_not_in(const validate_FloatRules *msg, size_t *len) { return (float const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_FloatRules_has_ignore_empty(const validate_FloatRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_FloatRules_ignore_empty(const validate_FloatRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_FloatRules_set_const(validate_FloatRules *msg, float value) {
_upb_sethas(msg, 1);
@@ -512,25 +536,29 @@ UPB_INLINE void validate_FloatRules_set_gte(validate_FloatRules *msg, float valu
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), float) = value;
}
UPB_INLINE float* validate_FloatRules_mutable_in(validate_FloatRules *msg, size_t *len) {
- return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE float* validate_FloatRules_resize_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_FloatRules_add_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE float* validate_FloatRules_mutable_not_in(validate_FloatRules *msg, size_t *len) {
- return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (float*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE float* validate_FloatRules_resize_not_in(validate_FloatRules *msg, size_t len, upb_arena *arena) {
- return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (float*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_FloatRules_add_not_in(validate_FloatRules *msg, float val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_FloatRules_set_ignore_empty(validate_FloatRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.DoubleRules */
@@ -540,13 +568,19 @@ UPB_INLINE validate_DoubleRules *validate_DoubleRules_new(upb_arena *arena) {
UPB_INLINE validate_DoubleRules *validate_DoubleRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_DoubleRules *ret = validate_DoubleRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_DoubleRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_DoubleRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_DoubleRules *validate_DoubleRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_DoubleRules *ret = validate_DoubleRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_DoubleRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_DoubleRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_DoubleRules_serialize(const validate_DoubleRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_DoubleRules_msginit, arena, len);
@@ -562,8 +596,10 @@ UPB_INLINE bool validate_DoubleRules_has_gt(const validate_DoubleRules *msg) { r
UPB_INLINE double validate_DoubleRules_gt(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), double); }
UPB_INLINE bool validate_DoubleRules_has_gte(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE double validate_DoubleRules_gte(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), double); }
-UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE double const* validate_DoubleRules_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE double const* validate_DoubleRules_not_in(const validate_DoubleRules *msg, size_t *len) { return (double const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_DoubleRules_has_ignore_empty(const validate_DoubleRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_DoubleRules_ignore_empty(const validate_DoubleRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_DoubleRules_set_const(validate_DoubleRules *msg, double value) {
_upb_sethas(msg, 1);
@@ -586,25 +622,29 @@ UPB_INLINE void validate_DoubleRules_set_gte(validate_DoubleRules *msg, double v
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), double) = value;
}
UPB_INLINE double* validate_DoubleRules_mutable_in(validate_DoubleRules *msg, size_t *len) {
- return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE double* validate_DoubleRules_resize_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_DoubleRules_add_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE double* validate_DoubleRules_mutable_not_in(validate_DoubleRules *msg, size_t *len) {
- return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (double*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE double* validate_DoubleRules_resize_not_in(validate_DoubleRules *msg, size_t len, upb_arena *arena) {
- return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (double*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_DoubleRules_add_not_in(validate_DoubleRules *msg, double val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_DoubleRules_set_ignore_empty(validate_DoubleRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.Int32Rules */
@@ -614,13 +654,19 @@ UPB_INLINE validate_Int32Rules *validate_Int32Rules_new(upb_arena *arena) {
UPB_INLINE validate_Int32Rules *validate_Int32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_Int32Rules *ret = validate_Int32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Int32Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_Int32Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_Int32Rules *validate_Int32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_Int32Rules *ret = validate_Int32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Int32Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_Int32Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_Int32Rules_serialize(const validate_Int32Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_Int32Rules_msginit, arena, len);
@@ -636,8 +682,10 @@ UPB_INLINE bool validate_Int32Rules_has_gt(const validate_Int32Rules *msg) { ret
UPB_INLINE int32_t validate_Int32Rules_gt(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
UPB_INLINE bool validate_Int32Rules_has_gte(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int32_t validate_Int32Rules_gte(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
-UPB_INLINE int32_t const* validate_Int32Rules_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE int32_t const* validate_Int32Rules_not_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_Int32Rules_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_Int32Rules_not_in(const validate_Int32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_Int32Rules_has_ignore_empty(const validate_Int32Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_Int32Rules_ignore_empty(const validate_Int32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_Int32Rules_set_const(validate_Int32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -660,25 +708,29 @@ UPB_INLINE void validate_Int32Rules_set_gte(validate_Int32Rules *msg, int32_t va
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_Int32Rules_mutable_in(validate_Int32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_Int32Rules_resize_in(validate_Int32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_Int32Rules_add_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE int32_t* validate_Int32Rules_mutable_not_in(validate_Int32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE int32_t* validate_Int32Rules_resize_not_in(validate_Int32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_Int32Rules_add_not_in(validate_Int32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_Int32Rules_set_ignore_empty(validate_Int32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.Int64Rules */
@@ -688,13 +740,19 @@ UPB_INLINE validate_Int64Rules *validate_Int64Rules_new(upb_arena *arena) {
UPB_INLINE validate_Int64Rules *validate_Int64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_Int64Rules *ret = validate_Int64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Int64Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_Int64Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_Int64Rules *validate_Int64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_Int64Rules *ret = validate_Int64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Int64Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_Int64Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_Int64Rules_serialize(const validate_Int64Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_Int64Rules_msginit, arena, len);
@@ -710,8 +768,10 @@ UPB_INLINE bool validate_Int64Rules_has_gt(const validate_Int64Rules *msg) { ret
UPB_INLINE int64_t validate_Int64Rules_gt(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
UPB_INLINE bool validate_Int64Rules_has_gte(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int64_t validate_Int64Rules_gte(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
-UPB_INLINE int64_t const* validate_Int64Rules_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE int64_t const* validate_Int64Rules_not_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_Int64Rules_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_Int64Rules_not_in(const validate_Int64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_Int64Rules_has_ignore_empty(const validate_Int64Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_Int64Rules_ignore_empty(const validate_Int64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_Int64Rules_set_const(validate_Int64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
@@ -734,25 +794,29 @@ UPB_INLINE void validate_Int64Rules_set_gte(validate_Int64Rules *msg, int64_t va
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_Int64Rules_mutable_in(validate_Int64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_Int64Rules_resize_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_Int64Rules_add_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE int64_t* validate_Int64Rules_mutable_not_in(validate_Int64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE int64_t* validate_Int64Rules_resize_not_in(validate_Int64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_Int64Rules_add_not_in(validate_Int64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_Int64Rules_set_ignore_empty(validate_Int64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.UInt32Rules */
@@ -762,13 +826,19 @@ UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_new(upb_arena *arena) {
UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_UInt32Rules *ret = validate_UInt32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_UInt32Rules *validate_UInt32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_UInt32Rules *ret = validate_UInt32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_UInt32Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_UInt32Rules_serialize(const validate_UInt32Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_UInt32Rules_msginit, arena, len);
@@ -784,8 +854,10 @@ UPB_INLINE bool validate_UInt32Rules_has_gt(const validate_UInt32Rules *msg) { r
UPB_INLINE uint32_t validate_UInt32Rules_gt(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
UPB_INLINE bool validate_UInt32Rules_has_gte(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE uint32_t validate_UInt32Rules_gte(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
-UPB_INLINE uint32_t const* validate_UInt32Rules_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE uint32_t const* validate_UInt32Rules_not_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE uint32_t const* validate_UInt32Rules_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE uint32_t const* validate_UInt32Rules_not_in(const validate_UInt32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_UInt32Rules_has_ignore_empty(const validate_UInt32Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_UInt32Rules_ignore_empty(const validate_UInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_UInt32Rules_set_const(validate_UInt32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
@@ -808,25 +880,29 @@ UPB_INLINE void validate_UInt32Rules_set_gte(validate_UInt32Rules *msg, uint32_t
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
}
UPB_INLINE uint32_t* validate_UInt32Rules_mutable_in(validate_UInt32Rules *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE uint32_t* validate_UInt32Rules_resize_in(validate_UInt32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_UInt32Rules_add_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE uint32_t* validate_UInt32Rules_mutable_not_in(validate_UInt32Rules *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE uint32_t* validate_UInt32Rules_resize_not_in(validate_UInt32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_UInt32Rules_add_not_in(validate_UInt32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_UInt32Rules_set_ignore_empty(validate_UInt32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.UInt64Rules */
@@ -836,13 +912,19 @@ UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_new(upb_arena *arena) {
UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_UInt64Rules *ret = validate_UInt64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_UInt64Rules *validate_UInt64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_UInt64Rules *ret = validate_UInt64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_UInt64Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_UInt64Rules_serialize(const validate_UInt64Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_UInt64Rules_msginit, arena, len);
@@ -858,8 +940,10 @@ UPB_INLINE bool validate_UInt64Rules_has_gt(const validate_UInt64Rules *msg) { r
UPB_INLINE uint64_t validate_UInt64Rules_gt(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
UPB_INLINE bool validate_UInt64Rules_has_gte(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE uint64_t validate_UInt64Rules_gte(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
-UPB_INLINE uint64_t const* validate_UInt64Rules_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE uint64_t const* validate_UInt64Rules_not_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE uint64_t const* validate_UInt64Rules_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE uint64_t const* validate_UInt64Rules_not_in(const validate_UInt64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_UInt64Rules_has_ignore_empty(const validate_UInt64Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_UInt64Rules_ignore_empty(const validate_UInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_UInt64Rules_set_const(validate_UInt64Rules *msg, uint64_t value) {
_upb_sethas(msg, 1);
@@ -882,25 +966,29 @@ UPB_INLINE void validate_UInt64Rules_set_gte(validate_UInt64Rules *msg, uint64_t
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
}
UPB_INLINE uint64_t* validate_UInt64Rules_mutable_in(validate_UInt64Rules *msg, size_t *len) {
- return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE uint64_t* validate_UInt64Rules_resize_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_UInt64Rules_add_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE uint64_t* validate_UInt64Rules_mutable_not_in(validate_UInt64Rules *msg, size_t *len) {
- return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE uint64_t* validate_UInt64Rules_resize_not_in(validate_UInt64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_UInt64Rules_add_not_in(validate_UInt64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_UInt64Rules_set_ignore_empty(validate_UInt64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.SInt32Rules */
@@ -910,13 +998,19 @@ UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_new(upb_arena *arena) {
UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_SInt32Rules *ret = validate_SInt32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_SInt32Rules *validate_SInt32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_SInt32Rules *ret = validate_SInt32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_SInt32Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_SInt32Rules_serialize(const validate_SInt32Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_SInt32Rules_msginit, arena, len);
@@ -932,8 +1026,10 @@ UPB_INLINE bool validate_SInt32Rules_has_gt(const validate_SInt32Rules *msg) { r
UPB_INLINE int32_t validate_SInt32Rules_gt(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
UPB_INLINE bool validate_SInt32Rules_has_gte(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int32_t validate_SInt32Rules_gte(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
-UPB_INLINE int32_t const* validate_SInt32Rules_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE int32_t const* validate_SInt32Rules_not_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_SInt32Rules_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_SInt32Rules_not_in(const validate_SInt32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_SInt32Rules_has_ignore_empty(const validate_SInt32Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_SInt32Rules_ignore_empty(const validate_SInt32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_SInt32Rules_set_const(validate_SInt32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -956,25 +1052,29 @@ UPB_INLINE void validate_SInt32Rules_set_gte(validate_SInt32Rules *msg, int32_t
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_SInt32Rules_mutable_in(validate_SInt32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_SInt32Rules_resize_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_SInt32Rules_add_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE int32_t* validate_SInt32Rules_mutable_not_in(validate_SInt32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE int32_t* validate_SInt32Rules_resize_not_in(validate_SInt32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_SInt32Rules_add_not_in(validate_SInt32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_SInt32Rules_set_ignore_empty(validate_SInt32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.SInt64Rules */
@@ -984,13 +1084,19 @@ UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_new(upb_arena *arena) {
UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_SInt64Rules *ret = validate_SInt64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_SInt64Rules *validate_SInt64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_SInt64Rules *ret = validate_SInt64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_SInt64Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_SInt64Rules_serialize(const validate_SInt64Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_SInt64Rules_msginit, arena, len);
@@ -1006,8 +1112,10 @@ UPB_INLINE bool validate_SInt64Rules_has_gt(const validate_SInt64Rules *msg) { r
UPB_INLINE int64_t validate_SInt64Rules_gt(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
UPB_INLINE bool validate_SInt64Rules_has_gte(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int64_t validate_SInt64Rules_gte(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
-UPB_INLINE int64_t const* validate_SInt64Rules_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE int64_t const* validate_SInt64Rules_not_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_SInt64Rules_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_SInt64Rules_not_in(const validate_SInt64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_SInt64Rules_has_ignore_empty(const validate_SInt64Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_SInt64Rules_ignore_empty(const validate_SInt64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_SInt64Rules_set_const(validate_SInt64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
@@ -1030,25 +1138,29 @@ UPB_INLINE void validate_SInt64Rules_set_gte(validate_SInt64Rules *msg, int64_t
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_SInt64Rules_mutable_in(validate_SInt64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_SInt64Rules_resize_in(validate_SInt64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_SInt64Rules_add_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE int64_t* validate_SInt64Rules_mutable_not_in(validate_SInt64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE int64_t* validate_SInt64Rules_resize_not_in(validate_SInt64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_SInt64Rules_add_not_in(validate_SInt64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_SInt64Rules_set_ignore_empty(validate_SInt64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.Fixed32Rules */
@@ -1058,13 +1170,19 @@ UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_new(upb_arena *arena) {
UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_Fixed32Rules *ret = validate_Fixed32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_Fixed32Rules *validate_Fixed32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_Fixed32Rules *ret = validate_Fixed32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_Fixed32Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_Fixed32Rules_serialize(const validate_Fixed32Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_Fixed32Rules_msginit, arena, len);
@@ -1080,8 +1198,10 @@ UPB_INLINE bool validate_Fixed32Rules_has_gt(const validate_Fixed32Rules *msg) {
UPB_INLINE uint32_t validate_Fixed32Rules_gt(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint32_t); }
UPB_INLINE bool validate_Fixed32Rules_has_gte(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE uint32_t validate_Fixed32Rules_gte(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t); }
-UPB_INLINE uint32_t const* validate_Fixed32Rules_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE uint32_t const* validate_Fixed32Rules_not_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE uint32_t const* validate_Fixed32Rules_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE uint32_t const* validate_Fixed32Rules_not_in(const validate_Fixed32Rules *msg, size_t *len) { return (uint32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_Fixed32Rules_has_ignore_empty(const validate_Fixed32Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_Fixed32Rules_ignore_empty(const validate_Fixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_Fixed32Rules_set_const(validate_Fixed32Rules *msg, uint32_t value) {
_upb_sethas(msg, 1);
@@ -1104,25 +1224,29 @@ UPB_INLINE void validate_Fixed32Rules_set_gte(validate_Fixed32Rules *msg, uint32
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), uint32_t) = value;
}
UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_in(validate_Fixed32Rules *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_resize_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_Fixed32Rules_add_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_mutable_not_in(validate_Fixed32Rules *msg, size_t *len) {
- return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (uint32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE uint32_t* validate_Fixed32Rules_resize_not_in(validate_Fixed32Rules *msg, size_t len, upb_arena *arena) {
- return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (uint32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_Fixed32Rules_add_not_in(validate_Fixed32Rules *msg, uint32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_Fixed32Rules_set_ignore_empty(validate_Fixed32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.Fixed64Rules */
@@ -1132,13 +1256,19 @@ UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_new(upb_arena *arena) {
UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_Fixed64Rules *ret = validate_Fixed64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_Fixed64Rules *validate_Fixed64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_Fixed64Rules *ret = validate_Fixed64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_Fixed64Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_Fixed64Rules_serialize(const validate_Fixed64Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_Fixed64Rules_msginit, arena, len);
@@ -1154,8 +1284,10 @@ UPB_INLINE bool validate_Fixed64Rules_has_gt(const validate_Fixed64Rules *msg) {
UPB_INLINE uint64_t validate_Fixed64Rules_gt(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), uint64_t); }
UPB_INLINE bool validate_Fixed64Rules_has_gte(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE uint64_t validate_Fixed64Rules_gte(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t); }
-UPB_INLINE uint64_t const* validate_Fixed64Rules_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE uint64_t const* validate_Fixed64Rules_not_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE uint64_t const* validate_Fixed64Rules_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE uint64_t const* validate_Fixed64Rules_not_in(const validate_Fixed64Rules *msg, size_t *len) { return (uint64_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_Fixed64Rules_has_ignore_empty(const validate_Fixed64Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_Fixed64Rules_ignore_empty(const validate_Fixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_Fixed64Rules_set_const(validate_Fixed64Rules *msg, uint64_t value) {
_upb_sethas(msg, 1);
@@ -1178,25 +1310,29 @@ UPB_INLINE void validate_Fixed64Rules_set_gte(validate_Fixed64Rules *msg, uint64
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), uint64_t) = value;
}
UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_in(validate_Fixed64Rules *msg, size_t *len) {
- return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_resize_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_Fixed64Rules_add_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_mutable_not_in(validate_Fixed64Rules *msg, size_t *len) {
- return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (uint64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE uint64_t* validate_Fixed64Rules_resize_not_in(validate_Fixed64Rules *msg, size_t len, upb_arena *arena) {
- return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (uint64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_Fixed64Rules_add_not_in(validate_Fixed64Rules *msg, uint64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_Fixed64Rules_set_ignore_empty(validate_Fixed64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.SFixed32Rules */
@@ -1206,13 +1342,19 @@ UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_new(upb_arena *arena)
UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_SFixed32Rules *ret = validate_SFixed32Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_SFixed32Rules *validate_SFixed32Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_SFixed32Rules *ret = validate_SFixed32Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_SFixed32Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_SFixed32Rules_serialize(const validate_SFixed32Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_SFixed32Rules_msginit, arena, len);
@@ -1228,8 +1370,10 @@ UPB_INLINE bool validate_SFixed32Rules_has_gt(const validate_SFixed32Rules *msg)
UPB_INLINE int32_t validate_SFixed32Rules_gt(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int32_t); }
UPB_INLINE bool validate_SFixed32Rules_has_gte(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int32_t validate_SFixed32Rules_gte(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t); }
-UPB_INLINE int32_t const* validate_SFixed32Rules_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(24, 24), len); }
-UPB_INLINE int32_t const* validate_SFixed32Rules_not_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_SFixed32Rules_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(28, 32), len); }
+UPB_INLINE int32_t const* validate_SFixed32Rules_not_in(const validate_SFixed32Rules *msg, size_t *len) { return (int32_t const*)_upb_array_accessor(msg, UPB_SIZE(32, 40), len); }
+UPB_INLINE bool validate_SFixed32Rules_has_ignore_empty(const validate_SFixed32Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_SFixed32Rules_ignore_empty(const validate_SFixed32Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE void validate_SFixed32Rules_set_const(validate_SFixed32Rules *msg, int32_t value) {
_upb_sethas(msg, 1);
@@ -1252,25 +1396,29 @@ UPB_INLINE void validate_SFixed32Rules_set_gte(validate_SFixed32Rules *msg, int3
*UPB_PTR_AT(msg, UPB_SIZE(20, 20), int32_t) = value;
}
UPB_INLINE int32_t* validate_SFixed32Rules_mutable_in(validate_SFixed32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 24), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
}
UPB_INLINE int32_t* validate_SFixed32Rules_resize_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 24), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
}
UPB_INLINE bool validate_SFixed32Rules_add_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(24, 24), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
arena);
}
UPB_INLINE int32_t* validate_SFixed32Rules_mutable_not_in(validate_SFixed32Rules *msg, size_t *len) {
- return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(28, 32), len);
+ return (int32_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(32, 40), len);
}
UPB_INLINE int32_t* validate_SFixed32Rules_resize_not_in(validate_SFixed32Rules *msg, size_t len, upb_arena *arena) {
- return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(28, 32), len, 2, arena);
+ return (int32_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(32, 40), len, 2, arena);
}
UPB_INLINE bool validate_SFixed32Rules_add_not_in(validate_SFixed32Rules *msg, int32_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(28, 32), 2, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(32, 40), 2, &val,
arena);
}
+UPB_INLINE void validate_SFixed32Rules_set_ignore_empty(validate_SFixed32Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool) = value;
+}
/* validate.SFixed64Rules */
@@ -1280,13 +1428,19 @@ UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_new(upb_arena *arena)
UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_SFixed64Rules *ret = validate_SFixed64Rules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_SFixed64Rules *validate_SFixed64Rules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_SFixed64Rules *ret = validate_SFixed64Rules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_SFixed64Rules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_SFixed64Rules_serialize(const validate_SFixed64Rules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_SFixed64Rules_msginit, arena, len);
@@ -1302,8 +1456,10 @@ UPB_INLINE bool validate_SFixed64Rules_has_gt(const validate_SFixed64Rules *msg)
UPB_INLINE int64_t validate_SFixed64Rules_gt(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
UPB_INLINE bool validate_SFixed64Rules_has_gte(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE int64_t validate_SFixed64Rules_gte(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t); }
-UPB_INLINE int64_t const* validate_SFixed64Rules_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(48, 48), len); }
-UPB_INLINE int64_t const* validate_SFixed64Rules_not_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_SFixed64Rules_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(52, 56), len); }
+UPB_INLINE int64_t const* validate_SFixed64Rules_not_in(const validate_SFixed64Rules *msg, size_t *len) { return (int64_t const*)_upb_array_accessor(msg, UPB_SIZE(56, 64), len); }
+UPB_INLINE bool validate_SFixed64Rules_has_ignore_empty(const validate_SFixed64Rules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_SFixed64Rules_ignore_empty(const validate_SFixed64Rules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool); }
UPB_INLINE void validate_SFixed64Rules_set_const(validate_SFixed64Rules *msg, int64_t value) {
_upb_sethas(msg, 1);
@@ -1326,25 +1482,29 @@ UPB_INLINE void validate_SFixed64Rules_set_gte(validate_SFixed64Rules *msg, int6
*UPB_PTR_AT(msg, UPB_SIZE(40, 40), int64_t) = value;
}
UPB_INLINE int64_t* validate_SFixed64Rules_mutable_in(validate_SFixed64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(48, 48), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
}
UPB_INLINE int64_t* validate_SFixed64Rules_resize_in(validate_SFixed64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(48, 48), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
}
UPB_INLINE bool validate_SFixed64Rules_add_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(48, 48), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
arena);
}
UPB_INLINE int64_t* validate_SFixed64Rules_mutable_not_in(validate_SFixed64Rules *msg, size_t *len) {
- return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(52, 56), len);
+ return (int64_t*)_upb_array_mutable_accessor(msg, UPB_SIZE(56, 64), len);
}
UPB_INLINE int64_t* validate_SFixed64Rules_resize_not_in(validate_SFixed64Rules *msg, size_t len, upb_arena *arena) {
- return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(52, 56), len, 3, arena);
+ return (int64_t*)_upb_array_resize_accessor2(msg, UPB_SIZE(56, 64), len, 3, arena);
}
UPB_INLINE bool validate_SFixed64Rules_add_not_in(validate_SFixed64Rules *msg, int64_t val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(52, 56), 3, &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(56, 64), 3, &val,
arena);
}
+UPB_INLINE void validate_SFixed64Rules_set_ignore_empty(validate_SFixed64Rules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(48, 48), bool) = value;
+}
/* validate.BoolRules */
@@ -1354,13 +1514,19 @@ UPB_INLINE validate_BoolRules *validate_BoolRules_new(upb_arena *arena) {
UPB_INLINE validate_BoolRules *validate_BoolRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_BoolRules *ret = validate_BoolRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_BoolRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_BoolRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_BoolRules *validate_BoolRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_BoolRules *ret = validate_BoolRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_BoolRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_BoolRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_BoolRules_serialize(const validate_BoolRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_BoolRules_msginit, arena, len);
@@ -1382,13 +1548,19 @@ UPB_INLINE validate_StringRules *validate_StringRules_new(upb_arena *arena) {
UPB_INLINE validate_StringRules *validate_StringRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_StringRules *ret = validate_StringRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_StringRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_StringRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_StringRules *validate_StringRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_StringRules *ret = validate_StringRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_StringRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_StringRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_StringRules_serialize(const validate_StringRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_StringRules_msginit, arena, len);
@@ -1457,6 +1629,8 @@ UPB_INLINE bool validate_StringRules_has_well_known_regex(const validate_StringR
UPB_INLINE int32_t validate_StringRules_well_known_regex(const validate_StringRules *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(116, 176), UPB_SIZE(120, 180), 24, 0); }
UPB_INLINE bool validate_StringRules_has_strict(const validate_StringRules *msg) { return _upb_hasbit(msg, 13); }
UPB_INLINE bool validate_StringRules_strict(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool); }
+UPB_INLINE bool validate_StringRules_has_ignore_empty(const validate_StringRules *msg) { return _upb_hasbit(msg, 14); }
+UPB_INLINE bool validate_StringRules_ignore_empty(const validate_StringRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(57, 57), bool); }
UPB_INLINE void validate_StringRules_set_const(validate_StringRules *msg, upb_strview value) {
_upb_sethas(msg, 1);
@@ -1560,6 +1734,10 @@ UPB_INLINE void validate_StringRules_set_strict(validate_StringRules *msg, bool
_upb_sethas(msg, 13);
*UPB_PTR_AT(msg, UPB_SIZE(56, 56), bool) = value;
}
+UPB_INLINE void validate_StringRules_set_ignore_empty(validate_StringRules *msg, bool value) {
+ _upb_sethas(msg, 14);
+ *UPB_PTR_AT(msg, UPB_SIZE(57, 57), bool) = value;
+}
/* validate.BytesRules */
@@ -1569,13 +1747,19 @@ UPB_INLINE validate_BytesRules *validate_BytesRules_new(upb_arena *arena) {
UPB_INLINE validate_BytesRules *validate_BytesRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_BytesRules *ret = validate_BytesRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_BytesRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_BytesRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_BytesRules *validate_BytesRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_BytesRules *ret = validate_BytesRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_BytesRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_BytesRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_BytesRules_serialize(const validate_BytesRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_BytesRules_msginit, arena, len);
@@ -1587,36 +1771,38 @@ typedef enum {
validate_BytesRules_well_known_ipv6 = 12,
validate_BytesRules_well_known_NOT_SET = 0
} validate_BytesRules_well_known_oneofcases;
-UPB_INLINE validate_BytesRules_well_known_oneofcases validate_BytesRules_well_known_case(const validate_BytesRules* msg) { return (validate_BytesRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(84, 132), int32_t); }
+UPB_INLINE validate_BytesRules_well_known_oneofcases validate_BytesRules_well_known_case(const validate_BytesRules* msg) { return (validate_BytesRules_well_known_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(88, 140), int32_t); }
UPB_INLINE bool validate_BytesRules_has_const(const validate_BytesRules *msg) { return _upb_hasbit(msg, 1); }
-UPB_INLINE upb_strview validate_BytesRules_const(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview); }
+UPB_INLINE upb_strview validate_BytesRules_const(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview); }
UPB_INLINE bool validate_BytesRules_has_min_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE uint64_t validate_BytesRules_min_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), uint64_t); }
UPB_INLINE bool validate_BytesRules_has_max_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 3); }
UPB_INLINE uint64_t validate_BytesRules_max_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
UPB_INLINE bool validate_BytesRules_has_pattern(const validate_BytesRules *msg) { return _upb_hasbit(msg, 4); }
-UPB_INLINE upb_strview validate_BytesRules_pattern(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview); }
+UPB_INLINE upb_strview validate_BytesRules_pattern(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview); }
UPB_INLINE bool validate_BytesRules_has_prefix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 5); }
-UPB_INLINE upb_strview validate_BytesRules_prefix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview); }
+UPB_INLINE upb_strview validate_BytesRules_prefix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview); }
UPB_INLINE bool validate_BytesRules_has_suffix(const validate_BytesRules *msg) { return _upb_hasbit(msg, 6); }
-UPB_INLINE upb_strview validate_BytesRules_suffix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview); }
+UPB_INLINE upb_strview validate_BytesRules_suffix(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview); }
UPB_INLINE bool validate_BytesRules_has_contains(const validate_BytesRules *msg) { return _upb_hasbit(msg, 7); }
-UPB_INLINE upb_strview validate_BytesRules_contains(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview); }
-UPB_INLINE upb_strview const* validate_BytesRules_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(72, 112), len); }
-UPB_INLINE upb_strview const* validate_BytesRules_not_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(76, 120), len); }
-UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 10; }
-UPB_INLINE bool validate_BytesRules_ip(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 10, false); }
-UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 11; }
-UPB_INLINE bool validate_BytesRules_ipv4(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 11, false); }
-UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(84, 132)) == 12; }
-UPB_INLINE bool validate_BytesRules_ipv6(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(80, 128), UPB_SIZE(84, 132), 12, false); }
+UPB_INLINE upb_strview validate_BytesRules_contains(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview); }
+UPB_INLINE upb_strview const* validate_BytesRules_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(76, 120), len); }
+UPB_INLINE upb_strview const* validate_BytesRules_not_in(const validate_BytesRules *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(80, 128), len); }
+UPB_INLINE bool validate_BytesRules_has_ip(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(88, 140)) == 10; }
+UPB_INLINE bool validate_BytesRules_ip(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(84, 136), UPB_SIZE(88, 140), 10, false); }
+UPB_INLINE bool validate_BytesRules_has_ipv4(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(88, 140)) == 11; }
+UPB_INLINE bool validate_BytesRules_ipv4(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(84, 136), UPB_SIZE(88, 140), 11, false); }
+UPB_INLINE bool validate_BytesRules_has_ipv6(const validate_BytesRules *msg) { return _upb_getoneofcase(msg, UPB_SIZE(88, 140)) == 12; }
+UPB_INLINE bool validate_BytesRules_ipv6(const validate_BytesRules *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(84, 136), UPB_SIZE(88, 140), 12, false); }
UPB_INLINE bool validate_BytesRules_has_len(const validate_BytesRules *msg) { return _upb_hasbit(msg, 8); }
UPB_INLINE uint64_t validate_BytesRules_len(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t); }
+UPB_INLINE bool validate_BytesRules_has_ignore_empty(const validate_BytesRules *msg) { return _upb_hasbit(msg, 9); }
+UPB_INLINE bool validate_BytesRules_ignore_empty(const validate_BytesRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool); }
UPB_INLINE void validate_BytesRules_set_const(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 1);
- *UPB_PTR_AT(msg, UPB_SIZE(32, 32), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(36, 40), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_min_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 2);
@@ -1628,53 +1814,57 @@ UPB_INLINE void validate_BytesRules_set_max_len(validate_BytesRules *msg, uint64
}
UPB_INLINE void validate_BytesRules_set_pattern(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 4);
- *UPB_PTR_AT(msg, UPB_SIZE(40, 48), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(44, 56), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_prefix(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 5);
- *UPB_PTR_AT(msg, UPB_SIZE(48, 64), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(52, 72), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_suffix(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 6);
- *UPB_PTR_AT(msg, UPB_SIZE(56, 80), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(60, 88), upb_strview) = value;
}
UPB_INLINE void validate_BytesRules_set_contains(validate_BytesRules *msg, upb_strview value) {
_upb_sethas(msg, 7);
- *UPB_PTR_AT(msg, UPB_SIZE(64, 96), upb_strview) = value;
+ *UPB_PTR_AT(msg, UPB_SIZE(68, 104), upb_strview) = value;
}
UPB_INLINE upb_strview* validate_BytesRules_mutable_in(validate_BytesRules *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(72, 112), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(76, 120), len);
}
UPB_INLINE upb_strview* validate_BytesRules_resize_in(validate_BytesRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(72, 112), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(76, 120), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool validate_BytesRules_add_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(72, 112), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(76, 120), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE upb_strview* validate_BytesRules_mutable_not_in(validate_BytesRules *msg, size_t *len) {
- return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(76, 120), len);
+ return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(80, 128), len);
}
UPB_INLINE upb_strview* validate_BytesRules_resize_not_in(validate_BytesRules *msg, size_t len, upb_arena *arena) {
- return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(76, 120), len, UPB_SIZE(3, 4), arena);
+ return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(80, 128), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool validate_BytesRules_add_not_in(validate_BytesRules *msg, upb_strview val, upb_arena *arena) {
- return _upb_array_append_accessor2(msg, UPB_SIZE(76, 120), UPB_SIZE(3, 4), &val,
+ return _upb_array_append_accessor2(msg, UPB_SIZE(80, 128), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE void validate_BytesRules_set_ip(validate_BytesRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 10);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(84, 136), value, UPB_SIZE(88, 140), 10);
}
UPB_INLINE void validate_BytesRules_set_ipv4(validate_BytesRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 11);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(84, 136), value, UPB_SIZE(88, 140), 11);
}
UPB_INLINE void validate_BytesRules_set_ipv6(validate_BytesRules *msg, bool value) {
- UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(80, 128), value, UPB_SIZE(84, 132), 12);
+ UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(84, 136), value, UPB_SIZE(88, 140), 12);
}
UPB_INLINE void validate_BytesRules_set_len(validate_BytesRules *msg, uint64_t value) {
_upb_sethas(msg, 8);
*UPB_PTR_AT(msg, UPB_SIZE(24, 24), uint64_t) = value;
}
+UPB_INLINE void validate_BytesRules_set_ignore_empty(validate_BytesRules *msg, bool value) {
+ _upb_sethas(msg, 9);
+ *UPB_PTR_AT(msg, UPB_SIZE(32, 32), bool) = value;
+}
/* validate.EnumRules */
@@ -1684,13 +1874,19 @@ UPB_INLINE validate_EnumRules *validate_EnumRules_new(upb_arena *arena) {
UPB_INLINE validate_EnumRules *validate_EnumRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_EnumRules *ret = validate_EnumRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_EnumRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_EnumRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_EnumRules *validate_EnumRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_EnumRules *ret = validate_EnumRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_EnumRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_EnumRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_EnumRules_serialize(const validate_EnumRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_EnumRules_msginit, arena, len);
@@ -1740,13 +1936,19 @@ UPB_INLINE validate_MessageRules *validate_MessageRules_new(upb_arena *arena) {
UPB_INLINE validate_MessageRules *validate_MessageRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_MessageRules *ret = validate_MessageRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_MessageRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_MessageRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_MessageRules *validate_MessageRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_MessageRules *ret = validate_MessageRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_MessageRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_MessageRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_MessageRules_serialize(const validate_MessageRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_MessageRules_msginit, arena, len);
@@ -1774,13 +1976,19 @@ UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_new(upb_arena *arena)
UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_RepeatedRules *ret = validate_RepeatedRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_RepeatedRules *validate_RepeatedRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_RepeatedRules *ret = validate_RepeatedRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_RepeatedRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_RepeatedRules_serialize(const validate_RepeatedRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_RepeatedRules_msginit, arena, len);
@@ -1794,6 +2002,8 @@ UPB_INLINE bool validate_RepeatedRules_has_unique(const validate_RepeatedRules *
UPB_INLINE bool validate_RepeatedRules_unique(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), bool); }
UPB_INLINE bool validate_RepeatedRules_has_items(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 4); }
UPB_INLINE const validate_FieldRules* validate_RepeatedRules_items(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
+UPB_INLINE bool validate_RepeatedRules_has_ignore_empty(const validate_RepeatedRules *msg) { return _upb_hasbit(msg, 5); }
+UPB_INLINE bool validate_RepeatedRules_ignore_empty(const validate_RepeatedRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
UPB_INLINE void validate_RepeatedRules_set_min_items(validate_RepeatedRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
@@ -1820,6 +2030,10 @@ UPB_INLINE struct validate_FieldRules* validate_RepeatedRules_mutable_items(vali
}
return sub;
}
+UPB_INLINE void validate_RepeatedRules_set_ignore_empty(validate_RepeatedRules *msg, bool value) {
+ _upb_sethas(msg, 5);
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
+}
/* validate.MapRules */
@@ -1829,13 +2043,19 @@ UPB_INLINE validate_MapRules *validate_MapRules_new(upb_arena *arena) {
UPB_INLINE validate_MapRules *validate_MapRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_MapRules *ret = validate_MapRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_MapRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_MapRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_MapRules *validate_MapRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_MapRules *ret = validate_MapRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_MapRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_MapRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_MapRules_serialize(const validate_MapRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_MapRules_msginit, arena, len);
@@ -1851,6 +2071,8 @@ UPB_INLINE bool validate_MapRules_has_keys(const validate_MapRules *msg) { retur
UPB_INLINE const validate_FieldRules* validate_MapRules_keys(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(28, 32), const validate_FieldRules*); }
UPB_INLINE bool validate_MapRules_has_values(const validate_MapRules *msg) { return _upb_hasbit(msg, 5); }
UPB_INLINE const validate_FieldRules* validate_MapRules_values(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 40), const validate_FieldRules*); }
+UPB_INLINE bool validate_MapRules_has_ignore_empty(const validate_MapRules *msg) { return _upb_hasbit(msg, 6); }
+UPB_INLINE bool validate_MapRules_ignore_empty(const validate_MapRules *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool); }
UPB_INLINE void validate_MapRules_set_min_pairs(validate_MapRules *msg, uint64_t value) {
_upb_sethas(msg, 1);
@@ -1890,6 +2112,10 @@ UPB_INLINE struct validate_FieldRules* validate_MapRules_mutable_values(validate
}
return sub;
}
+UPB_INLINE void validate_MapRules_set_ignore_empty(validate_MapRules *msg, bool value) {
+ _upb_sethas(msg, 6);
+ *UPB_PTR_AT(msg, UPB_SIZE(25, 25), bool) = value;
+}
/* validate.AnyRules */
@@ -1899,13 +2125,19 @@ UPB_INLINE validate_AnyRules *validate_AnyRules_new(upb_arena *arena) {
UPB_INLINE validate_AnyRules *validate_AnyRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_AnyRules *ret = validate_AnyRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_AnyRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_AnyRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_AnyRules *validate_AnyRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_AnyRules *ret = validate_AnyRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_AnyRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_AnyRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_AnyRules_serialize(const validate_AnyRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_AnyRules_msginit, arena, len);
@@ -1949,13 +2181,19 @@ UPB_INLINE validate_DurationRules *validate_DurationRules_new(upb_arena *arena)
UPB_INLINE validate_DurationRules *validate_DurationRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_DurationRules *ret = validate_DurationRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_DurationRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_DurationRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_DurationRules *validate_DurationRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_DurationRules *ret = validate_DurationRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_DurationRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_DurationRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_DurationRules_serialize(const validate_DurationRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_DurationRules_msginit, arena, len);
@@ -2082,13 +2320,19 @@ UPB_INLINE validate_TimestampRules *validate_TimestampRules_new(upb_arena *arena
UPB_INLINE validate_TimestampRules *validate_TimestampRules_parse(const char *buf, size_t size,
upb_arena *arena) {
validate_TimestampRules *ret = validate_TimestampRules_new(arena);
- return (ret && upb_decode(buf, size, ret, &validate_TimestampRules_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &validate_TimestampRules_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE validate_TimestampRules *validate_TimestampRules_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
validate_TimestampRules *ret = validate_TimestampRules_new(arena);
- return (ret && _upb_decode(buf, size, ret, &validate_TimestampRules_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &validate_TimestampRules_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *validate_TimestampRules_serialize(const validate_TimestampRules *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &validate_TimestampRules_msginit, arena, len);
@@ -2204,6 +2448,16 @@ UPB_INLINE struct google_protobuf_Duration* validate_TimestampRules_mutable_with
return sub;
}
+UPB_INLINE bool validate_has_disabled(const struct google_protobuf_MessageOptions *msg) { return _upb_msg_getext(msg, &validate_disabled_ext) != NULL; }
+UPB_INLINE bool validate_disabled(const struct google_protobuf_MessageOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &validate_disabled_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+UPB_INLINE bool validate_has_ignored(const struct google_protobuf_MessageOptions *msg) { return _upb_msg_getext(msg, &validate_ignored_ext) != NULL; }
+UPB_INLINE bool validate_ignored(const struct google_protobuf_MessageOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &validate_ignored_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+UPB_INLINE bool validate_has_required(const struct google_protobuf_OneofOptions *msg) { return _upb_msg_getext(msg, &validate_required_ext) != NULL; }
+UPB_INLINE bool validate_required(const struct google_protobuf_OneofOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &validate_required_ext); return ext ? *UPB_PTR_AT(&ext->data, 0, bool) : false; }
+UPB_INLINE bool validate_has_rules(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &validate_rules_ext) != NULL; }
+UPB_INLINE const validate_FieldRules* validate_rules(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &validate_rules_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const validate_FieldRules*); }
+extern const upb_msglayout_file validate_validate_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
new file mode 100644
index 00000000000..da19eab247e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c
@@ -0,0 +1,103 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/annotations/v3/status.upb.h"
+#include "google/protobuf/descriptor.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_field xds_annotations_v3_FileStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_annotations_v3_FileStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FileStatusAnnotation__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field xds_annotations_v3_MessageStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_annotations_v3_MessageStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_MessageStatusAnnotation__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field xds_annotations_v3_FieldStatusAnnotation__fields[1] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_annotations_v3_FieldStatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_FieldStatusAnnotation__fields[0],
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout_field xds_annotations_v3_StatusAnnotation__fields[2] = {
+ {1, UPB_SIZE(4, 4), 0, 0, 8, _UPB_MODE_SCALAR | (_UPB_REP_1BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_annotations_v3_StatusAnnotation_msginit = {
+ NULL,
+ &xds_annotations_v3_StatusAnnotation__fields[0],
+ UPB_SIZE(8, 8), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[4] = {
+ &xds_annotations_v3_FileStatusAnnotation_msginit,
+ &xds_annotations_v3_MessageStatusAnnotation_msginit,
+ &xds_annotations_v3_FieldStatusAnnotation_msginit,
+ &xds_annotations_v3_StatusAnnotation_msginit,
+};
+
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+extern const upb_msglayout xds_annotations_v3_FieldStatusAnnotation_msginit;
+extern const upb_msglayout xds_annotations_v3_FileStatusAnnotation_msginit;
+extern const upb_msglayout xds_annotations_v3_MessageStatusAnnotation_msginit;
+const upb_msglayout_ext xds_annotations_v3_file_status_ext = {
+ {226829418, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FileOptions_msginit,
+ {.submsg = &xds_annotations_v3_FileStatusAnnotation_msginit},
+
+};
+const upb_msglayout_ext xds_annotations_v3_message_status_ext = {
+ {226829418, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_MessageOptions_msginit,
+ {.submsg = &xds_annotations_v3_MessageStatusAnnotation_msginit},
+
+};
+const upb_msglayout_ext xds_annotations_v3_field_status_ext = {
+ {226829418, 0, 0, 0, 11, _UPB_MODE_SCALAR | _UPB_MODE_IS_EXTENSION | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ &google_protobuf_FieldOptions_msginit,
+ {.submsg = &xds_annotations_v3_FieldStatusAnnotation_msginit},
+
+};
+
+static const upb_msglayout_ext *extensions_layout[3] = {
+ &xds_annotations_v3_file_status_ext,
+ &xds_annotations_v3_message_status_ext,
+ &xds_annotations_v3_field_status_ext,
+};
+
+const upb_msglayout_file xds_annotations_v3_status_proto_upb_file_layout = {
+ messages_layout,
+ extensions_layout,
+ 4,
+ 3,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h
new file mode 100644
index 00000000000..8882dfb119d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h
@@ -0,0 +1,199 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_
+#define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_annotations_v3_FileStatusAnnotation;
+struct xds_annotations_v3_MessageStatusAnnotation;
+struct xds_annotations_v3_FieldStatusAnnotation;
+struct xds_annotations_v3_StatusAnnotation;
+typedef struct xds_annotations_v3_FileStatusAnnotation xds_annotations_v3_FileStatusAnnotation;
+typedef struct xds_annotations_v3_MessageStatusAnnotation xds_annotations_v3_MessageStatusAnnotation;
+typedef struct xds_annotations_v3_FieldStatusAnnotation xds_annotations_v3_FieldStatusAnnotation;
+typedef struct xds_annotations_v3_StatusAnnotation xds_annotations_v3_StatusAnnotation;
+extern const upb_msglayout xds_annotations_v3_FileStatusAnnotation_msginit;
+extern const upb_msglayout xds_annotations_v3_MessageStatusAnnotation_msginit;
+extern const upb_msglayout xds_annotations_v3_FieldStatusAnnotation_msginit;
+extern const upb_msglayout xds_annotations_v3_StatusAnnotation_msginit;
+extern const upb_msglayout_ext xds_annotations_v3_file_status_ext;
+extern const upb_msglayout_ext xds_annotations_v3_message_status_ext;
+extern const upb_msglayout_ext xds_annotations_v3_field_status_ext;
+struct google_protobuf_FieldOptions;
+struct google_protobuf_FileOptions;
+struct google_protobuf_MessageOptions;
+extern const upb_msglayout google_protobuf_FieldOptions_msginit;
+extern const upb_msglayout google_protobuf_FileOptions_msginit;
+extern const upb_msglayout google_protobuf_MessageOptions_msginit;
+
+typedef enum {
+ xds_annotations_v3_UNKNOWN = 0,
+ xds_annotations_v3_FROZEN = 1,
+ xds_annotations_v3_ACTIVE = 2,
+ xds_annotations_v3_NEXT_MAJOR_VERSION_CANDIDATE = 3
+} xds_annotations_v3_PackageVersionStatus;
+
+
+/* xds.annotations.v3.FileStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation *xds_annotations_v3_FileStatusAnnotation_new(upb_arena *arena) {
+ return (xds_annotations_v3_FileStatusAnnotation *)_upb_msg_new(&xds_annotations_v3_FileStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation *xds_annotations_v3_FileStatusAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_annotations_v3_FileStatusAnnotation *ret = xds_annotations_v3_FileStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FileStatusAnnotation *xds_annotations_v3_FileStatusAnnotation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_annotations_v3_FileStatusAnnotation *ret = xds_annotations_v3_FileStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_annotations_v3_FileStatusAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_annotations_v3_FileStatusAnnotation_serialize(const xds_annotations_v3_FileStatusAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool xds_annotations_v3_FileStatusAnnotation_work_in_progress(const xds_annotations_v3_FileStatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void xds_annotations_v3_FileStatusAnnotation_set_work_in_progress(xds_annotations_v3_FileStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.MessageStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation *xds_annotations_v3_MessageStatusAnnotation_new(upb_arena *arena) {
+ return (xds_annotations_v3_MessageStatusAnnotation *)_upb_msg_new(&xds_annotations_v3_MessageStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation *xds_annotations_v3_MessageStatusAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_annotations_v3_MessageStatusAnnotation *ret = xds_annotations_v3_MessageStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_MessageStatusAnnotation *xds_annotations_v3_MessageStatusAnnotation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_annotations_v3_MessageStatusAnnotation *ret = xds_annotations_v3_MessageStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_annotations_v3_MessageStatusAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_annotations_v3_MessageStatusAnnotation_serialize(const xds_annotations_v3_MessageStatusAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool xds_annotations_v3_MessageStatusAnnotation_work_in_progress(const xds_annotations_v3_MessageStatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void xds_annotations_v3_MessageStatusAnnotation_set_work_in_progress(xds_annotations_v3_MessageStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.FieldStatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation *xds_annotations_v3_FieldStatusAnnotation_new(upb_arena *arena) {
+ return (xds_annotations_v3_FieldStatusAnnotation *)_upb_msg_new(&xds_annotations_v3_FieldStatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation *xds_annotations_v3_FieldStatusAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_annotations_v3_FieldStatusAnnotation *ret = xds_annotations_v3_FieldStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_FieldStatusAnnotation *xds_annotations_v3_FieldStatusAnnotation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_annotations_v3_FieldStatusAnnotation *ret = xds_annotations_v3_FieldStatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_annotations_v3_FieldStatusAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_annotations_v3_FieldStatusAnnotation_serialize(const xds_annotations_v3_FieldStatusAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool xds_annotations_v3_FieldStatusAnnotation_work_in_progress(const xds_annotations_v3_FieldStatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
+
+UPB_INLINE void xds_annotations_v3_FieldStatusAnnotation_set_work_in_progress(xds_annotations_v3_FieldStatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
+}
+
+/* xds.annotations.v3.StatusAnnotation */
+
+UPB_INLINE xds_annotations_v3_StatusAnnotation *xds_annotations_v3_StatusAnnotation_new(upb_arena *arena) {
+ return (xds_annotations_v3_StatusAnnotation *)_upb_msg_new(&xds_annotations_v3_StatusAnnotation_msginit, arena);
+}
+UPB_INLINE xds_annotations_v3_StatusAnnotation *xds_annotations_v3_StatusAnnotation_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_annotations_v3_StatusAnnotation *ret = xds_annotations_v3_StatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_annotations_v3_StatusAnnotation *xds_annotations_v3_StatusAnnotation_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_annotations_v3_StatusAnnotation *ret = xds_annotations_v3_StatusAnnotation_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_annotations_v3_StatusAnnotation_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_annotations_v3_StatusAnnotation_serialize(const xds_annotations_v3_StatusAnnotation *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, arena, len);
+}
+
+UPB_INLINE bool xds_annotations_v3_StatusAnnotation_work_in_progress(const xds_annotations_v3_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
+UPB_INLINE int32_t xds_annotations_v3_StatusAnnotation_package_version_status(const xds_annotations_v3_StatusAnnotation *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
+
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_work_in_progress(xds_annotations_v3_StatusAnnotation *msg, bool value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
+}
+UPB_INLINE void xds_annotations_v3_StatusAnnotation_set_package_version_status(xds_annotations_v3_StatusAnnotation *msg, int32_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
+}
+
+UPB_INLINE bool xds_annotations_v3_has_file_status(const struct google_protobuf_FileOptions *msg) { return _upb_msg_getext(msg, &xds_annotations_v3_file_status_ext) != NULL; }
+UPB_INLINE const xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_file_status(const struct google_protobuf_FileOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &xds_annotations_v3_file_status_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FileStatusAnnotation*); }
+UPB_INLINE bool xds_annotations_v3_has_message_status(const struct google_protobuf_MessageOptions *msg) { return _upb_msg_getext(msg, &xds_annotations_v3_message_status_ext) != NULL; }
+UPB_INLINE const xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_message_status(const struct google_protobuf_MessageOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &xds_annotations_v3_message_status_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_MessageStatusAnnotation*); }
+UPB_INLINE bool xds_annotations_v3_has_field_status(const struct google_protobuf_FieldOptions *msg) { return _upb_msg_getext(msg, &xds_annotations_v3_field_status_ext) != NULL; }
+UPB_INLINE const xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_field_status(const struct google_protobuf_FieldOptions *msg) { const upb_msg_ext *ext = _upb_msg_getext(msg, &xds_annotations_v3_field_status_ext); UPB_ASSERT(ext); return *UPB_PTR_AT(&ext->data, 0, const xds_annotations_v3_FieldStatusAnnotation*); }
+extern const upb_msglayout_file xds_annotations_v3_status_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
index 6c6da7d75b7..fe5c3c44bf6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.c
@@ -7,21 +7,32 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/authority.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout_field xds_core_v3_Authority__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_Authority_msginit = {
NULL,
&xds_core_v3_Authority__fields[0],
- UPB_SIZE(8, 16), 1, false, 255,
+ UPB_SIZE(8, 16), 1, _UPB_MSGEXT_NONE, 1, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &xds_core_v3_Authority_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_authority_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
index 2f1ff445416..cfc40dfa309 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/authority.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_
#define XDS_CORE_V3_AUTHORITY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -33,13 +33,19 @@ UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_new(upb_arena *arena) {
UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_Authority *ret = xds_core_v3_Authority_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_Authority *xds_core_v3_Authority_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_Authority *ret = xds_core_v3_Authority_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_Authority_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_Authority_serialize(const xds_core_v3_Authority *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_Authority_msginit, arena, len);
@@ -51,6 +57,8 @@ UPB_INLINE void xds_core_v3_Authority_set_name(xds_core_v3_Authority *msg, upb_s
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
}
+extern const upb_msglayout_file xds_core_v3_authority_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
index 20cc2970982..92a7f54ff85 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
@@ -7,45 +7,57 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/collection_entry.upb.h"
#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/resource_locator.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_CollectionEntry_submsgs[2] = {
- &xds_core_v3_CollectionEntry_InlineEntry_msginit,
- &xds_core_v3_ResourceLocator_msginit,
+static const upb_msglayout_sub xds_core_v3_CollectionEntry_submsgs[2] = {
+ {.submsg = &xds_core_v3_CollectionEntry_InlineEntry_msginit},
+ {.submsg = &xds_core_v3_ResourceLocator_msginit},
};
static const upb_msglayout_field xds_core_v3_CollectionEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-5, -9), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_CollectionEntry_msginit = {
&xds_core_v3_CollectionEntry_submsgs[0],
&xds_core_v3_CollectionEntry__fields[0],
- UPB_SIZE(8, 16), 2, false, 255,
+ UPB_SIZE(8, 16), 2, _UPB_MSGEXT_NONE, 2, 255,
};
-static const upb_msglayout *const xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = {
- &google_protobuf_Any_msginit,
+static const upb_msglayout_sub xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = {
+ {.submsg = &google_protobuf_Any_msginit},
};
static const upb_msglayout_field xds_core_v3_CollectionEntry_InlineEntry__fields[3] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit = {
&xds_core_v3_CollectionEntry_InlineEntry_submsgs[0],
&xds_core_v3_CollectionEntry_InlineEntry__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &xds_core_v3_CollectionEntry_msginit,
+ &xds_core_v3_CollectionEntry_InlineEntry_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_collection_entry_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
index 983a3455c8f..cd6fb80c792 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
#define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -40,13 +40,19 @@ UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_new(upb_aren
UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_CollectionEntry *xds_core_v3_CollectionEntry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_CollectionEntry *ret = xds_core_v3_CollectionEntry_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_CollectionEntry_msginit, arena, len);
@@ -97,13 +103,19 @@ UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_
UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry *xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_CollectionEntry_InlineEntry *ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, arena, len);
@@ -134,6 +146,8 @@ UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_m
return sub;
}
+extern const upb_msglayout_file xds_core_v3_collection_entry_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
index 17c3c61cda9..b1208c85d95 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c
@@ -7,35 +7,47 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/context_params.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ContextParams_submsgs[1] = {
- &xds_core_v3_ContextParams_ParamsEntry_msginit,
+static const upb_msglayout_sub xds_core_v3_ContextParams_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_ParamsEntry_msginit},
};
static const upb_msglayout_field xds_core_v3_ContextParams__fields[1] = {
- {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_LABEL_MAP},
+ {1, UPB_SIZE(0, 0), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_ContextParams_msginit = {
&xds_core_v3_ContextParams_submsgs[0],
&xds_core_v3_ContextParams__fields[0],
- UPB_SIZE(8, 8), 1, false, 255,
+ UPB_SIZE(8, 8), 1, _UPB_MSGEXT_NONE, 1, 255,
};
static const upb_msglayout_field xds_core_v3_ContextParams_ParamsEntry__fields[2] = {
- {1, UPB_SIZE(0, 0), 0, 0, 9, 1},
- {2, UPB_SIZE(8, 16), 0, 0, 9, 1},
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_ContextParams_ParamsEntry_msginit = {
NULL,
&xds_core_v3_ContextParams_ParamsEntry__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &xds_core_v3_ContextParams_msginit,
+ &xds_core_v3_ContextParams_ParamsEntry_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_context_params_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
index 0bcd2425962..273f2e6bdc8 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_
#define XDS_CORE_V3_CONTEXT_PARAMS_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -36,13 +36,19 @@ UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_new(upb_arena *a
UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_ContextParams *ret = xds_core_v3_ContextParams_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_ContextParams *xds_core_v3_ContextParams_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_ContextParams *ret = xds_core_v3_ContextParams_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_ContextParams_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_ContextParams_serialize(const xds_core_v3_ContextParams *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_ContextParams_msginit, arena, len);
@@ -75,6 +81,8 @@ UPB_INLINE void xds_core_v3_ContextParams_ParamsEntry_set_value(xds_core_v3_Cont
_upb_msg_map_set_value(msg, &value, 0);
}
+extern const upb_msglayout_file xds_core_v3_context_params_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
index fa2375e98ee..ef462d9a3a1 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.c
@@ -7,29 +7,40 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource.upb.h"
#include "google/protobuf/any.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/resource_name.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_Resource_submsgs[2] = {
- &google_protobuf_Any_msginit,
- &xds_core_v3_ResourceName_msginit,
+static const upb_msglayout_sub xds_core_v3_Resource_submsgs[2] = {
+ {.submsg = &google_protobuf_Any_msginit},
+ {.submsg = &xds_core_v3_ResourceName_msginit},
};
static const upb_msglayout_field xds_core_v3_Resource__fields[3] = {
- {1, UPB_SIZE(12, 24), 1, 1, 11, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(16, 32), 2, 0, 11, 1},
+ {1, UPB_SIZE(12, 24), 1, 1, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 32), 2, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_Resource_msginit = {
&xds_core_v3_Resource_submsgs[0],
&xds_core_v3_Resource__fields[0],
- UPB_SIZE(24, 48), 3, false, 255,
+ UPB_SIZE(24, 48), 3, _UPB_MSGEXT_NONE, 3, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &xds_core_v3_Resource_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_resource_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
index ab8e2df41b6..503c0f562c6 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -37,13 +37,19 @@ UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_new(upb_arena *arena) {
UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_Resource *ret = xds_core_v3_Resource_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_Resource *xds_core_v3_Resource_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_Resource *ret = xds_core_v3_Resource_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_Resource_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_Resource_serialize(const xds_core_v3_Resource *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_Resource_msginit, arena, len);
@@ -85,6 +91,8 @@ UPB_INLINE struct google_protobuf_Any* xds_core_v3_Resource_mutable_resource(xds
return sub;
}
+extern const upb_msglayout_file xds_core_v3_resource_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
index 2bd099a5e4c..0c71a02bd70 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c
@@ -7,47 +7,59 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource_locator.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/context_params.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ResourceLocator_submsgs[2] = {
- &xds_core_v3_ContextParams_msginit,
- &xds_core_v3_ResourceLocator_Directive_msginit,
+static const upb_msglayout_sub xds_core_v3_ResourceLocator_submsgs[2] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
+ {.submsg = &xds_core_v3_ResourceLocator_Directive_msginit},
};
static const upb_msglayout_field xds_core_v3_ResourceLocator__fields[6] = {
- {1, UPB_SIZE(0, 0), 0, 0, 14, 1},
- {2, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {3, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {4, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {5, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 0, 11, 1},
- {6, UPB_SIZE(28, 56), 0, 1, 11, 3},
+ {1, UPB_SIZE(0, 0), 0, 0, 14, _UPB_MODE_SCALAR | (_UPB_REP_4BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(32, 64), UPB_SIZE(-37, -73), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {6, UPB_SIZE(28, 56), 0, 1, 11, _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_ResourceLocator_msginit = {
&xds_core_v3_ResourceLocator_submsgs[0],
&xds_core_v3_ResourceLocator__fields[0],
- UPB_SIZE(40, 80), 6, false, 255,
+ UPB_SIZE(40, 80), 6, _UPB_MSGEXT_NONE, 6, 255,
};
-static const upb_msglayout *const xds_core_v3_ResourceLocator_Directive_submsgs[1] = {
- &xds_core_v3_ResourceLocator_msginit,
+static const upb_msglayout_sub xds_core_v3_ResourceLocator_Directive_submsgs[1] = {
+ {.submsg = &xds_core_v3_ResourceLocator_msginit},
};
static const upb_msglayout_field xds_core_v3_ResourceLocator_Directive__fields[2] = {
- {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, 1},
- {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, 1},
+ {1, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(0, 0), UPB_SIZE(-9, -17), 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit = {
&xds_core_v3_ResourceLocator_Directive_submsgs[0],
&xds_core_v3_ResourceLocator_Directive__fields[0],
- UPB_SIZE(16, 32), 2, false, 255,
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[2] = {
+ &xds_core_v3_ResourceLocator_msginit,
+ &xds_core_v3_ResourceLocator_Directive_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_resource_locator_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 2,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
index da7442bd179..04aa8fa220b 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_LOCATOR_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -44,13 +44,19 @@ UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_new(upb_aren
UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_ResourceLocator *xds_core_v3_ResourceLocator_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_ResourceLocator *ret = xds_core_v3_ResourceLocator_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_ResourceLocator_serialize(const xds_core_v3_ResourceLocator *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_ResourceLocator_msginit, arena, len);
@@ -117,13 +123,19 @@ UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Di
UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_ResourceLocator_Directive *xds_core_v3_ResourceLocator_Directive_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_ResourceLocator_Directive *ret = xds_core_v3_ResourceLocator_Directive_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_ResourceLocator_Directive_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_ResourceLocator_Directive_serialize(const xds_core_v3_ResourceLocator_Directive *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, arena, len);
@@ -157,6 +169,8 @@ UPB_INLINE void xds_core_v3_ResourceLocator_Directive_set_entry(xds_core_v3_Reso
UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
}
+extern const upb_msglayout_file xds_core_v3_resource_locator_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
index ff645f687ff..682e6fe5edd 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c
@@ -7,29 +7,40 @@
* regenerated. */
#include <stddef.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "xds/core/v3/resource_name.upb.h"
-#include "udpa/annotations/status.upb.h"
+#include "xds/annotations/v3/status.upb.h"
#include "xds/core/v3/context_params.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
-static const upb_msglayout *const xds_core_v3_ResourceName_submsgs[1] = {
- &xds_core_v3_ContextParams_msginit,
+static const upb_msglayout_sub xds_core_v3_ResourceName_submsgs[1] = {
+ {.submsg = &xds_core_v3_ContextParams_msginit},
};
static const upb_msglayout_field xds_core_v3_ResourceName__fields[4] = {
- {1, UPB_SIZE(4, 8), 0, 0, 9, 1},
- {2, UPB_SIZE(12, 24), 0, 0, 9, 1},
- {3, UPB_SIZE(20, 40), 0, 0, 9, 1},
- {4, UPB_SIZE(28, 56), 1, 0, 11, 1},
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(20, 40), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(28, 56), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
};
const upb_msglayout xds_core_v3_ResourceName_msginit = {
&xds_core_v3_ResourceName_submsgs[0],
&xds_core_v3_ResourceName__fields[0],
- UPB_SIZE(32, 64), 4, false, 255,
+ UPB_SIZE(32, 64), 4, _UPB_MSGEXT_NONE, 4, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &xds_core_v3_ResourceName_msginit,
+};
+
+const upb_msglayout_file xds_core_v3_resource_name_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
};
#include "upb/port_undef.inc"
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
index 3f38cc5139d..68688f4c798 100644
--- a/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h
@@ -9,7 +9,7 @@
#ifndef XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_
#define XDS_CORE_V3_RESOURCE_NAME_PROTO_UPB_H_
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
@@ -35,13 +35,19 @@ UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_new(upb_arena *are
UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_parse(const char *buf, size_t size,
upb_arena *arena) {
xds_core_v3_ResourceName *ret = xds_core_v3_ResourceName_new(arena);
- return (ret && upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, arena)) ? ret : NULL;
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, arena)) return NULL;
+ return ret;
}
UPB_INLINE xds_core_v3_ResourceName *xds_core_v3_ResourceName_parse_ex(const char *buf, size_t size,
- upb_arena *arena, int options) {
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
xds_core_v3_ResourceName *ret = xds_core_v3_ResourceName_new(arena);
- return (ret && _upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, arena, options))
- ? ret : NULL;
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_core_v3_ResourceName_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
}
UPB_INLINE char *xds_core_v3_ResourceName_serialize(const xds_core_v3_ResourceName *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &xds_core_v3_ResourceName_msginit, arena, len);
@@ -76,6 +82,8 @@ UPB_INLINE struct xds_core_v3_ContextParams* xds_core_v3_ResourceName_mutable_co
return sub;
}
+extern const upb_msglayout_file xds_core_v3_resource_name_proto_upb_file_layout;
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
new file mode 100644
index 00000000000..f8b1741f113
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c
@@ -0,0 +1,71 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/data/orca/v3/orca_load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/data/orca/v3/orca_load_report.upb.h"
+#include "validate/validate.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub xds_data_orca_v3_OrcaLoadReport_submsgs[2] = {
+ {.submsg = &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit},
+ {.submsg = &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit},
+};
+
+static const upb_msglayout_field xds_data_orca_v3_OrcaLoadReport__fields[5] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 8), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {3, UPB_SIZE(16, 16), 0, 0, 4, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+ {4, UPB_SIZE(24, 24), 0, 0, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+ {5, UPB_SIZE(28, 32), 0, 1, 11, _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_data_orca_v3_OrcaLoadReport_msginit = {
+ &xds_data_orca_v3_OrcaLoadReport_submsgs[0],
+ &xds_data_orca_v3_OrcaLoadReport__fields[0],
+ UPB_SIZE(32, 40), 5, _UPB_MSGEXT_NONE, 5, 255,
+};
+
+static const upb_msglayout_field xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit = {
+ NULL,
+ &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout_field xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[2] = {
+ {1, UPB_SIZE(0, 0), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(8, 16), 0, 0, 1, _UPB_MODE_SCALAR | (_UPB_REP_8BYTE << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit = {
+ NULL,
+ &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[3] = {
+ &xds_data_orca_v3_OrcaLoadReport_msginit,
+ &xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit,
+ &xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit,
+};
+
+const upb_msglayout_file xds_data_orca_v3_orca_load_report_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 3,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
new file mode 100644
index 00000000000..a3000f275f4
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h
@@ -0,0 +1,132 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/data/orca/v3/orca_load_report.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_
+#define XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_data_orca_v3_OrcaLoadReport;
+struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry;
+struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry;
+typedef struct xds_data_orca_v3_OrcaLoadReport xds_data_orca_v3_OrcaLoadReport;
+typedef struct xds_data_orca_v3_OrcaLoadReport_RequestCostEntry xds_data_orca_v3_OrcaLoadReport_RequestCostEntry;
+typedef struct xds_data_orca_v3_OrcaLoadReport_UtilizationEntry xds_data_orca_v3_OrcaLoadReport_UtilizationEntry;
+extern const upb_msglayout xds_data_orca_v3_OrcaLoadReport_msginit;
+extern const upb_msglayout xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_msginit;
+extern const upb_msglayout xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_msginit;
+
+
+/* xds.data.orca.v3.OrcaLoadReport */
+
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport *xds_data_orca_v3_OrcaLoadReport_new(upb_arena *arena) {
+ return (xds_data_orca_v3_OrcaLoadReport *)_upb_msg_new(&xds_data_orca_v3_OrcaLoadReport_msginit, arena);
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport *xds_data_orca_v3_OrcaLoadReport_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_data_orca_v3_OrcaLoadReport *ret = xds_data_orca_v3_OrcaLoadReport_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport *xds_data_orca_v3_OrcaLoadReport_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_data_orca_v3_OrcaLoadReport *ret = xds_data_orca_v3_OrcaLoadReport_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_data_orca_v3_OrcaLoadReport_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_data_orca_v3_OrcaLoadReport_serialize(const xds_data_orca_v3_OrcaLoadReport *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, arena, len);
+}
+
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_cpu_utilization(const xds_data_orca_v3_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double); }
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_mem_utilization(const xds_data_orca_v3_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double); }
+UPB_INLINE uint64_t xds_data_orca_v3_OrcaLoadReport_rps(const xds_data_orca_v3_OrcaLoadReport *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_request_cost(const xds_data_orca_v3_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_request_cost_size(const xds_data_orca_v3_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_get(const xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(24, 24), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_next(const xds_data_orca_v3_OrcaLoadReport *msg, size_t* iter) { return (const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_has_utilization(const xds_data_orca_v3_OrcaLoadReport *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE size_t xds_data_orca_v3_OrcaLoadReport_utilization_size(const xds_data_orca_v3_OrcaLoadReport *msg) {return _upb_msg_map_size(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_get(const xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key, double *val) { return _upb_msg_map_get(msg, UPB_SIZE(28, 32), &key, 0, val, sizeof(*val)); }
+UPB_INLINE const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_next(const xds_data_orca_v3_OrcaLoadReport *msg, size_t* iter) { return (const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_cpu_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_mem_utilization(xds_data_orca_v3_OrcaLoadReport *msg, double value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(8, 8), double) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_set_rps(xds_data_orca_v3_OrcaLoadReport *msg, uint64_t value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(16, 16), uint64_t) = value;
+}
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_request_cost_clear(xds_data_orca_v3_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(24, 24)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_set(xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(24, 24), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_request_cost_delete(xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(24, 24), &key, 0); }
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport_RequestCostEntry* xds_data_orca_v3_OrcaLoadReport_request_cost_nextmutable(xds_data_orca_v3_OrcaLoadReport *msg, size_t* iter) { return (xds_data_orca_v3_OrcaLoadReport_RequestCostEntry*)_upb_msg_map_next(msg, UPB_SIZE(24, 24), iter); }
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_utilization_clear(xds_data_orca_v3_OrcaLoadReport *msg) { _upb_msg_map_clear(msg, UPB_SIZE(28, 32)); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_set(xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key, double val, upb_arena *a) { return _upb_msg_map_set(msg, UPB_SIZE(28, 32), &key, 0, &val, sizeof(val), a); }
+UPB_INLINE bool xds_data_orca_v3_OrcaLoadReport_utilization_delete(xds_data_orca_v3_OrcaLoadReport *msg, upb_strview key) { return _upb_msg_map_delete(msg, UPB_SIZE(28, 32), &key, 0); }
+UPB_INLINE xds_data_orca_v3_OrcaLoadReport_UtilizationEntry* xds_data_orca_v3_OrcaLoadReport_utilization_nextmutable(xds_data_orca_v3_OrcaLoadReport *msg, size_t* iter) { return (xds_data_orca_v3_OrcaLoadReport_UtilizationEntry*)_upb_msg_map_next(msg, UPB_SIZE(28, 32), iter); }
+
+/* xds.data.orca.v3.OrcaLoadReport.RequestCostEntry */
+
+UPB_INLINE upb_strview xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_key(const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_value(const xds_data_orca_v3_OrcaLoadReport_RequestCostEntry *msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_RequestCostEntry_set_value(xds_data_orca_v3_OrcaLoadReport_RequestCostEntry *msg, double value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
+}
+
+/* xds.data.orca.v3.OrcaLoadReport.UtilizationEntry */
+
+UPB_INLINE upb_strview xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_key(const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry *msg) {
+ upb_strview ret;
+ _upb_msg_map_key(msg, &ret, 0);
+ return ret;
+}
+UPB_INLINE double xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_value(const xds_data_orca_v3_OrcaLoadReport_UtilizationEntry *msg) {
+ double ret;
+ _upb_msg_map_value(msg, &ret, sizeof(ret));
+ return ret;
+}
+
+UPB_INLINE void xds_data_orca_v3_OrcaLoadReport_UtilizationEntry_set_value(xds_data_orca_v3_OrcaLoadReport_UtilizationEntry *msg, double value) {
+ _upb_msg_map_set_value(msg, &value, sizeof(double));
+}
+
+extern const upb_msglayout_file xds_data_orca_v3_orca_load_report_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_DATA_ORCA_V3_ORCA_LOAD_REPORT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c b/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
new file mode 100644
index 00000000000..198c2014caa
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c
@@ -0,0 +1,44 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include <stddef.h>
+#include "upb/msg_internal.h"
+#include "xds/type/v3/typed_struct.upb.h"
+#include "validate/validate.upb.h"
+#include "google/protobuf/struct.upb.h"
+
+#include "upb/port_def.inc"
+
+static const upb_msglayout_sub xds_type_v3_TypedStruct_submsgs[1] = {
+ {.submsg = &google_protobuf_Struct_msginit},
+};
+
+static const upb_msglayout_field xds_type_v3_TypedStruct__fields[2] = {
+ {1, UPB_SIZE(4, 8), 0, 0, 9, _UPB_MODE_SCALAR | (_UPB_REP_STRVIEW << _UPB_REP_SHIFT)},
+ {2, UPB_SIZE(12, 24), 1, 0, 11, _UPB_MODE_SCALAR | (_UPB_REP_PTR << _UPB_REP_SHIFT)},
+};
+
+const upb_msglayout xds_type_v3_TypedStruct_msginit = {
+ &xds_type_v3_TypedStruct_submsgs[0],
+ &xds_type_v3_TypedStruct__fields[0],
+ UPB_SIZE(16, 32), 2, _UPB_MSGEXT_NONE, 2, 255,
+};
+
+static const upb_msglayout *messages_layout[1] = {
+ &xds_type_v3_TypedStruct_msginit,
+};
+
+const upb_msglayout_file xds_type_v3_typed_struct_proto_upb_file_layout = {
+ messages_layout,
+ NULL,
+ 1,
+ 0,
+};
+
+#include "upb/port_undef.inc"
+
diff --git a/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h b/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h
new file mode 100644
index 00000000000..1ad14aab24e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h
@@ -0,0 +1,85 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_
+#define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_
+
+#include "upb/msg_internal.h"
+#include "upb/decode.h"
+#include "upb/decode_fast.h"
+#include "upb/encode.h"
+
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct xds_type_v3_TypedStruct;
+typedef struct xds_type_v3_TypedStruct xds_type_v3_TypedStruct;
+extern const upb_msglayout xds_type_v3_TypedStruct_msginit;
+struct google_protobuf_Struct;
+extern const upb_msglayout google_protobuf_Struct_msginit;
+
+
+/* xds.type.v3.TypedStruct */
+
+UPB_INLINE xds_type_v3_TypedStruct *xds_type_v3_TypedStruct_new(upb_arena *arena) {
+ return (xds_type_v3_TypedStruct *)_upb_msg_new(&xds_type_v3_TypedStruct_msginit, arena);
+}
+UPB_INLINE xds_type_v3_TypedStruct *xds_type_v3_TypedStruct_parse(const char *buf, size_t size,
+ upb_arena *arena) {
+ xds_type_v3_TypedStruct *ret = xds_type_v3_TypedStruct_new(arena);
+ if (!ret) return NULL;
+ if (!upb_decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, arena)) return NULL;
+ return ret;
+}
+UPB_INLINE xds_type_v3_TypedStruct *xds_type_v3_TypedStruct_parse_ex(const char *buf, size_t size,
+ const upb_extreg *extreg, int options,
+ upb_arena *arena) {
+ xds_type_v3_TypedStruct *ret = xds_type_v3_TypedStruct_new(arena);
+ if (!ret) return NULL;
+ if (!_upb_decode(buf, size, ret, &xds_type_v3_TypedStruct_msginit, extreg, options, arena)) {
+ return NULL;
+ }
+ return ret;
+}
+UPB_INLINE char *xds_type_v3_TypedStruct_serialize(const xds_type_v3_TypedStruct *msg, upb_arena *arena, size_t *len) {
+ return upb_encode(msg, &xds_type_v3_TypedStruct_msginit, arena, len);
+}
+
+UPB_INLINE upb_strview xds_type_v3_TypedStruct_type_url(const xds_type_v3_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
+UPB_INLINE bool xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
+UPB_INLINE const struct google_protobuf_Struct* xds_type_v3_TypedStruct_value(const xds_type_v3_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
+
+UPB_INLINE void xds_type_v3_TypedStruct_set_type_url(xds_type_v3_TypedStruct *msg, upb_strview value) {
+ *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
+}
+UPB_INLINE void xds_type_v3_TypedStruct_set_value(xds_type_v3_TypedStruct *msg, struct google_protobuf_Struct* value) {
+ _upb_sethas(msg, 1);
+ *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
+}
+UPB_INLINE struct google_protobuf_Struct* xds_type_v3_TypedStruct_mutable_value(xds_type_v3_TypedStruct *msg, upb_arena *arena) {
+ struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)xds_type_v3_TypedStruct_value(msg);
+ if (sub == NULL) {
+ sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
+ if (!sub) return NULL;
+ xds_type_v3_TypedStruct_set_value(msg, sub);
+ }
+ return sub;
+}
+
+extern const upb_msglayout_file xds_type_v3_typed_struct_proto_upb_file_layout;
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
index 8418d1e9284..fa1f40e3aa9 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c
@@ -8,60 +8,13 @@
#include "upb/def.h"
#include "envoy/admin/v3/config_dump.upbdefs.h"
+#include "envoy/admin/v3/config_dump.upb.h"
extern upb_def_init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_admin_v3_ConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_UpdateFailureState_msginit;
-extern const upb_msglayout envoy_admin_v3_BootstrapConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_StaticListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit;
-extern const upb_msglayout envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit;
-extern const upb_msglayout envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit;
-
-static const upb_msglayout *layouts[22] = {
- &envoy_admin_v3_ConfigDump_msginit,
- &envoy_admin_v3_UpdateFailureState_msginit,
- &envoy_admin_v3_BootstrapConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_msginit,
- &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit,
- &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit,
- &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit,
- &envoy_admin_v3_ClustersConfigDump_msginit,
- &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit,
- &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit,
- &envoy_admin_v3_RoutesConfigDump_msginit,
- &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit,
- &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit,
- &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit,
- &envoy_admin_v3_SecretsConfigDump_msginit,
- &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit,
- &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit,
- &envoy_admin_v3_EndpointsConfigDump_msginit,
- &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit,
- &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit,
-};
-
static const char descriptor[6802] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd',
'u', 'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\016', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
'\032', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
@@ -348,7 +301,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_admin_v3_config_dump_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_admin_v3_config_dump_proto_upb_file_layout,
"envoy/admin/v3/config_dump.proto",
UPB_STRVIEW_INIT(descriptor, 6802)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
index ffb007703cf..324e41ac1d5 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c
@@ -8,21 +8,29 @@
#include "upb/def.h"
#include "envoy/annotations/deprecation.upbdefs.h"
+#include "envoy/annotations/deprecation.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
-static const char descriptor[283] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e',
+static const char descriptor[490] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e',
'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'n', 'n', 'o', 't',
'a', 't', 'i', 'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd',
'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', ':', 'T', '\n', '\025', 'd', 'i', 's', 'a', 'l', 'l',
'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\347', '\255', '\256',
'Z', ' ', '\001', '(', '\010', 'R', '\023', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l',
-'t', ':', 'a', '\n', '\032', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l',
-'t', '_', 'e', 'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\365', '\316', '\266', '!', ' ', '\001', '(', '\010',
-'R', '\027', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'E', 'n', 'u', 'm',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'t', ':', '_', '\n', '\033', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'a', 't', '_', 'm', 'i', 'n', 'o', 'r', '_',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\362', '\350', '\200', 'K', ' ', '\001', '(', '\t', 'R', '\030', 'd',
+'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'A', 't', 'M', 'i', 'n', 'o', 'r', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', 'a',
+'\n', '\032', 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', '_', 'b', 'y', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'e',
+'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'E', 'n', 'u',
+'m', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\365', '\316', '\266', '!', ' ', '\001', '(', '\010', 'R', '\027', 'd',
+'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd', 'B', 'y', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'E', 'n', 'u', 'm', ':', 'l', '\n',
+' ', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'a', 't', '_', 'm', 'i', 'n', 'o', 'r', '_', 'v', 'e', 'r', 's',
+'i', 'o', 'n', '_', 'e', 'n', 'u', 'm', '\022', '!', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\301', '\276', '\263', 'V', ' ', '\001',
+'(', '\t', 'R', '\034', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'A', 't', 'M', 'i', 'n', 'o', 'r', 'V', 'e', 'r', 's',
+'i', 'o', 'n', 'E', 'n', 'u', 'm', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -32,7 +40,7 @@ static upb_def_init *deps[2] = {
upb_def_init envoy_annotations_deprecation_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_annotations_deprecation_proto_upb_file_layout,
"envoy/annotations/deprecation.proto",
- UPB_STRVIEW_INIT(descriptor, 283)
+ UPB_STRVIEW_INIT(descriptor, 490)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
index 5a3b9652a7f..c0729eada74 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c
@@ -8,14 +8,9 @@
#include "upb/def.h"
#include "envoy/annotations/resource.upbdefs.h"
+#include "envoy/annotations/resource.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout envoy_annotations_ResourceAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_annotations_ResourceAnnotation_msginit,
-};
-
static const char descriptor[240] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'r', 'e', 's', 'o', 'u',
'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
@@ -35,7 +30,7 @@ static upb_def_init *deps[2] = {
upb_def_init envoy_annotations_resource_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_annotations_resource_proto_upb_file_layout,
"envoy/annotations/resource.proto",
UPB_STRVIEW_INIT(descriptor, 240)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
index d9e634392ca..e62a51146dd 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/accesslog/v3/accesslog.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/accesslog/v3/accesslog.upbdefs.h"
+#include "envoy/config/accesslog/v3/accesslog.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
@@ -18,41 +19,7 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_AccessLogFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ComparisonFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_StatusCodeFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_DurationFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_NotHealthCheckFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_TraceableFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_RuntimeFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_AndFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_OrFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_HeaderFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ResponseFlagFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_GrpcStatusFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_MetadataFilter_msginit;
-extern const upb_msglayout envoy_config_accesslog_v3_ExtensionFilter_msginit;
-
-static const upb_msglayout *layouts[15] = {
- &envoy_config_accesslog_v3_AccessLog_msginit,
- &envoy_config_accesslog_v3_AccessLogFilter_msginit,
- &envoy_config_accesslog_v3_ComparisonFilter_msginit,
- &envoy_config_accesslog_v3_StatusCodeFilter_msginit,
- &envoy_config_accesslog_v3_DurationFilter_msginit,
- &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit,
- &envoy_config_accesslog_v3_TraceableFilter_msginit,
- &envoy_config_accesslog_v3_RuntimeFilter_msginit,
- &envoy_config_accesslog_v3_AndFilter_msginit,
- &envoy_config_accesslog_v3_OrFilter_msginit,
- &envoy_config_accesslog_v3_HeaderFilter_msginit,
- &envoy_config_accesslog_v3_ResponseFlagFilter_msginit,
- &envoy_config_accesslog_v3_GrpcStatusFilter_msginit,
- &envoy_config_accesslog_v3_MetadataFilter_msginit,
- &envoy_config_accesslog_v3_ExtensionFilter_msginit,
-};
-
-static const char descriptor[4388] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/',
+static const char descriptor[4402] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/',
'v', '3', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
@@ -178,56 +145,57 @@ static const char descriptor[4388] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', '
'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005',
'\212', '\001', '\002', '\020', '\001', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o',
-'g', '.', 'v', '2', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\334', '\001', '\n', '\022', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\211', '\001', '\n', '\005', 'f', 'l', 'a', 'g', 's',
-'\030', '\001', ' ', '\003', '(', '\t', 'B', 's', '\372', 'B', 'p', '\222', '\001', 'm', '\"', 'k', 'r', 'i', 'R', '\002', 'L', 'H', 'R', '\002', 'U',
-'H', 'R', '\002', 'U', 'T', 'R', '\002', 'L', 'R', 'R', '\002', 'U', 'R', 'R', '\002', 'U', 'F', 'R', '\002', 'U', 'C', 'R', '\002', 'U', 'O',
-'R', '\002', 'N', 'R', 'R', '\002', 'D', 'I', 'R', '\002', 'F', 'I', 'R', '\002', 'R', 'L', 'R', '\004', 'U', 'A', 'E', 'X', 'R', '\004', 'R',
-'L', 'S', 'E', 'R', '\002', 'D', 'C', 'R', '\003', 'U', 'R', 'X', 'R', '\002', 'S', 'I', 'R', '\002', 'I', 'H', 'R', '\003', 'D', 'P', 'E',
-'R', '\005', 'U', 'M', 'S', 'D', 'R', 'R', '\004', 'R', 'F', 'C', 'F', 'R', '\004', 'N', 'F', 'C', 'F', 'R', '\002', 'D', 'T', 'R', '\005',
-'f', 'l', 'a', 'g', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\200', '\004', '\n', '\020', 'G', 'r', 'p', 'c', 'S',
-'t', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '\022', ']', '\n', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001',
-' ', '\003', '(', '\016', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's',
-'s', 'l', 'o', 'g', '.', 'v', '3', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '.',
-'S', 't', 'a', 't', 'u', 's', 'B', '\r', '\372', 'B', '\n', '\222', '\001', '\007', '\"', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 's', 't',
-'a', 't', 'u', 's', 'e', 's', '\022', '\030', '\n', '\007', 'e', 'x', 'c', 'l', 'u', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\007',
-'e', 'x', 'c', 'l', 'u', 'd', 'e', '\"', '\270', '\002', '\n', '\006', 'S', 't', 'a', 't', 'u', 's', '\022', '\006', '\n', '\002', 'O', 'K', '\020',
-'\000', '\022', '\014', '\n', '\010', 'C', 'A', 'N', 'C', 'E', 'L', 'E', 'D', '\020', '\001', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W',
-'N', '\020', '\002', '\022', '\024', '\n', '\020', 'I', 'N', 'V', 'A', 'L', 'I', 'D', '_', 'A', 'R', 'G', 'U', 'M', 'E', 'N', 'T', '\020', '\003',
-'\022', '\025', '\n', '\021', 'D', 'E', 'A', 'D', 'L', 'I', 'N', 'E', '_', 'E', 'X', 'C', 'E', 'E', 'D', 'E', 'D', '\020', '\004', '\022', '\r',
-'\n', '\t', 'N', 'O', 'T', '_', 'F', 'O', 'U', 'N', 'D', '\020', '\005', '\022', '\022', '\n', '\016', 'A', 'L', 'R', 'E', 'A', 'D', 'Y', '_',
-'E', 'X', 'I', 'S', 'T', 'S', '\020', '\006', '\022', '\025', '\n', '\021', 'P', 'E', 'R', 'M', 'I', 'S', 'S', 'I', 'O', 'N', '_', 'D', 'E',
-'N', 'I', 'E', 'D', '\020', '\007', '\022', '\026', '\n', '\022', 'R', 'E', 'S', 'O', 'U', 'R', 'C', 'E', '_', 'E', 'X', 'H', 'A', 'U', 'S',
-'T', 'E', 'D', '\020', '\010', '\022', '\027', '\n', '\023', 'F', 'A', 'I', 'L', 'E', 'D', '_', 'P', 'R', 'E', 'C', 'O', 'N', 'D', 'I', 'T',
-'I', 'O', 'N', '\020', '\t', '\022', '\013', '\n', '\007', 'A', 'B', 'O', 'R', 'T', 'E', 'D', '\020', '\n', '\022', '\020', '\n', '\014', 'O', 'U', 'T',
-'_', 'O', 'F', '_', 'R', 'A', 'N', 'G', 'E', '\020', '\013', '\022', '\021', '\n', '\r', 'U', 'N', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N',
-'T', 'E', 'D', '\020', '\014', '\022', '\014', '\n', '\010', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '\020', '\r', '\022', '\017', '\n', '\013', 'U', 'N',
-'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\016', '\022', '\r', '\n', '\t', 'D', 'A', 'T', 'A', '_', 'L', 'O', 'S', 'S', '\020',
-'\017', '\022', '\023', '\n', '\017', 'U', 'N', 'A', 'U', 'T', 'H', 'E', 'N', 'T', 'I', 'C', 'A', 'T', 'E', 'D', '\020', '\020', ':', '8', '\232',
-'\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F',
-'i', 'l', 't', 'e', 'r', '\"', '\332', '\001', '\n', '\016', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\022',
-'@', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M',
-'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'N', '\n', '\026', 'm', 'a', 't', 'c', 'h', '_',
-'i', 'f', '_', 'k', 'e', 'y', '_', 'n', 'o', 't', '_', 'f', 'o', 'u', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\022', 'm', 'a', 't', 'c', 'h', 'I', 'f', 'K', 'e', 'y', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', ':', '6', '\232', '\305', '\210',
-'\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a',
-'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e',
-'r', '\"', '\266', '\001', '\n', '\017', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\022', '\n', '\004',
-'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
-':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l',
-'t', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010',
-'\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
-'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o',
-'g', '.', 'v', '3', 'B', '\016', 'A', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'g', '.', 'v', '2', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\352', '\001', '\n', '\022', 'R', 'e', 's',
+'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\227', '\001', '\n', '\005', 'f', 'l', 'a', 'g', 's',
+'\030', '\001', ' ', '\003', '(', '\t', 'B', '\200', '\001', '\372', 'B', '}', '\222', '\001', 'z', '\"', 'x', 'r', 'v', 'R', '\002', 'L', 'H', 'R', '\002',
+'U', 'H', 'R', '\002', 'U', 'T', 'R', '\002', 'L', 'R', 'R', '\002', 'U', 'R', 'R', '\002', 'U', 'F', 'R', '\002', 'U', 'C', 'R', '\002', 'U',
+'O', 'R', '\002', 'N', 'R', 'R', '\002', 'D', 'I', 'R', '\002', 'F', 'I', 'R', '\002', 'R', 'L', 'R', '\004', 'U', 'A', 'E', 'X', 'R', '\004',
+'R', 'L', 'S', 'E', 'R', '\002', 'D', 'C', 'R', '\003', 'U', 'R', 'X', 'R', '\002', 'S', 'I', 'R', '\002', 'I', 'H', 'R', '\003', 'D', 'P',
+'E', 'R', '\005', 'U', 'M', 'S', 'D', 'R', 'R', '\004', 'R', 'F', 'C', 'F', 'R', '\004', 'N', 'F', 'C', 'F', 'R', '\002', 'D', 'T', 'R',
+'\003', 'U', 'P', 'E', 'R', '\002', 'N', 'C', 'R', '\002', 'O', 'M', 'R', '\005', 'f', 'l', 'a', 'g', 's', ':', ':', '\232', '\305', '\210', '\036',
+'5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c',
+'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2', '.', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'F', 'l', 'a', 'g', 'F', 'i',
+'l', 't', 'e', 'r', '\"', '\200', '\004', '\n', '\020', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r',
+'\022', ']', '\n', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\001', ' ', '\003', '(', '\016', '2', '2', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'G', 'r', 'p',
+'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '.', 'S', 't', 'a', 't', 'u', 's', 'B', '\r', '\372', 'B', '\n',
+'\222', '\001', '\007', '\"', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\022', '\030', '\n', '\007', 'e',
+'x', 'c', 'l', 'u', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\007', 'e', 'x', 'c', 'l', 'u', 'd', 'e', '\"', '\270', '\002', '\n',
+'\006', 'S', 't', 'a', 't', 'u', 's', '\022', '\006', '\n', '\002', 'O', 'K', '\020', '\000', '\022', '\014', '\n', '\010', 'C', 'A', 'N', 'C', 'E', 'L',
+'E', 'D', '\020', '\001', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\002', '\022', '\024', '\n', '\020', 'I', 'N', 'V', 'A',
+'L', 'I', 'D', '_', 'A', 'R', 'G', 'U', 'M', 'E', 'N', 'T', '\020', '\003', '\022', '\025', '\n', '\021', 'D', 'E', 'A', 'D', 'L', 'I', 'N',
+'E', '_', 'E', 'X', 'C', 'E', 'E', 'D', 'E', 'D', '\020', '\004', '\022', '\r', '\n', '\t', 'N', 'O', 'T', '_', 'F', 'O', 'U', 'N', 'D',
+'\020', '\005', '\022', '\022', '\n', '\016', 'A', 'L', 'R', 'E', 'A', 'D', 'Y', '_', 'E', 'X', 'I', 'S', 'T', 'S', '\020', '\006', '\022', '\025', '\n',
+'\021', 'P', 'E', 'R', 'M', 'I', 'S', 'S', 'I', 'O', 'N', '_', 'D', 'E', 'N', 'I', 'E', 'D', '\020', '\007', '\022', '\026', '\n', '\022', 'R',
+'E', 'S', 'O', 'U', 'R', 'C', 'E', '_', 'E', 'X', 'H', 'A', 'U', 'S', 'T', 'E', 'D', '\020', '\010', '\022', '\027', '\n', '\023', 'F', 'A',
+'I', 'L', 'E', 'D', '_', 'P', 'R', 'E', 'C', 'O', 'N', 'D', 'I', 'T', 'I', 'O', 'N', '\020', '\t', '\022', '\013', '\n', '\007', 'A', 'B',
+'O', 'R', 'T', 'E', 'D', '\020', '\n', '\022', '\020', '\n', '\014', 'O', 'U', 'T', '_', 'O', 'F', '_', 'R', 'A', 'N', 'G', 'E', '\020', '\013',
+'\022', '\021', '\n', '\r', 'U', 'N', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N', 'T', 'E', 'D', '\020', '\014', '\022', '\014', '\n', '\010', 'I', 'N',
+'T', 'E', 'R', 'N', 'A', 'L', '\020', '\r', '\022', '\017', '\n', '\013', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\016',
+'\022', '\r', '\n', '\t', 'D', 'A', 'T', 'A', '_', 'L', 'O', 'S', 'S', '\020', '\017', '\022', '\023', '\n', '\017', 'U', 'N', 'A', 'U', 'T', 'H',
+'E', 'N', 'T', 'I', 'C', 'A', 'T', 'E', 'D', '\020', '\020', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.',
+'v', '2', '.', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\332', '\001', '\n', '\016', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\022', '@', '\n', '\007', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '\022', 'N', '\n', '\026', 'm', 'a', 't', 'c', 'h', '_', 'i', 'f', '_', 'k', 'e', 'y', '_', 'n', 'o', 't', '_',
+'f', 'o', 'u', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\022', 'm', 'a', 't', 'c', 'h', 'I', 'f', 'K', 'e',
+'y', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', ':', '6', '\232', '\305', '\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '2',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'F', 'i', 'l', 't', 'e', 'r', '\"', '\266', '\001', '\n', '\017', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R',
+'\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001',
+'(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H',
+'\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'a', 'c', 'c', 'e', 's', 's', 'l',
+'o', 'g', '.', 'v', '2', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013',
+'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g',
+'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', 'B', '\016', 'A', 'c', 'c', 'e', 's',
+'s', 'l', 'o', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
};
static upb_def_init *deps[10] = {
@@ -245,7 +213,7 @@ static upb_def_init *deps[10] = {
upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_accesslog_v3_accesslog_proto_upb_file_layout,
"envoy/config/accesslog/v3/accesslog.proto",
- UPB_STRVIEW_INIT(descriptor, 4388)
+ UPB_STRVIEW_INIT(descriptor, 4402)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
index f86bfe76f4a..c2f2cf4e2cf 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.c
@@ -8,13 +8,16 @@
#include "upb/def.h"
#include "envoy/config/bootstrap/v3/bootstrap.upbdefs.h"
+#include "envoy/config/bootstrap/v3/bootstrap.upb.h"
+extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
extern upb_def_init envoy_config_cluster_v3_cluster_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_resolver_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
extern upb_def_init envoy_config_listener_v3_listener_proto_upbdefinit;
extern upb_def_init envoy_config_metrics_v3_stats_proto_upbdefinit;
@@ -25,338 +28,336 @@ extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_struct_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
extern upb_def_init udpa_annotations_security_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Admin_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdogs_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_FatalAction_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_Runtime_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit;
-extern const upb_msglayout envoy_config_bootstrap_v3_LayeredRuntime_msginit;
-
-static const upb_msglayout *layouts[17] = {
- &envoy_config_bootstrap_v3_Bootstrap_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit,
- &envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_msginit,
- &envoy_config_bootstrap_v3_Admin_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_msginit,
- &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit,
- &envoy_config_bootstrap_v3_Watchdogs_msginit,
- &envoy_config_bootstrap_v3_Watchdog_msginit,
- &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit,
- &envoy_config_bootstrap_v3_FatalAction_msginit,
- &envoy_config_bootstrap_v3_Runtime_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit,
- &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit,
- &envoy_config_bootstrap_v3_LayeredRuntime_msginit,
-};
-
-static const char descriptor[6993] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
+static const char descriptor[7815] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '/',
'v', '3', '/', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '\032', '%', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
-'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
-'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
-'/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n', 'v',
-'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v', 'e', 'n', 't', '_', 's',
-'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o',
-'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
-'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3',
-'/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
-'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd',
-'/', 'v', '3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y',
-'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 't', 'r', 'a',
-'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/',
-'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y',
-'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g',
-'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w',
-'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
-'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i',
-'d', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\341', '\026', '\n', '\t', 'B',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e',
-'R', '\004', 'n', 'o', 'd', 'e', '\022', '.', '\n', '\023', 'n', 'o', 'd', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a',
-'r', 'a', 'm', 's', '\030', '\032', ' ', '\003', '(', '\t', 'R', '\021', 'n', 'o', 'd', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a',
-'r', 'a', 'm', 's', '\022', '_', '\n', '\020', 's', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
-'s', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c',
-'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'R', '\017', 's', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
-'s', '\022', 'b', '\n', '\021', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\003', ' ',
-'\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
-'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'R', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
-'s', '\022', 'R', '\n', '\017', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\004', ' ', '\001', '(',
-'\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\016', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\n', 'h', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\016', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'h', 'd', 's', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'f', 'l', 'a', 'g', 's', '_', 'p', 'a', 't', 'h', '\030', '\005', ' ', '\001', '(', '\t',
-'R', '\t', 'f', 'l', 'a', 'g', 's', 'P', 'a', 't', 'h', '\022', 'C', '\n', '\013', 's', 't', 'a', 't', 's', '_', 's', 'i', 'n', 'k',
-'s', '\030', '\006', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e',
-'t', 'r', 'i', 'c', 's', '.', 'v', '3', '.', 'S', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 'R', '\n', 's', 't', 'a', 't', 's',
-'S', 'i', 'n', 'k', 's', '\022', 'G', '\n', '\014', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\001',
-'(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's',
-'.', 'v', '3', '.', 'S', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 's', 't', 'a', 't', 's', 'C', 'o', 'n',
-'f', 'i', 'g', '\022', 'q', '\n', '\024', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v',
-'a', 'l', '\030', '\007', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '$', '\372', 'B', '\016', '\252', '\001', '\013', '\032', '\003', '\010', '\254', '\002', '2', '\004',
-'\020', '\300', '\204', '=', '\362', '\230', '\376', '\217', '\005', '\r', '\022', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'R', '\022',
-'s', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', ':', '\n', '\024', 's', 't', 'a',
-'t', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'o', 'n', '_', 'a', 'd', 'm', 'i', 'n', '\030', '\035', ' ', '\001', '(', '\010', 'B', '\007',
-'\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\021', 's', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'O', 'n', 'A', 'd',
-'m', 'i', 'n', '\022', 'C', '\n', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '#', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.',
-'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'B', '\002', '\030', '\001', 'R', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'B', '\n',
-'\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\030', '\033', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h',
-'d', 'o', 'g', 's', 'R', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', '<', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n',
-'g', '\030', '\t', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r',
-'a', 'c', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '\002', '\030', '\001', 'R', '\007', 't', 'r', 'a', 'c', 'i',
-'n', 'g', '\022', 'R', '\n', '\017', 'l', 'a', 'y', 'e', 'r', 'e', 'd', '_', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\030', '\021', ' ', '\001',
-'(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r',
-'a', 'p', '.', 'v', '3', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'R', '\016', 'l', 'a', 'y',
-'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '6', '\n', '\005', 'a', 'd', 'm', 'i', 'n', '\030', '\014', ' ', '\001', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'A', 'd', 'm', 'i', 'n', 'R', '\005', 'a', 'd', 'm', 'i', 'n', '\022', 'd', '\n', '\020', 'o', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\017', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\016', '\212', '\223', '\267', '*', '\002', '\010', '\001', '\212', '\223', '\267', '*', '\002',
-'\020', '\001', 'R', '\017', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', '6', '\n', '\027', 'e', 'n',
-'a', 'b', 'l', 'e', '_', 'd', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '\020', ' ', '\001',
-'(', '\010', 'R', '\025', 'e', 'n', 'a', 'b', 'l', 'e', 'D', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r', 'S', 't', 'a', 't', 's',
-'\022', '#', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\022', ' ', '\001', '(', '\t', 'R', '\014',
-'h', 'e', 'a', 'd', 'e', 'r', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '_', '\n', '\035', 's', 't', 'a', 't', 's', '_', 's', 'e', 'r',
-'v', 'e', 'r', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030', '\023', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6',
-'4', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 's', 't', 'a', 't', 's', 'S', 'e', 'r', 'v', 'e', 'r', 'V', 'e', 'r', 's', 'i', 'o',
-'n', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', '4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_',
-'d', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '\024', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p',
-'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', ']', '\n', '\024', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', 'K', '\n', '\r', 'f', 'a', 't', 'a', 'l', '_', 'a', 'c', 't', 'i', 'o', 'n', 's',
-'\030', '\034', ' ', '\003', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o',
-'t', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'F', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\014', 'f', 'a',
-'t', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 's', '\022', 'I', '\n', '\016', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r',
-'c', 'e', 's', '\030', '\026', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\r', 'c', 'o', 'n',
-'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'V', '\n', '\025', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\027', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r',
-'c', 'e', 'R', '\023', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8',
-'\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'i', 'n', 't', 'e', 'r', 'f', 'a', 'c',
-'e', '\030', '\030', ' ', '\001', '(', '\t', 'R', '\026', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'o', 'c', 'k', 'e', 't', 'I', 'n', 't',
-'e', 'r', 'f', 'a', 'c', 'e', '\022', '\214', '\001', '\n', '\036', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r',
-'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', 'F', '.',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '\032', ')', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/', 'v', '3', '/', 'a', 'c',
+'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
+'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g',
+'_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
+'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v', 'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n',
+'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3', '/', 's', 't', 'a', 't',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e',
+'r', 'l', 'o', 'a', 'd', '/', 'v', '3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'',
+'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h', 't', 't',
+'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's',
+'/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v',
+'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's',
+'t', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm',
+'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
+'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\234', '\031', '\n', '\t', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
+'\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e', '\022', '.',
+'\n', '\023', 'n', 'o', 'd', 'e', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\032', ' ', '\003',
+'(', '\t', 'R', '\021', 'n', 'o', 'd', 'e', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '_', '\n', '\020',
+'s', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '4', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3',
-'.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o',
-'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\034', 'c', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\032',
-'\232', '\002', '\n', '\017', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', '@', '\n', '\t', 'l', 'i',
-'s', 't', 'e', 'n', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'R',
-'\t', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', '<', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\002', ' ',
-'\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e',
-'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'K', '\n',
-'\007', 's', 'e', 'c', 'r', 'e', 't', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
-'s', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'e', 'c', 'r', 'e', 't', 'R', '\007', 's', 'e', 'c', 'r', 'e', 't', 's', ':',
-':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
-'s', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c',
-'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\032', '\211', '\003', '\n', '\020', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o',
-'u', 'r', 'c', 'e', 's', '\022', 'A', '\n', '\n', 'l', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n',
-'\025', 'l', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\005', ' ',
-'\001', '(', '\t', 'R', '\023', 'l', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022',
-'A', '\n', '\n', 'c', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S',
-'o', 'u', 'r', 'c', 'e', 'R', '\t', 'c', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2', '\n', '\025', 'c', 'd', 's', '_', 'r',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\023', 'c',
-'d', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'D', '\n', '\n', 'a', 'd', 's',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r',
-'c', 'e', 'R', '\t', 'a', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o',
-'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'J',
-'\004', '\010', '\004', '\020', '\005', '\032', '{', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i',
-'d', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '@', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T',
-'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\005', 'v', 'a', 'l', 'u',
-'e', ':', '\002', '8', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'B',
-'\r', '\n', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'J', '\004', '\010', '\n', '\020', '\013', 'J', '\004', '\010', '\013', '\020',
-'\014', 'R', '\007', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\376', '\001', '\n', '\005', 'A', 'd', 'm', 'i', 'n', '\022', '&', '\n', '\017', 'a',
-'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\r', 'a', 'c', 'c',
-'e', 's', 's', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', '!', '\n', '\014', 'p', 'r', 'o', 'f', 'i', 'l', 'e', '_', 'p', 'a', 't',
-'h', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 'p', 'r', 'o', 'f', 'i', 'l', 'e', 'P', 'a', 't', 'h', '\022', '7', '\n', '\007', 'a',
-'d', 'd', 'r', 'e', 's', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e',
-'s', 's', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\003', '(',
+'.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+'s', 'R', '\017', 's', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'b', '\n', '\021', 'd', 'y', 'n',
+'a', 'm', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B',
+'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's',
+'R', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'R', '\n', '\017', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g',
+'e', 'r', '\022', 'D', '\n', '\n', 'h', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\016', ' ', '\001', '(', '\013', '2', '%', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C',
+'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'h', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n',
+'\n', 'f', 'l', 'a', 'g', 's', '_', 'p', 'a', 't', 'h', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\t', 'f', 'l', 'a', 'g', 's', 'P',
+'a', 't', 'h', '\022', 'C', '\n', '\013', 's', 't', 'a', 't', 's', '_', 's', 'i', 'n', 'k', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+'\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3',
+'.', 'S', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 'R', '\n', 's', 't', 'a', 't', 's', 'S', 'i', 'n', 'k', 's', '\022', 'G', '\n',
+'\014', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', '.', 'S', 't', 'a', 't',
+'s', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 's', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'q', '\n', '\024', 's',
+'t', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\007', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'B', '$', '\372', 'B', '\016', '\252', '\001', '\013', '\032', '\003', '\010', '\254', '\002', '2', '\004', '\020', '\300', '\204', '=', '\362', '\230', '\376', '\217',
+'\005', '\r', '\022', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'R', '\022', 's', 't', 'a', 't', 's', 'F', 'l', 'u',
+'s', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', ':', '\n', '\024', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h',
+'_', 'o', 'n', '_', 'a', 'd', 'm', 'i', 'n', '\030', '\035', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H',
+'\000', 'R', '\021', 's', 't', 'a', 't', 's', 'F', 'l', 'u', 's', 'h', 'O', 'n', 'A', 'd', 'm', 'i', 'n', '\022', 'L', '\n', '\010', 'w',
+'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g',
+'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\010', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'B',
+'\n', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\030', '\033', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c',
+'h', 'd', 'o', 'g', 's', 'R', '\t', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'E', '\n', '\007', 't', 'r', 'a', 'c', 'i',
+'n', 'g', '\030', '\t', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't',
+'r', 'a', 'c', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003',
+'3', '.', '0', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 'R', '\n', '\017', 'l', 'a', 'y', 'e', 'r', 'e', 'd', '_', 'r',
+'u', 'n', 't', 'i', 'm', 'e', '\030', '\021', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u',
+'n', 't', 'i', 'm', 'e', 'R', '\016', 'l', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '6', '\n', '\005',
+'a', 'd', 'm', 'i', 'n', '\030', '\014', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'A', 'd', 'm', 'i', 'n', 'R', '\005', 'a', 'd', 'm',
+'i', 'n', '\022', 'd', '\n', '\020', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '\030', '\017', ' ',
+'\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o',
+'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\016', '\212', '\223',
+'\267', '*', '\002', '\010', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\017', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n',
+'a', 'g', 'e', 'r', '\022', '6', '\n', '\027', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'd', 'i', 's', 'p', 'a', 't', 'c', 'h', 'e', 'r',
+'_', 's', 't', 'a', 't', 's', '\030', '\020', ' ', '\001', '(', '\010', 'R', '\025', 'e', 'n', 'a', 'b', 'l', 'e', 'D', 'i', 's', 'p', 'a',
+'t', 'c', 'h', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '#', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'p', 'r', 'e', 'f',
+'i', 'x', '\030', '\022', ' ', '\001', '(', '\t', 'R', '\014', 'h', 'e', 'a', 'd', 'e', 'r', 'P', 'r', 'e', 'f', 'i', 'x', '\022', '_', '\n',
+'\035', 's', 't', 'a', 't', 's', '_', 's', 'e', 'r', 'v', 'e', 'r', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'o', 'v', 'e',
+'r', 'r', 'i', 'd', 'e', '\030', '\023', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 's', 't', 'a', 't', 's', 'S', 'e',
+'r', 'v', 'e', 'r', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'A', '\n', '\027', 'u', 's',
+'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '\024', ' ', '\001',
+'(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o',
+'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', ']', '\n', '\025', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'u',
+'t', 'i', 'o', 'n', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\036', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u',
+'t', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'd', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\031', 't', 'y', 'p', 'e', 'd', '_', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l',
+'v', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\037', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\026', 't', 'y', 'p', 'e', 'd', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l',
+'v', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ']', '\n', '\024', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '_', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\025', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'E', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', 's', '\022', 'K', '\n', '\r', 'f', 'a', 't', 'a', 'l', '_', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\034', ' ', '\003',
+'(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r',
+'a', 'p', '.', 'v', '3', '.', 'F', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\014', 'f', 'a', 't', 'a', 'l', 'A',
+'c', 't', 'i', 'o', 'n', 's', '\022', 'I', '\n', '\016', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', 's', '\030',
+'\026', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\r', 'c', 'o', 'n', 'f', 'i', 'g', 'S',
+'o', 'u', 'r', 'c', 'e', 's', '\022', 'V', '\n', '\025', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_',
+'s', 'o', 'u', 'r', 'c', 'e', '\030', '\027', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\023',
+'d', 'e', 'f', 'a', 'u', 'l', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\030', 'd', 'e',
+'f', 'a', 'u', 'l', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', '\030', '\030', ' ',
+'\001', '(', '\t', 'R', '\026', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'o', 'c', 'k', 'e', 't', 'I', 'n', 't', 'e', 'r', 'f', 'a',
+'c', 'e', '\022', '\214', '\001', '\n', '\036', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd',
+'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', 'F', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'B', 'o', 'o',
+'t', 's', 't', 'r', 'a', 'p', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e',
+'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', 'R', '\034', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', '\022', 'T', '\n', '\016', 'i',
+'n', 'l', 'i', 'n', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', ' ', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'u',
+'s', 't', 'o', 'm', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'R', '\r', 'i', 'n', 'l', 'i', 'n', 'e', 'H',
+'e', 'a', 'd', 'e', 'r', 's', '\032', '\232', '\002', '\n', '\017', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+'s', '\022', '@', '\n', '\t', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', 'R', '\t', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 's', '\022', '<', '\n', '\010', 'c', 'l', 'u', 's',
+'t', 'e', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\010', 'c', 'l', 'u', 's',
+'t', 'e', 'r', 's', '\022', 'K', '\n', '\007', 's', 'e', 'c', 'r', 'e', 't', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '1', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
+'_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'e', 'c', 'r', 'e', 't', 'R', '\007', 's',
+'e', 'c', 'r', 'e', 't', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
+'.', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\032', '\211', '\003', '\n', '\020', 'D', 'y', 'n', 'a',
+'m', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '\022', 'A', '\n', '\n', 'l', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i',
+'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'd', 's', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', '2', '\n', '\025', 'l', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c',
+'a', 't', 'o', 'r', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\023', 'l', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L',
+'o', 'c', 'a', 't', 'o', 'r', '\022', 'A', '\n', '\n', 'c', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(',
'\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o',
-'n', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'A', 'd', 'm', 'i', 'n', '\"', '\313', '\004', '\n', '\016', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', ',', '\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'c', 'l', 'u', 's',
-'t', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\020', 'l', 'o', 'c', 'a', 'l', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'g', '\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't',
-'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l',
-'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_',
-'b', 'i', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i',
-'g', 'R', '\022', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Q', '\n', '\021',
-'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '%',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i',
-'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\017', 'l', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'C', 'o',
-'n', 'f', 'i', 'g', '\032', '\311', '\001', '\n', '\020', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n',
-'\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R',
-'\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't', '_', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n',
-'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', ':', '@', '\232', '\305', '\210', '\036', ';', '\n',
-'9', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
-'2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D',
-'e', 't', 'e', 'c', 't', 'i', 'o', 'n', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
-'M', 'a', 'n', 'a', 'g', 'e', 'r', '\"', '\260', '\001', '\n', '\t', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'U', '\n', '\024',
-'m', 'a', 'i', 'n', '_', 't', 'h', 'r', 'e', 'a', 'd', '_', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\001', ' ', '\001', '(',
-'\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
-'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\022', 'm', 'a', 'i', 'n', 'T', 'h', 'r', 'e', 'a', 'd',
-'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n', '\017', 'w', 'o', 'r', 'k', 'e', 'r', '_', 'w', 'a', 't', 'c', 'h', 'd',
-'o', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b',
-'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\016', 'w', 'o', 'r',
-'k', 'e', 'r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\"', '\272', '\006', '\n', '\010', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022',
-'L', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h',
-'d', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o',
-'n', 's', '\022', '<', '\n', '\014', 'm', 'i', 's', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'R', '\013', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'D', '\n', '\020', 'm', 'e', 'g', 'a', 'm', 'i', 's',
-'s', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'm', 'e', 'g', 'a', 'm', 'i',
-'s', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't',
-'\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'k', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Z', '\n', '\027',
-'m', 'a', 'x', '_', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\006',
+'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'c', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '2',
+'\n', '\025', 'c', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\006',
+' ', '\001', '(', '\t', 'R', '\023', 'c', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o', 'r',
+'\022', 'D', '\n', '\n', 'a', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n',
+'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'a', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', ';', '\232', '\305', '\210',
+'\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a',
+'p', '.', 'v', '2', '.', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'R', 'e', 's',
+'o', 'u', 'r', 'c', 'e', 's', 'J', '\004', '\010', '\004', '\020', '\005', '\032', '{', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
+'t', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 's', 'E', 'n', 't', 'r', 'y', '\022',
+'\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '@', '\n', '\005', 'v', 'a', 'l', 'u',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i',
+'g', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'B', 'o', 'o',
+'t', 's', 't', 'r', 'a', 'p', 'B', '\r', '\n', '\013', 's', 't', 'a', 't', 's', '_', 'f', 'l', 'u', 's', 'h', 'J', '\004', '\010', '\n',
+'\020', '\013', 'J', '\004', '\010', '\013', '\020', '\014', 'R', '\007', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\320', '\002', '\n', '\005', 'A', 'd', 'm',
+'i', 'n', '\022', 'C', '\n', '\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\005', ' ', '\003', '(', '\013', '2', '$', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3',
+'.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', '3', '\n', '\017',
+'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001',
+'\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\r', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'P', 'a', 't', 'h', '\022',
+'!', '\n', '\014', 'p', 'r', 'o', 'f', 'i', 'l', 'e', '_', 'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 'p', 'r',
+'o', 'f', 'i', 'l', 'e', 'P', 'a', 't', 'h', '\022', '7', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e',
+'t', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o',
+'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2',
+'.', 'A', 'd', 'm', 'i', 'n', '\"', '\313', '\004', '\n', '\016', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r',
+'\022', ',', '\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'R', '\020', 'l', 'o', 'c', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'g', '\n', '\021',
+'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', ':',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
+'3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D',
+'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o',
+'n', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
+'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Q', '\n', '\021', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'p', 'i', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c',
+'e', 'R', '\017', 'l', 'o', 'a', 'd', 'S', 't', 'a', 't', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\311', '\001', '\n', '\020', 'O', 'u',
+'t', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022', '$', '\n', '\016', 'e', 'v', 'e', 'n', 't', '_', 'l',
+'o', 'g', '_', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'L', 'o', 'g', 'P', 'a',
+'t', 'h', '\022', 'M', '\n', '\r', 'e', 'v', 'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E',
+'v', 'e', 'n', 't', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\014', 'e', 'v', 'e', 'n', 't', 'S',
+'e', 'r', 'v', 'i', 'c', 'e', ':', '@', '\232', '\305', '\210', '\036', ';', '\n', '9', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a',
+'n', 'a', 'g', 'e', 'r', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', ':', '/', '\232',
+'\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
+'r', 'a', 'p', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\"', '\260', '\001', '\n',
+'\t', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 's', '\022', 'U', '\n', '\024', 'm', 'a', 'i', 'n', '_', 't', 'h', 'r', 'e', 'a', 'd',
+'_', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd',
+'o', 'g', 'R', '\022', 'm', 'a', 'i', 'n', 'T', 'h', 'r', 'e', 'a', 'd', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n',
+'\017', 'w', 'o', 'r', 'k', 'e', 'r', '_', 'w', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3',
+'.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'R', '\016', 'w', 'o', 'r', 'k', 'e', 'r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g',
+'\"', '\272', '\006', '\n', '\010', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\022', 'L', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030',
+'\007', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't',
+'s', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o',
+'g', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'm', 'i', 's', 's', '_',
+'t', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e',
+'o', 'u', 't', '\022', 'D', '\n', '\020', 'm', 'e', 'g', 'a', 'm', 'i', 's', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'm', 'e', 'g', 'a', 'm', 'i', 's', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<',
+'\n', '\014', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'k',
+'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Z', '\n', '\027', 'm', 'a', 'x', '_', 'k', 'i', 'l', 'l', '_', 't', 'i',
+'m', 'e', 'o', 'u', 't', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\252', '\001', '\002', '2', '\000', 'R', '\024', 'm', 'a', 'x', 'K', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'J', 'i', 't', 't',
+'e', 'r', '\022', 'F', '\n', '\021', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004',
' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000', 'R', '\024', 'm', 'a', 'x', 'K', 'i', 'l', 'l',
-'T', 'i', 'm', 'e', 'o', 'u', 't', 'J', 'i', 't', 't', 'e', 'r', '\022', 'F', '\n', '\021', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l',
-'l', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\020', 'm', 'u', 'l', 't', 'i', 'k',
-'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'G', '\n', '\023', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't',
-'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\022', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T',
-'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\032', '\205', '\002', '\n', '\016', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i',
-'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '`', '\n', '\005', 'e',
-'v', 'e', 'n', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a',
-'t', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n',
-'t', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\005', 'e', 'v', 'e', 'n', 't', '\"', 'M', '\n', '\r', 'W', 'a', 't',
-'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\010',
-'\n', '\004', 'K', 'I', 'L', 'L', '\020', '\001', '\022', '\r', '\n', '\t', 'M', 'U', 'L', 'T', 'I', 'K', 'I', 'L', 'L', '\020', '\002', '\022', '\014',
-'\n', '\010', 'M', 'E', 'G', 'A', 'M', 'I', 'S', 'S', '\020', '\003', '\022', '\010', '\n', '\004', 'M', 'I', 'S', 'S', '\020', '\004', ':', ')', '\232',
-'\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
-'r', 'a', 'p', '.', 'v', '2', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '\"', 'Q', '\n', '\013', 'F', 'a', 't', 'a', 'l', 'A',
-'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd',
-'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\334',
-'\001', '\n', '\007', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '!', '\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o',
-'t', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm', 'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's',
-'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r',
-'e', 'c', 't', 'o', 'r', 'y', '\022', '3', '\n', '\025', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'u', 'b', 'd', 'i', 'r',
-'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\024', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 'u', 'b',
-'d', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '+', '\n', '\004', 'b', 'a', 's', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\027',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\004',
-'b', 'a', 's', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\333', '\006', '\n',
-'\014', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
-'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '<', '\n', '\014', 's', 't', 'a', 't',
-'i', 'c', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'H', '\000', 'R', '\013', 's', 't', 'a', 't', 'i', 'c', 'L',
-'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'd', 'i', 's', 'k', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2',
-'1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.',
-'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r',
-'H', '\000', 'R', '\t', 'd', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', 'U', '\n', '\013', 'a', 'd', 'm', 'i', 'n', '_', 'l', 'a',
-'y', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\020', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022',
+'G', '\n', '\023', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\005', ' ',
+'\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e',
+'n', 't', 'R', '\022', 'm', 'u', 'l', 't', 'i', 'k', 'i', 'l', 'l', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\032', '\205', '\002',
+'\n', '\016', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o', 'n', 'f', 'i',
+'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i',
+'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '`', '\n', '\005', 'e', 'v', 'e', 'n', 't', '\030', '\002', ' ', '\001', '(', '\016', '2',
+'@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.',
+'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'A', 'c', 't', 'i', 'o',
+'n', '.', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001',
+'R', '\005', 'e', 'v', 'e', 'n', 't', '\"', 'M', '\n', '\r', 'W', 'a', 't', 'c', 'h', 'd', 'o', 'g', 'E', 'v', 'e', 'n', 't', '\022',
+'\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\010', '\n', '\004', 'K', 'I', 'L', 'L', '\020', '\001', '\022', '\r', '\n',
+'\t', 'M', 'U', 'L', 'T', 'I', 'K', 'I', 'L', 'L', '\020', '\002', '\022', '\014', '\n', '\010', 'M', 'E', 'G', 'A', 'M', 'I', 'S', 'S', '\020',
+'\003', '\022', '\010', '\n', '\004', 'M', 'I', 'S', 'S', '\020', '\004', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'W', 'a', 't', 'c',
+'h', 'd', 'o', 'g', '\"', 'Q', '\n', '\013', 'F', 'a', 't', 'a', 'l', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\006', 'c', 'o',
+'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o',
+'n', 'f', 'i', 'g', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\334', '\001', '\n', '\007', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022',
+'!', '\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y',
+'m', 'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y',
+'\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '3', '\n', '\025', 'o',
+'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(',
+'\t', 'R', '\024', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '+',
+'\n', '\004', 'b', 'a', 's', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\004', 'b', 'a', 's', 'e', ':', '(', '\232', '\305', '\210', '\036', '#',
+'\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.',
+'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\"', '\333', '\006', '\n', '\014', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y',
+'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
+'R', '\004', 'n', 'a', 'm', 'e', '\022', '<', '\n', '\014', 's', 't', 'a', 't', 'i', 'c', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r',
+'u', 'c', 't', 'H', '\000', 'R', '\013', 's', 't', 'a', 't', 'i', 'c', 'L', 'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'd', 'i', 's',
+'k', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L',
+'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t', 'd', 'i', 's', 'k', 'L', 'a', 'y',
+'e', 'r', '\022', 'U', '\n', '\013', 'a', 'd', 'm', 'i', 'n', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '2',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
+'3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r',
+'H', '\000', 'R', '\n', 'a', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', '\022', 'R', '\n', '\n', 'r', 't', 'd', 's', '_', 'l', 'a',
+'y', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r',
-'.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\n', 'a', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r',
-'\022', 'R', '\n', '\n', 'r', 't', 'd', 's', '_', 'l', 'a', 'y', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t',
-'r', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\032', '\301', '\001', '\n', '\t', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', '!',
-'\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r', 'o', 'o', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm',
-'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030',
-'\003', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '4', '\n', '\026', 'a', 'p',
-'p', 'e', 'n', 'd', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(',
-'\010', 'R', '\024', 'a', 'p', 'p', 'e', 'n', 'd', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '7',
-'\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's',
-'t', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k',
-'L', 'a', 'y', 'e', 'r', '\032', 'F', '\n', '\n', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', ':', '8', '\232', '\305', '\210', '\036',
-'3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
-'.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y',
-'e', 'r', '\032', '\235', '\001', '\n', '\t', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'C', '\n', '\013', 'r', 't', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'r', 't', 'd', 's', 'C',
-'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y',
-'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o',
+'.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', 'H', '\000', 'R', '\t', 'r', 't', 'd', 's', 'L', 'a', 'y', 'e', 'r', '\032', '\301',
+'\001', '\n', '\t', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\022', '!', '\n', '\014', 's', 'y', 'm', 'l', 'i', 'n', 'k', '_', 'r',
+'o', 'o', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\013', 's', 'y', 'm', 'l', 'i', 'n', 'k', 'R', 'o', 'o', 't', '\022', '\"', '\n',
+'\014', 's', 'u', 'b', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 'd',
+'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '4', '\n', '\026', 'a', 'p', 'p', 'e', 'n', 'd', '_', 's', 'e', 'r', 'v', 'i', 'c',
+'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\024', 'a', 'p', 'p', 'e', 'n', 'd', 'S', 'e',
+'r', 'v', 'i', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o',
'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'B', '\026', '\n', '\017', 'l', 'a', 'y', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f',
-'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\202', '\001', '\n', '\016', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i',
-'m', 'e', '\022', '?', '\n', '\006', 'l', 'a', 'y', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'R', '\006', 'l', 'a', 'y', 'e', 'r', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n',
-'(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v',
-'2', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n',
-'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o',
-'t', 's', 't', 'r', 'a', 'p', '.', 'v', '3', 'B', '\016', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'P', 'r', 'o', 't', 'o',
-'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'t', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'D', 'i', 's', 'k', 'L', 'a', 'y', 'e', 'r', '\032', 'F', '\n', '\n', 'A', 'd',
+'m', 'i', 'n', 'L', 'a', 'y', 'e', 'r', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e',
+'L', 'a', 'y', 'e', 'r', '.', 'A', 'd', 'm', 'i', 'n', 'L', 'a', 'y', 'e', 'r', '\032', '\235', '\001', '\n', '\t', 'R', 't', 'd', 's',
+'L', 'a', 'y', 'e', 'r', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e',
+'\022', 'C', '\n', '\013', 'r', 't', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i',
+'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'r', 't', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036',
+'2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p',
+'.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', '.', 'R', 't', 'd', 's', 'L', 'a', 'y', 'e',
+'r', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o',
+'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'B', '\026',
+'\n', '\017', 'l', 'a', 'y', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\202', '\001',
+'\n', '\016', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '?', '\n', '\006', 'l', 'a', 'y', 'e', 'r',
+'s', '\030', '\001', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o',
+'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'L', 'a', 'y', 'e', 'r', 'R', '\006',
+'l', 'a', 'y', 'e', 'r', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '2', '.', 'L', 'a', 'y', 'e', 'r', 'e', 'd', 'R', 'u',
+'n', 't', 'i', 'm', 'e', '\"', '\261', '\002', '\n', '\022', 'C', 'u', 's', 't', 'o', 'm', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a',
+'d', 'e', 'r', '\022', ';', '\n', '\022', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\020', 'i', 'n',
+'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'v', '\n', '\022', 'i', 'n', 'l', 'i', 'n', 'e', '_',
+'h', 'e', 'a', 'd', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', '.', 'v', '3', '.', 'C', 'u', 's', 't',
+'o', 'm', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '.', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd',
+'e', 'r', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\020', 'i', 'n', 'l', 'i', 'n', 'e', 'H',
+'e', 'a', 'd', 'e', 'r', 'T', 'y', 'p', 'e', '\"', 'f', '\n', '\020', 'I', 'n', 'l', 'i', 'n', 'e', 'H', 'e', 'a', 'd', 'e', 'r',
+'T', 'y', 'p', 'e', '\022', '\022', '\n', '\016', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\000', '\022',
+'\023', '\n', '\017', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '_', 'T', 'R', 'A', 'I', 'L', 'E', 'R', '\020', '\001', '\022', '\023', '\n', '\017', 'R',
+'E', 'S', 'P', 'O', 'N', 'S', 'E', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\002', '\022', '\024', '\n', '\020', 'R', 'E', 'S', 'P', 'O',
+'N', 'S', 'E', '_', 'T', 'R', 'A', 'I', 'L', 'E', 'R', '\020', '\003', 'B', 'C', '\n', '\'', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'b', 'o', 'o', 't', 's', 't',
+'r', 'a', 'p', '.', 'v', '3', 'B', '\016', 'B', 'o', 'o', 't', 's', 't', 'r', 'a', 'p', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
+'\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[22] = {
+static upb_def_init *deps[25] = {
+ &envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_cluster_v3_cluster_proto_upbdefinit,
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_config_core_v3_event_service_config_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_core_v3_resolver_proto_upbdefinit,
&envoy_config_core_v3_socket_option_proto_upbdefinit,
&envoy_config_listener_v3_listener_proto_upbdefinit,
&envoy_config_metrics_v3_stats_proto_upbdefinit,
@@ -367,6 +368,7 @@ static upb_def_init *deps[22] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -377,7 +379,7 @@ static upb_def_init *deps[22] = {
upb_def_init envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_bootstrap_v3_bootstrap_proto_upb_file_layout,
"envoy/config/bootstrap/v3/bootstrap.proto",
- UPB_STRVIEW_INIT(descriptor, 6993)
+ UPB_STRVIEW_INIT(descriptor, 7815)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
index 666cbed19e3..5f9ac87f7ef 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/bootstrap/v3/bootstrap.upbdefs.h
@@ -106,6 +106,11 @@ UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_LayeredRuntime_getmsgdef(
return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.LayeredRuntime");
}
+UPB_INLINE const upb_msgdef *envoy_config_bootstrap_v3_CustomInlineHeader_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_bootstrap_v3_bootstrap_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.bootstrap.v3.CustomInlineHeader");
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
index baca9f3e43d..3ef0ebaddb9 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/circuit_breaker.upbdefs.h"
+#include "envoy/config/cluster/v3/circuit_breaker.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
@@ -15,16 +16,6 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_config_cluster_v3_CircuitBreakers_msginit,
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit,
- &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit,
-};
-
static const char descriptor[1364] = {'\n', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '\037', 'e',
@@ -94,7 +85,7 @@ static upb_def_init *deps[7] = {
upb_def_init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_circuit_breaker_proto_upb_file_layout,
"envoy/config/cluster/v3/circuit_breaker.proto",
UPB_STRVIEW_INIT(descriptor, 1364)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
index 18db991b6ba..62a8dcae186 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/cluster.upbdefs.h"
+#include "envoy/config/cluster/v3/cluster.upb.h"
extern upb_def_init envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit;
extern upb_def_init envoy_config_cluster_v3_filter_proto_upbdefinit;
@@ -18,6 +19,7 @@ extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_resolver_proto_upbdefinit;
extern upb_def_init envoy_config_endpoint_v3_endpoint_proto_upbdefinit;
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
@@ -25,61 +27,13 @@ extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_struct_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init xds_core_v3_collection_entry_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
+extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
extern upb_def_init udpa_annotations_security_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_ClusterCollection_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CustomClusterType_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_RefreshRate_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_UpstreamBindConfig_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_UpstreamConnectionOptions_msginit;
-extern const upb_msglayout envoy_config_cluster_v3_TrackClusterStats_msginit;
-
-static const upb_msglayout *layouts[23] = {
- &envoy_config_cluster_v3_ClusterCollection_msginit,
- &envoy_config_cluster_v3_Cluster_msginit,
- &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit,
- &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit,
- &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit,
- &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit,
- &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit,
- &envoy_config_cluster_v3_Cluster_RefreshRate_msginit,
- &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit,
- &envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_msginit,
- &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit,
- &envoy_config_cluster_v3_UpstreamBindConfig_msginit,
- &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit,
- &envoy_config_cluster_v3_TrackClusterStats_msginit,
-};
-
-static const char descriptor[10750] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
+static const char descriptor[11811] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '-', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3', '/', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r',
@@ -96,422 +50,465 @@ static const char descriptor[10750] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/',
'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't',
'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o',
-'\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
-'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't',
-'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g',
-'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p',
-'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r',
-'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r',
-'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u',
-'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
-'o', '\"', 'K', '\n', '\021', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', '6', '\n',
-'\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'R', '\007', 'e', 'n', 't', 'r',
-'i', 'e', 's', '\"', '\246', 'G', '\n', '\007', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'o', '\n', '\030', 't', 'r', 'a', 'n', 's', 'p',
-'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 's', '\030', '+', ' ', '\003', '(', '\013', '2',
-'5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
-'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M',
-'a', 't', 'c', 'h', 'R', '\026', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c',
-'h', 'e', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\"', '\n', '\r', 'a', 'l', 't', '_', 's', 't', 'a', 't', '_', 'n', 'a', 'm', 'e', '\030',
-'\034', ' ', '\001', '(', '\t', 'R', '\013', 'a', 'l', 't', 'S', 't', 'a', 't', 'N', 'a', 'm', 'e', '\022', 'N', '\n', '\004', 't', 'y', 'p',
-'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r',
-'y', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\004', 't', 'y', 'p', 'e', '\022', 'W',
-'\n', '\014', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '&', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u',
-'s', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', 'H', '\000', 'R',
-'\013', 'c', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\022', '_', '\n', '\022', 'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't',
-'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'e', 'd', 's', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\017', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e',
-'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\016', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'o', '\n', '!', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030',
-'\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\035', 'p', 'e', 'r', 'C',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's',
-'\022', 'R', '\n', '\t', 'l', 'b', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\006', ' ', '\001', '(', '\016', '2', ')', '.', 'e', 'n', 'v',
+'\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v', '3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n',
+'t', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
+'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
+'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
+'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'K', '\n', '\021', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\254', 'N', '\n', '\007', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'o', '\n', '\030',
+'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 's', '\030',
+'+', ' ', '\003', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S',
+'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', 'R', '\026', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
+'e', 't', 'M', 'a', 't', 'c', 'h', 'e', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
+'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '>', '\n', '\r', 'a', 'l', 't', '_', 's', 't', 'a', 't',
+'_', 'n', 'a', 'm', 'e', '\030', '\034', ' ', '\001', '(', '\t', 'B', '\032', '\362', '\230', '\376', '\217', '\005', '\024', '\n', '\022', 'o', 'b', 's', 'e',
+'r', 'v', 'a', 'b', 'i', 'l', 'i', 't', 'y', '_', 'n', 'a', 'm', 'e', 'R', '\013', 'a', 'l', 't', 'S', 't', 'a', 't', 'N', 'a',
+'m', 'e', '\022', 'N', '\n', '\004', 't', 'y', 'p', 'e', '\030', '\002', ' ', '\001', '(', '\016', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'H',
+'\000', 'R', '\004', 't', 'y', 'p', 'e', '\022', 'W', '\n', '\014', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 't', 'y', 'p', 'e', '\030', '&',
+' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
+'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'T', 'y', 'p', 'e', 'H', '\000', 'R', '\013', 'c', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\022', '_', '\n', '\022',
+'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\020', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\017', 'c', 'o', 'n',
+'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\252', '\001', '\002', '*', '\000', 'R', '\016', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'o', '\n', '!',
+'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm',
+'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*',
+'\002', '\020', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L',
+'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', 'P', '\n', '\t', 'l', 'b', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\006', ' ',
+'\001', '(', '\016', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e',
+'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B',
+'\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 'l', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', '\017', 'l', 'o', 'a', 'd', '_',
+'a', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', '\030', '!', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
+'r', 'L', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'R', '\016', 'l', 'o', 'a', 'd', 'A', 's', 's', 'i',
+'g', 'n', 'm', 'e', 'n', 't', '\022', 'F', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 's', '\030', '\010',
+' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
+'c', 'k', 's', '\022', 'h', '\n', '\033', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '_', 'p', 'e', 'r', '_', 'c',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222',
+'\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\030', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', 'P', 'e', 'r', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'S', '\n', '\020', 'c', 'i', 'r', 'c', 'u', 'i', 't', '_', 'b', 'r', 'e', 'a',
+'k', 'e', 'r', 's', '\030', '\n', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e',
+'r', 's', 'R', '\017', 'c', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\022', '\203', '\001', '\n', '\036', 'u',
+'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't',
+'i', 'o', 'n', 's', '\030', '.', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R',
+'\033', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i',
+'o', 'n', 's', '\022', 'w', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c',
+'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\035', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\031', 'c',
+'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'k', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030',
+'\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B',
+'\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 't', '\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o',
+'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\022', '\030', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004',
+'\003', '3', '.', '0', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '\214', '\001', '\n', ' ', 't', 'y', 'p', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '$', ' ', '\003', '(', '\013', '2', 'C', '.', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\n', '\372', 'B', '\007', '\202', '\001', '\004', '\020', '\001', ' ', '\007', 'R',
-'\010', 'l', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', '\017', 'l', 'o', 'a', 'd', '_', 'a', 's', 's', 'i', 'g', 'n', 'm',
-'e', 'n', 't', '\030', '!', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o', 'a', 'd', 'A', 's',
-'s', 'i', 'g', 'n', 'm', 'e', 'n', 't', 'R', '\016', 'l', 'o', 'a', 'd', 'A', 's', 's', 'i', 'g', 'n', 'm', 'e', 'n', 't', '\022',
-'F', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', '!', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l',
-'t', 'h', 'C', 'h', 'e', 'c', 'k', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 's', '\022', '[', '\n', '\033',
-'m', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '_', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\030', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't',
-'s', 'P', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'S', '\n', '\020', 'c', 'i', 'r', 'c', 'u', 'i', 't',
-'_', 'b', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\030', '\n', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'i', 'r', 'c', 'u', 'i', 't', 'B',
-'r', 'e', 'a', 'k', 'e', 'r', 's', 'R', '\017', 'c', 'i', 'r', 'c', 'u', 'i', 't', 'B', 'r', 'e', 'a', 'k', 'e', 'r', 's', '\022',
-'z', '\n', '\036', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '.', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\033', 'u', 'p', 's', 't',
-'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'n',
-'\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p',
-'t', 'i', 'o', 'n', 's', '\030', '\035', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
-'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\031', 'c', 'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'b', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c',
-'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\002', '\030', '\001', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'k', '\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o',
-'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't',
-'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\t', '\030', '\001', '\212', '\223', '\267', '*', '\002', '\020', '\001', 'R', '\024', 'h',
-'t', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\214', '\001', '\n', ' ', 't',
-'y', 'p', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o',
-'p', 't', 'i', 'o', 'n', 's', '\030', '$', ' ', '\003', '(', '\013', '2', 'C', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'y', 'p',
-'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', 'E', 'n', 't', 'r', 'y', 'R', '\035', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'Q', '\n', '\020', 'd', 'n', 's', '_', 'r', 'e', 'f', 'r', 'e',
-'s', 'h', '_', 'r', 'a', 't', 'e', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006', '*', '\004',
-'\020', '\300', '\204', '=', 'R', '\016', 'd', 'n', 's', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', 'e', '\n', '\030', 'd',
-'n', 's', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'r', 'a', 't', 'e', '\030', ',',
-' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't',
-'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e',
-'R', '\025', 'd', 'n', 's', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', '&',
-'\n', '\017', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'd', 'n', 's', '_', 't', 't', 'l', '\030', '\'', ' ', '\001', '(', '\010', 'R', '\r',
-'r', 'e', 's', 'p', 'e', 'c', 't', 'D', 'n', 's', 'T', 't', 'l', '\022', 'f', '\n', '\021', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k',
-'u', 'p', '_', 'f', 'a', 'm', 'i', 'l', 'y', '\030', '\021', ' ', '\001', '(', '\016', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001',
-'R', '\017', 'd', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022', 'B', '\n', '\r', 'd', 'n', 's', '_',
-'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\022', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\014', 'd', 'n',
-'s', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\022', '4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r',
-'_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '-', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c',
-'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', 'V', '\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r',
-'_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\023', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r',
-'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i',
-'o', 'n', '\022', 'N', '\n', '\020', 'c', 'l', 'e', 'a', 'n', 'u', 'p', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\024', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\017', 'c', 'l', 'e', 'a', 'n', 'u', 'p', 'I',
-'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\025', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p',
-'s', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020', 'l', 'b', '_', 's', 'u',
-'b', 's', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\026', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'l', 'b', 'S', 'u', 'b', 's', 'e',
-'t', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'b', '\n', '\023', 'r', 'i', 'n', 'g', '_', 'h', 'a', 's', 'h', '_', 'l', 'b', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g',
-'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\020', 'r', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '[', '\n', '\020', 'm', 'a', 'g', 'l', 'e', 'v', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '\030', '4', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'M', 'a', 'g', 'l', 'e', 'v', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\016', 'm', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g',
-'\022', 'k', '\n', '\026', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\"', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l',
-'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\023', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's',
-'t', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'l', 'e', 'a', 's', 't', '_', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '%', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R',
-'\024', 'l', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020',
-'c', 'o', 'm', 'm', 'o', 'n', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\033', ' ', '\001', '(', '\013', '2', '/', '.',
+'t', 'e', 'r', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', 'R', '\035', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'Q', '\n', '\020', 'd', 'n',
+'s', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'r', 'a', 't', 'e', '\030', '\020', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372',
+'B', '\t', '\252', '\001', '\006', '*', '\004', '\020', '\300', '\204', '=', 'R', '\016', 'd', 'n', 's', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a',
+'t', 'e', '\022', 'e', '\n', '\030', 'd', 'n', 's', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '_', 'r', 'e', 'f', 'r', 'e', 's', 'h',
+'_', 'r', 'a', 't', 'e', '\030', ',', ' ', '\001', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r',
+'e', 's', 'h', 'R', 'a', 't', 'e', 'R', '\025', 'd', 'n', 's', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'R', 'e', 'f', 'r', 'e', 's',
+'h', 'R', 'a', 't', 'e', '\022', '&', '\n', '\017', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'd', 'n', 's', '_', 't', 't', 'l', '\030',
+'\'', ' ', '\001', '(', '\010', 'R', '\r', 'r', 'e', 's', 'p', 'e', 'c', 't', 'D', 'n', 's', 'T', 't', 'l', '\022', 'f', '\n', '\021', 'd',
+'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p', '_', 'f', 'a', 'm', 'i', 'l', 'y', '\030', '\021', ' ', '\001', '(', '\016', '2', '0', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
-'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'c', 'o',
-'m', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
-'_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
-'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', ':', '\n', '\010', 'm', 'e',
-'t', 'a', 'd', 'a', 't', 'a', '\030', '\031', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\022', 'l', '\n', '\022', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o',
-'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'B', '\002', '\030', '\001', 'R', '\021', 'p', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'r', '\n', '\033', 'u', 'p', 's', 't', 'r', 'e', 'a',
-'m', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\036', ' ', '\001', '(',
-'\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
-'v', '3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i',
-'o', 'n', 's', 'R', '\031', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', 'U', '\n', '(', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'s', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '\030',
-'\037', ' ', '\001', '(', '\010', 'R', '#', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n',
-'H', 'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'F', 'a', 'i', 'l', 'u', 'r', 'e', '\022', '@', '\n', '\035', 'i', 'g', 'n', 'o',
-'r', 'e', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'm', 'o', 'v', 'a', 'l',
-'\030', ' ', ' ', '\001', '(', '\010', 'R', '\031', 'i', 'g', 'n', 'o', 'r', 'e', 'H', 'e', 'a', 'l', 't', 'h', 'O', 'n', 'H', 'o', 's',
-'t', 'R', 'e', 'm', 'o', 'v', 'a', 'l', '\022', '9', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '(', ' ', '\003', '(', '\013',
-'2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
-'3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '`', '\n', '\025', 'l', 'o', 'a', 'd',
-'_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', ')', ' ', '\001', '(', '\013', '2', ',',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.',
-'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\023', 'l', 'o', 'a', 'd',
-'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'A', '\n', '\n', 'l', 'r', 's', '_', 's', 'e',
-'r', 'v', 'e', 'r', '\030', '*', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'r',
-'s', 'S', 'e', 'r', 'v', 'e', 'r', '\022', '6', '\n', '\025', 't', 'r', 'a', 'c', 'k', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_',
-'b', 'u', 'd', 'g', 'e', 't', 's', '\030', '/', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '\023', 't', 'r', 'a', 'c', 'k', 'T',
-'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', 'S', '\n', '\017', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '0', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z',
-'\n', '\023', 't', 'r', 'a', 'c', 'k', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '1', ' ', '\001',
-'(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', 'R', '\021', 't', 'r',
-'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '^', '\n', '\021', 'p', 'r', 'e', 'c', 'o', 'n',
-'n', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '2', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y',
+'l', 'u', 's', 't', 'e', 'r', '.', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', 'B', '\010', '\372',
+'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'd', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022',
+'O', '\n', '\r', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\022', ' ', '\003', '(', '\013', '2', '\035', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r',
+'e', 's', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'd', 'n', 's', 'R', 'e', 's', 'o',
+'l', 'v', 'e', 'r', 's', '\022', 'A', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_',
+'l', 'o', 'o', 'k', 'u', 'p', 's', '\030', '-', ' ', '\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.',
+'0', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 's', '\022', ']', '\n',
+'\025', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '5', ' ',
+'\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'd', 'n',
+'s', 'R', 'e', 's', 'o', 'l', 'u', 't', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\031', 't', 'y', 'p', 'e',
+'d', '_', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '7', ' ', '\001',
+'(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\026', 't', 'y',
+'p', 'e', 'd', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\025', 'w',
+'a', 'i', 't', '_', 'f', 'o', 'r', '_', 'w', 'a', 'r', 'm', '_', 'o', 'n', '_', 'i', 'n', 'i', 't', '\030', '6', ' ', '\001', '(',
+'\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V',
+'a', 'l', 'u', 'e', 'R', '\021', 'w', 'a', 'i', 't', 'F', 'o', 'r', 'W', 'a', 'r', 'm', 'O', 'n', 'I', 'n', 'i', 't', '\022', 'V',
+'\n', '\021', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\023', ' ', '\001', '(', '\013',
+'2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
+'3', '.', 'O', 'u', 't', 'l', 'i', 'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 'o', 'u', 't', 'l', 'i',
+'e', 'r', 'D', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'N', '\n', '\020', 'c', 'l', 'e', 'a', 'n', 'u', 'p', '_', 'i', 'n',
+'t', 'e', 'r', 'v', 'a', 'l', '\030', '\024', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R',
+'\017', 'c', 'l', 'e', 'a', 'n', 'u', 'p', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'R', '\n', '\024', 'u', 'p', 's', 't', 'r',
+'e', 'a', 'm', '_', 'b', 'i', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\025', ' ', '\001', '(', '\013', '2', ' ', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'i', 'n', 'd', 'C',
+'o', 'n', 'f', 'i', 'g', 'R', '\022', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'Y', '\n', '\020', 'l', 'b', '_', 's', 'u', 'b', 's', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\026', ' ', '\001', '(',
+'\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
+'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\016', 'l', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'b', '\n', '\023', 'r', 'i', 'n', 'g', '_',
+'h', 'a', 's', 'h', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '1', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\020',
+'r', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '[', '\n', '\020', 'm', 'a', 'g', 'l', 'e',
+'v', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '4', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\020', 'p', 'r', 'e', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', ')', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'p', 'o', 'o', 'l', '_', 'p', 'e', 'r', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'n',
-'e', 'c', 't', 'i', 'o', 'n', '\030', '3', ' ', '\001', '(', '\010', 'R', '%', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P',
-'o', 'o', 'l', 'P', 'e', 'r', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
-'n', '\032', '\346', '\001', '\n', '\024', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c',
-'h', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\004', 'n', 'a', 'm', 'e', '\022', '-', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'm', 'a', 't',
-'c', 'h', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\003', ' ',
+'r', '.', 'M', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\016', 'm', 'a', 'g', 'l', 'e',
+'v', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'k', '\n', '\026', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't',
+'_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\"', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\023', 'o',
+'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'l', 'e', 'a',
+'s', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '%', ' ', '\001', '(',
+'\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.',
+'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b',
+'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\024', 'l', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'h', '\n', '\025', 'r', 'o', 'u', 'n', 'd', '_', 'r', 'o', 'b', 'i', 'n', '_', 'l', 'b', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '8', ' ', '\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'o', 'u', 'n',
+'d', 'R', 'o', 'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\001', 'R', '\022', 'r', 'o', 'u', 'n', 'd', 'R', 'o',
+'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\020', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'l', 'b', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '\030', '\033', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm',
+'m', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'c', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f',
+'i', 'g', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\030', ' ',
'\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
'3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p',
-'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o',
-'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', '\032', '\230', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'T', 'y', 'p', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '-', '\232', '\305', '\210', '\036', '(', '\n',
-'&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'u', 's',
-'t', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\032', '\246', '\001', '\n', '\020', 'E', 'd', 's', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\n', 'e', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'e', 'd', 's', 'C', 'o', 'n', 'f',
-'i', 'g', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
-'\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'E', 'd', 's', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\300', '\010', '\n', '\016', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f',
-'i', 'g', '\022', 'y', '\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\001', ' ', '\001',
-'(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B',
-'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '>', '\n', '\016', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\002', ' ', '\001', '(', '\013', '2',
-'\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R',
-'\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'u', 'b', 's', 'e', 't', '\022', 'k', '\n', '\020', 's', 'u', 'b', 's', 'e', 't', '_',
-'s', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
-'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e',
-'l', 'e', 'c', 't', 'o', 'r', 'R', '\017', 's', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\022', '2',
-'\n', '\025', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', '_', 'a', 'w', 'a', 'r', 'e', '\030', '\004',
-' ', '\001', '(', '\010', 'R', '\023', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'A', 'w', 'a', 'r', 'e',
-'\022', '2', '\n', '\025', 's', 'c', 'a', 'l', 'e', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't',
-'\030', '\005', ' ', '\001', '(', '\010', 'R', '\023', 's', 'c', 'a', 'l', 'e', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g',
-'h', 't', '\022', '$', '\n', '\016', 'p', 'a', 'n', 'i', 'c', '_', 'm', 'o', 'd', 'e', '_', 'a', 'n', 'y', '\030', '\006', ' ', '\001', '(',
-'\010', 'R', '\014', 'p', 'a', 'n', 'i', 'c', 'M', 'o', 'd', 'e', 'A', 'n', 'y', '\022', '\036', '\n', '\013', 'l', 'i', 's', 't', '_', 'a',
-'s', '_', 'a', 'n', 'y', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\t', 'l', 'i', 's', 't', 'A', 's', 'A', 'n', 'y', '\032', '\332', '\003',
-'\n', '\020', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\022', '\022', '\n', '\004', 'k', 'e', 'y',
-'s', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\004', 'k', 'e', 'y', 's', '\022', '3', '\n', '\026', 's', 'i', 'n', 'g', 'l', 'e', '_', 'h',
-'o', 's', 't', '_', 'p', 'e', 'r', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\023', 's', 'i', 'n',
-'g', 'l', 'e', 'H', 'o', 's', 't', 'P', 'e', 'r', 'S', 'u', 'b', 's', 'e', 't', '\022', '\222', '\001', '\n', '\017', 'f', 'a', 'l', 'l',
-'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\016', '2', '_', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e',
-'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't',
-'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r',
-'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
-'\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '0', '\n', '\024', 'f', 'a', 'l', 'l', 'b', 'a',
-'c', 'k', '_', 'k', 'e', 'y', 's', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\022', 'f', 'a', 'l',
-'l', 'b', 'a', 'c', 'k', 'K', 'e', 'y', 's', 'S', 'u', 'b', 's', 'e', 't', '\"', 'y', '\n', '\036', 'L', 'b', 'S', 'u', 'b', 's',
-'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022',
-'\017', '\n', '\013', 'N', 'O', 'T', '_', 'D', 'E', 'F', 'I', 'N', 'E', 'D', '\020', '\000', '\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A',
-'L', 'L', 'B', 'A', 'C', 'K', '\020', '\001', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020',
-'\002', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\003', '\022', '\017', '\n', '\013',
-'K', 'E', 'Y', 'S', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\004', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v',
+'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\031', ' ', '\001',
+'(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'u', '\n', '\022', 'p', 'r',
+'o', 't', 'o', 'c', 'o', 'l', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
+'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l',
+'e', 'c', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\021', 'p', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', 'r', '\n', '\033', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
+'_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\036', ' ', '\001', '(', '\013',
+'2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
+'3', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o',
+'n', 's', 'R', '\031', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't',
+'i', 'o', 'n', 's', '\022', 'U', '\n', '(', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's',
+'_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'f', 'a', 'i', 'l', 'u', 'r', 'e', '\030', '\037',
+' ', '\001', '(', '\010', 'R', '#', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H',
+'o', 's', 't', 'H', 'e', 'a', 'l', 't', 'h', 'F', 'a', 'i', 'l', 'u', 'r', 'e', '\022', '@', '\n', '\035', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'h', 'e', 'a', 'l', 't', 'h', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'm', 'o', 'v', 'a', 'l', '\030',
+' ', ' ', '\001', '(', '\010', 'R', '\031', 'i', 'g', 'n', 'o', 'r', 'e', 'H', 'e', 'a', 'l', 't', 'h', 'O', 'n', 'H', 'o', 's', 't',
+'R', 'e', 'm', 'o', 'v', 'a', 'l', '\022', '9', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '(', ' ', '\003', '(', '\013', '2',
+'\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '`', '\n', '\025', 'l', 'o', 'a', 'd', '_',
+'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', ')', ' ', '\001', '(', '\013', '2', ',', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'L',
+'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\023', 'l', 'o', 'a', 'd', 'B',
+'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'A', '\n', '\n', 'l', 'r', 's', '_', 's', 'e', 'r',
+'v', 'e', 'r', '\030', '*', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 'l', 'r', 's',
+'S', 'e', 'r', 'v', 'e', 'r', '\022', '?', '\n', '\025', 't', 'r', 'a', 'c', 'k', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'b',
+'u', 'd', 'g', 'e', 't', 's', '\030', '/', ' ', '\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'R', '\023', 't', 'r', 'a', 'c', 'k', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', 'S', '\n', '\017',
+'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '0', ' ', '\001', '(', '\013', '2', '*', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd',
+'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z', '\n', '\023', 't', 'r', 'a', 'c', 'k', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's',
+'t', 'a', 't', 's', '\030', '1', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S',
+'t', 'a', 't', 's', 'R', '\021', 't', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '^',
+'\n', '\021', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '2', ' ', '\001', '(', '\013',
+'2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
+'3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c',
+'y', 'R', '\020', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'X', '\n', ')', 'c', 'o',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'o', 'o', 'l', '_', 'p', 'e', 'r', '_', 'd', 'o', 'w', 'n', 's', 't', 'r',
+'e', 'a', 'm', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '3', ' ', '\001', '(', '\010', 'R', '%', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'o', 'o', 'l', 'P', 'e', 'r', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\032', '\346', '\001', '\n', '\024', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o',
+'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
+'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '-', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r',
+'u', 'c', 't', 'R', '\005', 'm', 'a', 't', 'c', 'h', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
+'o', 'c', 'k', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't',
+'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', ':', '0', '\232', '\305', '\210', '\036', '+', '\n',
+')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'T', 'r', 'a',
+'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'M', 'a', 't', 'c', 'h', '\032', '\230', '\001', '\n', '\021', 'C', 'u', 's',
+'t', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p',
+'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
+':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u',
+'s', 't', 'e', 'r', '.', 'C', 'u', 's', 't', 'o', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'T', 'y', 'p', 'e', '\032', '\246', '\001',
+'\n', '\020', 'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\n', 'e', 'd', 's',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R',
+'\t', 'e', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm',
+'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', ':', ',', '\232', '\305', '\210',
+'\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.',
+'E', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\300', '\010', '\n', '\016', 'L', 'b', 'S', 'u',
+'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'y', '\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'p', 'o',
+'l', 'i', 'c', 'y', '\030', '\001', ' ', '\001', '(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b',
+'s', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c',
+'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l', 'l', 'b', 'a',
+'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '>', '\n', '\016', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'u', 'b', 's', 'e',
+'t', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'u', 'b', 's', 'e', 't', '\022', 'k', '\n',
+'\020', 's', 'u', 'b', 's', 'e', 't', '_', 's', 'e', 'l', 'e', 'c', 't', 'o', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '@',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.',
+'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b',
+'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'R', '\017', 's', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l',
+'e', 'c', 't', 'o', 'r', 's', '\022', '2', '\n', '\025', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't',
+'_', 'a', 'w', 'a', 'r', 'e', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\023', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i',
+'g', 'h', 't', 'A', 'w', 'a', 'r', 'e', '\022', '2', '\n', '\025', 's', 'c', 'a', 'l', 'e', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't',
+'y', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\023', 's', 'c', 'a', 'l', 'e', 'L', 'o', 'c', 'a',
+'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', '\022', '$', '\n', '\016', 'p', 'a', 'n', 'i', 'c', '_', 'm', 'o', 'd', 'e', '_',
+'a', 'n', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\014', 'p', 'a', 'n', 'i', 'c', 'M', 'o', 'd', 'e', 'A', 'n', 'y', '\022', '\036',
+'\n', '\013', 'l', 'i', 's', 't', '_', 'a', 's', '_', 'a', 'n', 'y', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\t', 'l', 'i', 's', 't',
+'A', 's', 'A', 'n', 'y', '\032', '\332', '\003', '\n', '\020', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o',
+'r', '\022', '\022', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\004', 'k', 'e', 'y', 's', '\022', '3', '\n', '\026',
+'s', 'i', 'n', 'g', 'l', 'e', '_', 'h', 'o', 's', 't', '_', 'p', 'e', 'r', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\004', ' ',
+'\001', '(', '\010', 'R', '\023', 's', 'i', 'n', 'g', 'l', 'e', 'H', 'o', 's', 't', 'P', 'e', 'r', 'S', 'u', 'b', 's', 'e', 't', '\022',
+'\222', '\001', '\n', '\017', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\016',
+'2', '_', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v',
+'3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.',
+'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't',
+'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372',
+'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\016', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '0',
+'\n', '\024', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', '_', 'k', 'e', 'y', 's', '_', 's', 'u', 'b', 's', 'e', 't', '\030', '\003', ' ',
+'\003', '(', '\t', 'R', '\022', 'f', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'K', 'e', 'y', 's', 'S', 'u', 'b', 's', 'e', 't', '\"', 'y',
+'\n', '\036', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', 'F', 'a', 'l', 'l', 'b', 'a', 'c',
+'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'N', 'O', 'T', '_', 'D', 'E', 'F', 'I', 'N', 'E', 'D', '\020', '\000', '\022',
+'\017', '\n', '\013', 'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A', 'C', 'K', '\020', '\001', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E',
+'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020', '\002', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S',
+'E', 'T', '\020', '\003', '\022', '\017', '\n', '\013', 'K', 'E', 'Y', 'S', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\004', ':', ';', '\232', '\305',
+'\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S',
+'e', 'l', 'e', 'c', 't', 'o', 'r', '\"', 'O', '\n', '\026', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a',
+'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A', 'C', 'K', '\020', '\000',
+'\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_', 'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020', '\001', '\022', '\022', '\n', '\016', 'D', 'E', 'F',
+'A', 'U', 'L', 'T', '_', 'S', 'U', 'B', 'S', 'E', 'T', '\020', '\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v',
'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e',
-'t', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'S', 'e', 'l', 'e', 'c', 't', 'o', 'r', '\"',
-'O', '\n', '\026', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'F', 'a', 'l', 'l', 'b', 'a', 'c', 'k', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '\017', '\n', '\013', 'N', 'O', '_', 'F', 'A', 'L', 'L', 'B', 'A', 'C', 'K', '\020', '\000', '\022', '\020', '\n', '\014', 'A', 'N', 'Y', '_',
-'E', 'N', 'D', 'P', 'O', 'I', 'N', 'T', '\020', '\001', '\022', '\022', '\n', '\016', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '_', 'S', 'U', 'B',
-'S', 'E', 'T', '\020', '\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'b', 'S', 'u', 'b', 's', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\347', '\001', '\n', '\024', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'H', '\n', '\014', 'c', 'h', 'o', 'i', 'c', 'e', '_', 'c', 'o', 'u', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
-'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\002', 'R', '\013', 'c', 'h', 'o', 'i', 'c', 'e', 'C', 'o', 'u', 'n', 't', '\022', 'S',
-'\n', '\023', 'a', 'c', 't', 'i', 'v', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'i', 'a', 's', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', 'R', '\021', 'a', 'c', 't', 'i', 'v', 'e', 'R', 'e', 'q',
-'u', 'e', 's', 't', 'B', 'i', 'a', 's', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't',
-'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\221', '\003', '\n', '\020', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', 'T', '\n', '\021', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e',
-'\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'t', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\235', '\001', '\n', '\017', 'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f',
+'i', 'g', '\022', 'E', '\n', '\021', 's', 'l', 'o', 'w', '_', 's', 't', 'a', 'r', 't', '_', 'w', 'i', 'n', 'd', 'o', 'w', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 's', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'W', 'i', 'n', 'd', 'o', 'w', '\022', 'C',
+'\n', '\n', 'a', 'g', 'g', 'r', 'e', 's', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D',
+'o', 'u', 'b', 'l', 'e', 'R', '\n', 'a', 'g', 'g', 'r', 'e', 's', 's', 'i', 'o', 'n', '\032', 'r', '\n', '\022', 'R', 'o', 'u', 'n',
+'d', 'R', 'o', 'b', 'i', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\\', '\n', '\021', 's', 'l', 'o', 'w', '_', 's', 't',
+'a', 'r', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\017', 's', 'l', 'o', 'w', 'S', 't', 'a',
+'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\305', '\002', '\n', '\024', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u', 'e', 's', 't',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014', 'c', 'h', 'o', 'i', 'c', 'e', '_', 'c', 'o', 'u', 'n', 't', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\002', 'R', '\013', 'c', 'h', 'o', 'i',
+'c', 'e', 'C', 'o', 'u', 'n', 't', '\022', 'S', '\n', '\023', 'a', 'c', 't', 'i', 'v', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't',
+'_', 'b', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', 'R', '\021',
+'a', 'c', 't', 'i', 'v', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'i', 'a', 's', '\022', '\\', '\n', '\021', 's', 'l', 'o', 'w',
+'_', 's', 't', 'a', 'r', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'S', 'l', 'o', 'w', 'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\017', 's', 'l', 'o', 'w',
+'S', 't', 'a', 'r', 't', 'C', 'o', 'n', 'f', 'i', 'g', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y',
+'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'L', 'e', 'a', 's', 't', 'R', 'e', 'q', 'u',
+'e', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\221', '\003', '\n', '\020', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L',
+'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'T', '\n', '\021', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's',
+'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\200', '\200', '\200',
+'\004', 'R', '\017', 'm', 'i', 'n', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\022', 'm', '\n', '\r', 'h', 'a', 's',
+'h', '_', 'f', 'u', 'n', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r',
+'.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'H', 'a', 's', 'h', 'F', 'u', 'n',
+'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'h', 'a', 's', 'h', 'F', 'u', 'n', 'c',
+'t', 'i', 'o', 'n', '\022', 'T', '\n', '\021', 'm', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e',
+'\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017',
-'m', 'i', 'n', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\022', 'm', '\n', '\r', 'h', 'a', 's', 'h', '_', 'f',
-'u', 'n', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i',
-'n', 'g', 'H', 'a', 's', 'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i',
-'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'h', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't', 'i', 'o',
-'n', '\022', 'T', '\n', '\021', 'm', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'r', 'i', 'n', 'g', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ',
+'m', 'a', 'x', 'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\"', '.', '\n', '\014', 'H', 'a', 's', 'h', 'F', 'u',
+'n', 'c', 't', 'i', 'o', 'n', '\022', '\013', '\n', '\007', 'X', 'X', '_', 'H', 'A', 'S', 'H', '\020', '\000', '\022', '\021', '\n', '\r', 'M', 'U',
+'R', 'M', 'U', 'R', '_', 'H', 'A', 'S', 'H', '_', '2', '\020', '\001', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's',
+'h', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\002', '\020', '\003', '\032', 'Y', '\n', '\016', 'M', 'a', 'g', 'l', 'e', 'v',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'G', '\n', '\n', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ',
'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
-'t', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\200', '\200', '\200', '\004', 'R', '\017', 'm', 'a', 'x',
-'i', 'm', 'u', 'm', 'R', 'i', 'n', 'g', 'S', 'i', 'z', 'e', '\"', '.', '\n', '\014', 'H', 'a', 's', 'h', 'F', 'u', 'n', 'c', 't',
-'i', 'o', 'n', '\022', '\013', '\n', '\007', 'X', 'X', '_', 'H', 'A', 'S', 'H', '\020', '\000', '\022', '\021', '\n', '\r', 'M', 'U', 'R', 'M', 'U',
-'R', '_', 'H', 'A', 'S', 'H', '_', '2', '\020', '\001', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'i', 'n', 'g', 'H', 'a', 's', 'h', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\002', '\020', '\003', '\032', 'M', '\n', '\016', 'M', 'a', 'g', 'l', 'e', 'v', 'L', 'b', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', ';', '\n', '\n', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4',
-'V', 'a', 'l', 'u', 'e', 'R', '\t', 't', 'a', 'b', 'l', 'e', 'S', 'i', 'z', 'e', '\032', 'n', '\n', '\023', 'O', 'r', 'i', 'g', 'i',
-'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 'u', 's', 'e', '_', 'h', 't', 't',
-'p', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\r', 'u', 's', 'e', 'H', 't', 't', 'p', 'H', 'e',
-'a', 'd', 'e', 'r', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
-'.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n',
-'f', 'i', 'g', '\032', '\374', '\n', '\n', '\016', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n',
-'\027', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'p', 'a', 'n', 'i', 'c', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r',
-'c', 'e', 'n', 't', 'R', '\025', 'h', 'e', 'a', 'l', 't', 'h', 'y', 'P', 'a', 'n', 'i', 'c', 'T', 'h', 'r', 'e', 's', 'h', 'o',
-'l', 'd', '\022', 't', '\n', '\024', 'z', 'o', 'n', 'e', '_', 'a', 'w', 'a', 'r', 'e', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\002', ' ', '\001', '(', '\013', '2', 'A', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
-'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H',
-'\000', 'R', '\021', 'z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\211', '\001', '\n', '\033',
-'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', 'H', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L',
-'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\030', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't',
-'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'I', '\n', '\023', 'u', 'p', 'd', 'a', 't', 'e', '_', 'm', 'e', 'r', 'g',
-'e', '_', 'w', 'i', 'n', 'd', 'o', 'w', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'u', 'p', 'd', 'a', 't', 'e', 'M',
-'e', 'r', 'g', 'e', 'W', 'i', 'n', 'd', 'o', 'w', '\022', 'C', '\n', '\037', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'n', 'e', 'w', '_',
-'h', 'o', 's', 't', 's', '_', 'u', 'n', 't', 'i', 'l', '_', 'f', 'i', 'r', 's', 't', '_', 'h', 'c', '\030', '\005', ' ', '\001', '(',
-'\010', 'R', '\032', 'i', 'g', 'n', 'o', 'r', 'e', 'N', 'e', 'w', 'H', 'o', 's', 't', 's', 'U', 'n', 't', 'i', 'l', 'F', 'i', 'r',
-'s', 't', 'H', 'c', '\022', 'M', '\n', '$', 'c', 'l', 'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's',
-'_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 's', 'e', 't', '_', 'c', 'h', 'a', 'n', 'g', 'e', '\030', '\006', ' ', '\001', '(', '\010',
-'R', '\037', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H', 'o', 's', 't', 'S',
-'e', 't', 'C', 'h', 'a', 'n', 'g', 'e', '\022', '\212', '\001', '\n', '\034', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', '_', 'h',
-'a', 's', 'h', 'i', 'n', 'g', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'I', '.',
+'t', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '2', '\005', '\030', '\313', '\226', '\261', '\002', 'R', '\t', 't', 'a', 'b',
+'l', 'e', 'S', 'i', 'z', 'e', '\032', 'n', '\n', '\023', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 'u', 's', 'e', '_', 'h', 't', 't', 'p', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001',
+' ', '\001', '(', '\010', 'R', '\r', 'u', 's', 'e', 'H', 't', 't', 'p', 'H', 'e', 'a', 'd', 'e', 'r', ':', '/', '\232', '\305', '\210', '\036',
+'*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'O',
+'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\374', '\n', '\n', '\016', 'C', 'o',
+'m', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\027', 'h', 'e', 'a', 'l', 't', 'h', 'y', '_', 'p',
+'a', 'n', 'i', 'c', '_', 't', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\025', 'h', 'e', 'a', 'l',
+'t', 'h', 'y', 'P', 'a', 'n', 'i', 'c', 'T', 'h', 'r', 'e', 's', 'h', 'o', 'l', 'd', '\022', 't', '\n', '\024', 'z', 'o', 'n', 'e',
+'_', 'a', 'w', 'a', 'r', 'e', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', 'A', '.',
'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C',
-'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n',
-'s', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\031', 'c',
-'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\215', '\002', '\n', '\021', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\017',
-'r', 'o', 'u', 't', 'i', 'n', 'g', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e',
-'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'o', 'u',
-'t', 'i', 'n', 'g', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'F', '\n', '\020', 'm', 'i', 'n', '_', 'c', 'l', 'u', 's', 't', 'e',
-'r', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'i', 'n', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'S', 'i', 'z', 'e', '\022', '1', '\n', '\025', 'f', 'a', 'i', 'l', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_',
-'o', 'n', '_', 'p', 'a', 'n', 'i', 'c', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\022', 'f', 'a', 'i', 'l', 'T', 'r', 'a', 'f', 'f',
-'i', 'c', 'O', 'n', 'P', 'a', 'n', 'i', 'c', ':', '<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n',
-'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '_', '\n', '\030',
-'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':',
-'C', '\232', '\305', '\210', '\036', '>', '\n', '<', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i',
-'t', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\361', '\001', '\n', '\031', 'C', 'o',
-'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '7',
-'\n', '\030', 'u', 's', 'e', '_', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '_', 'f', 'o', 'r', '_', 'h', 'a', 's', 'h', 'i', 'n',
-'g', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\025', 'u', 's', 'e', 'H', 'o', 's', 't', 'n', 'a', 'm', 'e', 'F', 'o', 'r', 'H', 'a',
-'s', 'h', 'i', 'n', 'g', '\022', 'U', '\n', '\023', 'h', 'a', 's', 'h', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'f', 'a', 'c',
-'t', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', 'd', 'R', '\021',
-'h', 'a', 's', 'h', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'F', 'a', 'c', 't', 'o', 'r', ':', 'D', '\232', '\305', '\210', '\036', '?', '\n',
-'=', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm',
+'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n',
+'e', 'A', 'w', 'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\021', 'z', 'o', 'n', 'e', 'A', 'w', 'a',
+'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\211', '\001', '\n', '\033', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'w',
+'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', 'H',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.',
+'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o',
+'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R',
+'\030', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'I', '\n', '\023', 'u', 'p', 'd', 'a', 't', 'e', '_', 'm', 'e', 'r', 'g', 'e', '_', 'w', 'i', 'n', 'd', 'o', 'w', '\030', '\004',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'u', 'p', 'd', 'a', 't', 'e', 'M', 'e', 'r', 'g', 'e', 'W', 'i', 'n', 'd', 'o', 'w',
+'\022', 'C', '\n', '\037', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'n', 'e', 'w', '_', 'h', 'o', 's', 't', 's', '_', 'u', 'n', 't', 'i',
+'l', '_', 'f', 'i', 'r', 's', 't', '_', 'h', 'c', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\032', 'i', 'g', 'n', 'o', 'r', 'e', 'N',
+'e', 'w', 'H', 'o', 's', 't', 's', 'U', 'n', 't', 'i', 'l', 'F', 'i', 'r', 's', 't', 'H', 'c', '\022', 'M', '\n', '$', 'c', 'l',
+'o', 's', 'e', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '_', 'o', 'n', '_', 'h', 'o', 's', 't', '_', 's',
+'e', 't', '_', 'c', 'h', 'a', 'n', 'g', 'e', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'l', 'o', 's', 'e', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 's', 'O', 'n', 'H', 'o', 's', 't', 'S', 'e', 't', 'C', 'h', 'a', 'n', 'g', 'e', '\022', '\212',
+'\001', '\n', '\034', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', '_', 'h', 'a', 's', 'h', 'i', 'n', 'g', '_', 'l', 'b', '_',
+'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'I', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm',
'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's',
-'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b',
-'C', 'o', 'n', 'f', 'i', 'g', 'B', '\033', '\n', '\031', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g',
-'_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\032', '\322', '\001', '\n', '\013', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't',
-'e', '\022', 'N', '\n', '\r', 'b', 'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '*', '\004', '\020', '\300', '\204', '=', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n',
-'t', 'e', 'r', 'v', 'a', 'l', '\022', 'J', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006', '*', '\004', '\020', '\300', '\204', '=', 'R', '\013', 'm', 'a', 'x', 'I',
-'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\032', '\203',
-'\002', '\n', '\020', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'x', '\n', '\035', 'p', 'e',
-'r', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't',
-'i', 'o', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000',
-'\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\032', 'p', 'e', 'r', 'U', 'p', 's', 't', 'r', 'e', 'a',
-'m', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o', '\022', 'u', '\n', '\033', 'p', 'r', 'e', 'd', 'i',
-'c', 't', 'i', 'v', 'e', '_', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u',
-'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')',
-'\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\031', 'p', 'r', 'e', 'd', 'i', 'c', 't', 'i', 'v', 'e', 'P', 'r', 'e', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o', '\032', 'f', '\n', '\"', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020',
-'\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e',
-'\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', 'W', '\n', '\r', 'D', 'i', 's', 'c', 'o', 'v', 'e',
-'r', 'y', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T', 'A', 'T', 'I', 'C', '\020', '\000', '\022', '\016', '\n', '\n', 'S', 'T', 'R',
-'I', 'C', 'T', '_', 'D', 'N', 'S', '\020', '\001', '\022', '\017', '\n', '\013', 'L', 'O', 'G', 'I', 'C', 'A', 'L', '_', 'D', 'N', 'S', '\020',
-'\002', '\022', '\007', '\n', '\003', 'E', 'D', 'S', '\020', '\003', '\022', '\020', '\n', '\014', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S',
-'T', '\020', '\004', '\"', '\244', '\001', '\n', '\010', 'L', 'b', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'N', 'D',
-'_', 'R', 'O', 'B', 'I', 'N', '\020', '\000', '\022', '\021', '\n', '\r', 'L', 'E', 'A', 'S', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T',
-'\020', '\001', '\022', '\r', '\n', '\t', 'R', 'I', 'N', 'G', '_', 'H', 'A', 'S', 'H', '\020', '\002', '\022', '\n', '\n', '\006', 'R', 'A', 'N', 'D',
-'O', 'M', '\020', '\003', '\022', '\n', '\n', '\006', 'M', 'A', 'G', 'L', 'E', 'V', '\020', '\005', '\022', '\024', '\n', '\020', 'C', 'L', 'U', 'S', 'T',
-'E', 'R', '_', 'P', 'R', 'O', 'V', 'I', 'D', 'E', 'D', '\020', '\006', '\022', ' ', '\n', '\034', 'L', 'O', 'A', 'D', '_', 'B', 'A', 'L',
-'A', 'N', 'C', 'I', 'N', 'G', '_', 'P', 'O', 'L', 'I', 'C', 'Y', '_', 'C', 'O', 'N', 'F', 'I', 'G', '\020', '\007', '\"', '\004', '\010',
-'\004', '\020', '\004', '*', '\017', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S', 'T', '_', 'L', 'B', '\"', '5', '\n', '\017', 'D',
-'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a', 'm', 'i', 'l', 'y', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022',
-'\013', '\n', '\007', 'V', '4', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\013', '\n', '\007', 'V', '6', '_', 'O', 'N', 'L', 'Y', '\020', '\002',
-'\"', 'T', '\n', '\030', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'S', 'e', 'l', 'e', 'c', 't',
-'i', 'o', 'n', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'C', 'O', 'N', 'F', 'I', 'G', 'U', 'R', 'E', 'D', '_', 'P', 'R', 'O',
-'T', 'O', 'C', 'O', 'L', '\020', '\000', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'D', 'O', 'W', 'N', 'S', 'T', 'R', 'E', 'A', 'M',
-'_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\001', ':', '\033', '\232', '\305', '\210', '\036', '\026', '\n', '\024', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'B', '\030', '\n', '\026', 'c', 'l', 'u', 's', 't', 'e',
-'r', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '_', 't', 'y', 'p', 'e', 'B', '\013', '\n', '\t', 'l', 'b', '_', 'c', 'o',
-'n', 'f', 'i', 'g', 'J', '\004', '\010', '\014', '\020', '\r', 'J', '\004', '\010', '\017', '\020', '\020', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010',
-'\013', '\020', '\014', 'J', '\004', '\010', '#', '\020', '$', 'R', '\005', 'h', 'o', 's', 't', 's', 'R', '\013', 't', 'l', 's', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', 'R', '\032', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_',
-'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\245', '\002', '\n', '\023', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g',
-'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
-'3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3',
+'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\031', 'c', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H',
+'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\215', '\002', '\n', '\021', 'Z', 'o', 'n', 'e', 'A', 'w',
+'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\017', 'r', 'o', 'u', 't', 'i', 'n', 'g', '_', 'e', 'n',
+'a', 'b', 'l', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'o', 'u', 't', 'i', 'n', 'g', 'E', 'n', 'a', 'b', 'l', 'e',
+'d', '\022', 'F', '\n', '\020', 'm', 'i', 'n', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
+'6', '4', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'i', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'i', 'z', 'e', '\022', '1',
+'\n', '\025', 'f', 'a', 'i', 'l', '_', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'o', 'n', '_', 'p', 'a', 'n', 'i', 'c', '\030', '\003',
+' ', '\001', '(', '\010', 'R', '\022', 'f', 'a', 'i', 'l', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'O', 'n', 'P', 'a', 'n', 'i', 'c', ':',
+'<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's',
+'t', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'Z', 'o', 'n', 'e', 'A', 'w',
+'a', 'r', 'e', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '_', '\n', '\030', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e',
+'i', 'g', 'h', 't', 'e', 'd', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'C', '\232', '\305', '\210', '\036', '>', '\n', '<', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd',
+'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\361', '\001', '\n', '\031', 'C', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a',
+'s', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '7', '\n', '\030', 'u', 's', 'e', '_', 'h', 'o', 's', 't',
+'n', 'a', 'm', 'e', '_', 'f', 'o', 'r', '_', 'h', 'a', 's', 'h', 'i', 'n', 'g', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\025', 'u',
+'s', 'e', 'H', 'o', 's', 't', 'n', 'a', 'm', 'e', 'F', 'o', 'r', 'H', 'a', 's', 'h', 'i', 'n', 'g', '\022', 'U', '\n', '\023', 'h',
+'a', 's', 'h', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'f', 'a', 'c', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', 'd', 'R', '\021', 'h', 'a', 's', 'h', 'B', 'a', 'l', 'a', 'n', 'c',
+'e', 'F', 'a', 'c', 't', 'o', 'r', ':', 'D', '\232', '\305', '\210', '\036', '?', '\n', '=', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i',
+'g', '.', 'C', 'o', 'n', 's', 'i', 's', 't', 'e', 'n', 't', 'H', 'a', 's', 'h', 'i', 'n', 'g', 'L', 'b', 'C', 'o', 'n', 'f',
+'i', 'g', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C',
+'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'L', 'b', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\033', '\n', '\031',
+'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'\032', '\322', '\001', '\n', '\013', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\022', 'N', '\n', '\r', 'b', 'a', 's', 'e', '_',
+'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010',
+'\001', '*', '\004', '\020', '\300', '\204', '=', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'J', '\n', '\014',
+'m', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t',
+'\252', '\001', '\006', '*', '\004', '\020', '\300', '\204', '=', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '\'', '\232',
+'\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e',
+'r', '.', 'R', 'e', 'f', 'r', 'e', 's', 'h', 'R', 'a', 't', 'e', '\032', '\203', '\002', '\n', '\020', 'P', 'r', 'e', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'x', '\n', '\035', 'p', 'e', 'r', '_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm',
+'_', 'p', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a',
+'l', 'u', 'e', 'B', '\027', '\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000',
+'\000', '\360', '?', 'R', '\032', 'p', 'e', 'r', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c',
+'t', 'R', 'a', 't', 'i', 'o', '\022', 'u', '\n', '\033', 'p', 'r', 'e', 'd', 'i', 'c', 't', 'i', 'v', 'e', '_', 'p', 'r', 'e', 'c',
+'o', 'n', 'n', 'e', 'c', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', 'B', '\027',
+'\372', 'B', '\024', '\022', '\022', '\031', '\000', '\000', '\000', '\000', '\000', '\000', '\010', '@', ')', '\000', '\000', '\000', '\000', '\000', '\000', '\360', '?', 'R', '\031',
+'p', 'r', 'e', 'd', 'i', 'c', 't', 'i', 'v', 'e', 'P', 'r', 'e', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'R', 'a', 't', 'i', 'o',
+'\032', 'f', '\n', '\"', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(',
+'\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e',
+':', '\002', '8', '\001', '\"', 'W', '\n', '\r', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006',
+'S', 'T', 'A', 'T', 'I', 'C', '\020', '\000', '\022', '\016', '\n', '\n', 'S', 'T', 'R', 'I', 'C', 'T', '_', 'D', 'N', 'S', '\020', '\001', '\022',
+'\017', '\n', '\013', 'L', 'O', 'G', 'I', 'C', 'A', 'L', '_', 'D', 'N', 'S', '\020', '\002', '\022', '\007', '\n', '\003', 'E', 'D', 'S', '\020', '\003',
+'\022', '\020', '\n', '\014', 'O', 'R', 'I', 'G', 'I', 'N', 'A', 'L', '_', 'D', 'S', 'T', '\020', '\004', '\"', '\244', '\001', '\n', '\010', 'L', 'b',
+'P', 'o', 'l', 'i', 'c', 'y', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'N', 'D', '_', 'R', 'O', 'B', 'I', 'N', '\020', '\000', '\022', '\021',
+'\n', '\r', 'L', 'E', 'A', 'S', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020', '\001', '\022', '\r', '\n', '\t', 'R', 'I', 'N', 'G',
+'_', 'H', 'A', 'S', 'H', '\020', '\002', '\022', '\n', '\n', '\006', 'R', 'A', 'N', 'D', 'O', 'M', '\020', '\003', '\022', '\n', '\n', '\006', 'M', 'A',
+'G', 'L', 'E', 'V', '\020', '\005', '\022', '\024', '\n', '\020', 'C', 'L', 'U', 'S', 'T', 'E', 'R', '_', 'P', 'R', 'O', 'V', 'I', 'D', 'E',
+'D', '\020', '\006', '\022', ' ', '\n', '\034', 'L', 'O', 'A', 'D', '_', 'B', 'A', 'L', 'A', 'N', 'C', 'I', 'N', 'G', '_', 'P', 'O', 'L',
+'I', 'C', 'Y', '_', 'C', 'O', 'N', 'F', 'I', 'G', '\020', '\007', '\"', '\004', '\010', '\004', '\020', '\004', '*', '\017', 'O', 'R', 'I', 'G', 'I',
+'N', 'A', 'L', '_', 'D', 'S', 'T', '_', 'L', 'B', '\"', 'G', '\n', '\017', 'D', 'n', 's', 'L', 'o', 'o', 'k', 'u', 'p', 'F', 'a',
+'m', 'i', 'l', 'y', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'V', '4', '_', 'O', 'N', 'L', 'Y',
+'\020', '\001', '\022', '\013', '\n', '\007', 'V', '6', '_', 'O', 'N', 'L', 'Y', '\020', '\002', '\022', '\020', '\n', '\014', 'V', '4', '_', 'P', 'R', 'E',
+'F', 'E', 'R', 'R', 'E', 'D', '\020', '\003', '\"', 'T', '\n', '\030', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'c',
+'o', 'l', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'C', 'O', 'N', 'F', 'I', 'G',
+'U', 'R', 'E', 'D', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\000', '\022', '\033', '\n', '\027', 'U', 'S', 'E', '_', 'D', 'O',
+'W', 'N', 'S', 'T', 'R', 'E', 'A', 'M', '_', 'P', 'R', 'O', 'T', 'O', 'C', 'O', 'L', '\020', '\001', ':', '\033', '\232', '\305', '\210', '\036',
+'\026', '\n', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'B', '\030',
+'\n', '\026', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '_', 't', 'y', 'p', 'e', 'B',
+'\013', '\n', '\t', 'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\014', '\020', '\r', 'J', '\004', '\010', '\017', '\020', '\020', 'J',
+'\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\013', '\020', '\014', 'J', '\004', '\010', '#', '\020', '$', 'R', '\005', 'h', 'o', 's', 't', 's', 'R',
+'\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', '\032', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '_', 'p',
+'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\"', '\332', '\002', '\n', '\023', 'L', 'o', 'a', 'd', 'B',
+'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e',
+'s', '\030', '\001', ' ', '\003', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l',
+'u', 's', 't', 'e', 'r', '.', 'v', '3', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l',
+'i', 'c', 'y', '.', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', '\310', '\001', '\n', '\006',
+'P', 'o', 'l', 'i', 'c', 'y', '\022', '`', '\n', '\026', 't', 'y', 'p', 'e', 'd', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o',
+'n', 'f', 'i', 'g', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
'.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'P', 'o', 'l', 'i',
-'c', 'y', 'R', '\010', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\032', '\223', '\001', '\n', '\006', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\022',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '7', '\n', '\014', 't', 'y', 'p',
-'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g',
-':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a',
-'d', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'P', 'o', 'l', 'i', 'c', 'y', 'J', '\004',
-'\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l',
-'i', 'c', 'y', '\"', '\202', '\001', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', 'D', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A',
-'d', 'd', 'r', 'e', 's', 's', 'R', '\r', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '&', '\232', '\305',
-'\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a',
-'m', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\223', '\001', '\n', '\031', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'G', '\n', '\r', 't', 'c', 'p', '_', 'k',
-'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e',
-'R', '\014', 't', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c',
-'t', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', 'r', '\n', '\021', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'S', 't', 'a', 't', 's', '\022', '\'', '\n', '\017', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'b', 'u', 'd', 'g', 'e', 't',
-'s', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 't', 'i', 'm', 'e', 'o', 'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', '4',
-'\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 's', 'i', 'z', 'e', 's', '\030',
-'\002', ' ', '\001', '(', '\010', 'R', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'S', 'i', 'z',
-'e', 's', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't',
-'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'y', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\006', 'c', 'o', 'n',
+'f', 'i', 'g', 'R', '\004', 'n', 'a', 'm', 'e', 'R', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', ':', '\'',
+'\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'o', 'a', 'd', 'B',
+'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\202', '\001', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e',
+'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'D', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'a', 'd',
+'d', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\r', 's', 'o', 'u', 'r', 'c', 'e',
+'A', 'd', 'd', 'r', 'e', 's', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'B', 'i', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\223', '\001',
+'\n', '\031', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o',
+'n', 's', '\022', 'G', '\n', '\r', 't', 'c', 'p', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\001', ' ', '\001', '(', '\013',
+'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T',
+'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'R', '\014', 't', 'c', 'p', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e',
+':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'U', 'p', 's',
+'t', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', 'r', '\n',
+'\021', 'T', 'r', 'a', 'c', 'k', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', '\022', '\'', '\n', '\017', 't', 'i', 'm',
+'e', 'o', 'u', 't', '_', 'b', 'u', 'd', 'g', 'e', 't', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 't', 'i', 'm', 'e', 'o',
+'u', 't', 'B', 'u', 'd', 'g', 'e', 't', 's', '\022', '4', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'r', 'e', 's', 'p',
+'o', 'n', 's', 'e', '_', 's', 'i', 'z', 'e', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't',
+'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'S', 'i', 'z', 'e', 's', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
+'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e',
+'r', '.', 'v', '3', 'B', '\014', 'C', 'l', 'u', 's', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006',
+'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[21] = {
+static upb_def_init *deps[24] = {
&envoy_config_cluster_v3_circuit_breaker_proto_upbdefinit,
&envoy_config_cluster_v3_filter_proto_upbdefinit,
&envoy_config_cluster_v3_outlier_detection_proto_upbdefinit,
@@ -521,6 +518,7 @@ static upb_def_init *deps[21] = {
&envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_health_check_proto_upbdefinit,
&envoy_config_core_v3_protocol_proto_upbdefinit,
+ &envoy_config_core_v3_resolver_proto_upbdefinit,
&envoy_config_endpoint_v3_endpoint_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
@@ -528,6 +526,8 @@ static upb_def_init *deps[21] = {
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&xds_core_v3_collection_entry_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -537,7 +537,7 @@ static upb_def_init *deps[21] = {
upb_def_init envoy_config_cluster_v3_cluster_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_cluster_proto_upb_file_layout,
"envoy/config/cluster/v3/cluster.proto",
- UPB_STRVIEW_INIT(descriptor, 10750)
+ UPB_STRVIEW_INIT(descriptor, 11811)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
index 1bbc89979ac..cd32ef22051 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.h
@@ -56,6 +56,16 @@ UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSu
return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.LbSubsetConfig.LbSubsetSelector");
}
+UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_SlowStartConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.SlowStartConfig");
+}
+
+UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.RoundRobinLbConfig");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_cluster_v3_cluster_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.cluster.v3.Cluster.LeastRequestLbConfig");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
index fbd5db06baf..129f097223d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/filter.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/filter.upbdefs.h"
+#include "envoy/config/cluster/v3/filter.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_Filter_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_cluster_v3_Filter_msginit,
-};
-
static const char descriptor[386] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'f', 'i', 'l', 't', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
@@ -47,7 +42,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_cluster_v3_filter_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_filter_proto_upb_file_layout,
"envoy/config/cluster/v3/filter.proto",
UPB_STRVIEW_INIT(descriptor, 386)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
index 8ab795d9b2b..4d4b3adfe90 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/config/cluster/v3/outlier_detection.upbdefs.h"
+#include "envoy/config/cluster/v3/outlier_detection.upb.h"
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_cluster_v3_OutlierDetection_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_cluster_v3_OutlierDetection_msginit,
-};
-
static const char descriptor[2423] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v', '3',
'/', 'o', 'u', 't', 'l', 'i', 'e', 'r', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022',
'\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032',
@@ -130,7 +125,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_config_cluster_v3_outlier_detection_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_cluster_v3_outlier_detection_proto_upb_file_layout,
"envoy/config/cluster/v3/outlier_detection.proto",
UPB_STRVIEW_INIT(descriptor, 2423)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
index 25a383a1a5f..748848d7394 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/address.upbdefs.c
@@ -8,30 +8,13 @@
#include "upb/def.h"
#include "envoy/config/core/v3/address.upbdefs.h"
+#include "envoy/config/core/v3/address.upb.h"
extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_Pipe_msginit;
-extern const upb_msglayout envoy_config_core_v3_EnvoyInternalAddress_msginit;
-extern const upb_msglayout envoy_config_core_v3_SocketAddress_msginit;
-extern const upb_msglayout envoy_config_core_v3_TcpKeepalive_msginit;
-extern const upb_msglayout envoy_config_core_v3_BindConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_Address_msginit;
-extern const upb_msglayout envoy_config_core_v3_CidrRange_msginit;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_config_core_v3_Pipe_msginit,
- &envoy_config_core_v3_EnvoyInternalAddress_msginit,
- &envoy_config_core_v3_SocketAddress_msginit,
- &envoy_config_core_v3_TcpKeepalive_msginit,
- &envoy_config_core_v3_BindConfig_msginit,
- &envoy_config_core_v3_Address_msginit,
- &envoy_config_core_v3_CidrRange_msginit,
-};
-
static const char descriptor[1878] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd',
'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
@@ -121,7 +104,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_config_core_v3_address_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_address_proto_upb_file_layout,
"envoy/config/core/v3/address.proto",
UPB_STRVIEW_INIT(descriptor, 1878)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
index 0b0bbdd401c..48717ba44fe 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/backoff.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/core/v3/backoff.upbdefs.h"
+#include "envoy/config/core/v3/backoff.upb.h"
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_BackoffStrategy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_BackoffStrategy_msginit,
-};
-
static const char descriptor[465] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
'c', 'k', 'o', 'f', 'f', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
@@ -50,7 +45,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_core_v3_backoff_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_backoff_proto_upb_file_layout,
"envoy/config/core/v3/backoff.proto",
UPB_STRVIEW_INIT(descriptor, 465)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
index a91ff3d6ac5..716987ee61d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/core/v3/base.upbdefs.h"
+#include "envoy/config/core/v3/base.upb.h"
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_backoff_proto_upbdefinit;
@@ -17,57 +18,13 @@ extern upb_def_init envoy_type_v3_semantic_version_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init google_protobuf_struct_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_Locality_msginit;
-extern const upb_msglayout envoy_config_core_v3_BuildVersion_msginit;
-extern const upb_msglayout envoy_config_core_v3_Extension_msginit;
-extern const upb_msglayout envoy_config_core_v3_Node_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_msginit;
-extern const upb_msglayout envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeUInt32_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimePercent_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeDouble_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeFeatureFlag_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValue_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderValueOption_msginit;
-extern const upb_msglayout envoy_config_core_v3_HeaderMap_msginit;
-extern const upb_msglayout envoy_config_core_v3_WatchedDirectory_msginit;
-extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_RetryPolicy_msginit;
-extern const upb_msglayout envoy_config_core_v3_RemoteDataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_AsyncDataSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_TransportSocket_msginit;
-extern const upb_msglayout envoy_config_core_v3_RuntimeFractionalPercent_msginit;
-extern const upb_msglayout envoy_config_core_v3_ControlPlane_msginit;
-
-static const upb_msglayout *layouts[21] = {
- &envoy_config_core_v3_Locality_msginit,
- &envoy_config_core_v3_BuildVersion_msginit,
- &envoy_config_core_v3_Extension_msginit,
- &envoy_config_core_v3_Node_msginit,
- &envoy_config_core_v3_Metadata_msginit,
- &envoy_config_core_v3_Metadata_FilterMetadataEntry_msginit,
- &envoy_config_core_v3_RuntimeUInt32_msginit,
- &envoy_config_core_v3_RuntimePercent_msginit,
- &envoy_config_core_v3_RuntimeDouble_msginit,
- &envoy_config_core_v3_RuntimeFeatureFlag_msginit,
- &envoy_config_core_v3_HeaderValue_msginit,
- &envoy_config_core_v3_HeaderValueOption_msginit,
- &envoy_config_core_v3_HeaderMap_msginit,
- &envoy_config_core_v3_WatchedDirectory_msginit,
- &envoy_config_core_v3_DataSource_msginit,
- &envoy_config_core_v3_RetryPolicy_msginit,
- &envoy_config_core_v3_RemoteDataSource_msginit,
- &envoy_config_core_v3_AsyncDataSource_msginit,
- &envoy_config_core_v3_TransportSocket_msginit,
- &envoy_config_core_v3_RuntimeFractionalPercent_msginit,
- &envoy_config_core_v3_ControlPlane_msginit,
-};
-
-static const char descriptor[4473] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
+static const char descriptor[5228] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a',
's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
'r', 'e', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/',
'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c',
@@ -79,176 +36,207 @@ static const char descriptor[4473] = {'\n', '\037', 'e', 'n', 'v', 'o', 'y', '/'
'.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a',
'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
'/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
-'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 't', '\n', '\010', 'L', 'o', 'c',
-'a', 'l', 'i', 't', 'y', '\022', '\026', '\n', '\006', 'r', 'e', 'g', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\006', 'r', 'e',
-'g', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'z', 'o', 'n', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\004', 'z', 'o', 'n', 'e', '\022',
-'\031', '\n', '\010', 's', 'u', 'b', '_', 'z', 'o', 'n', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\007', 's', 'u', 'b', 'Z', 'o', 'n',
-'e', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
-'r', 'e', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\"', '\244', '\001', '\n', '\014', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's',
-'i', 'o', 'n', '\022', '8', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n',
-'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i',
-'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\002',
-' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't',
-'r', 'u', 'c', 't', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's',
-'i', 'o', 'n', '\"', '\342', '\001', '\n', '\t', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e',
-'\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\030',
-'\002', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\022', '\'', '\n', '\017', 't', 'y', 'p', 'e', '_', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\016', 't', 'y', 'p', 'e', 'D', 'e', 's', 'c',
-'r', 'i', 'p', 't', 'o', 'r', '\022', '<', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\"',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i',
-'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\032', '\n', '\010', 'd', 'i', 's',
-'a', 'b', 'l', 'e', 'd', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '\"', '\232', '\305',
-'\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\345', '\004', '\n', '\004', 'N', 'o', 'd', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ',
-'\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\030', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R',
-'\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c',
-'t', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\004',
-' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', '&', '\n', '\017',
-'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\r', 'u', 's',
-'e', 'r', 'A', 'g', 'e', 'n', 't', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\022', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't',
-'_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\020', 'u', 's', 'e', 'r', 'A', 'g', 'e',
-'n', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', ']', '\n', '\030', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'b',
-'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', 'H', '\000', 'R', '\025', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', '\022', '?', '\n', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\003', '(', '\013', '2',
-'\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'c', 'l',
-'i', 'e', 'n', 't', '_', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\016', 'c', 'l', 'i', 'e',
-'n', 't', 'F', 'e', 'a', 't', 'u', 'r', 'e', 's', '\022', 'R', '\n', '\023', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', '_', 'a',
-'d', 'd', 'r', 'e', 's', 's', 'e', 's', '\030', '\013', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\002', '\030', '\001', 'R',
-'\022', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', 'A', 'd', 'd', 'r', 'e', 's', 's', 'e', 's', ':', '\035', '\232', '\305', '\210', '\036',
-'\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'N', 'o', 'd', 'e',
-'B', '\031', '\n', '\027', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 't', 'y',
-'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\r', 'b', 'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\"', '\346',
-'\001', '\n', '\010', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '[', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e', 't',
-'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'F', 'i', 'l', 't', 'e', 'r',
-'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\032', 'Z', '\n', '\023', 'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't',
-'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '-', '\n', '\005', 'v',
-'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '!', '\232', '\305',
-'\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\022',
-'#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\014', 'd',
-'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e',
-'y', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e',
-'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\"', 'w', '\n', '\016', 'R', 'u', 'n',
-'t', 'i', 'm', 'e', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', ';', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a',
-'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
-'.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n',
-'\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
-'\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm',
-'e', 'D', 'o', 'u', 'b', 'l', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030',
-'\001', ' ', '\001', '(', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u',
-'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l',
-'e', '\"', '\266', '\001', '\n', '\022', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\022',
-'I', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022',
-'(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e',
-'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\"', '\177', '\n', '\013', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
-'e', '\022', '#', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\021', '\372', 'B', '\016', 'r', '\014', '\020', '\001', '(', '\200',
-'\200', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\003', 'k', 'e', 'y', '\022', '%', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ',
-'\001', '(', '\t', 'B', '\017', '\372', 'B', '\014', 'r', '\n', '(', '\200', '\200', '\001', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\005', 'v', 'a', 'l',
-'u', 'e', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c',
-'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\"', '\270', '\001', '\n', '\021', 'H', 'e', 'a', 'd', 'e',
-'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'C', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\006',
-'h', 'e', 'a', 'd', 'e', 'r', '\022', '2', '\n', '\006', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\006', 'a', 'p', 'p', 'e', 'n', 'd', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i',
-'o', 'n', '\"', 'l', '\n', '\t', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\022', ';', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '\030', '\001', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
-'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\"', '/', '\n', '\020', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i',
-'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '\033', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
-'\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\"', '\266', '\001', '\n', '\n', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c',
-'e', '\022', '%', '\n', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'H', '\000', 'R', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\022', '#', '\n', '\014', 'i', 'n', 'l', 'i', 'n', 'e',
-'_', 'b', 'y', 't', 'e', 's', '\030', '\002', ' ', '\001', '(', '\014', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'B', 'y', 't',
-'e', 's', '\022', '%', '\n', '\r', 'i', 'n', 'l', 'i', 'n', 'e', '_', 's', 't', 'r', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\t',
-'H', '\000', 'R', '\014', 'i', 'n', 'l', 'i', 'n', 'e', 'S', 't', 'r', 'i', 'n', 'g', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u',
-'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\"', '\324', '\001', '\n',
-'\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'K', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c',
-'k', '_', 'o', 'f', 'f', '\030', '\001', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r', 'a', 't', 'e', 'g', 'y',
-'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't',
-'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013',
-'m', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', ':', '$',
+'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's',
+'/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd',
+'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e',
+'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 't', '\n', '\010', 'L', 'o', 'c', 'a', 'l', 'i', 't',
+'y', '\022', '\026', '\n', '\006', 'r', 'e', 'g', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\006', 'r', 'e', 'g', 'i', 'o', 'n',
+'\022', '\022', '\n', '\004', 'z', 'o', 'n', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\004', 'z', 'o', 'n', 'e', '\022', '\031', '\n', '\010', 's',
+'u', 'b', '_', 'z', 'o', 'n', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\007', 's', 'u', 'b', 'Z', 'o', 'n', 'e', ':', '!', '\232',
+'\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'L',
+'o', 'c', 'a', 'l', 'i', 't', 'y', '\"', '\244', '\001', '\n', '\014', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022',
+'8', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'t', 'y', 'p', 'e', '.', 'v', '3', '.', 'S', 'e', 'm', 'a', 'n', 't', 'i', 'c', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'R', '\007',
+'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\002', ' ', '\001', '(', '\013',
+'2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't',
+'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\"',
+'\342', '\001', '\n', '\t', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\032', '\n', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\030', '\002', ' ', '\001', '(',
+'\t', 'R', '\010', 'c', 'a', 't', 'e', 'g', 'o', 'r', 'y', '\022', '\'', '\n', '\017', 't', 'y', 'p', 'e', '_', 'd', 'e', 's', 'c', 'r',
+'i', 'p', 't', 'o', 'r', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\016', 't', 'y', 'p', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't',
+'o', 'r', '\022', '<', '\n', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e',
+'r', 's', 'i', 'o', 'n', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\032', '\n', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e',
+'d', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n',
+'\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'E', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', '\"', '\262', '\006', '\n', '\004', 'N', 'o', 'd', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R',
+'\002', 'i', 'd', '\022', '\030', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '\022', '3', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(', '\013', '2', '\027', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\010', 'm',
+'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '`', '\n', '\022', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'p', 'a', 'r', 'a', 'm', 'e',
+'t', 'e', 'r', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '1', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a',
+'m', 'e', 't', 'e', 'r', 's', 'E', 'n', 't', 'r', 'y', 'R', '\021', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c',
+'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', '&', '\n', '\017', 'u', 's', 'e', 'r', '_', 'a',
+'g', 'e', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\r', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n',
+'t', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\022', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i',
+'o', 'n', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\020', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'V', 'e', 'r', 's',
+'i', 'o', 'n', '\022', ']', '\n', '\030', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'b', 'u', 'i', 'l', 'd', '_', 'v',
+'e', 'r', 's', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'H', '\000',
+'R', '\025', 'u', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '?',
+'\n', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 'R', '\n', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\'', '\n', '\017', 'c', 'l', 'i', 'e', 'n', 't', '_', 'f',
+'e', 'a', 't', 'u', 'r', 'e', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't', 'F', 'e', 'a', 't',
+'u', 'r', 'e', 's', '\022', '[', '\n', '\023', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', '_', 'a', 'd', 'd', 'r', 'e', 's', 's',
+'e', 's', '\030', '\013', ' ', '\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3',
+'.', '0', 'R', '\022', 'l', 'i', 's', 't', 'e', 'n', 'i', 'n', 'g', 'A', 'd', 'd', 'r', 'e', 's', 's', 'e', 's', '\032', '`', '\n',
+'\026', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'E', 'n', 't', 'r', 'y', '\022', '\020',
+'\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '0', '\n', '\005', 'v', 'a', 'l', 'u', 'e',
+'\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't',
+'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '\035', '\232', '\305', '\210',
+'\036', '\030', '\n', '\026', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'N', 'o', 'd',
+'e', 'B', '\031', '\n', '\027', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 't',
+'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\r', 'b', 'u', 'i', 'l', 'd', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\"',
+'\261', '\003', '\n', '\010', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '[', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e',
+'t', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'F', 'i', 'l', 't', 'e',
+'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\022', 'k', '\n', '\025', 't', 'y', 'p', 'e', 'd', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '\030', '\002', ' ', '\003', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'T', 'y', 'p', 'e', 'd', 'F',
+'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', 'R', '\023', 't', 'y', 'p', 'e', 'd',
+'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'Z', '\n', '\023', 'F', 'i', 'l', 't', 'e', 'r', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\003', 'k', 'e', 'y', '\022', '-', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l',
+'u', 'e', ':', '\002', '8', '\001', '\032', '\\', '\n', '\030', 'T', 'y', 'p', 'e', 'd', 'F', 'i', 'l', 't', 'e', 'r', 'M', 'e', 't', 'a',
+'d', 'a', 't', 'a', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k',
+'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001',
+':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r',
+'e', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\"', '\206', '\001', '\n', '\r', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n',
+'t', '3', '2', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(',
+'\r', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm',
+'e', '_', 'k', 'e', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n',
+'t', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'U', 'I', 'n', 't', '3', '2', '\"', 'w', '\n',
+'\016', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', ';', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l',
+'t', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u',
+'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372',
+'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', '\"', '\206', '\001', '\n', '\r', 'R', 'u',
+'n', 't', 'i', 'm', 'e', 'D', 'o', 'u', 'b', 'l', 'e', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a',
+'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '(',
+'\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
+'\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e',
+'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'D',
+'o', 'u', 'b', 'l', 'e', '\"', '\266', '\001', '\n', '\022', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F',
+'l', 'a', 'g', '\022', 'I', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V',
+'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a',
+'l', 'u', 'e', '\022', '(', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '+', '\232', '\305', '\210',
+'\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'u', 'n',
+'t', 'i', 'm', 'e', 'F', 'e', 'a', 't', 'u', 'r', 'e', 'F', 'l', 'a', 'g', '\"', 'A', '\n', '\016', 'Q', 'u', 'e', 'r', 'y', 'P',
+'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t',
+'R', '\005', 'v', 'a', 'l', 'u', 'e', '\"', '\177', '\n', '\013', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '#', '\n',
+'\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\021', '\372', 'B', '\016', 'r', '\014', '\020', '\001', '(', '\200', '\200', '\001', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\003', 'k', 'e', 'y', '\022', '%', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B',
+'\017', '\372', 'B', '\014', 'r', '\n', '(', '\200', '\200', '\001', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '$',
'\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
-'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\350', '\001', '\n', '\020', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't',
-'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'B', '\n', '\010', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H',
-'t', 't', 'p', 'U', 'r', 'i', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'h', 't', 't', 'p', 'U', 'r', 'i',
-'\022', '\037', '\n', '\006', 's', 'h', 'a', '2', '5', '6', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
-'R', '\006', 's', 'h', 'a', '2', '5', '6', '\022', 'D', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030',
-'\003', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l',
-'i', 'c', 'y', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'c', 'o', 'r', 'e', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\"', '\311', '\001', '\n',
-'\017', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\005', 'l', 'o', 'c', 'a', 'l',
-'\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
-'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\005', 'l', 'o', 'c', 'a', 'l', '\022',
-'@', '\n', '\006', 'r', 'e', 'm', 'o', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S',
-'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\006', 'r', 'e', 'm', 'o', 't', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't',
-'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001',
-'\"', '\260', '\001', '\n', '\017', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', '\033', '\n', '\004', 'n',
-'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022',
-'9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p',
-'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't',
-'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o',
-'n', 'f', 'i', 'g', '\"', '\277', '\001', '\n', '\030', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a',
-'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'O', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e',
-'\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r',
-'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e',
-'_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', ':', '1', '\232',
-'\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\"', 'U',
-'\n', '\014', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '\022', '\036', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f',
-'i', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', ':', '%', '\232', '\305',
-'\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o',
-'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '*', '(', '\n', '\017', 'R', 'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o',
-'r', 'i', 't', 'y', '\022', '\013', '\n', '\007', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\010', '\n', '\004', 'H', 'I', 'G', 'H',
-'\020', '\001', '*', '\211', '\001', '\n', '\r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'e', 't', 'h', 'o', 'd', '\022', '\026', '\n', '\022', 'M',
-'E', 'T', 'H', 'O', 'D', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\007', '\n', '\003', 'G', 'E',
-'T', '\020', '\001', '\022', '\010', '\n', '\004', 'H', 'E', 'A', 'D', '\020', '\002', '\022', '\010', '\n', '\004', 'P', 'O', 'S', 'T', '\020', '\003', '\022', '\007',
-'\n', '\003', 'P', 'U', 'T', '\020', '\004', '\022', '\n', '\n', '\006', 'D', 'E', 'L', 'E', 'T', 'E', '\020', '\005', '\022', '\013', '\n', '\007', 'C', 'O',
-'N', 'N', 'E', 'C', 'T', '\020', '\006', '\022', '\013', '\n', '\007', 'O', 'P', 'T', 'I', 'O', 'N', 'S', '\020', '\007', '\022', '\t', '\n', '\005', 'T',
-'R', 'A', 'C', 'E', '\020', '\010', '\022', '\t', '\n', '\005', 'P', 'A', 'T', 'C', 'H', '\020', '\t', '*', '>', '\n', '\020', 'T', 'r', 'a', 'f',
-'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\022', '\017', '\n', '\013', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I',
-'E', 'D', '\020', '\000', '\022', '\013', '\n', '\007', 'I', 'N', 'B', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\014', '\n', '\010', 'O', 'U', 'T', 'B',
-'O', 'U', 'N', 'D', '\020', '\002', 'B', '9', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\t', 'B', 'a', 's', 'e',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\"', '\211', '\003', '\n', '\021', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'C', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e',
+'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\006', 'h', 'e', 'a', 'd',
+'e', 'r', '\022', '2', '\n', '\006', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\006', 'a', 'p',
+'p', 'e', 'n', 'd', '\022', 'i', '\n', '\r', 'a', 'p', 'p', 'e', 'n', 'd', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001',
+'(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r',
+'A', 'p', 'p', 'e', 'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'a',
+'p', 'p', 'e', 'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'd', '\n', '\022', 'H', 'e', 'a', 'd', 'e', 'r', 'A', 'p', 'p', 'e',
+'n', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\033', '\n', '\027', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'I', 'F', '_', 'E', 'X', 'I',
+'S', 'T', 'S', '_', 'O', 'R', '_', 'A', 'D', 'D', '\020', '\000', '\022', '\021', '\n', '\r', 'A', 'D', 'D', '_', 'I', 'F', '_', 'A', 'B',
+'S', 'E', 'N', 'T', '\020', '\001', '\022', '\036', '\n', '\032', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T', 'E', '_', 'I', 'F', '_', 'E', 'X',
+'I', 'S', 'T', 'S', '_', 'O', 'R', '_', 'A', 'D', 'D', '\020', '\002', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
+'e', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'l', '\n', '\t', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\022', ';', '\n', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', ':', '\"', '\232', '\305', '\210', '\036', '\035', '\n', '\033', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'p', '\"', '/', '\n', '\020', 'W', 'a', 't', 'c',
+'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', '\033', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\"', '\266', '\001', '\n', '\n', 'D', 'a', 't', 'a',
+'S', 'o', 'u', 'r', 'c', 'e', '\022', '%', '\n', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\010', 'f', 'i', 'l', 'e', 'n', 'a', 'm', 'e', '\022', '#', '\n', '\014', 'i',
+'n', 'l', 'i', 'n', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\002', ' ', '\001', '(', '\014', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i',
+'n', 'e', 'B', 'y', 't', 'e', 's', '\022', '%', '\n', '\r', 'i', 'n', 'l', 'i', 'n', 'e', '_', 's', 't', 'r', 'i', 'n', 'g', '\030',
+'\003', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\014', 'i', 'n', 'l', 'i', 'n', 'e', 'S', 't', 'r', 'i', 'n', 'g', ':', '#', '\232', '\305',
+'\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'D', 'a',
+'t', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B',
+'\001', '\"', '\324', '\001', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'K', '\n', '\016', 'r', 'e', 't', 'r',
+'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\001', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'B', 'a', 'c', 'k', 'o', 'f', 'f', 'S', 't', 'r',
+'a', 't', 'e', 'g', 'y', 'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'R', '\n', '\013', 'n', 'u',
+'m', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376',
+'\217', '\005', '\r', '\n', '\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r',
+'i', 'e', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'c', 'o', 'r', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\350', '\001', '\n', '\020', 'R', 'e', 'm', 'o',
+'t', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', 'B', '\n', '\010', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', 'U', 'r', 'i', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'h', 't',
+'t', 'p', 'U', 'r', 'i', '\022', '\037', '\n', '\006', 's', 'h', 'a', '2', '5', '6', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\006', 's', 'h', 'a', '2', '5', '6', '\022', 'D', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o',
+'l', 'i', 'c', 'y', '\030', '\003', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't',
+'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'R', 'e', 'm', 'o', 't', 'e', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c',
+'e', '\"', '\311', '\001', '\n', '\017', 'A', 's', 'y', 'n', 'c', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '8', '\n', '\005',
+'l', 'o', 'c', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\005', 'l',
+'o', 'c', 'a', 'l', '\022', '@', '\n', '\006', 'r', 'e', 'm', 'o', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 'm', 'o', 't', 'e',
+'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\006', 'r', 'e', 'm', 'o', 't', 'e', ':', '(', '\232', '\305', '\210',
+'\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'A', 's', 'y',
+'n', 'c', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\020', '\n', '\t', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'\022', '\003', '\370', 'B', '\001', '\"', '\260', '\001', '\n', '\017', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't',
+'\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004',
+'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000',
+'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S',
+'o', 'c', 'k', 'e', 't', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020',
+'\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\277', '\001', '\n', '\030', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c',
+'t', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', '\022', 'O', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_',
+'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005',
+'\212', '\001', '\002', '\020', '\001', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\037', '\n', '\013', 'r', 'u',
+'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K',
+'e', 'y', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c',
+'o', 'r', 'e', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c',
+'e', 'n', 't', '\"', 'U', '\n', '\014', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '\022', '\036', '\n', '\n', 'i', 'd',
+'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e',
+'r', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o',
+'r', 'e', '.', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'P', 'l', 'a', 'n', 'e', '*', '(', '\n', '\017', 'R', 'o', 'u', 't', 'i', 'n',
+'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', '\013', '\n', '\007', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\010', '\n',
+'\004', 'H', 'I', 'G', 'H', '\020', '\001', '*', '\211', '\001', '\n', '\r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'e', 't', 'h', 'o', 'd',
+'\022', '\026', '\n', '\022', 'M', 'E', 'T', 'H', 'O', 'D', '_', 'U', 'N', 'S', 'P', 'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022',
+'\007', '\n', '\003', 'G', 'E', 'T', '\020', '\001', '\022', '\010', '\n', '\004', 'H', 'E', 'A', 'D', '\020', '\002', '\022', '\010', '\n', '\004', 'P', 'O', 'S',
+'T', '\020', '\003', '\022', '\007', '\n', '\003', 'P', 'U', 'T', '\020', '\004', '\022', '\n', '\n', '\006', 'D', 'E', 'L', 'E', 'T', 'E', '\020', '\005', '\022',
+'\013', '\n', '\007', 'C', 'O', 'N', 'N', 'E', 'C', 'T', '\020', '\006', '\022', '\013', '\n', '\007', 'O', 'P', 'T', 'I', 'O', 'N', 'S', '\020', '\007',
+'\022', '\t', '\n', '\005', 'T', 'R', 'A', 'C', 'E', '\020', '\010', '\022', '\t', '\n', '\005', 'P', 'A', 'T', 'C', 'H', '\020', '\t', '*', '>', '\n',
+'\020', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\022', '\017', '\n', '\013', 'U', 'N', 'S', 'P',
+'E', 'C', 'I', 'F', 'I', 'E', 'D', '\020', '\000', '\022', '\013', '\n', '\007', 'I', 'N', 'B', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\014', '\n',
+'\010', 'O', 'U', 'T', 'B', 'O', 'U', 'N', 'D', '\020', '\002', 'B', '9', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
+'\t', 'B', 'a', 's', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[13] = {
+static upb_def_init *deps[15] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_backoff_proto_upbdefinit,
&envoy_config_core_v3_http_uri_proto_upbdefinit,
@@ -257,6 +245,8 @@ static upb_def_init *deps[13] = {
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &xds_core_v3_context_params_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -266,7 +256,7 @@ static upb_def_init *deps[13] = {
upb_def_init envoy_config_core_v3_base_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_base_proto_upb_file_layout,
"envoy/config/core/v3/base.proto",
- UPB_STRVIEW_INIT(descriptor, 4473)
+ UPB_STRVIEW_INIT(descriptor, 5228)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
index 4464edaf687..dd7ad08c2a5 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/base.upbdefs.h
@@ -41,6 +41,11 @@ UPB_INLINE const upb_msgdef *envoy_config_core_v3_Node_getmsgdef(upb_symtab *s)
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Node");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_Node_DynamicParametersEntry_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Node.DynamicParametersEntry");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_core_v3_Metadata_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Metadata");
@@ -51,6 +56,11 @@ UPB_INLINE const upb_msgdef *envoy_config_core_v3_Metadata_FilterMetadataEntry_g
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Metadata.FilterMetadataEntry");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Metadata.TypedFilterMetadataEntry");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeUInt32_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeUInt32");
@@ -71,6 +81,11 @@ UPB_INLINE const upb_msgdef *envoy_config_core_v3_RuntimeFeatureFlag_getmsgdef(u
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.RuntimeFeatureFlag");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_QueryParameter_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.QueryParameter");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_core_v3_HeaderValue_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_core_v3_base_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HeaderValue");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
index 6eb77098334..47f2ffdf6af 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/core/v3/config_source.upbdefs.h"
+#include "envoy/config/core/v3/config_source.upb.h"
extern upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
@@ -17,21 +18,7 @@ extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_ApiConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_AggregatedConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_SelfConfigSource_msginit;
-extern const upb_msglayout envoy_config_core_v3_RateLimitSettings_msginit;
-extern const upb_msglayout envoy_config_core_v3_ConfigSource_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_core_v3_ApiConfigSource_msginit,
- &envoy_config_core_v3_AggregatedConfigSource_msginit,
- &envoy_config_core_v3_SelfConfigSource_msginit,
- &envoy_config_core_v3_RateLimitSettings_msginit,
- &envoy_config_core_v3_ConfigSource_msginit,
-};
-
-static const char descriptor[2238] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
+static const char descriptor[2256] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r', 'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
@@ -115,12 +102,13 @@ static const char descriptor[2238] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', '
'\022', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'A', 'p', 'i', 'V', 'e', 'r', 's', 'i', 'o', 'n', ':', '%', '\232', '\305', '\210', '\036',
' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'C', 'o', 'n', 'f',
'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\036', '\n', '\027', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e',
-'_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '*', '.', '\n', '\n', 'A', 'p', 'i', 'V', 'e', 'r',
-'s', 'i', 'o', 'n', '\022', '\014', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\032', '\002', '\010', '\001', '\022', '\n', '\n', '\002', 'V', '2', '\020',
-'\001', '\032', '\002', '\010', '\001', '\022', '\006', '\n', '\002', 'V', '3', '\020', '\002', 'B', 'A', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y',
-'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', 'B', '\021', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '*', '@', '\n', '\n', 'A', 'p', 'i', 'V', 'e', 'r',
+'s', 'i', 'o', 'n', '\022', '\025', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\032', '\013', '\010', '\001', '\212', '\364', '\233', '\263', '\005', '\003', '3',
+'.', '0', '\022', '\023', '\n', '\002', 'V', '2', '\020', '\001', '\032', '\013', '\010', '\001', '\212', '\364', '\233', '\263', '\005', '\003', '3', '.', '0', '\022', '\006',
+'\n', '\002', 'V', '3', '\020', '\002', 'B', 'A', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\021', 'C', 'o', 'n', 'f',
+'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006',
+'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[9] = {
@@ -137,7 +125,7 @@ static upb_def_init *deps[9] = {
upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_config_source_proto_upb_file_layout,
"envoy/config/core/v3/config_source.proto",
- UPB_STRVIEW_INIT(descriptor, 2238)
+ UPB_STRVIEW_INIT(descriptor, 2256)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
index 3de56597c2d..c63d2eda829 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/event_service_config.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/core/v3/event_service_config.upbdefs.h"
+#include "envoy/config/core/v3/event_service_config.upb.h"
extern upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_EventServiceConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_EventServiceConfig_msginit,
-};
-
static const char descriptor[456] = {'\n', '/', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'v',
'e', 'n', 't', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022',
'\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\'', 'e', 'n',
@@ -50,7 +45,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_event_service_config_proto_upb_file_layout,
"envoy/config/core/v3/event_service_config.proto",
UPB_STRVIEW_INIT(descriptor, 456)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
index 3518a9a7291..599618ff9e6 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c
@@ -8,19 +8,12 @@
#include "upb/def.h"
#include "envoy/config/core/v3/extension.upbdefs.h"
+#include "envoy/config/core/v3/extension.upb.h"
extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
-extern const upb_msglayout envoy_config_core_v3_ExtensionConfigSource_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_core_v3_TypedExtensionConfig_msginit,
- &envoy_config_core_v3_ExtensionConfigSource_msginit,
-};
-
static const char descriptor[666] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x',
't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
@@ -60,7 +53,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_core_v3_extension_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_extension_proto_upb_file_layout,
"envoy/config/core/v3/extension.proto",
UPB_STRVIEW_INIT(descriptor, 666)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
index 17f95e90b61..44ce9fafd09 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/grpc_service.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/core/v3/grpc_service.upbdefs.h"
+#include "envoy/config/core/v3/grpc_service.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
@@ -19,38 +20,6 @@ extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit;
-
-static const upb_msglayout *layouts[14] = {
- &envoy_config_core_v3_GrpcService_msginit,
- &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit,
- &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_msginit,
-};
-
static const char descriptor[4684] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'g', 'r',
'p', 'c', '_', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
@@ -257,7 +226,7 @@ static upb_def_init *deps[11] = {
upb_def_init envoy_config_core_v3_grpc_service_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_grpc_service_proto_upb_file_layout,
"envoy/config/core/v3/grpc_service.proto",
UPB_STRVIEW_INIT(descriptor, 4684)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
index 469acd3f7a3..cac321a88d2 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/core/v3/health_check.upbdefs.h"
+#include "envoy/config/core/v3/health_check.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_event_service_config_proto_upbdefinit;
@@ -21,27 +22,7 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_Payload_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit;
-extern const upb_msglayout envoy_config_core_v3_HealthCheck_TlsOptions_msginit;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_core_v3_HealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_Payload_msginit,
- &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit,
- &envoy_config_core_v3_HealthCheck_TlsOptions_msginit,
-};
-
-static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e',
+static const char descriptor[4221] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e',
'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f',
'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '/', 'e', 'n',
@@ -58,7 +39,7 @@ static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's',
't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\306', '\033', '\n',
+'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\220', '\034', '\n',
'\013', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '?', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001',
' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\007', 't', 'i', 'm', 'e', 'o',
@@ -137,8 +118,8 @@ static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'\020', '\001', 'H', '\000', 'R', '\004', 't', 'e', 'x', 't', '\022', '\030', '\n', '\006', 'b', 'i', 'n', 'a', 'r', 'y', '\030', '\002', ' ', '\001', '(',
'\014', 'H', '\000', 'R', '\006', 'b', 'i', 'n', 'a', 'r', 'y', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y',
'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.',
-'P', 'a', 'y', 'l', 'o', 'a', 'd', 'B', '\016', '\n', '\007', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\022', '\003', '\370', 'B', '\001', '\032', '\340',
-'\005', '\n', '\017', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\037', '\n', '\004', 'h', 'o', 's',
+'P', 'a', 'y', 'l', 'o', 'a', 'd', 'B', '\016', '\n', '\007', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\022', '\003', '\370', 'B', '\001', '\032', '\252',
+'\006', '\n', '\017', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\037', '\n', '\004', 'h', 'o', 's',
't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\004', 'h', 'o', 's',
't', '\022', '!', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300',
'\001', '\002', '\310', '\001', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\003', ' ', '\001', '(', '\013',
@@ -156,57 +137,60 @@ static const char descriptor[4147] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e',
'\022', 'F', '\n', '\021', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\t', ' ', '\003',
'(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R',
-'a', 'n', 'g', 'e', 'R', '\020', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'T', '\n',
-'\021', 'c', 'o', 'd', 'e', 'c', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\n', ' ', '\001', '(', '\016', '2',
-'\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'C', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e',
-'n', 't', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'c', 'o', 'd', 'e', 'c', 'C', 'l',
-'i', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', 'V', '\n', '\024', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '_',
-'m', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\013', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
-'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'R', '\022', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '4', '\232', '\305',
-'\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
-'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm',
-'e', 'R', '\t', 'u', 's', 'e', '_', 'h', 't', 't', 'p', '2', '\032', '\311', '\001', '\n', '\016', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't',
-'h', 'C', 'h', 'e', 'c', 'k', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h',
-'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022', 'C', '\n', '\007', 'r', 'e',
-'c', 'e', 'i', 'v', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y',
-'l', 'o', 'a', 'd', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c',
-'k', '.', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '[', '\n', '\020', 'R', 'e', 'd', 'i', 's',
-'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R',
-'\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
-'.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'R', 'e', 'd', 'i', 's', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\225', '\001', '\n', '\017', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C',
-'h', 'e', 'c', 'k', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
-'\t', 'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i',
-'t', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\t', 'a', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c',
-'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\300', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a',
-'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '6', '\232', '\305',
-'\210', '\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e',
-'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006',
-'c', 'o', 'n', 'f', 'i', 'g', '\032', 'd', '\n', '\n', 'T', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\016', 'a',
-'l', 'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a',
-'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'l',
-'s', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'B', '\025', '\n', '\016',
-'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\n', '\020', '\013',
-'*', '`', '\n', '\014', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O',
-'W', 'N', '\020', '\000', '\022', '\013', '\n', '\007', 'H', 'E', 'A', 'L', 'T', 'H', 'Y', '\020', '\001', '\022', '\r', '\n', '\t', 'U', 'N', 'H', 'E',
-'A', 'L', 'T', 'H', 'Y', '\020', '\002', '\022', '\014', '\n', '\010', 'D', 'R', 'A', 'I', 'N', 'I', 'N', 'G', '\020', '\003', '\022', '\013', '\n', '\007',
-'T', 'I', 'M', 'E', 'O', 'U', 'T', '\020', '\004', '\022', '\014', '\n', '\010', 'D', 'E', 'G', 'R', 'A', 'D', 'E', 'D', '\020', '\005', 'B', '@',
-'\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\020', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'P',
-'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'a', 'n', 'g', 'e', 'R', '\020', 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'H', '\n',
+'\022', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'u', 's', 'e', 's', '\030', '\014', ' ', '\003', '(', '\013',
+'2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a', 'n',
+'g', 'e', 'R', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'e', 's', '\022', 'T', '\n', '\021',
+'c', 'o', 'd', 'e', 'c', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\n', ' ', '\001', '(', '\016', '2', '\036',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'C', 'o', 'd', 'e', 'c', 'C', 'l', 'i', 'e', 'n',
+'t', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\017', 'c', 'o', 'd', 'e', 'c', 'C', 'l', 'i',
+'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', 'V', '\n', '\024', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '_', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '\030', '\013', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
+'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'R', '\022', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '4', '\232', '\305', '\210',
+'\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a',
+'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'H', 't', 't', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'J',
+'\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e',
+'R', '\t', 'u', 's', 'e', '_', 'h', 't', 't', 'p', '2', '\032', '\311', '\001', '\n', '\016', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h',
+'C', 'h', 'e', 'c', 'k', '\022', '=', '\n', '\004', 's', 'e', 'n', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C',
+'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l', 'o', 'a', 'd', 'R', '\004', 's', 'e', 'n', 'd', '\022', 'C', '\n', '\007', 'r', 'e', 'c',
+'e', 'i', 'v', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'P', 'a', 'y', 'l',
+'o', 'a', 'd', 'R', '\007', 'r', 'e', 'c', 'e', 'i', 'v', 'e', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'.', 'T', 'c', 'p', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '[', '\n', '\020', 'R', 'e', 'd', 'i', 's', 'H',
+'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003',
+'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'R', 'e', 'd', 'i', 's', 'H', 'e', 'a',
+'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\225', '\001', '\n', '\017', 'G', 'r', 'p', 'c', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h',
+'e', 'c', 'k', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'i', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'R', '\013', 's', 'e', 'r', 'v', 'i', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't',
+'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\t', 'a', 'u', 't',
+'h', 'o', 'r', 'i', 't', 'y', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'G', 'r', 'p', 'c', 'H',
+'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '\032', '\300', '\001', '\n', '\021', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l',
+'t', 'h', 'C', 'h', 'e', 'c', 'k', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '6', '\232', '\305', '\210',
+'\036', '1', '\n', '/', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a',
+'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'C', 'u', 's', 't', 'o', 'm', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c',
+'k', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c',
+'o', 'n', 'f', 'i', 'g', '\032', 'd', '\n', '\n', 'T', 'l', 's', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\016', 'a', 'l',
+'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\001', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n', 'P',
+'r', 'o', 't', 'o', 'c', 'o', 'l', 's', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', '.', 'T', 'l', 's',
+'O', 'p', 't', 'i', 'o', 'n', 's', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'B', '\025', '\n', '\016', 'h',
+'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\n', '\020', '\013', '*',
+'`', '\n', '\014', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W',
+'N', '\020', '\000', '\022', '\013', '\n', '\007', 'H', 'E', 'A', 'L', 'T', 'H', 'Y', '\020', '\001', '\022', '\r', '\n', '\t', 'U', 'N', 'H', 'E', 'A',
+'L', 'T', 'H', 'Y', '\020', '\002', '\022', '\014', '\n', '\010', 'D', 'R', 'A', 'I', 'N', 'I', 'N', 'G', '\020', '\003', '\022', '\013', '\n', '\007', 'T',
+'I', 'M', 'E', 'O', 'U', 'T', '\020', '\004', '\022', '\014', '\n', '\010', 'D', 'E', 'G', 'R', 'A', 'D', 'E', 'D', '\020', '\005', 'B', '@', '\n',
+'\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\020', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'P', 'r',
+'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[13] = {
@@ -227,7 +211,7 @@ static upb_def_init *deps[13] = {
upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_health_check_proto_upb_file_layout,
"envoy/config/core/v3/health_check.proto",
- UPB_STRVIEW_INIT(descriptor, 4147)
+ UPB_STRVIEW_INIT(descriptor, 4221)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
index 3afce108f46..e7e9f56827f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/config/core/v3/http_uri.upbdefs.h"
+#include "envoy/config/core/v3/http_uri.upb.h"
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_HttpUri_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_HttpUri_msginit,
-};
-
static const char descriptor[454] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 't',
't', 'p', '_', 'u', 'r', 'i', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
@@ -50,7 +45,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_core_v3_http_uri_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_http_uri_proto_upb_file_layout,
"envoy/config/core/v3/http_uri.proto",
UPB_STRVIEW_INIT(descriptor, 454)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
index 0f1096b5641..26f9e1195fa 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c
@@ -8,215 +8,253 @@
#include "upb/def.h"
#include "envoy/config/core/v3/protocol.upbdefs.h"
+#include "envoy/config/core/v3/protocol.upb.h"
+extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_TcpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_HttpProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit;
-extern const upb_msglayout envoy_config_core_v3_KeepaliveSettings_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit;
-extern const upb_msglayout envoy_config_core_v3_GrpcProtocolOptions_msginit;
-extern const upb_msglayout envoy_config_core_v3_Http3ProtocolOptions_msginit;
-
-static const upb_msglayout *layouts[11] = {
- &envoy_config_core_v3_TcpProtocolOptions_msginit,
- &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit,
- &envoy_config_core_v3_HttpProtocolOptions_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit,
- &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit,
- &envoy_config_core_v3_KeepaliveSettings_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_msginit,
- &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit,
- &envoy_config_core_v3_GrpcProtocolOptions_msginit,
- &envoy_config_core_v3_Http3ProtocolOptions_msginit,
-};
-
-static const char descriptor[4229] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
+static const char descriptor[5660] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/',
-'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
-'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'A', '\n', '\022', 'T', 'c', 'p',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'T', 'c', 'p', 'P', 'r', 'o', 't', 'o',
-'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\236', '\001', '\n', '\033', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't',
-'t', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\031', '\n', '\010', 'a', 'u', 't', 'o',
-'_', 's', 'n', 'i', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\007', 'a', 'u', 't', 'o', 'S', 'n', 'i', '\022', '.', '\n', '\023', 'a', 'u',
-'t', 'o', '_', 's', 'a', 'n', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\021',
-'a', 'u', 't', 'o', 'S', 'a', 'n', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', ':', '4', '\232', '\305', '\210', '\036', '/', '\n',
-'-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'U', 'p', 's', 't', 'r', 'e',
-'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\322', '\004', '\n',
-'\023', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'i',
-'d', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e',
-'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Q', '\n', '\027', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\025', 'm', 'a', 'x', 'C', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'Q', '\n', '\021', 'm', 'a', 'x', '_', 'h', 'e',
-'a', 'd', 'e', 'r', 's', '_', 'c', 'o', 'u', 'n', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372',
-'B', '\004', '*', '\002', '(', '\001', 'R', '\017', 'm', 'a', 'x', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'C', 'o', 'u', 'n', 't', '\022', 'I',
-'\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e',
+'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#',
+'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
+'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\"', 'A', '\n', '\022', 'T', 'c', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '+',
+'\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
+'T', 'c', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\303', '\002', '\n', '\023', 'Q', 'u',
+'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'R', '\n', '\026', 'm', 'a', 'x', '_',
+'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a', 'm', 's', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'R', '\024', 'm', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm',
+'s', '\022', 'g', '\n', '\032', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o',
+'w', '_', 's', 'i', 'z', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\014', '\372', 'B', '\t', '*', '\007', '\030',
+'\200', '\200', '\200', '\010', '(', '\001', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W', 'i', 'n', 'd',
+'o', 'w', 'S', 'i', 'z', 'e', '\022', 'o', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'B', '\014', '\372', 'B', '\t', '*', '\007', '\030', '\200', '\200', '\200', '\014', '(', '\001', 'R', '\033', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\"', '\344', '\001', '\n', '\033', 'U',
+'p', 's', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '\031', '\n', '\010', 'a', 'u', 't', 'o', '_', 's', 'n', 'i', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\007', 'a', 'u', 't', 'o',
+'S', 'n', 'i', '\022', '.', '\n', '\023', 'a', 'u', 't', 'o', '_', 's', 'a', 'n', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
+'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\021', 'a', 'u', 't', 'o', 'S', 'a', 'n', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
+'n', '\022', 'D', '\n', '\030', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 'a', 'u', 't', 'o', '_', 's', 'n', 'i', '_', 'h', 'e',
+'a', 'd', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\320', '\001', '\001', 'R', '\025',
+'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'A', 'u', 't', 'o', 'S', 'n', 'i', 'H', 'e', 'a', 'd', 'e', 'r', ':', '4', '\232', '\305',
+'\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'U', 'p',
+'s', 't', 'r', 'e', 'a', 'm', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'\"', '\346', '\001', '\n', '\036', 'A', 'l', 't', 'e', 'r', 'n', 'a', 't', 'e', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', 'C', 'a',
+'c', 'h', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'F', '\n', '\013', 'm', 'a', 'x', '_', 'e', 'n', 't',
+'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', ' ', '\000', 'R',
+'\n', 'm', 'a', 'x', 'E', 'n', 't', 'r', 'i', 'e', 's', '\022', '_', '\n', '\026', 'k', 'e', 'y', '_', 'v', 'a', 'l', 'u', 'e', '_',
+'s', 't', 'o', 'r', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'k', 'e', 'y', 'V', 'a', 'l', 'u', 'e', 'S', 't', 'o',
+'r', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\257', '\005', '\n', '\023', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
+'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
+'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'Q', '\n', '\027', 'm', 'a',
+'x', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001',
'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\215',
-'\001', '\n', '\037', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'w', 'i', 't', 'h', '_', 'u', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r',
-'e', 's', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\005', ' ', '\001', '(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o',
-'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r',
-'s', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\034', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h',
-'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'N', '\n', '\034', 'H', 'e', 'a', 'd',
-'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022',
-'\t', '\n', '\005', 'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\022', '\n', '\016', 'R', 'E', 'J', 'E', 'C', 'T', '_', 'R', 'E', 'Q', 'U',
-'E', 'S', 'T', '\020', '\001', '\022', '\017', '\n', '\013', 'D', 'R', 'O', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '\020', '\002', ':', ',', '\232',
-'\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H',
-'t', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\361', '\006', '\n', '\024', 'H', 't',
-'t', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'H', '\n', '\022', 'a', 'l', 'l',
-'o', 'w', '_', 'a', 'b', 's', 'o', 'l', 'u', 't', 'e', '_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R',
-'\020', 'a', 'l', 'l', 'o', 'w', 'A', 'b', 's', 'o', 'l', 'u', 't', 'e', 'U', 'r', 'l', '\022', '$', '\n', '\016', 'a', 'c', 'c', 'e',
-'p', 't', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\014', 'a', 'c', 'c', 'e', 'p', 't', 'H',
-'t', 't', 'p', '1', '0', '\022', '6', '\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'h', 'o', 's', 't', '_', 'f', 'o', 'r',
-'_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'H', 'o',
-'s', 't', 'F', 'o', 'r', 'H', 't', 't', 'p', '1', '0', '\022', 'f', '\n', '\021', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'k', 'e', 'y',
-'_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'R', '\017',
-'h', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\'', '\n', '\017', 'e', 'n', 'a', 'b', 'l', 'e',
-'_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\016', 'e', 'n', 'a', 'b', 'l', 'e', 'T', 'r',
-'a', 'i', 'l', 'e', 'r', 's', '\022', '0', '\n', '\024', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'h', 'u', 'n', 'k', 'e', 'd', '_', 'l',
-'e', 'n', 'g', 't', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l', 'o', 'w', 'C', 'h', 'u', 'n', 'k', 'e', 'd',
-'L', 'e', 'n', 'g', 't', 'h', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm',
-'_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e',
-'s', 's', 'a', 'g', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S',
-'t', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e',
-'s', 's', 'a', 'g', 'e', '\032', '\302', '\002', '\n', '\017', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't',
-'\022', 'x', '\n', '\021', 'p', 'r', 'o', 'p', 'e', 'r', '_', 'c', 'a', 's', 'e', '_', 'w', 'o', 'r', 'd', 's', '\030', '\001', ' ', '\001',
-'(', '\013', '2', 'J', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a',
-'d', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o',
-'r', 'd', 's', 'H', '\000', 'R', '\017', 'p', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', '\032', '`', '\n',
-'\017', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', 'M', '\232', '\305', '\210', '\036', 'H', '\n', 'F',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o',
-'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', '=', '\232', '\305', '\210',
-'\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't',
-'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K',
-'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\024', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'f', 'o', 'r', 'm', 'a', 't',
-'\022', '\003', '\370', 'B', '\001', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', '\"', '\340', '\001', '\n', '\021', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022',
-'E', '\n', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252',
-'\001', '\010', '\010', '\001', '2', '\004', '\020', '\300', '\204', '=', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'C', '\n', '\007', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '2',
-'\004', '\020', '\300', '\204', '=', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '?', '\n', '\017', 'i', 'n', 't', 'e', 'r', 'v', 'a',
-'l', '_', 'j', 'i', 't', 't', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i',
-'t', 't', 'e', 'r', '\"', '\370', '\r', '\n', '\024', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't',
-'i', 'o', 'n', 's', '\022', 'F', '\n', '\020', 'h', 'p', 'a', 'c', 'k', '_', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'h', 'p', 'a', 'c', 'k', 'T', 'a', 'b', 'l', 'e', 'S', 'i', 'z',
-'e', '\022', 'a', '\n', '\026', 'm', 'a', 'x', '_', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a',
-'m', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\r', '\372', 'B', '\n', '*', '\010', '\030', '\377', '\377', '\377', '\377',
-'\007', '(', '\001', 'R', '\024', 'm', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 's',
-'\022', 'j', '\n', '\032', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o', 'w',
-'_', 's', 'i', 'z', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377',
-'\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W', 'i',
-'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022', 'r', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a',
-'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377', '\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\033', 'i', 'n', 'i',
-'t', 'i', 'a', 'l', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022',
-'#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\014', 'a',
-'l', 'l', 'o', 'w', 'C', 'o', 'n', 'n', 'e', 'c', 't', '\022', '%', '\n', '\016', 'a', 'l', 'l', 'o', 'w', '_', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\r', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'\022', 'U', '\n', '\023', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\007',
+'t', 'i', 'o', 'n', 'R', '\025', 'm', 'a', 'x', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '\022', 'Q', '\n', '\021', 'm', 'a', 'x', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'c', 'o', 'u', 'n', 't', '\030', '\002',
' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\021', 'm', 'a', 'x', 'O', 'u',
-'t', 'b', 'o', 'u', 'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', '\022', 'd', '\n', '\033', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o',
-'u', 'n', 'd', '_', 'c', 'o', 'n', 't', 'r', 'o', 'l', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\010', ' ', '\001', '(', '\013', '2',
-'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
-'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\030', 'm', 'a', 'x', 'O', 'u', 't', 'b', 'o', 'u', 'n',
-'d', 'C', 'o', 'n', 't', 'r', 'o', 'l', 'F', 'r', 'a', 'm', 'e', 's', '\022', '\204', '\001', '\n', '1', 'm', 'a', 'x', '_', 'c', 'o',
-'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '_',
-'w', 'i', 't', 'h', '_', 'e', 'm', 'p', 't', 'y', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\030', '\t', ' ', '\001', '(', '\013', '2',
-'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
-'a', 'l', 'u', 'e', 'R', '+', 'm', 'a', 'x', 'C', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', 'I', 'n', 'b', 'o', 'u',
-'n', 'd', 'F', 'r', 'a', 'm', 'e', 's', 'W', 'i', 't', 'h', 'E', 'm', 'p', 't', 'y', 'P', 'a', 'y', 'l', 'o', 'a', 'd', '\022',
-'o', '\n', '&', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '_', 'f',
-'r', 'a', 'm', 'e', 's', '_', 'p', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', '\030', '\n', ' ', '\001', '(', '\013', '2', '\034', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
-'u', 'e', 'R', '!', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'F', 'r', 'a',
-'m', 'e', 's', 'P', 'e', 'r', 'S', 't', 'r', 'e', 'a', 'm', '\022', '\221', '\001', '\n', '4', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o',
-'u', 'n', 'd', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's', '_',
-'p', 'e', 'r', '_', 'd', 'a', 't', 'a', '_', 'f', 'r', 'a', 'm', 'e', '_', 's', 'e', 'n', 't', '\030', '\013', ' ', '\001', '(', '\013',
+'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\017', 'm', 'a', 'x', 'H', 'e',
+'a', 'd', 'e', 'r', 's', 'C', 'o', 'u', 'n', 't', '\022', 'I', '\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_',
+'d', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e',
+'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\215', '\001', '\n', '\037', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'w', 'i',
+'t', 'h', '_', 'u', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\005', ' ', '\001',
+'(', '\016', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd',
+'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', 'R',
+'\034', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c',
+'t', 'i', 'o', 'n', '\022', '[', '\n', '\033', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '_', 'p', 'e', 'r', '_',
+'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\030', 'm', 'a',
+'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', 'P', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '\"', 'N', '\n',
+'\034', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'W', 'i', 't', 'h', 'U', 'n', 'd', 'e', 'r', 's', 'c', 'o', 'r', 'e', 's', 'A', 'c',
+'t', 'i', 'o', 'n', '\022', '\t', '\n', '\005', 'A', 'L', 'L', 'O', 'W', '\020', '\000', '\022', '\022', '\n', '\016', 'R', 'E', 'J', 'E', 'C', 'T',
+'_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020', '\001', '\022', '\017', '\n', '\013', 'D', 'R', 'O', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R',
+'\020', '\002', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c',
+'o', 'r', 'e', '.', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\316',
+'\007', '\n', '\024', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'H',
+'\n', '\022', 'a', 'l', 'l', 'o', 'w', '_', 'a', 'b', 's', 'o', 'l', 'u', 't', 'e', '_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V',
+'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l', 'o', 'w', 'A', 'b', 's', 'o', 'l', 'u', 't', 'e', 'U', 'r', 'l', '\022', '$', '\n',
+'\016', 'a', 'c', 'c', 'e', 'p', 't', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\014', 'a', 'c',
+'c', 'e', 'p', 't', 'H', 't', 't', 'p', '1', '0', '\022', '6', '\n', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'h', 'o', 's',
+'t', '_', 'f', 'o', 'r', '_', 'h', 't', 't', 'p', '_', '1', '0', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\024', 'd', 'e', 'f', 'a',
+'u', 'l', 't', 'H', 'o', 's', 't', 'F', 'o', 'r', 'H', 't', 't', 'p', '1', '0', '\022', 'f', '\n', '\021', 'h', 'e', 'a', 'd', 'e',
+'r', '_', 'k', 'e', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r',
+'m', 'a', 't', 'R', '\017', 'h', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\'', '\n', '\017', 'e',
+'n', 'a', 'b', 'l', 'e', '_', 't', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\016', 'e', 'n', 'a',
+'b', 'l', 'e', 'T', 'r', 'a', 'i', 'l', 'e', 'r', 's', '\022', '0', '\n', '\024', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'h', 'u', 'n',
+'k', 'e', 'd', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l', 'o', 'w', 'C', 'h',
+'u', 'n', 'k', 'e', 'd', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's',
+'t', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't',
+'t', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r',
+'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H',
+'t', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e', '\032', '\237', '\003', '\n', '\017', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F',
+'o', 'r', 'm', 'a', 't', '\022', 'x', '\n', '\021', 'p', 'r', 'o', 'p', 'e', 'r', '_', 'c', 'a', 's', 'e', '_', 'w', 'o', 'r', 'd',
+'s', '\030', '\001', ' ', '\001', '(', '\013', '2', 'J', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
+'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm', 'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C',
+'a', 's', 'e', 'W', 'o', 'r', 'd', 's', 'H', '\000', 'R', '\017', 'p', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r',
+'d', 's', '\022', '[', '\n', '\022', 's', 't', 'a', 't', 'e', 'f', 'u', 'l', '_', 'f', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', '\030',
+'\010', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H',
+'\000', 'R', '\021', 's', 't', 'a', 't', 'e', 'f', 'u', 'l', 'F', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', '\032', '`', '\n', '\017', 'P',
+'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', 'M', '\232', '\305', '\210', '\036', 'H', '\n', 'F', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y', 'F', 'o', 'r', 'm',
+'a', 't', '.', 'P', 'r', 'o', 'p', 'e', 'r', 'C', 'a', 's', 'e', 'W', 'o', 'r', 'd', 's', ':', '=', '\232', '\305', '\210', '\036', '8',
+'\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1',
+'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'K', 'e', 'y',
+'F', 'o', 'r', 'm', 'a', 't', 'B', '\024', '\n', '\r', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'f', 'o', 'r', 'm', 'a', 't', '\022', '\003',
+'\370', 'B', '\001', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'\"', '\301', '\002', '\n', '\021', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', '\022', 'C', '\n',
+'\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006',
+'2', '\004', '\020', '\300', '\204', '=', 'R', '\010', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'C', '\n', '\007', 't', 'i', 'm', 'e', 'o',
+'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\016', '\372', 'B', '\013', '\252', '\001', '\010', '\010', '\001', '2', '\004', '\020', '\300', '\204',
+'=', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '?', '\n', '\017', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '_', 'j', 'i',
+'t', 't', 'e', 'r', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v',
+'3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', 'J', 'i', 't', 't', 'e', 'r',
+'\022', 'a', '\n', '\030', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'i', 'd', 'l', 'e', '_', 'i', 'n', 't', 'e', 'r',
+'v', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\014', '\372', 'B', '\t', '\252', '\001', '\006', '2', '\004', '\020', '\300', '\204', '=',
+'R', '\026', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'I', 'd', 'l', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\"',
+'\201', '\016', '\n', '\024', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'F', '\n', '\020', 'h', 'p', 'a', 'c', 'k', '_', 't', 'a', 'b', 'l', 'e', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013',
'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
-'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', ',', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n',
-'d', 'W', 'i', 'n', 'd', 'o', 'w', 'U', 'p', 'd', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 's', 'P', 'e', 'r', 'D', 'a', 't',
-'a', 'F', 'r', 'a', 'm', 'e', 'S', 'e', 'n', 't', '\022', 'U', '\n', '&', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o',
-'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'i',
-'n', 'g', '\030', '\014', ' ', '\001', '(', '\010', 'B', '\002', '\030', '\001', 'R', '!', 's', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r',
-'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'i', 'n', 'g', '\022', 'z', '\n',
-'-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n',
-'_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '\016', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o',
-'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e', '\022', 'z', '\n', '\032',
-'c', 'u', 's', 't', 'o', 'm', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
-'s', '\030', '\r', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'R', '\030', 'c', 'u', 's', 't',
-'o', 'm', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', 'Z', '\n', '\024', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\017', ' ', '\001', '(', '\013',
-'2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'K',
-'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\023', 'c', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\032', '\345', '\001', '\n', '\021', 'S', 'e', 't', 't', 'i', 'n', 'g', 's',
-'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', 'Q', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\000', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\022', '<', '\n', '\005', 'v', 'a', 'l', 'u',
-'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v',
-'a', 'l', 'u', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
-'.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ':', '-', '\232', '\305', '\210', '\036',
-'(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p',
-'2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\245', '\001', '\n', '\023', 'G', 'r', 'p', 'c',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '`', '\n', '\026', 'h', 't', 't', 'p', '2', '_',
-'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p',
-'2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n', '%', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c',
-'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\026', '\n', '\024', 'H', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o',
-'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '=', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'V', 'a', 'l', 'u', 'e', 'R', '\016', 'h', 'p', 'a', 'c', 'k', 'T', 'a', 'b', 'l', 'e', 'S', 'i', 'z', 'e', '\022', 'a', '\n', '\026',
+'m', 'a', 'x', '_', 'c', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 's', 't', 'r', 'e', 'a', 'm', 's', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
+'t', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\r', '\372', 'B', '\n', '*', '\010', '\030', '\377', '\377', '\377', '\377', '\007', '(', '\001', 'R', '\024',
+'m', 'a', 'x', 'C', 'o', 'n', 'c', 'u', 'r', 'r', 'e', 'n', 't', 'S', 't', 'r', 'e', 'a', 'm', 's', '\022', 'j', '\n', '\032', 'i',
+'n', 'i', 't', 'i', 'a', 'l', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '*', '\n', '\030', '\377', '\377', '\377', '\377', '\007', '(',
+'\377', '\377', '\003', 'R', '\027', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'S', 't', 'r', 'e', 'a', 'm', 'W', 'i', 'n', 'd', 'o', 'w', 'S',
+'i', 'z', 'e', '\022', 'r', '\n', '\036', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'w', 'i', 'n', 'd', 'o', 'w', '_', 's', 'i', 'z', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\017',
+'\372', 'B', '\014', '*', '\n', '\030', '\377', '\377', '\377', '\377', '\007', '(', '\377', '\377', '\003', 'R', '\033', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'W', 'i', 'n', 'd', 'o', 'w', 'S', 'i', 'z', 'e', '\022', '#', '\n', '\r', 'a', 'l',
+'l', 'o', 'w', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\014', 'a', 'l', 'l', 'o', 'w', 'C',
+'o', 'n', 'n', 'e', 'c', 't', '\022', '%', '\n', '\016', 'a', 'l', 'l', 'o', 'w', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030',
+'\006', ' ', '\001', '(', '\010', 'R', '\r', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'U', '\n', '\023', 'm',
+'a', 'x', '_', 'o', 'u', 't', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\007', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\021', 'm', 'a', 'x', 'O', 'u', 't', 'b', 'o', 'u', 'n',
+'d', 'F', 'r', 'a', 'm', 'e', 's', '\022', 'd', '\n', '\033', 'm', 'a', 'x', '_', 'o', 'u', 't', 'b', 'o', 'u', 'n', 'd', '_', 'c',
+'o', 'n', 't', 'r', 'o', 'l', '_', 'f', 'r', 'a', 'm', 'e', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B',
+'\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\030', 'm', 'a', 'x', 'O', 'u', 't', 'b', 'o', 'u', 'n', 'd', 'C', 'o', 'n', 't',
+'r', 'o', 'l', 'F', 'r', 'a', 'm', 'e', 's', '\022', '\204', '\001', '\n', '1', 'm', 'a', 'x', '_', 'c', 'o', 'n', 's', 'e', 'c', 'u',
+'t', 'i', 'v', 'e', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'f', 'r', 'a', 'm', 'e', 's', '_', 'w', 'i', 't', 'h', '_',
+'e', 'm', 'p', 't', 'y', '_', 'p', 'a', 'y', 'l', 'o', 'a', 'd', '\030', '\t', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R',
+'+', 'm', 'a', 'x', 'C', 'o', 'n', 's', 'e', 'c', 'u', 't', 'i', 'v', 'e', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'F', 'r', 'a',
+'m', 'e', 's', 'W', 'i', 't', 'h', 'E', 'm', 'p', 't', 'y', 'P', 'a', 'y', 'l', 'o', 'a', 'd', '\022', 'o', '\n', '&', 'm', 'a',
+'x', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '_', 'f', 'r', 'a', 'm', 'e', 's',
+'_', 'p', 'e', 'r', '_', 's', 't', 'r', 'e', 'a', 'm', '\030', '\n', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '!', 'm',
+'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'F', 'r', 'a', 'm', 'e', 's', 'P', 'e',
+'r', 'S', 't', 'r', 'e', 'a', 'm', '\022', '\221', '\001', '\n', '4', 'm', 'a', 'x', '_', 'i', 'n', 'b', 'o', 'u', 'n', 'd', '_', 'w',
+'i', 'n', 'd', 'o', 'w', '_', 'u', 'p', 'd', 'a', 't', 'e', '_', 'f', 'r', 'a', 'm', 'e', 's', '_', 'p', 'e', 'r', '_', 'd',
+'a', 't', 'a', '_', 'f', 'r', 'a', 'm', 'e', '_', 's', 'e', 'n', 't', '\030', '\013', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e',
+'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', ',', 'm', 'a', 'x', 'I', 'n', 'b', 'o', 'u', 'n', 'd', 'W', 'i', 'n', 'd',
+'o', 'w', 'U', 'p', 'd', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 's', 'P', 'e', 'r', 'D', 'a', 't', 'a', 'F', 'r', 'a', 'm',
+'e', 'S', 'e', 'n', 't', '\022', '^', '\n', '&', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_',
+'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'i', 'n', 'g', '\030', '\014', ' ',
+'\001', '(', '\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '!', 's', 't', 'r', 'e', 'a', 'm', 'E',
+'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'i', 'n',
+'g', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o',
+'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e',
+'\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'S', 't', 'r', 'e', 'a', 'm',
+'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a', 'g', 'e',
+'\022', 'z', '\n', '\032', 'c', 'u', 's', 't', 'o', 'm', '_', 's', 'e', 't', 't', 'i', 'n', 'g', 's', '_', 'p', 'a', 'r', 'a', 'm',
+'e', 't', 'e', 'r', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'R', '\030',
+'c', 'u', 's', 't', 'o', 'm', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022',
+'Z', '\n', '\024', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'k', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\030', '\017',
+' ', '\001', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'R', '\023', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'K', 'e', 'e', 'p', 'a', 'l', 'i', 'v', 'e', '\032', '\345', '\001', '\n', '\021', 'S', 'e', 't', 't',
+'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', 'Q', '\n', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i',
+'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(',
+'\000', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\n', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\022', '<', '\n', '\005',
+'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020',
+'\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', '.', 'S', 'e', 't', 't', 'i', 'n', 'g', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ':', '-',
+'\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.',
+'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\245', '\001', '\n', '\023',
+'G', 'r', 'p', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '`', '\n', '\026', 'h', 't',
+'t', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\024', 'h', 't', 't',
+'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ',', '\232', '\305', '\210', '\036', '\'', '\n',
+'%', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'c', 'o', 'r', 'e', '.', 'G', 'r', 'p', 'c', 'P', 'r',
+'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\"', '\261', '\002', '\n', '\024', 'H', 't', 't', 'p', '3', 'P', 'r',
+'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\025', 'q', 'u', 'i', 'c', '_', 'p', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\023', 'q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o',
+'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'z', '\n', '-', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 't', 'r', 'e',
+'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't', 't', 'p', '_',
+'m', 'e', 's', 's', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\'', 'o', 'v', 'e', 'r', 'r', 'i', 'd',
+'e', 'S', 't', 'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p',
+'M', 'e', 's', 's', 'a', 'g', 'e', '\022', '>', '\n', '\026', 'a', 'l', 'l', 'o', 'w', '_', 'e', 'x', 't', 'e', 'n', 'd', 'e', 'd',
+'_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '\030', '\005', ' ', '\001', '(', '\010', 'B', '\010', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'R',
+'\024', 'a', 'l', 'l', 'o', 'w', 'E', 'x', 't', 'e', 'n', 'd', 'e', 'd', 'C', 'o', 'n', 'n', 'e', 'c', 't', '\"', 't', '\n', '\032',
+'S', 'c', 'h', 'e', 'm', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
+'n', '\022', 'D', '\n', '\023', 's', 'c', 'h', 'e', 'm', 'e', '_', 't', 'o', '_', 'o', 'v', 'e', 'r', 'w', 'r', 'i', 't', 'e', '\030',
+'\001', ' ', '\001', '(', '\t', 'B', '\022', '\372', 'B', '\017', 'r', '\r', 'R', '\004', 'h', 't', 't', 'p', 'R', '\005', 'h', 't', 't', 'p', 's',
+'H', '\000', 'R', '\021', 's', 'c', 'h', 'e', 'm', 'e', 'T', 'o', 'O', 'v', 'e', 'r', 'w', 'r', 'i', 't', 'e', 'B', '\020', '\n', '\016',
+'t', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'B', '=', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', 'B', '\r', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[7] = {
+static upb_def_init *deps[10] = {
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
@@ -225,7 +263,7 @@ static upb_def_init *deps[7] = {
upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_protocol_proto_upb_file_layout,
"envoy/config/core/v3/protocol.proto",
- UPB_STRVIEW_INIT(descriptor, 4229)
+ UPB_STRVIEW_INIT(descriptor, 5660)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
index ddc54578dfa..df29eb31b2b 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.h
@@ -26,11 +26,21 @@ UPB_INLINE const upb_msgdef *envoy_config_core_v3_TcpProtocolOptions_getmsgdef(u
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.TcpProtocolOptions");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_QuicProtocolOptions_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.QuicProtocolOptions");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_core_v3_UpstreamHttpProtocolOptions_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.UpstreamHttpProtocolOptions");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_AlternateProtocolsCacheOptions_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.AlternateProtocolsCacheOptions");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_core_v3_HttpProtocolOptions_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.HttpProtocolOptions");
@@ -76,6 +86,11 @@ UPB_INLINE const upb_msgdef *envoy_config_core_v3_Http3ProtocolOptions_getmsgdef
return upb_symtab_lookupmsg(s, "envoy.config.core.v3.Http3ProtocolOptions");
}
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_SchemeHeaderTransformation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_protocol_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.SchemeHeaderTransformation");
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
index f1c19dc7557..f070a49c89b 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c
@@ -8,14 +8,9 @@
#include "upb/def.h"
#include "envoy/config/core/v3/proxy_protocol.upbdefs.h"
+#include "envoy/config/core/v3/proxy_protocol.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_ProxyProtocolConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_ProxyProtocolConfig_msginit,
-};
-
static const char descriptor[299] = {'\n', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r',
'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y',
'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
@@ -37,7 +32,7 @@ static upb_def_init *deps[2] = {
upb_def_init envoy_config_core_v3_proxy_protocol_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_proxy_protocol_proto_upb_file_layout,
"envoy/config/core/v3/proxy_protocol.proto",
UPB_STRVIEW_INIT(descriptor, 299)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
new file mode 100644
index 00000000000..1236cd5dedd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c
@@ -0,0 +1,52 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/core/v3/resolver.upbdefs.h"
+#include "envoy/config/core/v3/resolver.upb.h"
+
+extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
+extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init validate_validate_proto_upbdefinit;
+static const char descriptor[543] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'l', 'v', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't',
+'o', '\"', '\203', '\001', '\n', '\022', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'4', '\n', '\027', 'u', 's', 'e', '_', 't', 'c', 'p', '_', 'f', 'o', 'r', '_', 'd', 'n', 's', '_', 'l', 'o', 'o', 'k', 'u', 'p',
+'s', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\023', 'u', 's', 'e', 'T', 'c', 'p', 'F', 'o', 'r', 'D', 'n', 's', 'L', 'o', 'o', 'k',
+'u', 'p', 's', '\022', '7', '\n', '\030', 'n', 'o', '_', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 's', 'e', 'a', 'r', 'c', 'h', '_',
+'d', 'o', 'm', 'a', 'i', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\025', 'n', 'o', 'D', 'e', 'f', 'a', 'u', 'l', 't', 'S', 'e',
+'a', 'r', 'c', 'h', 'D', 'o', 'm', 'a', 'i', 'n', '\"', '\270', '\001', '\n', '\023', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'u', 't',
+'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\t', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', 's', '\030', '\001', ' ',
+'\003', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'r', 'e', 's', 'o',
+'l', 'v', 'e', 'r', 's', '\022', 'Z', '\n', '\024', 'd', 'n', 's', '_', 'r', 'e', 's', 'o', 'l', 'v', 'e', 'r', '_', 'o', 'p', 't',
+'i', 'o', 'n', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o',
+'n', 's', 'R', '\022', 'd', 'n', 's', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '=', '\n',
+'\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'R', 'e', 's', 'o', 'l', 'v', 'e', 'r', 'P', 'r', 'o', 't', 'o',
+'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[4] = {
+ &envoy_config_core_v3_address_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init envoy_config_core_v3_resolver_proto_upbdefinit = {
+ deps,
+ &envoy_config_core_v3_resolver_proto_upb_file_layout,
+ "envoy/config/core/v3/resolver.proto",
+ UPB_STRVIEW_INIT(descriptor, 543)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h
new file mode 100644
index 00000000000..67999d49b54
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.h
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/resolver.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init envoy_config_core_v3_resolver_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_DnsResolverOptions_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_resolver_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.DnsResolverOptions");
+}
+
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_DnsResolutionConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_resolver_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.DnsResolutionConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_RESOLVER_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
index 1ea0575c947..51e8731fad3 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c
@@ -8,16 +8,11 @@
#include "upb/def.h"
#include "envoy/config/core/v3/socket_option.upbdefs.h"
+#include "envoy/config/core/v3/socket_option.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_SocketOption_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_SocketOption_msginit,
-};
-
static const char descriptor[590] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o',
'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
@@ -53,7 +48,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_socket_option_proto_upb_file_layout,
"envoy/config/core/v3/socket_option.proto",
UPB_STRVIEW_INIT(descriptor, 590)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
index 82062b6692b..2b274b4f8c6 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c
@@ -8,53 +8,52 @@
#include "upb/def.h"
#include "envoy/config/core/v3/substitution_format_string.upbdefs.h"
+#include "envoy/config/core/v3/substitution_format_string.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init google_protobuf_struct_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_core_v3_SubstitutionFormatString_msginit,
-};
-
-static const char descriptor[711] = {'\n', '5', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'u',
+static const char descriptor[757] = {'\n', '5', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'u',
'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 't', 'r', 'i', 'n', 'g', '.',
'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034',
'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\203', '\003', '\n', '\030', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o',
-'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', '\022', '%', '\n', '\013', 't', 'e', 'x', 't', '_', 'f', 'o', 'r',
-'m', 'a', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\002', '\030', '\001', 'H', '\000', 'R', '\n', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm',
-'a', 't', '\022', 'D', '\n', '\013', 'j', 's', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'B', '\010',
-'\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\n', 'j', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'P', '\n',
-'\022', 't', 'e', 'x', 't', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\005', ' ', '\001', '(', '\013',
-'2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D',
-'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\020', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', 'S', 'o',
-'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'o', 'm', 'i', 't', '_', 'e', 'm', 'p', 't', 'y', '_', 'v', 'a', 'l', 'u', 'e', 's',
-'\030', '\003', ' ', '\001', '(', '\010', 'R', '\017', 'o', 'm', 'i', 't', 'E', 'm', 'p', 't', 'y', 'V', 'a', 'l', 'u', 'e', 's', '\022', '!',
-'\n', '\014', 'c', 'o', 'n', 't', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\013', 'c', 'o', 'n',
-'t', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', 'J', '\n', '\n', 'f', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', '\030', '\006', ' ',
-'\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'f',
-'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', 'B', '\r', '\n', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\022', '\003', '\370', 'B', '\001', 'B',
-'M', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\035', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o',
-'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006',
-'\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e',
+'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\214', '\003', '\n',
+'\030', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g',
+'\022', '.', '\n', '\013', 't', 'e', 'x', 't', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001',
+'\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\n', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'D',
+'\n', '\013', 'j', 's', 'o', 'n', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'B', '\010', '\372', 'B', '\005', '\212',
+'\001', '\002', '\020', '\001', 'H', '\000', 'R', '\n', 'j', 's', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'P', '\n', '\022', 't', 'e', 'x',
+'t', '_', 'f', 'o', 'r', 'm', 'a', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S',
+'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\020', 't', 'e', 'x', 't', 'F', 'o', 'r', 'm', 'a', 't', 'S', 'o', 'u', 'r', 'c', 'e',
+'\022', '*', '\n', '\021', 'o', 'm', 'i', 't', '_', 'e', 'm', 'p', 't', 'y', '_', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\003', ' ', '\001',
+'(', '\010', 'R', '\017', 'o', 'm', 'i', 't', 'E', 'm', 'p', 't', 'y', 'V', 'a', 'l', 'u', 'e', 's', '\022', '!', '\n', '\014', 'c', 'o',
+'n', 't', 'e', 'n', 't', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\013', 'c', 'o', 'n', 't', 'e', 'n', 't',
+'T', 'y', 'p', 'e', '\022', 'J', '\n', '\n', 'f', 'o', 'r', 'm', 'a', 't', 't', 'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'f', 'o', 'r', 'm', 'a',
+'t', 't', 'e', 'r', 's', 'B', '\r', '\n', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\022', '\003', '\370', 'B', '\001', 'B', 'M', '\n', '\"', 'i',
+'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\035', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r',
+'m', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[6] = {
+static upb_def_init *deps[7] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
@@ -62,7 +61,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_config_core_v3_substitution_format_string_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_core_v3_substitution_format_string_proto_upb_file_layout,
"envoy/config/core/v3/substitution_format_string.proto",
- UPB_STRVIEW_INIT(descriptor, 711)
+ UPB_STRVIEW_INIT(descriptor, 757)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
new file mode 100644
index 00000000000..02374ccd44a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c
@@ -0,0 +1,47 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/core/v3/udp_socket_config.upbdefs.h"
+#include "envoy/config/core/v3/udp_socket_config.upb.h"
+
+extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init validate_validate_proto_upbdefinit;
+static const char descriptor[405] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'u', 'd',
+'p', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\024', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l',
+'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', '\250', '\001', '\n', '\017', 'U', 'd', 'p', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o', 'n', 'f', 'i',
+'g', '\022', 'Z', '\n', '\024', 'm', 'a', 'x', '_', 'r', 'x', '_', 'd', 'a', 't', 'a', 'g', 'r', 'a', 'm', '_', 's', 'i', 'z', 'e',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '2', '\006', '\020', '\200', '\200', '\004', ' ', '\000', 'R',
+'\021', 'm', 'a', 'x', 'R', 'x', 'D', 'a', 't', 'a', 'g', 'r', 'a', 'm', 'S', 'i', 'z', 'e', '\022', '9', '\n', '\n', 'p', 'r', 'e',
+'f', 'e', 'r', '_', 'g', 'r', 'o', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'e', 'f', 'e', 'r', 'G',
+'r', 'o', 'B', 'D', '\n', '\"', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'U', 'd', 'p', 'S', 'o', 'c', 'k', 'e',
+'t', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p',
+'r', 'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[4] = {
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init envoy_config_core_v3_udp_socket_config_proto_upbdefinit = {
+ deps,
+ &envoy_config_core_v3_udp_socket_config_proto_upb_file_layout,
+ "envoy/config/core/v3/udp_socket_config.proto",
+ UPB_STRVIEW_INIT(descriptor, 405)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h
new file mode 100644
index 00000000000..1b1dfbcf258
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/core/v3/udp_socket_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init envoy_config_core_v3_udp_socket_config_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *envoy_config_core_v3_UdpSocketConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_core_v3_udp_socket_config_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.core.v3.UdpSocketConfig");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_CORE_V3_UDP_SOCKET_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
index a140da45240..45a7cf5d506 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/endpoint.upbdefs.h"
+#include "envoy/config/endpoint/v3/endpoint.upb.h"
extern upb_def_init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit;
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
@@ -16,18 +17,6 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit,
- &envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_msginit,
-};
-
static const char descriptor[1443] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/',
@@ -101,7 +90,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_config_endpoint_v3_endpoint_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_endpoint_proto_upb_file_layout,
"envoy/config/endpoint/v3/endpoint.proto",
UPB_STRVIEW_INIT(descriptor, 1443)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
index ea1dc96f4f3..b552ce5c8ad 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c
@@ -8,95 +8,107 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/endpoint_components.upbdefs.h"
+#include "envoy/config/endpoint/v3/endpoint_components.upb.h"
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_health_check_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_LbEndpoint_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_LocalityLbEndpoints_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_config_endpoint_v3_Endpoint_msginit,
- &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit,
- &envoy_config_endpoint_v3_LbEndpoint_msginit,
- &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit,
-};
-
-static const char descriptor[1584] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
+static const char descriptor[2119] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't',
'.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
'/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
-'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e',
-'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't',
-'h', '_', 'c', 'h', 'e', 'c', 'k', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p',
-'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
-'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
-'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\201', '\003', '\n', '\010', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022',
-'7', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a',
-'d', 'd', 'r', 'e', 's', 's', '\022', 'd', '\n', '\023', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a',
-'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\003', ' ', '\001', '(',
-'\t', 'R', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\032', '\222', '\001', '\n', '\021', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e',
-'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '(', '\n', '\n', 'p', 'o', 'r', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ',
-'\001', '(', '\r', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '\377', '\377', '\003', 'R', '\t', 'p', 'o', 'r', 't', 'V', 'a', 'l', 'u', 'e',
-'\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n',
-'a', 'm', 'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C',
-'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\"',
-'\221', '\003', '\n', '\n', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '@', '\n', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n',
-'d', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'H', '\000', 'R', '\010', 'e', 'n', 'd',
-'p', 'o', 'i', 'n', 't', '\022', '%', '\n', '\r', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ',
-'\001', '(', '\t', 'H', '\000', 'R', '\014', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'N', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'h', 'e',
-'a', 'l', 't', 'h', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a',
-'t', 'u', 's', 'R', '\014', 'h', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '\030', '\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g',
-'h', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l',
-'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h', 't', ':', '\'', '\232', '\305', '\210', '\036', '\"',
-'\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'L',
-'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'B', '\021', '\n', '\017', 'h', 'o', 's', 't', '_', 'i', 'd', 'e', 'n', 't', 'i', 'f',
-'i', 'e', 'r', '\"', '\211', '\003', '\n', '\023', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i',
-'t', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '\022', 'G', '\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i',
-'n', 't', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l',
-'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c',
-'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B',
-'\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h',
-'t', '\022', '$', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\005', ' ', '\001', '(', '\r', 'B', '\010', '\372', 'B', '\005', '*',
-'\003', '\030', '\200', '\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', ':', '\n', '\t', 'p', 'r', 'o', 'x', 'i', 'm', 'i',
-'t', 'y', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'o', 'x', 'i', 'm', 'i', 't', 'y', ':',
-'0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p',
-'o', 'i', 'n', 't', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'B',
-'K', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', 'B', '\027', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
-'t', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e',
+'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i',
+'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n',
+'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r',
+'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\"', '\201', '\003', '\n', '\010', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '7', '\n', '\007', 'a', 'd', 'd', 'r', 'e',
+'s', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'd',
+'\n', '\023', 'h', 'e', 'a', 'l', 't', 'h', '_', 'c', 'h', 'e', 'c', 'k', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'h', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '\032', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n',
+'a', 'm', 'e', '\032', '\222', '\001', '\n', '\021', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', '(', '\n', '\n', 'p', 'o', 'r', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\t', '\372', 'B', '\006',
+'*', '\004', '\030', '\377', '\377', '\003', 'R', '\t', 'p', 'o', 'r', 't', 'V', 'a', 'l', 'u', 'e', '\022', '\032', '\n', '\010', 'h', 'o', 's', 't',
+'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', ':', '7', '\232', '\305', '\210',
+'\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't',
+'.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'H', 'e', 'a', 'l', 't', 'h', 'C', 'h', 'e', 'c', 'k', 'C', 'o', 'n', 'f',
+'i', 'g', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\"', '\221', '\003', '\n', '\n', 'L', 'b', 'E', 'n',
+'d', 'p', 'o', 'i', 'n', 't', '\022', '@', '\n', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v',
+'3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'H', '\000', 'R', '\010', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '\022', '%', '\n',
+'\r', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'n', 'a', 'm', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\014', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', 'N', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'h', 'e', 'a', 'l', 't', 'h', '_', 's', 't', 'a',
+'t', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'h', 'e', 'a',
+'l', 't', 'h', 'S', 't', 'a', 't', 'u', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\003', ' ', '\001',
+'(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'Y', '\n', '\025', 'l', 'o',
+'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\004', ' ', '\001', '(', '\013',
+'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
+'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n',
+'c', 'i', 'n', 'g', 'W', 'e', 'i', 'g', 'h', 't', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', 'B', '\021', '\n', '\017', 'h', 'o', 's', 't', '_', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '\"', '\222', '\001', '\n', '\031',
+'L', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'C', '\n', '\013', 'l', 'e', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i',
+'g', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'l', 'e', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '0', '\n', '\024', 'l', 'e',
+'d', 's', '_', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
+'\022', 'l', 'e', 'd', 's', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\"', '\341', '\005', '\n', '\023', 'L',
+'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', ':', '\n', '\010', 'l', 'o', 'c',
+'a', 'l', 'i', 't', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'R', '\010', 'l', 'o', 'c', 'a', 'l',
+'i', 't', 'y', '\022', 'G', '\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\030', '\002', ' ', '\003', '(', '\013',
+'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.',
+'v', '3', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't',
+'s', '\022', 'v', '\n', '\027', 'l', 'o', 'a', 'd', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', 'r', '_', 'e', 'n', 'd', 'p', 'o', 'i',
+'n', 't', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd',
+'p', 'o', 'i', 'n', 't', 's', '.', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'L', 'i', 's', 't', 'H', '\000', 'R', '\025',
+'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'r', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\022', 'v', '\n', '\034',
+'l', 'e', 'd', 's', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'l', 'o', 'c', 'a', 'l', 'i', 't', 'y', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\010', ' ', '\001', '(', '\013', '2', '3', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'e', 'd', 's', 'C', 'l', 'u', 's', 't', 'e', 'r', 'L', 'o',
+'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\031', 'l', 'e', 'd', 's', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '\025', 'l', 'o', 'a', 'd', '_',
+'b', 'a', 'l', 'a', 'n', 'c', 'i', 'n', 'g', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
+'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\023', 'l', 'o', 'a', 'd', 'B', 'a', 'l', 'a', 'n', 'c', 'i', 'n',
+'g', 'W', 'e', 'i', 'g', 'h', 't', '\022', '$', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\005', ' ', '\001', '(', '\r',
+'B', '\010', '\372', 'B', '\005', '*', '\003', '\030', '\200', '\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', ':', '\n', '\t', 'p',
+'r', 'o', 'x', 'i', 'm', 'i', 't', 'y', '\030', '\006', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'o', 'x',
+'i', 'm', 'i', 't', 'y', '\032', 'Y', '\n', '\016', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'L', 'i', 's', 't', '\022', 'G',
+'\n', '\014', 'l', 'b', '_', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '.', 'L', 'b',
+'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'R', '\013', 'l', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', ':', '0', '\232', '\305',
+'\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n',
+'t', '.', 'L', 'o', 'c', 'a', 'l', 'i', 't', 'y', 'L', 'b', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'B', '\013', '\n', '\t',
+'l', 'b', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'B', 'K', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
+'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v',
+'3', 'B', '\027', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't',
+'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static upb_def_init *deps[9] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_config_source_proto_upbdefinit,
&envoy_config_core_v3_health_check_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -107,7 +119,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_endpoint_components_proto_upb_file_layout,
"envoy/config/endpoint/v3/endpoint_components.proto",
- UPB_STRVIEW_INIT(descriptor, 1584)
+ UPB_STRVIEW_INIT(descriptor, 2119)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
index 0173282c2d7..78661a9a2d6 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.h
@@ -36,11 +36,21 @@ UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LbEndpoint_getmsgdef(upb_s
return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LbEndpoint");
}
+UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LedsClusterLocalityConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LedsClusterLocalityConfig");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LocalityLbEndpoints_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LocalityLbEndpoints");
}
+UPB_INLINE const upb_msgdef *envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_endpoint_v3_endpoint_components_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.endpoint.v3.LocalityLbEndpoints.LbEndpointList");
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
index a0fb711a7e4..28685667237 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/endpoint/v3/load_report.upbdefs.h"
+#include "envoy/config/endpoint/v3/load_report.upb.h"
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
@@ -16,20 +17,6 @@ extern upb_def_init google_protobuf_struct_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_endpoint_v3_UpstreamLocalityStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_UpstreamEndpointStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_msginit;
-extern const upb_msglayout envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit,
- &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit,
- &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit,
- &envoy_config_endpoint_v3_ClusterStats_msginit,
- &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit,
-};
-
static const char descriptor[2351] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/', 'v',
'3', '/', 'l', 'o', 'a', 'd', '_', 'r', 'e', 'p', 'o', 'r', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o',
'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v',
@@ -140,7 +127,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_config_endpoint_v3_load_report_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_endpoint_v3_load_report_proto_upb_file_layout,
"envoy/config/endpoint/v3/load_report.proto",
UPB_STRVIEW_INIT(descriptor, 2351)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
index 088a1389231..401b97f5318 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c
@@ -8,16 +8,11 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/api_listener.upbdefs.h"
+#include "envoy/config/listener/v3/api_listener.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_ApiListener_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_config_listener_v3_ApiListener_msginit,
-};
-
static const char descriptor[359] = {'\n', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '\031', 'g', 'o',
@@ -44,7 +39,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_config_listener_v3_api_listener_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_api_listener_proto_upb_file_layout,
"envoy/config/listener/v3/api_listener.proto",
UPB_STRVIEW_INIT(descriptor, 359)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
index f1d684a89d9..ad192cf190a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c
@@ -8,11 +8,11 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/listener.upbdefs.h"
+#include "envoy/config/listener/v3/listener.upb.h"
extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
-extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_socket_option_proto_upbdefinit;
extern upb_def_init envoy_config_listener_v3_api_listener_proto_upbdefinit;
extern upb_def_init envoy_config_listener_v3_listener_components_proto_upbdefinit;
@@ -20,159 +20,153 @@ extern upb_def_init envoy_config_listener_v3_udp_listener_config_proto_upbdefini
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init xds_core_v3_collection_entry_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_security_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerCollection_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_DeprecatedV1_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_config_listener_v3_ListenerCollection_msginit,
- &envoy_config_listener_v3_Listener_msginit,
- &envoy_config_listener_v3_Listener_DeprecatedV1_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit,
- &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit,
-};
-
-static const char descriptor[3185] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+static const char descriptor[3383] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', ')', 'e', 'n', 'v', 'o', 'y', '/',
'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/', 'v', '3', '/', 'a', 'c', 'c', 'e', 's',
's', 'l', 'o', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'd', 'd', 'r', 'e', 's', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n',
'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p',
-'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
-'3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/',
-'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't',
-'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '+', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p',
-'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x',
-'d', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't',
-'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'s', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
-'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
-'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\"', 'L', '\n', '\022', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c',
-'t', 'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\034', '.', 'x',
-'d', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r',
-'y', 'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\335', '\022', '\n', '\010', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', '\022',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\007', 'a', 'd', 'd',
-'r', 'e', 's', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020',
-'\001', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i',
-'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'R', '\014', 'f',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 's', '\022', 'D', '\n', '\020', 'u', 's', 'e', '_', 'o', 'r', 'i', 'g', 'i', 'n',
-'a', 'l', '_', 'd', 's', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'u', 's', 'e', 'O', 'r', 'i', 'g', 'i',
-'n', 'a', 'l', 'D', 's', 't', '\022', 'W', '\n', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'f', 'i', 'l', 't', 'e', 'r', '_',
-'c', 'h', 'a', 'i', 'n', '\030', '\031', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
-'R', '\022', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '\022', 'o', '\n', '!', 'p',
-'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i',
-'t', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002',
-'\010', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i',
-'m', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'X', '\n', '\r', 'd', 'e', 'p',
-'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'v', '1', '\030', '\007', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', 'B', '\002', '\030', '\001', 'R', '\014', 'd', 'e', 'p', 'r',
-'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022', 'K', '\n', '\n', 'd', 'r', 'a', 'i', 'n', '_', 't', 'y', 'p', 'e', '\030', '\010', ' ',
-'\001', '(', '\016', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', 'R',
-'\t', 'd', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', '\022', 'S', '\n', '\020', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i',
-'l', 't', 'e', 'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l',
-'t', 'e', 'r', 'R', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', 'S', '\n', '\030', 'l',
-'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\017',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'R', '\026', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i',
-'m', 'e', 'o', 'u', 't', '\022', 'N', '\n', '$', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '_', 'o', 'n', '_', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\021', ' ', '\001', '(',
-'\010', 'R', ' ', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', 'O', 'n', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't',
-'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't',
-'\030', '\n', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\022', '6', '\n',
-'\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd', '\030', '\013', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\010', 'f', 'r', 'e', 'e', 'b',
-'i', 'n', 'd', '\022', 'I', '\n', '\016', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\003',
-'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i',
-'o', 'n', 's', '\022', 'X', '\n', '\032', 't', 'c', 'p', '_', 'f', 'a', 's', 't', '_', 'o', 'p', 'e', 'n', '_', 'q', 'u', 'e', 'u',
-'e', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\014', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\026', 't', 'c', 'p', 'F',
-'a', 's', 't', 'O', 'p', 'e', 'n', 'Q', 'u', 'e', 'u', 'e', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'S', '\n', '\021', 't', 'r', 'a',
-'f', 'f', 'i', 'c', '_', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\030', '\020', ' ', '\001', '(', '\016', '2', '&', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'f', 'f', 'i',
-'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', 'R', '\020', 't', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't',
-'i', 'o', 'n', '\022', '[', '\n', '\023', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\022', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i',
-'s', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f',
-'i', 'g', 'R', '\021', 'u', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014',
-'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '\030', '\023', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'A', 'p', 'i', 'L',
-'i', 's', 't', 'e', 'n', 'e', 'r', 'R', '\013', 'a', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', 'v', '\n', '\031', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
-'\024', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\027', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'r', 'e', 'u', 's', 'e', '_',
-'p', 'o', 'r', 't', '\030', '\025', ' ', '\001', '(', '\010', 'R', '\t', 'r', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't', '\022', 'C', '\n', '\n',
-'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\026', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's',
-'s', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'V', '\n', '\021', 'u', 'd', 'p', '_', 'w', 'r',
-'i', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\027', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e',
-'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\017', 'u', 'd', 'p', 'W', 'r', 'i', 't', 'e', 'r', 'C', 'o', 'n',
-'f', 'i', 'g', '\022', 'F', '\n', '\020', 't', 'c', 'p', '_', 'b', 'a', 'c', 'k', 'l', 'o', 'g', '_', 's', 'i', 'z', 'e', '\030', '\030',
-' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I',
-'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 't', 'c', 'p', 'B', 'a', 'c', 'k', 'l', 'o', 'g', 'S', 'i', 'z', 'e',
-'\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_', 'p', 'o', 'r', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\032', '.',
+'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
+'3', '/', 's', 'o', 'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '+', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'a', 'p',
+'i', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '2', 'e', 'n', 'v', 'o', 'y',
+'/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3', '/', 'u', 'd', 'p', '_', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
+'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p',
+'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o',
+'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v',
+'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o',
+'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', 'L', '\n', '\022', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'l', 'l', 'e', 'c', 't',
+'i', 'o', 'n', '\022', '6', '\n', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\034', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'R', '\007', 'e', 'n', 't', 'r', 'i', 'e', 's', '\"', '\244', '\024', '\n', '\010', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', '\022', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\007', 'a', 'd', 'd', 'r',
+'e', 's', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'A', 'd', 'd', 'r', 'e', 's', 's', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
+'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\037', '\n', '\013', 's', 't', 'a', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030',
+'\034', ' ', '\001', '(', '\t', 'R', '\n', 's', 't', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't',
+'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C',
+'h', 'a', 'i', 'n', 'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 's', '\022', 'D', '\n', '\020', 'u', 's', 'e',
+'_', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'd', 's', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'u',
+'s', 'e', 'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'D', 's', 't', '\022', 'W', '\n', '\024', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_',
+'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', '\030', '\031', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't',
+'e', 'r', 'C', 'h', 'a', 'i', 'n', 'R', '\022', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', '\022', 'o', '\n', '!', 'p', 'e', 'r', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'b', 'u', 'f', 'f',
+'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e',
+'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\035', 'p', 'e', 'r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B',
+'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a',
+'t', 'a', '\030', '\006', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'\022', 'a', '\n', '\r', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '_', 'v', '1', '\030', '\007', ' ', '\001', '(', '\013', '2', '/',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', 'B', '\013', '\030',
+'\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022',
+'K', '\n', '\n', 'd', 'r', 'a', 'i', 'n', '_', 't', 'y', 'p', 'e', '\030', '\010', ' ', '\001', '(', '\016', '2', ',', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', 'R', '\t', 'd', 'r', 'a', 'i', 'n', 'T', 'y', 'p',
+'e', '\022', 'S', '\n', '\020', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\t', ' ', '\003',
+'(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\017', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', 'S', '\n', '\030', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f',
+'i', 'l', 't', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\017', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\026', 'l',
+'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'N', '\n', '$',
+'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '_', 'o', 'n', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'f', 'i', 'l', 't',
+'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\021', ' ', '\001', '(', '\010', 'R', ' ', 'c', 'o', 'n', 't', 'i', 'n',
+'u', 'e', 'O', 'n', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u',
+'t', '\022', '<', '\n', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\030', '\n', ' ', '\001', '(', '\013', '2', '\032', '.',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't', '\032', 'w', '\n', '\014', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e',
-'d', 'V', '1', '\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_', 'p', 'o', 'r', 't', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r',
-'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\032', '\247', '\002', '\n', '\027', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a',
-'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\r', 'e', 'x', 'a', 'c', 't', '_', 'b', 'a', 'l', 'a',
-'n', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n',
-'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't',
-'B', 'a', 'l', 'a', 'n', 'c', 'e', 'H', '\000', 'R', '\014', 'e', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', '\032', 'Q',
-'\n', '\014', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e',
-'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B',
-'a', 'l', 'a', 'n', 'c', 'e', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
-'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l',
-'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\023', '\n', '\014', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 't', 'y', 'p',
-'e', '\022', '\003', '\370', 'B', '\001', '\"', ')', '\n', '\t', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'D', 'E',
-'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\017', '\n', '\013', 'M', 'O', 'D', 'I', 'F', 'Y', '_', 'O', 'N', 'L', 'Y', '\020', '\001', ':',
-'\034', '\232', '\305', '\210', '\036', '\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'J', '\004', '\010', '\016', '\020', '\017', 'B', 'A', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
-'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
-'v', '3', 'B', '\r', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002',
-'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\013', 't', 'r', 'a', 'n', 's', 'p', 'a', 'r', 'e', 'n', 't', '\022', '6', '\n', '\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd',
+'\030', '\013', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\010', 'f', 'r', 'e', 'e', 'b', 'i', 'n', 'd', '\022', 'I', '\n', '\016', 's', 'o',
+'c', 'k', 'e', 't', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'o', 'c', 'k', 'e', 't', 'O', 'p',
+'t', 'i', 'o', 'n', 'R', '\r', 's', 'o', 'c', 'k', 'e', 't', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n', '\032', 't', 'c',
+'p', '_', 'f', 'a', 's', 't', '_', 'o', 'p', 'e', 'n', '_', 'q', 'u', 'e', 'u', 'e', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030',
+'\014', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
+'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\026', 't', 'c', 'p', 'F', 'a', 's', 't', 'O', 'p', 'e', 'n', 'Q', 'u',
+'e', 'u', 'e', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'S', '\n', '\021', 't', 'r', 'a', 'f', 'f', 'i', 'c', '_', 'd', 'i', 'r', 'e',
+'c', 't', 'i', 'o', 'n', '\030', '\020', ' ', '\001', '(', '\016', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o',
+'n', 'R', '\020', 't', 'r', 'a', 'f', 'f', 'i', 'c', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'o', 'n', '\022', '[', '\n', '\023', 'u', 'd',
+'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\022', ' ', '\001', '(', '\013', '2', '+',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'u', 'd', 'p', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'H', '\n', '\014', 'a', 'p', 'i', '_', 'l', 'i', 's', 't', 'e',
+'n', 'e', 'r', '\030', '\023', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'A', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'R', '\013',
+'a', 'p', 'i', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '\022', 'v', '\n', '\031', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', ':', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L',
+'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\027', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '*', '\n', '\n', 'r', 'e', 'u', 's', 'e', '_', 'p', 'o', 'r', 't', '\030', '\025', ' ', '\001', '(',
+'\010', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\t', 'r', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't',
+'\022', 'F', '\n', '\021', 'e', 'n', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'u', 's', 'e', '_', 'p', 'o', 'r', 't', '\030', '\035', ' ', '\001',
+'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
+'V', 'a', 'l', 'u', 'e', 'R', '\017', 'e', 'n', 'a', 'b', 'l', 'e', 'R', 'e', 'u', 's', 'e', 'P', 'o', 'r', 't', '\022', 'C', '\n',
+'\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\026', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e',
+'s', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'F', '\n', '\020', 't', 'c', 'p', '_', 'b',
+'a', 'c', 'k', 'l', 'o', 'g', '_', 's', 'i', 'z', 'e', '\030', '\030', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 't',
+'c', 'p', 'B', 'a', 'c', 'k', 'l', 'o', 'g', 'S', 'i', 'z', 'e', '\022', '<', '\n', '\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_',
+'p', 'o', 'r', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'b', 'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't',
+'\022', 'h', '\n', '\021', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '\030', '\033', ' ', '\001',
+'(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\020', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '\032', 'w', '\n', '\014', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', 'V', '1', '\022', '<', '\n',
+'\014', 'b', 'i', 'n', 'd', '_', 't', 'o', '_', 'p', 'o', 'r', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'b',
+'i', 'n', 'd', 'T', 'o', 'P', 'o', 'r', 't', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'D', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd',
+'V', '1', '\032', '\247', '\002', '\n', '\027', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\r', 'e', 'x', 'a', 'c', 't', '_', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '\030', '\001', ' ',
+'\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n',
+'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c',
+'e', 'H', '\000', 'R', '\014', 'e', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e', '\032', 'Q', '\n', '\014', 'E', 'x', 'a', 'c',
+'t', 'B', 'a', 'l', 'a', 'n', 'c', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B',
+'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'E', 'x', 'a', 'c', 't', 'B', 'a', 'l', 'a', 'n', 'c', 'e',
+':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'B', 'a', 'l', 'a', 'n', 'c', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'B', '\023', '\n', '\014', 'b', 'a', 'l', 'a', 'n', 'c', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001',
+'\032', '\030', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
+'g', '\"', ')', '\n', '\t', 'D', 'r', 'a', 'i', 'n', 'T', 'y', 'p', 'e', '\022', '\013', '\n', '\007', 'D', 'E', 'F', 'A', 'U', 'L', 'T',
+'\020', '\000', '\022', '\017', '\n', '\013', 'M', 'O', 'D', 'I', 'F', 'Y', '_', 'O', 'N', 'L', 'Y', '\020', '\001', ':', '\034', '\232', '\305', '\210', '\036',
+'\027', '\n', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'B',
+'\024', '\n', '\022', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\016',
+'\020', '\017', 'J', '\004', '\010', '\027', '\020', '\030', 'B', 'A', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'B', '\r', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[16] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
- &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_socket_option_proto_upbdefinit,
&envoy_config_listener_v3_api_listener_proto_upbdefinit,
&envoy_config_listener_v3_listener_components_proto_upbdefinit,
@@ -180,6 +174,7 @@ static upb_def_init *deps[16] = {
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&xds_core_v3_collection_entry_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_security_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -189,7 +184,7 @@ static upb_def_init *deps[16] = {
upb_def_init envoy_config_listener_v3_listener_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_listener_proto_upb_file_layout,
"envoy/config/listener/v3/listener.proto",
- UPB_STRVIEW_INIT(descriptor, 3185)
+ UPB_STRVIEW_INIT(descriptor, 3383)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
index 535d37a3308..23f49b02c56 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.h
@@ -46,6 +46,11 @@ UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_ConnectionBalance
return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener.ConnectionBalanceConfig.ExactBalance");
}
+UPB_INLINE const upb_msgdef *envoy_config_listener_v3_Listener_InternalListenerConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_listener_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.Listener.InternalListenerConfig");
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
index ffe22ce9b6d..ad30e24e233 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/listener_components.upbdefs.h"
+#include "envoy/config/listener/v3/listener_components.upb.h"
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
@@ -16,28 +17,11 @@ extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_Filter_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChainMatch_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChain_msginit;
-extern const upb_msglayout envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ListenerFilter_msginit;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_config_listener_v3_Filter_msginit,
- &envoy_config_listener_v3_FilterChainMatch_msginit,
- &envoy_config_listener_v3_FilterChain_msginit,
- &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit,
- &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit,
- &envoy_config_listener_v3_ListenerFilter_msginit,
-};
-
-static const char descriptor[3284] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+static const char descriptor[3426] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
'.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
@@ -49,129 +33,135 @@ static const char descriptor[3284] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', '
'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
-'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i',
-'d', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\202', '\002', '\n', '\006', 'F',
-'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g',
-'\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n',
-'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D',
-'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c',
-'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c',
-'o', 'n', 'f', 'i', 'g', '\"', '\212', '\006', '\n', '\020', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c',
-'h', '\022', 'T', '\n', '\020', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\010', ' ', '\001',
-'(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't',
-'3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\017', 'd', 'e', 's',
-'t', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r', 't', '\022', 'D', '\n', '\r', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a',
-'n', 'g', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\014', 'p', 'r', 'e', 'f', 'i',
-'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '%', '\n', '\016', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 's', 'u', 'f', 'f', 'i', 'x',
-'\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'a', 'd', 'd', 'r', 'e', 's', 's', 'S', 'u', 'f', 'f', 'i', 'x', '\022', ';', '\n', '\n',
-'s', 'u', 'f', 'f', 'i', 'x', '_', 'l', 'e', 'n', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 's', 'u',
-'f', 'f', 'i', 'x', 'L', 'e', 'n', '\022', 'j', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\014', ' ',
-'\001', '(', '\016', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '.', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001',
-'\002', '\020', '\001', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', 'Q', '\n', '\024', 's', 'o', 'u', 'r', 'c', 'e',
-'_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a',
-'n', 'g', 'e', 'R', '\022', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '3',
-'\n', '\014', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'o', 'r', 't', 's', '\030', '\007', ' ', '\003', '(', '\r', 'B', '\020', '\372', 'B', '\r',
-'\222', '\001', '\n', '\"', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\013', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'o', 'r', 't',
-'s', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', 's', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\013',
-'s', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', '-', '\n', '\022', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_',
-'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\021', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
-'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '3', '\n', '\025', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', '_', 'p',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\024', 'a', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i',
-'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\"', 'F', '\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '\007', '\n', '\003', 'A', 'N', 'Y', '\020', '\000', '\022', '\027', '\n', '\023', 'S', 'A',
-'M', 'E', '_', 'I', 'P', '_', 'O', 'R', '_', 'L', 'O', 'O', 'P', 'B', 'A', 'C', 'K', '\020', '\001', '\022', '\014', '\n', '\010', 'E', 'X',
-'T', 'E', 'R', 'N', 'A', 'L', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
-'M', 'a', 't', 'c', 'h', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\200', '\006', '\n', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
-'i', 'n', '\022', 'X', '\n', '\022', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i', 'n', '_', 'm', 'a', 't', 'c', 'h', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
-'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'R',
-'\020', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '\022', ':', '\n', '\007', 'f', 'i', 'l', 't',
-'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e',
-'r', 's', '\022', 'F', '\n', '\017', 'u', 's', 'e', '_', 'p', 'r', 'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', '\030', '\004', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\r', 'u', 's', 'e', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', '\022',
-':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R',
-'\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R',
-'\017', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', 'b', '\n', ' ', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o',
-'u', 't', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\035', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k',
-'e', 't', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\007', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 's', '\n', '\027', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l',
-'t', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '.', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\025', 'o', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\032', '[', '\n', '\025', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\022', 'B', '\n', '\017', 'r', 'e', 'b', 'u', 'i', 'l', 'd', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\016', 'r', 'e', 'b', 'u', 'i', 'l', 'd', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '(', '\232', '\305',
-'\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
-'r', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 't', 'l', 's', '_',
-'c', 'o', 'n', 't', 'e', 'x', 't', '\"', '\302', '\005', '\n', '!', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
-'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'a', '\n', '\010', 'o',
-'r', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.',
-'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c', 'h', '\022', 'c', '\n', '\t', 'a', 'n',
-'d', '_', 'm', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.',
-'M', 'a', 't', 'c', 'h', 'S', 'e', 't', 'H', '\000', 'R', '\010', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', '\022', 'Z', '\n', '\t', 'n',
-'o', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
-'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
-'H', '\000', 'R', '\010', 'n', 'o', 't', 'M', 'a', 't', 'c', 'h', '\022', '&', '\n', '\t', 'a', 'n', 'y', '_', 'm', 'a', 't', 'c', 'h',
-'\030', '\004', ' ', '\001', '(', '\010', 'B', '\007', '\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a', 't',
-'c', 'h', '\022', 'Q', '\n', '\026', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '_', 'r', 'a',
-'n', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
-'.', 'I', 'n', 't', '3', '2', 'R', 'a', 'n', 'g', 'e', 'H', '\000', 'R', '\024', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o',
-'n', 'P', 'o', 'r', 't', 'R', 'a', 'n', 'g', 'e', '\032', '\260', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', '\022', '[',
-'\n', '\005', 'r', 'u', 'l', 'e', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F',
-'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B',
-'\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's',
-'t', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd',
-'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', ':', '>', '\232', '\305', '\210', '\036', '9', '\n', '7', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e',
-'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c',
-'a', 't', 'e', 'B', '\013', '\n', '\004', 'r', 'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\230', '\002', '\n', '\016', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'd',
-'\n', '\017', 'f', 'i', 'l', 't', 'e', 'r', '_', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', ';',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
-'.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h',
-'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'D', 'i', 's', 'a', 'b', 'l', 'e', 'd',
-':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's',
-'t', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c',
-'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B',
-'K', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\027', 'L', 'i', 's', 't', 'e', 'n', 'e',
-'r', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e',
+'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
+'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\"', '\202', '\002', '\n', '\006', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014',
+'t', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
+'\030', '\005', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c',
+'e', 'H', '\000', 'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', ':', '#', '\232', '\305', '\210',
+'\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'.', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010',
+'\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\352', '\006', '\n', '\020', 'F', 'i', 'l',
+'t', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', '\022', 'T', '\n', '\020', 'd', 'e', 's', 't', 'i', 'n', 'a', 't',
+'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*',
+'\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\017', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r', 't', '\022',
+'D', '\n', '\r', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\037', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r',
+'R', 'a', 'n', 'g', 'e', 'R', '\014', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', '%', '\n', '\016', 'a', 'd',
+'d', 'r', 'e', 's', 's', '_', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'a', 'd', 'd', 'r', 'e',
+'s', 's', 'S', 'u', 'f', 'f', 'i', 'x', '\022', ';', '\n', '\n', 's', 'u', 'f', 'f', 'i', 'x', '_', 'l', 'e', 'n', '\030', '\005', ' ',
+'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
+'t', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 's', 'u', 'f', 'f', 'i', 'x', 'L', 'e', 'n', '\022', '^', '\n', '\033', 'd', 'i',
+'r', 'e', 'c', 't', '_', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's',
+'\030', '\r', ' ', '\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\030', 'd', 'i', 'r', 'e', 'c', 't', 'S', 'o', 'u',
+'r', 'c', 'e', 'P', 'r', 'e', 'f', 'i', 'x', 'R', 'a', 'n', 'g', 'e', 's', '\022', 'j', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e',
+'_', 't', 'y', 'p', 'e', '\030', '\014', ' ', '\001', '(', '\016', '2', '?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
+'M', 'a', 't', 'c', 'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p',
+'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', 'Q',
+'\n', '\024', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'a', 'n', 'g', 'e', 's', '\030', '\006', ' ',
+'\003', '(', '\013', '2', '\037', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'C', 'i', 'd', 'r', 'R', 'a', 'n', 'g', 'e', 'R', '\022', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'e', 'f', 'i', 'x',
+'R', 'a', 'n', 'g', 'e', 's', '\022', '3', '\n', '\014', 's', 'o', 'u', 'r', 'c', 'e', '_', 'p', 'o', 'r', 't', 's', '\030', '\007', ' ',
+'\003', '(', '\r', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', '*', '\006', '\030', '\377', '\377', '\003', '(', '\001', 'R', '\013', 's', 'o',
+'u', 'r', 'c', 'e', 'P', 'o', 'r', 't', 's', '\022', '!', '\n', '\014', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', 's',
+'\030', '\013', ' ', '\003', '(', '\t', 'R', '\013', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', 's', '\022', '-', '\n', '\022', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\021', 't',
+'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '3', '\n', '\025', 'a', 'p', 'p', 'l', 'i',
+'c', 'a', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\024', 'a',
+'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\"', 'F', '\n', '\024', 'C', 'o',
+'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'S', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '\007', '\n', '\003', 'A', 'N', 'Y',
+'\020', '\000', '\022', '\027', '\n', '\023', 'S', 'A', 'M', 'E', '_', 'I', 'P', '_', 'O', 'R', '_', 'L', 'O', 'O', 'P', 'B', 'A', 'C', 'K',
+'\020', '\001', '\022', '\014', '\n', '\010', 'E', 'X', 'T', 'E', 'R', 'N', 'A', 'L', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l',
+'t', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\211', '\006', '\n', '\013', 'F',
+'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', '\022', 'X', '\n', '\022', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'h', 'a', 'i',
+'n', '_', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', 'M', 'a', 't', 'c', 'h', 'R', '\020', 'f', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h',
+'\022', ':', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e',
+'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', 'O', '\n', '\017', 'u', 's', 'e', '_', 'p', 'r', 'o', 'x', 'y', '_', 'p',
+'r', 'o', 't', 'o', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.',
+'0', 'R', '\r', 'u', 's', 'e', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd',
+'a', 't', 'a', '\030', '\005', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't',
+'a', '\022', 'P', '\n', '\020', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', '\030', '\006', ' ', '\001',
+'(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'T', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'R', '\017', 't', 'r', 'a', 'n', 's', 'p', 'o',
+'r', 't', 'S', 'o', 'c', 'k', 'e', 't', '\022', 'b', '\n', ' ', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c',
+'k', 'e', 't', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\t', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'R', '\035', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\004', 'n',
+'a', 'm', 'e', '\022', 's', '\n', '\027', 'o', 'n', '_', 'd', 'e', 'm', 'a', 'n', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
+'a', 't', 'i', 'o', 'n', '\030', '\010', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n',
+'.', 'O', 'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\025', 'o',
+'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\032', '[', '\n', '\025', 'O',
+'n', 'D', 'e', 'm', 'a', 'n', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'B', '\n', '\017', 'r',
+'e', 'b', 'u', 'i', 'l', 'd', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\016', 'r',
+'e', 'b', 'u', 'i', 'l', 'd', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'F', 'i', 'l', 't', 'e', 'r',
+'C', 'h', 'a', 'i', 'n', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\"',
+'\302', '\005', '\n', '!', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a',
+'t', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'a', '\n', '\010', 'o', 'r', '_', 'm', 'a', 't', 'c', 'h', '\030',
+'\001', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't',
+'H', '\000', 'R', '\007', 'o', 'r', 'M', 'a', 't', 'c', 'h', '\022', 'c', '\n', '\t', 'a', 'n', 'd', '_', 'm', 'a', 't', 'c', 'h', '\030',
+'\002', ' ', '\001', '(', '\013', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't',
+'H', '\000', 'R', '\010', 'a', 'n', 'd', 'M', 'a', 't', 'c', 'h', '\022', 'Z', '\n', '\t', 'n', 'o', 't', '_', 'm', 'a', 't', 'c', 'h',
+'\030', '\003', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h',
+'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'H', '\000', 'R', '\010', 'n', 'o', 't', 'M',
+'a', 't', 'c', 'h', '\022', '&', '\n', '\t', 'a', 'n', 'y', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\010', 'B', '\007',
+'\372', 'B', '\004', 'j', '\002', '\010', '\001', 'H', '\000', 'R', '\010', 'a', 'n', 'y', 'M', 'a', 't', 'c', 'h', '\022', 'Q', '\n', '\026', 'd', 'e',
+'s', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'p', 'o', 'r', 't', '_', 'r', 'a', 'n', 'g', 'e', '\030', '\005', ' ', '\001', '(',
+'\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '3', '2', 'R', 'a',
+'n', 'g', 'e', 'H', '\000', 'R', '\024', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'P', 'o', 'r', 't', 'R', 'a', 'n',
+'g', 'e', '\032', '\260', '\001', '\n', '\010', 'M', 'a', 't', 'c', 'h', 'S', 'e', 't', '\022', '[', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\030',
+'\001', ' ', '\003', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't',
+'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a',
+'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010',
+'\002', 'R', '\005', 'r', 'u', 'l', 'e', 's', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l',
+'t', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '.', 'M', 'a',
+'t', 'c', 'h', 'S', 'e', 't', ':', '>', '\232', '\305', '\210', '\036', '9', '\n', '7', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e',
+'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\013', '\n', '\004', 'r',
+'u', 'l', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\230', '\002', '\n', '\016', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't',
+'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
+'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ',
+'\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y',
+'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'd', '\n', '\017', 'f', 'i', 'l', 't', 'e', 'r',
+'_', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e', 'n', 'e',
+'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'h', 'a', 'i', 'n', 'M', 'a', 't', 'c', 'h', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't',
+'e', 'R', '\016', 'f', 'i', 'l', 't', 'e', 'r', 'D', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', '+', '\232', '\305', '\210', '\036', '&', '\n',
+'$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'L', 'i',
+'s', 't', 'e', 'n', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y',
+'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', 'K', '\n', '&', 'i', 'o', '.', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's',
+'t', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\027', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'm', 'p', 'o', 'n', 'e',
+'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
};
-static upb_def_init *deps[11] = {
+static upb_def_init *deps[12] = {
&envoy_config_core_v3_address_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
@@ -179,6 +169,7 @@ static upb_def_init *deps[11] = {
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
@@ -187,7 +178,7 @@ static upb_def_init *deps[11] = {
upb_def_init envoy_config_listener_v3_listener_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_listener_components_proto_upb_file_layout,
"envoy/config/listener/v3/listener_components.proto",
- UPB_STRVIEW_INIT(descriptor, 3284)
+ UPB_STRVIEW_INIT(descriptor, 3426)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
new file mode 100644
index 00000000000..9397ff1e319
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c
@@ -0,0 +1,85 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/config/listener/v3/quic_config.upbdefs.h"
+#include "envoy/config/listener/v3/quic_config.upb.h"
+
+extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_protocol_proto_upbdefinit;
+extern upb_def_init google_protobuf_duration_proto_upbdefinit;
+extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
+extern upb_def_init validate_validate_proto_upbdefinit;
+static const char descriptor[1107] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+'3', '/', 'q', 'u', 'i', 'c', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v',
+'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+'/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c',
+'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
+'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
+'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
+'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\266', '\005', '\n', '\023', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
+'O', 'p', 't', 'i', 'o', 'n', 's', '\022', ']', '\n', '\025', 'q', 'u', 'i', 'c', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_',
+'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O',
+'p', 't', 'i', 'o', 'n', 's', 'R', '\023', 'q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
+'n', 's', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'S', '\n', '\030', 'c', 'r', 'y', 'p', 't', 'o', '_',
+'h', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'R', '\026', 'c', 'r', 'y', 'p', 't', 'o', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022',
+'B', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'e', 'a',
+'t', 'u', 'r', 'e', 'F', 'l', 'a', 'g', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', '}', '\n', ')', 'p', 'a', 'c', 'k',
+'e', 't', 's', '_', 't', 'o', '_', 'r', 'e', 'a', 'd', '_', 't', 'o', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'c', 'o', 'u', 'n', 't', '_', 'r', 'a', 't', 'i', 'o', '\030', '\005', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007',
+'\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '#', 'p', 'a', 'c', 'k', 'e', 't', 's', 'T', 'o', 'R', 'e', 'a', 'd', 'T', 'o', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'C', 'o', 'u', 'n', 't', 'R', 'a', 't', 'i', 'o', '\022', '\\', '\n', '\024', 'c', 'r',
+'y', 'p', 't', 'o', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y',
+'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\022', 'c', 'r', 'y', 'p', 't',
+'o', 'S', 't', 'r', 'e', 'a', 'm', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z', '\n', '\023', 'p', 'r', 'o', 'o', 'f', '_', 's', 'o',
+'u', 'r', 'c', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'p', 'r', 'o', 'o', 'f', 'S', 'o', 'u', 'r', 'c', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
+'t', 'i', 'o', 'n', 's', 'B', 'C', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', 'B', '\017', 'Q',
+'u', 'i', 'c', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
+'\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[9] = {
+ &envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
+ &envoy_config_core_v3_protocol_proto_upbdefinit,
+ &google_protobuf_duration_proto_upbdefinit,
+ &google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_status_proto_upbdefinit,
+ &udpa_annotations_versioning_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init envoy_config_listener_v3_quic_config_proto_upbdefinit = {
+ deps,
+ &envoy_config_listener_v3_quic_config_proto_upb_file_layout,
+ "envoy/config/listener/v3/quic_config.proto",
+ UPB_STRVIEW_INIT(descriptor, 1107)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h
new file mode 100644
index 00000000000..782aacb2689
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/config/listener/v3/quic_config.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_
+#define ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init envoy_config_listener_v3_quic_config_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *envoy_config_listener_v3_QuicProtocolOptions_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_listener_v3_quic_config_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.listener.v3.QuicProtocolOptions");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_CONFIG_LISTENER_V3_QUIC_CONFIG_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
index 525a38a51a8..3cb96aeeb32 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c
@@ -8,44 +8,45 @@
#include "upb/def.h"
#include "envoy/config/listener/v3/udp_listener_config.upbdefs.h"
+#include "envoy/config/listener/v3/udp_listener_config.upb.h"
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_udp_socket_config_proto_upbdefinit;
+extern upb_def_init envoy_config_listener_v3_quic_config_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_config_listener_v3_UdpListenerConfig_msginit;
-extern const upb_msglayout envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_listener_v3_UdpListenerConfig_msginit,
- &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit,
-};
-
-static const char descriptor[544] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
+static const char descriptor[692] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v',
'3', '/', 'u', 'd', 'p', '_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o',
't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r',
-'.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.',
-'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's',
-'t', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\307', '\001', '\n',
-'\021', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '*', '\n', '\021', 'u', 'd', 'p',
-'_', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\017', 'u', 'd', 'p',
-'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n',
-'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '.', '\232', '\305',
-'\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e',
-'r', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\013', 'c', 'o',
-'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'U',
-'\n', '\032', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n',
-'f', 'i', 'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', 'J', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o',
-'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
-'v', '3', 'B', '\026', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't',
-'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'.', 'v', '3', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3',
+'/', 'u', 'd', 'p', '_', 's', 'o', 'c', 'k', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'*', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/', 'v', '3',
+'/', 'q', 'u', 'i', 'c', '_', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n',
+'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\234', '\002', '\n', '\021', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '_', '\n', '\030', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 's', 'o', 'c', 'k',
+'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'U', 'd', 'p', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o',
+'n', 'f', 'i', 'g', 'R', '\026', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'S', 'o', 'c', 'k', 'e', 't', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', 'P', '\n', '\014', 'q', 'u', 'i', 'c', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\007', ' ', '\001', '(', '\013',
+'2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.',
+'v', '3', '.', 'Q', 'u', 'i', 'c', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\013', 'q',
+'u', 'i', 'c', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n',
+'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020',
+'\004', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\006', '\020', '\007', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'U', '\n', '\032',
+'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
+'g', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'l', 'i',
+'s', 't', 'e', 'n', 'e', 'r', '.', 'A', 'c', 't', 'i', 'v', 'e', 'R', 'a', 'w', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n',
+'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'B', 'J', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3',
+'B', '\026', 'U', 'd', 'p', 'L', 'i', 's', 't', 'e', 'n', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'P', 'r', 'o', 't', 'o', 'P',
+'\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[4] = {
- &google_protobuf_any_proto_upbdefinit,
+static upb_def_init *deps[5] = {
+ &envoy_config_core_v3_udp_socket_config_proto_upbdefinit,
+ &envoy_config_listener_v3_quic_config_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
@@ -53,7 +54,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_config_listener_v3_udp_listener_config_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_listener_v3_udp_listener_config_proto_upb_file_layout,
"envoy/config/listener/v3/udp_listener_config.proto",
- UPB_STRVIEW_INIT(descriptor, 544)
+ UPB_STRVIEW_INIT(descriptor, 692)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
index e49149aad7b..0de90d01df5 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/metrics/v3/stats.upbdefs.h"
+#include "envoy/config/metrics/v3/stats.upb.h"
extern upb_def_init envoy_config_core_v3_address_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
@@ -16,26 +17,6 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsConfig_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsMatcher_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_TagSpecifier_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HistogramBucketSettings_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_StatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_DogStatsdSink_msginit;
-extern const upb_msglayout envoy_config_metrics_v3_HystrixSink_msginit;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_metrics_v3_StatsSink_msginit,
- &envoy_config_metrics_v3_StatsConfig_msginit,
- &envoy_config_metrics_v3_StatsMatcher_msginit,
- &envoy_config_metrics_v3_TagSpecifier_msginit,
- &envoy_config_metrics_v3_HistogramBucketSettings_msginit,
- &envoy_config_metrics_v3_StatsdSink_msginit,
- &envoy_config_metrics_v3_DogStatsdSink_msginit,
- &envoy_config_metrics_v3_HystrixSink_msginit,
-};
-
static const char descriptor[2091] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'm', 'e', 't', 'r', 'i', 'c', 's', '/', 'v', '3',
'/', 's', 't', 'a', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
'g', '.', 'm', 'e', 't', 'r', 'i', 'c', 's', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
@@ -135,7 +116,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_config_metrics_v3_stats_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_metrics_v3_stats_proto_upb_file_layout,
"envoy/config/metrics/v3/stats.proto",
UPB_STRVIEW_INIT(descriptor, 2091)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
index e189d990001..ca270431f48 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/config/overload/v3/overload.upbdefs.h"
+#include "envoy/config/overload/v3/overload.upb.h"
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
@@ -15,27 +16,7 @@ extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_overload_v3_ResourceMonitor_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ThresholdTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaledTrigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_Trigger_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit;
-extern const upb_msglayout envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadAction_msginit;
-extern const upb_msglayout envoy_config_overload_v3_OverloadManager_msginit;
-
-static const upb_msglayout *layouts[8] = {
- &envoy_config_overload_v3_ResourceMonitor_msginit,
- &envoy_config_overload_v3_ThresholdTrigger_msginit,
- &envoy_config_overload_v3_ScaledTrigger_msginit,
- &envoy_config_overload_v3_Trigger_msginit,
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit,
- &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit,
- &envoy_config_overload_v3_OverloadAction_msginit,
- &envoy_config_overload_v3_OverloadManager_msginit,
-};
-
-static const char descriptor[2145] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '/', 'v',
+static const char descriptor[2358] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '/', 'v',
'3', '/', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/',
't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o',
@@ -105,22 +86,31 @@ static const char descriptor[2145] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013', 't', 'y', 'p', 'e',
'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r',
-'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\263', '\002', '\n', '\017', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a',
-'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\020', 'r', 'e', 'f', 'r', 'e', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l',
-'\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'r', 'e', 'f', 'r', 'e', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l',
-'\022', '`', '\n', '\021', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'm', 'o', 'n', 'i', 't', 'o', 'r', 's', '\030', '\002', ' ', '\003',
-'(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a',
-'d', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 'B', '\010', '\372', 'B', '\005',
-'\222', '\001', '\002', '\010', '\001', 'R', '\020', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 's', '\022', 'B',
-'\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a',
-'d', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a',
-'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', 'A', '\n', '&', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', 'B', '\r', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'P', 'r', 'o',
-'t', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', '\"', 'p', '\n', '\023', 'B', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o',
+'r', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Y', '\n', '%', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'a', 'c', 'c', 'o', 'u',
+'n', 't', '_', 't', 'o', '_', 't', 'r', 'a', 'c', 'k', '_', 'p', 'o', 'w', 'e', 'r', '_', 'o', 'f', '_', 't', 'w', 'o', '\030',
+'\001', ' ', '\001', '(', '\r', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '8', '(', '\n', 'R', '\037', 'm', 'i', 'n', 'i', 'm', 'u', 'm',
+'A', 'c', 'c', 'o', 'u', 'n', 't', 'T', 'o', 'T', 'r', 'a', 'c', 'k', 'P', 'o', 'w', 'e', 'r', 'O', 'f', 'T', 'w', 'o', '\"',
+'\226', '\003', '\n', '\017', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'D', '\n', '\020', 'r', 'e',
+'f', 'r', 'e', 's', 'h', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\017', 'r',
+'e', 'f', 'r', 'e', 's', 'h', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', '`', '\n', '\021', 'r', 'e', 's', 'o', 'u', 'r', 'c',
+'e', '_', 'm', 'o', 'n', 'i', 't', 'o', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r',
+'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\020', 'r', 'e', 's', 'o',
+'u', 'r', 'c', 'e', 'M', 'o', 'n', 'i', 't', 'o', 'r', 's', '\022', 'B', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\003',
+' ', '\003', '(', '\013', '2', '(', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l',
+'o', 'a', 'd', '.', 'v', '3', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'A', 'c', 't', 'i', 'o', 'n', 'R', '\007', 'a', 'c',
+'t', 'i', 'o', 'n', 's', '\022', 'a', '\n', '\025', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'f', 'a', 'c', 't', 'o', 'r', 'y', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3', '.', 'B', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o',
+'r', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'b', 'u', 'f', 'f', 'e', 'r', 'F', 'a', 'c', 't', 'o', 'r', 'y', 'C', 'o',
+'n', 'f', 'i', 'g', ':', '4', '\232', '\305', '\210', '\036', '/', '\n', '-', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '2', 'a', 'l', 'p', 'h', 'a', '.', 'O', 'v', 'e', 'r', 'l', 'o', 'a',
+'d', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', 'A', '\n', '&', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'o', 'v', 'e', 'r', 'l', 'o', 'a', 'd', '.', 'v', '3',
+'B', '\r', 'O', 'v', 'e', 'r', 'l', 'o', 'a', 'd', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[7] = {
@@ -135,7 +125,7 @@ static upb_def_init *deps[7] = {
upb_def_init envoy_config_overload_v3_overload_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_overload_v3_overload_proto_upb_file_layout,
"envoy/config/overload/v3/overload.proto",
- UPB_STRVIEW_INIT(descriptor, 2145)
+ UPB_STRVIEW_INIT(descriptor, 2358)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
index ca1dc51729c..73df103776d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.h
@@ -56,6 +56,11 @@ UPB_INLINE const upb_msgdef *envoy_config_overload_v3_OverloadAction_getmsgdef(u
return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.OverloadAction");
}
+UPB_INLINE const upb_msgdef *envoy_config_overload_v3_BufferFactoryConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.BufferFactoryConfig");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_overload_v3_OverloadManager_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_overload_v3_overload_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.overload.v3.OverloadManager");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
index 8e6490aa8d7..89dcc626fa7 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c
@@ -8,83 +8,88 @@
#include "upb/def.h"
#include "envoy/config/route/v3/route.upbdefs.h"
+#include "envoy/config/route/v3/route.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_route_v3_RouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_Vhds_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_route_v3_RouteConfiguration_msginit,
- &envoy_config_route_v3_Vhds_msginit,
-};
-
-static const char descriptor[1389] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
+static const char descriptor[1634] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c',
'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r',
-'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o',
-'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p',
-'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a',
-'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\"', '\202', '\007', '\n', '\022', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'v',
-'i', 'r', 't', 'u', 'a', 'l', '_', 'h', 'o', 's', 't', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l',
-'H', 'o', 's', 't', 'R', '\014', 'v', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 's', '\022', '/', '\n', '\004', 'v', 'h', 'd',
-'s', '\030', '\t', ' ', '\001', '(', '\013', '2', '\033', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
-'u', 't', 'e', '.', 'v', '3', '.', 'V', 'h', 'd', 's', 'R', '\004', 'v', 'h', 'd', 's', '\022', 'D', '\n', '\025', 'i', 'n', 't', 'e',
-'r', 'n', 'a', 'l', '_', 'o', 'n', 'l', 'y', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\020',
-'\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\023', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', 'O', 'n', 'l', 'y', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r',
-'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r',
-'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e',
-'s', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030',
-'\005', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027',
-'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'g',
-'\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030',
-'\006', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B',
-'\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o',
-'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o',
-'_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\010', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006',
-'\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R',
-'e', 'm', 'o', 'v', 'e', '\022', 'L', '\n', '#', 'm', 'o', 's', 't', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'c', '_', 'h', 'e',
-'a', 'd', 'e', 'r', '_', 'm', 'u', 't', 'a', 't', 'i', 'o', 'n', 's', '_', 'w', 'i', 'n', 's', '\030', '\n', ' ', '\001', '(', '\010',
-'R', '\037', 'm', 'o', 's', 't', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'c', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'u', 't', 'a', 't',
-'i', 'o', 'n', 's', 'W', 'i', 'n', 's', '\022', 'G', '\n', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '_', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'C', 'l',
-'u', 's', 't', 'e', 'r', 's', '\022', 'i', '\n', '#', 'm', 'a', 'x', '_', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p',
-'o', 'n', 's', 'e', '_', 'b', 'o', 'd', 'y', '_', 's', 'i', 'z', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\013', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'R', '\036', 'm', 'a', 'x', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e',
-'B', 'o', 'd', 'y', 'S', 'i', 'z', 'e', 'B', 'y', 't', 'e', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't',
-'i', 'o', 'n', '\"', 's', '\n', '\004', 'V', 'h', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u',
-'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', '\030', '\232', '\305', '\210', '\036',
-'\023', '\n', '\021', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'V', 'h', 'd', 's', 'B', ';', '\n', '#', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\n', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'c', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n',
+'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e',
+'_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
+'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
+'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\355', '\007', '\n', '\022', 'R', 'o', 'u', 't', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'G', '\n', '\r', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'h', 'o', 's', 't', 's',
+'\030', '\002', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 'R', '\014', 'v', 'i', 'r', 't', 'u', 'a',
+'l', 'H', 'o', 's', 't', 's', '\022', '/', '\n', '\004', 'v', 'h', 'd', 's', '\030', '\t', ' ', '\001', '(', '\013', '2', '\033', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'h', 'd', 's', 'R',
+'\004', 'v', 'h', 'd', 's', '\022', 'D', '\n', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'o', 'n', 'l', 'y', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\023', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'O', 'n', 'l', 'y', 'H', 'e', 'a', 'd', 'e', 'r', 's',
+'\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a',
+'d', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B',
+'\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e',
+'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e',
+'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\005', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001',
+'\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd',
+'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\006', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
+'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q',
+'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e',
+'s', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\010', ' ', '\003', '(',
+'\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u',
+'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'L', '\n', '#', 'm', 'o', 's',
+'t', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'c', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'u', 't', 'a', 't', 'i', 'o',
+'n', 's', '_', 'w', 'i', 'n', 's', '\030', '\n', ' ', '\001', '(', '\010', 'R', '\037', 'm', 'o', 's', 't', 'S', 'p', 'e', 'c', 'i', 'f',
+'i', 'c', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'u', 't', 'a', 't', 'i', 'o', 'n', 's', 'W', 'i', 'n', 's', '\022', 'G', '\n', '\021',
+'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u',
+'e', 'R', '\020', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'i', '\n', '#', 'm', 'a',
+'x', '_', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'b', 'o', 'd', 'y', '_', 's', 'i',
+'z', 'e', '_', 'b', 'y', 't', 'e', 's', '\030', '\013', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\036', 'm', 'a', 'x', 'D',
+'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'B', 'o', 'd', 'y', 'S', 'i', 'z', 'e', 'B', 'y', 't', 'e',
+'s', '\022', 'i', '\n', '\031', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '_', 'p', 'l',
+'u', 'g', 'i', 'n', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i',
+'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', 'R', '\027', 'c', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
+'r', 'P', 'l', 'u', 'g', 'i', 'n', 's', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\"', 'b',
+'\n', '\026', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', '\022',
+'H', '\n', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', 's',
+'\n', '\004', 'V', 'h', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
+'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', '\030', '\232', '\305', '\210', '\036', '\023', '\n', '\021', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'V', 'h', 'd', 's', 'B', ';', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v',
+'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', 'B', '\n', 'R', 'o', 'u', 't', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
+'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[8] = {
+static upb_def_init *deps[9] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_route_v3_route_components_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
@@ -95,7 +100,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_config_route_v3_route_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_route_proto_upb_file_layout,
"envoy/config/route/v3/route.proto",
- UPB_STRVIEW_INIT(descriptor, 1389)
+ UPB_STRVIEW_INIT(descriptor, 1634)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
index 30b5dd5ec3f..873757f1df1 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.h
@@ -26,6 +26,11 @@ UPB_INLINE const upb_msgdef *envoy_config_route_v3_RouteConfiguration_getmsgdef(
return upb_symtab_lookupmsg(s, "envoy.config.route.v3.RouteConfiguration");
}
+UPB_INLINE const upb_msgdef *envoy_config_route_v3_ClusterSpecifierPlugin_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.route.v3.ClusterSpecifierPlugin");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_route_v3_Vhds_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Vhds");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
index b9e231614b1..d7498bda40a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c
@@ -8,10 +8,12 @@
#include "upb/def.h"
#include "envoy/config/route/v3/route_components.upbdefs.h"
+#include "envoy/config/route/v3/route_components.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_proxy_protocol_proto_upbdefinit;
+extern upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
extern upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit;
@@ -26,899 +28,826 @@ extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_route_v3_VirtualHost_msginit;
-extern const upb_msglayout envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_FilterAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_Route_msginit;
-extern const upb_msglayout envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit;
-extern const upb_msglayout envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_CorsPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit;
-extern const upb_msglayout envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryPriority_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_ResetHeader_msginit;
-extern const upb_msglayout envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit;
-extern const upb_msglayout envoy_config_route_v3_HedgePolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_RedirectAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_DirectResponseAction_msginit;
-extern const upb_msglayout envoy_config_route_v3_Decorator_msginit;
-extern const upb_msglayout envoy_config_route_v3_Tracing_msginit;
-extern const upb_msglayout envoy_config_route_v3_VirtualCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_GenericKey_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Action_MetaData_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_msginit;
-extern const upb_msglayout envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit;
-extern const upb_msglayout envoy_config_route_v3_HeaderMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_QueryParameterMatcher_msginit;
-extern const upb_msglayout envoy_config_route_v3_InternalRedirectPolicy_msginit;
-extern const upb_msglayout envoy_config_route_v3_FilterConfig_msginit;
-
-static const upb_msglayout *layouts[52] = {
- &envoy_config_route_v3_VirtualHost_msginit,
- &envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_FilterAction_msginit,
- &envoy_config_route_v3_Route_msginit,
- &envoy_config_route_v3_Route_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_WeightedCluster_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit,
- &envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_msginit,
- &envoy_config_route_v3_RouteMatch_msginit,
- &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit,
- &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit,
- &envoy_config_route_v3_CorsPolicy_msginit,
- &envoy_config_route_v3_RouteAction_msginit,
- &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit,
- &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit,
- &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit,
- &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit,
- &envoy_config_route_v3_RetryPolicy_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit,
- &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit,
- &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit,
- &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit,
- &envoy_config_route_v3_HedgePolicy_msginit,
- &envoy_config_route_v3_RedirectAction_msginit,
- &envoy_config_route_v3_DirectResponseAction_msginit,
- &envoy_config_route_v3_Decorator_msginit,
- &envoy_config_route_v3_Tracing_msginit,
- &envoy_config_route_v3_VirtualCluster_msginit,
- &envoy_config_route_v3_RateLimit_msginit,
- &envoy_config_route_v3_RateLimit_Action_msginit,
- &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit,
- &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit,
- &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit,
- &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit,
- &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit,
- &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit,
- &envoy_config_route_v3_RateLimit_Action_MetaData_msginit,
- &envoy_config_route_v3_RateLimit_Override_msginit,
- &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit,
- &envoy_config_route_v3_HeaderMatcher_msginit,
- &envoy_config_route_v3_QueryParameterMatcher_msginit,
- &envoy_config_route_v3_InternalRedirectPolicy_msginit,
- &envoy_config_route_v3_FilterConfig_msginit,
-};
-
-static const char descriptor[19463] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
+static const char descriptor[20318] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 'r',
'o', 'u', 't', 'e', '_', 'c', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n',
'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o',
'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o',
't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/',
'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', ')', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o',
'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'p', 'r', 'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c',
-'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
-'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p',
-'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't',
-'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p',
-'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/',
-'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036',
-'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
-'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\324', '\014', '\n', '\013', 'V', 'i', 'r', 't', 'u',
-'a', 'l', 'H', 'o', 's', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ',', '\n', '\007', 'd', 'o', 'm', 'a', 'i', 'n', 's', '\030', '\002', ' ', '\003',
-'(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\010', '\001', '\"', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\007', 'd',
-'o', 'm', 'a', 'i', 'n', 's', '\022', '4', '\n', '\006', 'r', 'o', 'u', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\034', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u',
-'t', 'e', 'R', '\006', 'r', 'o', 'u', 't', 'e', 's', '\022', '`', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 't', 'l', 's',
-'\030', '\004', ' ', '\001', '(', '\016', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '.', 'T', 'l', 's', 'R', 'e', 'q', 'u',
-'i', 'r', 'e', 'm', 'e', 'n', 't', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 'r', 'e',
-'q', 'u', 'i', 'r', 'e', 'T', 'l', 's', '\022', 'P', '\n', '\020', 'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'c', 'l', 'u', 's', 't',
-'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\017',
-'v', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l',
-'i', 'm', 'i', 't', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't',
-'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\007', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O',
-'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't',
-'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h',
-'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\r', ' ', '\003', '(', '\t', 'B', '\022', '\372',
-'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's',
-'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o',
-'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2',
-'\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e',
-'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350',
-'\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O',
-'\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm',
-'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
-'\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e',
-'m', 'o', 'v', 'e', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l',
-'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 's', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i',
-'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\017', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H',
-'o', 's', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E',
-'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', 'A', '\n', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'a', 't', 't', 'e',
-'m', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '\030', '\016', ' ', '\001', '(', '\010', 'R', '\032', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'R',
-'e', 'q', 'u', 'e', 's', 't', 'A', 't', 't', 'e', 'm', 'p', 't', 'C', 'o', 'u', 'n', 't', '\022', 'H', '\n', '!', 'i', 'n', 'c',
-'l', 'u', 'd', 'e', '_', 'a', 't', 't', 'e', 'm', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '_', 'i', 'n', '_', 'r', 'e', 's',
-'p', 'o', 'n', 's', 'e', '\030', '\023', ' ', '\001', '(', '\010', 'R', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'A', 't', 't', 'e', 'm',
-'p', 't', 'C', 'o', 'u', 'n', 't', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'E', '\n', '\014', 'r', 'e', 't', 'r',
-'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\020', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y',
-'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o',
-'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', '\024',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e', 't',
-'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'h', 'e',
-'d', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\021', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i',
-'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e',
-'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030',
-'\022', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U',
-'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f',
-'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r',
-'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030',
-'\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v',
-'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', ':', '\n', '\022', 'T', 'l', 's', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'm', 'e', 'n',
-'t', 'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'N', 'O', 'N', 'E', '\020', '\000', '\022', '\021', '\n', '\r', 'E', 'X', 'T', 'E', 'R', 'N',
-'A', 'L', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\007', '\n', '\003', 'A', 'L', 'L', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ',
-'\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't',
-'u', 'a', 'l', 'H', 'o', 's', 't', 'J', '\004', '\010', '\t', '\020', '\n', 'J', '\004', '\010', '\014', '\020', '\r', 'R', '\021', 'p', 'e', 'r', '_',
-'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', 'd', '\n', '\014', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c',
-'t', 'i', 'o', 'n', '\022', ',', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n',
-':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\254', '\n', '\n', '\005', 'R', 'o', 'u', 't', 'e',
-'\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\016', ' ', '\001', '(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\005', 'm',
-'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\010', '\372', 'B', '\005',
-'\212', '\001', '\002', '\020', '\001', 'R', '\005', 'm', 'a', 't', 'c', 'h', '\022', ':', '\n', '\005', 'r', 'o', 'u', 't', 'e', '\030', '\002', ' ', '\001',
+'o', 'l', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
+'h', 'e', 'r', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r', 'e', 'g', 'e', 'x',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/',
+'t', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n',
+'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n',
+'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r',
+'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm',
+'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r',
+'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r',
+'o', 't', 'o', '\"', '\324', '\014', '\n', '\013', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '\022', '\033', '\n', '\004', 'n', 'a',
+'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ',',
+'\n', '\007', 'd', 'o', 'm', 'a', 'i', 'n', 's', '\030', '\002', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\010', '\001',
+'\"', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\007', 'd', 'o', 'm', 'a', 'i', 'n', 's', '\022', '4', '\n', '\006', 'r', 'o',
+'u', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\034', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'R', '\006', 'r', 'o', 'u', 't', 'e', 's', '\022', '`',
+'\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 't', 'l', 's', '\030', '\004', ' ', '\001', '(', '\016', '2', '5', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a',
+'l', 'H', 'o', 's', 't', '.', 'T', 'l', 's', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'm', 'e', 'n', 't', 'T', 'y', 'p', 'e', 'B',
+'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\n', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'T', 'l', 's', '\022', 'P', '\n', '\020',
+'v', 'i', 'r', 't', 'u', 'a', 'l', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', '%', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'V', 'i', 'r',
+'t', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'R', '\017', 'v', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't',
+'e', 'r', 's', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
+'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'g', '\n', '\026', 'r',
+'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\007', ' ', '\003',
+'(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001',
+'\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd',
+'\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e',
+'m', 'o', 'v', 'e', '\030', '\r', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300',
+'\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e',
+'m', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_',
+'t', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't',
+'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H',
+'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372',
+'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n',
+'s', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's',
+'\030', '\010', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 's', '\n',
+'\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\017', ' ', '\003', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r',
+'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P',
+'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'A', '\n', '\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e',
+'_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'a', 't', 't', 'e', 'm', 'p', 't', '_', 'c', 'o', 'u', 'n', 't', '\030', '\016', ' ',
+'\001', '(', '\010', 'R', '\032', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'A', 't', 't', 'e', 'm', 'p',
+'t', 'C', 'o', 'u', 'n', 't', '\022', 'H', '\n', '!', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'a', 't', 't', 'e', 'm', 'p', 't',
+'_', 'c', 'o', 'u', 'n', 't', '_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\023', ' ', '\001', '(', '\010', 'R',
+'\035', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'A', 't', 't', 'e', 'm', 'p', 't', 'C', 'o', 'u', 'n', 't', 'I', 'n', 'R', 'e', 's',
+'p', 'o', 'n', 's', 'e', '\022', 'E', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\020', ' ', '\001',
'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\005', 'r', 'o', 'u', 't', 'e', '\022', 'C', '\n',
-'\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
-'t', 'i', 'o', 'n', 'H', '\000', 'R', '\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', 'V', '\n', '\017', 'd', 'i', 'r', 'e', 'c',
-'t', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's',
-'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\016', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p',
-'o', 'n', 's', 'e', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't', 'e', 'r', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'A',
-'c', 't', 'i', 'o', 'n', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't',
-'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', '>', '\n', '\t', 'd', 'e', 'c', 'o', 'r', 'a',
-'t', 'o', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', 'R', '\t', 'd', 'e', 'c', 'o', 'r',
-'a', 't', 'o', 'r', '\022', 'm', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e',
-'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd',
-'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's',
-'t', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\t', ' ', '\003', '(', '\013', '2', '\'', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R',
-'\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r',
-'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030',
-'\014', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000',
-'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022',
-'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd',
-'d', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t',
-'\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r',
-'s', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\013', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014',
-'\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a',
-'d', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '8', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030', '\017',
-' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '`', '\n', '\036', 'p',
-'e', 'r', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b',
-'y', 't', 'e', 's', '\030', '\020', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e',
-'s', 't', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e', 's', '\032', ']', '\n', '\031', 'T', 'y', 'p',
-'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n',
-'\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A',
-'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '\037', '\232', '\305', '\210', '\036', '\032', '\n', '\030', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'B', '\r', '\n', '\006',
-'a', 'c', 't', 'i', 'o', 'n', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021',
-'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\353', '\010', '\n', '\017', 'W', 'e', 'i',
-'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Z', '\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030',
-'\001', ' ', '\003', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's',
-'t', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\010', 'c', 'l', 'u', 's',
-'t', 'e', 'r', 's', '\022', 'H', '\n', '\014', 't', 'o', 't', 'a', 'l', '_', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3',
-'2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\013', 't', 'o', 't', 'a', 'l', 'W', 'e', 'i',
-'g', 'h', 't', '\022', ',', '\n', '\022', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'e', 'f', 'i', 'x',
-'\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'K', 'e', 'y', 'P', 'r', 'e', 'f', 'i', 'x', '\032',
-'\330', '\006', '\n', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e',
-'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '4', '\n', '\006',
-'w', 'e', 'i', 'g', 'h', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\006', 'w', 'e', 'i', 'g', 'h', 't',
-'\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'm', 'a', 't', 'c', 'h', '\030', '\003', ' ', '\001', '(', '\013', '2',
-'\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e',
-'t', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022', 'g', '\n', '\026',
-'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\004', ' ',
-'\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222',
-'\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd',
-'d', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r',
-'e', 'm', 'o', 'v', 'e', '\030', '\t', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001',
-'\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm',
-'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't',
-'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i',
-'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e',
-'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e',
-'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\006', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B',
-'\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H',
-'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '\205', '\001', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_',
-'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\n', ' ', '\003', '(', '\013', '2', 'N',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e',
-'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g',
-'h', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n',
-'t', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g',
-'\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E',
-'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n',
-'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '7', '\232', '\305', '\210',
-'\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e',
-'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g',
-'h', 't', 'J', '\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e',
-'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e',
-'r', '\"', '\313', '\010', '\n', '\n', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '\022', '\030', '\n', '\006', 'p', 'r', 'e', 'f', 'i',
-'x', '\030', '\001', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\024', '\n', '\004', 'p', 'a', 't', 'h',
-'\030', '\002', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'N', '\n', '\n', 's', 'a', 'f', 'e', '_', 'r', 'e',
-'g', 'e', 'x', '\030', '\n', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', '\022', '[', '\n', '\017', 'c', 'o',
-'n', 'n', 'e', 'c', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\014', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M',
-'a', 't', 'c', 'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\016', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'A', '\n', '\016', 'c', 'a', 's', 'e', '_', 's', 'e', 'n', 's',
-'i', 't', 'i', 'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'c', 'a', 's', 'e', 'S', 'e', 'n', 's', 'i',
-'t', 'i', 'v', 'e', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\030',
+'3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
+'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\024', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e',
+'d', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\021',
+' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l',
+'i', 'c', 'y', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f', 'f', 'e', 'r',
+'_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\022', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\032',
+'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B', 'y', 't', 'e',
+'s', '\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g',
+'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*',
+'\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', '\"', ':', '\n', '\022',
+'T', 'l', 's', 'R', 'e', 'q', 'u', 'i', 'r', 'e', 'm', 'e', 'n', 't', 'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'N', 'O', 'N',
+'E', '\020', '\000', '\022', '\021', '\n', '\r', 'E', 'X', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\007', '\n',
+'\003', 'A', 'L', 'L', '\020', '\002', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'H', 'o', 's', 't', 'J', '\004', '\010', '\t', '\020',
+'\n', 'J', '\004', '\010', '\014', '\020', '\r', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i',
+'g', '\"', 'd', '\n', '\014', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\022', ',', '\n', '\006', 'a', 'c', 't', 'i',
+'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'A', 'n', 'y', 'R', '\006', 'a', 'c', 't', 'i', 'o', 'n', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't',
+'i', 'o', 'n', '\"', '\216', '\013', '\n', '\005', 'R', 'o', 'u', 't', 'e', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\016', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'A', '\n', '\005', 'm', 'a', 't', 'c', 'h', '\030', '\001', ' ', '\001', '(', '\013', '2', '!',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
+'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'm', 'a', 't', 'c', 'h',
+'\022', ':', '\n', '\005', 'r', 'o', 'u', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
+'n', 'H', '\000', 'R', '\005', 'r', 'o', 'u', 't', 'e', '\022', 'C', '\n', '\010', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\003', ' ',
+'\001', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\010', 'r', 'e', 'd', 'i',
+'r', 'e', 'c', 't', '\022', 'V', '\n', '\017', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '\007',
+' ', '\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'H',
+'\000', 'R', '\016', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', 'J', '\n', '\r', 'f', 'i', 'l', 't',
+'e', 'r', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\021', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'F', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i',
+'o', 'n', 'H', '\000', 'R', '\014', 'f', 'i', 'l', 't', 'e', 'r', 'A', 'c', 't', 'i', 'o', 'n', '\022', '`', '\n', '\025', 'n', 'o', 'n',
+'_', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\022', ' ', '\001', '(', '\013', '2',
+'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'N',
+'o', 'n', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\023', 'n', 'o', 'n',
+'F', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\022', ':', '\n', '\010', 'm', 'e', 't', 'a', 'd',
+'a', 't', 'a', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't',
+'a', '\022', '>', '\n', '\t', 'd', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'D', 'e', 'c', 'o', 'r',
+'a', 't', 'o', 'r', 'R', '\t', 'd', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\022', 'm', '\n', '\027', 't', 'y', 'p', 'e', 'd', '_',
+'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '6',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
+'u', 't', 'e', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E',
+'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i',
+'g', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a',
+'d', 'd', '\030', '\t', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B',
+'\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r',
+'s', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's',
+'_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\014', ' ', '\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"',
+'\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e',
+'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\n', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
+'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's',
+'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'O', '\n', '\032', 'r', 'e', 's', 'p',
+'o', 'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\013', ' ',
+'\003', '(', '\t', 'B', '\022', '\372', 'B', '\017', '\222', '\001', '\014', '\"', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027',
+'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '8',
+'\n', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030', '\017', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't',
+'r', 'a', 'c', 'i', 'n', 'g', '\022', '`', '\n', '\036', 'p', 'e', 'r', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'b', 'u', 'f',
+'f', 'e', 'r', '_', 'l', 'i', 'm', 'i', 't', '_', 'b', 'y', 't', 'e', 's', '\030', '\020', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'R', '\032', 'p', 'e', 'r', 'R', 'e', 'q', 'u', 'e', 's', 't', 'B', 'u', 'f', 'f', 'e', 'r', 'L', 'i', 'm', 'i', 't', 'B',
+'y', 't', 'e', 's', '\032', ']', '\n', '\031', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n',
+'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e',
+'y', '\022', '*', '\n', '\005', 'v', 'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':',
+'\037', '\232', '\305', '\210', '\036', '\032', '\n', '\030', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
+'e', '.', 'R', 'o', 'u', 't', 'e', 'B', '\r', '\n', '\006', 'a', 'c', 't', 'i', 'o', 'n', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010',
+'\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\"', '\245', '\n', '\n', '\017', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Z',
+'\n', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C',
+'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', 'B', '\010', '\372', 'B', '\005',
+'\222', '\001', '\002', '\010', '\001', 'R', '\010', 'c', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', 'H', '\n', '\014', 't', 'o', 't', 'a', 'l', '_',
+'w', 'e', 'i', 'g', 'h', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(',
+'\001', 'R', '\013', 't', 'o', 't', 'a', 'l', 'W', 'e', 'i', 'g', 'h', 't', '\022', ',', '\n', '\022', 'r', 'u', 'n', 't', 'i', 'm', 'e',
+'_', 'k', 'e', 'y', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'r', 'u', 'n', 't', 'i', 'm',
+'e', 'K', 'e', 'y', 'P', 'r', 'e', 'f', 'i', 'x', '\032', '\222', '\010', '\n', '\r', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i',
+'g', 'h', 't', '\022', '-', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\031', '\362', '\230', '\376', '\217', '\005', '\023',
+'\022', '\021', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\004', 'n', 'a', 'm', 'e',
+'\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\014', ' ', '\001', '(', '\t', 'B',
+'$', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', '\362', '\230', '\376', '\217', '\005', '\023', '\022', '\021', 'c', 'l', 'u', 's', 't',
+'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'R', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r', 'H', 'e', 'a', 'd',
+'e', 'r', '\022', '4', '\n', '\006', 'w', 'e', 'i', 'g', 'h', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\006',
+'w', 'e', 'i', 'g', 'h', 't', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'm', 'a', 't', 'c', 'h', '\030',
+'\003', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't',
+'c', 'h', '\022', 'g', '\n', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_',
+'a', 'd', 'd', '\030', '\004', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n',
+'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\023', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e',
+'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'K', '\n', '\031', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r',
+'s', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\t', ' ', '\003', '(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n',
+'\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\026', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r',
+'s', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', 'i', '\n', '\027', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'h', 'e', 'a',
+'d', 'e', 'r', 's', '_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\024', 'r', 'e', 's', 'p',
+'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'A', 'd', 'd', '\022', 'M', '\n', '\032', 'r', 'e', 's', 'p', 'o',
+'n', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'o', '_', 'r', 'e', 'm', 'o', 'v', 'e', '\030', '\006', ' ', '\003',
+'(', '\t', 'B', '\020', '\372', 'B', '\r', '\222', '\001', '\n', '\"', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\027', 'r', 'e', 's',
+'p', 'o', 'n', 's', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o', 'R', 'e', 'm', 'o', 'v', 'e', '\022', '\205', '\001', '\n', '\027',
+'t', 'y', 'p', 'e', 'd', '_', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\n',
+' ', '\003', '(', '\013', '2', 'N', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't',
+'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', '.', 'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o',
+'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y', 'R', '\024', 't', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '?', '\n', '\024', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'l', 'i',
+'t', 'e', 'r', 'a', 'l', '\030', '\013', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H',
+'\000', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'L', 'i', 't', 'e', 'r', 'a', 'l', '\032', ']', '\n', '\031',
+'T', 'y', 'p', 'e', 'd', 'P', 'e', 'r', 'F', 'i', 'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', 'E', 'n', 't', 'r', 'y',
+'\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '*', '\n', '\005', 'v', 'a', 'l',
+'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'A', 'n', 'y', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e', 'i', 'g', 'h', 't',
+'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'W', 'e', 'i', 'g', 'h', 't', 'B', '\030',
+'\n', '\026', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J',
+'\004', '\010', '\007', '\020', '\010', 'J', '\004', '\010', '\010', '\020', '\t', 'R', '\021', 'p', 'e', 'r', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 'c',
+'o', 'n', 'f', 'i', 'g', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', '\"', '\236',
+'\t', '\n', '\n', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '\022', '\030', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\001',
+' ', '\001', '(', '\t', 'H', '\000', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\024', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002', ' ',
+'\001', '(', '\t', 'H', '\000', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'N', '\n', '\n', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x',
+'\030', '\n', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001',
+'\002', '\020', '\001', 'H', '\000', 'R', '\t', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', '\022', '[', '\n', '\017', 'c', 'o', 'n', 'n', 'e',
+'c', 't', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', '\030', '\014', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c',
+'h', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\016', 'c', 'o', 'n', 'n', 'e',
+'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'A', '\n', '\016', 'c', 'a', 's', 'e', '_', 's', 'e', 'n', 's', 'i', 't', 'i',
+'v', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'c', 'a', 's', 'e', 'S', 'e', 'n', 's', 'i', 't', 'i', 'v',
+'e', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\t', ' ', '\001',
+'(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't',
+'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022', '>', '\n', '\007', 'h', 'e', 'a', 'd',
+'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h',
+'e', 'a', 'd', 'e', 'r', 's', '\022', 'W', '\n', '\020', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
+'s', '\030', '\007', ' ', '\003', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
+'u', 't', 'e', '.', 'v', '3', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'R', '\017', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', 'K', '\n', '\004', 'g',
+'r', 'p', 'c', '\030', '\010', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'G', 'r', 'p', 'c', 'R',
+'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\004', 'g', 'r', 'p', 'c', '\022', 'Y', '\n',
+'\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\013', ' ', '\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a',
+'t', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n',
+'s', 'R', '\n', 't', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'Q', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_',
+'m', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\r', ' ', '\003', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'S', '\n', '\025',
+'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ':', '\232', '\305',
+'\210', '\036', '5', '\n', '3', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R',
+'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O',
+'p', 't', 'i', 'o', 'n', 's', '\032', '\311', '\001', '\n', '\026', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c',
+'h', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '8', '\n', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\030', '\001', ' ', '\001',
+'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
+'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\022', '8', '\n', '\t', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', ':',
+';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
+'e', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a',
+'t', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', '\032', '\020', '\n', '\016', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c',
+'h', 'e', 'r', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\025', '\n', '\016', 'p', 'a', 't', 'h', '_',
+'s', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\003', '\020',
+'\004', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\"', '\350', '\004', '\n', '\n', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '_',
+'\n', '\031', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't',
+'c', 'h', '\030', '\013', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\026', 'a', 'l',
+'l', 'o', 'w', 'O', 'r', 'i', 'g', 'i', 'n', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022', '#', '\n', '\r', 'a',
+'l', 'l', 'o', 'w', '_', 'm', 'e', 't', 'h', 'o', 'd', 's', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 'a', 'l', 'l', 'o', 'w',
+'M', 'e', 't', 'h', 'o', 'd', 's', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030',
+'\003', ' ', '\001', '(', '\t', 'R', '\014', 'a', 'l', 'l', 'o', 'w', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '%', '\n', '\016', 'e', 'x',
+'p', 'o', 's', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'e', 'x', 'p', 'o', 's',
+'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'a', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\t',
+'R', '\006', 'm', 'a', 'x', 'A', 'g', 'e', '\022', 'G', '\n', '\021', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'e', 'd', 'e', 'n', 't',
+'i', 'a', 'l', 's', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l', 'o', 'w', 'C', 'r', 'e', 'd', 'e',
+'n', 't', 'i', 'a', 'l', 's', '\022', 'W', '\n', '\016', 'f', 'i', 'l', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030',
'\t', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
'.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c',
-'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022', '>', '\n', '\007', 'h',
-'e', 'a', 'd', 'e', 'r', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
-'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'W', '\n', '\020', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e',
-'t', 'e', 'r', 's', '\030', '\007', ' ', '\003', '(', '\013', '2', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'M',
-'a', 't', 'c', 'h', 'e', 'r', 'R', '\017', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', 'K',
-'\n', '\004', 'g', 'r', 'p', 'c', '\030', '\010', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', '.', 'G', 'r',
-'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\004', 'g', 'r', 'p', 'c',
-'\022', 'Y', '\n', '\013', 't', 'l', 's', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\013', ' ', '\001', '(', '\013', '2', '8', '.', 'e',
+'e', 'n', 't', 'H', '\000', 'R', '\r', 'f', 'i', 'l', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'U', '\n', '\016', 's',
+'h', 'a', 'd', 'o', 'w', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\n', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e',
+'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\r', 's', 'h', 'a', 'd', 'o', 'w',
+'E', 'n', 'a', 'b', 'l', 'e', 'd', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\023', '\n', '\021', 'e',
+'n', 'a', 'b', 'l', 'e', 'd', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010',
+'\010', '\020', '\t', 'J', '\004', '\010', '\007', '\020', '\010', 'R', '\014', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', 'R', '\022',
+'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 'r', 'e', 'g', 'e', 'x', 'R', '\007', 'e', 'n', 'a', 'b', 'l',
+'e', 'd', '\"', '\262', '\'', '\n', '\013', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022', '#', '\n', '\007', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\007', 'c', 'l',
+'u', 's', 't', 'e', 'r', '\022', '6', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\002',
+' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'H', '\000', 'R', '\r', 'c', 'l',
+'u', 's', 't', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'U', '\n', '\021', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'c',
+'l', 'u', 's', 't', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's',
+'t', 'e', 'r', 'H', '\000', 'R', '\020', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', ':',
+'\n', '\030', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '_', 'p', 'l', 'u', 'g', 'i',
+'n', '\030', '%', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\026', 'c', 'l', 'u', 's', 't', 'e', 'r', 'S', 'p', 'e', 'c', 'i', 'f', 'i',
+'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', '\022', '\216', '\001', '\n', '\037', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'n', 'o', 't', '_',
+'f', 'o', 'u', 'n', 'd', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\024', ' ', '\001', '(', '\016',
+'2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
+'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u',
+'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
+'\033', 'c', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C',
+'o', 'd', 'e', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001',
+'(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022',
+'2', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'B', '\013',
+'\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\r', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'e', 'w', 'r', 'i', 't',
+'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', ' ', ' ', '\001', '(', '\013', '2',
+'.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R',
+'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', 'R', '\014', 'r',
+'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '?', '\n', '\024', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i',
+'t', 'e', '_', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001',
+'\002', '\310', '\001', '\000', 'H', '\001', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'L', 'i', 't', 'e', 'r', 'a',
+'l', '\022', 'H', '\n', '\021', 'a', 'u', 't', 'o', '_', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\007', ' ',
+'\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o',
+'l', 'V', 'a', 'l', 'u', 'e', 'H', '\001', 'R', '\017', 'a', 'u', 't', 'o', 'H', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e',
+'\022', '=', '\n', '\023', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\035',
+' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310', '\001', '\000', 'H', '\001', 'R', '\021', 'h', 'o', 's', 't',
+'R', 'e', 'w', 'r', 'i', 't', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'g', '\n', '\027', 'h', 'o', 's', 't', '_', 'r', 'e', 'w',
+'r', 'i', 't', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'e', 'g', 'e', 'x', '\030', '#', ' ', '\001', '(', '\013', '2', '.', '.', 'e',
+'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e',
+'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', 'H', '\001', 'R', '\024', 'h', 'o',
+'s', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'P', 'a', 't', 'h', 'R', 'e', 'g', 'e', 'x', '\022', '3', '\n', '\007', 't', 'i', 'm',
+'e', 'o', 'u', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014',
+'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l',
+'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'E', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030',
+'\t', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o',
+'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e',
+'d', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '!', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T',
+'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r',
+'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\036', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
+'t', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R',
+'\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\022', 'K', '\n',
+'\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\013', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o',
+'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022',
+'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 's', '\030', '\r', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
+'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', '\\', '\n', '\026', 'i', 'n', 'c', 'l', 'u',
+'d', 'e', '_', 'v', 'h', '_', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u',
+'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\023', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'V', 'h',
+'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'N', '\n', '\013', 'h', 'a', 's', 'h', '_', 'p', 'o', 'l', 'i', 'c', 'y',
+'\030', '\017', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l',
+'i', 'c', 'y', 'R', '\n', 'h', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030', '\021',
+' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 'P', '\n', '\020', 'm',
+'a', 'x', '_', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\027', ' ', '\001', '(', '\013', '2', '\031', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\013',
+'\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\016', 'm', 'a', 'x', 'G', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o',
+'u', 't', '\022', 'V', '\n', '\023', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'o', 'f', 'f', 's', 'e', 't',
+'\030', '\034', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\021', 'g', 'r',
+'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'O', 'f', 'f', 's', 'e', 't', '\022', 'Y', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd',
+'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
+'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', 's', '\022', 'g', '\n', '\030', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e',
+'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\"', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e',
+'d', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\026', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd',
+'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\200', '\001', '\n', '\030', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_',
+'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\032', ' ', '\001', '(', '\016', '2', '9', '.', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't',
-'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't',
-'i', 'o', 'n', 's', 'R', '\n', 't', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\032', 'S', '\n', '\025', 'G', 'r', 'p', 'c', 'R',
-'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n', 's', ':', ':', '\232', '\305', '\210', '\036', '5', '\n', '3',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'M',
-'a', 't', 'c', 'h', '.', 'G', 'r', 'p', 'c', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i', 'o', 'n',
-'s', '\032', '\311', '\001', '\n', '\026', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p', 't', 'i',
-'o', 'n', 's', '\022', '8', '\n', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e',
-'R', '\t', 'p', 'r', 'e', 's', 'e', 'n', 't', 'e', 'd', '\022', '8', '\n', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'd', ':', ';', '\232', '\305', '\210', '\036',
-'6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u',
-'t', 'e', 'M', 'a', 't', 'c', 'h', '.', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'M', 'a', 't', 'c', 'h', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\032', '\020', '\n', '\016', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', 'e', 'r', ':', '$',
-'\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'R', 'o', 'u', 't', 'e', 'M', 'a', 't', 'c', 'h', 'B', '\025', '\n', '\016', 'p', 'a', 't', 'h', '_', 's', 'p', 'e', 'c', 'i',
-'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\005', '\020', '\006', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\005', 'r', 'e',
-'g', 'e', 'x', '\"', '\350', '\004', '\n', '\n', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '_', '\n', '\031', 'a', 'l', 'l',
-'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\013', ' ',
-'\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\026', 'a', 'l', 'l', 'o', 'w', 'O', 'r',
-'i', 'g', 'i', 'n', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_',
-'m', 'e', 't', 'h', 'o', 'd', 's', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 'a', 'l', 'l', 'o', 'w', 'M', 'e', 't', 'h', 'o',
-'d', 's', '\022', '#', '\n', '\r', 'a', 'l', 'l', 'o', 'w', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\t',
-'R', '\014', 'a', 'l', 'l', 'o', 'w', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '%', '\n', '\016', 'e', 'x', 'p', 'o', 's', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\r', 'e', 'x', 'p', 'o', 's', 'e', 'H', 'e', 'a', 'd',
-'e', 'r', 's', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'a', 'g', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'R', '\006', 'm', 'a', 'x',
-'A', 'g', 'e', '\022', 'G', '\n', '\021', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l', 's', '\030',
-'\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'a', 'l', 'l', 'o', 'w', 'C', 'r', 'e', 'd', 'e', 'n', 't', 'i', 'a', 'l',
-'s', '\022', 'W', '\n', '\016', 'f', 'i', 'l', 't', 'e', 'r', '_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\t', ' ', '\001', '(', '\013',
-'2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'H', '\000',
-'R', '\r', 'f', 'i', 'l', 't', 'e', 'r', 'E', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'U', '\n', '\016', 's', 'h', 'a', 'd', 'o', 'w',
-'_', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\n', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't',
-'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\r', 's', 'h', 'a', 'd', 'o', 'w', 'E', 'n', 'a', 'b', 'l',
-'e', 'd', ':', '$', '\232', '\305', '\210', '\036', '\037', '\n', '\035', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
-'o', 'u', 't', 'e', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\023', '\n', '\021', 'e', 'n', 'a', 'b', 'l', 'e',
-'d', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004',
-'\010', '\007', '\020', '\010', 'R', '\014', 'a', 'l', 'l', 'o', 'w', '_', 'o', 'r', 'i', 'g', 'i', 'n', 'R', '\022', 'a', 'l', 'l', 'o', 'w',
-'_', 'o', 'r', 'i', 'g', 'i', 'n', '_', 'r', 'e', 'g', 'e', 'x', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\"', '\310', '&',
-'\n', '\013', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022', '#', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030',
-'\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'\022', '6', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'B',
-'\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'H', '\000', 'R', '\r', 'c', 'l', 'u', 's', 't', 'e', 'r',
-'H', 'e', 'a', 'd', 'e', 'r', '\022', 'U', '\n', '\021', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', '_', 'c', 'l', 'u', 's', 't', 'e',
-'r', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r',
-'o', 'u', 't', 'e', '.', 'v', '3', '.', 'W', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H', '\000',
-'R', '\020', 'w', 'e', 'i', 'g', 'h', 't', 'e', 'd', 'C', 'l', 'u', 's', 't', 'e', 'r', 's', '\022', '\216', '\001', '\n', '\037', 'c', 'l',
-'u', 's', 't', 'e', 'r', '_', 'n', 'o', 't', '_', 'f', 'o', 'u', 'n', 'd', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_',
-'c', 'o', 'd', 'e', '\030', '\024', ' ', '\001', '(', '\016', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'C', 'l', 'u',
-'s', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 'B',
-'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\033', 'c', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n',
-'d', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', 'E', '\n', '\016', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
-'_', 'm', 'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\013', '2', '\036', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'R', '\r', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i',
-'t', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\r', 'p', 'r',
-'e', 'f', 'i', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r',
-'i', 't', 'e', '\030', ' ', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b',
-'s', 't', 'i', 't', 'u', 't', 'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '?', '\n', '\024',
-'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'l', 'i', 't', 'e', 'r', 'a', 'l', '\030', '\006', ' ', '\001', '(',
-'\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\022', 'h', 'o', 's', 't', 'R', 'e', 'w',
-'r', 'i', 't', 'e', 'L', 'i', 't', 'e', 'r', 'a', 'l', '\022', 'H', '\n', '\021', 'a', 'u', 't', 'o', '_', 'h', 'o', 's', 't', '_',
-'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\007', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'H', '\001', 'R', '\017', 'a', 'u', 't', 'o', 'H',
-'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', '=', '\n', '\023', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't',
-'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\035', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\001', '\310',
-'\001', '\000', 'H', '\001', 'R', '\021', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'H', 'e', 'a', 'd', 'e', 'r', '\022', 'g',
-'\n', '\027', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'e', 'g', 'e', 'x',
-'\030', '#', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h',
-'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i',
-'t', 'u', 't', 'e', 'H', '\001', 'R', '\024', 'h', 'o', 's', 't', 'R', 'e', 'w', 'r', 'i', 't', 'e', 'P', 'a', 't', 'h', 'R', 'e',
-'g', 'e', 'x', '\022', '3', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\007', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\022', '<', '\n', '\014', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ',
-'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
-'a', 't', 'i', 'o', 'n', 'R', '\013', 'i', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'E', '\n', '\014', 'r', 'e', 't',
-'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\t', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
-'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'O', '\n', '\031', 'r', 'e', 't', 'r', 'y', '_', 'p',
-'o', 'l', 'i', 'c', 'y', '_', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '!', ' ', '\001', '(', '\013', '2',
-'\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\026', 'r', 'e',
-'t', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'T', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'n', '\n', '\027', 'r',
-'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'i', 'e', 's', '\030', '\036', ' ',
-'\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r',
-'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P',
-'o', 'l', 'i', 'c', 'i', 'e', 's', '\022', 'K', '\n', '\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\013', ' ', '\001', '(', '\016',
-'2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'o', 'u', 't', 'i', 'n', 'g', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
-'\010', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'A', '\n', '\013', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 's', '\030',
-'\r', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'R', '\n', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
-'s', '\022', 'S', '\n', '\026', 'i', 'n', 'c', 'l', 'u', 'd', 'e', '_', 'v', 'h', '_', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i',
-'t', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\023', 'i', 'n', 'c', 'l', 'u', 'd', 'e', 'V',
-'h', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 's', '\022', 'N', '\n', '\013', 'h', 'a', 's', 'h', '_', 'p', 'o', 'l', 'i', 'c',
-'y', '\030', '\017', ' ', '\003', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
-'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o',
-'l', 'i', 'c', 'y', 'R', '\n', 'h', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '5', '\n', '\004', 'c', 'o', 'r', 's', '\030',
-'\021', ' ', '\001', '(', '\013', '2', '!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
-'e', '.', 'v', '3', '.', 'C', 'o', 'r', 's', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\004', 'c', 'o', 'r', 's', '\022', 'G', '\n', '\020',
-'m', 'a', 'x', '_', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\027', ' ', '\001', '(', '\013', '2', '\031', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B',
-'\002', '\030', '\001', 'R', '\016', 'm', 'a', 'x', 'G', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\023', 'g', 'r',
-'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'o', 'f', 'f', 's', 'e', 't', '\030', '\034', ' ', '\001', '(', '\013', '2', '\031',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'B', '\002', '\030', '\001', 'R', '\021', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'O', 'f', 'f', 's', 'e', 't', '\022', 'Y',
-'\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\031', ' ', '\003', '(', '\013', '2', '0',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o',
-'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016',
-'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', 'g', '\n', '\030', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\"', ' ', '\001', '(', '\013', '2', '-',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'I', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\026', 'i', 'n', 't',
-'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'w', '\n', '\030', 'i', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\032', ' ',
-'\001', '(', '\016', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e',
-'d', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\002', '\030', '\001', 'R', '\026', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', 'V', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\030', '\037', ' ', '\001', '(', '\013', '2', '\034', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l',
-'u', 'e', 'B', '\002', '\030', '\001', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e',
-'c', 't', 's', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\033', ' ', '\001', '(', '\013',
-'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'h', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022',
-'d', '\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '$', ' ',
-'\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
-'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D',
-'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o',
-'n', '\032', '\242', '\002', '\n', '\023', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', '!', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Y', '\n', '\020', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a',
-'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n',
-'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'r', 'u', 'n', 't', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o',
-'n', '\022', '?', '\n', '\r', 't', 'r', 'a', 'c', 'e', '_', 's', 'a', 'm', 'p', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2',
-'\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l',
-'u', 'e', 'R', '\014', 't', 'r', 'a', 'c', 'e', 'S', 'a', 'm', 'p', 'l', 'e', 'd', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M', 'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y',
-'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'k', 'e', 'y', '\032', '\226', '\n', '\n', '\n', 'H',
-'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'N', '\n', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013',
-'2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e',
-'a', 'd', 'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r', '\022', 'N', '\n', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A',
+'c', 't', 'i', 'o', 'n', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\026', 'i', 'n', 't', 'e', 'r',
+'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '_', '\n', '\026', 'm', 'a', 'x', '_',
+'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\030', '\037', ' ', '\001', '(', '\013', '2',
+'\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V',
+'a', 'l', 'u', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't',
+'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\022', 'E', '\n', '\014', 'h', 'e', 'd', 'g', 'e', '_', 'p',
+'o', 'l', 'i', 'c', 'y', '\030', '\033', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'h',
+'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'd', '\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_',
+'d', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n',
+'.', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't',
+'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\032', '\242', '\002', '\n', '\023', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M',
+'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '!', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', 'Y', '\n', '\020',
+'r', 'u', 'n', 't', 'i', 'm', 'e', '_', 'f', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\013', '2', '.', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'u', 'n', 't',
+'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'r', 'u', 'n',
+'t', 'i', 'm', 'e', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', '\022', '?', '\n', '\r', 't', 'r', 'a', 'c', 'e', '_', 's', 'a', 'm',
+'p', 'l', 'e', 'd', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\014', 't', 'r', 'a', 'c', 'e', 'S', 'a', 'm', 'p', 'l',
+'e', 'd', ':', '9', '\232', '\305', '\210', '\036', '4', '\n', '2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
+'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'M',
+'i', 'r', 'r', 'o', 'r', 'P', 'o', 'l', 'i', 'c', 'y', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\013', 'r', 'u', 'n', 't', 'i', 'm',
+'e', '_', 'k', 'e', 'y', '\032', '\226', '\n', '\n', '\n', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'N', '\n', '\006', 'h',
+'e', 'a', 'd', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a',
+'s', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'H', '\000', 'R', '\006', 'h', 'e', 'a', 'd', 'e', 'r',
+'\022', 'N', '\n', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i',
+'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', 'H', '\000', 'R', '\006', 'c',
+'o', 'o', 'k', 'i', 'e', '\022', 'y', '\n', '\025', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 'p', 'e',
+'r', 't', 'i', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', 'B', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a',
+'s', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r',
+'t', 'i', 'e', 's', 'H', '\000', 'R', '\024', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't',
+'i', 'e', 's', '\022', 'g', '\n', '\017', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\030', '\005', ' ',
+'\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y',
+'.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'H', '\000', 'R', '\016', 'q', 'u', 'e', 'r', 'y', 'P',
+'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '^', '\n', '\014', 'f', 'i', 'l', 't', 'e', 'r', '_', 's', 't', 'a', 't', 'e', '\030',
+'\006', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i',
-'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', 'H', '\000', 'R', '\006', 'c', 'o', 'o', 'k', 'i', 'e', '\022', 'y', '\n', '\025', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013',
-'2', 'B', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 'H', '\000', 'R', '\024', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', 'g', '\n', '\017', 'q', 'u', 'e', 'r',
-'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\030', '\005', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't',
-'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm',
-'e', 't', 'e', 'r', 'H', '\000', 'R', '\016', 'q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '^', '\n',
-'\014', 'f', 'i', 'l', 't', 'e', 'r', '_', 's', 't', 'a', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't',
-'a', 't', 'e', 'H', '\000', 'R', '\013', 'f', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\032', '\n', '\010', 't', 'e', 'r',
-'m', 'i', 'n', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\010', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l', '\032', '\306', '\001', '\n',
-'\006', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
-'\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e',
-'r', 'N', 'a', 'm', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't',
-'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c',
-'t', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'H', 'e', 'a', 'd', 'e', 'r', '\032', '\237', '\001',
-'\n', '\006', 'C', 'o', 'o', 'k', 'i', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\003', 't', 't', 'l', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
-'o', 'n', 'R', '\003', 't', 't', 'l', '\022', '\022', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 'p', 'a',
-'t', 'h', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r',
-'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i',
-'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', '\032', 'z', '\n', '\024', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r',
-'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', '\033', '\n', '\t', 's', 'o', 'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\001', ' ', '\001',
-'(', '\010', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', ':', 'E', '\232', '\305', '\210', '\036', '@', '\n', '>', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
-'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r',
-'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\032', 'n', '\n', '\016', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e',
-'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
-'\004', 'n', 'a', 'm', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P',
-'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\032', 'f', '\n', '\013', 'F',
-'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', ':', '<', '\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o',
-'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', ':',
-'0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
-'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'B',
-'\027', '\n', '\020', 'p', 'o', 'l', 'i', 'c', 'y', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032',
-'\243', '\003', '\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '0', '\n', '\014', 'u', 'p', 'g', 'r',
-'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
-'\002', '\310', '\001', '\000', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b',
-'l', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'e', '\n', '\016',
-'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '>', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e',
-'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 'n',
-'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\r', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032',
-'\215', '\001', '\n', '\r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ']', '\n', '\025', 'p', 'r', 'o', 'x',
-'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ')',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'r', 'o',
-'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\023', 'p', 'r', 'o', 'x', 'y', 'P', 'r',
-'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035', '\n', '\n', 'a', 'l', 'l', 'o', 'w', '_', 'p', 'o', 's',
-'t', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\t', 'a', 'l', 'l', 'o', 'w', 'P', 'o', 's', 't', ':', '3', '\232', '\305', '\210', '\036', '.',
-'\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't',
-'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\210', '\002', '\n',
-'\021', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'I', '\n', '\023', 'm', 'a', 'x',
-'_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.',
+'c', 'y', '.', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', 'H', '\000', 'R', '\013', 'f', 'i', 'l', 't', 'e', 'r', 'S',
+'t', 'a', 't', 'e', '\022', '\032', '\n', '\010', 't', 'e', 'r', 'm', 'i', 'n', 'a', 'l', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\010', 't',
+'e', 'r', 'm', 'i', 'n', 'a', 'l', '\032', '\306', '\001', '\n', '\006', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '.', '\n', '\013', 'h', 'e', 'a',
+'d', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'S', '\n', '\r', 'r', 'e', 'g', 'e', 'x',
+'_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A',
+'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't',
+'e', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o',
+'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c',
+'y', '.', 'H', 'e', 'a', 'd', 'e', 'r', '\032', '\237', '\001', '\n', '\006', 'C', 'o', 'o', 'k', 'i', 'e', '\022', '\033', '\n', '\004', 'n', 'a',
+'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+',
+'\n', '\003', 't', 't', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 't', 't', 'l', '\022', '\022', '\n', '\004', 'p', 'a', 't',
+'h', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\004', 'p', 'a', 't', 'h', ':', '7', '\232', '\305', '\210', '\036', '2', '\n', '0', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i',
+'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C', 'o', 'o', 'k', 'i', 'e', '\032', 'z', '\n', '\024', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\022', '\033', '\n', '\t', 's', 'o',
+'u', 'r', 'c', 'e', '_', 'i', 'p', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 's', 'o', 'u', 'r', 'c', 'e', 'I', 'p', ':', 'E',
+'\232', '\305', '\210', '\036', '@', '\n', '>', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', '\032', 'n', '\n', '\016', 'Q', 'u',
+'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', ':', '?', '\232', '\305', '\210', '\036', ':', '\n', '8',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A',
+'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r',
+'a', 'm', 'e', 't', 'e', 'r', '\032', 'f', '\n', '\013', 'F', 'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', '\022', '\031', '\n', '\003',
+'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\003', 'k', 'e', 'y', ':', '<',
+'\232', '\305', '\210', '\036', '7', '\n', '5', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'F',
+'i', 'l', 't', 'e', 'r', 'S', 't', 'a', 't', 'e', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.',
+'H', 'a', 's', 'h', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\027', '\n', '\020', 'p', 'o', 'l', 'i', 'c', 'y', '_', 's', 'p', 'e', 'c',
+'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', '\032', '\243', '\003', '\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', '0', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\t',
+'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T',
+'y', 'p', 'e', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007',
+'e', 'n', 'a', 'b', 'l', 'e', 'd', '\022', 'e', '\n', '\016', 'c', 'o', 'n', 'n', 'e', 'c', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '>', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e',
+'C', 'o', 'n', 'f', 'i', 'g', '.', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\r', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\215', '\001', '\n', '\r', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'C', 'o', 'n',
+'f', 'i', 'g', '\022', ']', '\n', '\025', 'p', 'r', 'o', 'x', 'y', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'P', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f',
+'i', 'g', 'R', '\023', 'p', 'r', 'o', 'x', 'y', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\035',
+'\n', '\n', 'a', 'l', 'l', 'o', 'w', '_', 'p', 'o', 's', 't', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\t', 'a', 'l', 'l', 'o', 'w',
+'P', 'o', 's', 't', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2',
+'.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', '.', 'U', 'p', 'g', 'r', 'a', 'd',
+'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\210', '\002', '\n', '\021', 'M', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '\022', 'I', '\n', '\023', 'm', 'a', 'x', '_', 's', 't', 'r', 'e', 'a', 'm', '_', 'd', 'u', 'r', 'a', 't', 'i',
+'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', '\022', 'P', '\n', '\027', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd',
+'e', 'r', '_', 'm', 'a', 'x', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\024', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o',
+'u', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'x', '\022', 'V', '\n', '\032', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o',
+'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'o', 'f', 'f', 's', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R',
-'\021', 'm', 'a', 'x', 'S', 't', 'r', 'e', 'a', 'm', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', 'P', '\n', '\027', 'g', 'r', 'p',
-'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 'x', '\030', '\002', ' ', '\001', '(',
-'\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't',
-'i', 'o', 'n', 'R', '\024', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 'x',
-'\022', 'V', '\n', '\032', 'g', 'r', 'p', 'c', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'o',
-'f', 'f', 's', 'e', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\027', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u',
-'t', 'H', 'e', 'a', 'd', 'e', 'r', 'O', 'f', 'f', 's', 'e', 't', '\"', 'E', '\n', '\033', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N',
-'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\027', '\n', '\023', 'S', 'E',
-'R', 'V', 'I', 'C', 'E', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A', 'B', 'L', 'E', '\020', '\000', '\022', '\r', '\n', '\t', 'N', 'O',
-'T', '_', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\"', '^', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i',
-'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\"', '\n', '\036', 'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G',
-'H', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\000', '\022', '\034', '\n', '\030',
-'H', 'A', 'N', 'D', 'L', 'E', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020',
-'\001', '\032', '\002', '\030', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\030', '\n', '\021', 'c', 'l',
-'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\030', '\n', '\026', 'h',
-'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\014',
-'\020', '\r', 'J', '\004', '\010', '\022', '\020', '\023', 'J', '\004', '\010', '\023', '\020', '\024', 'J', '\004', '\010', '\020', '\020', '\021', 'J', '\004', '\010', '\026', '\020',
-'\027', 'J', '\004', '\010', '\025', '\020', '\026', 'J', '\004', '\010', '\n', '\020', '\013', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i',
-'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\"', '\215', '\017', '\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i',
-'c', 'y', '\022', '\031', '\n', '\010', 'r', 'e', 't', 'r', 'y', '_', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'r', 'e', 't',
-'r', 'y', 'O', 'n', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
-'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n', '\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e',
-'s', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022', 'A', '\n', '\017', 'p', 'e', 'r', '_', 't', 'r', 'y', '_',
-'t', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'p', 'e', 'r', 'T', 'r', 'y', 'T', 'i',
-'m', 'e', 'o', 'u', 't', '\022', 'W', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\004',
-' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o',
-'r', 'i', 't', 'y', 'R', '\r', 'r', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', 'g', '\n', '\024', 'r', 'e',
-'t', 'r', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\030', '\005', ' ', '\003', '(', '\013', '2',
-'5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
-'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i',
-'c', 'a', 't', 'e', 'R', '\022', 'r', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022',
-'H', '\n', '!', 'h', 'o', 's', 't', '_', 's', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_', 'r', 'e', 't', 'r', 'y', '_', 'm',
-'a', 'x', '_', 'a', 't', 't', 'e', 'm', 'p', 't', 's', '\030', '\006', ' ', '\001', '(', '\003', 'R', '\035', 'h', 'o', 's', 't', 'S', 'e',
-'l', 'e', 'c', 't', 'i', 'o', 'n', 'R', 'e', 't', 'r', 'y', 'M', 'a', 'x', 'A', 't', 't', 'e', 'm', 'p', 't', 's', '\022', '4',
-'\n', '\026', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e', 's', '\030',
-'\007', ' ', '\003', '(', '\r', 'R', '\024', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'd',
-'e', 's', '\022', 'U', '\n', '\016', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\010', ' ', '\001', '(',
-'\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f',
-'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'x', '\n', '\033', 'r', 'a', 't', 'e', '_', 'l', 'i',
-'m', 'i', 't', 'e', 'd', '_', 'r', 'e', 't', 'r', 'y', '_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\013', ' ', '\001', '(',
-'\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R',
-'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', 'R', '\027', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R',
-'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'Q', '\n', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_',
-'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'R', '\020', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '`', '\n', '\031', 'r', 'e',
-'t', 'r', 'i', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\n',
-' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\027', 'r', 'e', 't', 'r', 'i', 'a',
-'b', 'l', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\032', '\271', '\001', '\n', '\r', 'R', 'e', 't',
-'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c',
-'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '3',
-'\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't',
-'y', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c',
-'o', 'n', 'f', 'i', 'g', '\032', '\303', '\001', '\n', '\022', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c',
-'a', 't', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003',
-' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n',
-'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P',
-'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B',
-'\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n',
-'f', 'i', 'g', '\032', '\326', '\001', '\n', '\014', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'J', '\n', '\r', 'b',
-'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
-'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007',
-'\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\014', 'b', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'F', '\n', '\014',
+'\027', 'g', 'r', 'p', 'c', 'T', 'i', 'm', 'e', 'o', 'u', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'O', 'f', 'f', 's', 'e', 't', '\"',
+'E', '\n', '\033', 'C', 'l', 'u', 's', 't', 'e', 'r', 'N', 'o', 't', 'F', 'o', 'u', 'n', 'd', 'R', 'e', 's', 'p', 'o', 'n', 's',
+'e', 'C', 'o', 'd', 'e', '\022', '\027', '\n', '\023', 'S', 'E', 'R', 'V', 'I', 'C', 'E', '_', 'U', 'N', 'A', 'V', 'A', 'I', 'L', 'A',
+'B', 'L', 'E', '\020', '\000', '\022', '\r', '\n', '\t', 'N', 'O', 'T', '_', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\"', '^', '\n', '\026', 'I',
+'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\"', '\n', '\036',
+'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G', 'H', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A', 'L', '_', 'R', 'E', 'D',
+'I', 'R', 'E', 'C', 'T', '\020', '\000', '\022', '\034', '\n', '\030', 'H', 'A', 'N', 'D', 'L', 'E', '_', 'I', 'N', 'T', 'E', 'R', 'N', 'A',
+'L', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\001', '\032', '\002', '\030', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'o', 'u', 't', 'e', 'A',
+'c', 't', 'i', 'o', 'n', 'B', '\030', '\n', '\021', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
+'r', '\022', '\003', '\370', 'B', '\001', 'B', '\030', '\n', '\026', 'h', 'o', 's', 't', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p',
+'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\014', '\020', '\r', 'J', '\004', '\010', '\022', '\020', '\023', 'J', '\004', '\010', '\023', '\020', '\024',
+'J', '\004', '\010', '\020', '\020', '\021', 'J', '\004', '\010', '\026', '\020', '\027', 'J', '\004', '\010', '\025', '\020', '\026', 'J', '\004', '\010', '\n', '\020', '\013', 'R',
+'\025', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'm', 'i', 'r', 'r', 'o', 'r', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\"', '\277', '\020',
+'\n', '\013', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\031', '\n', '\010', 'r', 'e', 't', 'r', 'y', '_', 'o', 'n',
+'\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 'r', 'e', 't', 'r', 'y', 'O', 'n', '\022', 'R', '\n', '\013', 'n', 'u', 'm', '_', 'r', 'e',
+'t', 'r', 'i', 'e', 's', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
+'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\023', '\362', '\230', '\376', '\217', '\005', '\r', '\n',
+'\013', 'm', 'a', 'x', '_', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R', '\n', 'n', 'u', 'm', 'R', 'e', 't', 'r', 'i', 'e', 's', '\022',
+'A', '\n', '\017', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\r', 'p', 'e', 'r', 'T', 'r', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'J', '\n', '\024', 'p', 'e', 'r', '_', 't',
+'r', 'y', '_', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\r', ' ', '\001', '(', '\013', '2', '\031', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\021',
+'p', 'e', 'r', 'T', 'r', 'y', 'I', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'W', '\n', '\016', 'r', 'e', 't', 'r',
+'y', '_', 'p', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\030', '\004', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i',
+'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'R', '\r', 'r', 'e', 't', 'r', 'y', 'P', 'r',
+'i', 'o', 'r', 'i', 't', 'y', '\022', 'g', '\n', '\024', 'r', 'e', 't', 'r', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'r', 'e', 'd',
+'i', 'c', 'a', 't', 'e', '\030', '\005', ' ', '\003', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
+'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e',
+'t', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'R', '\022', 'r', 'e', 't', 'r', 'y', 'H', 'o',
+'s', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', 'd', '\n', '\030', 'r', 'e', 't', 'r', 'y', '_', 'o', 'p', 't', 'i',
+'o', 'n', 's', '_', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\030', '\014', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E',
+'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\026', 'r', 'e', 't', 'r', 'y', 'O', 'p', 't', 'i',
+'o', 'n', 's', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\022', 'H', '\n', '!', 'h', 'o', 's', 't', '_', 's', 'e', 'l',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'r', 'e', 't', 'r', 'y', '_', 'm', 'a', 'x', '_', 'a', 't', 't', 'e', 'm', 'p', 't', 's',
+'\030', '\006', ' ', '\001', '(', '\003', 'R', '\035', 'h', 'o', 's', 't', 'S', 'e', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'R', 'e', 't', 'r',
+'y', 'M', 'a', 'x', 'A', 't', 't', 'e', 'm', 'p', 't', 's', '\022', '4', '\n', '\026', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e',
+'_', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e', 's', '\030', '\007', ' ', '\003', '(', '\r', 'R', '\024', 'r', 'e', 't', 'r',
+'i', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', 's', '\022', 'U', '\n', '\016', 'r', 'e', 't', 'r', 'y',
+'_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\010', ' ', '\001', '(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
+'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', 'R', '\014', 'r', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k',
+'O', 'f', 'f', '\022', 'x', '\n', '\033', 'r', 'a', 't', 'e', '_', 'l', 'i', 'm', 'i', 't', 'e', 'd', '_', 'r', 'e', 't', 'r', 'y',
+'_', 'b', 'a', 'c', 'k', '_', 'o', 'f', 'f', '\030', '\013', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
+'y', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f',
+'R', '\027', 'r', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f',
+'\022', 'Q', '\n', '\021', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\t', ' ', '\003',
+'(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
+'3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\020', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l',
+'e', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '`', '\n', '\031', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', '_', 'r', 'e', 'q',
+'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\n', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M',
+'a', 't', 'c', 'h', 'e', 'r', 'R', '\027', 'r', 'e', 't', 'r', 'i', 'a', 'b', 'l', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H',
+'e', 'a', 'd', 'e', 'r', 's', '\032', '\271', '\001', '\n', '\r', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', '\022',
+'\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n',
+'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013',
+'2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R',
+'\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o',
+'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c',
+'y', '.', 'R', 'e', 't', 'r', 'y', 'P', 'r', 'i', 'o', 'r', 'i', 't', 'y', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g',
+'_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\032', '\303', '\001', '\n', '\022', 'R',
+'e', 't', 'r', 'y', 'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e',
+'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014',
+'t', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C',
+'o', 'n', 'f', 'i', 'g', ':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
+'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y',
+'H', 'o', 's', 't', 'P', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't',
+'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\032', '\326', '\001', '\n', '\014', 'R', 'e', 't',
+'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', 'J', '\n', '\r', 'b', 'a', 's', 'e', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a',
+'l', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\n', '\372', 'B', '\007', '\252', '\001', '\004', '\010', '\001', '*', '\000', 'R', '\014', 'b', 'a',
+'s', 'e', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\022', 'F', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a',
+'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I',
+'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't',
+'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\032', '\210', '\001', '\n', '\013', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r',
+'\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'V', '\n', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(',
+'\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
+'.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F',
+'o', 'r', 'm', 'a', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\032', '\300',
+'\001', '\n', '\027', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f',
+'f', '\022', ']', '\n', '\r', 'r', 'e', 's', 'e', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2',
+'.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
+'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'B', '\010', '\372',
+'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\014', 'r', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'F', '\n', '\014',
'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g',
'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
-'\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', ':', '2', '\232', '\305', '\210', '\036', '-',
-'\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r',
-'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\032', '\210', '\001', '\n', '\013',
-'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'V', '\n', '\006',
-'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ', '\001', '(', '\016', '2', '4', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R',
-'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020',
-'\001', 'R', '\006', 'f', 'o', 'r', 'm', 'a', 't', '\032', '\300', '\001', '\n', '\027', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', 'e', 'd',
-'R', 'e', 't', 'r', 'y', 'B', 'a', 'c', 'k', 'O', 'f', 'f', '\022', ']', '\n', '\r', 'r', 'e', 's', 'e', 't', '_', 'h', 'e', 'a',
-'d', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '.', 'R', 'e', 's',
-'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\014', 'r', 'e', 's', 'e', 't',
-'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', 'F', '\n', '\014', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\030', '\002',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e',
-'r', 'v', 'a', 'l', '\"', '4', '\n', '\021', 'R', 'e', 's', 'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't',
-'\022', '\013', '\n', '\007', 'S', 'E', 'C', 'O', 'N', 'D', 'S', '\020', '\000', '\022', '\022', '\n', '\016', 'U', 'N', 'I', 'X', '_', 'T', 'I', 'M',
-'E', 'S', 'T', 'A', 'M', 'P', '\020', '\001', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\234', '\002',
-'\n', '\013', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', 'P', '\n', '\020', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_',
-'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*',
-'\002', '(', '\001', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '\\', '\n', '\031', 'a',
-'d', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'c', 'h', 'a', 'n', 'c', 'e', '\030',
-'\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a',
-'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\027', 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a',
-'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'h', 'a', 'n', 'c', 'e', '\022', '6', '\n', '\030', 'h', 'e', 'd', 'g', 'e', '_', 'o',
-'n', '_', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\024',
-'h', 'e', 'd', 'g', 'e', 'O', 'n', 'P', 'e', 'r', 'T', 'r', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '%', '\232', '\305', '\210',
-'\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e',
-'d', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\341', '\005', '\n', '\016', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't',
-'i', 'o', 'n', '\022', '\'', '\n', '\016', 'h', 't', 't', 'p', 's', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001',
-'(', '\010', 'H', '\000', 'R', '\r', 'h', 't', 't', 'p', 's', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', ')', '\n', '\017', 's', 'c',
-'h', 'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\016', 's', 'c',
-'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '0', '\n', '\r', 'h', 'o', 's', 't', '_', 'r', 'e', 'd', 'i',
-'r', 'e', 'c', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\014',
-'h', 'o', 's', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '#', '\n', '\r', 'p', 'o', 'r', 't', '_', 'r', 'e', 'd', 'i',
-'r', 'e', 'c', 't', '\030', '\010', ' ', '\001', '(', '\r', 'R', '\014', 'p', 'o', 'r', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022',
-'2', '\n', '\r', 'p', 'a', 't', 'h', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372',
-'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\014', 'p', 'a', 't', 'h', 'R', 'e', 'd', 'i', 'r', 'e', 'c',
-'t', '\022', '4', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\005', ' ', '\001', '(', '\t',
-'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H', '\001', 'R', '\r', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'e',
-'w', 'r', 'i', 't', 'e', '\022', 'U', '\n', '\r', 'r', 'e', 'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\t', ' ',
-'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't',
-'e', 'H', '\001', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'i', '\n', '\r', 'r', 'e', 's', 'p',
-'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\003', ' ', '\001', '(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
-'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c',
-'t', 'i', 'o', 'n', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022',
-'\037', '\n', '\013', 's', 't', 'r', 'i', 'p', '_', 'q', 'u', 'e', 'r', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 's', 't', 'r',
-'i', 'p', 'Q', 'u', 'e', 'r', 'y', '\"', 'w', '\n', '\024', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', 'C', 'o', 'd', 'e', '\022', '\025', '\n', '\021', 'M', 'O', 'V', 'E', 'D', '_', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T',
-'L', 'Y', '\020', '\000', '\022', '\t', '\n', '\005', 'F', 'O', 'U', 'N', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'S', 'E', 'E', '_', 'O', 'T',
-'H', 'E', 'R', '\020', '\002', '\022', '\026', '\n', '\022', 'T', 'E', 'M', 'P', 'O', 'R', 'A', 'R', 'Y', '_', 'R', 'E', 'D', 'I', 'R', 'E',
-'C', 'T', '\020', '\003', '\022', '\026', '\n', '\022', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C',
-'T', '\020', '\004', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
-'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\032', '\n', '\030', 's',
-'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\030',
-'\n', '\026', 'p', 'a', 't', 'h', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\"',
-'\240', '\001', '\n', '\024', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022',
-'\"', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\r', 'B', '\n', '\372', 'B', '\007', '*', '\005', '\020', '\330', '\004',
-'(', 'd', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2',
-' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a',
-'t', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e',
-'s', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\"', '\221', '\001', '\n', '\t', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o',
-'r', '\022', '%', '\n', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004',
-'r', '\002', '\020', '\001', 'R', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\022', '8', '\n', '\t', 'p', 'r', 'o', 'p', 'a', 'g',
-'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\t', 'p', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'e', ':', '#',
-'\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e',
-'.', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\"', '\322', '\002', '\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 'I', '\n',
-'\017', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.',
-'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P',
-'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'I', '\n',
-'\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.',
-'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P',
-'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o', 'm', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'K', '\n',
-'\020', 'o', 'v', 'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l',
-'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'o', 'v', 'e', 'r', 'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022',
-'A', '\n', '\013', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n',
-'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o',
-'m', 'T', 'a', 'g', 'R', '\n', 'c', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 's', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032',
-'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'T', 'r', 'a', 'c', 'i', 'n',
-'g', '\"', '\264', '\001', '\n', '\016', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', '>', '\n', '\007', 'h',
-'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
-'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
-'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', ':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l',
-'u', 's', 't', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\003', '\020', '\004', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r',
-'n', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\"', '\241', '\026', '\n', '\t', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\022', ';',
-'\n', '\005', 's', 't', 'a', 'g', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002',
-'\030', '\n', 'R', '\005', 's', 't', 'a', 'g', 'e', '\022', '\037', '\n', '\013', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'k', 'e', 'y', '\030',
-'\002', ' ', '\001', '(', '\t', 'R', '\n', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'K', 'e', 'y', '\022', 'K', '\n', '\007', 'a', 'c', 't', 'i',
-'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n',
-'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\022', '?', '\n', '\005', 'l', 'i',
-'m', 'i', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'O', 'v', 'e', 'r', 'r', 'i',
-'d', 'e', 'R', '\005', 'l', 'i', 'm', 'i', 't', '\032', '\215', '\022', '\n', '\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '^', '\n', '\016', 's',
-'o', 'u', 'r', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i',
-'m', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H',
-'\000', 'R', '\r', 's', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'm', '\n', '\023', 'd', 'e', 's', 't', 'i',
-'n', 'a', 't', 'i', 'o', 'n', '_', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
-'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l',
-'u', 's', 't', 'e', 'r', 'H', '\000', 'R', '\022', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't',
-'e', 'r', '\022', 'a', '\n', '\017', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\001',
-'(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's',
-'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'H', '\000', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r',
-'s', '\022', '^', '\n', '\016', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\004', ' ', '\001', '(', '\013',
-'2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.',
-'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd',
-'d', 'r', 'e', 's', 's', 'H', '\000', 'R', '\r', 'r', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', 'U', '\n',
-'\013', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'k', 'e', 'y', '\030', '\005', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm',
-'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', 'H', '\000', 'R', '\n', 'g',
-'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\022', 'h', '\n', '\022', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e',
-'_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'\252', '\001', '\002', '*', '\000', 'R', '\013', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'v', 'a', 'l', '\"', '4', '\n', '\021', 'R', 'e', 's',
+'e', 't', 'H', 'e', 'a', 'd', 'e', 'r', 'F', 'o', 'r', 'm', 'a', 't', '\022', '\013', '\n', '\007', 'S', 'E', 'C', 'O', 'N', 'D', 'S',
+'\020', '\000', '\022', '\022', '\n', '\016', 'U', 'N', 'I', 'X', '_', 'T', 'I', 'M', 'E', 'S', 'T', 'A', 'M', 'P', '\020', '\001', ':', '%', '\232',
+'\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
+'R', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\234', '\002', '\n', '\013', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i',
+'c', 'y', '\022', 'P', '\n', '\020', 'i', 'n', 'i', 't', 'i', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', 's', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n',
+'t', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '(', '\001', 'R', '\017', 'i', 'n', 'i', 't', 'i', 'a',
+'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 's', '\022', '\\', '\n', '\031', 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', '_', 'r',
+'e', 'q', 'u', 'e', 's', 't', '_', 'c', 'h', 'a', 'n', 'c', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v',
+'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c',
+'e', 'n', 't', 'R', '\027', 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'C', 'h', 'a',
+'n', 'c', 'e', '\022', '6', '\n', '\030', 'h', 'e', 'd', 'g', 'e', '_', 'o', 'n', '_', 'p', 'e', 'r', '_', 't', 'r', 'y', '_', 't',
+'i', 'm', 'e', 'o', 'u', 't', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\024', 'h', 'e', 'd', 'g', 'e', 'O', 'n', 'P', 'e', 'r', 'T',
+'r', 'y', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '%', '\232', '\305', '\210', '\036', ' ', '\n', '\036', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e', 'd', 'g', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', '\341',
+'\005', '\n', '\016', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\'', '\n', '\016', 'h', 't', 't', 'p',
+'s', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\r', 'h', 't', 't', 'p', 's',
+'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', ')', '\n', '\017', 's', 'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e',
+'c', 't', '\030', '\007', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\016', 's', 'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c',
+'t', '\022', '0', '\n', '\r', 'h', 'o', 's', 't', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\001', ' ', '\001', '(', '\t', 'B',
+'\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\014', 'h', 'o', 's', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c',
+'t', '\022', '#', '\n', '\r', 'p', 'o', 'r', 't', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\010', ' ', '\001', '(', '\r', 'R',
+'\014', 'p', 'o', 'r', 't', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '2', '\n', '\r', 'p', 'a', 't', 'h', '_', 'r', 'e', 'd',
+'i', 'r', 'e', 'c', 't', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'H',
+'\001', 'R', '\014', 'p', 'a', 't', 'h', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\022', '4', '\n', '\016', 'p', 'r', 'e', 'f', 'i', 'x',
+'_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\005', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310',
+'\001', '\000', 'H', '\001', 'R', '\r', 'p', 'r', 'e', 'f', 'i', 'x', 'R', 'e', 'w', 'r', 'i', 't', 'e', '\022', 'U', '\n', '\r', 'r', 'e',
+'g', 'e', 'x', '_', 'r', 'e', 'w', 'r', 'i', 't', 'e', '\030', '\t', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't',
+'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', 'H', '\001', 'R', '\014', 'r', 'e', 'g', 'e', 'x', 'R',
+'e', 'w', 'r', 'i', 't', 'e', '\022', 'i', '\n', '\r', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', '\030', '\003',
+' ', '\001', '(', '\016', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', '.', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'd', 'i', 'r', 'e',
+'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
+'\014', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\037', '\n', '\013', 's', 't', 'r', 'i', 'p', '_', 'q', 'u',
+'e', 'r', 'y', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 's', 't', 'r', 'i', 'p', 'Q', 'u', 'e', 'r', 'y', '\"', 'w', '\n', '\024',
+'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', '\022', '\025', '\n', '\021', 'M',
+'O', 'V', 'E', 'D', '_', 'P', 'E', 'R', 'M', 'A', 'N', 'E', 'N', 'T', 'L', 'Y', '\020', '\000', '\022', '\t', '\n', '\005', 'F', 'O', 'U',
+'N', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'S', 'E', 'E', '_', 'O', 'T', 'H', 'E', 'R', '\020', '\002', '\022', '\026', '\n', '\022', 'T', 'E',
+'M', 'P', 'O', 'R', 'A', 'R', 'Y', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\003', '\022', '\026', '\n', '\022', 'P', 'E', 'R',
+'M', 'A', 'N', 'E', 'N', 'T', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C', 'T', '\020', '\004', ':', '(', '\232', '\305', '\210', '\036', '#', '\n',
+'!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'e', 'd', 'i', 'r',
+'e', 'c', 't', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\032', '\n', '\030', 's', 'c', 'h', 'e', 'm', 'e', '_', 'r', 'e', 'w', 'r', 'i',
+'t', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\030', '\n', '\026', 'p', 'a', 't', 'h', '_', 'r', 'e', 'w', 'r',
+'i', 't', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\"', '\240', '\001', '\n', '\024', 'D', 'i', 'r', 'e', 'c', 't', 'R',
+'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\"', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001',
+' ', '\001', '(', '\r', 'B', '\n', '\372', 'B', '\007', '*', '\005', '\020', '\330', '\004', '(', 'd', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022',
+'4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b',
+'o', 'd', 'y', ':', '.', '\232', '\305', '\210', '\036', ')', '\n', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'D', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'A', 'c', 't', 'i', 'o',
+'n', '\"', '\025', '\n', '\023', 'N', 'o', 'n', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'A', 'c', 't', 'i', 'o', 'n', '\"',
+'\221', '\001', '\n', '\t', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\022', '%', '\n', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o',
+'n', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\t', 'o', 'p', 'e', 'r', 'a', 't', 'i',
+'o', 'n', '\022', '8', '\n', '\t', 'p', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R',
+'\t', 'p', 'r', 'o', 'p', 'a', 'g', 'a', 't', 'e', ':', '#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.',
+'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'D', 'e', 'c', 'o', 'r', 'a', 't', 'o', 'r', '\"', '\322', '\002',
+'\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 'I', '\n', '\017', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 'a', 'm', 'p', 'l',
+'i', 'n', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
+'.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n',
+'t', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'I', '\n', '\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l',
+'i', 'n', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3',
+'.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o',
+'m', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'K', '\n', '\020', 'o', 'v', 'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p',
+'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v',
+'3', '.', 'F', 'r', 'a', 'c', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'o', 'v', 'e', 'r',
+'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'A', '\n', '\013', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g',
+'s', '\030', '\004', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 't', 'r', 'a', 'c',
+'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'R', '\n', 'c', 'u', 's', 't', 'o', 'm', 'T',
+'a', 'g', 's', ':', '!', '\232', '\305', '\210', '\036', '\034', '\n', '\032', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.',
+'r', 'o', 'u', 't', 'e', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\"', '\264', '\001', '\n', '\016', 'V', 'i', 'r', 't', 'u', 'a', 'l',
+'C', 'l', 'u', 's', 't', 'e', 'r', '\022', '>', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\004', ' ', '\003', '(', '\013', '2',
+'$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H',
+'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\022', '\033', '\n', '\004',
+'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e',
+':', '(', '\232', '\305', '\210', '\036', '#', '\n', '!', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'V', 'i', 'r', 't', 'u', 'a', 'l', 'C', 'l', 'u', 's', 't', 'e', 'r', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004',
+'\010', '\003', '\020', '\004', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', 'R', '\006', 'm', 'e', 't', 'h', 'o', 'd', '\"', '\252', '\026', '\n',
+'\t', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\022', ';', '\n', '\005', 's', 't', 'a', 'g', 'e', '\030', '\001', ' ', '\001', '(', '\013',
+'2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2',
+'V', 'a', 'l', 'u', 'e', 'B', '\007', '\372', 'B', '\004', '*', '\002', '\030', '\n', 'R', '\005', 's', 't', 'a', 'g', 'e', '\022', '\037', '\n', '\013',
+'d', 'i', 's', 'a', 'b', 'l', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 'd', 'i', 's', 'a', 'b', 'l',
+'e', 'K', 'e', 'y', '\022', 'K', '\n', '\007', 'a', 'c', 't', 'i', 'o', 'n', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\'', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e',
+'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'a',
+'c', 't', 'i', 'o', 'n', 's', '\022', '?', '\n', '\005', 'l', 'i', 'm', 'i', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e',
+'L', 'i', 'm', 'i', 't', '.', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', 'R', '\005', 'l', 'i', 'm', 'i', 't', '\032', '\226', '\022', '\n',
+'\006', 'A', 'c', 't', 'i', 'o', 'n', '\022', '^', '\n', '\016', 's', 'o', 'u', 'r', 'c', 'e', '_', 'c', 'l', 'u', 's', 't', 'e', 'r',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u',
+'t', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o',
+'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H', '\000', 'R', '\r', 's', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's',
+'t', 'e', 'r', '\022', 'm', '\n', '\023', 'd', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', '_', 'c', 'l', 'u', 's', 't', 'e',
+'r', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o',
+'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D',
+'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', 'H', '\000', 'R', '\022', 'd', 'e', 's', 't',
+'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', '\022', 'a', '\n', '\017', 'r', 'e', 'q', 'u', 'e', 's', 't',
+'_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A',
+'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'H', '\000', 'R', '\016', 'r',
+'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '^', '\n', '\016', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a',
+'d', 'd', 'r', 'e', 's', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '5', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't',
-'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\020', 'h',
-'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', 'n', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i',
-'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'i', 'o', 'n', '.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', 'H', '\000', 'R', '\r', 'r', 'e', 'm', 'o',
+'t', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', 'U', '\n', '\013', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'k', 'e', 'y', '\030',
+'\005', ' ', '\001', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't',
+'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'G', 'e', 'n',
+'e', 'r', 'i', 'c', 'K', 'e', 'y', 'H', '\000', 'R', '\n', 'g', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\022', 'h', '\n', '\022',
+'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013', '2',
+'8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R',
+'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'M', 'a', 't', 'c', 'h', 'H', '\000', 'R', '\020', 'h', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't',
+'c', 'h', '\022', 'w', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\007', ' ',
+'\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.',
+'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'y', 'n', 'a', 'm',
+'i', 'c', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'B', '\021', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', '\270', '\356',
+'\362', '\322', '\005', '\001', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'N',
+'\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\010', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
-'.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'B', '\010',
-'\030', '\001', '\270', '\356', '\362', '\322', '\005', '\001', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '\022', 'N', '\n', '\010', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\010', ' ', '\001', '(', '\013', '2', '0', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
-'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'H', '\000', 'R', '\010', 'm',
-'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'J', '\n', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(',
-'\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\t', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\032', 'I', '\n', '\r', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r',
-':', '8', '\232', '\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u',
-'t', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c',
-'e', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', 'S', '\n', '\022', 'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l',
-'u', 's', 't', 'e', 'r', ':', '=', '\232', '\305', '\210', '\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v',
-'2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.',
-'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', '\321', '\001', '\n', '\016', 'R', 'e',
-'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a',
-'m', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n',
-'h', 'e', 'a', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_',
-'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r',
-'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', '$', '\n', '\016', 's', 'k', 'i', 'p', '_', 'i', 'f', '_', 'a', 'b', 's', 'e', 'n',
-'t', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\014', 's', 'k', 'i', 'p', 'I', 'f', 'A', 'b', 's', 'e', 'n', 't', ':', '9', '\232', '\305',
-'\210', '\036', '4', '\n', '2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R',
-'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e',
-'a', 'd', 'e', 'r', 's', '\032', 'I', '\n', '\r', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '8', '\232',
-'\305', '\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
-'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd',
-'d', 'r', 'e', 's', 's', '\032', '\236', '\001', '\n', '\n', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\022', '2', '\n', '\020', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
-'\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '%', '\n',
-'\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e',
-'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A',
-'c', 't', 'i', 'o', 'n', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\032', '\214', '\002', '\n', '\020', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
-'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd',
-'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '=', '\n', '\014', 'e', 'x', 'p', 'e', 'c', 't', '_',
-'m', 'a', 't', 'c', 'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'e', 'x', 'p', 'e', 'c', 't', 'M', 'a', 't',
-'c', 'h', '\022', 'H', '\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r',
-'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', ':', ';', '\232', '\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o',
-'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd',
-'e', 'r', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\032', '\270', '\001', '\n', '\017', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M',
-'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y',
-'\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't',
-'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001',
-'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.',
-'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R',
-'\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v',
-'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\032',
-'\264', '\002', '\n', '\010', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
-'r', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's',
-'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e',
-'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a',
-'d', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212',
-'\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a',
-'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V',
-'a', 'l', 'u', 'e', '\022', 'Y', '\n', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\016', '2', '7', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L',
-'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '.', 'S', 'o', 'u', 'r',
-'c', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\"', '&', '\n', '\006', 'S',
-'o', 'u', 'r', 'c', 'e', '\022', '\013', '\n', '\007', 'D', 'Y', 'N', 'A', 'M', 'I', 'C', '\020', '\000', '\022', '\017', '\n', '\013', 'R', 'O', 'U',
-'T', 'E', '_', 'E', 'N', 'T', 'R', 'Y', '\020', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.',
-'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c',
-'t', 'i', 'o', 'n', 'B', '\027', '\n', '\020', 'a', 'c', 't', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022',
-'\003', '\370', 'B', '\001', '\032', '\362', '\001', '\n', '\010', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'f', '\n', '\020', 'd', 'y', 'n', 'a',
-'m', 'i', 'c', '_', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm',
-'i', 't', '.', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a',
-'t', 'a', 'H', '\000', 'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'c', '\n', '\017',
-'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a',
-'t', 'a', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\031', '\n',
-'\022', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', ':',
-'#', '\232', '\305', '\210', '\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't',
-'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '\"', '\236', '\004', '\n', '\r', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't',
-'c', 'h', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010',
-'\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '!', '\n', '\013', 'e', 'x', 'a', 'c', 't', '_', 'm',
-'a', 't', 'c', 'h', '\030', '\004', ' ', '\001', '(', '\t', 'H', '\000', 'R', '\n', 'e', 'x', 'a', 'c', 't', 'M', 'a', 't', 'c', 'h', '\022',
-'O', '\n', '\020', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\013', ' ', '\001', '(', '\013',
-'2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.',
-'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\016', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x',
-'M', 'a', 't', 'c', 'h', '\022', '<', '\n', '\013', 'r', 'a', 'n', 'g', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '\031', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a',
-'n', 'g', 'e', 'H', '\000', 'R', '\n', 'r', 'a', 'n', 'g', 'e', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's',
-'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n',
-'t', 'M', 'a', 't', 'c', 'h', '\022', ',', '\n', '\014', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t', ' ',
-'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 'p', 'r', 'e', 'f', 'i', 'x', 'M', 'a', 't',
-'c', 'h', '\022', ',', '\n', '\014', 's', 'u', 'f', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\n', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 'u', 'f', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', '0',
-'\n', '\016', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\014', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'H', '\000', 'R', '\r', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', 'M', 'a', 't', 'c', 'h', '\022', '!',
-'\n', '\014', 'i', 'n', 'v', 'e', 'r', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'n', 'v',
-'e', 'r', 't', 'M', 'a', 't', 'c', 'h', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
-'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\030', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
-'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\013', 'r', 'e', 'g', 'e', 'x',
-'_', 'm', 'a', 't', 'c', 'h', '\"', '\241', '\002', '\n', '\025', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r',
-'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\036', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\n', '\372', 'B',
-'\007', 'r', '\005', '\020', '\001', '(', '\200', '\010', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'S', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_',
-'m', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
-'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', '\022',
-'%', '\n', '\r', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\010', 'H', '\000', 'R',
-'\014', 'p', 'r', 'e', 's', 'e', 'n', 't', 'M', 'a', 't', 'c', 'h', ':', '/', '\232', '\305', '\210', '\036', '*', '\n', '(', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a',
-'m', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '!', '\n', '\037', 'q', 'u', 'e', 'r', 'y', '_', 'p', 'a', 'r',
-'a', 'm', 'e', 't', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010',
-'\003', '\020', '\004', 'J', '\004', '\010', '\004', '\020', '\005', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\"', '\271',
-'\002', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P', 'o', 'l', 'i', 'c', 'y',
-'\022', 'R', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't',
-'s', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l',
-'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\022', '@', '\n', '\027', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '_', 'r', 'e', 's',
-'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', 's', '\030', '\002', ' ', '\003', '(', '\r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002',
-'\020', '\005', 'R', '\025', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'C', 'o', 'd', 'e', 's',
-'\022', 'J', '\n', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e',
-'s', '\022', '=', '\n', '\033', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'o', 's', 's', '_', 's', 'c', 'h', 'e', 'm', 'e', '_', 'r',
-'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\030', 'a', 'l', 'l', 'o', 'w', 'C', 'r', 'o', 's', 's',
-'S', 'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\"', ']', '\n', '\014', 'F', 'i', 'l', 't', 'e', 'r', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', ',', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2', '\024', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\006', 'c', 'o', 'n', 'f', 'i',
-'g', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'i',
-'s', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', 'B', 'E', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x',
-'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', 'B', '\024',
-'R', 'o', 'u', 't', 'e', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', 'H', '\000', 'R', '\010', 'm', 'e', 't', 'a', 'd',
+'a', 't', 'a', '\022', 'J', '\n', '\t', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '*', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e',
+'d', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\t', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', '\032', 'I', '\n', '\r', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u', 's', 't', 'e', 'r', ':', '8', '\232', '\305',
+'\210', '\036', '3', '\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R',
+'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'l', 'u',
+'s', 't', 'e', 'r', '\032', 'S', '\n', '\022', 'D', 'e', 's', 't', 'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e',
+'r', ':', '=', '\232', '\305', '\210', '\036', '8', '\n', '6', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o',
+'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'D', 'e', 's', 't',
+'i', 'n', 'a', 't', 'i', 'o', 'n', 'C', 'l', 'u', 's', 't', 'e', 'r', '\032', '\321', '\001', '\n', '\016', 'R', 'e', 'q', 'u', 'e', 's',
+'t', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '.', '\n', '\013', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001',
+' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\n', 'h', 'e', 'a', 'd',
+'e', 'r', 'N', 'a', 'm', 'e', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030',
+'\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
+'r', 'K', 'e', 'y', '\022', '$', '\n', '\016', 's', 'k', 'i', 'p', '_', 'i', 'f', '_', 'a', 'b', 's', 'e', 'n', 't', '\030', '\003', ' ',
+'\001', '(', '\010', 'R', '\014', 's', 'k', 'i', 'p', 'I', 'f', 'A', 'b', 's', 'e', 'n', 't', ':', '9', '\232', '\305', '\210', '\036', '4', '\n',
+'2', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L',
+'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r',
+'s', '\032', 'I', '\n', '\r', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', ':', '8', '\232', '\305', '\210', '\036', '3',
+'\n', '1', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e',
+'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's',
+'s', '\032', '\236', '\001', '\n', '\n', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r',
+'i', 'p', 't', 'o', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
+'\001', 'R', '\017', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '%', '\n', '\016', 'd', 'e', 's',
+'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i',
+'p', 't', 'o', 'r', 'K', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
+'.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o',
+'n', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'K', 'e', 'y', '\032', '\214', '\002', '\n', '\020', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
+'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\022', '2', '\n', '\020', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'v', 'a',
+'l', 'u', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\017', 'd', 'e', 's', 'c', 'r',
+'i', 'p', 't', 'o', 'r', 'V', 'a', 'l', 'u', 'e', '\022', '=', '\n', '\014', 'e', 'x', 'p', 'e', 'c', 't', '_', 'm', 'a', 't', 'c',
+'h', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\013', 'e', 'x', 'p', 'e', 'c', 't', 'M', 'a', 't', 'c', 'h', '\022', 'H',
+'\n', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c',
+'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c',
+'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\007', 'h', 'e', 'a', 'd', 'e', 'r', 's', ':', ';', '\232',
+'\305', '\210', '\036', '6', '\n', '4', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.',
+'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
+'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', '\032', '\270', '\001', '\n', '\017', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'D',
+'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e', 'y', '\030', '\001', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'K', 'e',
+'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '#',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '.', 'M',
+'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'u', 'e',
+'\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e', '\032', '\264', '\002', '\n', '\010',
+'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '\022', '.', '\n', '\016', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '_', 'k', 'e',
+'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\r', 'd', 'e', 's', 'c', 'r', 'i', 'p',
+'t', 'o', 'r', 'K', 'e', 'y', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k', 'e', 'y', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
+'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', '\022', '#', '\n', '\r', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_',
+'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\014', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'u', 'e',
+'\022', 'Y', '\n', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\016', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't',
+'.', 'A', 'c', 't', 'i', 'o', 'n', '.', 'M', 'e', 't', 'a', 'D', 'a', 't', 'a', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010',
+'\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's', 'o', 'u', 'r', 'c', 'e', '\"', '&', '\n', '\006', 'S', 'o', 'u', 'r', 'c',
+'e', '\022', '\013', '\n', '\007', 'D', 'Y', 'N', 'A', 'M', 'I', 'C', '\020', '\000', '\022', '\017', '\n', '\013', 'R', 'O', 'U', 'T', 'E', '_', 'E',
+'N', 'T', 'R', 'Y', '\020', '\001', ':', '*', '\232', '\305', '\210', '\036', '%', '\n', '#', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.',
+'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'A', 'c', 't', 'i', 'o', 'n',
+'B', '\027', '\n', '\020', 'a', 'c', 't', 'i', 'o', 'n', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001',
+'\032', '\362', '\001', '\n', '\010', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'f', '\n', '\020', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_',
+'m', 'e', 't', 'a', 'd', 'a', 't', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i', 't', '.', 'O',
+'v', 'e', 'r', 'r', 'i', 'd', 'e', '.', 'D', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'H', '\000',
+'R', '\017', 'd', 'y', 'n', 'a', 'm', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\032', 'c', '\n', '\017', 'D', 'y', 'n', 'a',
+'m', 'i', 'c', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', '\022', 'P', '\n', '\014', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '_', 'k',
+'e', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'e', 't',
+'a', 'd', 'a', 't', 'a', '.', 'v', '3', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\010', '\372', 'B', '\005',
+'\212', '\001', '\002', '\020', '\001', 'R', '\013', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', 'K', 'e', 'y', 'B', '\031', '\n', '\022', 'o', 'v', 'e',
+'r', 'r', 'i', 'd', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', ':', '#', '\232', '\305', '\210',
+'\036', '\036', '\n', '\034', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'R', 'a',
+'t', 'e', 'L', 'i', 'm', 'i', 't', '\"', '\244', '\005', '\n', '\r', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r',
+'\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001',
+'\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '.', '\n', '\013', 'e', 'x', 'a', 'c', 't', '_', 'm', 'a', 't', 'c', 'h',
+'\030', '\004', ' ', '\001', '(', '\t', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\n', 'e', 'x',
+'a', 'c', 't', 'M', 'a', 't', 'c', 'h', '\022', '\\', '\n', '\020', 's', 'a', 'f', 'e', '_', 'r', 'e', 'g', 'e', 'x', '_', 'm', 'a',
+'t', 'c', 'h', '\030', '\013', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
+'t', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\013', '\030', '\001',
+'\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\016', 's', 'a', 'f', 'e', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't',
+'c', 'h', '\022', '<', '\n', '\013', 'r', 'a', 'n', 'g', 'e', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'I', 'n', 't', '6', '4', 'R', 'a', 'n', 'g', 'e',
+'H', '\000', 'R', '\n', 'r', 'a', 'n', 'g', 'e', 'M', 'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's', 'e', 'n', 't',
+'_', 'm', 'a', 't', 'c', 'h', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n', 't', 'M', 'a',
+'t', 'c', 'h', '\022', '7', '\n', '\014', 'p', 'r', 'e', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c', 'h', '\030', '\t', ' ', '\001', '(', '\t',
+'B', '\022', '\030', '\001', '\372', 'B', '\004', 'r', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\013', 'p',
+'r', 'e', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', '7', '\n', '\014', 's', 'u', 'f', 'f', 'i', 'x', '_', 'm', 'a', 't', 'c',
+'h', '\030', '\n', ' ', '\001', '(', '\t', 'B', '\022', '\030', '\001', '\372', 'B', '\004', 'r', '\002', '\020', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3',
+'.', '0', 'H', '\000', 'R', '\013', 's', 'u', 'f', 'f', 'i', 'x', 'M', 'a', 't', 'c', 'h', '\022', ';', '\n', '\016', 'c', 'o', 'n', 't',
+'a', 'i', 'n', 's', '_', 'm', 'a', 't', 'c', 'h', '\030', '\014', ' ', '\001', '(', '\t', 'B', '\022', '\030', '\001', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '\r', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', 'M', 'a',
+'t', 'c', 'h', '\022', 'I', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\r', ' ', '\001', '(', '\013',
+'2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.',
+'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M', 'a',
+'t', 'c', 'h', '\022', '!', '\n', '\014', 'i', 'n', 'v', 'e', 'r', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\010', ' ', '\001', '(', '\010',
+'R', '\013', 'i', 'n', 'v', 'e', 'r', 't', 'M', 'a', 't', 'c', 'h', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v',
+'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'B', '\030', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c',
+'i', 'f', 'i', 'e', 'r', 'J', '\004', '\010', '\002', '\020', '\003', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\013',
+'r', 'e', 'g', 'e', 'x', '_', 'm', 'a', 't', 'c', 'h', '\"', '\241', '\002', '\n', '\025', 'Q', 'u', 'e', 'r', 'y', 'P', 'a', 'r', 'a',
+'m', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\036', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(',
+'\t', 'B', '\n', '\372', 'B', '\007', 'r', '\005', '\020', '\001', '(', '\200', '\010', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'S', '\n', '\014', 's', 't',
+'r', 'i', 'n', 'g', '_', 'm', 'a', 't', 'c', 'h', '\030', '\005', ' ', '\001', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't',
+'c', 'h', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'M',
+'a', 't', 'c', 'h', '\022', '%', '\n', '\r', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'm', 'a', 't', 'c', 'h', '\030', '\006', ' ', '\001',
+'(', '\010', 'H', '\000', 'R', '\014', 'p', 'r', 'e', 's', 'e', 'n', 't', 'M', 'a', 't', 'c', 'h', ':', '/', '\232', '\305', '\210', '\036', '*',
+'\n', '(', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'r', 'o', 'u', 't', 'e', '.', 'Q', 'u', 'e', 'r',
+'y', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '!', '\n', '\037', 'q', 'u', 'e', 'r',
+'y', '_', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', '_', 'm', 'a', 't', 'c', 'h', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i',
+'e', 'r', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\004', '\020', '\005', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'R', '\005', 'r', 'e',
+'g', 'e', 'x', '\"', '\271', '\002', '\n', '\026', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'P',
+'o', 'l', 'i', 'c', 'y', '\022', 'R', '\n', '\026', 'm', 'a', 'x', '_', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'd',
+'i', 'r', 'e', 'c', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\024', 'm', 'a', 'x', 'I', 'n', 't',
+'e', 'r', 'n', 'a', 'l', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', 's', '\022', '@', '\n', '\027', 'r', 'e', 'd', 'i', 'r', 'e', 'c',
+'t', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'c', 'o', 'd', 'e', 's', '\030', '\002', ' ', '\003', '(', '\r', 'B', '\010', '\372',
+'B', '\005', '\222', '\001', '\002', '\020', '\005', 'R', '\025', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e',
+'C', 'o', 'd', 'e', 's', '\022', 'J', '\n', '\n', 'p', 'r', 'e', 'd', 'i', 'c', 'a', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\013',
+'2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T',
+'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\n', 'p', 'r', 'e', 'd',
+'i', 'c', 'a', 't', 'e', 's', '\022', '=', '\n', '\033', 'a', 'l', 'l', 'o', 'w', '_', 'c', 'r', 'o', 's', 's', '_', 's', 'c', 'h',
+'e', 'm', 'e', '_', 'r', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\030', 'a', 'l', 'l', 'o', 'w',
+'C', 'r', 'o', 's', 's', 'S', 'c', 'h', 'e', 'm', 'e', 'R', 'e', 'd', 'i', 'r', 'e', 'c', 't', '\"', ']', '\n', '\014', 'F', 'i',
+'l', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', ',', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(',
+'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\006',
+'c', 'o', 'n', 'f', 'i', 'g', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\002', ' ', '\001',
+'(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', 'B', 'E', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e',
+'.', 'v', '3', 'B', '\024', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'm', 'p', 'o', 'n', 'e', 'n', 't', 's', 'P', 'r', 'o', 't', 'o',
+'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[18] = {
+static upb_def_init *deps[19] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_config_core_v3_proxy_protocol_proto_upbdefinit,
+ &envoy_type_matcher_v3_metadata_proto_upbdefinit,
&envoy_type_matcher_v3_regex_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&envoy_type_metadata_v3_metadata_proto_upbdefinit,
@@ -938,7 +867,7 @@ static upb_def_init *deps[18] = {
upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_route_components_proto_upb_file_layout,
"envoy/config/route/v3/route_components.proto",
- UPB_STRVIEW_INIT(descriptor, 19463)
+ UPB_STRVIEW_INIT(descriptor, 20318)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
index a3cce451d37..7ac1dfb3458 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.h
@@ -186,6 +186,11 @@ UPB_INLINE const upb_msgdef *envoy_config_route_v3_DirectResponseAction_getmsgde
return upb_symtab_lookupmsg(s, "envoy.config.route.v3.DirectResponseAction");
}
+UPB_INLINE const upb_msgdef *envoy_config_route_v3_NonForwardingAction_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.config.route.v3.NonForwardingAction");
+}
+
UPB_INLINE const upb_msgdef *envoy_config_route_v3_Decorator_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_config_route_v3_route_components_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.config.route.v3.Decorator");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
index 202945e8f19..5cd19c620fe 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
@@ -8,20 +8,11 @@
#include "upb/def.h"
#include "envoy/config/route/v3/scoped_route.upbdefs.h"
+#include "envoy/config/route/v3/scoped_route.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_msginit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit;
-extern const upb_msglayout envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_config_route_v3_ScopedRouteConfiguration_msginit,
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit,
- &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit,
-};
-
static const char descriptor[789] = {'\n', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 's',
'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.',
'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
@@ -65,7 +56,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_config_route_v3_scoped_route_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_route_v3_scoped_route_proto_upb_file_layout,
"envoy/config/route/v3/scoped_route.proto",
UPB_STRVIEW_INIT(descriptor, 789)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
index 3817a57292b..7385bbf78b9 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
@@ -8,19 +8,12 @@
#include "upb/def.h"
#include "envoy/config/trace/v3/http_tracer.upbdefs.h"
+#include "envoy/config/trace/v3/http_tracer.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_msginit;
-extern const upb_msglayout envoy_config_trace_v3_Tracing_Http_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_config_trace_v3_Tracing_msginit,
- &envoy_config_trace_v3_Tracing_Http_msginit,
-};
-
static const char descriptor[532] = {'\n', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3', '/', 'h',
't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 'c',
'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
@@ -55,7 +48,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_config_trace_v3_http_tracer_proto_upb_file_layout,
"envoy/config/trace/v3/http_tracer.proto",
UPB_STRVIEW_INIT(descriptor, 532)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
index d159a9920d9..327d1979c5a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
@@ -8,16 +8,11 @@
#include "upb/def.h"
#include "envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h"
+#include "envoy/extensions/clusters/aggregate/v3/cluster.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit,
-};
-
static const char descriptor[389] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'c', 'l', 'u', 's', 't', 'e',
'r', 's', '/', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '/', 'v', '3', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'p',
'r', 'o', 't', 'o', '\022', '&', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'c', 'l',
@@ -45,7 +40,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_extensions_clusters_aggregate_v3_cluster_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_clusters_aggregate_v3_cluster_proto_upb_file_layout,
"envoy/extensions/clusters/aggregate/v3/cluster.proto",
UPB_STRVIEW_INIT(descriptor, 389)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
index 1ee8a91170c..614b1846554 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
@@ -8,26 +8,13 @@
#include "upb/def.h"
#include "envoy/extensions/filters/common/fault/v3/fault.upbdefs.h"
+#include "envoy/extensions/filters/common/fault/v3/fault.upb.h"
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit;
-extern const upb_msglayout envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit,
- &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit,
-};
-
static const char descriptor[1354] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'c', 'o', 'm', 'm', 'o', 'n', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', '/', 'f', 'a', 'u', 'l', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', '(', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i',
@@ -96,7 +83,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout,
"envoy/extensions/filters/common/fault/v3/fault.proto",
UPB_STRVIEW_INIT(descriptor, 1354)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
index cd46e9352e3..55a916401e8 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/extensions/filters/http/fault/v3/fault.upbdefs.h"
+#include "envoy/extensions/filters/http/fault/v3/fault.upb.h"
extern upb_def_init envoy_config_route_v3_route_components_proto_upbdefinit;
extern upb_def_init envoy_extensions_filters_common_fault_v3_fault_proto_upbdefinit;
@@ -16,17 +17,7 @@ extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit;
-extern const upb_msglayout envoy_extensions_filters_http_fault_v3_HTTPFault_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit,
- &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit,
- &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit,
-};
-
-static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+static const char descriptor[1885] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'h', 't', 't', 'p', '/', 'f', 'a', 'u', 'l', 't', '/', 'v', '3', '/', 'f', 'a', 'u', 'l', 't', '.', 'p', 'r', 'o',
't', 'o', '\022', '&', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', '\032', ',', 'e', 'n', 'v', 'o', 'y', '/',
@@ -56,7 +47,7 @@ static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', '
'r', 't', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'A', 'b', 'o', 'r', 't', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n',
'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h', 't', 't', 'p', '.', 'f', 'a',
'u', 'l', 't', '.', 'v', '2', '.', 'F', 'a', 'u', 'l', 't', 'A', 'b', 'o', 'r', 't', 'B', '\021', '\n', '\n', 'e', 'r', 'r', 'o',
-'r', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\274', '\007', '\n', '\t', 'H', 'T', 'T',
+'r', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', 'J', '\004', '\010', '\001', '\020', '\002', '\"', '\205', '\010', '\n', '\t', 'H', 'T', 'T',
'P', 'F', 'a', 'u', 'l', 't', '\022', 'J', '\n', '\005', 'd', 'e', 'l', 'a', 'y', '\030', '\001', ' ', '\001', '(', '\013', '2', '4', '.', 'e',
'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'c',
'o', 'm', 'm', 'o', 'n', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '3', '.', 'F', 'a', 'u', 'l', 't', 'D', 'e', 'l', 'a', 'y',
@@ -92,13 +83,16 @@ static const char descriptor[1812] = {'\n', '2', 'e', 'n', 'v', 'o', 'y', '/', '
'e', '\030', '\r', ' ', '\001', '(', '\t', 'R', '\037', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', 'R', 'a', 't', 'e', 'L', 'i', 'm', 'i',
't', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022', '9', '\n', '\031', 'a', 'b', 'o', 'r', 't', '_',
'g', 'r', 'p', 'c', '_', 's', 't', 'a', 't', 'u', 's', '_', 'r', 'u', 'n', 't', 'i', 'm', 'e', '\030', '\016', ' ', '\001', '(', '\t',
-'R', '\026', 'a', 'b', 'o', 'r', 't', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'R', 'u', 'n', 't', 'i', 'm', 'e', ':',
-'2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't',
-'e', 'r', '.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '2', '.', 'H', 'T', 'T', 'P', 'F', 'a', 'u', 'l',
-'t', 'B', 'L', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f',
-'a', 'u', 'l', 't', '.', 'v', '3', 'B', '\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321',
-'\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\026', 'a', 'b', 'o', 'r', 't', 'G', 'r', 'p', 'c', 'S', 't', 'a', 't', 'u', 's', 'R', 'u', 'n', 't', 'i', 'm', 'e', '\022',
+'G', '\n', ' ', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 'd', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '_', 'c', 'l', 'u',
+'s', 't', 'e', 'r', '_', 's', 't', 'a', 't', 's', '\030', '\017', ' ', '\001', '(', '\010', 'R', '\035', 'd', 'i', 's', 'a', 'b', 'l', 'e',
+'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'u', 's', 't', 'e', 'r', 'S', 't', 'a', 't', 's', ':', '2', '\232',
+'\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u', 'l', 't', '.', 'v', '2', '.', 'H', 'T', 'T', 'P', 'F', 'a', 'u', 'l', 't', 'B',
+'L', '\n', '4', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'f', 'a', 'u',
+'l', 't', '.', 'v', '3', 'B', '\n', 'F', 'a', 'u', 'l', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002',
+'\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[8] = {
@@ -114,7 +108,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_extensions_filters_http_fault_v3_fault_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_http_fault_v3_fault_proto_upb_file_layout,
"envoy/extensions/filters/http/fault/v3/fault.proto",
- UPB_STRVIEW_INIT(descriptor, 1812)
+ UPB_STRVIEW_INIT(descriptor, 1885)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
index f1d9a578077..30f8df433c3 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
@@ -8,19 +8,14 @@
#include "upb/def.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
+#include "envoy/extensions/filters/http/router/v3/router.upb.h"
extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_extensions_filters_http_router_v3_Router_msginit,
-};
-
-static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+static const char descriptor[996] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'h', 't', 't', 'p', '/', 'r', 'o', 'u', 't', 'e', 'r', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', 'r', '.', 'p',
'r', 'o', 't', 'o', '\022', '\'', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i',
'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '3', '\032', ')', 'e', 'n', 'v',
@@ -30,7 +25,7 @@ static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\255', '\004', '\n', '\006', 'R', 'o', 'u', 't', 'e', 'r', '\022', '?', '\n',
+'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\204', '\005', '\n', '\006', 'R', 'o', 'u', 't', 'e', 'r', '\022', '?', '\n',
'\r', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 's', 't', 'a', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\014',
'd', 'y', 'n', 'a', 'm', 'i', 'c', 'S', 't', 'a', 't', 's', '\022', '(', '\n', '\020', 's', 't', 'a', 'r', 't', '_', 'c', 'h', 'i',
@@ -50,13 +45,16 @@ static const char descriptor[909] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e
'n', 'v', 'o', 'y', '-', 'r', 'e', 't', 'r', 'y', '-', 'o', 'n', 'R', '\022', 's', 't', 'r', 'i', 'c', 't', 'C', 'h', 'e', 'c',
'k', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '=', '\n', '\033', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'e', 'x', 'p', 'e', 'c',
't', 'e', 'd', '_', 'r', 'q', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\030', 'r', 'e', 's',
-'p', 'e', 'c', 't', 'E', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'R', 'q', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '0', '\232', '\305',
-'\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
-'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'r', 'B', 'N', '\n', '5',
-'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r',
-'.', 'v', '3', 'B', '\013', 'R', 'o', 'u', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
-'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'p', 'e', 'c', 't', 'E', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'R', 'q', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'U', '\n', '(',
+'s', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'g', 'r', 'p', 'c', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'f', 'a', 'i',
+'l', 'u', 'r', 'e', '_', 'c', 'o', 'd', 'e', '_', 's', 't', 'a', 't', 's', '\030', '\007', ' ', '\001', '(', '\010', 'R', '#', 's', 'u',
+'p', 'p', 'r', 'e', 's', 's', 'G', 'r', 'p', 'c', 'R', 'e', 'q', 'u', 'e', 's', 't', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'C',
+'o', 'd', 'e', 'S', 't', 'a', 't', 's', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
+'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v',
+'2', '.', 'R', 'o', 'u', 't', 'e', 'r', 'B', 'N', '\n', '5', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's',
+'.', 'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '3', 'B', '\013', 'R', 'o', 'u', 't', 'e', 'r', 'P', 'r',
+'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[6] = {
@@ -70,7 +68,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_http_router_v3_router_proto_upb_file_layout,
"envoy/extensions/filters/http/router/v3/router.proto",
- UPB_STRVIEW_INIT(descriptor, 909)
+ UPB_STRVIEW_INIT(descriptor, 996)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
index 916044e9f43..bd5f697f4d6 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h"
+#include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h"
extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
@@ -18,6 +19,7 @@ extern upb_def_init envoy_config_core_v3_substitution_format_string_proto_upbdef
extern upb_def_init envoy_config_route_v3_route_proto_upbdefinit;
extern upb_def_init envoy_config_route_v3_scoped_route_proto_upbdefinit;
extern upb_def_init envoy_config_trace_v3_http_tracer_proto_upbdefinit;
+extern upb_def_init envoy_type_http_v3_path_transformation_proto_upbdefinit;
extern upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit;
extern upb_def_init envoy_type_v3_percent_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
@@ -28,45 +30,7 @@ extern upb_def_init udpa_annotations_security_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit;
-extern const upb_msglayout envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit;
-
-static const upb_msglayout *layouts[17] = {
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit,
- &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit,
-};
-
-static const char descriptor[10141] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
+static const char descriptor[11539] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'n', 'e', 't', 'w', 'o', 'r', 'k', '/', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', ';', 'e', 'n', 'v', 'o', 'y', '.', 'e',
@@ -86,395 +50,451 @@ static const char descriptor[10141] = {'\n', 'Y', 'e', 'n', 'v', 'o', 'y', '/',
'o', 'u', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '(', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/',
'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '.', 'p', 'r', 'o',
't', 'o', '\032', '\'', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 't', 'r', 'a', 'c', 'e', '/', 'v', '3',
-'/', 'h', 't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y',
-'/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't',
-'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p',
-'e', 'r', 'c', 'e', 'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
-'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r',
-'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g',
-'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n',
-'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\222', '+', '\n', '\025', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', '\205', '\001', '\n', '\n', 'c', 'o', 'd', 'e', 'c', '_', 't', 'y', 'p', 'e',
-'\030', '\001', ' ', '\001', '(', '\016', '2', '\\', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
-'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\t', 'c', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', '\022', '(', '\n', '\013',
-'s', 't', 'a', 't', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020',
-'\001', 'R', '\n', 's', 't', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'T', '\n', '\003', 'r', 'd', 's', '\030', '\003', ' ', '\001', '(',
-'\013', '2', '@', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'd', 's', 'H', '\000', 'R', '\003', 'r', 'd', 's', '\022',
-'N', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't',
-'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', 'p', '\n', '\r', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', 's', '\030', '\037', ' ', '\001',
-'(', '\013', '2', 'I', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
+'/', 'h', 't', 't', 'p', '_', 't', 'r', 'a', 'c', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', ',', 'e', 'n', 'v', 'o', 'y',
+'/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', '/', 'p', 'a', 't', 'h', '_', 't', 'r', 'a', 'n', 's', 'f',
+'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p',
+'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c', 'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p',
+'r', 'o', 't', 'o', '\032', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e',
+'n', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
+'\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'s', 'e', 'c', 'u', 'r', 'i', 't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.',
+'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\223', '4', '\n', '\025', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
+'a', 'n', 'a', 'g', 'e', 'r', '\022', '\205', '\001', '\n', '\n', 'c', 'o', 'd', 'e', 'c', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001',
+'(', '\016', '2', '\\', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
-'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't',
-'e', 's', 'H', '\000', 'R', '\014', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', 'j', '\n', '\014', 'h', 't', 't',
-'p', '_', 'f', 'i', 'l', 't', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
-'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '3', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\013', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r',
-'s', '\022', '@', '\n', '\016', 'a', 'd', 'd', '_', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '\030', '\006', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\014', 'a', 'd', 'd', 'U', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', '\022', 't', '\n', '\007', 't', 'r', 'a', 'c',
-'i', 'n', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_',
-'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't',
-'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n',
-'g', 'R', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\022', 's', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p',
-'_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '#', ' ', '\001', '(', '\013', '2', ')',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't',
-'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001',
-'R', '\031', 'c', 'o', 'm', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', '\022', '^', '\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o',
-'n', 's', '\030', '\010', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
-'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
-'n', 's', 'R', '\023', 'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'i',
-'\n', '\026', 'h', 't', 't', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030',
-'\t', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
-'.', 'v', '3', '.', 'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B',
-'\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', ',', '\n', '\013', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(',
-'\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\n', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm',
-'e', '\022', '\271', '\001', '\n', '\034', 's', 'e', 'r', 'v', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 't', 'r', 'a', 'n', 's',
-'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\030', '\"', ' ', '\001', '(', '\016', '2', 'm', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
-'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'S', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\032', 's', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r',
-'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', '\\', '\n', '\026', 'm', 'a', 'x', '_', 'r', 'e', 'q',
-'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'k', 'b', '\030', '\035', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
-'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
-'e', 'B', '\t', '\372', 'B', '\006', '*', '\004', '\030', '`', ' ', '\000', 'R', '\023', 'm', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H',
-'e', 'a', 'd', 'e', 'r', 's', 'K', 'b', '\022', 'R', '\n', '\023', 's', 't', 'r', 'e', 'a', 'm', '_', 'i', 'd', 'l', 'e', '_', 't',
-'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\021',
-'s', 't', 'r', 'e', 'a', 'm', 'I', 'd', 'l', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'K', '\n', '\017', 'r', 'e', 'q', 'u',
-'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\034', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*',
-'\002', '\010', '\001', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'b', '\n', '\027', 'r', 'e',
-'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', ')', ' ', '\001',
-'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
-'t', 'i', 'o', 'n', 'B', '\017', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\025', 'r', 'e',
-'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '>', '\n', '\r', 'd', 'r',
-'a', 'i', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\014', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\014', 'd', 'r', 'a', 'i',
-'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\025', 'd', 'e', 'l', 'a', 'y', 'e', 'd', '_', 'c', 'l', 'o', 's', 'e',
-'_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\032', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\023', 'd', 'e', 'l', 'a', 'y', 'e', 'd',
-'C', 'l', 'o', 's', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'C', '\n', '\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o',
-'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c',
-'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c',
-'e', 's', 's', 'L', 'o', 'g', '\022', 'Q', '\n', '\022', 'u', 's', 'e', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r',
-'e', 's', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\020', 'u', 's',
-'e', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', '\022', '/', '\n', '\024', 'x', 'f', 'f', '_', 'n', 'u', 'm',
-'_', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'h', 'o', 'p', 's', '\030', '\023', ' ', '\001', '(', '\r', 'R', '\021', 'x', 'f', 'f', 'N',
-'u', 'm', 'T', 'r', 'u', 's', 't', 'e', 'd', 'H', 'o', 'p', 's', '\022', '\240', '\001', '\n', '\027', 'i', 'n', 't', 'e', 'r', 'n', 'a',
-'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\031', ' ', '\001', '(', '\013', '2', 'h', '.',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', 'B', '\010', '\372', 'B',
+'\005', '\202', '\001', '\002', '\020', '\001', 'R', '\t', 'c', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', '\022', '(', '\n', '\013', 's', 't', 'a', 't',
+'_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\n', 's',
+'t', 'a', 't', 'P', 'r', 'e', 'f', 'i', 'x', '\022', 'T', '\n', '\003', 'r', 'd', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '@', '.',
'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.',
'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n',
-'f', 'i', 'g', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i',
-'g', '\022', '&', '\n', '\017', 's', 'k', 'i', 'p', '_', 'x', 'f', 'f', '_', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\025', ' ', '\001', '(',
-'\010', 'R', '\r', 's', 'k', 'i', 'p', 'X', 'f', 'f', 'A', 'p', 'p', 'e', 'n', 'd', '\022', '\020', '\n', '\003', 'v', 'i', 'a', '\030', '\026',
-' ', '\001', '(', '\t', 'R', '\003', 'v', 'i', 'a', '\022', 'J', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'r', 'e', 'q',
-'u', 'e', 's', 't', '_', 'i', 'd', '\030', '\017', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\021', 'g', 'e', 'n', 'e', 'r', 'a', 't',
-'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', '\022', '?', '\n', '\034', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', '_', 'e', 'x',
-'t', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', ' ', ' ', '\001', '(', '\010', 'R', '\031',
-'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'E', 'x', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd',
-'\022', 'G', '\n', '!', 'a', 'l', 'w', 'a', 'y', 's', '_', 's', 'e', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd',
-'_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '\030', '%', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y',
-'s', 'S', 'e', 't', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '\264',
-'\001', '\n', '\033', 'f', 'o', 'r', 'w', 'a', 'r', 'd', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e',
-'t', 'a', 'i', 'l', 's', '\030', '\020', ' ', '\001', '(', '\016', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't',
-'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H',
-'t', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'F', 'o', 'r', 'w',
-'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'B', '\010', '\372', 'B', '\005',
-'\202', '\001', '\002', '\020', '\001', 'R', '\030', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D',
-'e', 't', 'a', 'i', 'l', 's', '\022', '\264', '\001', '\n', '\037', 's', 'e', 't', '_', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'c', 'l',
-'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\021', ' ', '\001', '(', '\013', '2', 'n',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'd', 's', 'H', '\000', 'R', '\003', 'r', 'd', 's', '\022', 'N', '\n', '\014', 'r',
+'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '.', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g',
+'\022', 'p', '\n', '\r', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', 's', '\030', '\037', ' ', '\001', '(', '\013', '2', 'I',
'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's',
'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'R', '\033', 's', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i',
-'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', ',', '\n', '\022', 'p', 'r', 'o', 'x', 'y', '_', '1',
-'0', '0', '_', 'c', 'o', 'n', 't', 'i', 'n', 'u', 'e', '\030', '\022', ' ', '\001', '(', '\010', 'R', '\020', 'p', 'r', 'o', 'x', 'y', '1',
-'0', '0', 'C', 'o', 'n', 't', 'i', 'n', 'u', 'e', '\022', 'e', '\n', '1', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'i',
-'p', 'v', '4', '_', 'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'a', 's', '_', 'i', 'p', 'v',
-'4', '_', 'm', 'a', 'p', 'p', 'e', 'd', '_', 'i', 'p', 'v', '6', '\030', '\024', ' ', '\001', '(', '\010', 'R', '*', 'r', 'e', 'p', 'r',
-'e', 's', 'e', 'n', 't', 'I', 'p', 'v', '4', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', 'A', 's', 'I',
-'p', 'v', '4', 'M', 'a', 'p', 'p', 'e', 'd', 'I', 'p', 'v', '6', '\022', '\211', '\001', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e',
-'_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\027', ' ', '\003', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'H', '\000',
+'R', '\014', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', 'j', '\n', '\014', 'h', 't', 't', 'p', '_', 'f', 'i',
+'l', 't', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't',
+'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H',
+'t', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\013', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 's', '\022', '@', '\n',
+'\016', 'a', 'd', 'd', '_', 'u', 's', 'e', 'r', '_', 'a', 'g', 'e', 'n', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R',
+'\014', 'a', 'd', 'd', 'U', 's', 'e', 'r', 'A', 'g', 'e', 'n', 't', '\022', 't', '\n', '\007', 't', 'r', 'a', 'c', 'i', 'n', 'g', '\030',
+'\007', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'R', '\007', 't',
+'r', 'a', 'c', 'i', 'n', 'g', '\022', 's', '\n', '\034', 'c', 'o', 'm', 'm', 'o', 'n', '_', 'h', 't', 't', 'p', '_', 'p', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '#', ' ', '\001', '(', '\013', '2', ')', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'P', 'r', 'o',
+'t', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\031', 'c', 'o',
+'m', 'm', 'o', 'n', 'H', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '^',
+'\n', '\025', 'h', 't', 't', 'p', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\010',
+' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'H', 't', 't', 'p', '1', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'R', '\023',
+'h', 't', 't', 'p', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'i', '\n', '\026', 'h', 't',
+'t', 'p', '2', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '\t', ' ', '\001', '(',
+'\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
+'H', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', 'B', '\007', '\212', '\223', '\267',
+'*', '\002', '\010', '\001', 'R', '\024', 'h', 't', 't', 'p', '2', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '`', '\n', '\026', 'h', 't', 't', 'p', '3', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'o', 'p', 't', 'i', 'o',
+'n', 's', '\030', ',', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o',
+'n', 's', 'R', '\024', 'h', 't', 't', 'p', '3', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+',', '\n', '\013', 's', 'e', 'r', 'v', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\n', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010',
+'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\n', 's', 'e', 'r', 'v', 'e', 'r', 'N', 'a', 'm', 'e', '\022', '\271', '\001', '\n', '\034',
+'s', 'e', 'r', 'v', 'e', 'r', '_', 'h', 'e', 'a', 'd', 'e', 'r', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't',
+'i', 'o', 'n', '\030', '\"', ' ', '\001', '(', '\016', '2', 'm', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
+'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_',
+'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't',
+'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S', 'e', 'r', 'v', 'e', 'r',
+'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005',
+'\202', '\001', '\002', '\020', '\001', 'R', '\032', 's', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f',
+'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', 'r', '\n', '\034', 's', 'c', 'h', 'e', 'm', 'e', '_', 'h', 'e', 'a', 'd', 'e', 'r',
+'_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\030', '0', ' ', '\001', '(', '\013', '2', '0', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'c', 'h', 'e', 'm',
+'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'R', '\032', 's', 'c',
+'h', 'e', 'm', 'e', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022',
+']', '\n', '\026', 'm', 'a', 'x', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_', 'k', 'b',
+'\030', '\035', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\n', '\372', 'B', '\007', '*', '\005', '\030', '\200', '@', ' ', '\000', 'R', '\023',
+'m', 'a', 'x', 'R', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'K', 'b', '\022', 'R', '\n', '\023', 's', 't',
+'r', 'e', 'a', 'm', '_', 'i', 'd', 'l', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\030', ' ', '\001', '(', '\013', '2', '\031',
+'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\021', 's', 't', 'r', 'e', 'a', 'm', 'I', 'd', 'l', 'e', 'T', 'i', 'm', 'e',
+'o', 'u', 't', '\022', 'K', '\n', '\017', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\034', ' ',
+'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
+'a', 't', 'i', 'o', 'n', 'B', '\007', '\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\016', 'r', 'e', 'q', 'u', 'e', 's', 't', 'T', 'i',
+'m', 'e', 'o', 'u', 't', '\022', 'b', '\n', '\027', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_',
+'t', 'i', 'm', 'e', 'o', 'u', 't', '\030', ')', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\017', '\372', 'B', '\005', '\252', '\001', '\002', '2', '\000',
+'\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\025', 'r', 'e', 'q', 'u', 'e', 's', 't', 'H', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'i',
+'m', 'e', 'o', 'u', 't', '\022', '>', '\n', '\r', 'd', 'r', 'a', 'i', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\014', ' ',
+'\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r',
+'a', 't', 'i', 'o', 'n', 'R', '\014', 'd', 'r', 'a', 'i', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'M', '\n', '\025', 'd', 'e',
+'l', 'a', 'y', 'e', 'd', '_', 'c', 'l', 'o', 's', 'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\032', ' ', '\001', '(', '\013',
+'2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i',
+'o', 'n', 'R', '\023', 'd', 'e', 'l', 'a', 'y', 'e', 'd', 'C', 'l', 'o', 's', 'e', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', 'C',
+'\n', '\n', 'a', 'c', 'c', 'e', 's', 's', '_', 'l', 'o', 'g', '\030', '\r', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v', '3', '.', 'A', 'c', 'c',
+'e', 's', 's', 'L', 'o', 'g', 'R', '\t', 'a', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', '\022', 'Q', '\n', '\022', 'u', 's', 'e', '_',
+'r', 'e', 'm', 'o', 't', 'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030', '\016', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'B', '\007',
+'\212', '\223', '\267', '*', '\002', '\010', '\001', 'R', '\020', 'u', 's', 'e', 'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's',
+'\022', '/', '\n', '\024', 'x', 'f', 'f', '_', 'n', 'u', 'm', '_', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'h', 'o', 'p', 's', '\030',
+'\023', ' ', '\001', '(', '\r', 'R', '\021', 'x', 'f', 'f', 'N', 'u', 'm', 'T', 'r', 'u', 's', 't', 'e', 'd', 'H', 'o', 'p', 's', '\022',
+'s', '\n', ' ', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', '_', 'i', 'p', '_', 'd', 'e', 't', 'e', 'c', 't', 'i', 'o', 'n', '_',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\030', '.', ' ', '\003', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n',
+'s', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\035', 'o', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'I', 'p', 'D', 'e', 't',
+'e', 'c', 't', 'i', 'o', 'n', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '\022', '\240', '\001', '\n', '\027', 'i', 'n', 't', 'e',
+'r', 'n', 'a', 'l', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\031', ' ', '\001', '(', '\013',
+'2', 'h', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's',
+'C', 'o', 'n', 'f', 'i', 'g', 'R', '\025', 'i', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', '&', '\n', '\017', 's', 'k', 'i', 'p', '_', 'x', 'f', 'f', '_', 'a', 'p', 'p', 'e', 'n', 'd', '\030', '\025',
+' ', '\001', '(', '\010', 'R', '\r', 's', 'k', 'i', 'p', 'X', 'f', 'f', 'A', 'p', 'p', 'e', 'n', 'd', '\022', '\035', '\n', '\003', 'v', 'i',
+'a', '\030', '\026', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300', '\001', '\002', '\310', '\001', '\000', 'R', '\003', 'v', 'i', 'a',
+'\022', 'J', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', '\017',
+' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o',
+'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\021', 'g', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I',
+'d', '\022', '?', '\n', '\034', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', '_', 'e', 'x', 't', 'e', 'r', 'n', 'a', 'l', '_', 'r', 'e',
+'q', 'u', 'e', 's', 't', '_', 'i', 'd', '\030', ' ', ' ', '\001', '(', '\010', 'R', '\031', 'p', 'r', 'e', 's', 'e', 'r', 'v', 'e', 'E',
+'x', 't', 'e', 'r', 'n', 'a', 'l', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'd', '\022', 'G', '\n', '!', 'a', 'l', 'w', 'a', 'y',
+'s', '_', 's', 'e', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_', 'i', 'n', '_', 'r', 'e', 's', 'p', 'o',
+'n', 's', 'e', '\030', '%', ' ', '\001', '(', '\010', 'R', '\034', 'a', 'l', 'w', 'a', 'y', 's', 'S', 'e', 't', 'R', 'e', 'q', 'u', 'e',
+'s', 't', 'I', 'd', 'I', 'n', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '\264', '\001', '\n', '\033', 'f', 'o', 'r', 'w', 'a', 'r',
+'d', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', '_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\020', ' ', '\001',
+'(', '\016', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l',
+'t', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c',
+'t', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't',
+'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\030', 'f', 'o',
+'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\264', '\001',
+'\n', '\037', 's', 'e', 't', '_', 'c', 'u', 'r', 'r', 'e', 'n', 't', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't',
+'_', 'd', 'e', 't', 'a', 'i', 'l', 's', '\030', '\021', ' ', '\001', '(', '\013', '2', 'n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'U',
-'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f',
-'i', 'g', 's', '\022', 'A', '\n', '\016', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '\030', '\036', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\r', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', '\022', '#', '\n', '\r', 'm',
-'e', 'r', 'g', 'e', '_', 's', 'l', 'a', 's', 'h', 'e', 's', '\030', '!', ' ', '\001', '(', '\010', 'R', '\014', 'm', 'e', 'r', 'g', 'e',
-'S', 'l', 'a', 's', 'h', 'e', 's', '\022', '\201', '\001', '\n', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't',
-'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h',
-'t', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3',
-'.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\022', 'r', 'e', 'q', 'u',
-'e', 's', 't', 'I', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '{', '\n', '\022', 'l', 'o', 'c', 'a', 'l', '_', 'r',
-'e', 'p', 'l', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '&', ' ', '\001', '(', '\013', '2', 'M', '.', 'e', 'n', 'v', 'o', 'y',
-'.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o',
-'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e',
-'r', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'l', 'o',
-'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\030', 's', 't', 'r', 'i', 'p', '_', 'm',
-'a', 't', 'c', 'h', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '\'', ' ', '\001', '(', '\010', 'B', '\027',
-'\362', '\230', '\376', '\217', '\005', '\021', '\022', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o', 'r', 't', '_', 'm', 'o', 'd', 'e', 'R', '\025',
-'s', 't', 'r', 'i', 'p', 'M', 'a', 't', 'c', 'h', 'i', 'n', 'g', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', '/', '\n', '\023',
-'s', 't', 'r', 'i', 'p', '_', 'a', 'n', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '*', ' ', '\001', '(', '\010',
-'H', '\001', 'R', '\020', 's', 't', 'r', 'i', 'p', 'A', 'n', 'y', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', 'i', '\n', '$', 's',
-'t', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_', 'h', 't',
-'t', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '(', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\037', 's', 't', 'r', 'e',
-'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's', 's', 'a',
-'g', 'e', '\032', '\366', '\004', '\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'c', 'l', 'i', 'e', 'n', 't', '_',
-'s', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't', 'S', 'a', 'm', 'p',
-'l', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\004',
-' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c',
-'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o', 'm', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'A', '\n', '\020', 'o', 'v',
-'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n',
-'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017', 'o', 'v', 'e', 'r',
-'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\030', '\006', ' ',
-'\001', '(', '\010', 'R', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\022', 'K', '\n', '\023', 'm', 'a', 'x', '_', 'p', 'a', 't', 'h', '_',
-'t', 'a', 'g', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\020', 'm', 'a',
-'x', 'P', 'a', 't', 'h', 'T', 'a', 'g', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'A', '\n', '\013', 'c', 'u', 's', 't', 'o', 'm', '_',
-'t', 'a', 'g', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 't',
-'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'R', '\n', 'c', 'u', 's', 't',
-'o', 'm', 'T', 'a', 'g', 's', '\022', '?', '\n', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001', '(', '\013', '2',
-'#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.', 'v', '3', '.', 'T',
-'r', 'a', 'c', 'i', 'n', 'g', '.', 'H', 't', 't', 'p', 'R', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\"', '(', '\n', '\r',
-'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '\013', '\n', '\007', 'I', 'N', 'G', 'R', 'E', 'S', 'S', '\020',
-'\000', '\022', '\n', '\n', '\006', 'E', 'G', 'R', 'E', 'S', 'S', '\020', '\001', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
-'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'T',
-'r', 'a', 'c', 'i', 'n', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\016', 'o', 'p', 'e', 'r', 'a',
-'t', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e', 'a', 'd', 'e', 'r',
-'s', '_', 'f', 'o', 'r', '_', 't', 'a', 'g', 's', '\032', '\245', '\001', '\n', '\025', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd',
-'d', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'n', 'i', 'x', '_', 's', 'o', 'c', 'k', 'e',
-'t', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\013', 'u', 'n', 'i', 'x', 'S', 'o', 'c', 'k', 'e', 't', 's', ':', 'i', '\232', '\305',
-'\210', '\036', 'd', '\n', 'b', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
-'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n',
-'f', 'i', 'g', '\032', '\230', '\002', '\n', '\033', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '4', '\n', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\030', '\001', ' ', '\001',
-'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l',
-'V', 'a', 'l', 'u', 'e', 'R', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\022', '\022', '\n', '\004', 'c', 'e', 'r', 't', '\030', '\003', ' ',
-'\001', '(', '\010', 'R', '\004', 'c', 'e', 'r', 't', '\022', '\024', '\n', '\005', 'c', 'h', 'a', 'i', 'n', '\030', '\006', ' ', '\001', '(', '\010', 'R',
-'\005', 'c', 'h', 'a', 'i', 'n', '\022', '\020', '\n', '\003', 'd', 'n', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\003', 'd', 'n', 's', '\022',
-'\020', '\n', '\003', 'u', 'r', 'i', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\003', 'u', 'r', 'i', ':', 'o', '\232', '\305', '\210', '\036', 'j', '\n',
-'h', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
-'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e',
-'t', 'a', 'i', 'l', 's', 'J', '\004', '\010', '\002', '\020', '\003', '\032', '\256', '\002', '\n', '\r', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(',
-'\t', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', 'a', '\n', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's',
-'\030', '\002', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
-'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'F', 'i',
-'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', '\030',
-'\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
-'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', ':', 'a', '\232', '\305', '\210', '\036', '\\', '\n',
-'Z', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
+'3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'S',
+'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l',
+'s', 'R', '\033', 's', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e',
+'t', 'a', 'i', 'l', 's', '\022', ',', '\n', '\022', 'p', 'r', 'o', 'x', 'y', '_', '1', '0', '0', '_', 'c', 'o', 'n', 't', 'i', 'n',
+'u', 'e', '\030', '\022', ' ', '\001', '(', '\010', 'R', '\020', 'p', 'r', 'o', 'x', 'y', '1', '0', '0', 'C', 'o', 'n', 't', 'i', 'n', 'u',
+'e', '\022', 'e', '\n', '1', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', '_', 'i', 'p', 'v', '4', '_', 'r', 'e', 'm', 'o', 't',
+'e', '_', 'a', 'd', 'd', 'r', 'e', 's', 's', '_', 'a', 's', '_', 'i', 'p', 'v', '4', '_', 'm', 'a', 'p', 'p', 'e', 'd', '_',
+'i', 'p', 'v', '6', '\030', '\024', ' ', '\001', '(', '\010', 'R', '*', 'r', 'e', 'p', 'r', 'e', 's', 'e', 'n', 't', 'I', 'p', 'v', '4',
+'R', 'e', 'm', 'o', 't', 'e', 'A', 'd', 'd', 'r', 'e', 's', 's', 'A', 's', 'I', 'p', 'v', '4', 'M', 'a', 'p', 'p', 'e', 'd',
+'I', 'p', 'v', '6', '\022', '\211', '\001', '\n', '\017', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030',
+'\027', ' ', '\003', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n',
+'f', 'i', 'g', 'R', '\016', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', 'A', '\n', '\016', 'n', 'o',
+'r', 'm', 'a', 'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '\030', '\036', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\r', 'n', 'o',
+'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', '\022', '#', '\n', '\r', 'm', 'e', 'r', 'g', 'e', '_', 's', 'l', 'a', 's',
+'h', 'e', 's', '\030', '!', ' ', '\001', '(', '\010', 'R', '\014', 'm', 'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', '\022', '\267',
+'\001', '\n', ' ', 'p', 'a', 't', 'h', '_', 'w', 'i', 't', 'h', '_', 'e', 's', 'c', 'a', 'p', 'e', 'd', '_', 's', 'l', 'a', 's',
+'h', 'e', 's', '_', 'a', 'c', 't', 'i', 'o', 'n', '\030', '-', ' ', '\001', '(', '\016', '2', 'o', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r',
+'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'P', 'a', 't', 'h', 'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's', 'h', 'e', 's', 'A', 'c',
+'t', 'i', 'o', 'n', 'R', '\034', 'p', 'a', 't', 'h', 'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's',
+'h', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022', '\201', '\001', '\n', '\024', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'i', 'd', '_',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '$', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
+'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
+'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
+'v', '3', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'R', '\022', 'r', 'e',
+'q', 'u', 'e', 's', 't', 'I', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\022', '{', '\n', '\022', 'l', 'o', 'c', 'a', 'l',
+'_', 'r', 'e', 'p', 'l', 'y', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '&', ' ', '\001', '(', '\013', '2', 'M', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't',
+'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a',
+'g', 'e', 'r', '.', 'v', '3', '.', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020',
+'l', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'P', '\n', '\030', 's', 't', 'r', 'i', 'p',
+'_', 'm', 'a', 't', 'c', 'h', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '\'', ' ', '\001', '(', '\010',
+'B', '\027', '\362', '\230', '\376', '\217', '\005', '\021', '\022', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o', 'r', 't', '_', 'm', 'o', 'd', 'e',
+'R', '\025', 's', 't', 'r', 'i', 'p', 'M', 'a', 't', 'c', 'h', 'i', 'n', 'g', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', '/',
+'\n', '\023', 's', 't', 'r', 'i', 'p', '_', 'a', 'n', 'y', '_', 'h', 'o', 's', 't', '_', 'p', 'o', 'r', 't', '\030', '*', ' ', '\001',
+'(', '\010', 'H', '\001', 'R', '\020', 's', 't', 'r', 'i', 'p', 'A', 'n', 'y', 'H', 'o', 's', 't', 'P', 'o', 'r', 't', '\022', 'i', '\n',
+'$', 's', 't', 'r', 'e', 'a', 'm', '_', 'e', 'r', 'r', 'o', 'r', '_', 'o', 'n', '_', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '_',
+'h', 't', 't', 'p', '_', 'm', 'e', 's', 's', 'a', 'g', 'e', '\030', '(', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\037', 's', 't',
+'r', 'e', 'a', 'm', 'E', 'r', 'r', 'o', 'r', 'O', 'n', 'I', 'n', 'v', 'a', 'l', 'i', 'd', 'H', 't', 't', 'p', 'M', 'e', 's',
+'s', 'a', 'g', 'e', '\022', '\251', '\001', '\n', '\032', 'p', 'a', 't', 'h', '_', 'n', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i',
+'o', 'n', '_', 'o', 'p', 't', 'i', 'o', 'n', 's', '\030', '+', ' ', '\001', '(', '\013', '2', 'k', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r',
+'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r',
+'.', 'P', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's',
+'R', '\030', 'p', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\022', '5', '\n', '\027', 's', 't', 'r', 'i', 'p', '_', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'h', 'o', 's', 't', '_',
+'d', 'o', 't', '\030', '/', ' ', '\001', '(', '\010', 'R', '\024', 's', 't', 'r', 'i', 'p', 'T', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'H',
+'o', 's', 't', 'D', 'o', 't', '\032', '\366', '\004', '\n', '\007', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'c', 'l', 'i',
+'e', 'n', 't', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o',
+'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'c', 'l', 'i', 'e', 'n', 't',
+'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '?', '\n', '\017', 'r', 'a', 'n', 'd', 'o', 'm', '_', 's', 'a', 'm', 'p', 'l', 'i',
+'n', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.',
+'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\016', 'r', 'a', 'n', 'd', 'o', 'm', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', 'A',
+'\n', '\020', 'o', 'v', 'e', 'r', 'a', 'l', 'l', '_', 's', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2',
+'\026', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '.', 'P', 'e', 'r', 'c', 'e', 'n', 't', 'R', '\017',
+'o', 'v', 'e', 'r', 'a', 'l', 'l', 'S', 'a', 'm', 'p', 'l', 'i', 'n', 'g', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 'b', 'o', 's',
+'e', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\007', 'v', 'e', 'r', 'b', 'o', 's', 'e', '\022', 'K', '\n', '\023', 'm', 'a', 'x', '_', 'p',
+'a', 't', 'h', '_', 't', 'a', 'g', '_', 'l', 'e', 'n', 'g', 't', 'h', '\030', '\007', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e',
+'R', '\020', 'm', 'a', 'x', 'P', 'a', 't', 'h', 'T', 'a', 'g', 'L', 'e', 'n', 'g', 't', 'h', '\022', 'A', '\n', '\013', 'c', 'u', 's',
+'t', 'o', 'm', '_', 't', 'a', 'g', 's', '\030', '\010', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
+'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '.', 'C', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 'R', '\n',
+'c', 'u', 's', 't', 'o', 'm', 'T', 'a', 'g', 's', '\022', '?', '\n', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ',
+'\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 't', 'r', 'a', 'c', 'e', '.',
+'v', '3', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'H', 't', 't', 'p', 'R', '\010', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
+'\"', '(', '\n', '\r', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'N', 'a', 'm', 'e', '\022', '\013', '\n', '\007', 'I', 'N', 'G', 'R',
+'E', 'S', 'S', '\020', '\000', '\022', '\n', '\n', '\006', 'E', 'G', 'R', 'E', 'S', 'S', '\020', '\001', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n',
+'T', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '6', '\n', '\t', 'C', 'o', 'd', 'e', 'c',
-'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '1', '\020', '\001',
-'\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '2', '\020', '\002', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '3', '\020', '\003', '\"', 'S', '\n',
-'\032', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i',
-'o', 'n', '\022', '\r', '\n', '\t', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T', 'E', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'P', 'P', 'E',
-'N', 'D', '_', 'I', 'F', '_', 'A', 'B', 'S', 'E', 'N', 'T', '\020', '\001', '\022', '\020', '\n', '\014', 'P', 'A', 'S', 'S', '_', 'T', 'H',
-'R', 'O', 'U', 'G', 'H', '\020', '\002', '\"', 'y', '\n', '\030', 'F', 'o', 'r', 'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C',
-'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\014', '\n', '\010', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '\020', '\000', '\022',
-'\020', '\n', '\014', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L', 'Y', '\020', '\001', '\022', '\022', '\n', '\016', 'A', 'P', 'P', 'E',
-'N', 'D', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '\020', '\002', '\022', '\020', '\n', '\014', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '_',
-'S', 'E', 'T', '\020', '\003', '\022', '\027', '\n', '\023', 'A', 'L', 'W', 'A', 'Y', 'S', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O',
-'N', 'L', 'Y', '\020', '\004', ':', 'S', '\232', '\305', '\210', '\036', 'N', '\n', 'L', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\026', '\n', '\017', 'r', 'o', 'u', 't', 'e', '_',
-'s', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\021', '\n', '\017', 's', 't', 'r', 'i', 'p', '_', 'p',
-'o', 'r', 't', '_', 'm', 'o', 'd', 'e', 'J', '\004', '\010', '\033', '\020', '\034', 'J', '\004', '\010', '\013', '\020', '\014', 'R', '\014', 'i', 'd', 'l',
-'e', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\"', '\312', '\001', '\n', '\020', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C',
-'o', 'n', 'f', 'i', 'g', '\022', 'e', '\n', '\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', 'K', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.',
+'e', 'r', '.', 'T', 'r', 'a', 'c', 'i', 'n', 'g', 'J', '\004', '\010', '\001', '\020', '\002', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\016', 'o',
+'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '_', 'n', 'a', 'm', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'h', 'e',
+'a', 'd', 'e', 'r', 's', '_', 'f', 'o', 'r', '_', 't', 'a', 'g', 's', '\032', '\245', '\001', '\n', '\025', 'I', 'n', 't', 'e', 'r', 'n',
+'a', 'l', 'A', 'd', 'd', 'r', 'e', 's', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'n', 'i', 'x', '_', 's',
+'o', 'c', 'k', 'e', 't', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\013', 'u', 'n', 'i', 'x', 'S', 'o', 'c', 'k', 'e', 't', 's',
+':', 'i', '\232', '\305', '\210', '\036', 'd', '\n', 'b', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l',
+'t', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'A', 'd', 'd', 'r', 'e', 's',
+'s', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\230', '\002', '\n', '\033', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i',
+'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '4', '\n', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 's', 'u', 'b', 'j', 'e', 'c', 't', '\022', '\022', '\n', '\004', 'c', 'e', 'r',
+'t', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\004', 'c', 'e', 'r', 't', '\022', '\024', '\n', '\005', 'c', 'h', 'a', 'i', 'n', '\030', '\006', ' ',
+'\001', '(', '\010', 'R', '\005', 'c', 'h', 'a', 'i', 'n', '\022', '\020', '\n', '\003', 'd', 'n', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\003',
+'d', 'n', 's', '\022', '\020', '\n', '\003', 'u', 'r', 'i', '\030', '\005', ' ', '\001', '(', '\010', 'R', '\003', 'u', 'r', 'i', ':', 'o', '\232', '\305',
+'\210', '\036', 'j', '\n', 'h', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
-'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'M', 'a', 'p', 'p', 'e', 'r', 'R',
-'\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\022', 'O', '\n', '\013', 'b', 'o', 'd', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002',
-' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i',
-'n', 'g', 'R', '\n', 'b', 'o', 'd', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\"', '\234', '\003', '\n', '\016', 'R', 'e', 's', 'p', 'o', 'n',
-'s', 'e', 'M', 'a', 'p', 'p', 'e', 'r', '\022', 'L', '\n', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2',
-'*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.',
-'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001',
-'\002', '\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'J', '\n', '\013', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd',
-'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\020', '\330', '\004', '(', '\310', '\001',
-'R', '\n', 's', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\003', ' ', '\001', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', '\022', '`', '\n', '\024', 'b', 'o', 'd', 'y', '_',
-'f', 'o', 'r', 'm', 'a', 't', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '.', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'u', 'b', 's', 't',
-'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'R', '\022', 'b', 'o', 'd', 'y',
-'F', 'o', 'r', 'm', 'a', 't', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'X', '\n', '\016', 'h', 'e', 'a', 'd', 'e', 'r', 's',
-'_', 't', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p',
-'t', 'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\014', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'T',
-'o', 'A', 'd', 'd', '\"', '\307', '\001', '\n', '\003', 'R', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o',
-'u', 'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'r',
-'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'r',
-'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'N', 'a', 'm', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
-'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
-'v', '2', '.', 'R', 'd', 's', '\"', '\367', '\001', '\n', '\035', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n',
-'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', '\022', 'y', '\n', '\033', 's', 'c', 'o', 'p', 'e', 'd',
-'_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003',
-'(', '\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v',
-'3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\031', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C',
-'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'S', 'e', 't', 'C', 'u', 'r', 'r', 'e', 'n', 't', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e',
+'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', 'J', '\004', '\010', '\002', '\020', '\003', '\032', '\256', '\002', '\n', '\r', 'U', 'p', 'g', 'r', 'a',
+'d', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '!', '\n', '\014', 'u', 'p', 'g', 'r', 'a', 'd', 'e', '_', 't', 'y', 'p', 'e', '\030',
+'\001', ' ', '\001', '(', '\t', 'R', '\013', 'u', 'p', 'g', 'r', 'a', 'd', 'e', 'T', 'y', 'p', 'e', '\022', 'a', '\n', '\007', 'f', 'i', 'l',
+'t', 'e', 'r', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
+'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p',
+'_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't',
+'t', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'R', '\007', 'f', 'i', 'l', 't', 'e', 'r', 's', '\022', '4', '\n', '\007', 'e', 'n', 'a', 'b',
+'l', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\007', 'e', 'n', 'a', 'b', 'l', 'e', 'd', ':', 'a', '\232', '\305',
+'\210', '\036', '\\', '\n', 'Z', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
+'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'U', 'p', 'g', 'r', 'a', 'd', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\032', '\345', '\001', '\n', '\030',
+'P', 'a', 't', 'h', 'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'a', 't', 'i', 'o', 'n', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022',
+'c', '\n', '\031', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't',
+'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't',
+'t', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'R',
+'\030', 'f', 'o', 'r', 'w', 'a', 'r', 'd', 'i', 'n', 'g', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n',
+'\022', 'd', '\n', '\032', 'h', 't', 't', 'p', '_', 'f', 'i', 'l', 't', 'e', 'r', '_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm',
+'a', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o',
+'n', 'R', '\030', 'h', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i',
+'o', 'n', '\"', '6', '\n', '\t', 'C', 'o', 'd', 'e', 'c', 'T', 'y', 'p', 'e', '\022', '\010', '\n', '\004', 'A', 'U', 'T', 'O', '\020', '\000',
+'\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '1', '\020', '\001', '\022', '\t', '\n', '\005', 'H', 'T', 'T', 'P', '2', '\020', '\002', '\022', '\t', '\n',
+'\005', 'H', 'T', 'T', 'P', '3', '\020', '\003', '\"', 'S', '\n', '\032', 'S', 'e', 'r', 'v', 'e', 'r', 'H', 'e', 'a', 'd', 'e', 'r', 'T',
+'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', '\r', '\n', '\t', 'O', 'V', 'E', 'R', 'W', 'R', 'I', 'T',
+'E', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'I', 'F', '_', 'A', 'B', 'S', 'E', 'N', 'T', '\020', '\001',
+'\022', '\020', '\n', '\014', 'P', 'A', 'S', 'S', '_', 'T', 'H', 'R', 'O', 'U', 'G', 'H', '\020', '\002', '\"', 'y', '\n', '\030', 'F', 'o', 'r',
+'w', 'a', 'r', 'd', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'D', 'e', 't', 'a', 'i', 'l', 's', '\022', '\014', '\n', '\010',
+'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '\020', '\000', '\022', '\020', '\n', '\014', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L',
+'Y', '\020', '\001', '\022', '\022', '\n', '\016', 'A', 'P', 'P', 'E', 'N', 'D', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '\020', '\002', '\022', '\020',
+'\n', '\014', 'S', 'A', 'N', 'I', 'T', 'I', 'Z', 'E', '_', 'S', 'E', 'T', '\020', '\003', '\022', '\027', '\n', '\023', 'A', 'L', 'W', 'A', 'Y',
+'S', '_', 'F', 'O', 'R', 'W', 'A', 'R', 'D', '_', 'O', 'N', 'L', 'Y', '\020', '\004', '\"', '\240', '\001', '\n', '\034', 'P', 'a', 't', 'h',
+'W', 'i', 't', 'h', 'E', 's', 'c', 'a', 'p', 'e', 'd', 'S', 'l', 'a', 's', 'h', 'e', 's', 'A', 'c', 't', 'i', 'o', 'n', '\022',
+'#', '\n', '\037', 'I', 'M', 'P', 'L', 'E', 'M', 'E', 'N', 'T', 'A', 'T', 'I', 'O', 'N', '_', 'S', 'P', 'E', 'C', 'I', 'F', 'I',
+'C', '_', 'D', 'E', 'F', 'A', 'U', 'L', 'T', '\020', '\000', '\022', '\022', '\n', '\016', 'K', 'E', 'E', 'P', '_', 'U', 'N', 'C', 'H', 'A',
+'N', 'G', 'E', 'D', '\020', '\001', '\022', '\022', '\n', '\016', 'R', 'E', 'J', 'E', 'C', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', '\020',
+'\002', '\022', '\031', '\n', '\025', 'U', 'N', 'E', 'S', 'C', 'A', 'P', 'E', '_', 'A', 'N', 'D', '_', 'R', 'E', 'D', 'I', 'R', 'E', 'C',
+'T', '\020', '\003', '\022', '\030', '\n', '\024', 'U', 'N', 'E', 'S', 'C', 'A', 'P', 'E', '_', 'A', 'N', 'D', '_', 'F', 'O', 'R', 'W', 'A',
+'R', 'D', '\020', '\004', ':', 'S', '\232', '\305', '\210', '\036', 'N', '\n', 'L', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'C', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'B', '\026', '\n', '\017', 'r', 'o', 'u', 't', 'e', '_', 's',
+'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\021', '\n', '\017', 's', 't', 'r', 'i', 'p', '_', 'p', 'o',
+'r', 't', '_', 'm', 'o', 'd', 'e', 'J', '\004', '\010', '\033', '\020', '\034', 'J', '\004', '\010', '\013', '\020', '\014', 'R', '\014', 'i', 'd', 'l', 'e',
+'_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\"', '\312', '\001', '\n', '\020', 'L', 'o', 'c', 'a', 'l', 'R', 'e', 'p', 'l', 'y', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', 'e', '\n', '\007', 'm', 'a', 'p', 'p', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', 'K', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n',
+'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a',
+'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', 'M', 'a', 'p', 'p', 'e', 'r', 'R', '\007',
+'m', 'a', 'p', 'p', 'e', 'r', 's', '\022', 'O', '\n', '\013', 'b', 'o', 'd', 'y', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\002', ' ',
+'\001', '(', '\013', '2', '.', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n',
+'g', 'R', '\n', 'b', 'o', 'd', 'y', 'F', 'o', 'r', 'm', 'a', 't', '\"', '\234', '\003', '\n', '\016', 'R', 'e', 's', 'p', 'o', 'n', 's',
+'e', 'M', 'a', 'p', 'p', 'e', 'r', '\022', 'L', '\n', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '*',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '.', 'v',
+'3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002',
+'\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'J', '\n', '\013', 's', 't', 'a', 't', 'u', 's', '_', 'c', 'o', 'd', 'e',
+'\030', '\002', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\013', '\372', 'B', '\010', '*', '\006', '\020', '\330', '\004', '(', '\310', '\001', 'R',
+'\n', 's', 't', 'a', 't', 'u', 's', 'C', 'o', 'd', 'e', '\022', '4', '\n', '\004', 'b', 'o', 'd', 'y', '\030', '\003', ' ', '\001', '(', '\013',
+'2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D',
+'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\004', 'b', 'o', 'd', 'y', '\022', '`', '\n', '\024', 'b', 'o', 'd', 'y', '_', 'f',
+'o', 'r', 'm', 'a', 't', '_', 'o', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '.', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'S', 'u', 'b', 's', 't', 'i',
+'t', 'u', 't', 'i', 'o', 'n', 'F', 'o', 'r', 'm', 'a', 't', 'S', 't', 'r', 'i', 'n', 'g', 'R', '\022', 'b', 'o', 'd', 'y', 'F',
+'o', 'r', 'm', 'a', 't', 'O', 'v', 'e', 'r', 'r', 'i', 'd', 'e', '\022', 'X', '\n', '\016', 'h', 'e', 'a', 'd', 'e', 'r', 's', '_',
+'t', 'o', '_', 'a', 'd', 'd', '\030', '\005', ' ', '\003', '(', '\013', '2', '\'', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f',
+'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't',
+'i', 'o', 'n', 'B', '\t', '\372', 'B', '\006', '\222', '\001', '\003', '\020', '\350', '\007', 'R', '\014', 'h', 'e', 'a', 'd', 'e', 'r', 's', 'T', 'o',
+'A', 'd', 'd', '\"', '\307', '\001', '\n', '\003', 'R', 'd', 's', '\022', 'Q', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u',
+'r', 'c', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
+'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005',
+'\212', '\001', '\002', '\020', '\001', 'R', '\014', 'c', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '*', '\n', '\021', 'r', 'o',
+'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'r', 'o',
+'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'N', 'a', 'm', 'e', ':', 'A', '\232', '\305', '\210', '\036', '<', '\n', ':', 'e', 'n', 'v',
'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 's', 'L', 'i', 's', 't', '\"', '\351', '\016', '\n', '\014', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', '\033',
-'\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a',
-'m', 'e', '\022', '\217', '\001', '\n', '\021', 's', 'c', 'o', 'p', 'e', '_', 'k', 'e', 'y', '_', 'b', 'u', 'i', 'l', 'd', 'e', 'r', '\030',
-'\002', ' ', '\001', '(', '\013', '2', 'Y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'2', '.', 'R', 'd', 's', '\"', '\367', '\001', '\n', '\035', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f',
+'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', '\022', 'y', '\n', '\033', 's', 'c', 'o', 'p', 'e', 'd', '_',
+'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(',
+'\013', '2', '/', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3',
+'.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\031', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', ':', '[', '\232', '\305', '\210', '\036', 'V', '\n', 'T', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h',
+'t', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2',
+'.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'s', 'L', 'i', 's', 't', '\"', '\351', '\016', '\n', '\014', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '\022', '\033', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm',
+'e', '\022', '\217', '\001', '\n', '\021', 's', 'c', 'o', 'p', 'e', '_', 'k', 'e', 'y', '_', 'b', 'u', 'i', 'l', 'd', 'e', 'r', '\030', '\002',
+' ', '\001', '(', '\013', '2', 'Y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f',
+'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e',
+'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o',
+'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005',
+'\212', '\001', '\002', '\020', '\001', 'R', '\017', 's', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', 'X', '\n',
+'\021', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2',
+'\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o',
+'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 'r', 'd', 's',
+'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '\245', '\001', '\n', ' ', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r',
+'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '_', 'l', 'i', 's', 't', '\030',
+'\004', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
-'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B',
-'\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 's', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', 'X',
-'\n', '\021', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013',
-'2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C',
-'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\017', 'r', 'd',
-'s', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '\245', '\001', '\n', ' ', 's', 'c', 'o', 'p', 'e', 'd', '_',
-'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', '_', 'l', 'i', 's', 't',
-'\030', '\004', ' ', '\001', '(', '\013', '2', 'Z', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', 'H', '\000', 'R',
+'\035', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n',
+'s', 'L', 'i', 's', 't', '\022', 'g', '\n', '\n', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '\030', '\005', ' ', '\001', '(', '\013',
+'2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'H', '\000', 'R',
+'\t', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\032', '\331', '\t', '\n', '\017', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u',
+'i', 'l', 'd', 'e', 'r', '\022', '\221', '\001', '\n', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(', '\013',
+'2', 'i', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's',
+'.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't',
+'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm', 'e',
+'n', 't', 's', '\032', '\325', '\007', '\n', '\017', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022', '\266',
+'\001', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '_', 'e', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r',
+'\030', '\001', ' ', '\001', '(', '\013', '2', '~', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd',
-'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o', 'n', 's', 'L', 'i', 's', 't', 'H', '\000',
-'R', '\035', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'a', 't', 'i', 'o',
-'n', 's', 'L', 'i', 's', 't', '\022', 'g', '\n', '\n', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '\030', '\005', ' ', '\001', '(',
-'\013', '2', 'F', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'H', '\000',
-'R', '\t', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\032', '\331', '\t', '\n', '\017', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B',
-'u', 'i', 'l', 'd', 'e', 'r', '\022', '\221', '\001', '\n', '\t', 'f', 'r', 'a', 'g', 'm', 'e', 'n', 't', 's', '\030', '\001', ' ', '\003', '(',
-'\013', '2', 'i', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e',
-'s', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n',
-'t', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\t', 'f', 'r', 'a', 'g', 'm',
-'e', 'n', 't', 's', '\032', '\325', '\007', '\n', '\017', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '\022',
-'\266', '\001', '\n', '\026', 'h', 'e', 'a', 'd', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '_', 'e', 'x', 't', 'r', 'a', 'c', 't', 'o',
-'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '~', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
-'s', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o',
-'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e',
-'d', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F',
-'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u',
-'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', 'H', '\000', 'R', '\024', 'h', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
-'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\032', '\217', '\005', '\n', '\024', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
-'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
-'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\021', 'e', 'l', 'e', 'm', 'e', 'n', 't', '_',
-'s', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'e', 'l', 'e', 'm', 'e', 'n', 't', 'S',
-'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\022', '\026', '\n', '\005', 'i', 'n', 'd', 'e', 'x', '\030', '\003', ' ', '\001', '(', '\r', 'H', '\000',
-'R', '\005', 'i', 'n', 'd', 'e', 'x', '\022', '\245', '\001', '\n', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\030', '\004', ' ', '\001', '(', '\013',
-'2', '\210', '\001', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't',
-'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
-'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e',
-'s', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n',
-'t', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a',
-'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', 'H', '\000', 'R', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't',
-'\032', '\333', '\001', '\n', '\t', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', '\022', '%', '\n', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't',
-'o', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\t', 's', 'e', 'p', 'a', 'r', 'a',
-'t', 'o', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001',
-'R', '\003', 'k', 'e', 'y', ':', '\213', '\001', '\232', '\305', '\210', '\036', '\205', '\001', '\n', '\202', '\001', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o',
-'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_',
-'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o',
-'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r',
-'.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a',
-'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', ':', '\177', '\232',
-'\305', '\210', '\036', 'z', '\n', 'x', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S',
-'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u',
-'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o',
-'r', 'B', '\016', '\n', '\014', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 't', 'y', 'p', 'e', ':', 'j', '\232', '\305', '\210', '\036', 'e', '\n',
-'c', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w',
-'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g',
-'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K',
-'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r',
-'B', '\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', 'Z', '\232', '\305', '\210', '\036', 'U', '\n', 'S', 'e', 'n', 'v',
-'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.',
-'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v',
-'2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u',
-'i', 'l', 'd', 'e', 'r', ':', 'J', '\232', '\305', '\210', '\036', 'E', '\n', 'C', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i',
-'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
-'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd',
-'R', 'o', 'u', 't', 'e', 's', 'B', '\027', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e',
-'r', '\022', '\003', '\370', 'B', '\001', '\"', '\273', '\001', '\n', '\t', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\022', 'e', '\n', '\030', 's',
-'c', 'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001',
-' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'R', '\025', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', ':', 'G',
-'\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e',
-'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
-'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\"', '\314', '\002', '\n',
-'\n', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_',
-'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ', '\001', '(', '\013',
-'2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'E',
-'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000', 'R', '\017', 'c',
-'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o', 'p', 't', 'i',
-'o', 'n', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l', ':', 'H', '\232',
-'\305', '\210', '\036', 'C', '\n', 'A', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r',
-'.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_',
-'m', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'B', '\r', '\n', '\013',
-'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020', '\003', 'R', '\006',
-'c', 'o', 'n', 'f', 'i', 'g', '\"', '\237', '\001', '\n', '\022', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n',
-'s', 'i', 'o', 'n', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(',
-'\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\013',
-'t', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'P', '\232', '\305', '\210', '\036', 'K', '\n', 'I', 'e', 'n', 'v', 'o', 'y',
-'.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't',
-'t', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.',
-'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'B', 'q', '\n', 'I', 'i', 'o', '.',
-'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
-'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c',
-'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', 'B', '\032', 'H', 't', 't',
-'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001',
-'\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r',
+'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e',
+'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', 'H', '\000', 'R', '\024', 'h', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E',
+'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\032', '\217', '\005', '\n', '\024', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E',
+'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372',
+'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '+', '\n', '\021', 'e', 'l', 'e', 'm', 'e', 'n', 't', '_', 's',
+'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\020', 'e', 'l', 'e', 'm', 'e', 'n', 't', 'S', 'e',
+'p', 'a', 'r', 'a', 't', 'o', 'r', '\022', '\026', '\n', '\005', 'i', 'n', 'd', 'e', 'x', '\030', '\003', ' ', '\001', '(', '\r', 'H', '\000', 'R',
+'\005', 'i', 'n', 'd', 'e', 'x', '\022', '\245', '\001', '\n', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\030', '\004', ' ', '\001', '(', '\013', '2',
+'\210', '\001', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e',
+'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's',
+'.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't',
+'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c',
+'t', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', 'H', '\000', 'R', '\007', 'e', 'l', 'e', 'm', 'e', 'n', 't', '\032',
+'\333', '\001', '\n', '\t', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', '\022', '%', '\n', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't', 'o',
+'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\t', 's', 'e', 'p', 'a', 'r', 'a', 't',
+'o', 'r', '\022', '\031', '\n', '\003', 'k', 'e', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\003', 'k', 'e', 'y', ':', '\213', '\001', '\232', '\305', '\210', '\036', '\205', '\001', '\n', '\202', '\001', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
+'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p',
+'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.',
+'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r', '.', 'K', 'v', 'E', 'l', 'e', 'm', 'e', 'n', 't', ':', '\177', '\232', '\305',
+'\210', '\036', 'z', '\n', 'x', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
+'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm',
+'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c',
+'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i',
+'l', 'd', 'e', 'r', '.', 'H', 'e', 'a', 'd', 'e', 'r', 'V', 'a', 'l', 'u', 'e', 'E', 'x', 't', 'r', 'a', 'c', 't', 'o', 'r',
+'B', '\016', '\n', '\014', 'e', 'x', 't', 'r', 'a', 'c', 't', '_', 't', 'y', 'p', 'e', ':', 'j', '\232', '\305', '\210', '\036', 'e', '\n', 'c',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o',
+'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e',
+'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e',
+'y', 'B', 'u', 'i', 'l', 'd', 'e', 'r', '.', 'F', 'r', 'a', 'g', 'm', 'e', 'n', 't', 'B', 'u', 'i', 'l', 'd', 'e', 'r', 'B',
+'\013', '\n', '\004', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', ':', 'Z', '\232', '\305', '\210', '\036', 'U', '\n', 'S', 'e', 'n', 'v', 'o',
+'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h',
+'t', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2',
+'.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', '.', 'S', 'c', 'o', 'p', 'e', 'K', 'e', 'y', 'B', 'u', 'i',
+'l', 'd', 'e', 'r', ':', 'J', '\232', '\305', '\210', '\036', 'E', '\n', 'C', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
+'.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n',
+'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R',
+'o', 'u', 't', 'e', 's', 'B', '\027', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r',
+'\022', '\003', '\370', 'B', '\001', '\"', '\361', '\001', '\n', '\t', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\022', 'e', '\n', '\030', 's', 'c',
+'o', 'p', 'e', 'd', '_', 'r', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\001', ' ',
+'\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R',
+'\025', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', '\022', '4', '\n',
+'\026', 's', 'r', 'd', 's', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030', '\002',
+' ', '\001', '(', '\t', 'R', '\024', 's', 'r', 'd', 's', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 's', 'L', 'o', 'c', 'a', 't', 'o',
+'r', ':', 'G', '\232', '\305', '\210', '\036', 'B', '\n', '@', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i',
+'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't',
+'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'd', 's', '\"',
+'\314', '\002', '\n', '\n', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ',
+'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '9', '\n', '\014', 't', 'y', 'p',
+'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f',
+'i', 'g', '\022', 'X', '\n', '\020', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\030', '\005', ' ',
+'\001', '(', '\013', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v',
+'3', '.', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 'o', 'u', 'r', 'c', 'e', 'H', '\000',
+'R', '\017', 'c', 'o', 'n', 'f', 'i', 'g', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '\022', '\037', '\n', '\013', 'i', 's', '_', 'o',
+'p', 't', 'i', 'o', 'n', 'a', 'l', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\n', 'i', 's', 'O', 'p', 't', 'i', 'o', 'n', 'a', 'l',
+':', 'H', '\232', '\305', '\210', '\036', 'C', '\n', 'A', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l',
+'t', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i',
+'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '2', '.', 'H', 't', 't', 'p', 'F', 'i', 'l', 't', 'e', 'r', 'B',
+'\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\003', '\020', '\004', 'J', '\004', '\010', '\002', '\020',
+'\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\237', '\001', '\n', '\022', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', '\022', '7', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001',
+' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n',
+'y', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', 'P', '\232', '\305', '\210', '\036', 'K', '\n', 'I', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k',
+'.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.',
+'v', '2', '.', 'R', 'e', 'q', 'u', 'e', 's', 't', 'I', 'D', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\216', '\001', '\n',
+' ', 'E', 'n', 'v', 'o', 'y', 'M', 'o', 'b', 'i', 'l', 'e', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', '\022', 'j', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\001', '(', '\013', '2',
+'R', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r',
+'s', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n',
+'_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', '.', 'H', 't', 't', 'p', 'C', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o',
+'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', 'B', 'q', '\n', 'I', 'i', 'o', '.', 'e', 'n',
+'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'n', 'e', 't', 'w', 'o', 'r', 'k', '.', 'h', 't', 't', 'p', '_', 'c', 'o', 'n',
+'n', 'e', 'c', 't', 'i', 'o', 'n', '_', 'm', 'a', 'n', 'a', 'g', 'e', 'r', '.', 'v', '3', 'B', '\032', 'H', 't', 't', 'p', 'C',
+'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 'M', 'a', 'n', 'a', 'g', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
+'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[20] = {
+static upb_def_init *deps[21] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_config_source_proto_upbdefinit,
@@ -484,6 +504,7 @@ static upb_def_init *deps[20] = {
&envoy_config_route_v3_route_proto_upbdefinit,
&envoy_config_route_v3_scoped_route_proto_upbdefinit,
&envoy_config_trace_v3_http_tracer_proto_upbdefinit,
+ &envoy_type_http_v3_path_transformation_proto_upbdefinit,
&envoy_type_tracing_v3_custom_tag_proto_upbdefinit,
&envoy_type_v3_percent_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
@@ -499,7 +520,7 @@ static upb_def_init *deps[20] = {
upb_def_init envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upb_file_layout,
"envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto",
- UPB_STRVIEW_INIT(descriptor, 10141)
+ UPB_STRVIEW_INIT(descriptor, 11539)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
index bf8b017acf6..5518b7d4062 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
@@ -46,6 +46,11 @@ UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_ma
return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.UpgradeConfig");
}
+UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.PathNormalizationOptions");
+}
+
UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.LocalReplyConfig");
@@ -106,6 +111,11 @@ UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_ma
return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.RequestIDExtension");
}
+UPB_INLINE const upb_msgdef *envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_extensions_filters_network_http_connection_manager_v3_http_connection_manager_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.extensions.filters.network.http_connection_manager.v3.EnvoyMobileHttpConnectionManager");
+}
+
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
index c5af26143a0..658db6dcc62 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
@@ -8,11 +8,11 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/cert.upb.h"
extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
extern upb_def_init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit;
-
static const char descriptor[348] = {'\n', '4', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 'c', 'e', 'r', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
@@ -38,7 +38,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_extensions_transport_sockets_tls_v3_cert_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_extensions_transport_sockets_tls_v3_cert_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/cert.proto",
UPB_STRVIEW_INIT(descriptor, 348)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
index dbf238cbbec..a93d3abb962 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@@ -8,153 +8,164 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/common.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
+extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit,
- &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit,
- &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit,
-};
-
-static const char descriptor[2914] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+static const char descriptor[3401] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 'c', 'o', 'm', 'm', 'o', 'n',
'.', 'p', 'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032',
'\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
-'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l',
-'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o',
-'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's',
-'i', 't', 'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
-'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o',
-'t', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o',
-'t', 'o', '\"', '\362', '\003', '\n', '\r', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', '\217', '\001', '\n', '\034',
-'t', 'l', 's', '_', 'm', 'i', 'n', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's',
-'i', 'o', 'n', '\030', '\001', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's',
-'.', 'v', '3', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't',
-'o', 'c', 'o', 'l', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'i', 'n', 'i', 'm', 'u',
-'m', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\217', '\001', '\n', '\034', 't', 'l', 's', '_',
-'m', 'a', 'x', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030',
-'\002', ' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
-'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
-'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
-'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'a', 'x', 'i', 'm', 'u', 'm', 'P', 'r', 'o',
-'t', 'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '#', '\n', '\r', 'c', 'i', 'p', 'h', 'e', 'r', '_', 's', 'u',
-'i', 't', 'e', 's', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\014', 'c', 'i', 'p', 'h', 'e', 'r', 'S', 'u', 'i', 't', 'e', 's', '\022',
-'\037', '\n', '\013', 'e', 'c', 'd', 'h', '_', 'c', 'u', 'r', 'v', 'e', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\n', 'e', 'c', 'd',
-'h', 'C', 'u', 'r', 'v', 'e', 's', '\"', 'O', '\n', '\013', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\014', '\n',
-'\010', 'T', 'L', 'S', '_', 'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '0', '\020', '\001', '\022',
-'\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '1', '\020', '\002', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '2', '\020', '\003',
-'\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '3', '\020', '\004', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v',
-'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't',
-'e', 'r', 's', '\"', '\317', '\001', '\n', '\022', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e',
-'r', '\022', ',', '\n', '\r', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'A', '\n',
-'\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o',
-'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'H',
-'\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e',
-'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J',
-'\004', '\010', '\002', '\020', '\003', 'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\206', '\005', '\n', '\016', 'T', 'l', 's', 'C', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', 'M', '\n', '\021', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'h',
-'a', 'i', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\020', 'c', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'C', 'h', 'a', 'i', 'n', '\022', 'I', '\n', '\013', 'p', 'r', 'i', 'v', 'a', 't', 'e', '_', 'k', 'e',
-'y', '\030', '\002', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R',
-'\n', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i',
-'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n',
-'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't',
-'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'o', '\n', '\024',
-'p', 'r', 'i', 'v', 'a', 't', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\006', ' ', '\001', '(',
-'\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
-'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'P', 'r', 'i', 'v',
-'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R', '\022', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e',
-'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', 'D', '\n', '\010', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '\030', '\003', ' ', '\001',
+'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '$', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r',
+'e', '/', 'v', '3', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'e', 'n', 'v',
+'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's', 't', 'r', 'i', 'n', 'g',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a',
+'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
+'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'u',
+'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e',
+'.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/',
+'s', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a',
+'t', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\362', '\003',
+'\n', '\r', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\022', '\217', '\001', '\n', '\034', 't', 'l', 's', '_', 'm',
+'i', 'n', 'i', 'm', 'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\001',
+' ', '\001', '(', '\016', '2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't',
+'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T',
+'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'B',
+'\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'i', 'n', 'i', 'm', 'u', 'm', 'P', 'r', 'o', 't',
+'o', 'c', 'o', 'l', 'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '\217', '\001', '\n', '\034', 't', 'l', 's', '_', 'm', 'a', 'x', 'i', 'm',
+'u', 'm', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\016',
+'2', 'D', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
+'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'P', 'a',
+'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '.', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 'B', '\010', '\372', 'B', '\005',
+'\202', '\001', '\002', '\020', '\001', 'R', '\031', 't', 'l', 's', 'M', 'a', 'x', 'i', 'm', 'u', 'm', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l',
+'V', 'e', 'r', 's', 'i', 'o', 'n', '\022', '#', '\n', '\r', 'c', 'i', 'p', 'h', 'e', 'r', '_', 's', 'u', 'i', 't', 'e', 's', '\030',
+'\003', ' ', '\003', '(', '\t', 'R', '\014', 'c', 'i', 'p', 'h', 'e', 'r', 'S', 'u', 'i', 't', 'e', 's', '\022', '\037', '\n', '\013', 'e', 'c',
+'d', 'h', '_', 'c', 'u', 'r', 'v', 'e', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\n', 'e', 'c', 'd', 'h', 'C', 'u', 'r', 'v',
+'e', 's', '\"', 'O', '\n', '\013', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', '\022', '\014', '\n', '\010', 'T', 'L', 'S', '_',
+'A', 'U', 'T', 'O', '\020', '\000', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '0', '\020', '\001', '\022', '\013', '\n', '\007', 'T', 'L',
+'S', 'v', '1', '_', '1', '\020', '\002', '\022', '\013', '\n', '\007', 'T', 'L', 'S', 'v', '1', '_', '2', '\020', '\003', '\022', '\013', '\n', '\007', 'T',
+'L', 'S', 'v', '1', '_', '3', '\020', '\004', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p',
+'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', '\"', '\317',
+'\001', '\n', '\022', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', ',', '\n', '\r',
+'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
+'\002', '\020', '\001', 'R', '\014', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'N', 'a', 'm', 'e', '\022', 'A', '\n', '\014', 't', 'y', 'p', 'e',
+'d', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'H', '\000', 'R', '\013', 't', 'y',
+'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 'a',
+'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', 'B', '\r', '\n', '\013', 'c', 'o', 'n', 'f', 'i', 'g', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\002', '\020', '\003',
+'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\206', '\005', '\n', '\016', 'T', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
+'t', 'e', '\022', 'M', '\n', '\021', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'h', 'a', 'i', 'n', '\030', '\001',
+' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', 'C', 'h', 'a', 'i', 'n', '\022', 'I', '\n', '\013', 'p', 'r', 'i', 'v', 'a', 't', 'e', '_', 'k', 'e', 'y', '\030', '\002', ' ', '\001',
'(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\010', 'p', 'a', 's', 's',
-'w', 'o', 'r', 'd', '\022', 'A', '\n', '\013', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '\030', '\004', ' ', '\001', '(', '\013',
-'2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D',
-'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\n', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', '\022', 'b', '\n', '\034',
-'s', 'i', 'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't',
-'a', 'm', 'p', '\030', '\005', ' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\032', 's', 'i', 'g', 'n', 'e',
-'d', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', ':', '\'', '\232', '\305',
-'\210', '\036', '\"', '\n', ' ', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l',
-'s', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\"', '\213', '\001', '\n', '\024', 'T', 'l', 's', 'S', 'e', 's', 's', 'i',
-'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\022', 'D', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ', '\003', '(',
-'\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\016', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', '\270', '\267', '\213', '\244', '\002',
-'\001', 'R', '\004', 'k', 'e', 'y', 's', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't',
-'K', 'e', 'y', 's', '\"', '\307', '\007', '\n', '\034', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '?', '\n', '\n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'c',
-'a', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\t', 't', 'r', 'u', 's', 't', 'e', 'd',
-'C', 'a', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\013',
-' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c',
-'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'F', '\n', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e',
-'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'p', 'k', 'i', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013',
-'\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', ',', '(', ',', 'R', '\025', 'v', 'e', 'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'S', 'p', 'k', 'i', '\022', 'F', '\n', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', '_', 'h', 'a', 's', 'h', '\030', '\002', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010',
-'\"', '\006', 'r', '\004', '\020', '@', '(', '_', 'R', '\025', 'v', 'e', 'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'H', 'a', 's', 'h', '\022', '[', '\n', '\027', 'm', 'a', 't', 'c', 'h', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a',
-'l', 't', '_', 'n', 'a', 'm', 'e', 's', '\030', '\t', ' ', '\003', '(', '\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h',
-'e', 'r', 'R', '\024', 'm', 'a', 't', 'c', 'h', 'S', 'u', 'b', 'j', 'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 's', '\022',
-'k', '\n', '$', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'i', 'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '!',
-'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'i', 'g', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T',
-'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '2', '\n', '\003', 'c', 'r', 'l', '\030', '\007', ' ', '\001', '(', '\013', '2', ' ', '.', 'e',
+'.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\n', 'p', 'r', 'i', 'v',
+'a', 't', 'e', 'K', 'e', 'y', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd', '_', 'd', 'i', 'r', 'e', 'c', 't', 'o',
+'r', 'y', '\030', '\007', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', 'R', '\020',
+'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022', 'o', '\n', '\024', 'p', 'r', 'i', 'v', 'a',
+'t', 'e', '_', 'k', 'e', 'y', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\006', ' ', '\001', '(', '\013', '2', '=', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
+'_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e',
+'y', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R', '\022', 'p', 'r', 'i', 'v', 'a', 't', 'e', 'K', 'e', 'y', 'P', 'r', 'o', 'v',
+'i', 'd', 'e', 'r', '\022', 'D', '\n', '\010', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '\030', '\003', ' ', '\001', '(', '\013', '2', ' ', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a',
+'S', 'o', 'u', 'r', 'c', 'e', 'B', '\006', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\010', 'p', 'a', 's', 's', 'w', 'o', 'r', 'd', '\022',
+'A', '\n', '\013', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o',
+'u', 'r', 'c', 'e', 'R', '\n', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', '\022', 'b', '\n', '\034', 's', 'i', 'g', 'n', 'e',
+'d', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\030', '\005',
+' ', '\003', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\032', 's', 'i', 'g', 'n', 'e', 'd', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', ':', '\'', '\232', '\305', '\210', '\036', '\"', '\n', ' ',
+'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'T', 'l', 's', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', '\"', '\213', '\001', '\n', '\024', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c',
+'k', 'e', 't', 'K', 'e', 'y', 's', '\022', 'D', '\n', '\004', 'k', 'e', 'y', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', ' ', '.', 'e',
'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S',
-'o', 'u', 'r', 'c', 'e', 'R', '\003', 'c', 'r', 'l', '\022', ':', '\n', '\031', 'a', 'l', 'l', 'o', 'w', '_', 'e', 'x', 'p', 'i', 'r',
-'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\027', 'a', 'l', 'l',
-'o', 'w', 'E', 'x', 'p', 'i', 'r', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', '\242', '\001', '\n', '\030',
-'t', 'r', 'u', 's', 't', '_', 'c', 'h', 'a', 'i', 'n', '_', 'v', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\030',
-'\n', ' ', '\001', '(', '\016', '2', '^', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
-'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
-'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't',
-'e', 'x', 't', '.', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o',
-'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\026', 't', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e',
-'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\"', 'F', '\n', '\026', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V',
-'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\022', 'V', 'E', 'R', 'I', 'F', 'Y', '_', 'T', 'R', 'U',
-'S', 'T', '_', 'C', 'H', 'A', 'I', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'A', 'C', 'C', 'E', 'P', 'T', '_', 'U', 'N', 'T', 'R',
-'U', 'S', 'T', 'E', 'D', '\020', '\001', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i',
-'.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'R',
-'\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 'B',
-'P', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
-'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
-'s', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\013', 'C', 'o', 'm', 'm', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', 'u', 'r', 'c', 'e', 'B', '\016', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', '\270', '\267', '\213', '\244', '\002', '\001', 'R', '\004', 'k', 'e',
+'y', 's', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a',
+'u', 't', 'h', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\"',
+'s', '\n', '!', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'P', 'l', 'u',
+'g', 'i', 'n', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '_', 'n',
+'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')',
+'\n', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R',
+'\017', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'N', 'a', 'm', 'e', '\"', '\363', '\t', '\n', '\034', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022',
+'W', '\n', '\n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'c', 'a', '\030', '\001', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u',
+'r', 'c', 'e', 'B', '\026', '\362', '\230', '\376', '\217', '\005', '\020', '\022', '\016', 'c', 'a', '_', 'c', 'e', 'r', 't', '_', 's', 'o', 'u', 'r',
+'c', 'e', 'R', '\t', 't', 'r', 'u', 's', 't', 'e', 'd', 'C', 'a', '\022', '\255', '\001', '\n', ' ', 'c', 'a', '_', 'c', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e',
+'\030', '\r', ' ', '\001', '(', '\013', '2', 'L', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3',
+'.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'P', 'l', 'u', 'g', 'i',
+'n', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\026', '\362', '\230', '\376', '\217', '\005', '\020', '\022', '\016', 'c', 'a', '_', 'c', 'e', 'r',
+'t', '_', 's', 'o', 'u', 'r', 'c', 'e', 'R', '\035', 'c', 'a', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r',
+'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', 'S', '\n', '\021', 'w', 'a', 't', 'c', 'h', 'e', 'd',
+'_', 'd', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\030', '\013', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'W', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r',
+'e', 'c', 't', 'o', 'r', 'y', 'R', '\020', 'w', 'a', 't', 'c', 'h', 'e', 'd', 'D', 'i', 'r', 'e', 'c', 't', 'o', 'r', 'y', '\022',
+'F', '\n', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'p', 'k',
+'i', '\030', '\003', ' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', ',', '(', ',', 'R', '\025',
+'v', 'e', 'r', 'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'S', 'p', 'k', 'i', '\022', 'F', '\n', '\027',
+'v', 'e', 'r', 'i', 'f', 'y', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'h', 'a', 's', 'h', '\030', '\002',
+' ', '\003', '(', '\t', 'B', '\016', '\372', 'B', '\013', '\222', '\001', '\010', '\"', '\006', 'r', '\004', '\020', '@', '(', '_', 'R', '\025', 'v', 'e', 'r',
+'i', 'f', 'y', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'H', 'a', 's', 'h', '\022', '[', '\n', '\027', 'm', 'a', 't',
+'c', 'h', '_', 's', 'u', 'b', 'j', 'e', 'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 's', '\030', '\t', ' ', '\003', '(',
+'\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3',
+'.', 'S', 't', 'r', 'i', 'n', 'g', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\024', 'm', 'a', 't', 'c', 'h', 'S', 'u', 'b', 'j',
+'e', 'c', 't', 'A', 'l', 't', 'N', 'a', 'm', 'e', 's', '\022', 'k', '\n', '$', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'i',
+'g', 'n', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 't', 'i', 'm', 'e', 's', 't', 'a', 'm',
+'p', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '!', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'i', 'g', 'n', 'e', 'd',
+'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '\022', '2', '\n', '\003', 'c',
+'r', 'l', '\030', '\007', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'D', 'a', 't', 'a', 'S', 'o', 'u', 'r', 'c', 'e', 'R', '\003', 'c', 'r', 'l', '\022', ':', '\n',
+'\031', 'a', 'l', 'l', 'o', 'w', '_', 'e', 'x', 'p', 'i', 'r', 'e', 'd', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\027', 'a', 'l', 'l', 'o', 'w', 'E', 'x', 'p', 'i', 'r', 'e', 'd', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', '\242', '\001', '\n', '\030', 't', 'r', 'u', 's', 't', '_', 'c', 'h', 'a', 'i', 'n', '_', 'v',
+'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\n', ' ', '\001', '(', '\016', '2', '^', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c',
+'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a',
+'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i',
+'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\026',
+'t', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\022', 'b', '\n',
+'\027', 'c', 'u', 's', 't', 'o', 'm', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030',
+'\014', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
+'\025', 'c', 'u', 's', 't', 'o', 'm', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'o', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\"', 'F', '\n',
+'\026', 'T', 'r', 'u', 's', 't', 'C', 'h', 'a', 'i', 'n', 'V', 'e', 'r', 'i', 'f', 'i', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026',
+'\n', '\022', 'V', 'E', 'R', 'I', 'F', 'Y', '_', 'T', 'R', 'U', 'S', 'T', '_', 'C', 'H', 'A', 'I', 'N', '\020', '\000', '\022', '\024', '\n',
+'\020', 'A', 'C', 'C', 'E', 'P', 'T', '_', 'U', 'N', 'T', 'R', 'U', 'S', 'T', 'E', 'D', '\020', '\001', ':', '5', '\232', '\305', '\210', '\036',
+'0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'e', 'r', 't',
+'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'J',
+'\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010', '\005', '\020', '\006', 'R', '\027', 'v', 'e', 'r', 'i', 'f', 'y', '_', 's', 'u', 'b', 'j', 'e',
+'c', 't', '_', 'a', 'l', 't', '_', 'n', 'a', 'm', 'e', 'B', 'P', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r',
+'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\013', 'C', 'o', 'm',
+'m', 'o', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
+'3',
};
-static upb_def_init *deps[9] = {
+static upb_def_init *deps[11] = {
&envoy_config_core_v3_base_proto_upbdefinit,
+ &envoy_config_core_v3_extension_proto_upbdefinit,
&envoy_type_matcher_v3_string_proto_upbdefinit,
&google_protobuf_any_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
+ &udpa_annotations_migrate_proto_upbdefinit,
&udpa_annotations_sensitive_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
@@ -164,7 +175,7 @@ static upb_def_init *deps[9] = {
upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_common_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/common.proto",
- UPB_STRVIEW_INIT(descriptor, 2914)
+ UPB_STRVIEW_INIT(descriptor, 3401)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
index b289899d806..397f5af2fff 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
@@ -41,6 +41,11 @@ UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_TlsSessio
return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.TlsSessionTicketKeys");
}
+UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CertificateProviderPluginInstance");
+}
+
UPB_INLINE const upb_msgdef *envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.extensions.transport_sockets.tls.v3.CertificateValidationContext");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
index 5623e1bc881..82e7bb00dd1 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/secret.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/secret.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_config_source_proto_upbdefinit;
@@ -16,16 +17,6 @@ extern upb_def_init udpa_annotations_sensitive_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_Secret_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit,
- &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit,
- &envoy_extensions_transport_sockets_tls_v3_Secret_msginit,
-};
-
static const char descriptor[1236] = {'\n', '6', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't',
'.', 'p', 'r', 'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
@@ -91,7 +82,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_secret_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/secret.proto",
UPB_STRVIEW_INIT(descriptor, 1236)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
index a4651fcd688..cd67567f580 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c
@@ -8,33 +8,18 @@
#include "upb/def.h"
#include "envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h"
+#include "envoy/extensions/transport_sockets/tls/v3/tls.upb.h"
extern upb_def_init envoy_config_core_v3_extension_proto_upbdefinit;
extern upb_def_init envoy_extensions_transport_sockets_tls_v3_common_proto_upbdefinit;
extern upb_def_init envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit;
-extern const upb_msglayout envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit;
-
-static const upb_msglayout *layouts[6] = {
- &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit,
- &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit,
-};
-
-static const char descriptor[4707] = {'\n', '3', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
+static const char descriptor[4838] = {'\n', '3', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 't', 'r', 'a', 'n', 's', 'p',
'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '/', 't', 'l', 's', '/', 'v', '3', '/', 't', 'l', 's', '.', 'p', 'r',
'o', 't', 'o', '\022', ')', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '\032', '$', 'e', 'n',
@@ -46,183 +31,188 @@ static const char descriptor[4707] = {'\n', '3', 'e', 'n', 'v', 'o', 'y', '/', '
's', '/', 't', 'l', 's', '/', 'v', '3', '/', 's', 'e', 'c', 'r', 'e', 't', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o',
'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r',
'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p',
-'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
-'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
-'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i',
-'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a',
-'t', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\301', '\002', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C',
-'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n', 't',
-'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
-'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's',
-'.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o', 'm',
-'m', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\032', '\n', '\003', 's', 'n', 'i', '\030', '\002', ' ', '\001', '(',
-'\t', 'B', '\010', '\372', 'B', '\005', 'r', '\003', '(', '\377', '\001', 'R', '\003', 's', 'n', 'i', '\022', '/', '\n', '\023', 'a', 'l', 'l', 'o', 'w',
-'_', 'r', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\022', 'a', 'l', 'l',
-'o', 'w', 'R', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\022', 'F', '\n', '\020', 'm', 'a', 'x', '_', 's', 'e',
-'s', 's', 'i', 'o', 'n', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'R', '\016', 'm', 'a',
-'x', 'S', 'e', 's', 's', 'i', 'o', 'n', 'K', 'e', 'y', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '\"', '\352', '\007', '\n', '\024', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
-'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
-'s', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'R', '\020', 'c', 'o',
-'m', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'X', '\n', '\032', 'r', 'e', 'q', 'u', 'i', 'r', 'e',
-'_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030', '\002', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '\022', ';', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'n', 'i', '\030', '\003', ' ', '\001', '(', '\013',
-'2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a',
-'l', 'u', 'e', 'R', '\n', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'n', 'i', '\022', 'q', '\n', '\023', 's', 'e', 's', 's', 'i', 'o',
-'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '?', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
-'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'T',
-'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'H', '\000', 'R', '\021', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e',
-'t', 'K', 'e', 'y', 's', '\022', '\215', '\001', '\n', '%', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_',
-'k', 'e', 'y', 's', '_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\005', ' ',
-'\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
-'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd',
-'s', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 's', 'e', 's', 's', 'i', 'o', 'n', 'T',
-'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022',
-'Q', '\n', '$', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'e', 'l', 'e', 's', 's', '_', 's', 'e', 's', 's',
-'i', 'o', 'n', '_', 'r', 'e', 's', 'u', 'm', 'p', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\010', 'H', '\000', 'R', '!', 'd',
-'i', 's', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'e', 'l', 'e', 's', 's', 'S', 'e', 's', 's', 'i', 'o', 'n', 'R', 'e', 's',
-'u', 'm', 'p', 't', 'i', 'o', 'n', '\022', 'T', '\n', '\017', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'm', 'e', 'o', 'u',
-'t', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\020', '\372', 'B', '\r', '\252', '\001', '\n', '\032', '\006', '\010', '\200', '\200', '\200', '\200', '\020',
-'2', '\000', 'R', '\016', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\210', '\001', '\n', '\022', 'o', 'c',
-'s', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\010', ' ', '\001', '(', '\016', '2', 'P', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r',
-'t', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e',
-'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o',
-'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\020', 'o', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l',
-'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', 'N', '\n', '\020', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i',
-'c', 'y', '\022', '\024', '\n', '\020', 'L', 'E', 'N', 'I', 'E', 'N', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\000', '\022',
-'\023', '\n', '\017', 'S', 'T', 'R', 'I', 'C', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\001', '\022', '\017', '\n', '\013', 'M',
-'U', 'S', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'E', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n', '&', 'e', 'n', 'v', 'o',
-'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', 'T',
-'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\032', '\n', '\030', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k',
-'e', 't', '_', 'k', 'e', 'y', 's', '_', 't', 'y', 'p', 'e', '\"', '\247', '\026', '\n', '\020', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l',
-'s', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'W', '\n', '\n', 't', 'l', 's', '_', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ',
-'\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
-'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l',
-'s', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'R', '\t', 't', 'l', 's', 'P', 'a', 'r', 'a', 'm', 's', '\022', 'd', '\n',
-'\020', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\030', '\002', ' ', '\003', '(', '\013', '2', '9',
-'.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o',
-'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'C', 'e', 'r', 't',
-'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', '\017', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\022',
-'\220', '\001', '\n', '\"', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 's', 'd', 's', '_', 's',
-'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', ':', '.', 'e', 'n', 'v',
-'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's',
-'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
-'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\020', '\001', 'R', '\036', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\022', '\240', '\001', '\n',
-'$', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n',
-'t', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'R',
-'!', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
-'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\271', '\001', '\n', '-', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
-'_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\013', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
+'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u',
+'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
+'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r',
+'s', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\301', '\002', '\n', '\022', 'U', 'p', 's', 't', 'r', 'e', 'a',
+'m', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l', 's',
+'_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x',
+'t', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't',
+'s', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't',
+'R', '\020', 'c', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\032', '\n', '\003', 's', 'n', 'i',
+'\030', '\002', ' ', '\001', '(', '\t', 'B', '\010', '\372', 'B', '\005', 'r', '\003', '(', '\377', '\001', 'R', '\003', 's', 'n', 'i', '\022', '/', '\n', '\023',
+'a', 'l', 'l', 'o', 'w', '_', 'r', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\030', '\003', ' ', '\001', '(', '\010',
+'R', '\022', 'a', 'l', 'l', 'o', 'w', 'R', 'e', 'n', 'e', 'g', 'o', 't', 'i', 'a', 't', 'i', 'o', 'n', '\022', 'F', '\n', '\020', 'm',
+'a', 'x', '_', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'R', '\016', 'm', 'a', 'x', 'S', 'e', 's', 's', 'i', 'o', 'n', 'K', 'e', 'y', 's', ':', '+', '\232', '\305', '\210', '\036', '&', '\n',
+'$', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'U', 'p', 's', 't', 'r', 'e',
+'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\"', '\352', '\007', '\n', '\024', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e',
+'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'i', '\n', '\022', 'c', 'o', 'm', 'm', 'o', 'n', '_', 't', 'l',
+'s', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', ';', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e',
'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e',
't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x',
-'t', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't',
-'a', 'n', 'c', 'e', 'R', ')', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', 'x', '\n',
-'\022', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\003', ' ', '\001', '(', '\013',
-'2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000',
-'R', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\214', '\001', '\n', '$', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c',
-'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
-'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', 'H', '\000', 'R', ' ', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's',
-'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\242', '\001', '\n', '\033', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd',
-'_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\010', ' ', '\001', '(', '\013',
-'2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's',
-'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o',
-'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000',
-'R', '\031', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e',
-'x', 't', '\022', '\250', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't',
-'_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\n', ' ', '\001',
+'t', 'R', '\020', 'c', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'X', '\n', '\032', 'r', 'e',
+'q', 'u', 'i', 'r', 'e', '_', 'c', 'l', 'i', 'e', 'n', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
+'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\030', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'e',
+'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '\022', ';', '\n', '\013', 'r', 'e', 'q', 'u', 'i', 'r', 'e', '_', 's', 'n', 'i', '\030',
+'\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B',
+'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\n', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'S', 'n', 'i', '\022', 'q', '\n', '\023', 's',
+'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '\030', '\004', ' ', '\001', '(', '\013', '2',
+'?', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l', 's', 'S', 'e', 's',
+'s', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'H', '\000', 'R', '\021', 's', 'e', 's', 's', 'i', 'o', 'n',
+'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', '\022', '\215', '\001', '\n', '%', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't', 'i',
+'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.',
+'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 's', 'e', 's',
+'s', 'i', 'o', 'n', 'T', 'i', 'c', 'k', 'e', 't', 'K', 'e', 'y', 's', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
+'n', 'f', 'i', 'g', '\022', 'Q', '\n', '$', 'd', 'i', 's', 'a', 'b', 'l', 'e', '_', 's', 't', 'a', 't', 'e', 'l', 'e', 's', 's',
+'_', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 'r', 'e', 's', 'u', 'm', 'p', 't', 'i', 'o', 'n', '\030', '\007', ' ', '\001', '(', '\010',
+'H', '\000', 'R', '!', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'S', 't', 'a', 't', 'e', 'l', 'e', 's', 's', 'S', 'e', 's', 's', 'i',
+'o', 'n', 'R', 'e', 's', 'u', 'm', 'p', 't', 'i', 'o', 'n', '\022', 'T', '\n', '\017', 's', 'e', 's', 's', 'i', 'o', 'n', '_', 't',
+'i', 'm', 'e', 'o', 'u', 't', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'B', '\020', '\372', 'B', '\r', '\252', '\001', '\n', '\032', '\006', '\010',
+'\200', '\200', '\200', '\200', '\020', '2', '\000', 'R', '\016', 's', 'e', 's', 's', 'i', 'o', 'n', 'T', 'i', 'm', 'e', 'o', 'u', 't', '\022', '\210',
+'\001', '\n', '\022', 'o', 'c', 's', 'p', '_', 's', 't', 'a', 'p', 'l', 'e', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\010', ' ', '\001',
+'(', '\016', '2', 'P', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
+'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'D', 'o', 'w',
+'n', 's', 't', 'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'O', 'c', 's', 'p', 'S', 't', 'a',
+'p', 'l', 'e', 'P', 'o', 'l', 'i', 'c', 'y', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\020', 'o', 'c', 's', 'p',
+'S', 't', 'a', 'p', 'l', 'e', 'P', 'o', 'l', 'i', 'c', 'y', '\"', 'N', '\n', '\020', 'O', 'c', 's', 'p', 'S', 't', 'a', 'p', 'l',
+'e', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '\024', '\n', '\020', 'L', 'E', 'N', 'I', 'E', 'N', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I',
+'N', 'G', '\020', '\000', '\022', '\023', '\n', '\017', 'S', 'T', 'R', 'I', 'C', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'I', 'N', 'G', '\020', '\001',
+'\022', '\017', '\n', '\013', 'M', 'U', 'S', 'T', '_', 'S', 'T', 'A', 'P', 'L', 'E', '\020', '\002', ':', '-', '\232', '\305', '\210', '\036', '(', '\n',
+'&', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'D', 'o', 'w', 'n', 's', 't',
+'r', 'e', 'a', 'm', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\032', '\n', '\030', 's', 'e', 's', 's', 'i', 'o', 'n',
+'_', 't', 'i', 'c', 'k', 'e', 't', '_', 'k', 'e', 'y', 's', '_', 't', 'y', 'p', 'e', '\"', '\245', '\027', '\n', '\020', 'C', 'o', 'm',
+'m', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'W', '\n', '\n', 't', 'l', 's', '_', 'p', 'a', 'r', 'a',
+'m', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '8', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o',
+'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.',
+'v', '3', '.', 'T', 'l', 's', 'P', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 'R', '\t', 't', 'l', 's', 'P', 'a', 'r', 'a',
+'m', 's', '\022', 'd', '\n', '\020', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 's', '\030', '\002', ' ',
+'\003', '(', '\013', '2', '9', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r',
+'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'T', 'l',
+'s', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'R', '\017', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 's', '\022', '\220', '\001', '\n', '\"', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_',
+'s', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\006', ' ', '\003', '(', '\013', '2',
+':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p',
+'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c',
+'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\020', '\002', 'R', '\036', 't', 'l', 's', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+'s', '\022', '\227', '\001', '\n', '!', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o',
+'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\016', ' ', '\001', '(', '\013', '2', 'L', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_',
+'s', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'P', 'l', 'u', 'g', 'i', 'n', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', '\036',
+'t', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's',
+'t', 'a', 'n', 'c', 'e', '\022', '\255', '\001', '\n', '$', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e',
+'_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\t', ' ', '\001',
'(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm',
'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e',
-'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'H', '\000', 'R', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n',
-'t', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\301',
-'\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r',
-'t', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c',
-'e', '\030', '\014', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n',
-'s', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v',
-'3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f',
-'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'H', '\000', 'R', ',',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '%', '\n', '\016', 'a', 'l',
-'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\004', ' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n', 'P',
-'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', 'W', '\n', '\021', 'c', 'u', 's', 't', 'o', 'm', '_', 'h', 'a', 'n', 'd', 's', 'h',
-'a', 'k', 'e', 'r', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g',
-'.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o',
-'n', 'f', 'i', 'g', 'R', '\020', 'c', 'u', 's', 't', 'o', 'm', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', '\032', '\222', '\001',
-'\n', '\023', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\033', '\n', '\004',
-'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e',
-'\022', 'O', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.',
-'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e',
-'d', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd',
-'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\006', 'c', 'o', 'n', 'f', 'i', 'g', '\022', '\003', '\370', 'B', '\001', '\032', 'm', '\n', '\033',
-'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n',
-'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i',
-'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\017', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c',
-'a', 't', 'e', 'N', 'a', 'm', 'e', '\032', '\364', '\006', '\n', '$', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i',
-'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\217',
-'\001', '\n', '\032', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n',
-'t', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
+'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '!', 't', 'l',
+'s', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r',
+'o', 'v', 'i', 'd', 'e', 'r', '\022', '\306', '\001', '\n', '-', 't', 'l', 's', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
+'e', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n',
+'s', 't', 'a', 'n', 'c', 'e', '\030', '\013', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c',
+'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', ')', 't', 'l', 's', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I',
+'n', 's', 't', 'a', 'n', 'c', 'e', '\022', 'x', '\n', '\022', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n',
+'t', 'e', 'x', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', 'G', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
-'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\030', 'd', 'e', 'f', 'a', 'u',
-'l', 't', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\266', '\001', '\n', '$', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c',
-'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
-'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i',
-'g', 'B', '*', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm', 'i',
-'c', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', ' ', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '\312', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e',
-'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\030', '\003',
-' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't',
-'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C',
-'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\"', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm',
-'i', 'c', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', '$', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't',
-'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\343', '\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_',
-'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i',
-'d', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o',
-'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o',
-'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n',
-'t', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I',
-'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\"', '\362', '\230', '\376', '\217', '\005', '\034', '\022', '\032', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', 'R', ',', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r',
-'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', ':', 'N', '\232', '\305', '\210', '\036', 'I', '\n', 'G', 'e', 'n',
-'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's',
-'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
-'t', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', ':', ')', '\232', '\305', '\210', '\036',
-'$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm', 'm',
-'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\031', '\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
-'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020', '\006', 'B', 'M', '\n', '7', 'i',
-'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
+'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000', 'R', '\021', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n',
+'t', 'e', 'x', 't', '\022', '\214', '\001', '\n', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e',
+'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\007', ' ', '\001', '(',
+'\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n',
+'s', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's', 'S',
+'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'H', '\000', 'R', ' ', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n',
+'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\242', '\001',
+'\n', '\033', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd', '_', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n',
+'t', 'e', 'x', 't', '\030', '\010', ' ', '\001', '(', '\013', '2', '`', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's',
'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l',
-'s', '.', 'v', '3', 'B', '\010', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm',
+'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o',
+'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'H', '\000', 'R', '\031', 'c', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'V', 'a', 'l', 'i', 'd',
+'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\265', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i',
+'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r',
+'o', 'v', 'i', 'd', 'e', 'r', '\030', '\n', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e',
+'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.',
+'t', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C',
+'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206',
+'\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e',
+'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\316', '\001', '\n',
+'0', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i',
+'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030',
+'\014', ' ', '\001', '(', '\013', '2', 'W', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.',
+'t', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.',
+'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c',
+'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\013', '\030', '\001', '\222', '\307',
+'\206', '\330', '\004', '\003', '3', '.', '0', 'H', '\000', 'R', ',', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't',
+'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's',
+'t', 'a', 'n', 'c', 'e', '\022', '%', '\n', '\016', 'a', 'l', 'p', 'n', '_', 'p', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\030', '\004',
+' ', '\003', '(', '\t', 'R', '\r', 'a', 'l', 'p', 'n', 'P', 'r', 'o', 't', 'o', 'c', 'o', 'l', 's', '\022', 'W', '\n', '\021', 'c', 'u',
+'s', 't', 'o', 'm', '_', 'h', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', '\030', '\r', ' ', '\001', '(', '\013', '2', '*', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd',
+'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\020', 'c', 'u', 's', 't', 'o', 'm', 'H', 'a',
+'n', 'd', 's', 'h', 'a', 'k', 'e', 'r', '\032', '\222', '\001', '\n', '\023', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P',
+'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B',
+'\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', '\022', 'O', '\n', '\014', 't', 'y', 'p', 'e', 'd', '_', 'c', 'o', 'n', 'f',
+'i', 'g', '\030', '\002', ' ', '\001', '(', '\013', '2', '*', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c',
+'o', 'r', 'e', '.', 'v', '3', '.', 'T', 'y', 'p', 'e', 'd', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 'C', 'o', 'n', 'f',
+'i', 'g', 'H', '\000', 'R', '\013', 't', 'y', 'p', 'e', 'd', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\r', '\n', '\006', 'c', 'o', 'n', 'f',
+'i', 'g', '\022', '\003', '\370', 'B', '\001', '\032', 'm', '\n', '\033', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o',
+'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '\022', '#', '\n', '\r', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e',
+'_', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\014', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'N', 'a', 'm', 'e',
+'\022', ')', '\n', '\020', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001', '(',
+'\t', 'R', '\017', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'N', 'a', 'm', 'e', '\032', '\244', '\006', '\n', '$', 'C', 'o',
+'m', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i',
+'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', '\217', '\001', '\n', '\032', 'd', 'e', 'f', 'a', 'u', 'l', 't', '_', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', 'G', '.', 'e',
+'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't',
+'_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a',
+'t', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\010', '\372', 'B', '\005', '\212',
+'\001', '\002', '\020', '\001', 'R', '\030', 'd', 'e', 'f', 'a', 'u', 'l', 't', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o',
+'n', 't', 'e', 'x', 't', '\022', '\224', '\001', '\n', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't',
+'e', 'x', 't', '_', 's', 'd', 's', '_', 's', 'e', 'c', 'r', 'e', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001',
+'(', '\013', '2', ':', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a',
+'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'S', 'd', 's',
+'S', 'e', 'c', 'r', 'e', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', ' ', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'S', 'd', 's', 'S', 'e', 'c', 'r', 'e', 't',
+'C', 'o', 'n', 'f', 'i', 'g', '\022', '\263', '\001', '\n', '\'', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n',
+'t', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p', 'r', 'o', 'v', 'i', 'd', 'e', 'r',
+'\030', '\003', ' ', '\001', '(', '\013', '2', 'O', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's',
+'.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3',
+'.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i',
+'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'R', '$', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f',
+'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', '\022', '\314', '\001', '\n', '0', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'c', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', '_', 'p',
+'r', 'o', 'v', 'i', 'd', 'e', 'r', '_', 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', 'W', '.',
+'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r',
+'t', '_', 's', 'o', 'c', 'k', 'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l',
+'s', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'e', 'r', 't', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i',
+'d', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R',
+',', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't', 'C', 'e', 'r', 't', 'i', 'f', 'i',
+'c', 'a', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', ':', 'N', '\232', '\305', '\210',
+'\036', 'I', '\n', 'G', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't', 'h', '.', 'C', 'o', 'm',
+'m', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', '.', 'C', 'o', 'm', 'b', 'i', 'n', 'e', 'd', 'C', 'e', 'r',
+'t', 'i', 'f', 'i', 'c', 'a', 't', 'e', 'V', 'a', 'l', 'i', 'd', 'a', 't', 'i', 'o', 'n', 'C', 'o', 'n', 't', 'e', 'x', 't',
+':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'p', 'i', '.', 'v', '2', '.', 'a', 'u', 't',
+'h', '.', 'C', 'o', 'm', 'm', 'o', 'n', 'T', 'l', 's', 'C', 'o', 'n', 't', 'e', 'x', 't', 'B', '\031', '\n', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'i', 'o', 'n', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 't', 'y', 'p', 'e', 'J', '\004', '\010', '\005', '\020',
+'\006', 'B', 'M', '\n', '7', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 't', 'r', 'a', 'n', 's', 'p', 'o', 'r', 't', '_', 's', 'o', 'c', 'k',
+'e', 't', 's', '.', 't', 'l', 's', '.', 'v', '3', 'B', '\010', 'T', 'l', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
+'\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[10] = {
@@ -231,7 +221,7 @@ static upb_def_init *deps[10] = {
&envoy_extensions_transport_sockets_tls_v3_secret_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
- &udpa_annotations_migrate_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
@@ -240,7 +230,7 @@ static upb_def_init *deps[10] = {
upb_def_init envoy_extensions_transport_sockets_tls_v3_tls_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_extensions_transport_sockets_tls_v3_tls_proto_upb_file_layout,
"envoy/extensions/transport_sockets/tls/v3/tls.proto",
- UPB_STRVIEW_INIT(descriptor, 4707)
+ UPB_STRVIEW_INIT(descriptor, 4838)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
index 6fbd46bf3be..06d0b5210a1 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/cluster/v3/cds.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/service/cluster/v3/cds.upbdefs.h"
+#include "envoy/service/cluster/v3/cds.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_cluster_v3_CdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_cluster_v3_CdsDummy_msginit,
-};
-
static const char descriptor[815] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'c', 'l', 'u', 's', 't', 'e', 'r', '/', 'v',
'3', '/', 'c', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\030', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
'e', '.', 'c', 'l', 'u', 's', 't', 'e', 'r', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i',
@@ -66,7 +61,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_cluster_v3_cds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_cluster_v3_cds_proto_upb_file_layout,
"envoy/service/cluster/v3/cds.proto",
UPB_STRVIEW_INIT(descriptor, 815)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
index f741848c631..2cb2e6ef08d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/ads.upbdefs.c
@@ -8,16 +8,11 @@
#include "upb/def.h"
#include "envoy/service/discovery/v3/ads.upbdefs.h"
+#include "envoy/service/discovery/v3/ads.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_discovery_v3_AdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_discovery_v3_AdsDummy_msginit,
-};
-
static const char descriptor[604] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
'/', 'v', '3', '/', 'a', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\032', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v',
'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's',
@@ -54,7 +49,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_service_discovery_v3_ads_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_discovery_v3_ads_proto_upb_file_layout,
"envoy/service/discovery/v3/ads.proto",
UPB_STRVIEW_INIT(descriptor, 604)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
index 0df3b7b3cb9..fa55ae09f9b 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/discovery/v3/discovery.upbdefs.c
@@ -8,6 +8,7 @@
#include "upb/def.h"
#include "envoy/service/discovery/v3/discovery.upbdefs.h"
+#include "envoy/service/discovery/v3/discovery.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init google_protobuf_any_proto_upbdefinit;
@@ -15,24 +16,6 @@ extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_rpc_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_discovery_v3_DiscoveryRequest_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DiscoveryResponse_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_Resource_msginit;
-extern const upb_msglayout envoy_service_discovery_v3_Resource_CacheControl_msginit;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_service_discovery_v3_DiscoveryRequest_msginit,
- &envoy_service_discovery_v3_DiscoveryResponse_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry_msginit,
- &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit,
- &envoy_service_discovery_v3_Resource_msginit,
- &envoy_service_discovery_v3_Resource_CacheControl_msginit,
-};
-
static const char descriptor[2206] = {'\n', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y',
'/', 'v', '3', '/', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\032', 'e', 'n', 'v', 'o',
'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 'd', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', '.', 'v', '3', '\032', '\037', 'e',
@@ -136,7 +119,7 @@ static upb_def_init *deps[7] = {
upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_discovery_v3_discovery_proto_upb_file_layout,
"envoy/service/discovery/v3/discovery.proto",
UPB_STRVIEW_INIT(descriptor, 2206)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
index c76678797be..5a2cf25796f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/endpoint/v3/eds.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/service/endpoint/v3/eds.upbdefs.h"
+#include "envoy/service/endpoint/v3/eds.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_endpoint_v3_EdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_endpoint_v3_EdsDummy_msginit,
-};
-
static const char descriptor[838] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '/',
'v', '3', '/', 'e', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
'c', 'e', '.', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r',
@@ -67,7 +62,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_endpoint_v3_eds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_endpoint_v3_eds_proto_upb_file_layout,
"envoy/service/endpoint/v3/eds.proto",
UPB_STRVIEW_INIT(descriptor, 838)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
index c0a9934266f..fe8160a3b9c 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/listener/v3/lds.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/service/listener/v3/lds.upbdefs.h"
+#include "envoy/service/listener/v3/lds.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_listener_v3_LdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_listener_v3_LdsDummy_msginit,
-};
-
static const char descriptor[825] = {'\n', '#', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '/',
'v', '3', '/', 'l', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\031', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
'c', 'e', '.', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r',
@@ -66,7 +61,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_listener_v3_lds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_listener_v3_lds_proto_upb_file_layout,
"envoy/service/listener/v3/lds.proto",
UPB_STRVIEW_INIT(descriptor, 825)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
index 830b3987115..ac25553f49a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/load_stats/v3/lrs.upbdefs.c
@@ -8,20 +8,13 @@
#include "upb/def.h"
#include "envoy/service/load_stats/v3/lrs.upbdefs.h"
+#include "envoy/service/load_stats/v3/lrs.upb.h"
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_config_endpoint_v3_load_report_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsRequest_msginit;
-extern const upb_msglayout envoy_service_load_stats_v3_LoadStatsResponse_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_service_load_stats_v3_LoadStatsRequest_msginit,
- &envoy_service_load_stats_v3_LoadStatsResponse_msginit,
-};
-
static const char descriptor[958] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't',
's', '/', 'v', '3', '/', 'l', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\033', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r',
'v', 'i', 'c', 'e', '.', 'l', 'o', 'a', 'd', '_', 's', 't', 'a', 't', 's', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y',
@@ -74,7 +67,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_load_stats_v3_lrs_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_load_stats_v3_lrs_proto_upb_file_layout,
"envoy/service/load_stats/v3/lrs.proto",
UPB_STRVIEW_INIT(descriptor, 958)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
index d6f94655e5b..b216e048a8f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/service/route/v3/rds.upbdefs.h"
+#include "envoy/service/route/v3/rds.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_route_v3_RdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_route_v3_RdsDummy_msginit,
-};
-
static const char descriptor[1014] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/',
'r', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.',
'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'd',
@@ -74,7 +69,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_route_v3_rds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_route_v3_rds_proto_upb_file_layout,
"envoy/service/route/v3/rds.proto",
UPB_STRVIEW_INIT(descriptor, 1014)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
index a0609a2f485..85d847a69fa 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c
@@ -8,18 +8,13 @@
#include "upb/def.h"
#include "envoy/service/route/v3/srds.upbdefs.h"
+#include "envoy/service/route/v3/srds.upb.h"
extern upb_def_init envoy_service_discovery_v3_discovery_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
extern upb_def_init envoy_annotations_resource_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_route_v3_SrdsDummy_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_service_route_v3_SrdsDummy_msginit,
-};
-
static const char descriptor[851] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 'r', 'o', 'u', 't', 'e', '/', 'v', '3', '/',
's', 'r', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e',
'.', 'r', 'o', 'u', 't', 'e', '.', 'v', '3', '\032', '*', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/',
@@ -68,7 +63,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_service_route_v3_srds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_route_v3_srds_proto_upb_file_layout,
"envoy/service/route/v3/srds.proto",
UPB_STRVIEW_INIT(descriptor, 851)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
index 2673ebbbdee..987e98b93a1 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c
@@ -8,115 +8,135 @@
#include "upb/def.h"
#include "envoy/service/status/v3/csds.upbdefs.h"
+#include "envoy/service/status/v3/csds.upb.h"
extern upb_def_init envoy_admin_v3_config_dump_proto_upbdefinit;
extern upb_def_init envoy_config_core_v3_base_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_node_proto_upbdefinit;
extern upb_def_init google_api_annotations_proto_upbdefinit;
-extern upb_def_init udpa_annotations_migrate_proto_upbdefinit;
+extern upb_def_init google_protobuf_any_proto_upbdefinit;
+extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusRequest_msginit;
-extern const upb_msglayout envoy_service_status_v3_PerXdsConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientConfig_msginit;
-extern const upb_msglayout envoy_service_status_v3_ClientStatusResponse_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &envoy_service_status_v3_ClientStatusRequest_msginit,
- &envoy_service_status_v3_PerXdsConfig_msginit,
- &envoy_service_status_v3_ClientConfig_msginit,
- &envoy_service_status_v3_ClientStatusResponse_msginit,
-};
-
-static const char descriptor[2001] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 's', 't', 'a', 't', 'u', 's', '/', 'v', '3',
+static const char descriptor[2677] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 's', 'e', 'r', 'v', 'i', 'c', 'e', '/', 's', 't', 'a', 't', 'u', 's', '/', 'v', '3',
'/', 'c', 's', 'd', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\027', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'd', 'm', 'i', 'n', '/',
'v', '3', '/', 'c', 'o', 'n', 'f', 'i', 'g', '_', 'd', 'u', 'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r',
'o', 't', 'o', '\032', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v',
'3', '/', 'n', 'o', 'd', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v',
-'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\"', '\302', '\001', '\n', '\023', 'C', 'l', 'i', 'e', 'n',
-'t', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\022', 'G', '\n', '\r', 'n', 'o', 'd', 'e', '_', 'm', 'a',
-'t', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\014',
-'n', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 's', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\002', ' ', '\001', '(',
-'\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.',
-'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e', ':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.',
-'s', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\"', '\360', '\004', '\n', '\014', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o',
-'n', 'f', 'i', 'g', '\022', '=', '\n', '\006', 's', 't', 'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n',
-'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n',
-'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R', '\006', 's', 't', 'a', 't', 'u', 's', '\022', 'T', '\n', '\r', 'c', 'l', 'i', 'e',
-'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\030', '\007', ' ', '\001', '(', '\016', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e',
+'/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'g', 'o', 'o', 'g',
+'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p',
+'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p',
+'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\302', '\001', '\n', '\023', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q',
+'u', 'e', 's', 't', '\022', 'G', '\n', '\r', 'n', 'o', 'd', 'e', '_', 'm', 'a', 't', 'c', 'h', 'e', 'r', 's', '\030', '\001', ' ', '\003',
+'(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v',
+'3', '.', 'N', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'R', '\014', 'n', 'o', 'd', 'e', 'M', 'a', 't', 'c', 'h', 'e',
+'r', 's', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v', 'o', 'y', '.',
+'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n', 'o', 'd', 'e',
+':', '2', '\232', '\305', '\210', '\036', '-', '\n', '+', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e',
+'s', 't', '\"', '\371', '\004', '\n', '\014', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '=', '\n', '\006', 's', 't',
+'a', 't', 'u', 's', '\030', '\001', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
+'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R',
+'\006', 's', 't', 'a', 't', 'u', 's', '\022', ']', '\n', '\r', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\030',
+'\007', ' ', '\001', '(', '\016', '2', '+', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a',
+'t', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's',
+'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\014', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't',
+'u', 's', '\022', 'N', '\n', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\001',
+'(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'L', 'i', 's', 't', 'e',
+'n', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'l', 'i', 's', 't', 'e', 'n', 'e',
+'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\003', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'C',
+'l', 'u', 's', 't', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\r', 'c', 'l', 'u', 's',
+'t', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g',
+'\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'R',
+'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\023', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n',
+'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v',
+'3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H',
+'\000', 'R', '\021', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\017', 'e',
+'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n',
+'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'C', 'o', 'n',
+'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\020', '\n', '\016', 'p',
+'e', 'r', '_', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\213', '\006', '\n', '\014', 'C', 'l', 'i', 'e', 'n', 't', 'C',
+'o', 'n', 'f', 'i', 'g', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n', 'v',
+'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004', 'n',
+'o', 'd', 'e', '\022', 'Q', '\n', '\n', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\003', '(', '\013', '2', '%',
+'.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.',
+'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0',
+'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'f', '\n', '\023', 'g', 'e', 'n', 'e', 'r', 'i', 'c', '_', 'x', 'd',
+'s', '_', 'c', 'o', 'n', 'f', 'i', 'g', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '6', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o',
-'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'B', '\002', '\030', '\001', 'R', '\014', 'c', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', '\022', 'N', '\n', '\017', 'l', 'i', 's', 't', 'e', 'n', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ',
-'\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'L', 'i', 's', 't',
-'e', 'n', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'l', 'i', 's', 't', 'e', 'n',
-'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'K', '\n', '\016', 'c', 'l', 'u', 's', 't', 'e', 'r', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.',
-'C', 'l', 'u', 's', 't', 'e', 'r', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\r', 'c', 'l', 'u',
-'s', 't', 'e', 'r', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\014', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o', 'n', 'f', 'i',
-'g', '\030', '\004', ' ', '\001', '(', '\013', '2', ' ', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.',
-'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\013', 'r', 'o', 'u', 't', 'e',
-'C', 'o', 'n', 'f', 'i', 'g', '\022', 'X', '\n', '\023', 's', 'c', 'o', 'p', 'e', 'd', '_', 'r', 'o', 'u', 't', 'e', '_', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\005', ' ', '\001', '(', '\013', '2', '&', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.',
-'v', '3', '.', 'S', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p',
-'H', '\000', 'R', '\021', 's', 'c', 'o', 'p', 'e', 'd', 'R', 'o', 'u', 't', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'N', '\n', '\017',
-'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\006', ' ', '\001', '(', '\013', '2', '#', '.', 'e',
-'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'E', 'n', 'd', 'p', 'o', 'i', 'n', 't', 's', 'C', 'o',
-'n', 'f', 'i', 'g', 'D', 'u', 'm', 'p', 'H', '\000', 'R', '\016', 'e', 'n', 'd', 'p', 'o', 'i', 'n', 't', 'C', 'o', 'n', 'f', 'i',
-'g', ':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's',
-'t', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'B', '\020', '\n', '\016',
-'p', 'e', 'r', '_', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\"', '\261', '\001', '\n', '\014', 'C', 'l', 'i', 'e', 'n', 't',
-'C', 'o', 'n', 'f', 'i', 'g', '\022', '.', '\n', '\004', 'n', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'e', 'n',
-'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'N', 'o', 'd', 'e', 'R', '\004',
-'n', 'o', 'd', 'e', '\022', 'D', '\n', '\n', 'x', 'd', 's', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\002', ' ', '\003', '(', '\013', '2',
-'%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3',
-'.', 'P', 'e', 'r', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', ':',
-'+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a',
-'t', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\212', '\001', '\n', '\024', 'C',
-'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '=', '\n', '\006', 'c', 'o',
-'n', 'f', 'i', 'g', '\030', '\001', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
-'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', 'R',
-'\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r',
-'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't',
-'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '*', 'K', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u',
-'s', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'S', 'Y', 'N', 'C', 'E', 'D', '\020',
-'\001', '\022', '\014', '\n', '\010', 'N', 'O', 'T', '_', 'S', 'E', 'N', 'T', '\020', '\002', '\022', '\t', '\n', '\005', 'S', 'T', 'A', 'L', 'E', '\020',
-'\003', '\022', '\t', '\n', '\005', 'E', 'R', 'R', 'O', 'R', '\020', '\004', '*', 'c', '\n', '\022', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n',
-'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\016', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'U', 'N', 'K', 'N', 'O',
-'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', 'E', 'D', '\020',
-'\001', '\022', '\020', '\n', '\014', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'A', 'C', 'K', 'E', 'D', '\020', '\002', '\022', '\021', '\n', '\r', 'C', 'L',
-'I', 'E', 'N', 'T', '_', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\003', '2', '\270', '\002', '\n', '\034', 'C', 'l', 'i', 'e', 'n', 't', 'S',
-'t', 'a', 't', 'u', 's', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'w', '\n', '\022',
-'S', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o',
-'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n',
-'t', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\236', '\001', '\n', '\021', 'F', 'e', 't',
-'c', 'h', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
-'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
-'t', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c',
-'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R',
-'e', 's', 'p', 'o', 'n', 's', 'e', '\"', ',', '\202', '\323', '\344', '\223', '\002', '\035', '\"', '\033', '/', 'v', '3', '/', 'd', 'i', 's', 'c',
-'o', 'v', 'e', 'r', 'y', ':', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\202', '\323', '\344', '\223', '\002', '\003',
-':', '\001', '*', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
-'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', 'B', '\t', 'C', 's', 'd', 's',
-'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
+'n', 'f', 'i', 'g', '.', 'G', 'e', 'n', 'e', 'r', 'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 'R', '\021', 'g', 'e',
+'n', 'e', 'r', 'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', 's', '\032', '\342', '\003', '\n', '\020', 'G', 'e', 'n', 'e', 'r',
+'i', 'c', 'X', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u', 'r', 'l', '\030', '\001',
+' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '\022', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\001',
+'(', '\t', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '!', '\n', '\014', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 'i', 'n', 'f', 'o', '\030',
+'\003', ' ', '\001', '(', '\t', 'R', '\013', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'f', 'o', '\022', '3', '\n', '\n', 'x', 'd', 's',
+'_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\t', 'x', 'd', 's', 'C', 'o', 'n', 'f', 'i', 'g', '\022', '=', '\n', '\014',
+'l', 'a', 's', 't', '_', 'u', 'p', 'd', 'a', 't', 'e', 'd', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\013', 'l', 'a',
+'s', 't', 'U', 'p', 'd', 'a', 't', 'e', 'd', '\022', 'J', '\n', '\r', 'c', 'o', 'n', 'f', 'i', 'g', '_', 's', 't', 'a', 't', 'u',
+'s', '\030', '\006', ' ', '\001', '(', '\016', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's',
+'t', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'c', 'o',
+'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', 'I', '\n', '\r', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't',
+'u', 's', '\030', '\007', ' ', '\001', '(', '\016', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3',
+'.', 'C', 'l', 'i', 'e', 'n', 't', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'S', 't', 'a', 't', 'u', 's', 'R', '\014', 'c', 'l',
+'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', 'C', '\n', '\013', 'e', 'r', 'r', 'o', 'r', '_', 's', 't', 'a', 't', 'e',
+'\030', '\010', ' ', '\001', '(', '\013', '2', '\"', '.', 'e', 'n', 'v', 'o', 'y', '.', 'a', 'd', 'm', 'i', 'n', '.', 'v', '3', '.', 'U',
+'p', 'd', 'a', 't', 'e', 'F', 'a', 'i', 'l', 'u', 'r', 'e', 'S', 't', 'a', 't', 'e', 'R', '\n', 'e', 'r', 'r', 'o', 'r', 'S',
+'t', 'a', 't', 'e', '\022', ',', '\n', '\022', 'i', 's', '_', 's', 't', 'a', 't', 'i', 'c', '_', 'r', 'e', 's', 'o', 'u', 'r', 'c',
+'e', '\030', '\t', ' ', '\001', '(', '\010', 'R', '\020', 'i', 's', 'S', 't', 'a', 't', 'i', 'c', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+':', '+', '\232', '\305', '\210', '\036', '&', '\n', '$', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't',
+'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g', '\"', '\212', '\001', '\n', '\024',
+'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\022', '=', '\n', '\006', 'c',
+'o', 'n', 'f', 'i', 'g', '\030', '\001', ' ', '\003', '(', '\013', '2', '%', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
+'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o', 'n', 'f', 'i', 'g',
+'R', '\006', 'c', 'o', 'n', 'f', 'i', 'g', ':', '3', '\232', '\305', '\210', '\036', '.', '\n', ',', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e',
+'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '2', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a',
+'t', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '*', 'K', '\n', '\014', 'C', 'o', 'n', 'f', 'i', 'g', 'S', 't', 'a', 't',
+'u', 's', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'S', 'Y', 'N', 'C', 'E', 'D',
+'\020', '\001', '\022', '\014', '\n', '\010', 'N', 'O', 'T', '_', 'S', 'E', 'N', 'T', '\020', '\002', '\022', '\t', '\n', '\005', 'S', 'T', 'A', 'L', 'E',
+'\020', '\003', '\022', '\t', '\n', '\005', 'E', 'R', 'R', 'O', 'R', '\020', '\004', '*', 'c', '\n', '\022', 'C', 'l', 'i', 'e', 'n', 't', 'C', 'o',
+'n', 'f', 'i', 'g', 'S', 't', 'a', 't', 'u', 's', '\022', '\022', '\n', '\016', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'U', 'N', 'K', 'N',
+'O', 'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'R', 'E', 'Q', 'U', 'E', 'S', 'T', 'E', 'D',
+'\020', '\001', '\022', '\020', '\n', '\014', 'C', 'L', 'I', 'E', 'N', 'T', '_', 'A', 'C', 'K', 'E', 'D', '\020', '\002', '\022', '\021', '\n', '\r', 'C',
+'L', 'I', 'E', 'N', 'T', '_', 'N', 'A', 'C', 'K', 'E', 'D', '\020', '\003', '2', '\270', '\002', '\n', '\034', 'C', 'l', 'i', 'e', 'n', 't',
+'S', 't', 'a', 't', 'u', 's', 'D', 'i', 's', 'c', 'o', 'v', 'e', 'r', 'y', 'S', 'e', 'r', 'v', 'i', 'c', 'e', '\022', 'w', '\n',
+'\022', 'S', 't', 'r', 'e', 'a', 'm', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v',
+'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e',
+'n', 't', 'S', 't', 'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't',
+'a', 't', 'u', 's', 'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', '\000', '(', '\001', '0', '\001', '\022', '\236', '\001', '\n', '\021', 'F', 'e',
+'t', 'c', 'h', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's', '\022', ',', '.', 'e', 'n', 'v', 'o', 'y', '.', 's',
+'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't',
+'a', 't', 'u', 's', 'R', 'e', 'q', 'u', 'e', 's', 't', '\032', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 's', 'e', 'r', 'v', 'i',
+'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', '.', 'C', 'l', 'i', 'e', 'n', 't', 'S', 't', 'a', 't', 'u', 's',
+'R', 'e', 's', 'p', 'o', 'n', 's', 'e', '\"', ',', '\202', '\323', '\344', '\223', '\002', '\035', '\"', '\033', '/', 'v', '3', '/', 'd', 'i', 's',
+'c', 'o', 'v', 'e', 'r', 'y', ':', 'c', 'l', 'i', 'e', 'n', 't', '_', 's', 't', 'a', 't', 'u', 's', '\202', '\323', '\344', '\223', '\002',
+'\003', ':', '\001', '*', 'B', '?', '\n', '%', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v',
+'o', 'y', '.', 's', 'e', 'r', 'v', 'i', 'c', 'e', '.', 's', 't', 'a', 't', 'u', 's', '.', 'v', '3', 'B', '\t', 'C', 's', 'd',
+'s', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\210', '\001', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't',
+'o', '3',
};
-static upb_def_init *deps[8] = {
+static upb_def_init *deps[10] = {
&envoy_admin_v3_config_dump_proto_upbdefinit,
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_type_matcher_v3_node_proto_upbdefinit,
&google_api_annotations_proto_upbdefinit,
- &udpa_annotations_migrate_proto_upbdefinit,
+ &google_protobuf_any_proto_upbdefinit,
+ &google_protobuf_timestamp_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
NULL
@@ -124,7 +144,7 @@ static upb_def_init *deps[8] = {
upb_def_init envoy_service_status_v3_csds_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_service_status_v3_csds_proto_upb_file_layout,
"envoy/service/status/v3/csds.proto",
- UPB_STRVIEW_INIT(descriptor, 2001)
+ UPB_STRVIEW_INIT(descriptor, 2677)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
index 91723cc10ae..7b034cad345 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.h
@@ -36,6 +36,11 @@ UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientConfig_getmsgdef(upb_
return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientConfig");
}
+UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientConfig_GenericXdsConfig_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientConfig.GenericXdsConfig");
+}
+
UPB_INLINE const upb_msgdef *envoy_service_status_v3_ClientStatusResponse_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_service_status_v3_csds_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.service.status.v3.ClientStatusResponse");
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
new file mode 100644
index 00000000000..dce0ce798dd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c
@@ -0,0 +1,53 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "envoy/type/http/v3/path_transformation.upbdefs.h"
+#include "envoy/type/http/v3/path_transformation.upb.h"
+
+extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init validate_validate_proto_upbdefinit;
+static const char descriptor[618] = {'\n', ',', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'h', 't', 't', 'p', '/', 'v', '3', '/', 'p', 'a', 't', 'h',
+'_', 't', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'e', 'n',
+'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\236', '\003',
+'\n', '\022', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '\022', 'P', '\n', '\n', 'o',
+'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '0', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm',
+'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o',
+'n', 's', '\032', '\265', '\002', '\n', '\t', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '\022', '~', '\n', '\027', 'n', 'o', 'r', 'm', 'a',
+'l', 'i', 'z', 'e', '_', 'p', 'a', 't', 'h', '_', 'r', 'f', 'c', '_', '3', '9', '8', '6', '\030', '\002', ' ', '\001', '(', '\013', '2',
+'E', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h',
+'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '.',
+'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'F', 'C', '3', '9', '8', '6', 'H', '\000', 'R', '\024', 'n',
+'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'f', 'c', '3', '9', '8', '6', '\022', 'd', '\n', '\r', 'm', 'e',
+'r', 'g', 'e', '_', 's', 'l', 'a', 's', 'h', 'e', 's', '\030', '\003', ' ', '\001', '(', '\013', '2', '=', '.', 'e', 'n', 'v', 'o', 'y',
+'.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3', '.', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o',
+'r', 'm', 'a', 't', 'i', 'o', 'n', '.', 'O', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '.', 'M', 'e', 'r', 'g', 'e', 'S', 'l',
+'a', 's', 'h', 'e', 's', 'H', '\000', 'R', '\014', 'm', 'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', '\032', '\026', '\n', '\024',
+'N', 'o', 'r', 'm', 'a', 'l', 'i', 'z', 'e', 'P', 'a', 't', 'h', 'R', 'F', 'C', '3', '9', '8', '6', '\032', '\016', '\n', '\014', 'M',
+'e', 'r', 'g', 'e', 'S', 'l', 'a', 's', 'h', 'e', 's', 'B', '\032', '\n', '\023', 'o', 'p', 'e', 'r', 'a', 't', 'i', 'o', 'n', '_',
+'s', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', 'E', '\n', ' ', 'i', 'o', '.', 'e', 'n', 'v', 'o',
+'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'h', 't', 't', 'p', '.', 'v', '3',
+'B', '\027', 'P', 'a', 't', 'h', 'T', 'r', 'a', 'n', 's', 'f', 'o', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'P', 'r', 'o', 't', 'o',
+'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[3] = {
+ &udpa_annotations_status_proto_upbdefinit,
+ &validate_validate_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init envoy_type_http_v3_path_transformation_proto_upbdefinit = {
+ deps,
+ &envoy_type_http_v3_path_transformation_proto_upb_file_layout,
+ "envoy/type/http/v3/path_transformation.proto",
+ UPB_STRVIEW_INIT(descriptor, 618)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h
new file mode 100644
index 00000000000..10990efcedf
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * envoy/type/http/v3/path_transformation.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_
+#define ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init envoy_type_http_v3_path_transformation_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *envoy_type_http_v3_PathTransformation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.type.http.v3.PathTransformation");
+}
+
+UPB_INLINE const upb_msgdef *envoy_type_http_v3_PathTransformation_Operation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.type.http.v3.PathTransformation.Operation");
+}
+
+UPB_INLINE const upb_msgdef *envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.type.http.v3.PathTransformation.Operation.NormalizePathRFC3986");
+}
+
+UPB_INLINE const upb_msgdef *envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &envoy_type_http_v3_path_transformation_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "envoy.type.http.v3.PathTransformation.Operation.MergeSlashes");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* ENVOY_TYPE_HTTP_V3_PATH_TRANSFORMATION_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
index f4afda70f59..8fbb4b9a022 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c
@@ -8,27 +8,20 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/metadata.upbdefs.h"
+#include "envoy/type/matcher/v3/metadata.upb.h"
extern upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_MetadataMatcher_msginit,
- &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit,
-};
-
-static const char descriptor[621] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm',
+static const char descriptor[645] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'm',
'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm',
'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v', 'a', 'l', 'u', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd',
'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o',
't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's',
'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a',
-'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\347', '\002', '\n', '\017', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
+'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\377', '\002', '\n', '\017', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a',
'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', '\037', '\n', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007',
'\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\006', 'f', 'i', 'l', 't', 'e', 'r', '\022', 'P', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\002',
' ', '\003', '(', '\013', '2', '2', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r',
@@ -36,16 +29,17 @@ static const char descriptor[621] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't
'e', 'g', 'm', 'e', 'n', 't', 'B', '\010', '\372', 'B', '\005', '\222', '\001', '\002', '\010', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', 'C', '\n',
'\005', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'V', 'a', 'l', 'u', 'e', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\032', 'q', '\n', '\013', 'P', 'a', 't', 'h', 'S',
-'e', 'g', 'm', 'e', 'n', 't', '\022', '\033', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r',
-'\002', '\020', '\001', 'H', '\000', 'R', '\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.',
-'t', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c',
-'h', 'e', 'r', '.', 'P', 'a', 't', 'h', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'B', '\016', '\n', '\007', 's', 'e', 'g', 'm', 'e', 'n',
-'t', '\022', '\003', '\370', 'B', '\001', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'>', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'P', 'r',
-'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\005', 'v', 'a', 'l', 'u', 'e', '\022', '\026', '\n', '\006', 'i', 'n', 'v', 'e', 'r',
+'t', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\006', 'i', 'n', 'v', 'e', 'r', 't', '\032', 'q', '\n', '\013', 'P', 'a', 't', 'h', 'S', 'e',
+'g', 'm', 'e', 'n', 't', '\022', '\033', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002',
+'\020', '\001', 'H', '\000', 'R', '\003', 'k', 'e', 'y', ':', '5', '\232', '\305', '\210', '\036', '0', '\n', '.', 'e', 'n', 'v', 'o', 'y', '.', 't',
+'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h',
+'e', 'r', '.', 'P', 'a', 't', 'h', 'S', 'e', 'g', 'm', 'e', 'n', 't', 'B', '\016', '\n', '\007', 's', 'e', 'g', 'm', 'e', 'n', 't',
+'\022', '\003', '\370', 'B', '\001', ':', ')', '\232', '\305', '\210', '\036', '$', '\n', '\"', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '>',
+'\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
+'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\r', 'M', 'e', 't', 'a', 'd', 'a', 't', 'a', 'P', 'r', 'o',
+'t', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[5] = {
@@ -58,7 +52,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_metadata_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_metadata_proto_upb_file_layout,
"envoy/type/matcher/v3/metadata.proto",
- UPB_STRVIEW_INIT(descriptor, 621)
+ UPB_STRVIEW_INIT(descriptor, 645)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
index 8b0ecb58151..91764f0f902 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/node.upbdefs.h"
+#include "envoy/type/matcher/v3/node.upb.h"
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_struct_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_NodeMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_NodeMatcher_msginit,
-};
-
static const char descriptor[458] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
'o', 'd', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
@@ -50,7 +45,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_node_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_node_proto_upb_file_layout,
"envoy/type/matcher/v3/node.proto",
UPB_STRVIEW_INIT(descriptor, 458)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
index a7f8fda0087..42e5c9311de 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/number.upbdefs.h"
+#include "envoy/type/matcher/v3/number.upb.h"
extern upb_def_init envoy_type_v3_range_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_DoubleMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_DoubleMatcher_msginit,
-};
-
static const char descriptor[404] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'n',
'u', 'm', 'b', 'e', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/',
@@ -48,7 +43,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_number_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_number_proto_upb_file_layout,
"envoy/type/matcher/v3/number.proto",
UPB_STRVIEW_INIT(descriptor, 404)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
index f003b0464a3..98d689b842e 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/path.upbdefs.c
@@ -8,17 +8,12 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/path.upbdefs.h"
+#include "envoy/type/matcher/v3/path.upb.h"
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_matcher_v3_PathMatcher_msginit,
-};
-
static const char descriptor[390] = {'\n', ' ', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'p',
'a', 't', 'h', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h',
@@ -47,7 +42,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_path_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_path_proto_upb_file_layout,
"envoy/type/matcher/v3/path.proto",
UPB_STRVIEW_INIT(descriptor, 390)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
index 8805d24c6f0..3d7fe375788 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/regex.upbdefs.c
@@ -8,57 +8,51 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/regex.upbdefs.h"
+#include "envoy/type/matcher/v3/regex.upb.h"
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
+extern upb_def_init envoy_annotations_deprecation_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_matcher_v3_RegexMatcher_msginit,
- &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit,
- &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit,
-};
-
-static const char descriptor[776] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r',
+static const char descriptor[822] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'r',
'e', 'g', 'e', 'x', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n',
-'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd',
-'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g',
-'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'.', 'p', 'r', 'o', 't', 'o', '\"', '\317', '\002', '\n', '\014', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'X',
-'\n', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '_', 'r', 'e', '2', '\030', '\001', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o',
-'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a',
-'t', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001',
-'H', '\000', 'R', '\t', 'g', 'o', 'o', 'g', 'l', 'e', 'R', 'e', '2', '\022', '\035', '\n', '\005', 'r', 'e', 'g', 'e', 'x', '\030', '\002', ' ',
-'\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\005', 'r', 'e', 'g', 'e', 'x', '\032', '\211', '\001', '\n', '\t', 'G',
-'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', '\022', 'J', '\n', '\020', 'm', 'a', 'x', '_', 'p', 'r', 'o', 'g', 'r', 'a', 'm', '_', 's',
-'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u', 'e', 'B', '\002', '\030', '\001', 'R', '\016', 'm', 'a', 'x', 'P', 'r',
-'o', 'g', 'r', 'a', 'm', 'S', 'i', 'z', 'e', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 't',
-'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.',
-'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 't',
-'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B',
-'\022', '\n', '\013', 'e', 'n', 'g', 'i', 'n', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\271', '\001', '\n', '\027', 'R',
-'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', '\022', 'G', '\n',
-'\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
-'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e',
-'r', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\"', '\n', '\014', 's',
-'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 's', 't', 'i',
-'t', 'u', 't', 'i', 'o', 'n', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
-'.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b',
-'s', 't', 'i', 't', 'u', 't', 'e', 'B', ';', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.',
-'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'R', 'e',
-'g', 'e', 'x', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
+'/', 'w', 'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o',
+'t', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
+'s', '/', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
+'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\330', '\002', '\n', '\014', 'R', 'e',
+'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '\022', 'X', '\n', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '_', 'r', 'e', '2', '\030',
+'\001', ' ', '\001', '(', '\013', '2', '-', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e',
+'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g', 'l', 'e', 'R',
+'E', '2', 'B', '\010', '\372', 'B', '\005', '\212', '\001', '\002', '\020', '\001', 'H', '\000', 'R', '\t', 'g', 'o', 'o', 'g', 'l', 'e', 'R', 'e', '2',
+'\022', '\035', '\n', '\005', 'r', 'e', 'g', 'e', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R',
+'\005', 'r', 'e', 'g', 'e', 'x', '\032', '\222', '\001', '\n', '\t', 'G', 'o', 'o', 'g', 'l', 'e', 'R', 'E', '2', '\022', 'S', '\n', '\020', 'm',
+'a', 'x', '_', 'p', 'r', 'o', 'g', 'r', 'a', 'm', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '3', '2', 'V', 'a', 'l', 'u',
+'e', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\016', 'm', 'a', 'x', 'P', 'r', 'o', 'g', 'r', 'a',
+'m', 'S', 'i', 'z', 'e', ':', '0', '\232', '\305', '\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', '.', 'G', 'o', 'o', 'g',
+'l', 'e', 'R', 'E', '2', ':', '&', '\232', '\305', '\210', '\036', '!', '\n', '\037', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.',
+'m', 'a', 't', 'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\022', '\n', '\013', 'e',
+'n', 'g', 'i', 'n', 'e', '_', 't', 'y', 'p', 'e', '\022', '\003', '\370', 'B', '\001', '\"', '\271', '\001', '\n', '\027', 'R', 'e', 'g', 'e', 'x',
+'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'e', '\022', 'G', '\n', '\007', 'p', 'a', 't',
+'t', 'e', 'r', 'n', '\030', '\001', ' ', '\001', '(', '\013', '2', '#', '.', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
+'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'e', 'r', 'B', '\010', '\372',
+'B', '\005', '\212', '\001', '\002', '\020', '\001', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\"', '\n', '\014', 's', 'u', 'b', 's', 't',
+'i', 't', 'u', 't', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\014', 's', 'u', 'b', 's', 't', 'i', 't', 'u', 't', 'i',
+'o', 'n', ':', '1', '\232', '\305', '\210', '\036', ',', '\n', '*', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't',
+'c', 'h', 'e', 'r', '.', 'R', 'e', 'g', 'e', 'x', 'M', 'a', 't', 'c', 'h', 'A', 'n', 'd', 'S', 'u', 'b', 's', 't', 'i', 't',
+'u', 't', 'e', 'B', ';', '\n', '#', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o',
+'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', 'B', '\n', 'R', 'e', 'g', 'e', 'x', 'P',
+'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static upb_def_init *deps[6] = {
&google_protobuf_wrappers_proto_upbdefinit,
+ &envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
@@ -67,7 +61,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_regex_proto_upb_file_layout,
"envoy/type/matcher/v3/regex.proto",
- UPB_STRVIEW_INIT(descriptor, 776)
+ UPB_STRVIEW_INIT(descriptor, 822)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
index 4844b106143..dc86efdfbb3 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/string.upbdefs.c
@@ -8,19 +8,12 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/string.upbdefs.h"
+#include "envoy/type/matcher/v3/string.upb.h"
extern upb_def_init envoy_type_matcher_v3_regex_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_StringMatcher_msginit,
- &envoy_type_matcher_v3_ListStringMatcher_msginit,
-};
-
static const char descriptor[738] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
't', 'r', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't',
@@ -63,7 +56,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_string_proto_upb_file_layout,
"envoy/type/matcher/v3/string.proto",
UPB_STRVIEW_INIT(descriptor, 738)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
index 6660ffad3a1..fe07a39afcf 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/struct.upbdefs.c
@@ -8,19 +8,12 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/struct.upbdefs.h"
+#include "envoy/type/matcher/v3/struct.upb.h"
extern upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_matcher_v3_StructMatcher_msginit,
- &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit,
-};
-
static const char descriptor[576] = {'\n', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 's',
't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm',
'a', 't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't',
@@ -57,7 +50,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_matcher_v3_struct_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_struct_proto_upb_file_layout,
"envoy/type/matcher/v3/struct.proto",
UPB_STRVIEW_INIT(descriptor, 576)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
index ae8789941ef..b0488172c8e 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/matcher/v3/value.upbdefs.c
@@ -8,22 +8,13 @@
#include "upb/def.h"
#include "envoy/type/matcher/v3/value.upbdefs.h"
+#include "envoy/type/matcher/v3/value.upb.h"
extern upb_def_init envoy_type_matcher_v3_number_proto_upbdefinit;
extern upb_def_init envoy_type_matcher_v3_string_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit;
-extern const upb_msglayout envoy_type_matcher_v3_ListMatcher_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_matcher_v3_ValueMatcher_msginit,
- &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit,
- &envoy_type_matcher_v3_ListMatcher_msginit,
-};
-
static const char descriptor[942] = {'\n', '!', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c', 'h', 'e', 'r', '/', 'v', '3', '/', 'v',
'a', 'l', 'u', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'm', 'a',
't', 'c', 'h', 'e', 'r', '.', 'v', '3', '\032', '\"', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'a', 't', 'c',
@@ -75,7 +66,7 @@ static upb_def_init *deps[6] = {
upb_def_init envoy_type_matcher_v3_value_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_matcher_v3_value_proto_upb_file_layout,
"envoy/type/matcher/v3/value.proto",
UPB_STRVIEW_INIT(descriptor, 942)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
index 9b08fcaf746..18578d9e52a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/metadata/v3/metadata.upbdefs.c
@@ -8,28 +8,11 @@
#include "upb/def.h"
#include "envoy/type/metadata/v3/metadata.upbdefs.h"
+#include "envoy/type/metadata/v3/metadata.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKey_PathSegment_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Request_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Route_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Cluster_msginit;
-extern const upb_msglayout envoy_type_metadata_v3_MetadataKind_Host_msginit;
-
-static const upb_msglayout *layouts[7] = {
- &envoy_type_metadata_v3_MetadataKey_msginit,
- &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit,
- &envoy_type_metadata_v3_MetadataKind_msginit,
- &envoy_type_metadata_v3_MetadataKind_Request_msginit,
- &envoy_type_metadata_v3_MetadataKind_Route_msginit,
- &envoy_type_metadata_v3_MetadataKind_Cluster_msginit,
- &envoy_type_metadata_v3_MetadataKind_Host_msginit,
-};
-
static const char descriptor[1104] = {'\n', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '/', 'v', '3', '/',
'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'p', 'r', 'o', 't', 'o', '\022', '\026', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p',
'e', '.', 'm', 'e', 't', 'a', 'd', 'a', 't', 'a', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't',
@@ -86,7 +69,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_metadata_v3_metadata_proto_upb_file_layout,
"envoy/type/metadata/v3/metadata.proto",
UPB_STRVIEW_INIT(descriptor, 1104)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
index 27c5118a35b..093565c8451 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/tracing/v3/custom_tag.upbdefs.c
@@ -8,25 +8,12 @@
#include "upb/def.h"
#include "envoy/type/tracing/v3/custom_tag.upbdefs.h"
+#include "envoy/type/tracing/v3/custom_tag.upb.h"
extern upb_def_init envoy_type_metadata_v3_metadata_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Literal_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Environment_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Header_msginit;
-extern const upb_msglayout envoy_type_tracing_v3_CustomTag_Metadata_msginit;
-
-static const upb_msglayout *layouts[5] = {
- &envoy_type_tracing_v3_CustomTag_msginit,
- &envoy_type_tracing_v3_CustomTag_Literal_msginit,
- &envoy_type_tracing_v3_CustomTag_Environment_msginit,
- &envoy_type_tracing_v3_CustomTag_Header_msginit,
- &envoy_type_tracing_v3_CustomTag_Metadata_msginit,
-};
-
static const char descriptor[1249] = {'\n', '&', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 't', 'r', 'a', 'c', 'i', 'n', 'g', '/', 'v', '3', '/', 'c',
'u', 's', 't', 'o', 'm', '_', 't', 'a', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\025', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y',
'p', 'e', '.', 't', 'r', 'a', 'c', 'i', 'n', 'g', '.', 'v', '3', '\032', '%', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e',
@@ -89,7 +76,7 @@ static upb_def_init *deps[5] = {
upb_def_init envoy_type_tracing_v3_custom_tag_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_tracing_v3_custom_tag_proto_upb_file_layout,
"envoy/type/tracing/v3/custom_tag.proto",
UPB_STRVIEW_INIT(descriptor, 1249)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
index 4dd38687ad4..5d0ca321abf 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/http.upbdefs.c
@@ -8,9 +8,9 @@
#include "upb/def.h"
#include "envoy/type/v3/http.upbdefs.h"
+#include "envoy/type/v3/http.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-
static const char descriptor[184] = {'\n', '\030', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't',
'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n',
'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '*', '2', '\n',
@@ -28,7 +28,7 @@ static upb_def_init *deps[2] = {
upb_def_init envoy_type_v3_http_proto_upbdefinit = {
deps,
- NULL,
+ &envoy_type_v3_http_proto_upb_file_layout,
"envoy/type/v3/http.proto",
UPB_STRVIEW_INIT(descriptor, 184)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
index d15de820957..2f3114641e5 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/percent.upbdefs.c
@@ -8,18 +8,11 @@
#include "upb/def.h"
#include "envoy/type/v3/percent.upbdefs.h"
+#include "envoy/type/v3/percent.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout envoy_type_v3_Percent_msginit;
-extern const upb_msglayout envoy_type_v3_FractionalPercent_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &envoy_type_v3_Percent_msginit,
- &envoy_type_v3_FractionalPercent_msginit,
-};
-
static const char descriptor[529] = {'\n', '\033', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'p', 'e', 'r', 'c', 'e', 'n', 't', '.', 'p',
'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a',
'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
@@ -53,7 +46,7 @@ static upb_def_init *deps[4] = {
upb_def_init envoy_type_v3_percent_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_percent_proto_upb_file_layout,
"envoy/type/v3/percent.proto",
UPB_STRVIEW_INIT(descriptor, 529)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
index 5a4db5c4029..3813599317a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/range.upbdefs.c
@@ -8,19 +8,10 @@
#include "upb/def.h"
#include "envoy/type/v3/range.upbdefs.h"
+#include "envoy/type/v3/range.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_type_v3_Int64Range_msginit;
-extern const upb_msglayout envoy_type_v3_Int32Range_msginit;
-extern const upb_msglayout envoy_type_v3_DoubleRange_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &envoy_type_v3_Int64Range_msginit,
- &envoy_type_v3_Int32Range_msginit,
- &envoy_type_v3_DoubleRange_msginit,
-};
-
static const char descriptor[423] = {'\n', '\031', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 'r', 'a', 'n', 'g', 'e', '.', 'p', 'r', 'o',
't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '!',
@@ -48,7 +39,7 @@ static upb_def_init *deps[3] = {
upb_def_init envoy_type_v3_range_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_range_proto_upb_file_layout,
"envoy/type/v3/range.proto",
UPB_STRVIEW_INIT(descriptor, 423)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
index f97b1b4ff54..798e345ee90 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/envoy/type/v3/semantic_version.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "envoy/type/v3/semantic_version.upbdefs.h"
+#include "envoy/type/v3/semantic_version.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
-extern const upb_msglayout envoy_type_v3_SemanticVersion_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &envoy_type_v3_SemanticVersion_msginit,
-};
-
static const char descriptor[337] = {'\n', '$', 'e', 'n', 'v', 'o', 'y', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 's', 'e', 'm', 'a', 'n', 't', 'i', 'c', '_',
'v', 'e', 'r', 's', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\r', 'e', 'n', 'v', 'o', 'y', '.', 't', 'y', 'p', 'e',
'.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a',
@@ -41,7 +36,7 @@ static upb_def_init *deps[3] = {
upb_def_init envoy_type_v3_semantic_version_proto_upbdefinit = {
deps,
- layouts,
+ &envoy_type_v3_semantic_version_proto_upb_file_layout,
"envoy/type/v3/semantic_version.proto",
UPB_STRVIEW_INIT(descriptor, 337)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
index f1b69216546..76665af3a21 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/annotations.upbdefs.c
@@ -8,10 +8,10 @@
#include "upb/def.h"
#include "google/api/annotations.upbdefs.h"
+#include "google/api/annotations.upb.h"
extern upb_def_init google_api_http_proto_upbdefinit;
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
static const char descriptor[296] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.',
'p', 'r', 'o', 't', 'o', '\022', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '\032', '\025', 'g', 'o', 'o', 'g', 'l', 'e',
'/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p',
@@ -34,7 +34,7 @@ static upb_def_init *deps[3] = {
upb_def_init google_api_annotations_proto_upbdefinit = {
deps,
- NULL,
+ &google_api_annotations_proto_upb_file_layout,
"google/api/annotations.proto",
UPB_STRVIEW_INIT(descriptor, 296)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
index 232fd18de88..700f36ae95f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/api/http.upbdefs.c
@@ -8,16 +8,7 @@
#include "upb/def.h"
#include "google/api/http.upbdefs.h"
-
-extern const upb_msglayout google_api_Http_msginit;
-extern const upb_msglayout google_api_HttpRule_msginit;
-extern const upb_msglayout google_api_CustomHttpPattern_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &google_api_Http_msginit,
- &google_api_HttpRule_msginit,
- &google_api_CustomHttpPattern_msginit,
-};
+#include "google/api/http.upb.h"
static const char descriptor[684] = {'\n', '\025', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'a', 'p', 'i', '/', 'h', 't', 't', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\n',
'g', 'o', 'o', 'g', 'l', 'e', '.', 'a', 'p', 'i', '\"', 'y', '\n', '\004', 'H', 't', 't', 'p', '\022', '*', '\n', '\005', 'r', 'u', 'l',
@@ -55,7 +46,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_api_http_proto_upbdefinit = {
deps,
- layouts,
+ &google_api_http_proto_upb_file_layout,
"google/api/http.proto",
UPB_STRVIEW_INIT(descriptor, 684)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
index 7db348329ac..5294f29ba6d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/any.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Any_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Any_msginit,
-};
+#include "google/protobuf/any.upb.h"
static const char descriptor[228] = {'\n', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o',
't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '6', '\n', '\003', 'A', 'n',
@@ -33,7 +28,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_any_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_any_proto_upb_file_layout,
"google/protobuf/any.proto",
UPB_STRVIEW_INIT(descriptor, 228)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
index 9026d56d621..e76d25ecd5f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c
@@ -8,66 +8,9 @@
#include "upb/def.h"
#include "google/protobuf/descriptor.upbdefs.h"
+#include "google/protobuf/descriptor.upb.h"
-extern const upb_msglayout google_protobuf_FileDescriptorSet_msginit;
-extern const upb_msglayout google_protobuf_FileDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ExtensionRange_msginit;
-extern const upb_msglayout google_protobuf_DescriptorProto_ReservedRange_msginit;
-extern const upb_msglayout google_protobuf_ExtensionRangeOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_OneofDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit;
-extern const upb_msglayout google_protobuf_EnumValueDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_ServiceDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_MethodDescriptorProto_msginit;
-extern const upb_msglayout google_protobuf_FileOptions_msginit;
-extern const upb_msglayout google_protobuf_MessageOptions_msginit;
-extern const upb_msglayout google_protobuf_FieldOptions_msginit;
-extern const upb_msglayout google_protobuf_OneofOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumOptions_msginit;
-extern const upb_msglayout google_protobuf_EnumValueOptions_msginit;
-extern const upb_msglayout google_protobuf_ServiceOptions_msginit;
-extern const upb_msglayout google_protobuf_MethodOptions_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_msginit;
-extern const upb_msglayout google_protobuf_UninterpretedOption_NamePart_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_SourceCodeInfo_Location_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_msginit;
-extern const upb_msglayout google_protobuf_GeneratedCodeInfo_Annotation_msginit;
-
-static const upb_msglayout *layouts[27] = {
- &google_protobuf_FileDescriptorSet_msginit,
- &google_protobuf_FileDescriptorProto_msginit,
- &google_protobuf_DescriptorProto_msginit,
- &google_protobuf_DescriptorProto_ExtensionRange_msginit,
- &google_protobuf_DescriptorProto_ReservedRange_msginit,
- &google_protobuf_ExtensionRangeOptions_msginit,
- &google_protobuf_FieldDescriptorProto_msginit,
- &google_protobuf_OneofDescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_msginit,
- &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit,
- &google_protobuf_EnumValueDescriptorProto_msginit,
- &google_protobuf_ServiceDescriptorProto_msginit,
- &google_protobuf_MethodDescriptorProto_msginit,
- &google_protobuf_FileOptions_msginit,
- &google_protobuf_MessageOptions_msginit,
- &google_protobuf_FieldOptions_msginit,
- &google_protobuf_OneofOptions_msginit,
- &google_protobuf_EnumOptions_msginit,
- &google_protobuf_EnumValueOptions_msginit,
- &google_protobuf_ServiceOptions_msginit,
- &google_protobuf_MethodOptions_msginit,
- &google_protobuf_UninterpretedOption_msginit,
- &google_protobuf_UninterpretedOption_NamePart_msginit,
- &google_protobuf_SourceCodeInfo_msginit,
- &google_protobuf_SourceCodeInfo_Location_msginit,
- &google_protobuf_GeneratedCodeInfo_msginit,
- &google_protobuf_GeneratedCodeInfo_Annotation_msginit,
-};
-
-static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
+static const char descriptor[7619] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
'f', '\"', 'M', '\n', '\021', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'S', 'e', 't', '\022', '8', '\n',
'\004', 'f', 'i', 'l', 'e', '\030', '\001', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
@@ -256,7 +199,7 @@ static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '
'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', ':', '\n', '\014', 'O', 'p', 't', 'i', 'm', 'i', 'z', 'e', 'M', 'o',
'd', 'e', '\022', '\t', '\n', '\005', 'S', 'P', 'E', 'E', 'D', '\020', '\001', '\022', '\r', '\n', '\t', 'C', 'O', 'D', 'E', '_', 'S', 'I', 'Z',
'E', '\020', '\002', '\022', '\020', '\n', '\014', 'L', 'I', 'T', 'E', '_', 'R', 'U', 'N', 'T', 'I', 'M', 'E', '\020', '\003', '*', '\t', '\010', '\350',
-'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\321', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e',
+'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '&', '\020', '\'', '\"', '\343', '\002', '\n', '\016', 'M', 'e', 's', 's', 'a', 'g', 'e',
'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '<', '\n', '\027', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 'e', 't', '_', 'w', 'i',
'r', 'e', '_', 'f', 'o', 'r', 'm', 'a', 't', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\024', 'm',
'e', 's', 's', 'a', 'g', 'e', 'S', 'e', 't', 'W', 'i', 'r', 'e', 'F', 'o', 'r', 'm', 'a', 't', '\022', 'L', '\n', '\037', 'n', 'o',
@@ -269,109 +212,109 @@ static const char descriptor[7601] = {'\n', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '
'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g',
'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O',
-'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010',
-'\t', '\020', '\n', '\"', '\342', '\003', '\n', '\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c',
-'t', 'y', 'p', 'e', '\030', '\001', ' ', '\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S',
-'T', 'R', 'I', 'N', 'G', 'R', '\005', 'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ',
-'\001', '(', '\010', 'R', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001',
-'(', '\016', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l',
-'d', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A',
-'L', 'R', '\006', 'j', 's', 't', 'y', 'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005',
-'f', 'a', 'l', 's', 'e', 'R', '\004', 'l', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd',
-'\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd',
-'\022', '\031', '\n', '\004', 'w', 'e', 'a', 'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e',
-'a', 'k', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o',
-'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n',
-'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p',
-'e', '\022', '\n', '\n', '\006', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020',
-'\n', '\014', 'S', 'T', 'R', 'I', 'N', 'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p',
-'e', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T',
-'R', 'I', 'N', 'G', '\020', '\001', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350',
-'\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't',
-'i', 'o', 'n', 's', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't',
-'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023',
-'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020',
-'\200', '\200', '\200', '\200', '\002', '\"', '\300', '\001', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013',
-'a', 'l', 'l', 'o', 'w', '_', 'a', 'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A',
-'l', 'i', 'a', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':',
-'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i',
-'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2',
-'$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r',
-'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
-'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006',
-'\"', '\236', '\001', '\n', '\020', 'E', 'n', 'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n',
-'d', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
+'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\004', '\020', '\005', 'J', '\004', '\010',
+'\005', '\020', '\006', 'J', '\004', '\010', '\006', '\020', '\007', 'J', '\004', '\010', '\010', '\020', '\t', 'J', '\004', '\010', '\t', '\020', '\n', '\"', '\342', '\003', '\n',
+'\014', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'A', '\n', '\005', 'c', 't', 'y', 'p', 'e', '\030', '\001', ' ',
+'\001', '(', '\016', '2', '#', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e',
+'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'C', 'T', 'y', 'p', 'e', ':', '\006', 'S', 'T', 'R', 'I', 'N', 'G', 'R', '\005',
+'c', 't', 'y', 'p', 'e', '\022', '\026', '\n', '\006', 'p', 'a', 'c', 'k', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\006', 'p', 'a',
+'c', 'k', 'e', 'd', '\022', 'G', '\n', '\006', 'j', 's', 't', 'y', 'p', 'e', '\030', '\006', ' ', '\001', '(', '\016', '2', '$', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '.', 'J', 'S', 'T', 'y', 'p', 'e', ':', '\t', 'J', 'S', '_', 'N', 'O', 'R', 'M', 'A', 'L', 'R', '\006', 'j', 's', 't', 'y',
+'p', 'e', '\022', '\031', '\n', '\004', 'l', 'a', 'z', 'y', '\030', '\005', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004',
+'l', 'a', 'z', 'y', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':',
+'\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', '\031', '\n', '\004', 'w', 'e', 'a',
+'k', '\030', '\n', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\004', 'w', 'e', 'a', 'k', '\022', 'X', '\n', '\024', 'u',
+'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(',
+'\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't',
+'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r',
+'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\"', '/', '\n', '\005', 'C', 'T', 'y', 'p', 'e', '\022', '\n', '\n', '\006', 'S', 'T',
+'R', 'I', 'N', 'G', '\020', '\000', '\022', '\010', '\n', '\004', 'C', 'O', 'R', 'D', '\020', '\001', '\022', '\020', '\n', '\014', 'S', 'T', 'R', 'I', 'N',
+'G', '_', 'P', 'I', 'E', 'C', 'E', '\020', '\002', '\"', '5', '\n', '\006', 'J', 'S', 'T', 'y', 'p', 'e', '\022', '\r', '\n', '\t', 'J', 'S',
+'_', 'N', 'O', 'R', 'M', 'A', 'L', '\020', '\000', '\022', '\r', '\n', '\t', 'J', 'S', '_', 'S', 'T', 'R', 'I', 'N', 'G', '\020', '\001', '\022',
+'\r', '\n', '\t', 'J', 'S', '_', 'N', 'U', 'M', 'B', 'E', 'R', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002',
+'J', '\004', '\010', '\004', '\020', '\005', '\"', 's', '\n', '\014', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', 'X', '\n',
+'\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ',
+'\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i',
+'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r',
+'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\300',
+'\001', '\n', '\013', 'E', 'n', 'u', 'm', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '\037', '\n', '\013', 'a', 'l', 'l', 'o', 'w', '_', 'a',
+'l', 'i', 'a', 's', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\n', 'a', 'l', 'l', 'o', 'w', 'A', 'l', 'i', 'a', 's', '\022', '%', '\n',
+'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '\003', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R',
+'\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
+'t', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O',
+'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o',
+'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', 'J', '\004', '\010', '\005', '\020', '\006', '\"', '\236', '\001', '\n', '\020', 'E', 'n',
+'u', 'm', 'V', 'a', 'l', 'u', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a',
+'t', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i',
+'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
+'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u',
+'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200',
+'\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%',
+'\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e',
+'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r',
+'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd',
+'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i',
+'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r', 'M', 'e', 't', 'h', 'o', 'd', 'O',
+'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(',
+'\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'q', '\n', '\021', 'i',
+'d', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"', ' ', '\001', '(', '\016', '2', '/', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't',
+'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', ':', '\023', 'I', 'D',
+'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R', '\020', 'i', 'd', 'e', 'm', 'p', 'o',
+'t', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't',
'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e',
'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p',
't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n',
-'*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\234', '\001', '\n', '\016', 'S', 'e', 'r', 'v', 'i', 'c', 'e', 'O', 'p',
-'t', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\030', '!', ' ', '\001', '(', '\010',
-':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'e', 'd', '\022', 'X', '\n', '\024', 'u', 'n',
-'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013',
-'2', '$', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e',
-'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e',
-'t', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\340', '\002', '\n', '\r',
-'M', 'e', 't', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\022', '%', '\n', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't',
-'e', 'd', '\030', '!', ' ', '\001', '(', '\010', ':', '\005', 'f', 'a', 'l', 's', 'e', 'R', '\n', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't',
-'e', 'd', '\022', 'q', '\n', '\021', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', '_', 'l', 'e', 'v', 'e', 'l', '\030', '\"',
-' ', '\001', '(', '\016', '2', '/', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e',
-'t', 'h', 'o', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '.', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e',
-'v', 'e', 'l', ':', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', 'R',
-'\020', 'i', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', 'X', '\n', '\024', 'u', 'n', 'i', 'n',
-'t', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', '_', 'o', 'p', 't', 'i', 'o', 'n', '\030', '\347', '\007', ' ', '\003', '(', '\013', '2', '$',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p',
-'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', 'R', '\023', 'u', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e',
-'d', 'O', 'p', 't', 'i', 'o', 'n', '\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v',
-'e', 'l', '\022', '\027', '\n', '\023', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N',
-'\020', '\000', '\022', '\023', '\n', '\017', 'N', 'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016',
-'\n', '\n', 'I', 'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002',
-'\"', '\232', '\003', '\n', '\023', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022',
-'A', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
-'o', 't', 'o', 'b', 'u', 'f', '.', 'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o',
-'n', '.', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't',
-'i', 'f', 'i', 'e', 'r', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i',
-'f', 'i', 'e', 'r', 'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't',
-'_', 'v', 'a', 'l', 'u', 'e', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't',
-'V', 'a', 'l', 'u', 'e', '\022', ',', '\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l',
-'u', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u',
-'e', '\022', '!', '\n', '\014', 'd', 'o', 'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013',
-'d', 'o', 'u', 'b', 'l', 'e', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l',
-'u', 'e', '\030', '\007', ' ', '\001', '(', '\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017',
-'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g',
-'g', 'r', 'e', 'g', 'a', 't', 'e', 'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022',
-'\033', '\n', '\t', 'n', 'a', 'm', 'e', '_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P',
-'a', 'r', 't', '\022', '!', '\n', '\014', 'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010',
-'R', '\013', 'i', 's', 'E', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C',
-'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013',
-'2', '(', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e',
-'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i',
-'o', 'n', '\032', '\316', '\001', '\n', '\010', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001',
-' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ',
-'\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_',
-'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o',
-'m', 'm', 'e', 'n', 't', 's', '\022', '+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n',
-'t', 's', '\030', '\004', ' ', '\001', '(', '\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't',
-'s', '\022', ':', '\n', '\031', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm',
-'m', 'e', 'n', 't', 's', '\030', '\006', ' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c',
-'h', 'e', 'd', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\"', '\321', '\001', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd',
-'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ',
-'\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n',
-'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'R', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\032', 'm', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
-'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h',
-'\022', '\037', '\n', '\013', 's', 'o', 'u', 'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o',
-'u', 'r', 'c', 'e', 'F', 'i', 'l', 'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005',
-'b', 'e', 'g', 'i', 'n', '\022', '\020', '\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~',
-'\n', '\023', 'c', 'o', 'm', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e',
-'s', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.',
-'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's',
-'/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032',
-'G', 'o', 'o', 'g', 'l', 'e', '.', 'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o',
-'n',
+'\"', 'P', '\n', '\020', 'I', 'd', 'e', 'm', 'p', 'o', 't', 'e', 'n', 'c', 'y', 'L', 'e', 'v', 'e', 'l', '\022', '\027', '\n', '\023', 'I',
+'D', 'E', 'M', 'P', 'O', 'T', 'E', 'N', 'C', 'Y', '_', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\023', '\n', '\017', 'N',
+'O', '_', 'S', 'I', 'D', 'E', '_', 'E', 'F', 'F', 'E', 'C', 'T', 'S', '\020', '\001', '\022', '\016', '\n', '\n', 'I', 'D', 'E', 'M', 'P',
+'O', 'T', 'E', 'N', 'T', '\020', '\002', '*', '\t', '\010', '\350', '\007', '\020', '\200', '\200', '\200', '\200', '\002', '\"', '\232', '\003', '\n', '\023', 'U', 'n',
+'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '\022', 'A', '\n', '\004', 'n', 'a', 'm', 'e',
+'\030', '\002', ' ', '\003', '(', '\013', '2', '-', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'U', 'n', 'i', 'n', 't', 'e', 'r', 'p', 'r', 'e', 't', 'e', 'd', 'O', 'p', 't', 'i', 'o', 'n', '.', 'N', 'a', 'm', 'e', 'P',
+'a', 'r', 't', 'R', '\004', 'n', 'a', 'm', 'e', '\022', ')', '\n', '\020', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', '_', 'v',
+'a', 'l', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'i', 'd', 'e', 'n', 't', 'i', 'f', 'i', 'e', 'r', 'V', 'a', 'l',
+'u', 'e', '\022', ',', '\n', '\022', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030',
+'\004', ' ', '\001', '(', '\004', 'R', '\020', 'p', 'o', 's', 'i', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', ',',
+'\n', '\022', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', '_', 'i', 'n', 't', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\005', ' ', '\001', '(',
+'\003', 'R', '\020', 'n', 'e', 'g', 'a', 't', 'i', 'v', 'e', 'I', 'n', 't', 'V', 'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 'd', 'o',
+'u', 'b', 'l', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\006', ' ', '\001', '(', '\001', 'R', '\013', 'd', 'o', 'u', 'b', 'l', 'e', 'V',
+'a', 'l', 'u', 'e', '\022', '!', '\n', '\014', 's', 't', 'r', 'i', 'n', 'g', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\007', ' ', '\001', '(',
+'\014', 'R', '\013', 's', 't', 'r', 'i', 'n', 'g', 'V', 'a', 'l', 'u', 'e', '\022', '\'', '\n', '\017', 'a', 'g', 'g', 'r', 'e', 'g', 'a',
+'t', 'e', '_', 'v', 'a', 'l', 'u', 'e', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\016', 'a', 'g', 'g', 'r', 'e', 'g', 'a', 't', 'e',
+'V', 'a', 'l', 'u', 'e', '\032', 'J', '\n', '\010', 'N', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '\033', '\n', '\t', 'n', 'a', 'm', 'e',
+'_', 'p', 'a', 'r', 't', '\030', '\001', ' ', '\002', '(', '\t', 'R', '\010', 'n', 'a', 'm', 'e', 'P', 'a', 'r', 't', '\022', '!', '\n', '\014',
+'i', 's', '_', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\002', '(', '\010', 'R', '\013', 'i', 's', 'E', 'x', 't',
+'e', 'n', 's', 'i', 'o', 'n', '\"', '\247', '\002', '\n', '\016', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f', 'o',
+'\022', 'D', '\n', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '(', '.', 'g', 'o', 'o', 'g',
+'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'S', 'o', 'u', 'r', 'c', 'e', 'C', 'o', 'd', 'e', 'I', 'n', 'f',
+'o', '.', 'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', 'R', '\010', 'l', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\032', '\316', '\001', '\n', '\010',
+'L', 'o', 'c', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a', 't', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020',
+'\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\026', '\n', '\004', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001',
+'R', '\004', 's', 'p', 'a', 'n', '\022', ')', '\n', '\020', 'l', 'e', 'a', 'd', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't',
+'s', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\017', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022',
+'+', '\n', '\021', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\004', ' ', '\001', '(',
+'\t', 'R', '\020', 't', 'r', 'a', 'i', 'l', 'i', 'n', 'g', 'C', 'o', 'm', 'm', 'e', 'n', 't', 's', '\022', ':', '\n', '\031', 'l', 'e',
+'a', 'd', 'i', 'n', 'g', '_', 'd', 'e', 't', 'a', 'c', 'h', 'e', 'd', '_', 'c', 'o', 'm', 'm', 'e', 'n', 't', 's', '\030', '\006',
+' ', '\003', '(', '\t', 'R', '\027', 'l', 'e', 'a', 'd', 'i', 'n', 'g', 'D', 'e', 't', 'a', 'c', 'h', 'e', 'd', 'C', 'o', 'm', 'm',
+'e', 'n', 't', 's', '\"', '\321', '\001', '\n', '\021', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C', 'o', 'd', 'e', 'I', 'n', 'f',
+'o', '\022', 'M', '\n', '\n', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\030', '\001', ' ', '\003', '(', '\013', '2', '-', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'G', 'e', 'n', 'e', 'r', 'a', 't', 'e', 'd', 'C',
+'o', 'd', 'e', 'I', 'n', 'f', 'o', '.', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'a', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', '\032', 'm', '\n', '\n', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '\026', '\n', '\004', 'p', 'a',
+'t', 'h', '\030', '\001', ' ', '\003', '(', '\005', 'B', '\002', '\020', '\001', 'R', '\004', 'p', 'a', 't', 'h', '\022', '\037', '\n', '\013', 's', 'o', 'u',
+'r', 'c', 'e', '_', 'f', 'i', 'l', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\n', 's', 'o', 'u', 'r', 'c', 'e', 'F', 'i', 'l',
+'e', '\022', '\024', '\n', '\005', 'b', 'e', 'g', 'i', 'n', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\005', 'b', 'e', 'g', 'i', 'n', '\022', '\020',
+'\n', '\003', 'e', 'n', 'd', '\030', '\004', ' ', '\001', '(', '\005', 'R', '\003', 'e', 'n', 'd', 'B', '~', '\n', '\023', 'c', 'o', 'm', '.', 'g',
+'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', 'B', '\020', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o',
+'r', 'P', 'r', 'o', 't', 'o', 's', 'H', '\001', 'Z', '-', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.',
+'o', 'r', 'g', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'y', 'p', 'e', 's', '/', 'd', 'e', 's', 'c', 'r', 'i',
+'p', 't', 'o', 'r', 'p', 'b', '\370', '\001', '\001', '\242', '\002', '\003', 'G', 'P', 'B', '\252', '\002', '\032', 'G', 'o', 'o', 'g', 'l', 'e', '.',
+'P', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'R', 'e', 'f', 'l', 'e', 'c', 't', 'i', 'o', 'n',
};
static upb_def_init *deps[1] = {
@@ -380,7 +323,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_descriptor_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_descriptor_proto_upb_file_layout,
"google/protobuf/descriptor.proto",
- UPB_STRVIEW_INIT(descriptor, 7601)
+ UPB_STRVIEW_INIT(descriptor, 7619)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
index 4cfdc7580ee..e7f55b90c0c 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/duration.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Duration_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Duration_msginit,
-};
+#include "google/protobuf/duration.upb.h"
static const char descriptor[251] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o',
'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"',
@@ -34,7 +29,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_duration_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_duration_proto_upb_file_layout,
"google/protobuf/duration.proto",
UPB_STRVIEW_INIT(descriptor, 251)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
index 8f974d9600f..f92dbcba8e1 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/empty.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Empty_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Empty_msginit,
-};
+#include "google/protobuf/empty.upb.h"
static const char descriptor[190] = {'\n', '\033', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'e', 'm', 'p', 't', 'y', '.', 'p',
'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\007', '\n', '\005',
@@ -31,7 +26,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_empty_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_empty_proto_upb_file_layout,
"google/protobuf/empty.proto",
UPB_STRVIEW_INIT(descriptor, 190)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
index 6f2f13c5501..1eff1387a2f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c
@@ -8,18 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/struct.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Struct_msginit;
-extern const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit;
-extern const upb_msglayout google_protobuf_Value_msginit;
-extern const upb_msglayout google_protobuf_ListValue_msginit;
-
-static const upb_msglayout *layouts[4] = {
- &google_protobuf_Struct_msginit,
- &google_protobuf_Struct_FieldsEntry_msginit,
- &google_protobuf_Value_msginit,
- &google_protobuf_ListValue_msginit,
-};
+#include "google/protobuf/struct.upb.h"
static const char descriptor[738] = {'\n', '\034', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.',
'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"', '\230', '\001',
@@ -59,7 +48,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_struct_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_struct_proto_upb_file_layout,
"google/protobuf/struct.proto",
UPB_STRVIEW_INIT(descriptor, 738)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
index bc2f7af6fb5..04999120d37 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c
@@ -8,12 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/timestamp.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_Timestamp_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_protobuf_Timestamp_msginit,
-};
+#include "google/protobuf/timestamp.upb.h"
static const char descriptor[255] = {'\n', '\037', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 't', 'i', 'm', 'e', 's', 't', 'a',
'm', 'p', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
@@ -34,7 +29,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_timestamp_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_timestamp_proto_upb_file_layout,
"google/protobuf/timestamp.proto",
UPB_STRVIEW_INIT(descriptor, 255)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
index 59a598ad0de..d0d115c0f34 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c
@@ -8,28 +8,7 @@
#include "upb/def.h"
#include "google/protobuf/wrappers.upbdefs.h"
-
-extern const upb_msglayout google_protobuf_DoubleValue_msginit;
-extern const upb_msglayout google_protobuf_FloatValue_msginit;
-extern const upb_msglayout google_protobuf_Int64Value_msginit;
-extern const upb_msglayout google_protobuf_UInt64Value_msginit;
-extern const upb_msglayout google_protobuf_Int32Value_msginit;
-extern const upb_msglayout google_protobuf_UInt32Value_msginit;
-extern const upb_msglayout google_protobuf_BoolValue_msginit;
-extern const upb_msglayout google_protobuf_StringValue_msginit;
-extern const upb_msglayout google_protobuf_BytesValue_msginit;
-
-static const upb_msglayout *layouts[9] = {
- &google_protobuf_DoubleValue_msginit,
- &google_protobuf_FloatValue_msginit,
- &google_protobuf_Int64Value_msginit,
- &google_protobuf_UInt64Value_msginit,
- &google_protobuf_Int32Value_msginit,
- &google_protobuf_UInt32Value_msginit,
- &google_protobuf_BoolValue_msginit,
- &google_protobuf_StringValue_msginit,
- &google_protobuf_BytesValue_msginit,
-};
+#include "google/protobuf/wrappers.upb.h"
static const char descriptor[518] = {'\n', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w', 'r', 'a', 'p', 'p', 'e', 'r',
's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\017', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '\"',
@@ -60,7 +39,7 @@ static upb_def_init *deps[1] = {
upb_def_init google_protobuf_wrappers_proto_upbdefinit = {
deps,
- layouts,
+ &google_protobuf_wrappers_proto_upb_file_layout,
"google/protobuf/wrappers.proto",
UPB_STRVIEW_INIT(descriptor, 518)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
index a4300a1eb45..917c1fba81d 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/google/rpc/status.upbdefs.c
@@ -8,25 +8,20 @@
#include "upb/def.h"
#include "google/rpc/status.upbdefs.h"
+#include "google/rpc/status.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern const upb_msglayout google_rpc_Status_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &google_rpc_Status_msginit,
-};
-
-static const char descriptor[272] = {'\n', '\027', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+static const char descriptor[275] = {'\n', '\027', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
'\022', '\n', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'r', 'p', 'c', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't',
'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\"', 'f', '\n', '\006', 'S', 't', 'a', 't', 'u', 's', '\022',
'\022', '\n', '\004', 'c', 'o', 'd', 'e', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\004', 'c', 'o', 'd', 'e', '\022', '\030', '\n', '\007', 'm', 'e',
's', 's', 'a', 'g', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'm', 'e', 's', 's', 'a', 'g', 'e', '\022', '.', '\n', '\007', 'd',
'e', 't', 'a', 'i', 'l', 's', '\030', '\003', ' ', '\003', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\007', 'd', 'e', 't', 'a', 'i', 'l', 's', 'B', '^', '\n', '\016', 'c', 'o', 'm',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\007', 'd', 'e', 't', 'a', 'i', 'l', 's', 'B', 'a', '\n', '\016', 'c', 'o', 'm',
'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'r', 'p', 'c', 'B', '\013', 'S', 't', 'a', 't', 'u', 's', 'P', 'r', 'o', 't', 'o', 'P',
'\001', 'Z', '7', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'g', 'o', 'l', 'a', 'n', 'g', '.', 'o', 'r', 'g', '/', 'g', 'e', 'n', 'p',
'r', 'o', 't', 'o', '/', 'g', 'o', 'o', 'g', 'l', 'e', 'a', 'p', 'i', 's', '/', 'r', 'p', 'c', '/', 's', 't', 'a', 't', 'u',
-'s', ';', 's', 't', 'a', 't', 'u', 's', '\242', '\002', '\003', 'R', 'P', 'C', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', ';', 's', 't', 'a', 't', 'u', 's', '\370', '\001', '\001', '\242', '\002', '\003', 'R', 'P', 'C', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -36,7 +31,7 @@ static upb_def_init *deps[2] = {
upb_def_init google_rpc_status_proto_upbdefinit = {
deps,
- layouts,
+ &google_rpc_status_proto_upb_file_layout,
"google/rpc/status.proto",
- UPB_STRVIEW_INIT(descriptor, 272)
+ UPB_STRVIEW_INIT(descriptor, 275)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
index 6cfd7ee470c..e3705351dda 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/migrate.upbdefs.c
@@ -8,19 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/migrate.upbdefs.h"
+#include "udpa/annotations/migrate.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_MigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FieldMigrateAnnotation_msginit;
-extern const upb_msglayout udpa_annotations_FileMigrateAnnotation_msginit;
-
-static const upb_msglayout *layouts[3] = {
- &udpa_annotations_MigrateAnnotation_msginit,
- &udpa_annotations_FieldMigrateAnnotation_msginit,
- &udpa_annotations_FileMigrateAnnotation_msginit,
-};
-
-static const char descriptor[855] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't',
+static const char descriptor[893] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'm', 'i', 'g', 'r', 'a', 't',
'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
'\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p',
't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '+', '\n', '\021', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A', 'n', 'n', 'o', 't',
@@ -53,8 +44,9 @@ static const char descriptor[855] = {'\n', '\036', 'u', 'd', 'p', 'a', '/', 'a',
'r', 'a', 't', 'e', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i',
'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\216', '\343', '\377', 'Q', ' ', '\001', '(', '\013', '2', '\'', '.', 'u', 'd', 'p', 'a',
'.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'A',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'b', '\006', 'p',
-'r', 'o', 't', 'o', '3',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'l', 'e', 'M', 'i', 'g', 'r', 'a', 't', 'e', 'B', '$', 'Z',
+'\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -64,7 +56,7 @@ static upb_def_init *deps[2] = {
upb_def_init udpa_annotations_migrate_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_migrate_proto_upb_file_layout,
"udpa/annotations/migrate.proto",
- UPB_STRVIEW_INIT(descriptor, 855)
+ UPB_STRVIEW_INIT(descriptor, 893)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
index 6616936e3a4..904580ecb98 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c
@@ -8,49 +8,40 @@
#include "upb/def.h"
#include "udpa/annotations/security.upbdefs.h"
+#include "udpa/annotations/security.upb.h"
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern upb_def_init google_protobuf_any_proto_upbdefinit;
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_FieldSecurityAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_FieldSecurityAnnotation_msginit,
-};
-
-static const char descriptor[469] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i',
+static const char descriptor[453] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'c', 'u', 'r', 'i',
't', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
's', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
-'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
-'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\001', '\n', '\027', 'F', 'i',
-'e', 'l', 'd', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', 'K', '\n', '\"',
-'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'd',
-'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\022', 'G',
-'\n', ' ', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd',
-'_', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\035', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r',
-'e', 'F', 'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', ':', 'g', '\n', '\010',
-'s', 'e', 'c', 'u', 'r', 'i', 't', 'y', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
-'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\261', '\362', '\246', '\005', ' ', '\001', '(', '\013', '2', ')',
-'.', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'e', 'l', 'd', 'S', 'e',
-'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's', 'e', 'c', 'u', 'r', 'i', 't',
-'y', 'B', '\010', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/',
+'d', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '\257', '\001', '\n', '\027', 'F', 'i', 'e', 'l',
+'d', 'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', 'K', '\n', '\"', 'c', 'o',
+'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'd', 'o', 'w',
+'n', 's', 't', 'r', 'e', 'a', 'm', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\037', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', 'F',
+'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'D', 'o', 'w', 'n', 's', 't', 'r', 'e', 'a', 'm', '\022', 'G', '\n', ' ',
+'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', '_', 'f', 'o', 'r', '_', 'u', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', '_', 'u',
+'p', 's', 't', 'r', 'e', 'a', 'm', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\035', 'c', 'o', 'n', 'f', 'i', 'g', 'u', 'r', 'e', 'F',
+'o', 'r', 'U', 'n', 't', 'r', 'u', 's', 't', 'e', 'd', 'U', 'p', 's', 't', 'r', 'e', 'a', 'm', ':', 'g', '\n', '\010', 's', 'e',
+'c', 'u', 'r', 'i', 't', 'y', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
+'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\261', '\362', '\246', '\005', ' ', '\001', '(', '\013', '2', ')', '.', 'u',
+'d', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'F', 'i', 'e', 'l', 'd', 'S', 'e', 'c', 'u',
+'r', 'i', 't', 'y', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\010', 's', 'e', 'c', 'u', 'r', 'i', 't', 'y', 'B',
+',', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o',
+'/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o',
+'t', 'o', '3',
};
-static upb_def_init *deps[5] = {
+static upb_def_init *deps[3] = {
&udpa_annotations_status_proto_upbdefinit,
- &google_protobuf_any_proto_upbdefinit,
&google_protobuf_descriptor_proto_upbdefinit,
- &validate_validate_proto_upbdefinit,
NULL
};
upb_def_init udpa_annotations_security_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_security_proto_upb_file_layout,
"udpa/annotations/security.proto",
- UPB_STRVIEW_INIT(descriptor, 469)
+ UPB_STRVIEW_INIT(descriptor, 453)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
index 4e6416b21df..1b959779c42 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
@@ -8,16 +8,17 @@
#include "upb/def.h"
#include "udpa/annotations/sensitive.upbdefs.h"
+#include "udpa/annotations/sensitive.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-
-static const char descriptor[158] = {'\n', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't',
+static const char descriptor[196] = {'\n', ' ', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 'e', 'n', 's', 'i', 't',
'i', 'v', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r',
'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', ':', '>', '\n', '\t', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e', '\022',
'\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p',
't', 'i', 'o', 'n', 's', '\030', '\367', '\266', '\301', '$', ' ', '\001', '(', '\010', 'R', '\t', 's', 'e', 'n', 's', 'i', 't', 'i', 'v', 'e',
-'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'B', '$', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g',
+'o', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -27,7 +28,7 @@ static upb_def_init *deps[2] = {
upb_def_init udpa_annotations_sensitive_proto_upbdefinit = {
deps,
- NULL,
+ &udpa_annotations_sensitive_proto_upb_file_layout,
"udpa/annotations/sensitive.proto",
- UPB_STRVIEW_INIT(descriptor, 158)
+ UPB_STRVIEW_INIT(descriptor, 196)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
index f130145dd2d..caa26c3f90a 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/status.upbdefs.h"
+#include "udpa/annotations/status.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_StatusAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_StatusAnnotation_msginit,
-};
-
-static const char descriptor[445] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
+static const char descriptor[483] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
'.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '\032',
' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't',
'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '\232', '\001', '\n', '\020', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a',
@@ -33,7 +28,9 @@ static const char descriptor[445] = {'\n', '\035', 'u', 'd', 'p', 'a', '/', 'a',
'\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'l', 'e', 'O', 'p',
't', 'i', 'o', 'n', 's', '\030', '\207', '\200', '\231', 'j', ' ', '\001', '(', '\013', '2', '\"', '.', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n',
'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n',
-'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u', 's', 'B', '$', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o',
+'m', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -43,7 +40,7 @@ static upb_def_init *deps[2] = {
upb_def_init udpa_annotations_status_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_status_proto_upb_file_layout,
"udpa/annotations/status.proto",
- UPB_STRVIEW_INIT(descriptor, 445)
+ UPB_STRVIEW_INIT(descriptor, 483)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
index b6de8fb0bb0..d3319749a4f 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
@@ -8,15 +8,10 @@
#include "upb/def.h"
#include "udpa/annotations/versioning.upbdefs.h"
+#include "udpa/annotations/versioning.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
-extern const upb_msglayout udpa_annotations_VersioningAnnotation_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_annotations_VersioningAnnotation_msginit,
-};
-
-static const char descriptor[279] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
+static const char descriptor[317] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i', 'o',
'n', 'i', 'n', 'g', '.', 'p', 'r', 'o', 't', 'o', '\022', '\020', 'u', 'd', 'p', 'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i',
'o', 'n', 's', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', 'J', '\n', '\024', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n',
@@ -26,8 +21,9 @@ static const char descriptor[279] = {'\n', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n
'n', 'g', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's',
'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\323', '\210', '\341', '\003', ' ', '\001', '(', '\013', '2', '&', '.', 'u', 'd', 'p',
'a', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'A',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'b', '\006', 'p', 'r',
-'o', 't', 'o', '3',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'v', 'e', 'r', 's', 'i', 'o', 'n', 'i', 'n', 'g', 'B', '$', 'Z', '\"',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
@@ -37,7 +33,7 @@ static upb_def_init *deps[2] = {
upb_def_init udpa_annotations_versioning_proto_upbdefinit = {
deps,
- layouts,
+ &udpa_annotations_versioning_proto_upb_file_layout,
"udpa/annotations/versioning.proto",
- UPB_STRVIEW_INIT(descriptor, 279)
+ UPB_STRVIEW_INIT(descriptor, 317)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
deleted file mode 100644
index f786bff37ab..00000000000
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#include "upb/def.h"
-#include "udpa/type/v1/typed_struct.upbdefs.h"
-
-extern upb_def_init validate_validate_proto_upbdefinit;
-extern upb_def_init google_protobuf_struct_proto_upbdefinit;
-extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &udpa_type_v1_TypedStruct_msginit,
-};
-
-static const char descriptor[251] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 't', 'y', 'p', 'e', '/', 'v', '1', '/', 't', 'y', 'p', 'e', 'd', '_', 's', 't', 'r', 'u',
-'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\014', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', '\032', '\027', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g',
-'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o',
-'t', 'o', '\"', 'W', '\n', '\013', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e',
-'_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '-', '\n', '\005', 'v', 'a',
-'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
-'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'B', '2', '\n', '\034', 'c', 'o', 'm', '.', 'g',
-'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', 'B', '\020',
-'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o',
-'3',
-};
-
-static upb_def_init *deps[3] = {
- &validate_validate_proto_upbdefinit,
- &google_protobuf_struct_proto_upbdefinit,
- NULL
-};
-
-upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit = {
- deps,
- layouts,
- "udpa/type/v1/typed_struct.proto",
- UPB_STRVIEW_INIT(descriptor, 251)
-};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
deleted file mode 100644
index d30baef2b22..00000000000
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This file was generated by upbc (the upb compiler) from the input
- * file:
- *
- * udpa/type/v1/typed_struct.proto
- *
- * Do not edit -- your changes will be discarded when the file is
- * regenerated. */
-
-#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
-#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
-
-#include "upb/def.h"
-#include "upb/port_def.inc"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "upb/def.h"
-
-#include "upb/port_def.inc"
-
-extern upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit;
-
-UPB_INLINE const upb_msgdef *udpa_type_v1_TypedStruct_getmsgdef(upb_symtab *s) {
- _upb_symtab_loaddefinit(s, &udpa_type_v1_typed_struct_proto_upbdefinit);
- return upb_symtab_lookupmsg(s, "udpa.type.v1.TypedStruct");
-}
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#include "upb/port_undef.inc"
-
-#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
index dc751fa62b9..2f45be7e013 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
@@ -8,61 +8,12 @@
#include "upb/def.h"
#include "validate/validate.upbdefs.h"
+#include "validate/validate.upb.h"
extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
extern upb_def_init google_protobuf_duration_proto_upbdefinit;
extern upb_def_init google_protobuf_timestamp_proto_upbdefinit;
-extern const upb_msglayout validate_FieldRules_msginit;
-extern const upb_msglayout validate_FloatRules_msginit;
-extern const upb_msglayout validate_DoubleRules_msginit;
-extern const upb_msglayout validate_Int32Rules_msginit;
-extern const upb_msglayout validate_Int64Rules_msginit;
-extern const upb_msglayout validate_UInt32Rules_msginit;
-extern const upb_msglayout validate_UInt64Rules_msginit;
-extern const upb_msglayout validate_SInt32Rules_msginit;
-extern const upb_msglayout validate_SInt64Rules_msginit;
-extern const upb_msglayout validate_Fixed32Rules_msginit;
-extern const upb_msglayout validate_Fixed64Rules_msginit;
-extern const upb_msglayout validate_SFixed32Rules_msginit;
-extern const upb_msglayout validate_SFixed64Rules_msginit;
-extern const upb_msglayout validate_BoolRules_msginit;
-extern const upb_msglayout validate_StringRules_msginit;
-extern const upb_msglayout validate_BytesRules_msginit;
-extern const upb_msglayout validate_EnumRules_msginit;
-extern const upb_msglayout validate_MessageRules_msginit;
-extern const upb_msglayout validate_RepeatedRules_msginit;
-extern const upb_msglayout validate_MapRules_msginit;
-extern const upb_msglayout validate_AnyRules_msginit;
-extern const upb_msglayout validate_DurationRules_msginit;
-extern const upb_msglayout validate_TimestampRules_msginit;
-
-static const upb_msglayout *layouts[23] = {
- &validate_FieldRules_msginit,
- &validate_FloatRules_msginit,
- &validate_DoubleRules_msginit,
- &validate_Int32Rules_msginit,
- &validate_Int64Rules_msginit,
- &validate_UInt32Rules_msginit,
- &validate_UInt64Rules_msginit,
- &validate_SInt32Rules_msginit,
- &validate_SInt64Rules_msginit,
- &validate_Fixed32Rules_msginit,
- &validate_Fixed64Rules_msginit,
- &validate_SFixed32Rules_msginit,
- &validate_SFixed64Rules_msginit,
- &validate_BoolRules_msginit,
- &validate_StringRules_msginit,
- &validate_BytesRules_msginit,
- &validate_EnumRules_msginit,
- &validate_MessageRules_msginit,
- &validate_RepeatedRules_msginit,
- &validate_MapRules_msginit,
- &validate_AnyRules_msginit,
- &validate_DurationRules_msginit,
- &validate_TimestampRules_msginit,
-};
-
-static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+static const char descriptor[6319] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
'\022', '\010', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b',
'u', 'f', '/', 'd', 'e', 's', 'c', 'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g',
'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't',
@@ -111,131 +62,152 @@ static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a'
'R', 'u', 'l', 'e', 's', 'H', '\000', 'R', '\010', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n', '\022', '8', '\n', '\t', 't', 'i', 'm', 'e',
's', 't', 'a', 'm', 'p', '\030', '\026', ' ', '\001', '(', '\013', '2', '\030', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'T', 'i',
'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l', 'e', 's', 'H', '\000', 'R', '\t', 't', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
-'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', '\"', '\215', '\001', '\n', '\n', 'F', 'l', 'o', 'a', 't', 'R', 'u', 'l', 'e', 's', '\022', '\024',
+'B', '\006', '\n', '\004', 't', 'y', 'p', 'e', '\"', '\260', '\001', '\n', '\n', 'F', 'l', 'o', 'a', 't', 'R', 'u', 'l', 'e', 's', '\022', '\024',
'\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\002', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l',
't', '\030', '\002', ' ', '\001', '(', '\002', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\002', 'R',
'\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\002', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g',
't', 'e', '\030', '\005', ' ', '\001', '(', '\002', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\002',
'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\002', 'R', '\005', 'n', 'o', 't',
-'I', 'n', '\"', '\216', '\001', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
-'s', 't', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001',
-'(', '\001', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\001', 'R', '\003', 'l', 't', 'e', '\022',
-'\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\001', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ',
-'\001', '(', '\001', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\001', 'R', '\002', 'i', 'n', '\022',
-'\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\001', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\215', '\001',
-'\n', '\n', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001',
-'(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\002', 'l', 't',
-'\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030',
-'\004', ' ', '\001', '(', '\005', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\005', 'R', '\003', 'g',
-'t', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't',
-'_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\215', '\001', '\n', '\n', 'I', 'n', 't', '6',
-'4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\003', 'R', '\005', 'c', 'o',
-'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\003', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't',
-'e', '\030', '\003', ' ', '\001', '(', '\003', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\003', 'R',
-'\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002',
-'i', 'n', '\030', '\006', ' ', '\003', '(', '\003', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ',
-'\003', '(', '\003', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013', 'U', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e',
-'s', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\r', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016',
-'\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\r', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001',
-'(', '\r', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\r', 'R', '\002', 'g', 't', '\022', '\020',
-'\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\r', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ',
-'\003', '(', '\r', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\r', 'R', '\005',
-'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013', 'U', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005',
+'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R',
+'\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'D', 'o', 'u', 'b', 'l', 'e', 'R', 'u',
+'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\001', 'R', '\005', 'c', 'o', 'n', 's', 't',
+'\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\001', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003',
+' ', '\001', '(', '\001', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\001', 'R', '\002', 'g', 't',
+'\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\001', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030',
+'\006', ' ', '\003', '(', '\001', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\001',
+'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010',
+' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\260', '\001', '\n', '\n', 'I', 'n', 't',
+'3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 'c',
+'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\005', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
+'t', 'e', '\030', '\003', ' ', '\001', '(', '\005', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\005',
+'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\005', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
+'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
+' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p',
+'t', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\260', '\001', '\n',
+'\n', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(',
+'\003', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\003', 'R', '\002', 'l', 't', '\022',
+'\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\003', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004',
+' ', '\001', '(', '\003', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\003', 'R', '\003', 'g', 't',
+'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\003', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_',
+'i', 'n', '\030', '\007', ' ', '\003', '(', '\003', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e',
+'_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y',
+'\"', '\261', '\001', '\n', '\013', 'U', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't',
+'\030', '\001', ' ', '\001', '(', '\r', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\r',
+'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\r', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n',
+'\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\r', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(',
+'\r', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\r', 'R', '\002', 'i', 'n', '\022', '\025', '\n',
+'\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\r', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i',
+'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e',
+'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'U', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005',
'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030',
'\002', ' ', '\001', '(', '\004', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\003', 'l',
't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e',
'\030', '\005', ' ', '\001', '(', '\004', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\004', 'R', '\002',
'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\004', 'R', '\005', 'n', 'o', 't', 'I', 'n',
-'\"', '\216', '\001', '\n', '\013', 'S', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't',
-'\030', '\001', ' ', '\001', '(', '\021', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\021',
-'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\021', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n',
-'\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\021', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(',
-'\021', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\021', 'R', '\002', 'i', 'n', '\022', '\025', '\n',
-'\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\021', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\216', '\001', '\n', '\013',
-'S', 'I', 'n', 't', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(',
-'\022', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\022', 'R', '\002', 'l', 't', '\022',
-'\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\022', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004',
-' ', '\001', '(', '\022', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\022', 'R', '\003', 'g', 't',
-'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\022', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_',
-'i', 'n', '\030', '\007', ' ', '\003', '(', '\022', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\217', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd',
-'3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\007', 'R', '\005', 'c',
-'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\007', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
-'t', 'e', '\030', '\003', ' ', '\001', '(', '\007', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\007',
-'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\007', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
-'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\007', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
-' ', '\003', '(', '\007', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\217', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u',
-'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\006', 'R', '\005', 'c', 'o', 'n', 's', 't',
-'\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\006', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003',
-' ', '\001', '(', '\006', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\006', 'R', '\002', 'g', 't',
-'\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\006', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030',
-'\006', ' ', '\003', '(', '\006', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\006',
-'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\220', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's',
+'\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i',
+'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'S', 'I', 'n', 't', '3', '2', 'R', 'u', 'l', 'e',
+'s', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\021', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016',
+'\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\021', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001',
+'(', '\021', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\021', 'R', '\002', 'g', 't', '\022', '\020',
+'\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\021', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ',
+'\003', '(', '\021', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\021', 'R', '\005',
+'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001',
+'(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\261', '\001', '\n', '\013', 'S', 'I', 'n', 't', '6',
+'4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\022', 'R', '\005', 'c', 'o',
+'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\022', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't',
+'e', '\030', '\003', ' ', '\001', '(', '\022', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\022', 'R',
+'\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\022', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002',
+'i', 'n', '\030', '\006', ' ', '\003', '(', '\022', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ',
+'\003', '(', '\022', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't',
+'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\262', '\001', '\n', '\014',
+'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001',
+'(', '\007', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\007', 'R', '\002', 'l', 't',
+'\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\007', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030',
+'\004', ' ', '\001', '(', '\007', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\007', 'R', '\003', 'g',
+'t', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\007', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't',
+'_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\007', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't',
+'y', '\"', '\262', '\001', '\n', '\014', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
+'s', 't', '\030', '\001', ' ', '\001', '(', '\006', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001',
+'(', '\006', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\006', 'R', '\003', 'l', 't', 'e', '\022',
+'\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\006', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ',
+'\001', '(', '\006', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\006', 'R', '\002', 'i', 'n', '\022',
+'\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\006', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n',
+'\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o',
+'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\263', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '3', '2', 'R', 'u', 'l', 'e', 's',
'\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\017', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n',
'\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\017', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(',
'\017', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\017', 'R', '\002', 'g', 't', '\022', '\020', '\n',
'\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\017', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003',
'(', '\017', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\017', 'R', '\005', 'n',
-'o', 't', 'I', 'n', '\"', '\220', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd', '6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n',
-'\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\020', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't',
-'\030', '\002', ' ', '\001', '(', '\020', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l', 't', 'e', '\030', '\003', ' ', '\001', '(', '\020', 'R', '\003',
-'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\020', 'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't',
-'e', '\030', '\005', ' ', '\001', '(', '\020', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\020', 'R',
-'\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\020', 'R', '\005', 'n', 'o', 't', 'I',
-'n', '\"', '!', '\n', '\t', 'B', 'o', 'o', 'l', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001',
-' ', '\001', '(', '\010', 'R', '\005', 'c', 'o', 'n', 's', 't', '\"', '\261', '\005', '\n', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'R', 'u', 'l',
-'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022',
-'\020', '\n', '\003', 'l', 'e', 'n', '\030', '\023', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_',
-'l', 'e', 'n', '\030', '\002', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_',
-'l', 'e', 'n', '\030', '\003', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\033', '\n', '\t', 'l', 'e', 'n', '_',
-'b', 'y', 't', 'e', 's', '\030', '\024', ' ', '\001', '(', '\004', 'R', '\010', 'l', 'e', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t',
-'m', 'i', 'n', '_', 'b', 'y', 't', 'e', 's', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'B', 'y', 't', 'e', 's',
-'\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'B',
-'y', 't', 'e', 's', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a',
-'t', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\006', 'p', 'r',
-'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\006', 's', 'u', 'f',
-'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'o',
-'n', 't', 'a', 'i', 'n', 's', '\022', '!', '\n', '\014', 'n', 'o', 't', '_', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\027', ' ',
-'\001', '(', '\t', 'R', '\013', 'n', 'o', 't', 'C', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\n', ' ',
-'\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\005',
-'n', 'o', 't', 'I', 'n', '\022', '\026', '\n', '\005', 'e', 'm', 'a', 'i', 'l', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\005', 'e',
-'m', 'a', 'i', 'l', '\022', '\034', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\r', ' ', '\001', '(', '\010', 'H', '\000', 'R',
-'\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\016', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002',
-'i', 'p', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '4', '\030', '\017', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022',
-'\024', '\n', '\004', 'i', 'p', 'v', '6', '\030', '\020', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '\022', '\n', '\003',
-'u', 'r', 'i', '\030', '\021', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\003', 'u', 'r', 'i', '\022', '\031', '\n', '\007', 'u', 'r', 'i', '_', 'r',
-'e', 'f', '\030', '\022', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\006', 'u', 'r', 'i', 'R', 'e', 'f', '\022', '\032', '\n', '\007', 'a', 'd', 'd',
-'r', 'e', 's', 's', '\030', '\025', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\024', '\n', '\004',
-'u', 'u', 'i', 'd', '\030', '\026', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'u', 'u', 'i', 'd', '\022', '@', '\n', '\020', 'w', 'e', 'l',
-'l', '_', 'k', 'n', 'o', 'w', 'n', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\030', ' ', '\001', '(', '\016', '2', '\024', '.', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', 'H', '\000', 'R', '\016', 'w', 'e', 'l', 'l', 'K',
-'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\034', '\n', '\006', 's', 't', 'r', 'i', 'c', 't', '\030', '\031', ' ', '\001', '(', '\010',
-':', '\004', 't', 'r', 'u', 'e', 'R', '\006', 's', 't', 'r', 'i', 'c', 't', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n',
-'o', 'w', 'n', '\"', '\277', '\002', '\n', '\n', 'B', 'y', 't', 'e', 's', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n',
-'s', 't', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l', 'e', 'n', '\030', '\r', ' ',
-'\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030', '\002', ' ', '\001', '(', '\004',
-'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030', '\003', ' ', '\001', '(', '\004',
-'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\004', ' ', '\001', '(', '\t',
-'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\005', ' ', '\001', '(', '\014',
-'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\006', ' ', '\001', '(', '\014', 'R',
-'\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\007', ' ', '\001', '(', '\014',
-'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\014', 'R', '\002', 'i',
-'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\t', ' ', '\003', '(', '\014', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022',
-'\020', '\n', '\002', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '4',
-'\030', '\013', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p', 'v', '6', '\030', '\014', ' ',
-'\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o', 'w', 'n',
-'\"', 'k', '\n', '\t', 'E', 'n', 'u', 'm', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ',
-'\001', '(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '!', '\n', '\014', 'd', 'e', 'f', 'i', 'n', 'e', 'd', '_', 'o', 'n', 'l',
-'y', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\013', 'd', 'e', 'f', 'i', 'n', 'e', 'd', 'O', 'n', 'l', 'y', '\022', '\016', '\n', '\002', 'i',
-'n', '\030', '\003', ' ', '\003', '(', '\005', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\004', ' ', '\003',
-'(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '>', '\n', '\014', 'M', 'e', 's', 's', 'a', 'g', 'e', 'R', 'u', 'l', 'e', 's',
-'\022', '\022', '\n', '\004', 's', 'k', 'i', 'p', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\004', 's', 'k', 'i', 'p', '\022', '\032', '\n', '\010', 'r',
-'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\"', '\215',
-'\001', '\n', '\r', 'R', 'e', 'p', 'e', 'a', 't', 'e', 'd', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'i',
-'t', 'e', 'm', 's', '\030', '\001', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'I', 't', 'e', 'm', 's', '\022', '\033', '\n', '\t', 'm',
-'a', 'x', '_', 'i', 't', 'e', 'm', 's', '\030', '\002', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'I', 't', 'e', 'm', 's', '\022',
-'\026', '\n', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\030', '\003', ' ', '\001', '(', '\010', 'R', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\022', '*',
-'\n', '\005', 'i', 't', 'e', 'm', 's', '\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.',
-'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\005', 'i', 't', 'e', 'm', 's', '\"', '\271', '\001', '\n', '\010', 'M', 'a', 'p',
+'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\010', ' ', '\001', '(',
+'\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\263', '\001', '\n', '\r', 'S', 'F', 'i', 'x', 'e', 'd',
+'6', '4', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\020', 'R', '\005', 'c',
+'o', 'n', 's', 't', '\022', '\016', '\n', '\002', 'l', 't', '\030', '\002', ' ', '\001', '(', '\020', 'R', '\002', 'l', 't', '\022', '\020', '\n', '\003', 'l',
+'t', 'e', '\030', '\003', ' ', '\001', '(', '\020', 'R', '\003', 'l', 't', 'e', '\022', '\016', '\n', '\002', 'g', 't', '\030', '\004', ' ', '\001', '(', '\020',
+'R', '\002', 'g', 't', '\022', '\020', '\n', '\003', 'g', 't', 'e', '\030', '\005', ' ', '\001', '(', '\020', 'R', '\003', 'g', 't', 'e', '\022', '\016', '\n',
+'\002', 'i', 'n', '\030', '\006', ' ', '\003', '(', '\020', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\007',
+' ', '\003', '(', '\020', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p',
+'t', 'y', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '!', '\n', '\t',
+'B', 'o', 'o', 'l', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\010', 'R',
+'\005', 'c', 'o', 'n', 's', 't', '\"', '\324', '\005', '\n', '\013', 'S', 't', 'r', 'i', 'n', 'g', 'R', 'u', 'l', 'e', 's', '\022', '\024', '\n',
+'\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l', 'e',
+'n', '\030', '\023', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030', '\002',
+' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030', '\003',
+' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\033', '\n', '\t', 'l', 'e', 'n', '_', 'b', 'y', 't', 'e', 's',
+'\030', '\024', ' ', '\001', '(', '\004', 'R', '\010', 'l', 'e', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'b',
+'y', 't', 'e', 's', '\030', '\004', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'i', 'n', 'B', 'y', 't', 'e', 's', '\022', '\033', '\n', '\t', 'm',
+'a', 'x', '_', 'b', 'y', 't', 'e', 's', '\030', '\005', ' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'B', 'y', 't', 'e', 's', '\022',
+'\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030', '\006', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n',
+'\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\007', ' ', '\001', '(', '\t', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022',
+'\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\010', ' ', '\001', '(', '\t', 'R', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032',
+'\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\t', ' ', '\001', '(', '\t', 'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n',
+'s', '\022', '!', '\n', '\014', 'n', 'o', 't', '_', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030', '\027', ' ', '\001', '(', '\t', 'R', '\013',
+'n', 'o', 't', 'C', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\n', ' ', '\003', '(', '\t', 'R', '\002',
+'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\013', ' ', '\003', '(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n',
+'\022', '\026', '\n', '\005', 'e', 'm', 'a', 'i', 'l', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\005', 'e', 'm', 'a', 'i', 'l', '\022',
+'\034', '\n', '\010', 'h', 'o', 's', 't', 'n', 'a', 'm', 'e', '\030', '\r', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\010', 'h', 'o', 's', 't',
+'n', 'a', 'm', 'e', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\016', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n',
+'\004', 'i', 'p', 'v', '4', '\030', '\017', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p',
+'v', '6', '\030', '\020', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '\022', '\n', '\003', 'u', 'r', 'i', '\030', '\021',
+' ', '\001', '(', '\010', 'H', '\000', 'R', '\003', 'u', 'r', 'i', '\022', '\031', '\n', '\007', 'u', 'r', 'i', '_', 'r', 'e', 'f', '\030', '\022', ' ',
+'\001', '(', '\010', 'H', '\000', 'R', '\006', 'u', 'r', 'i', 'R', 'e', 'f', '\022', '\032', '\n', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\030',
+'\025', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\007', 'a', 'd', 'd', 'r', 'e', 's', 's', '\022', '\024', '\n', '\004', 'u', 'u', 'i', 'd', '\030',
+'\026', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'u', 'u', 'i', 'd', '\022', '@', '\n', '\020', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o',
+'w', 'n', '_', 'r', 'e', 'g', 'e', 'x', '\030', '\030', ' ', '\001', '(', '\016', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'.', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', 'H', '\000', 'R', '\016', 'w', 'e', 'l', 'l', 'K', 'n', 'o', 'w', 'n', 'R',
+'e', 'g', 'e', 'x', '\022', '\034', '\n', '\006', 's', 't', 'r', 'i', 'c', 't', '\030', '\031', ' ', '\001', '(', '\010', ':', '\004', 't', 'r', 'u',
+'e', 'R', '\006', 's', 't', 'r', 'i', 'c', 't', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y',
+'\030', '\032', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', 'B', '\014', '\n', '\n', 'w', 'e',
+'l', 'l', '_', 'k', 'n', 'o', 'w', 'n', '\"', '\342', '\002', '\n', '\n', 'B', 'y', 't', 'e', 's', 'R', 'u', 'l', 'e', 's', '\022', '\024',
+'\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\014', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '\020', '\n', '\003', 'l',
+'e', 'n', '\030', '\r', ' ', '\001', '(', '\004', 'R', '\003', 'l', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'i', 'n', '_', 'l', 'e', 'n', '\030',
+'\002', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'i', 'n', 'L', 'e', 'n', '\022', '\027', '\n', '\007', 'm', 'a', 'x', '_', 'l', 'e', 'n', '\030',
+'\003', ' ', '\001', '(', '\004', 'R', '\006', 'm', 'a', 'x', 'L', 'e', 'n', '\022', '\030', '\n', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\030',
+'\004', ' ', '\001', '(', '\t', 'R', '\007', 'p', 'a', 't', 't', 'e', 'r', 'n', '\022', '\026', '\n', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\030',
+'\005', ' ', '\001', '(', '\014', 'R', '\006', 'p', 'r', 'e', 'f', 'i', 'x', '\022', '\026', '\n', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\030', '\006',
+' ', '\001', '(', '\014', 'R', '\006', 's', 'u', 'f', 'f', 'i', 'x', '\022', '\032', '\n', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\030',
+'\007', ' ', '\001', '(', '\014', 'R', '\010', 'c', 'o', 'n', 't', 'a', 'i', 'n', 's', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\010', ' ', '\003',
+'(', '\014', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\t', ' ', '\003', '(', '\014', 'R', '\005', 'n',
+'o', 't', 'I', 'n', '\022', '\020', '\n', '\002', 'i', 'p', '\030', '\n', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\002', 'i', 'p', '\022', '\024', '\n',
+'\004', 'i', 'p', 'v', '4', '\030', '\013', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '4', '\022', '\024', '\n', '\004', 'i', 'p',
+'v', '6', '\030', '\014', ' ', '\001', '(', '\010', 'H', '\000', 'R', '\004', 'i', 'p', 'v', '6', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r',
+'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\016', ' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't',
+'y', 'B', '\014', '\n', '\n', 'w', 'e', 'l', 'l', '_', 'k', 'n', 'o', 'w', 'n', '\"', 'k', '\n', '\t', 'E', 'n', 'u', 'm', 'R', 'u',
+'l', 'e', 's', '\022', '\024', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\001', ' ', '\001', '(', '\005', 'R', '\005', 'c', 'o', 'n', 's', 't',
+'\022', '!', '\n', '\014', 'd', 'e', 'f', 'i', 'n', 'e', 'd', '_', 'o', 'n', 'l', 'y', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\013', 'd',
+'e', 'f', 'i', 'n', 'e', 'd', 'O', 'n', 'l', 'y', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\003', ' ', '\003', '(', '\005', 'R', '\002', 'i',
+'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\004', ' ', '\003', '(', '\005', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"',
+'>', '\n', '\014', 'M', 'e', 's', 's', 'a', 'g', 'e', 'R', 'u', 'l', 'e', 's', '\022', '\022', '\n', '\004', 's', 'k', 'i', 'p', '\030', '\001',
+' ', '\001', '(', '\010', 'R', '\004', 's', 'k', 'i', 'p', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\002', ' ',
+'\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\"', '\260', '\001', '\n', '\r', 'R', 'e', 'p', 'e', 'a', 't', 'e',
+'d', 'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'i', 't', 'e', 'm', 's', '\030', '\001', ' ', '\001', '(', '\004',
+'R', '\010', 'm', 'i', 'n', 'I', 't', 'e', 'm', 's', '\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'i', 't', 'e', 'm', 's', '\030', '\002',
+' ', '\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'I', 't', 'e', 'm', 's', '\022', '\026', '\n', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\030',
+'\003', ' ', '\001', '(', '\010', 'R', '\006', 'u', 'n', 'i', 'q', 'u', 'e', '\022', '*', '\n', '\005', 'i', 't', 'e', 'm', 's', '\030', '\004', ' ',
+'\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's',
+'R', '\005', 'i', 't', 'e', 'm', 's', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\005',
+' ', '\001', '(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', '\334', '\001', '\n', '\010', 'M', 'a', 'p',
'R', 'u', 'l', 'e', 's', '\022', '\033', '\n', '\t', 'm', 'i', 'n', '_', 'p', 'a', 'i', 'r', 's', '\030', '\001', ' ', '\001', '(', '\004', 'R',
'\010', 'm', 'i', 'n', 'P', 'a', 'i', 'r', 's', '\022', '\033', '\n', '\t', 'm', 'a', 'x', '_', 'p', 'a', 'i', 'r', 's', '\030', '\002', ' ',
'\001', '(', '\004', 'R', '\010', 'm', 'a', 'x', 'P', 'a', 'i', 'r', 's', '\022', '\033', '\n', '\t', 'n', 'o', '_', 's', 'p', 'a', 'r', 's',
@@ -243,56 +215,57 @@ static const char descriptor[5759] = {'\n', '\027', 'v', 'a', 'l', 'i', 'd', 'a'
'\030', '\004', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u',
'l', 'e', 's', 'R', '\004', 'k', 'e', 'y', 's', '\022', ',', '\n', '\006', 'v', 'a', 'l', 'u', 'e', 's', '\030', '\005', ' ', '\001', '(', '\013',
'2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\006', 'v',
-'a', 'l', 'u', 'e', 's', '\"', 'M', '\n', '\010', 'A', 'n', 'y', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u',
-'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '\016', '\n', '\002', 'i',
-'n', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\003', ' ', '\003',
-'(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\351', '\002', '\n', '\r', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', 'u', 'l',
+'a', 'l', 'u', 'e', 's', '\022', '!', '\n', '\014', 'i', 'g', 'n', 'o', 'r', 'e', '_', 'e', 'm', 'p', 't', 'y', '\030', '\006', ' ', '\001',
+'(', '\010', 'R', '\013', 'i', 'g', 'n', 'o', 'r', 'e', 'E', 'm', 'p', 't', 'y', '\"', 'M', '\n', '\010', 'A', 'n', 'y', 'R', 'u', 'l',
+'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q',
+'u', 'i', 'r', 'e', 'd', '\022', '\016', '\n', '\002', 'i', 'n', '\030', '\002', ' ', '\003', '(', '\t', 'R', '\002', 'i', 'n', '\022', '\025', '\n', '\006',
+'n', 'o', 't', '_', 'i', 'n', '\030', '\003', ' ', '\003', '(', '\t', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\351', '\002', '\n', '\r', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030',
+'\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '/', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030',
+'\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D',
+'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', ')', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(',
+'\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't',
+'i', 'o', 'n', 'R', '\002', 'l', 't', '\022', '+', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'l',
+'t', 'e', '\022', ')', '\n', '\002', 'g', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
+'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'g', 't', '\022', '+', '\n', '\003', 'g',
+'t', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'g', 't', 'e', '\022', ')', '\n', '\002', 'i', 'n', '\030', '\007', ' ', '\003',
+'(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a',
+'t', 'i', 'o', 'n', 'R', '\002', 'i', 'n', '\022', '0', '\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\013', '2',
+'\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o',
+'n', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\363', '\002', '\n', '\016', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l',
'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q',
-'u', 'i', 'r', 'e', 'd', '\022', '/', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o',
-'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'c',
-'o', 'n', 's', 't', '\022', ')', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e',
-'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'l', 't', '\022', '+', '\n',
-'\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\003', 'l', 't', 'e', '\022', ')', '\n', '\002', 'g', 't', '\030', '\005',
-' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
-'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'g', 't', '\022', '+', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\031',
-'.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n',
-'R', '\003', 'g', 't', 'e', '\022', ')', '\n', '\002', 'i', 'n', '\030', '\007', ' ', '\003', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\002', 'i', 'n', '\022', '0',
-'\n', '\006', 'n', 'o', 't', '_', 'i', 'n', '\030', '\010', ' ', '\003', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p',
-'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\005', 'n', 'o', 't', 'I', 'n', '\"', '\363',
-'\002', '\n', '\016', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', 'u', 'l', 'e', 's', '\022', '\032', '\n', '\010', 'r', 'e', 'q', 'u',
-'i', 'r', 'e', 'd', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '0', '\n', '\005', 'c',
-'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\005', 'c', 'o', 'n', 's', 't', '\022', '*', '\n', '\002', 'l',
-'t', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
-'.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'l', 't', '\022', ',', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001',
+'u', 'i', 'r', 'e', 'd', '\022', '0', '\n', '\005', 'c', 'o', 'n', 's', 't', '\030', '\002', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\005',
+'c', 'o', 'n', 's', 't', '\022', '*', '\n', '\002', 'l', 't', '\030', '\003', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
+'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'l', 't', '\022',
+',', '\n', '\003', 'l', 't', 'e', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\003', 'l', 't', 'e', '\022', '*', '\n', '\002', 'g',
+'t', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\002', 'g', 't', '\022', ',', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001',
'(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e',
-'s', 't', 'a', 'm', 'p', 'R', '\003', 'l', 't', 'e', '\022', '*', '\n', '\002', 'g', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.',
-'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p',
-'R', '\002', 'g', 't', '\022', ',', '\n', '\003', 'g', 't', 'e', '\030', '\006', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'T', 'i', 'm', 'e', 's', 't', 'a', 'm', 'p', 'R', '\003', 'g', 't', 'e',
-'\022', '\025', '\n', '\006', 'l', 't', '_', 'n', 'o', 'w', '\030', '\007', ' ', '\001', '(', '\010', 'R', '\005', 'l', 't', 'N', 'o', 'w', '\022', '\025',
-'\n', '\006', 'g', 't', '_', 'n', 'o', 'w', '\030', '\010', ' ', '\001', '(', '\010', 'R', '\005', 'g', 't', 'N', 'o', 'w', '\022', '1', '\n', '\006',
-'w', 'i', 't', 'h', 'i', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
-'t', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R', '\006', 'w', 'i', 't', 'h', 'i', 'n', '*', 'F', '\n',
-'\n', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\013', '\n', '\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022',
-'\024', '\n', '\020', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'N', 'A', 'M', 'E', '\020', '\001', '\022', '\025', '\n', '\021',
-'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'V', 'A', 'L', 'U', 'E', '\020', '\002', ':', '<', '\n', '\010', 'd', 'i',
-'s', 'a', 'b', 'l', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.',
-'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i',
-'s', 'a', 'b', 'l', 'e', 'd', ':', ':', '\n', '\007', 'i', 'g', 'n', 'o', 'r', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l',
-'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's',
-'\030', '\260', '\010', ' ', '\001', '(', '\010', 'R', '\007', 'i', 'g', 'n', 'o', 'r', 'e', 'd', ':', ':', '\n', '\010', 'r', 'e', 'q', 'u', 'i',
-'r', 'e', 'd', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e',
-'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e',
-'d', ':', 'J', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(', '\013', '2', '\024',
-'.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd', 'R', 'u', 'l', 'e', 's', 'R', '\005', 'r', 'u', 'l',
-'e', 's', 'B', 'P', '\n', '\032', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'p', 'g', 'v', '.', 'v',
-'a', 'l', 'i', 'd', 'a', 't', 'e', 'Z', '2', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y',
-'p', 'r', 'o', 'x', 'y', '/', 'p', 'r', 'o', 't', 'o', 'c', '-', 'g', 'e', 'n', '-', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
-'/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
+'s', 't', 'a', 'm', 'p', 'R', '\003', 'g', 't', 'e', '\022', '\025', '\n', '\006', 'l', 't', '_', 'n', 'o', 'w', '\030', '\007', ' ', '\001', '(',
+'\010', 'R', '\005', 'l', 't', 'N', 'o', 'w', '\022', '\025', '\n', '\006', 'g', 't', '_', 'n', 'o', 'w', '\030', '\010', ' ', '\001', '(', '\010', 'R',
+'\005', 'g', 't', 'N', 'o', 'w', '\022', '1', '\n', '\006', 'w', 'i', 't', 'h', 'i', 'n', '\030', '\t', ' ', '\001', '(', '\013', '2', '\031', '.',
+'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u', 'r', 'a', 't', 'i', 'o', 'n', 'R',
+'\006', 'w', 'i', 't', 'h', 'i', 'n', '*', 'F', '\n', '\n', 'K', 'n', 'o', 'w', 'n', 'R', 'e', 'g', 'e', 'x', '\022', '\013', '\n', '\007',
+'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\024', '\n', '\020', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_',
+'N', 'A', 'M', 'E', '\020', '\001', '\022', '\025', '\n', '\021', 'H', 'T', 'T', 'P', '_', 'H', 'E', 'A', 'D', 'E', 'R', '_', 'V', 'A', 'L',
+'U', 'E', '\020', '\002', ':', '<', '\n', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e',
+'.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030',
+'\257', '\010', ' ', '\001', '(', '\010', 'R', '\010', 'd', 'i', 's', 'a', 'b', 'l', 'e', 'd', ':', ':', '\n', '\007', 'i', 'g', 'n', 'o', 'r',
+'e', 'd', '\022', '\037', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's',
+'a', 'g', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\260', '\010', ' ', '\001', '(', '\010', 'R', '\007', 'i', 'g', 'n', 'o', 'r', 'e',
+'d', ':', ':', '\n', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'O', 'n', 'e', 'o', 'f', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\257', '\010', ' ', '\001', '(',
+'\010', 'R', '\010', 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd', ':', 'J', '\n', '\005', 'r', 'u', 'l', 'e', 's', '\022', '\035', '.', 'g', 'o',
+'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n',
+'s', '\030', '\257', '\010', ' ', '\001', '(', '\013', '2', '\024', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'F', 'i', 'e', 'l', 'd',
+'R', 'u', 'l', 'e', 's', 'R', '\005', 'r', 'u', 'l', 'e', 's', 'B', 'P', '\n', '\032', 'i', 'o', '.', 'e', 'n', 'v', 'o', 'y', 'p',
+'r', 'o', 'x', 'y', '.', 'p', 'g', 'v', '.', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', 'Z', '2', 'g', 'i', 't', 'h', 'u', 'b',
+'.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'p', 'r', 'o', 't', 'o', 'c', '-', 'g', 'e',
+'n', '-', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
};
static upb_def_init *deps[4] = {
@@ -304,7 +277,7 @@ static upb_def_init *deps[4] = {
upb_def_init validate_validate_proto_upbdefinit = {
deps,
- layouts,
+ &validate_validate_proto_upb_file_layout,
"validate/validate.proto",
- UPB_STRVIEW_INIT(descriptor, 5759)
+ UPB_STRVIEW_INIT(descriptor, 6319)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
new file mode 100644
index 00000000000..4c709a44f58
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c
@@ -0,0 +1,64 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/annotations/v3/status.upbdefs.h"
+#include "xds/annotations/v3/status.upb.h"
+
+extern upb_def_init google_protobuf_descriptor_proto_upbdefinit;
+static const char descriptor[936] = {'\n', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't',
+'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\022', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'.', 'v', '3', '\032', ' ', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'e', 's', 'c',
+'r', 'i', 'p', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\"', '@', '\n', '\024', 'F', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u',
+'s', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r',
+'o', 'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r',
+'e', 's', 's', '\"', 'C', '\n', '\027', 'M', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't',
+'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o', 'g', 'r', 'e', 's', 's',
+'\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e', 's', 's', '\"', 'A', '\n',
+'\025', 'F', 'i', 'e', 'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n',
+'\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o', 'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016',
+'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e', 's', 's', '\"', '\234', '\001', '\n', '\020', 'S', 't', 'a', 't', 'u', 's',
+'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', '\022', '(', '\n', '\020', 'w', 'o', 'r', 'k', '_', 'i', 'n', '_', 'p', 'r', 'o',
+'g', 'r', 'e', 's', 's', '\030', '\001', ' ', '\001', '(', '\010', 'R', '\016', 'w', 'o', 'r', 'k', 'I', 'n', 'P', 'r', 'o', 'g', 'r', 'e',
+'s', 's', '\022', '^', '\n', '\026', 'p', 'a', 'c', 'k', 'a', 'g', 'e', '_', 'v', 'e', 'r', 's', 'i', 'o', 'n', '_', 's', 't', 'a',
+'t', 'u', 's', '\030', '\002', ' ', '\001', '(', '\016', '2', '(', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o',
+'n', 's', '.', 'v', '3', '.', 'P', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u',
+'s', 'R', '\024', 'p', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u', 's', '*', ']',
+'\n', '\024', 'P', 'a', 'c', 'k', 'a', 'g', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 'S', 't', 'a', 't', 'u', 's', '\022', '\013', '\n',
+'\007', 'U', 'N', 'K', 'N', 'O', 'W', 'N', '\020', '\000', '\022', '\n', '\n', '\006', 'F', 'R', 'O', 'Z', 'E', 'N', '\020', '\001', '\022', '\n', '\n',
+'\006', 'A', 'C', 'T', 'I', 'V', 'E', '\020', '\002', '\022', ' ', '\n', '\034', 'N', 'E', 'X', 'T', '_', 'M', 'A', 'J', 'O', 'R', '_', 'V',
+'E', 'R', 'S', 'I', 'O', 'N', '_', 'C', 'A', 'N', 'D', 'I', 'D', 'A', 'T', 'E', '\020', '\003', ':', 'j', '\n', '\013', 'f', 'i', 'l',
+'e', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u',
+'f', '.', 'F', 'i', 'l', 'e', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001', '(', '\013', '2', '(', '.',
+'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F', 'i', 'l', 'e', 'S', 't',
+'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\n', 'f', 'i', 'l', 'e', 'S', 't', 'a', 't', 'u',
+'s', ':', 'v', '\n', '\016', 'm', 'e', 's', 's', 'a', 'g', 'e', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\037', '.', 'g', 'o', 'o',
+'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'O', 'p', 't', 'i', 'o',
+'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001', '(', '\013', '2', '+', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't',
+'i', 'o', 'n', 's', '.', 'v', '3', '.', 'M', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o',
+'t', 'a', 't', 'i', 'o', 'n', 'R', '\r', 'm', 'e', 's', 's', 'a', 'g', 'e', 'S', 't', 'a', 't', 'u', 's', ':', 'n', '\n', '\014',
+'f', 'i', 'e', 'l', 'd', '_', 's', 't', 'a', 't', 'u', 's', '\022', '\035', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'F', 'i', 'e', 'l', 'd', 'O', 'p', 't', 'i', 'o', 'n', 's', '\030', '\352', '\310', '\224', 'l', ' ', '\001',
+'(', '\013', '2', ')', '.', 'x', 'd', 's', '.', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '.', 'v', '3', '.', 'F',
+'i', 'e', 'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'A', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 'R', '\013', 'f', 'i', 'e',
+'l', 'd', 'S', 't', 'a', 't', 'u', 's', 'B', '+', 'Z', ')', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n',
+'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's',
+'/', 'v', '3', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[2] = {
+ &google_protobuf_descriptor_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init xds_annotations_v3_status_proto_upbdefinit = {
+ deps,
+ &xds_annotations_v3_status_proto_upb_file_layout,
+ "xds/annotations/v3/status.proto",
+ UPB_STRVIEW_INIT(descriptor, 936)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h
new file mode 100644
index 00000000000..03aefd222d3
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.h
@@ -0,0 +1,50 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/annotations/v3/status.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_
+#define XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *xds_annotations_v3_FileStatusAnnotation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "xds.annotations.v3.FileStatusAnnotation");
+}
+
+UPB_INLINE const upb_msgdef *xds_annotations_v3_MessageStatusAnnotation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "xds.annotations.v3.MessageStatusAnnotation");
+}
+
+UPB_INLINE const upb_msgdef *xds_annotations_v3_FieldStatusAnnotation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "xds.annotations.v3.FieldStatusAnnotation");
+}
+
+UPB_INLINE const upb_msgdef *xds_annotations_v3_StatusAnnotation_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &xds_annotations_v3_status_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "xds.annotations.v3.StatusAnnotation");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_ANNOTATIONS_V3_STATUS_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
index 699ae7d9968..7d0b1b01417 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
@@ -8,35 +8,31 @@
#include "upb/def.h"
#include "xds/core/v3/authority.upbdefs.h"
+#include "xds/core/v3/authority.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_Authority_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_Authority_msginit,
-};
-
-static const char descriptor[205] = {'\n', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p',
-'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a',
-'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '(',
-'\n', '\t', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t',
-'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', 'B', '7', '\n', '\033', 'c', 'o', 'm', '.', 'g', 'i',
-'t', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'A', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p',
-'r', 'o', 't', 'o', '3',
+static const char descriptor[238] = {'\n', '\033', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '.', 'p',
+'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n',
+'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o',
+'\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o',
+'\"', '(', '\n', '\t', 'A', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022', '\033', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\004', 'n', 'a', 'm', 'e', 'B', 'V', '\n', '\026', 'c', 'o', 'm', '.',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\016', 'A', 'u', 't', 'h', 'o',
+'r', 'i', 't', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c',
+'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244',
+'\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[3] = {
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
upb_def_init xds_core_v3_authority_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_authority_proto_upb_file_layout,
"xds/core/v3/authority.proto",
- UPB_STRVIEW_INIT(descriptor, 205)
+ UPB_STRVIEW_INIT(descriptor, 238)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
index 93d0581f8ea..bdca63a3785 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
@@ -8,47 +8,41 @@
#include "upb/def.h"
#include "xds/core/v3/collection_entry.upbdefs.h"
+#include "xds/core/v3/collection_entry.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
extern upb_def_init xds_core_v3_resource_locator_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_CollectionEntry_msginit;
-extern const upb_msglayout xds_core_v3_CollectionEntry_InlineEntry_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_CollectionEntry_msginit,
- &xds_core_v3_CollectionEntry_InlineEntry_msginit,
-};
-
-static const char descriptor[565] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_',
+static const char descriptor[598] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', '_',
'e', 'n', 't', 'r', 'y', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032',
'\031', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't',
-'o', '\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u',
-'s', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd',
-'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\303', '\002', '\n', '\017', 'C', 'o',
-'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '\022', '8', '\n', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\030',
-'\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u',
-'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'M', '\n', '\014',
-'i', 'n', 'l', 'i', 'n', 'e', '_', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd', 's', '.',
-'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '.', 'I',
-'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y',
-'\032', '\213', '\001', '\n', '\013', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', '\022', '0', '\n', '\004', 'n', 'a', 'm', 'e', '\030',
-'\001', ' ', '\001', '(', '\t', 'B', '\034', '\372', 'B', '\031', 'r', '\027', '2', '\025', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z',
-'_', '\\', '-', '\\', '.', '~', ':', ']', '+', '$', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 's', 'i',
-'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o',
-'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '\031', '\n', '\022', 'r', 'e', 's', 'o',
-'u', 'r', 'c', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '=', '\n', '\033', 'c', 'o',
-'m', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'B', '\024', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272',
-'\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'o', '\032', '\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a',
+'t', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o', 'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\303', '\002', '\n', '\017',
+'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', '\022', '8', '\n', '\007', 'l', 'o', 'c', 'a', 't', 'o',
+'r', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's',
+'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\007', 'l', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'M',
+'\n', '\014', 'i', 'n', 'l', 'i', 'n', 'e', '_', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2', '(', '.', 'x', 'd',
+'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y',
+'.', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', 'H', '\000', 'R', '\013', 'i', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't',
+'r', 'y', '\032', '\213', '\001', '\n', '\013', 'I', 'n', 'l', 'i', 'n', 'e', 'E', 'n', 't', 'r', 'y', '\022', '0', '\n', '\004', 'n', 'a', 'm',
+'e', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\034', '\372', 'B', '\031', 'r', '\027', '2', '\025', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A',
+'-', 'Z', '_', '\\', '-', '\\', '.', '~', ':', ']', '+', '$', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r',
+'s', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
+'t', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '\031', '\n', '\022', 'r', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', '\022', '\003', '\370', 'B', '\001', 'B', '\\', '\n', '\026',
+'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'C',
+'o', 'l', 'l', 'e', 'c', 't', 'i', 'o', 'n', 'E', 'n', 't', 'r', 'y', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i',
+'t', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/',
+'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[5] = {
&google_protobuf_any_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_resource_locator_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
@@ -56,7 +50,7 @@ static upb_def_init *deps[5] = {
upb_def_init xds_core_v3_collection_entry_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_collection_entry_proto_upb_file_layout,
"xds/core/v3/collection_entry.proto",
- UPB_STRVIEW_INIT(descriptor, 565)
+ UPB_STRVIEW_INIT(descriptor, 598)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
index 0c6584b0a43..44bf0384052 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c
@@ -8,38 +8,32 @@
#include "upb/def.h"
#include "xds/core/v3/context_params.upbdefs.h"
+#include "xds/core/v3/context_params.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ContextParams_msginit;
-extern const upb_msglayout xds_core_v3_ContextParams_ParamsEntry_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_ContextParams_msginit,
- &xds_core_v3_ContextParams_ParamsEntry_msginit,
-};
-
-static const char descriptor[288] = {'\n', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r',
-'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u',
-'d', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r',
-'o', 't', 'o', '\"', '\212', '\001', '\n', '\r', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '>', '\n', '\006',
-'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '.', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't',
-'r', 'y', 'R', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\032', '9', '\n', '\013', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't', 'r', 'y',
-'\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v', 'a', 'l',
-'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', ';', '\n', '\033', 'c', 'o',
-'m', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
-'B', '\022', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310',
-'\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
+static const char descriptor[321] = {'\n', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p', 'a', 'r',
+'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x',
+'d', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.',
+'p', 'r', 'o', 't', 'o', '\"', '\212', '\001', '\n', '\r', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '\022', '>',
+'\n', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\030', '\001', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', '.', 'P', 'a', 'r', 'a', 'm', 's', 'E',
+'n', 't', 'r', 'y', 'R', '\006', 'p', 'a', 'r', 'a', 'm', 's', '\032', '9', '\n', '\013', 'P', 'a', 'r', 'a', 'm', 's', 'E', 'n', 't',
+'r', 'y', '\022', '\020', '\n', '\003', 'k', 'e', 'y', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\003', 'k', 'e', 'y', '\022', '\024', '\n', '\005', 'v',
+'a', 'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\005', 'v', 'a', 'l', 'u', 'e', ':', '\002', '8', '\001', 'B', 'Z', '\n', '\026',
+'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\022', 'C',
+'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h',
+'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o',
+'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[2] = {
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
NULL
};
upb_def_init xds_core_v3_context_params_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_context_params_proto_upb_file_layout,
"xds/core/v3/context_params.proto",
- UPB_STRVIEW_INIT(descriptor, 288)
+ UPB_STRVIEW_INIT(descriptor, 321)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
index d299981d283..30cb324cdea 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c
@@ -8,42 +8,38 @@
#include "upb/def.h"
#include "xds/core/v3/resource.upbdefs.h"
+#include "xds/core/v3/resource.upb.h"
extern upb_def_init google_protobuf_any_proto_upbdefinit;
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
extern upb_def_init xds_core_v3_resource_name_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_Resource_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_Resource_msginit,
-};
-
-static const char descriptor[332] = {'\n', '\032', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r',
+static const char descriptor[365] = {'\n', '\032', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '.', 'p', 'r',
'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\031', 'g', 'o', 'o', 'g', 'l', 'e', '/',
-'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\035', 'u', 'd', 'p', 'a', '/',
-'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't', 'o', '\032',
-'\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a', 'm',
-'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\205', '\001', '\n', '\010', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', '\022', '-', '\n', '\004', 'n',
-'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e', 'r', 's',
-'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r', 'e', 's',
-'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't',
-'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', '6', '\n', '\033', 'c', 'o', 'm',
-'.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
-'\r', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b',
-'\006', 'p', 'r', 'o', 't', 'o', '3',
+'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'a', 'n', 'y', '.', 'p', 'r', 'o', 't', 'o', '\032', '\037', 'x', 'd', 's', '/', 'a',
+'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o', 't',
+'o', '\032', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n',
+'a', 'm', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\205', '\001', '\n', '\010', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', '\022', '-', '\n',
+'\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\031', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '\030', '\n', '\007', 'v', 'e',
+'r', 's', 'i', 'o', 'n', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\007', 'v', 'e', 'r', 's', 'i', 'o', 'n', '\022', '0', '\n', '\010', 'r',
+'e', 's', 'o', 'u', 'r', 'c', 'e', '\030', '\003', ' ', '\001', '(', '\013', '2', '\024', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r',
+'o', 't', 'o', 'b', 'u', 'f', '.', 'A', 'n', 'y', 'R', '\010', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'B', 'U', '\n', '\026', 'c',
+'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\r', 'R', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm',
+'/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322',
+'\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[4] = {
&google_protobuf_any_proto_upbdefinit,
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_resource_name_proto_upbdefinit,
NULL
};
upb_def_init xds_core_v3_resource_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_proto_upb_file_layout,
"xds/core/v3/resource.proto",
- UPB_STRVIEW_INIT(descriptor, 332)
+ UPB_STRVIEW_INIT(descriptor, 365)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
index fefa5a28cbf..1b6842c8450 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c
@@ -8,52 +8,46 @@
#include "upb/def.h"
#include "xds/core/v3/resource_locator.upbdefs.h"
+#include "xds/core/v3/resource_locator.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_msginit;
-extern const upb_msglayout xds_core_v3_ResourceLocator_Directive_msginit;
-
-static const upb_msglayout *layouts[2] = {
- &xds_core_v3_ResourceLocator_msginit,
- &xds_core_v3_ResourceLocator_Directive_msginit,
-};
-
-static const char descriptor[739] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o',
+static const char descriptor[772] = {'\n', '\"', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'l', 'o',
'c', 'a', 't', 'o', 'r', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032',
-'\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.',
-'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x',
-'t', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/',
-'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\216', '\004', '\n', '\017', 'R', 'e', 's', 'o', 'u', 'r',
-'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'E', '\n', '\006', 's', 'c', 'h', 'e', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\016',
-'2', '#', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o',
-'c', 'a', 't', 'o', 'r', '.', 'S', 'c', 'h', 'e', 'm', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R', '\006', 's',
-'c', 'h', 'e', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t',
-'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't',
-'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(', '\t', 'B',
-'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', 'A', '\n',
-'\r', 'e', 'x', 'a', 'c', 't', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd',
-'s', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'H', '\000',
-'R', '\014', 'e', 'x', 'a', 'c', 't', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'F', '\n', '\n', 'd', 'i', 'r', 'e', 'c', 't', 'i',
-'v', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R',
-'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 'R',
-'\n', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 's', '\032', '\210', '\001', '\n', '\t', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e',
-'\022', '0', '\n', '\003', 'a', 'l', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.',
-'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\003', 'a', 'l', 't',
-'\022', '7', '\n', '\005', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\037', '\372', 'B', '\034', 'r', '\032', '\020', '\001', '2',
-'\026', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z', '_', '\\', '-', '\\', '.', '/', '~', ':', ']', '+', '$', 'H', '\000',
-'R', '\005', 'e', 'n', 't', 'r', 'y', 'B', '\020', '\n', '\t', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', '\022', '\003', '\370', 'B', '\001',
-'\"', '\'', '\n', '\006', 'S', 'c', 'h', 'e', 'm', 'e', '\022', '\t', '\n', '\005', 'X', 'D', 'S', 'T', 'P', '\020', '\000', '\022', '\010', '\n', '\004',
-'H', 'T', 'T', 'P', '\020', '\001', '\022', '\010', '\n', '\004', 'F', 'I', 'L', 'E', '\020', '\002', 'B', '\031', '\n', '\027', 'c', 'o', 'n', 't', 'e',
-'x', 't', '_', 'p', 'a', 'r', 'a', 'm', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '=', '\n', '\033', 'c', 'o', 'm',
-'.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B',
-'\024', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200',
-'\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+'\037', 'x', 'd', 's', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u',
+'s', '.', 'p', 'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't',
+'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't',
+'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\216', '\004', '\n', '\017', 'R', 'e', 's', 'o',
+'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '\022', 'E', '\n', '\006', 's', 'c', 'h', 'e', 'm', 'e', '\030', '\001', ' ', '\001',
+'(', '\016', '2', '#', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e',
+'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'S', 'c', 'h', 'e', 'm', 'e', 'B', '\010', '\372', 'B', '\005', '\202', '\001', '\002', '\020', '\001', 'R',
+'\006', 's', 'c', 'h', 'e', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034',
+'\n', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\003', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r',
+'i', 't', 'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\004', ' ', '\001', '(',
+'\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022',
+'A', '\n', '\r', 'e', 'x', 'a', 'c', 't', '_', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\005', ' ', '\001', '(', '\013', '2', '\032', '.',
+'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's',
+'H', '\000', 'R', '\014', 'e', 'x', 'a', 'c', 't', 'C', 'o', 'n', 't', 'e', 'x', 't', '\022', 'F', '\n', '\n', 'd', 'i', 'r', 'e', 'c',
+'t', 'i', 'v', 'e', 's', '\030', '\006', ' ', '\003', '(', '\013', '2', '&', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3',
+'.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', '.', 'D', 'i', 'r', 'e', 'c', 't', 'i', 'v',
+'e', 'R', '\n', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', 's', '\032', '\210', '\001', '\n', '\t', 'D', 'i', 'r', 'e', 'c', 't', 'i',
+'v', 'e', '\022', '0', '\n', '\003', 'a', 'l', 't', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'x', 'd', 's', '.', 'c', 'o', 'r',
+'e', '.', 'v', '3', '.', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'H', '\000', 'R', '\003', 'a',
+'l', 't', '\022', '7', '\n', '\005', 'e', 'n', 't', 'r', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\037', '\372', 'B', '\034', 'r', '\032', '\020',
+'\001', '2', '\026', '^', '[', '0', '-', '9', 'a', '-', 'z', 'A', '-', 'Z', '_', '\\', '-', '\\', '.', '/', '~', ':', ']', '+', '$',
+'H', '\000', 'R', '\005', 'e', 'n', 't', 'r', 'y', 'B', '\020', '\n', '\t', 'd', 'i', 'r', 'e', 'c', 't', 'i', 'v', 'e', '\022', '\003', '\370',
+'B', '\001', '\"', '\'', '\n', '\006', 'S', 'c', 'h', 'e', 'm', 'e', '\022', '\t', '\n', '\005', 'X', 'D', 'S', 'T', 'P', '\020', '\000', '\022', '\010',
+'\n', '\004', 'H', 'T', 'T', 'P', '\020', '\001', '\022', '\010', '\n', '\004', 'F', 'I', 'L', 'E', '\020', '\002', 'B', '\031', '\n', '\027', 'c', 'o', 'n',
+'t', 'e', 'x', 't', '_', 'p', 'a', 'r', 'a', 'm', '_', 's', 'p', 'e', 'c', 'i', 'f', 'i', 'e', 'r', 'B', '\\', '\n', '\026', 'c',
+'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', 'B', '\024', 'R', 'e',
+'s', 'o', 'u', 'r', 'c', 'e', 'L', 'o', 'c', 'a', 't', 'o', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 'c',
+'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[4] = {
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_context_params_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
@@ -61,7 +55,7 @@ static upb_def_init *deps[4] = {
upb_def_init xds_core_v3_resource_locator_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_locator_proto_upb_file_layout,
"xds/core/v3/resource_locator.proto",
- UPB_STRVIEW_INIT(descriptor, 739)
+ UPB_STRVIEW_INIT(descriptor, 772)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
index 7b27e3dbb10..719d0cefc43 100644
--- a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c
@@ -8,35 +8,31 @@
#include "upb/def.h"
#include "xds/core/v3/resource_name.upbdefs.h"
+#include "xds/core/v3/resource_name.upb.h"
-extern upb_def_init udpa_annotations_status_proto_upbdefinit;
+extern upb_def_init xds_annotations_v3_status_proto_upbdefinit;
extern upb_def_init xds_core_v3_context_params_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
-extern const upb_msglayout xds_core_v3_ResourceName_msginit;
-
-static const upb_msglayout *layouts[1] = {
- &xds_core_v3_ResourceName_msginit,
-};
-
-static const char descriptor[367] = {'\n', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a',
-'m', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\035', 'u', 'd',
-'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p', 'r', 'o',
-'t', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't', '_', 'p',
-'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l',
-'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\240', '\001', '\n', '\014', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N',
-'a', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t', 'a', 'u',
-'t', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\022',
-',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'B', '\007', '\372',
-'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n', '\007', 'c',
-'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v',
-'3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\007', 'c', 'o', 'n', 't', 'e', 'x', 't', 'B',
-':', '\n', '\033', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'x', 'd', 's', '.', 'c', 'o',
-'r', 'e', '.', 'v', '3', 'B', '\021', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'P', 'r', 'o', 't', 'o', 'P',
-'\001', '\272', '\200', '\310', '\321', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
+static const char descriptor[400] = {'\n', '\037', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 'n', 'a',
+'m', 'e', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '\032', '\037', 'x', 'd',
+'s', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', '3', '/', 's', 't', 'a', 't', 'u', 's', '.', 'p',
+'r', 'o', 't', 'o', '\032', ' ', 'x', 'd', 's', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'c', 'o', 'n', 't', 'e', 'x', 't',
+'_', 'p', 'a', 'r', 'a', 'm', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v',
+'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\"', '\240', '\001', '\n', '\014', 'R', 'e', 's', 'o', 'u', 'r', 'c',
+'e', 'N', 'a', 'm', 'e', '\022', '\016', '\n', '\002', 'i', 'd', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\002', 'i', 'd', '\022', '\034', '\n', '\t',
+'a', 'u', 't', 'h', 'o', 'r', 'i', 't', 'y', '\030', '\002', ' ', '\001', '(', '\t', 'R', '\t', 'a', 'u', 't', 'h', 'o', 'r', 'i', 't',
+'y', '\022', ',', '\n', '\r', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', '_', 't', 'y', 'p', 'e', '\030', '\003', ' ', '\001', '(', '\t', 'B',
+'\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\014', 'r', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'T', 'y', 'p', 'e', '\022', '4', '\n',
+'\007', 'c', 'o', 'n', 't', 'e', 'x', 't', '\030', '\004', ' ', '\001', '(', '\013', '2', '\032', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e',
+'.', 'v', '3', '.', 'C', 'o', 'n', 't', 'e', 'x', 't', 'P', 'a', 'r', 'a', 'm', 's', 'R', '\007', 'c', 'o', 'n', 't', 'e', 'x',
+'t', 'B', 'Y', '\n', '\026', 'c', 'o', 'm', '.', 'g', 'i', 't', 'h', 'u', 'b', '.', 'x', 'd', 's', '.', 'c', 'o', 'r', 'e', '.',
+'v', '3', 'B', '\021', 'R', 'e', 's', 'o', 'u', 'r', 'c', 'e', 'N', 'a', 'm', 'e', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"',
+'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n', 'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd',
+'s', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '\322', '\306', '\244', '\341', '\006', '\002', '\010', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[4] = {
- &udpa_annotations_status_proto_upbdefinit,
+ &xds_annotations_v3_status_proto_upbdefinit,
&xds_core_v3_context_params_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
@@ -44,7 +40,7 @@ static upb_def_init *deps[4] = {
upb_def_init xds_core_v3_resource_name_proto_upbdefinit = {
deps,
- layouts,
+ &xds_core_v3_resource_name_proto_upb_file_layout,
"xds/core/v3/resource_name.proto",
- UPB_STRVIEW_INIT(descriptor, 367)
+ UPB_STRVIEW_INIT(descriptor, 400)
};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
new file mode 100644
index 00000000000..3fe19c3e7f5
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c
@@ -0,0 +1,40 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#include "upb/def.h"
+#include "xds/type/v3/typed_struct.upbdefs.h"
+#include "xds/type/v3/typed_struct.upb.h"
+
+extern upb_def_init validate_validate_proto_upbdefinit;
+extern upb_def_init google_protobuf_struct_proto_upbdefinit;
+static const char descriptor[279] = {'\n', '\036', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'v', '3', '/', 't', 'y', 'p', 'e', 'd', '_', 's', 't', 'r', 'u', 'c',
+'t', '.', 'p', 'r', 'o', 't', 'o', '\022', '\013', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'v', '3', '\032', '\027', 'v', 'a', 'l',
+'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g', 'o', 'o',
+'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o', 't', 'o',
+'\"', 'W', '\n', '\013', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e', '_', 'u',
+'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '-', '\n', '\005', 'v', 'a', 'l', 'u',
+'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f',
+'.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'B', 'P', '\n', '\026', 'c', 'o', 'm', '.', 'g', 'i', 't',
+'h', 'u', 'b', '.', 'x', 'd', 's', '.', 't', 'y', 'p', 'e', '.', 'v', '3', 'B', '\020', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r',
+'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', '\"', 'g', 'i', 't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'c', 'n',
+'c', 'f', '/', 'x', 'd', 's', '/', 'g', 'o', '/', 'x', 'd', 's', '/', 't', 'y', 'p', 'e', '/', 'v', '3', 'b', '\006', 'p', 'r',
+'o', 't', 'o', '3',
+};
+
+static upb_def_init *deps[3] = {
+ &validate_validate_proto_upbdefinit,
+ &google_protobuf_struct_proto_upbdefinit,
+ NULL
+};
+
+upb_def_init xds_type_v3_typed_struct_proto_upbdefinit = {
+ deps,
+ &xds_type_v3_typed_struct_proto_upb_file_layout,
+ "xds/type/v3/typed_struct.proto",
+ UPB_STRVIEW_INIT(descriptor, 279)
+};
diff --git a/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
new file mode 100644
index 00000000000..ac43a97645e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.h
@@ -0,0 +1,35 @@
+/* This file was generated by upbc (the upb compiler) from the input
+ * file:
+ *
+ * xds/type/v3/typed_struct.proto
+ *
+ * Do not edit -- your changes will be discarded when the file is
+ * regenerated. */
+
+#ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_
+#define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_
+
+#include "upb/def.h"
+#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "upb/def.h"
+
+#include "upb/port_def.inc"
+
+extern upb_def_init xds_type_v3_typed_struct_proto_upbdefinit;
+
+UPB_INLINE const upb_msgdef *xds_type_v3_TypedStruct_getmsgdef(upb_symtab *s) {
+ _upb_symtab_loaddefinit(s, &xds_type_v3_typed_struct_proto_upbdefinit);
+ return upb_symtab_lookupmsg(s, "xds.type.v3.TypedStruct");
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPBDEFS_H_ */
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
index af9085929c5..90b937b29ad 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_factory.h
@@ -49,7 +49,7 @@ class CertificateProviderFactory {
virtual const char* name() const = 0;
virtual RefCountedPtr<Config> CreateCertificateProviderConfig(
- const Json& config_json, grpc_error** error) = 0;
+ const Json& config_json, grpc_error_handle* error) = 0;
// Create a CertificateProvider instance from config.
virtual RefCountedPtr<grpc_tls_certificate_provider>
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
index ae972ba644a..16e766b9154 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_registry.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/container/inlined_vector.h"
-
#include "src/core/ext/xds/certificate_provider_registry.h"
+#include "y_absl/container/inlined_vector.h"
+
namespace grpc_core {
namespace {
@@ -58,7 +58,7 @@ class RegistryState {
factories_;
};
-static RegistryState* g_state = nullptr;
+RegistryState* g_state = nullptr;
} // namespace
diff --git a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.h b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.h
index d374e982804..e941f9a40a0 100644
--- a/contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.h
+++ b/contrib/libs/grpc/src/core/ext/xds/certificate_provider_store.h
@@ -74,7 +74,7 @@ class CertificateProviderStore
store_->ReleaseCertificateProvider(key_, this);
}
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor()
const override {
return certificate_provider_->distributor();
}
@@ -92,7 +92,7 @@ class CertificateProviderStore
};
RefCountedPtr<CertificateProviderWrapper> CreateCertificateProviderLocked(
- y_absl::string_view key);
+ y_absl::string_view key) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
// Releases a previously created certificate provider from the certificate
// provider map if the value matches \a wrapper.
@@ -101,10 +101,10 @@ class CertificateProviderStore
Mutex mu_;
// Map of plugin configurations
- PluginDefinitionMap plugin_config_map_;
+ const PluginDefinitionMap plugin_config_map_;
// Underlying map for the providers.
std::map<y_absl::string_view, CertificateProviderWrapper*>
- certificate_providers_map_;
+ certificate_providers_map_ Y_ABSL_GUARDED_BY(mu_);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc b/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
index a10cfd261a7..ea2c35f7101 100644
--- a/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.cc
@@ -64,14 +64,14 @@ TString FileWatcherCertificateProviderFactory::Config::ToString() const {
RefCountedPtr<FileWatcherCertificateProviderFactory::Config>
FileWatcherCertificateProviderFactory::Config::Parse(const Json& config_json,
- grpc_error** error) {
+ grpc_error_handle* error) {
auto config = MakeRefCounted<FileWatcherCertificateProviderFactory::Config>();
if (config_json.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"error:config type should be OBJECT.");
return nullptr;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
ParseJsonObjectField(config_json.object_value(), "certificate_file",
&config->identity_cert_file_, &error_list, false);
ParseJsonObjectField(config_json.object_value(), "private_key_file",
@@ -112,7 +112,7 @@ const char* FileWatcherCertificateProviderFactory::name() const {
RefCountedPtr<CertificateProviderFactory::Config>
FileWatcherCertificateProviderFactory::CreateCertificateProviderConfig(
- const Json& config_json, grpc_error** error) {
+ const Json& config_json, grpc_error_handle* error) {
return FileWatcherCertificateProviderFactory::Config::Parse(config_json,
error);
}
diff --git a/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h b/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
index 1d636f118c0..21e91034ba5 100644
--- a/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
+++ b/contrib/libs/grpc/src/core/ext/xds/file_watcher_certificate_provider_factory.h
@@ -31,7 +31,7 @@ class FileWatcherCertificateProviderFactory
class Config : public CertificateProviderFactory::Config {
public:
static RefCountedPtr<Config> Parse(const Json& config_json,
- grpc_error** error);
+ grpc_error_handle* error);
const char* name() const override;
@@ -58,7 +58,7 @@ class FileWatcherCertificateProviderFactory
RefCountedPtr<CertificateProviderFactory::Config>
CreateCertificateProviderConfig(const Json& config_json,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
RefCountedPtr<grpc_tls_certificate_provider> CreateCertificateProvider(
RefCountedPtr<CertificateProviderFactory::Config> config) override;
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_api.cc b/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
index b314f2ce2f1..5420644ed90 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_api.cc
@@ -1,23 +1,23 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
+#include "src/core/ext/xds/xds_api.h"
+
#include <algorithm>
#include <cctype>
#include <cstdint>
@@ -80,25 +80,25 @@
#include "google/protobuf/timestamp.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "google/rpc/status.upb.h"
-#include "udpa/type/v1/typed_struct.upb.h"
#include "upb/text_encode.h"
#include "upb/upb.h"
#include "upb/upb.hpp"
+#include "xds/type/v3/typed_struct.upb.h"
#include <grpc/impl/codegen/log.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include "src/core/ext/xds/xds_api.h"
+#include "src/core/ext/xds/xds_routing.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/slice/slice_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
@@ -115,33 +115,58 @@ bool XdsAggregateAndLogicalDnsClusterEnabled() {
return parse_succeeded && parsed_value;
}
-// TODO(donnadionne): Check to see if ring hash policy is enabled, this will be
-// removed once ring hash policy is fully integration-tested and enabled by
-// default.
-bool XdsRingHashEnabled() {
- char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH");
+// TODO(yashykt): Remove once RBAC is no longer experimental
+bool XdsRbacEnabled() {
+ char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_RBAC");
bool parsed_value;
bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
gpr_free(value);
return parse_succeeded && parsed_value;
}
-// TODO(yashykt): Check to see if xDS security is enabled. This will be
-// removed once this feature is fully integration-tested and enabled by
-// default.
-bool XdsSecurityEnabled() {
- char* value = gpr_getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT");
- bool parsed_value;
- bool parse_succeeded = gpr_parse_bool_value(value, &parsed_value);
- gpr_free(value);
- return parse_succeeded && parsed_value;
+//
+// XdsApi::RetryPolicy
+//
+
+TString XdsApi::RetryPolicy::RetryBackOff::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(
+ y_absl::StrCat("RetryBackOff Base: ", base_interval.ToString()));
+ contents.push_back(
+ y_absl::StrCat("RetryBackOff max: ", max_interval.ToString()));
+ return y_absl::StrJoin(contents, ",");
+}
+
+TString XdsApi::RetryPolicy::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(y_absl::StrFormat("num_retries=%d", num_retries));
+ contents.push_back(retry_back_off.ToString());
+ return y_absl::StrCat("{", y_absl::StrJoin(contents, ","), "}");
+}
+
+//
+// XdsApi::Route::Matchers
+//
+
+TString XdsApi::Route::Matchers::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(
+ y_absl::StrFormat("PathMatcher{%s}", path_matcher.ToString()));
+ for (const HeaderMatcher& header_matcher : header_matchers) {
+ contents.push_back(header_matcher.ToString());
+ }
+ if (fraction_per_million.has_value()) {
+ contents.push_back(y_absl::StrFormat("Fraction Per Million %d",
+ fraction_per_million.value()));
+ }
+ return y_absl::StrJoin(contents, "\n");
}
//
-// XdsApi::Route::HashPolicy
+// XdsApi::Route::RouteAction::HashPolicy
//
-XdsApi::Route::HashPolicy::HashPolicy(const HashPolicy& other)
+XdsApi::Route::RouteAction::HashPolicy::HashPolicy(const HashPolicy& other)
: type(other.type),
header_name(other.header_name),
regex_substitution(other.regex_substitution) {
@@ -151,8 +176,8 @@ XdsApi::Route::HashPolicy::HashPolicy(const HashPolicy& other)
}
}
-XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
- const HashPolicy& other) {
+XdsApi::Route::RouteAction::HashPolicy&
+XdsApi::Route::RouteAction::HashPolicy::operator=(const HashPolicy& other) {
type = other.type;
header_name = other.header_name;
if (other.regex != nullptr) {
@@ -163,14 +188,14 @@ XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
return *this;
}
-XdsApi::Route::HashPolicy::HashPolicy(HashPolicy&& other) noexcept
+XdsApi::Route::RouteAction::HashPolicy::HashPolicy(HashPolicy&& other) noexcept
: type(other.type),
header_name(std::move(other.header_name)),
regex(std::move(other.regex)),
regex_substitution(std::move(other.regex_substitution)) {}
-XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
- HashPolicy&& other) noexcept {
+XdsApi::Route::RouteAction::HashPolicy&
+XdsApi::Route::RouteAction::HashPolicy::operator=(HashPolicy&& other) noexcept {
type = other.type;
header_name = std::move(other.header_name);
regex = std::move(other.regex);
@@ -178,7 +203,7 @@ XdsApi::Route::HashPolicy& XdsApi::Route::HashPolicy::operator=(
return *this;
}
-bool XdsApi::Route::HashPolicy::HashPolicy::operator==(
+bool XdsApi::Route::RouteAction::HashPolicy::HashPolicy::operator==(
const HashPolicy& other) const {
if (type != other.type) return false;
if (type == Type::HEADER) {
@@ -194,7 +219,7 @@ bool XdsApi::Route::HashPolicy::HashPolicy::operator==(
return true;
}
-TString XdsApi::Route::HashPolicy::ToString() const {
+TString XdsApi::Route::RouteAction::HashPolicy::ToString() const {
std::vector<TString> contents;
switch (type) {
case Type::HEADER:
@@ -215,24 +240,10 @@ TString XdsApi::Route::HashPolicy::ToString() const {
}
//
-// XdsApi::Route
+// XdsApi::Route::RouteAction::ClusterWeight
//
-TString XdsApi::Route::Matchers::ToString() const {
- std::vector<TString> contents;
- contents.push_back(
- y_absl::StrFormat("PathMatcher{%s}", path_matcher.ToString()));
- for (const HeaderMatcher& header_matcher : header_matchers) {
- contents.push_back(header_matcher.ToString());
- }
- if (fraction_per_million.has_value()) {
- contents.push_back(y_absl::StrFormat("Fraction Per Million %d",
- fraction_per_million.value()));
- }
- return y_absl::StrJoin(contents, "\n");
-}
-
-TString XdsApi::Route::ClusterWeight::ToString() const {
+TString XdsApi::Route::RouteAction::ClusterWeight::ToString() const {
std::vector<TString> contents;
contents.push_back(y_absl::StrCat("cluster=", name));
contents.push_back(y_absl::StrCat("weight=", weight));
@@ -249,12 +260,18 @@ TString XdsApi::Route::ClusterWeight::ToString() const {
return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
}
-TString XdsApi::Route::ToString() const {
+//
+// XdsApi::Route::RouteAction
+//
+
+TString XdsApi::Route::RouteAction::ToString() const {
std::vector<TString> contents;
- contents.push_back(matchers.ToString());
for (const HashPolicy& hash_policy : hash_policies) {
contents.push_back(y_absl::StrCat("hash_policy=", hash_policy.ToString()));
}
+ if (retry_policy.has_value()) {
+ contents.push_back(y_absl::StrCat("retry_policy=", retry_policy->ToString()));
+ }
if (!cluster_name.empty()) {
contents.push_back(y_absl::StrFormat("Cluster name: %s", cluster_name));
}
@@ -264,6 +281,25 @@ TString XdsApi::Route::ToString() const {
if (max_stream_duration.has_value()) {
contents.push_back(max_stream_duration->ToString());
}
+ return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
+}
+
+//
+// XdsApi::Route
+//
+
+TString XdsApi::Route::ToString() const {
+ std::vector<TString> contents;
+ contents.push_back(matchers.ToString());
+ auto* route_action = y_absl::get_if<XdsApi::Route::RouteAction>(&action);
+ if (route_action != nullptr) {
+ contents.push_back(y_absl::StrCat("route=", route_action->ToString()));
+ } else if (y_absl::holds_alternative<XdsApi::Route::NonForwardingAction>(
+ action)) {
+ contents.push_back("non_forwarding_action={}");
+ } else {
+ contents.push_back("unknown_action={}");
+ }
if (!typed_per_filter_config.empty()) {
contents.push_back("typed_per_filter_config={");
for (const auto& p : typed_per_filter_config) {
@@ -308,104 +344,6 @@ TString XdsApi::RdsUpdate::ToString() const {
return y_absl::StrJoin(vhosts, "");
}
-namespace {
-
-// Better match type has smaller value.
-enum MatchType {
- EXACT_MATCH,
- SUFFIX_MATCH,
- PREFIX_MATCH,
- UNIVERSE_MATCH,
- INVALID_MATCH,
-};
-
-// Returns true if match succeeds.
-bool DomainMatch(MatchType match_type, const TString& domain_pattern_in,
- const TString& expected_host_name_in) {
- // Normalize the args to lower-case. Domain matching is case-insensitive.
- TString domain_pattern = domain_pattern_in;
- TString expected_host_name = expected_host_name_in;
- std::transform(domain_pattern.cbegin(), domain_pattern.cend(),
- domain_pattern.begin(),
- [](unsigned char c) { return std::tolower(c); });
- std::transform(expected_host_name.cbegin(), expected_host_name.cend(),
- expected_host_name.begin(),
- [](unsigned char c) { return std::tolower(c); });
- if (match_type == EXACT_MATCH) {
- return domain_pattern == expected_host_name;
- } else if (match_type == SUFFIX_MATCH) {
- // Asterisk must match at least one char.
- if (expected_host_name.size() < domain_pattern.size()) return false;
- y_absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
- y_absl::string_view host_suffix(expected_host_name.c_str() +
- expected_host_name.size() -
- pattern_suffix.size());
- return pattern_suffix == host_suffix;
- } else if (match_type == PREFIX_MATCH) {
- // Asterisk must match at least one char.
- if (expected_host_name.size() < domain_pattern.size()) return false;
- y_absl::string_view pattern_prefix(domain_pattern.c_str(),
- domain_pattern.size() - 1);
- y_absl::string_view host_prefix(expected_host_name.c_str(),
- pattern_prefix.size());
- return pattern_prefix == host_prefix;
- } else {
- return match_type == UNIVERSE_MATCH;
- }
-}
-
-MatchType DomainPatternMatchType(const TString& domain_pattern) {
- if (domain_pattern.empty()) return INVALID_MATCH;
- if (domain_pattern.find('*') == TString::npos) return EXACT_MATCH;
- if (domain_pattern == "*") return UNIVERSE_MATCH;
- if (domain_pattern[0] == '*') return SUFFIX_MATCH;
- if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH;
- return INVALID_MATCH;
-}
-
-} // namespace
-
-XdsApi::RdsUpdate::VirtualHost* XdsApi::RdsUpdate::FindVirtualHostForDomain(
- const TString& domain) {
- // Find the best matched virtual host.
- // The search order for 4 groups of domain patterns:
- // 1. Exact match.
- // 2. Suffix match (e.g., "*ABC").
- // 3. Prefix match (e.g., "ABC*").
- // 4. Universe match (i.e., "*").
- // Within each group, longest match wins.
- // If the same best matched domain pattern appears in multiple virtual hosts,
- // the first matched virtual host wins.
- VirtualHost* target_vhost = nullptr;
- MatchType best_match_type = INVALID_MATCH;
- size_t longest_match = 0;
- // Check each domain pattern in each virtual host to determine the best
- // matched virtual host.
- for (VirtualHost& vhost : virtual_hosts) {
- for (const TString& domain_pattern : vhost.domains) {
- // Check the match type first. Skip the pattern if it's not better than
- // current match.
- const MatchType match_type = DomainPatternMatchType(domain_pattern);
- // This should be caught by RouteConfigParse().
- GPR_ASSERT(match_type != INVALID_MATCH);
- if (match_type > best_match_type) continue;
- if (match_type == best_match_type &&
- domain_pattern.size() <= longest_match) {
- continue;
- }
- // Skip if match fails.
- if (!DomainMatch(match_type, domain_pattern, domain)) continue;
- // Choose this match.
- target_vhost = &vhost;
- best_match_type = match_type;
- longest_match = domain_pattern.size();
- if (best_match_type == EXACT_MATCH) break;
- }
- if (best_match_type == EXACT_MATCH) break;
- }
- return target_vhost;
-}
-
//
// XdsApi::CommonTlsContext::CertificateValidationContext
//
@@ -425,11 +363,11 @@ bool XdsApi::CommonTlsContext::CertificateValidationContext::Empty() const {
}
//
-// XdsApi::CommonTlsContext::CertificateValidationContext
+// XdsApi::CommonTlsContext::CertificateProviderPluginInstance
//
-TString XdsApi::CommonTlsContext::CertificateProviderInstance::ToString()
- const {
+TString
+XdsApi::CommonTlsContext::CertificateProviderPluginInstance::ToString() const {
y_absl::InlinedVector<TString, 2> contents;
if (!instance_name.empty()) {
contents.push_back(y_absl::StrFormat("instance_name=%s", instance_name));
@@ -441,34 +379,9 @@ TString XdsApi::CommonTlsContext::CertificateProviderInstance::ToString()
return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
}
-bool XdsApi::CommonTlsContext::CertificateProviderInstance::Empty() const {
- return instance_name.empty() && certificate_name.empty();
-}
-
-//
-// XdsApi::CommonTlsContext::CombinedCertificateValidationContext
-//
-
-TString
-XdsApi::CommonTlsContext::CombinedCertificateValidationContext::ToString()
+bool XdsApi::CommonTlsContext::CertificateProviderPluginInstance::Empty()
const {
- y_absl::InlinedVector<TString, 2> contents;
- if (!default_validation_context.Empty()) {
- contents.push_back(y_absl::StrFormat("default_validation_context=%s",
- default_validation_context.ToString()));
- }
- if (!validation_context_certificate_provider_instance.Empty()) {
- contents.push_back(y_absl::StrFormat(
- "validation_context_certificate_provider_instance=%s",
- validation_context_certificate_provider_instance.ToString()));
- }
- return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
-}
-
-bool XdsApi::CommonTlsContext::CombinedCertificateValidationContext::Empty()
- const {
- return default_validation_context.Empty() &&
- validation_context_certificate_provider_instance.Empty();
+ return instance_name.empty() && certificate_name.empty();
}
//
@@ -477,21 +390,22 @@ bool XdsApi::CommonTlsContext::CombinedCertificateValidationContext::Empty()
TString XdsApi::CommonTlsContext::ToString() const {
y_absl::InlinedVector<TString, 2> contents;
- if (!tls_certificate_certificate_provider_instance.Empty()) {
- contents.push_back(y_absl::StrFormat(
- "tls_certificate_certificate_provider_instance=%s",
- tls_certificate_certificate_provider_instance.ToString()));
+ if (!tls_certificate_provider_instance.Empty()) {
+ contents.push_back(
+ y_absl::StrFormat("tls_certificate_provider_instance=%s",
+ tls_certificate_provider_instance.ToString()));
}
- if (!combined_validation_context.Empty()) {
- contents.push_back(y_absl::StrFormat("combined_validation_context=%s",
- combined_validation_context.ToString()));
+ if (!certificate_validation_context.Empty()) {
+ contents.push_back(
+ y_absl::StrFormat("certificate_validation_context=%s",
+ certificate_validation_context.ToString()));
}
return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
}
bool XdsApi::CommonTlsContext::Empty() const {
- return tls_certificate_certificate_provider_instance.Empty() &&
- combined_validation_context.Empty();
+ return tls_certificate_provider_instance.Empty() &&
+ certificate_validation_context.Empty();
}
//
@@ -697,10 +611,24 @@ TString XdsApi::LdsUpdate::ToString() const {
//
TString XdsApi::CdsUpdate::ToString() const {
- y_absl::InlinedVector<TString, 4> contents;
- if (!eds_service_name.empty()) {
- contents.push_back(
- y_absl::StrFormat("eds_service_name=%s", eds_service_name));
+ y_absl::InlinedVector<TString, 8> contents;
+ switch (cluster_type) {
+ case EDS:
+ contents.push_back("cluster_type=EDS");
+ if (!eds_service_name.empty()) {
+ contents.push_back(
+ y_absl::StrFormat("eds_service_name=%s", eds_service_name));
+ }
+ break;
+ case LOGICAL_DNS:
+ contents.push_back("cluster_type=LOGICAL_DNS");
+ contents.push_back(y_absl::StrFormat("dns_hostname=%s", dns_hostname));
+ break;
+ case AGGREGATE:
+ contents.push_back("cluster_type=AGGREGATE");
+ contents.push_back(
+ y_absl::StrFormat("prioritized_cluster_names=[%s]",
+ y_absl::StrJoin(prioritized_cluster_names, ", ")));
}
if (!common_tls_context.Empty()) {
contents.push_back(y_absl::StrFormat("common_tls_context=%s",
@@ -710,6 +638,11 @@ TString XdsApi::CdsUpdate::ToString() const {
contents.push_back(y_absl::StrFormat("lrs_load_reporting_server_name=%s",
lrs_load_reporting_server_name.value()));
}
+ contents.push_back(y_absl::StrCat("lb_policy=", lb_policy));
+ if (lb_policy == "RING_HASH") {
+ contents.push_back(y_absl::StrCat("min_ring_size=", min_ring_size));
+ contents.push_back(y_absl::StrCat("max_ring_size=", max_ring_size));
+ }
contents.push_back(
y_absl::StrFormat("max_concurrent_requests=%d", max_concurrent_requests));
return y_absl::StrCat("{", y_absl::StrJoin(contents, ", "), "}");
@@ -789,25 +722,22 @@ TString XdsApi::EdsUpdate::ToString() const {
// XdsApi
//
-const char* XdsApi::kLdsTypeUrl =
- "type.googleapis.com/envoy.config.listener.v3.Listener";
-const char* XdsApi::kRdsTypeUrl =
- "type.googleapis.com/envoy.config.route.v3.RouteConfiguration";
-const char* XdsApi::kCdsTypeUrl =
- "type.googleapis.com/envoy.config.cluster.v3.Cluster";
+// TODO(roth): All constants and functions for individual resource types
+// should be merged into the XdsResourceType abstraction.
+const char* XdsApi::kLdsTypeUrl = "envoy.config.listener.v3.Listener";
+const char* XdsApi::kRdsTypeUrl = "envoy.config.route.v3.RouteConfiguration";
+const char* XdsApi::kCdsTypeUrl = "envoy.config.cluster.v3.Cluster";
const char* XdsApi::kEdsTypeUrl =
- "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment";
+ "envoy.config.endpoint.v3.ClusterLoadAssignment";
namespace {
-const char* kLdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Listener";
-const char* kRdsV2TypeUrl =
- "type.googleapis.com/envoy.api.v2.RouteConfiguration";
-const char* kCdsV2TypeUrl = "type.googleapis.com/envoy.api.v2.Cluster";
-const char* kEdsV2TypeUrl =
- "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment";
+const char* kLdsV2TypeUrl = "envoy.api.v2.Listener";
+const char* kRdsV2TypeUrl = "envoy.api.v2.RouteConfiguration";
+const char* kCdsV2TypeUrl = "envoy.api.v2.Cluster";
+const char* kEdsV2TypeUrl = "envoy.api.v2.ClusterLoadAssignment";
-bool IsLds(y_absl::string_view type_url, bool* is_v2 = nullptr) {
+bool IsLdsInternal(y_absl::string_view type_url, bool* is_v2 = nullptr) {
if (type_url == XdsApi::kLdsTypeUrl) return true;
if (type_url == kLdsV2TypeUrl) {
if (is_v2 != nullptr) *is_v2 = true;
@@ -816,28 +746,156 @@ bool IsLds(y_absl::string_view type_url, bool* is_v2 = nullptr) {
return false;
}
-bool IsRds(y_absl::string_view type_url) {
+bool IsRdsInternal(y_absl::string_view type_url, bool* /*is_v2*/ = nullptr) {
return type_url == XdsApi::kRdsTypeUrl || type_url == kRdsV2TypeUrl;
}
-bool IsCds(y_absl::string_view type_url) {
+bool IsCdsInternal(y_absl::string_view type_url, bool* /*is_v2*/ = nullptr) {
return type_url == XdsApi::kCdsTypeUrl || type_url == kCdsV2TypeUrl;
}
-bool IsEds(y_absl::string_view type_url) {
+bool IsEdsInternal(y_absl::string_view type_url, bool* /*is_v2*/ = nullptr) {
return type_url == XdsApi::kEdsTypeUrl || type_url == kEdsV2TypeUrl;
}
+y_absl::string_view TypeUrlExternalToInternal(bool use_v3,
+ const TString& type_url) {
+ if (!use_v3) {
+ if (type_url == XdsApi::kLdsTypeUrl) {
+ return kLdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kRdsTypeUrl) {
+ return kRdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kCdsTypeUrl) {
+ return kCdsV2TypeUrl;
+ }
+ if (type_url == XdsApi::kEdsTypeUrl) {
+ return kEdsV2TypeUrl;
+ }
+ }
+ return type_url;
+}
+
+TString TypeUrlInternalToExternal(y_absl::string_view type_url) {
+ if (type_url == kLdsV2TypeUrl) {
+ return XdsApi::kLdsTypeUrl;
+ } else if (type_url == kRdsV2TypeUrl) {
+ return XdsApi::kRdsTypeUrl;
+ } else if (type_url == kCdsV2TypeUrl) {
+ return XdsApi::kCdsTypeUrl;
+ } else if (type_url == kEdsV2TypeUrl) {
+ return XdsApi::kEdsTypeUrl;
+ }
+ return TString(type_url);
+}
+
+struct EncodingContext {
+ XdsClient* client; // Used only for logging. Unsafe for dereferencing.
+ TraceFlag* tracer;
+ upb_symtab* symtab;
+ upb_arena* arena;
+ bool use_v3;
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map;
+};
+
+class XdsResourceType {
+ public:
+ // A base type for resource data.
+ struct ResourceData {};
+
+ struct DecodeResult {
+ TString name;
+ y_absl::StatusOr<std::unique_ptr<ResourceData>> resource;
+ };
+
+ virtual ~XdsResourceType() = default;
+
+ virtual y_absl::string_view type_url() const = 0;
+
+ virtual y_absl::string_view v2_type_url() const = 0;
+
+ virtual y_absl::StatusOr<DecodeResult> Decode(
+ const EncodingContext& context, y_absl::string_view serialized_resource,
+ bool is_v2) const = 0;
+
+ bool IsType(y_absl::string_view resource_type, bool* is_v2) const {
+ if (resource_type == type_url()) return true;
+ if (resource_type == v2_type_url()) {
+ if (is_v2 != nullptr) *is_v2 = true;
+ return true;
+ }
+ return false;
+ }
+};
+
+y_absl::StatusOr<XdsApi::ResourceName> ParseResourceNameInternal(
+ y_absl::string_view name,
+ std::function<bool(y_absl::string_view, bool*)> is_expected_type) {
+ // Old-style names use the empty string for authority.
+ // authority is prefixed with "old:" to indicate that it's an old-style name.
+ if (!y_absl::StartsWith(name, "xdstp:")) {
+ return XdsApi::ResourceName{"old:", TString(name)};
+ }
+ // New style name. Parse URI.
+ auto uri = URI::Parse(name);
+ if (!uri.ok()) return uri.status();
+ // Split the resource type off of the path to get the id.
+ std::pair<y_absl::string_view, y_absl::string_view> path_parts =
+ y_absl::StrSplit(uri->path(), y_absl::MaxSplits('/', 1));
+ if (!is_expected_type(path_parts.first, nullptr)) {
+ return y_absl::InvalidArgumentError(
+ "xdstp URI path must indicate valid xDS resource type");
+ }
+ std::vector<std::pair<y_absl::string_view, y_absl::string_view>> query_parameters(
+ uri->query_parameter_map().begin(), uri->query_parameter_map().end());
+ std::sort(query_parameters.begin(), query_parameters.end());
+ return XdsApi::ResourceName{
+ y_absl::StrCat("xdstp:", uri->authority()),
+ y_absl::StrCat(
+ path_parts.second, (query_parameters.empty() ? "?" : ""),
+ y_absl::StrJoin(query_parameters, "&", y_absl::PairFormatter("=")))};
+}
+
} // namespace
+// If gRPC is built with -DGRPC_XDS_USER_AGENT_NAME_SUFFIX="...", that string
+// will be appended to the user agent name reported to the xDS server.
+#ifdef GRPC_XDS_USER_AGENT_NAME_SUFFIX
+#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING \
+ " " GRPC_XDS_USER_AGENT_NAME_SUFFIX
+#else
+#define GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING ""
+#endif
+
+// If gRPC is built with -DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="...", that string
+// will be appended to the user agent version reported to the xDS server.
+#ifdef GRPC_XDS_USER_AGENT_VERSION_SUFFIX
+#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING \
+ " " GRPC_XDS_USER_AGENT_VERSION_SUFFIX
+#else
+#define GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING ""
+#endif
+
XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
- const XdsBootstrap::Node* node)
+ const XdsBootstrap::Node* node,
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map)
: client_(client),
tracer_(tracer),
node_(node),
+ certificate_provider_definition_map_(certificate_provider_definition_map),
build_version_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING, " ",
- grpc_version_string())),
- user_agent_name_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING)) {
+ grpc_version_string(),
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
+ GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)),
+ user_agent_name_(y_absl::StrCat("gRPC C-core ", GPR_PLATFORM_STRING,
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING)),
+ user_agent_version_(
+ y_absl::StrCat("C-core ", grpc_version_string(),
+ GRPC_XDS_USER_AGENT_NAME_SUFFIX_STRING,
+ GRPC_XDS_USER_AGENT_VERSION_SUFFIX_STRING)) {
// Populate upb symtab with xDS proto messages that we want to print
// properly in logs.
// Note: This won't actually work properly until upb adds support for
@@ -856,15 +914,41 @@ XdsApi::XdsApi(XdsClient* client, TraceFlag* tracer,
XdsHttpFilterRegistry::PopulateSymtab(symtab_.ptr());
}
-namespace {
+bool XdsApi::IsLds(y_absl::string_view type_url) {
+ return IsLdsInternal(type_url);
+}
-struct EncodingContext {
- XdsClient* client;
- TraceFlag* tracer;
- upb_symtab* symtab;
- upb_arena* arena;
- bool use_v3;
-};
+bool XdsApi::IsRds(y_absl::string_view type_url) {
+ return IsRdsInternal(type_url);
+}
+
+bool XdsApi::IsCds(y_absl::string_view type_url) {
+ return IsCdsInternal(type_url);
+}
+
+bool XdsApi::IsEds(y_absl::string_view type_url) {
+ return IsEdsInternal(type_url);
+}
+
+y_absl::StatusOr<XdsApi::ResourceName> XdsApi::ParseResourceName(
+ y_absl::string_view name, bool (*is_expected_type)(y_absl::string_view)) {
+ return ParseResourceNameInternal(
+ name, [is_expected_type](y_absl::string_view type, bool*) {
+ return is_expected_type(type);
+ });
+}
+
+TString XdsApi::ConstructFullResourceName(y_absl::string_view authority,
+ y_absl::string_view resource_type,
+ y_absl::string_view name) {
+ if (y_absl::ConsumePrefix(&authority, "xdstp:")) {
+ return y_absl::StrCat("xdstp://", authority, "/", resource_type, "/", name);
+ } else {
+ return TString(y_absl::StripPrefix(name, "old:"));
+ }
+}
+
+namespace {
// Works for both TString and y_absl::string_view.
template <typename T>
@@ -968,6 +1052,7 @@ void PopulateNode(const EncodingContext& context,
const XdsBootstrap::Node* node,
const TString& build_version,
const TString& user_agent_name,
+ const TString& user_agent_version,
envoy_config_core_v3_Node* node_msg) {
if (node != nullptr) {
if (!node->id.empty()) {
@@ -1007,7 +1092,7 @@ void PopulateNode(const EncodingContext& context,
envoy_config_core_v3_Node_set_user_agent_name(
node_msg, StdStringToUpbString(user_agent_name));
envoy_config_core_v3_Node_set_user_agent_version(
- node_msg, upb_strview_makez(grpc_version_string()));
+ node_msg, StdStringToUpbString(user_agent_version));
envoy_config_core_v3_Node_add_client_features(
node_msg, upb_strview_makez("envoy.lb.does_not_support_overprovisioning"),
context.arena);
@@ -1044,43 +1129,31 @@ grpc_slice SerializeDiscoveryRequest(
return grpc_slice_from_copied_buffer(output, output_length);
}
-y_absl::string_view TypeUrlExternalToInternal(bool use_v3,
- const TString& type_url) {
- if (!use_v3) {
- if (type_url == XdsApi::kLdsTypeUrl) {
- return kLdsV2TypeUrl;
- }
- if (type_url == XdsApi::kRdsTypeUrl) {
- return kRdsV2TypeUrl;
- }
- if (type_url == XdsApi::kCdsTypeUrl) {
- return kCdsV2TypeUrl;
- }
- if (type_url == XdsApi::kEdsTypeUrl) {
- return kEdsV2TypeUrl;
- }
- }
- return type_url;
-}
-
} // namespace
grpc_slice XdsApi::CreateAdsRequest(
const XdsBootstrap::XdsServer& server, const TString& type_url,
- const std::set<y_absl::string_view>& resource_names,
- const TString& version, const TString& nonce, grpc_error* error,
- bool populate_node) {
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>& resource_names,
+ const TString& version, const TString& nonce,
+ grpc_error_handle error, bool populate_node) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const EncodingContext context = {client_,
+ tracer_,
+ symtab_.ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// Create a request.
envoy_service_discovery_v3_DiscoveryRequest* request =
envoy_service_discovery_v3_DiscoveryRequest_new(arena.ptr());
// Set type_url.
y_absl::string_view real_type_url =
TypeUrlExternalToInternal(server.ShouldUseV3(), type_url);
+ TString real_type_url_str =
+ y_absl::StrCat("type.googleapis.com/", real_type_url);
envoy_service_discovery_v3_DiscoveryRequest_set_type_url(
- request, StdStringToUpbString(real_type_url));
+ request, StdStringToUpbString(real_type_url_str));
// Set version_info.
if (!version.empty()) {
envoy_service_discovery_v3_DiscoveryRequest_set_version_info(
@@ -1092,6 +1165,7 @@ grpc_slice XdsApi::CreateAdsRequest(
request, StdStringToUpbString(nonce));
}
// Set error_detail if it's a NACK.
+ TString error_string_storage;
if (error != GRPC_ERROR_NONE) {
google_rpc_Status* error_detail =
envoy_service_discovery_v3_DiscoveryRequest_mutable_error_detail(
@@ -1102,8 +1176,8 @@ grpc_slice XdsApi::CreateAdsRequest(
// generate them in the parsing code, and then use that here.
google_rpc_Status_set_code(error_detail, GRPC_STATUS_INVALID_ARGUMENT);
// Error description comes from the error that was passed in.
- upb_strview error_description =
- StdStringToUpbString(y_absl::string_view(grpc_error_string(error)));
+ error_string_storage = grpc_error_std_string(error);
+ upb_strview error_description = StdStringToUpbString(error_string_storage);
google_rpc_Status_set_message(error_detail, error_description);
GRPC_ERROR_UNREF(error);
}
@@ -1112,12 +1186,30 @@ grpc_slice XdsApi::CreateAdsRequest(
envoy_config_core_v3_Node* node_msg =
envoy_service_discovery_v3_DiscoveryRequest_mutable_node(request,
arena.ptr());
- PopulateNode(context, node_, build_version_, user_agent_name_, node_msg);
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node_msg);
+ }
+ // A vector for temporary local storage of resource name strings.
+ std::vector<TString> resource_name_storage;
+ // Make sure the vector is sized right up-front, so that reallocations
+ // don't move the strings out from under the upb proto object that
+ // points to them.
+ size_t size = 0;
+ for (const auto& p : resource_names) {
+ size += p.second.size();
}
+ resource_name_storage.reserve(size);
// Add resource_names.
- for (const auto& resource_name : resource_names) {
- envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(
- request, StdStringToUpbString(resource_name), arena.ptr());
+ for (const auto& a : resource_names) {
+ y_absl::string_view authority = a.first;
+ for (const auto& p : a.second) {
+ y_absl::string_view resource_id = p;
+ resource_name_storage.push_back(
+ ConstructFullResourceName(authority, real_type_url, resource_id));
+ envoy_service_discovery_v3_DiscoveryRequest_add_resource_names(
+ request, StdStringToUpbString(resource_name_storage.back()),
+ arena.ptr());
+ }
}
MaybeLogDiscoveryRequest(context, request);
return SerializeDiscoveryRequest(context, request);
@@ -1139,6 +1231,18 @@ void MaybeLogDiscoveryResponse(
}
}
+void MaybeLogListener(const EncodingContext& context,
+ const envoy_config_listener_v3_Listener* listener) {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer) &&
+ gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
+ const upb_msgdef* msg_type =
+ envoy_config_listener_v3_Listener_getmsgdef(context.symtab);
+ char buf[10240];
+ upb_text_encode(listener, msg_type, nullptr, 0, buf, sizeof(buf));
+ gpr_log(GPR_DEBUG, "[xds_client %p] Listener: %s", context.client, buf);
+ }
+}
+
void MaybeLogHttpConnectionManager(
const EncodingContext& context,
const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
@@ -1197,8 +1301,9 @@ void MaybeLogClusterLoadAssignment(
}
}
-grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
- XdsApi::Route* route, bool* ignore_route) {
+grpc_error_handle RoutePathMatchParse(
+ const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route,
+ bool* ignore_route) {
auto* case_sensitive_ptr =
envoy_config_route_v3_RouteMatch_case_sensitive(match);
bool case_sensitive = true;
@@ -1231,7 +1336,7 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
return GRPC_ERROR_NONE;
}
}
- type = StringMatcher::Type::PREFIX;
+ type = StringMatcher::Type::kPrefix;
match_string = TString(prefix);
} else if (envoy_config_route_v3_RouteMatch_has_path(match)) {
y_absl::string_view path =
@@ -1265,13 +1370,13 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
*ignore_route = true;
return GRPC_ERROR_NONE;
}
- type = StringMatcher::Type::EXACT;
+ type = StringMatcher::Type::kExact;
match_string = TString(path);
} else if (envoy_config_route_v3_RouteMatch_has_safe_regex(match)) {
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
envoy_config_route_v3_RouteMatch_safe_regex(match);
GPR_ASSERT(regex_matcher != nullptr);
- type = StringMatcher::Type::SAFE_REGEX;
+ type = StringMatcher::Type::kSafeRegex;
match_string = UpbStringToStdString(
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
} else {
@@ -1281,16 +1386,14 @@ grpc_error* RoutePathMatchParse(const envoy_config_route_v3_RouteMatch* match,
y_absl::StatusOr<StringMatcher> string_matcher =
StringMatcher::Create(type, match_string, case_sensitive);
if (!string_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("path matcher: ", string_matcher.status().message())
- .c_str());
- ;
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("path matcher: ", string_matcher.status().message()));
}
route->matchers.path_matcher = std::move(string_matcher.value());
return GRPC_ERROR_NONE;
}
-grpc_error* RouteHeaderMatchersParse(
+grpc_error_handle RouteHeaderMatchersParse(
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
size_t size;
const envoy_config_route_v3_HeaderMatcher* const* headers =
@@ -1305,7 +1408,7 @@ grpc_error* RouteHeaderMatchersParse(
int64_t range_end = 0;
bool present_match = false;
if (envoy_config_route_v3_HeaderMatcher_has_exact_match(header)) {
- type = HeaderMatcher::Type::EXACT;
+ type = HeaderMatcher::Type::kExact;
match_string = UpbStringToStdString(
envoy_config_route_v3_HeaderMatcher_exact_match(header));
} else if (envoy_config_route_v3_HeaderMatcher_has_safe_regex_match(
@@ -1313,28 +1416,28 @@ grpc_error* RouteHeaderMatchersParse(
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
envoy_config_route_v3_HeaderMatcher_safe_regex_match(header);
GPR_ASSERT(regex_matcher != nullptr);
- type = HeaderMatcher::Type::SAFE_REGEX;
+ type = HeaderMatcher::Type::kSafeRegex;
match_string = UpbStringToStdString(
envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
} else if (envoy_config_route_v3_HeaderMatcher_has_range_match(header)) {
- type = HeaderMatcher::Type::RANGE;
+ type = HeaderMatcher::Type::kRange;
const envoy_type_v3_Int64Range* range_matcher =
envoy_config_route_v3_HeaderMatcher_range_match(header);
range_start = envoy_type_v3_Int64Range_start(range_matcher);
range_end = envoy_type_v3_Int64Range_end(range_matcher);
} else if (envoy_config_route_v3_HeaderMatcher_has_present_match(header)) {
- type = HeaderMatcher::Type::PRESENT;
+ type = HeaderMatcher::Type::kPresent;
present_match = envoy_config_route_v3_HeaderMatcher_present_match(header);
} else if (envoy_config_route_v3_HeaderMatcher_has_prefix_match(header)) {
- type = HeaderMatcher::Type::PREFIX;
+ type = HeaderMatcher::Type::kPrefix;
match_string = UpbStringToStdString(
envoy_config_route_v3_HeaderMatcher_prefix_match(header));
} else if (envoy_config_route_v3_HeaderMatcher_has_suffix_match(header)) {
- type = HeaderMatcher::Type::SUFFIX;
+ type = HeaderMatcher::Type::kSuffix;
match_string = UpbStringToStdString(
envoy_config_route_v3_HeaderMatcher_suffix_match(header));
} else if (envoy_config_route_v3_HeaderMatcher_has_contains_match(header)) {
- type = HeaderMatcher::Type::CONTAINS;
+ type = HeaderMatcher::Type::kContains;
match_string = UpbStringToStdString(
envoy_config_route_v3_HeaderMatcher_contains_match(header));
} else {
@@ -1347,9 +1450,8 @@ grpc_error* RouteHeaderMatchersParse(
HeaderMatcher::Create(name, type, match_string, range_start, range_end,
present_match, invert_match);
if (!header_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("header matcher: ", header_matcher.status().message())
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("header matcher: ", header_matcher.status().message()));
}
route->matchers.header_matchers.emplace_back(
std::move(header_matcher.value()));
@@ -1357,7 +1459,7 @@ grpc_error* RouteHeaderMatchersParse(
return GRPC_ERROR_NONE;
}
-grpc_error* RouteRuntimeFractionParse(
+grpc_error_handle RouteRuntimeFractionParse(
const envoy_config_route_v3_RouteMatch* match, XdsApi::Route* route) {
const envoy_config_core_v3_RuntimeFractionalPercent* runtime_fraction =
envoy_config_route_v3_RouteMatch_runtime_fraction(match);
@@ -1390,27 +1492,28 @@ grpc_error* RouteRuntimeFractionParse(
return GRPC_ERROR_NONE;
}
-grpc_error* ExtractHttpFilterTypeName(const EncodingContext& context,
- const google_protobuf_Any* any,
- y_absl::string_view* filter_type) {
+grpc_error_handle ExtractHttpFilterTypeName(const EncodingContext& context,
+ const google_protobuf_Any* any,
+ y_absl::string_view* filter_type) {
*filter_type = UpbStringToAbsl(google_protobuf_Any_type_url(any));
- if (*filter_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
+ if (*filter_type == "type.googleapis.com/xds.type.v3.TypedStruct" ||
+ *filter_type == "type.googleapis.com/udpa.type.v1.TypedStruct") {
upb_strview any_value = google_protobuf_Any_value(any);
- const auto* typed_struct = udpa_type_v1_TypedStruct_parse(
+ const auto* typed_struct = xds_type_v3_TypedStruct_parse(
any_value.data, any_value.size, context.arena);
if (typed_struct == nullptr) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"could not parse TypedStruct from filter config");
}
*filter_type =
- UpbStringToAbsl(udpa_type_v1_TypedStruct_type_url(typed_struct));
+ UpbStringToAbsl(xds_type_v3_TypedStruct_type_url(typed_struct));
}
*filter_type = y_absl::StripPrefix(*filter_type, "type.googleapis.com/");
return GRPC_ERROR_NONE;
}
template <typename ParentType, typename EntryType>
-grpc_error* ParseTypedPerFilterConfig(
+grpc_error_handle ParseTypedPerFilterConfig(
const EncodingContext& context, const ParentType* parent,
const EntryType* (*entry_func)(const ParentType*, size_t*),
upb_strview (*key_func)(const EntryType*),
@@ -1429,9 +1532,8 @@ grpc_error* ParseTypedPerFilterConfig(
y_absl::string_view filter_type =
UpbStringToAbsl(google_protobuf_Any_type_url(any));
if (filter_type.empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("no filter config specified for filter name ", key)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("no filter config specified for filter name ", key));
}
bool is_optional = false;
if (filter_type ==
@@ -1440,51 +1542,135 @@ grpc_error* ParseTypedPerFilterConfig(
const auto* filter_config = envoy_config_route_v3_FilterConfig_parse(
any_value.data, any_value.size, context.arena);
if (filter_config == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("could not parse FilterConfig wrapper for ", key)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("could not parse FilterConfig wrapper for ", key));
}
is_optional =
envoy_config_route_v3_FilterConfig_is_optional(filter_config);
any = envoy_config_route_v3_FilterConfig_config(filter_config);
if (any == nullptr) {
if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("no filter config specified for filter name ", key)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("no filter config specified for filter name ", key));
}
}
- grpc_error* error = ExtractHttpFilterTypeName(context, any, &filter_type);
+ grpc_error_handle error =
+ ExtractHttpFilterTypeName(context, any, &filter_type);
if (error != GRPC_ERROR_NONE) return error;
const XdsHttpFilterImpl* filter_impl =
XdsHttpFilterRegistry::GetFilterForType(filter_type);
if (filter_impl == nullptr) {
if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("no filter registered for config type ", filter_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("no filter registered for config type ", filter_type));
}
y_absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
filter_impl->GenerateFilterConfigOverride(
google_protobuf_Any_value(any), context.arena);
if (!filter_config.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("filter config for type ", filter_type,
- " failed to parse: ", filter_config.status().ToString())
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "filter config for type ", filter_type,
+ " failed to parse: ", filter_config.status().ToString()));
}
(*typed_per_filter_config)[TString(key)] = std::move(*filter_config);
}
return GRPC_ERROR_NONE;
}
-grpc_error* RouteActionParse(const EncodingContext& context,
- const envoy_config_route_v3_Route* route_msg,
- XdsApi::Route* route, bool* ignore_route) {
- if (!envoy_config_route_v3_Route_has_route(route_msg)) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No RouteAction found in route.");
+XdsApi::Duration DurationParse(const google_protobuf_Duration* proto_duration) {
+ XdsApi::Duration duration;
+ duration.seconds = google_protobuf_Duration_seconds(proto_duration);
+ duration.nanos = google_protobuf_Duration_nanos(proto_duration);
+ return duration;
+}
+
+grpc_error_handle RetryPolicyParse(
+ const EncodingContext& context,
+ const envoy_config_route_v3_RetryPolicy* retry_policy,
+ y_absl::optional<XdsApi::RetryPolicy>* retry) {
+ std::vector<grpc_error_handle> errors;
+ XdsApi::RetryPolicy retry_to_return;
+ auto retry_on = UpbStringToStdString(
+ envoy_config_route_v3_RetryPolicy_retry_on(retry_policy));
+ std::vector<y_absl::string_view> codes = y_absl::StrSplit(retry_on, ',');
+ for (const auto& code : codes) {
+ if (code == "cancelled") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_CANCELLED);
+ } else if (code == "deadline-exceeded") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_DEADLINE_EXCEEDED);
+ } else if (code == "internal") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_INTERNAL);
+ } else if (code == "resource-exhausted") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_RESOURCE_EXHAUSTED);
+ } else if (code == "unavailable") {
+ retry_to_return.retry_on.Add(GRPC_STATUS_UNAVAILABLE);
+ } else {
+ if (GRPC_TRACE_FLAG_ENABLED(*context.tracer)) {
+ gpr_log(GPR_INFO, "Unsupported retry_on policy %s.",
+ TString(code).c_str());
+ }
+ }
+ }
+ const google_protobuf_UInt32Value* num_retries =
+ envoy_config_route_v3_RetryPolicy_num_retries(retry_policy);
+ if (num_retries != nullptr) {
+ uint32_t num_retries_value = google_protobuf_UInt32Value_value(num_retries);
+ if (num_retries_value == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction RetryPolicy num_retries set to invalid value 0."));
+ } else {
+ retry_to_return.num_retries = num_retries_value;
+ }
+ } else {
+ retry_to_return.num_retries = 1;
+ }
+ const envoy_config_route_v3_RetryPolicy_RetryBackOff* backoff =
+ envoy_config_route_v3_RetryPolicy_retry_back_off(retry_policy);
+ if (backoff != nullptr) {
+ const google_protobuf_Duration* base_interval =
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_base_interval(backoff);
+ if (base_interval == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "RouteAction RetryPolicy RetryBackoff missing base interval."));
+ } else {
+ retry_to_return.retry_back_off.base_interval =
+ DurationParse(base_interval);
+ }
+ const google_protobuf_Duration* max_interval =
+ envoy_config_route_v3_RetryPolicy_RetryBackOff_max_interval(backoff);
+ XdsApi::Duration max;
+ if (max_interval != nullptr) {
+ max = DurationParse(max_interval);
+ } else {
+ // if max interval is not set, it is 10x the base, if the value in nanos
+ // can yield another second, adjust the value in seconds accordingly.
+ max.seconds = retry_to_return.retry_back_off.base_interval.seconds * 10;
+ max.nanos = retry_to_return.retry_back_off.base_interval.nanos * 10;
+ if (max.nanos > 1000000000) {
+ max.seconds += max.nanos / 1000000000;
+ max.nanos = max.nanos % 1000000000;
+ }
+ }
+ retry_to_return.retry_back_off.max_interval = max;
+ } else {
+ retry_to_return.retry_back_off.base_interval.seconds = 0;
+ retry_to_return.retry_back_off.base_interval.nanos = 25000000;
+ retry_to_return.retry_back_off.max_interval.seconds = 0;
+ retry_to_return.retry_back_off.max_interval.nanos = 250000000;
+ }
+ if (errors.empty()) {
+ *retry = retry_to_return;
+ return GRPC_ERROR_NONE;
+ } else {
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing retry policy",
+ &errors);
}
+}
+
+grpc_error_handle RouteActionParse(const EncodingContext& context,
+ const envoy_config_route_v3_Route* route_msg,
+ XdsApi::Route::RouteAction* route,
+ bool* ignore_route) {
const envoy_config_route_v3_RouteAction* route_action =
envoy_config_route_v3_Route_route(route_msg);
// Get the cluster or weighted_clusters in the RouteAction.
@@ -1513,7 +1699,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
for (size_t j = 0; j < clusters_size; ++j) {
const envoy_config_route_v3_WeightedCluster_ClusterWeight*
cluster_weight = clusters[j];
- XdsApi::Route::ClusterWeight cluster;
+ XdsApi::Route::RouteAction::ClusterWeight cluster;
cluster.name = UpbStringToStdString(
envoy_config_route_v3_WeightedCluster_ClusterWeight_name(
cluster_weight));
@@ -1533,7 +1719,7 @@ grpc_error* RouteActionParse(const EncodingContext& context,
if (cluster.weight == 0) continue;
sum_of_weights += cluster.weight;
if (context.use_v3) {
- grpc_error* error = ParseTypedPerFilterConfig<
+ grpc_error_handle error = ParseTypedPerFilterConfig<
envoy_config_route_v3_WeightedCluster_ClusterWeight,
envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry>(
context, cluster_weight,
@@ -1571,44 +1757,34 @@ grpc_error* RouteActionParse(const EncodingContext& context,
max_stream_duration);
}
if (duration != nullptr) {
- XdsApi::Duration duration_in_route;
- duration_in_route.seconds = google_protobuf_Duration_seconds(duration);
- duration_in_route.nanos = google_protobuf_Duration_nanos(duration);
- route->max_stream_duration = duration_in_route;
+ route->max_stream_duration = DurationParse(duration);
}
}
}
// Get HashPolicy from RouteAction
- if (XdsRingHashEnabled()) {
- size_t size = 0;
- const envoy_config_route_v3_RouteAction_HashPolicy* const* hash_policies =
- envoy_config_route_v3_RouteAction_hash_policy(route_action, &size);
- for (size_t i = 0; i < size; ++i) {
- const envoy_config_route_v3_RouteAction_HashPolicy* hash_policy =
- hash_policies[i];
- XdsApi::Route::HashPolicy policy;
- policy.terminal =
- envoy_config_route_v3_RouteAction_HashPolicy_terminal(hash_policy);
- const envoy_config_route_v3_RouteAction_HashPolicy_Header* header;
- const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*
- filter_state;
- if ((header = envoy_config_route_v3_RouteAction_HashPolicy_header(
- hash_policy)) != nullptr) {
- policy.type = XdsApi::Route::HashPolicy::Type::HEADER;
- policy.header_name = UpbStringToStdString(
- envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(
- header));
- const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*
- regex_rewrite =
- envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(
- header);
- if (regex_rewrite == nullptr) {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier Header with "
- "RegexMatchAndSubstitution but Regex is missing");
- continue;
- }
+ size_t size = 0;
+ const envoy_config_route_v3_RouteAction_HashPolicy* const* hash_policies =
+ envoy_config_route_v3_RouteAction_hash_policy(route_action, &size);
+ for (size_t i = 0; i < size; ++i) {
+ const envoy_config_route_v3_RouteAction_HashPolicy* hash_policy =
+ hash_policies[i];
+ XdsApi::Route::RouteAction::HashPolicy policy;
+ policy.terminal =
+ envoy_config_route_v3_RouteAction_HashPolicy_terminal(hash_policy);
+ const envoy_config_route_v3_RouteAction_HashPolicy_Header* header;
+ const envoy_config_route_v3_RouteAction_HashPolicy_FilterState*
+ filter_state;
+ if ((header = envoy_config_route_v3_RouteAction_HashPolicy_header(
+ hash_policy)) != nullptr) {
+ policy.type = XdsApi::Route::RouteAction::HashPolicy::Type::HEADER;
+ policy.header_name = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_HashPolicy_Header_header_name(
+ header));
+ const struct envoy_type_matcher_v3_RegexMatchAndSubstitute*
+ regex_rewrite =
+ envoy_config_route_v3_RouteAction_HashPolicy_Header_regex_rewrite(
+ header);
+ if (regex_rewrite != nullptr) {
const envoy_type_matcher_v3_RegexMatcher* regex_matcher =
envoy_type_matcher_v3_RegexMatchAndSubstitute_pattern(
regex_rewrite);
@@ -1636,38 +1812,45 @@ grpc_error* RouteActionParse(const EncodingContext& context,
policy.regex_substitution = UpbStringToStdString(
envoy_type_matcher_v3_RegexMatchAndSubstitute_substitution(
regex_rewrite));
- } else if ((filter_state =
- envoy_config_route_v3_RouteAction_HashPolicy_filter_state(
- hash_policy)) != nullptr) {
- TString key = UpbStringToStdString(
- envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(
- filter_state));
- if (key == "io.grpc.channel_id") {
- policy.type = XdsApi::Route::HashPolicy::Type::CHANNEL_ID;
- } else {
- gpr_log(GPR_DEBUG,
- "RouteAction HashPolicy contains policy specifier "
- "FilterState but "
- "key is not io.grpc.channel_id.");
- continue;
- }
+ }
+ } else if ((filter_state =
+ envoy_config_route_v3_RouteAction_HashPolicy_filter_state(
+ hash_policy)) != nullptr) {
+ TString key = UpbStringToStdString(
+ envoy_config_route_v3_RouteAction_HashPolicy_FilterState_key(
+ filter_state));
+ if (key == "io.grpc.channel_id") {
+ policy.type = XdsApi::Route::RouteAction::HashPolicy::Type::CHANNEL_ID;
} else {
- gpr_log(
- GPR_DEBUG,
- "RouteAction HashPolicy contains unsupported policy specifier.");
+ gpr_log(GPR_DEBUG,
+ "RouteAction HashPolicy contains policy specifier "
+ "FilterState but "
+ "key is not io.grpc.channel_id.");
continue;
}
- route->hash_policies.emplace_back(std::move(policy));
+ } else {
+ gpr_log(GPR_DEBUG,
+ "RouteAction HashPolicy contains unsupported policy specifier.");
+ continue;
}
+ route->hash_policies.emplace_back(std::move(policy));
+ }
+ // Get retry policy
+ const envoy_config_route_v3_RetryPolicy* retry_policy =
+ envoy_config_route_v3_RouteAction_retry_policy(route_action);
+ if (retry_policy != nullptr) {
+ y_absl::optional<XdsApi::RetryPolicy> retry;
+ grpc_error_handle error = RetryPolicyParse(context, retry_policy, &retry);
+ if (error != GRPC_ERROR_NONE) return error;
+ route->retry_policy = retry;
}
return GRPC_ERROR_NONE;
}
-grpc_error* RouteConfigParse(
+grpc_error_handle RouteConfigParse(
const EncodingContext& context,
const envoy_config_route_v3_RouteConfiguration* route_config,
- XdsApi::RdsUpdate* rds_update) {
- MaybeLogRouteConfiguration(context, route_config);
+ bool /*is_v2*/, XdsApi::RdsUpdate* rds_update) {
// Get the virtual hosts.
size_t num_virtual_hosts;
const envoy_config_route_v3_VirtualHost* const* virtual_hosts =
@@ -1682,11 +1865,9 @@ grpc_error* RouteConfigParse(
virtual_hosts[i], &domain_size);
for (size_t j = 0; j < domain_size; ++j) {
TString domain_pattern = UpbStringToStdString(domains[j]);
- const MatchType match_type = DomainPatternMatchType(domain_pattern);
- if (match_type == INVALID_MATCH) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Invalid domain pattern \"", domain_pattern, "\".")
- .c_str());
+ if (!XdsRouting::IsValidDomainPattern(domain_pattern)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Invalid domain pattern \"", domain_pattern, "\"."));
}
vhost.domains.emplace_back(std::move(domain_pattern));
}
@@ -1695,7 +1876,7 @@ grpc_error* RouteConfigParse(
}
// Parse typed_per_filter_config.
if (context.use_v3) {
- grpc_error* error = ParseTypedPerFilterConfig<
+ grpc_error_handle error = ParseTypedPerFilterConfig<
envoy_config_route_v3_VirtualHost,
envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry>(
context, virtual_hosts[i],
@@ -1705,6 +1886,15 @@ grpc_error* RouteConfigParse(
&vhost.typed_per_filter_config);
if (error != GRPC_ERROR_NONE) return error;
}
+ // Parse retry policy.
+ y_absl::optional<XdsApi::RetryPolicy> virtual_host_retry_policy;
+ const envoy_config_route_v3_RetryPolicy* retry_policy =
+ envoy_config_route_v3_VirtualHost_retry_policy(virtual_hosts[i]);
+ if (retry_policy != nullptr) {
+ grpc_error_handle error =
+ RetryPolicyParse(context, retry_policy, &virtual_host_retry_policy);
+ if (error != GRPC_ERROR_NONE) return error;
+ }
// Parse routes.
size_t num_routes;
const envoy_config_route_v3_Route* const* routes =
@@ -1728,18 +1918,32 @@ grpc_error* RouteConfigParse(
}
XdsApi::Route route;
bool ignore_route = false;
- grpc_error* error = RoutePathMatchParse(match, &route, &ignore_route);
+ grpc_error_handle error =
+ RoutePathMatchParse(match, &route, &ignore_route);
if (error != GRPC_ERROR_NONE) return error;
if (ignore_route) continue;
error = RouteHeaderMatchersParse(match, &route);
if (error != GRPC_ERROR_NONE) return error;
error = RouteRuntimeFractionParse(match, &route);
if (error != GRPC_ERROR_NONE) return error;
- error = RouteActionParse(context, routes[j], &route, &ignore_route);
- if (error != GRPC_ERROR_NONE) return error;
- if (ignore_route) continue;
+ if (envoy_config_route_v3_Route_has_route(routes[j])) {
+ route.action.emplace<XdsApi::Route::RouteAction>();
+ auto& route_action =
+ y_absl::get<XdsApi::Route::RouteAction>(route.action);
+ error =
+ RouteActionParse(context, routes[j], &route_action, &ignore_route);
+ if (error != GRPC_ERROR_NONE) return error;
+ if (ignore_route) continue;
+ if (route_action.retry_policy == y_absl::nullopt &&
+ retry_policy != nullptr) {
+ route_action.retry_policy = virtual_host_retry_policy;
+ }
+ } else if (envoy_config_route_v3_Route_has_non_forwarding_action(
+ routes[j])) {
+ route.action.emplace<XdsApi::Route::NonForwardingAction>();
+ }
if (context.use_v3) {
- grpc_error* error = ParseTypedPerFilterConfig<
+ grpc_error_handle error = ParseTypedPerFilterConfig<
envoy_config_route_v3_Route,
envoy_config_route_v3_Route_TypedPerFilterConfigEntry>(
context, routes[j],
@@ -1758,27 +1962,176 @@ grpc_error* RouteConfigParse(
return GRPC_ERROR_NONE;
}
-XdsApi::CommonTlsContext::CertificateProviderInstance
-CertificateProviderInstanceParse(
+// CertificateProviderInstance is deprecated but we are still supporting it for
+// backward compatibility reasons. Note that we still parse the data into the
+// same CertificateProviderPluginInstance struct since the fields are the same.
+// TODO(yashykt): Remove this once we stop supporting the old way of fetching
+// certificate provider instances.
+grpc_error_handle CertificateProviderInstanceParse(
+ const EncodingContext& context,
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance*
- certificate_provider_instance_proto) {
- return {
+ certificate_provider_instance_proto,
+ XdsApi::CommonTlsContext::CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance) {
+ *certificate_provider_plugin_instance = {
UpbStringToStdString(
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_instance_name(
certificate_provider_instance_proto)),
UpbStringToStdString(
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_certificate_name(
certificate_provider_instance_proto))};
+ if (context.certificate_provider_definition_map->find(
+ certificate_provider_plugin_instance->instance_name) ==
+ context.certificate_provider_definition_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unrecognized certificate provider instance name: ",
+ certificate_provider_plugin_instance->instance_name));
+ }
+ return GRPC_ERROR_NONE;
}
-grpc_error* CommonTlsContextParse(
- const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
- common_tls_context_proto,
- XdsApi::CommonTlsContext* common_tls_context) GRPC_MUST_USE_RESULT;
-grpc_error* CommonTlsContextParse(
+grpc_error_handle CertificateProviderPluginInstanceParse(
+ const EncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance_proto,
+ XdsApi::CommonTlsContext::CertificateProviderPluginInstance*
+ certificate_provider_plugin_instance) {
+ *certificate_provider_plugin_instance = {
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_instance_name(
+ certificate_provider_plugin_instance_proto)),
+ UpbStringToStdString(
+ envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_certificate_name(
+ certificate_provider_plugin_instance_proto))};
+ if (context.certificate_provider_definition_map->find(
+ certificate_provider_plugin_instance->instance_name) ==
+ context.certificate_provider_definition_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unrecognized certificate provider instance name: ",
+ certificate_provider_plugin_instance->instance_name));
+ }
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle CertificateValidationContextParse(
+ const EncodingContext& context,
+ const envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext*
+ certificate_validation_context_proto,
+ XdsApi::CommonTlsContext::CertificateValidationContext*
+ certificate_validation_context) {
+ std::vector<grpc_error_handle> errors;
+ size_t len = 0;
+ auto* subject_alt_names_matchers =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(
+ certificate_validation_context_proto, &len);
+ for (size_t i = 0; i < len; ++i) {
+ StringMatcher::Type type;
+ TString matcher;
+ if (envoy_type_matcher_v3_StringMatcher_has_exact(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kExact;
+ matcher = UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kPrefix;
+ matcher = UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kSuffix;
+ matcher = UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_contains(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kContains;
+ matcher =
+ UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
+ subject_alt_names_matchers[i]));
+ } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
+ subject_alt_names_matchers[i])) {
+ type = StringMatcher::Type::kSafeRegex;
+ auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
+ subject_alt_names_matchers[i]);
+ matcher = UpbStringToStdString(
+ envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
+ } else {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid StringMatcher specified"));
+ continue;
+ }
+ bool ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
+ subject_alt_names_matchers[i]);
+ y_absl::StatusOr<StringMatcher> string_matcher =
+ StringMatcher::Create(type, matcher,
+ /*case_sensitive=*/!ignore_case);
+ if (!string_matcher.ok()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("string matcher: ", string_matcher.status().message())));
+ continue;
+ }
+ if (type == StringMatcher::Type::kSafeRegex && ignore_case) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "StringMatcher: ignore_case has no effect for SAFE_REGEX."));
+ continue;
+ }
+ certificate_validation_context->match_subject_alt_names.push_back(
+ std::move(string_matcher.value()));
+ }
+ auto* ca_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_ca_certificate_provider_instance(
+ certificate_validation_context_proto);
+ if (ca_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderPluginInstanceParse(
+ context, ca_certificate_provider_instance,
+ &certificate_validation_context->ca_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_spki(
+ certificate_validation_context_proto, nullptr) != nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: verify_certificate_spki "
+ "unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_verify_certificate_hash(
+ certificate_validation_context_proto, nullptr) != nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: verify_certificate_hash "
+ "unsupported"));
+ }
+ auto* require_signed_certificate_timestamp =
+ envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_require_signed_certificate_timestamp(
+ certificate_validation_context_proto);
+ if (require_signed_certificate_timestamp != nullptr &&
+ google_protobuf_BoolValue_value(require_signed_certificate_timestamp)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: "
+ "require_signed_certificate_timestamp unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_crl(
+ certificate_validation_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: crl unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_has_custom_validator_config(
+ certificate_validation_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "CertificateValidationContext: custom_validator_config "
+ "unsupported"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR(
+ "Error parsing CertificateValidationContext", &errors);
+}
+
+grpc_error_handle CommonTlsContextParse(
+ const EncodingContext& context,
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*
common_tls_context_proto,
XdsApi::CommonTlsContext* common_tls_context) {
+ std::vector<grpc_error_handle> errors;
+ // The validation context is derived from the oneof in
+ // 'validation_context_type'. 'validation_context_sds_secret_config' is not
+ // supported.
auto* combined_validation_context =
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_combined_validation_context(
common_tls_context_proto);
@@ -1787,90 +2140,95 @@ grpc_error* CommonTlsContextParse(
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_default_validation_context(
combined_validation_context);
if (default_validation_context != nullptr) {
- size_t len = 0;
- auto* subject_alt_names_matchers =
- envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_match_subject_alt_names(
- default_validation_context, &len);
- for (size_t i = 0; i < len; ++i) {
- StringMatcher::Type type;
- TString matcher;
- if (envoy_type_matcher_v3_StringMatcher_has_exact(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::EXACT;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_exact(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_prefix(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::PREFIX;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_prefix(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_suffix(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::SUFFIX;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_suffix(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_contains(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::CONTAINS;
- matcher =
- UpbStringToStdString(envoy_type_matcher_v3_StringMatcher_contains(
- subject_alt_names_matchers[i]));
- } else if (envoy_type_matcher_v3_StringMatcher_has_safe_regex(
- subject_alt_names_matchers[i])) {
- type = StringMatcher::Type::SAFE_REGEX;
- auto* regex_matcher = envoy_type_matcher_v3_StringMatcher_safe_regex(
- subject_alt_names_matchers[i]);
- matcher = UpbStringToStdString(
- envoy_type_matcher_v3_RegexMatcher_regex(regex_matcher));
- } else {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Invalid StringMatcher specified");
- }
- bool ignore_case = envoy_type_matcher_v3_StringMatcher_ignore_case(
- subject_alt_names_matchers[i]);
- y_absl::StatusOr<StringMatcher> string_matcher =
- StringMatcher::Create(type, matcher,
- /*case_sensitive=*/!ignore_case);
- if (!string_matcher.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("string matcher: ",
- string_matcher.status().message())
- .c_str());
- }
- if (type == StringMatcher::Type::SAFE_REGEX && ignore_case) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "StringMatcher: ignore_case has no effect for SAFE_REGEX.");
- }
- common_tls_context->combined_validation_context
- .default_validation_context.match_subject_alt_names.push_back(
- std::move(string_matcher.value()));
- }
- }
+ grpc_error_handle error = CertificateValidationContextParse(
+ context, default_validation_context,
+ &common_tls_context->certificate_validation_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ // If after parsing default_validation_context,
+ // common_tls_context->certificate_validation_context.ca_certificate_provider_instance
+ // is empty, fall back onto
+ // 'validation_context_certificate_provider_instance' inside
+ // 'combined_validation_context'. Note that this way of fetching root
+ // certificates is deprecated and will be removed in the future.
+ // TODO(yashykt): Remove this once it's no longer needed.
auto* validation_context_certificate_provider_instance =
envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_validation_context_certificate_provider_instance(
combined_validation_context);
- if (validation_context_certificate_provider_instance != nullptr) {
- common_tls_context->combined_validation_context
- .validation_context_certificate_provider_instance =
- CertificateProviderInstanceParse(
- validation_context_certificate_provider_instance);
+ if (common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance.Empty() &&
+ validation_context_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderInstanceParse(
+ context, validation_context_certificate_provider_instance,
+ &common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
}
- }
- auto* tls_certificate_certificate_provider_instance =
- envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(
+ } else {
+ auto* validation_context =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context(
+ common_tls_context_proto);
+ if (validation_context != nullptr) {
+ grpc_error_handle error = CertificateValidationContextParse(
+ context, validation_context,
+ &common_tls_context->certificate_validation_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else if (
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_validation_context_sds_secret_config(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "validation_context_sds_secret_config unsupported"));
+ }
+ }
+ auto* tls_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_provider_instance(
common_tls_context_proto);
- if (tls_certificate_certificate_provider_instance != nullptr) {
- common_tls_context->tls_certificate_certificate_provider_instance =
- CertificateProviderInstanceParse(
- tls_certificate_certificate_provider_instance);
+ if (tls_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderPluginInstanceParse(
+ context, tls_certificate_provider_instance,
+ &common_tls_context->tls_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ // Fall back onto 'tls_certificate_certificate_provider_instance'. Note that
+ // this way of fetching identity certificates is deprecated and will be
+ // removed in the future.
+ // TODO(yashykt): Remove this once it's no longer needed.
+ auto* tls_certificate_certificate_provider_instance =
+ envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_tls_certificate_certificate_provider_instance(
+ common_tls_context_proto);
+ if (tls_certificate_certificate_provider_instance != nullptr) {
+ grpc_error_handle error = CertificateProviderInstanceParse(
+ context, tls_certificate_certificate_provider_instance,
+ &common_tls_context->tls_certificate_provider_instance);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificates(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "tls_certificates unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_certificate_sds_secret_configs(
+ common_tls_context_proto)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "tls_certificate_sds_secret_configs unsupported"));
+ }
+ }
}
- return GRPC_ERROR_NONE;
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_tls_params(
+ common_tls_context_proto)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("tls_params unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_has_custom_handshaker(
+ common_tls_context_proto)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("custom_handshaker unsupported"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing CommonTlsContext",
+ &errors);
}
-grpc_error* HttpConnectionManagerParse(
+grpc_error_handle HttpConnectionManagerParse(
bool is_client, const EncodingContext& context,
const envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager*
http_connection_manager_proto,
@@ -1885,10 +2243,8 @@ grpc_error* HttpConnectionManagerParse(
const google_protobuf_Duration* duration =
envoy_config_core_v3_HttpProtocolOptions_max_stream_duration(options);
if (duration != nullptr) {
- http_connection_manager->http_max_stream_duration.seconds =
- google_protobuf_Duration_seconds(duration);
- http_connection_manager->http_max_stream_duration.nanos =
- google_protobuf_Duration_nanos(duration);
+ http_connection_manager->http_max_stream_duration =
+ DurationParse(duration);
}
}
// Parse filters.
@@ -1904,12 +2260,12 @@ grpc_error* HttpConnectionManagerParse(
envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_name(
http_filter));
if (name.empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("empty filter name at index ", i).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("empty filter name at index ", i));
}
if (names_seen.find(name) != names_seen.end()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate HTTP filter name: ", name).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("duplicate HTTP filter name: ", name));
}
names_seen.insert(name);
const bool is_optional =
@@ -1920,43 +2276,69 @@ grpc_error* HttpConnectionManagerParse(
http_filter);
if (any == nullptr) {
if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("no filter config specified for filter name ", name)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("no filter config specified for filter name ", name));
}
y_absl::string_view filter_type;
- grpc_error* error = ExtractHttpFilterTypeName(context, any, &filter_type);
+ grpc_error_handle error =
+ ExtractHttpFilterTypeName(context, any, &filter_type);
if (error != GRPC_ERROR_NONE) return error;
const XdsHttpFilterImpl* filter_impl =
XdsHttpFilterRegistry::GetFilterForType(filter_type);
if (filter_impl == nullptr) {
if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("no filter registered for config type ", filter_type)
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("no filter registered for config type ", filter_type));
}
if ((is_client && !filter_impl->IsSupportedOnClients()) ||
(!is_client && !filter_impl->IsSupportedOnServers())) {
if (is_optional) continue;
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Filter %s is not supported on %s", filter_type,
- is_client ? "clients" : "servers")
- .c_str());
+ is_client ? "clients" : "servers"));
}
y_absl::StatusOr<XdsHttpFilterImpl::FilterConfig> filter_config =
filter_impl->GenerateFilterConfig(google_protobuf_Any_value(any),
context.arena);
if (!filter_config.ok()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "filter config for type ", filter_type,
- " failed to parse: ", filter_config.status().ToString())
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "filter config for type ", filter_type,
+ " failed to parse: ", filter_config.status().ToString()));
}
http_connection_manager->http_filters.emplace_back(
XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
TString(name), std::move(*filter_config)});
}
+ if (http_connection_manager->http_filters.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Expected at least one HTTP filter");
+ }
+ // Make sure that the last filter is terminal and non-last filters are
+ // non-terminal. Note that this check is being performed in a separate loop
+ // to take care of the case where there are two terminal filters in the list
+ // out of which only one gets added in the final list.
+ for (const auto& http_filter : http_connection_manager->http_filters) {
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ http_filter.config.config_proto_type_name);
+ if (&http_filter != &http_connection_manager->http_filters.back()) {
+ // Filters before the last filter must not be terminal.
+ if (filter_impl->IsTerminalFilter()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("terminal filter for config type ",
+ http_filter.config.config_proto_type_name,
+ " must be the last filter in the chain"));
+ }
+ } else {
+ // The last filter must be terminal.
+ if (!filter_impl->IsTerminalFilter()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("non-terminal filter for config type ",
+ http_filter.config.config_proto_type_name,
+ " is the last filter in the chain"));
+ }
+ }
+ }
} else {
// If using a v2 config, we just hard-code a list containing only the
// router filter without actually looking at the config. This ensures
@@ -1966,7 +2348,10 @@ grpc_error* HttpConnectionManagerParse(
XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter{
"router", {kXdsHttpRouterFilterConfigName, Json()}});
}
- if (is_client) {
+ // Guarding parsing of RouteConfig on the server side with the environmental
+ // variable since that's the first feature on the server side that will be
+ // using this.
+ if (is_client || XdsRbacEnabled()) {
// Found inlined route_config. Parse it to find the cluster_name.
if (envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_has_route_config(
http_connection_manager_proto)) {
@@ -1974,7 +2359,8 @@ grpc_error* HttpConnectionManagerParse(
envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_config(
http_connection_manager_proto);
XdsApi::RdsUpdate rds_update;
- grpc_error* error = RouteConfigParse(context, route_config, &rds_update);
+ grpc_error_handle error =
+ RouteConfigParse(context, route_config, is_v2, &rds_update);
if (error != GRPC_ERROR_NONE) return error;
http_connection_manager->rds_update = std::move(rds_update);
return GRPC_ERROR_NONE;
@@ -2007,7 +2393,7 @@ grpc_error* HttpConnectionManagerParse(
return GRPC_ERROR_NONE;
}
-grpc_error* LdsResponseParseClient(
+grpc_error_handle LdsResourceParseClient(
const EncodingContext& context,
const envoy_config_listener_v3_ApiListener* api_listener, bool is_v2,
XdsApi::LdsUpdate* lds_update) {
@@ -2026,60 +2412,90 @@ grpc_error* LdsResponseParseClient(
&lds_update->http_connection_manager);
}
-grpc_error* DownstreamTlsContextParse(
+grpc_error_handle DownstreamTlsContextParse(
const EncodingContext& context,
const envoy_config_core_v3_TransportSocket* transport_socket,
XdsApi::DownstreamTlsContext* downstream_tls_context) {
y_absl::string_view name = UpbStringToAbsl(
envoy_config_core_v3_TransportSocket_name(transport_socket));
- if (name == "envoy.transport_sockets.tls") {
- auto* typed_config =
- envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
- if (typed_config != nullptr) {
- const upb_strview encoded_downstream_tls_context =
- google_protobuf_Any_value(typed_config);
- auto* downstream_tls_context_proto =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(
- encoded_downstream_tls_context.data,
- encoded_downstream_tls_context.size, context.arena);
- if (downstream_tls_context_proto == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Can't decode downstream tls context.");
- }
- auto* common_tls_context =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
- downstream_tls_context_proto);
- if (common_tls_context != nullptr) {
- grpc_error* error = CommonTlsContextParse(
- common_tls_context, &downstream_tls_context->common_tls_context);
- if (error != GRPC_ERROR_NONE) return error;
- }
- auto* require_client_certificate =
- envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(
- downstream_tls_context_proto);
- if (require_client_certificate != nullptr) {
- downstream_tls_context->require_client_certificate =
- google_protobuf_BoolValue_value(require_client_certificate);
- }
- }
- if (downstream_tls_context->common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name
- .empty()) {
+ if (name != "envoy.transport_sockets.tls") {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unrecognized transport socket: ", name));
+ }
+ auto* typed_config =
+ envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
+ std::vector<grpc_error_handle> errors;
+ if (typed_config != nullptr) {
+ const upb_strview encoded_downstream_tls_context =
+ google_protobuf_Any_value(typed_config);
+ auto* downstream_tls_context_proto =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_parse(
+ encoded_downstream_tls_context.data,
+ encoded_downstream_tls_context.size, context.arena);
+ if (downstream_tls_context_proto == nullptr) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "TLS configuration provided but no "
- "tls_certificate_certificate_provider_instance found.");
- }
- }
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* CidrRangeParse(
+ "Can't decode downstream tls context.");
+ }
+ auto* common_tls_context =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_common_tls_context(
+ downstream_tls_context_proto);
+ if (common_tls_context != nullptr) {
+ grpc_error_handle error =
+ CommonTlsContextParse(context, common_tls_context,
+ &downstream_tls_context->common_tls_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ auto* require_client_certificate =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_client_certificate(
+ downstream_tls_context_proto);
+ if (require_client_certificate != nullptr) {
+ downstream_tls_context->require_client_certificate =
+ google_protobuf_BoolValue_value(require_client_certificate);
+ }
+ auto* require_sni =
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_require_sni(
+ downstream_tls_context_proto);
+ if (require_sni != nullptr &&
+ google_protobuf_BoolValue_value(require_sni)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("require_sni: unsupported"));
+ }
+ if (envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_ocsp_staple_policy(
+ downstream_tls_context_proto) !=
+ envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_LENIENT_STAPLING) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ocsp_staple_policy: Only LENIENT_STAPLING supported"));
+ }
+ }
+ if (downstream_tls_context->common_tls_context
+ .tls_certificate_provider_instance.instance_name.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TLS configuration provided but no "
+ "tls_certificate_provider_instance found."));
+ }
+ if (downstream_tls_context->require_client_certificate &&
+ downstream_tls_context->common_tls_context.certificate_validation_context
+ .ca_certificate_provider_instance.instance_name.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TLS configuration requires client certificates but no certificate "
+ "provider instance specified for validation."));
+ }
+ if (!downstream_tls_context->common_tls_context.certificate_validation_context
+ .match_subject_alt_names.empty()) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "match_subject_alt_names not supported on servers"));
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing DownstreamTlsContext",
+ &errors);
+}
+
+grpc_error_handle CidrRangeParse(
const envoy_config_core_v3_CidrRange* cidr_range_proto,
XdsApi::LdsUpdate::FilterChainMap::CidrRange* cidr_range) {
TString address_prefix = UpbStringToStdString(
envoy_config_core_v3_CidrRange_address_prefix(cidr_range_proto));
- grpc_error* error = grpc_string_to_sockaddr_new(&cidr_range->address,
- address_prefix.c_str(), 0);
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&cidr_range->address, address_prefix.c_str(), 0);
if (error != GRPC_ERROR_NONE) return error;
cidr_range->prefix_len = 0;
auto* prefix_len_proto =
@@ -2097,7 +2513,7 @@ grpc_error* CidrRangeParse(
return GRPC_ERROR_NONE;
}
-grpc_error* FilterChainMatchParse(
+grpc_error_handle FilterChainMatchParse(
const envoy_config_listener_v3_FilterChainMatch* filter_chain_match_proto,
FilterChain::FilterChainMatch* filter_chain_match) {
auto* destination_port =
@@ -2113,7 +2529,7 @@ grpc_error* FilterChainMatchParse(
filter_chain_match->prefix_ranges.reserve(size);
for (size_t i = 0; i < size; i++) {
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
- grpc_error* error = CidrRangeParse(prefix_ranges[i], &cidr_range);
+ grpc_error_handle error = CidrRangeParse(prefix_ranges[i], &cidr_range);
if (error != GRPC_ERROR_NONE) return error;
filter_chain_match->prefix_ranges.push_back(cidr_range);
}
@@ -2127,7 +2543,8 @@ grpc_error* FilterChainMatchParse(
filter_chain_match->source_prefix_ranges.reserve(size);
for (size_t i = 0; i < size; i++) {
XdsApi::LdsUpdate::FilterChainMap::CidrRange cidr_range;
- grpc_error* error = CidrRangeParse(source_prefix_ranges[i], &cidr_range);
+ grpc_error_handle error =
+ CidrRangeParse(source_prefix_ranges[i], &cidr_range);
if (error != GRPC_ERROR_NONE) return error;
filter_chain_match->source_prefix_ranges.push_back(cidr_range);
}
@@ -2156,79 +2573,81 @@ grpc_error* FilterChainMatchParse(
return GRPC_ERROR_NONE;
}
-grpc_error* FilterChainParse(
+grpc_error_handle FilterChainParse(
const EncodingContext& context,
const envoy_config_listener_v3_FilterChain* filter_chain_proto, bool is_v2,
FilterChain* filter_chain) {
- grpc_error* error = GRPC_ERROR_NONE;
+ std::vector<grpc_error_handle> errors;
auto* filter_chain_match =
envoy_config_listener_v3_FilterChain_filter_chain_match(
filter_chain_proto);
if (filter_chain_match != nullptr) {
- error = FilterChainMatchParse(filter_chain_match,
- &filter_chain->filter_chain_match);
- if (error != GRPC_ERROR_NONE) return error;
+ grpc_error_handle error = FilterChainMatchParse(
+ filter_chain_match, &filter_chain->filter_chain_match);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
}
+ filter_chain->filter_chain_data =
+ std::make_shared<XdsApi::LdsUpdate::FilterChainData>();
// Parse the filters list. Currently we only support HttpConnectionManager.
size_t size = 0;
auto* filters =
envoy_config_listener_v3_FilterChain_filters(filter_chain_proto, &size);
if (size != 1) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"FilterChain should have exactly one filter: HttpConnectionManager; no "
- "other filter is supported at the moment");
- }
- auto* typed_config = envoy_config_listener_v3_Filter_typed_config(filters[0]);
- if (typed_config == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No typed_config found in filter.");
- }
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(typed_config));
- if (type_url !=
- "type.googleapis.com/"
- "envoy.extensions.filters.network.http_connection_manager.v3."
- "HttpConnectionManager") {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Unsupported filter type ", type_url).c_str());
- }
- const upb_strview encoded_http_connection_manager =
- google_protobuf_Any_value(typed_config);
- const auto* http_connection_manager =
- envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
- encoded_http_connection_manager.data,
- encoded_http_connection_manager.size, context.arena);
- if (http_connection_manager == nullptr) {
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Could not parse HttpConnectionManager config from filter "
- "typed_config");
- }
- filter_chain->filter_chain_data =
- std::make_shared<XdsApi::LdsUpdate::FilterChainData>();
- error = HttpConnectionManagerParse(
- false /* is_client */, context, http_connection_manager, is_v2,
- &filter_chain->filter_chain_data->http_connection_manager);
- if (error != GRPC_ERROR_NONE) return error;
- // Get the DownstreamTlsContext for the filter chain
- if (XdsSecurityEnabled()) {
- auto* transport_socket =
- envoy_config_listener_v3_FilterChain_transport_socket(
- filter_chain_proto);
- if (transport_socket != nullptr) {
- error = DownstreamTlsContextParse(
- context, transport_socket,
- &filter_chain->filter_chain_data->downstream_tls_context);
+ "other filter is supported at the moment"));
+ } else {
+ auto* typed_config =
+ envoy_config_listener_v3_Filter_typed_config(filters[0]);
+ if (typed_config == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "No typed_config found in filter."));
+ } else {
+ y_absl::string_view type_url =
+ UpbStringToAbsl(google_protobuf_Any_type_url(typed_config));
+ if (type_url !=
+ "type.googleapis.com/"
+ "envoy.extensions.filters.network.http_connection_manager.v3."
+ "HttpConnectionManager") {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unsupported filter type ", type_url)));
+ } else {
+ const upb_strview encoded_http_connection_manager =
+ google_protobuf_Any_value(typed_config);
+ const auto* http_connection_manager =
+ envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_parse(
+ encoded_http_connection_manager.data,
+ encoded_http_connection_manager.size, context.arena);
+ if (http_connection_manager == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Could not parse HttpConnectionManager config from filter "
+ "typed_config"));
+ } else {
+ grpc_error_handle error = HttpConnectionManagerParse(
+ false /* is_client */, context, http_connection_manager, is_v2,
+ &filter_chain->filter_chain_data->http_connection_manager);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ }
}
}
- return error;
+ auto* transport_socket =
+ envoy_config_listener_v3_FilterChain_transport_socket(filter_chain_proto);
+ if (transport_socket != nullptr) {
+ grpc_error_handle error = DownstreamTlsContextParse(
+ context, transport_socket,
+ &filter_chain->filter_chain_data->downstream_tls_context);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("Error parsing FilterChain", &errors);
}
-grpc_error* AddressParse(const envoy_config_core_v3_Address* address_proto,
- TString* address) {
+grpc_error_handle AddressParse(
+ const envoy_config_core_v3_Address* address_proto, TString* address) {
const auto* socket_address =
envoy_config_core_v3_Address_socket_address(address_proto);
if (socket_address == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Address does not have socket_address");
}
if (envoy_config_core_v3_SocketAddress_protocol(socket_address) !=
@@ -2263,7 +2682,7 @@ struct InternalFilterChainMap {
DestinationIpMap destination_ip_map;
};
-grpc_error* AddFilterChainDataForSourcePort(
+grpc_error_handle AddFilterChainDataForSourcePort(
const FilterChain& filter_chain,
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map,
uint32_t port) {
@@ -2271,23 +2690,21 @@ grpc_error* AddFilterChainDataForSourcePort(
port, XdsApi::LdsUpdate::FilterChainMap::FilterChainDataSharedPtr{
filter_chain.filter_chain_data});
if (!insert_result.second) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Duplicate matching rules detected when adding filter chain: ",
- filter_chain.filter_chain_match.ToString())
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Duplicate matching rules detected when adding filter chain: ",
+ filter_chain.filter_chain_match.ToString()));
}
return GRPC_ERROR_NONE;
}
-grpc_error* AddFilterChainDataForSourcePorts(
+grpc_error_handle AddFilterChainDataForSourcePorts(
const FilterChain& filter_chain,
XdsApi::LdsUpdate::FilterChainMap::SourcePortsMap* ports_map) {
if (filter_chain.filter_chain_match.source_ports.empty()) {
return AddFilterChainDataForSourcePort(filter_chain, ports_map, 0);
} else {
for (uint32_t port : filter_chain.filter_chain_match.source_ports) {
- grpc_error* error =
+ grpc_error_handle error =
AddFilterChainDataForSourcePort(filter_chain, ports_map, port);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -2295,7 +2712,7 @@ grpc_error* AddFilterChainDataForSourcePorts(
return GRPC_ERROR_NONE;
}
-grpc_error* AddFilterChainDataForSourceIpRange(
+grpc_error_handle AddFilterChainDataForSourceIpRange(
const FilterChain& filter_chain,
InternalFilterChainMap::SourceIpMap* source_ip_map) {
if (filter_chain.filter_chain_match.source_prefix_ranges.empty()) {
@@ -2313,7 +2730,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
if (insert_result.second) {
insert_result.first->second.prefix_range.emplace(prefix_range);
}
- grpc_error* error = AddFilterChainDataForSourcePorts(
+ grpc_error_handle error = AddFilterChainDataForSourcePorts(
filter_chain, &insert_result.first->second.ports_map);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -2321,7 +2738,7 @@ grpc_error* AddFilterChainDataForSourceIpRange(
return GRPC_ERROR_NONE;
}
-grpc_error* AddFilterChainDataForSourceType(
+grpc_error_handle AddFilterChainDataForSourceType(
const FilterChain& filter_chain,
InternalFilterChainMap::DestinationIp* destination_ip) {
GPR_ASSERT(static_cast<unsigned int>(
@@ -2331,7 +2748,7 @@ grpc_error* AddFilterChainDataForSourceType(
filter_chain.filter_chain_match.source_type)]);
}
-grpc_error* AddFilterChainDataForApplicationProtocols(
+grpc_error_handle AddFilterChainDataForApplicationProtocols(
const FilterChain& filter_chain,
InternalFilterChainMap::DestinationIp* destination_ip) {
// Only allow filter chains that do not mention application protocols
@@ -2341,7 +2758,7 @@ grpc_error* AddFilterChainDataForApplicationProtocols(
return AddFilterChainDataForSourceType(filter_chain, destination_ip);
}
-grpc_error* AddFilterChainDataForTransportProtocol(
+grpc_error_handle AddFilterChainDataForTransportProtocol(
const FilterChain& filter_chain,
InternalFilterChainMap::DestinationIp* destination_ip) {
const TString& transport_protocol =
@@ -2369,7 +2786,7 @@ grpc_error* AddFilterChainDataForTransportProtocol(
destination_ip);
}
-grpc_error* AddFilterChainDataForServerNames(
+grpc_error_handle AddFilterChainDataForServerNames(
const FilterChain& filter_chain,
InternalFilterChainMap::DestinationIp* destination_ip) {
// Don't continue adding filter chains with server names mentioned
@@ -2379,7 +2796,7 @@ grpc_error* AddFilterChainDataForServerNames(
return AddFilterChainDataForTransportProtocol(filter_chain, destination_ip);
}
-grpc_error* AddFilterChainDataForDestinationIpRange(
+grpc_error_handle AddFilterChainDataForDestinationIpRange(
const FilterChain& filter_chain,
InternalFilterChainMap::DestinationIpMap* destination_ip_map) {
if (filter_chain.filter_chain_match.prefix_ranges.empty()) {
@@ -2397,7 +2814,7 @@ grpc_error* AddFilterChainDataForDestinationIpRange(
if (insert_result.second) {
insert_result.first->second.prefix_range.emplace(prefix_range);
}
- grpc_error* error = AddFilterChainDataForServerNames(
+ grpc_error_handle error = AddFilterChainDataForServerNames(
filter_chain, &insert_result.first->second);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -2424,14 +2841,14 @@ XdsApi::LdsUpdate::FilterChainMap BuildFromInternalFilterChainMap(
return filter_chain_map;
}
-grpc_error* BuildFilterChainMap(
+grpc_error_handle BuildFilterChainMap(
const std::vector<FilterChain>& filter_chains,
XdsApi::LdsUpdate::FilterChainMap* filter_chain_map) {
InternalFilterChainMap internal_filter_chain_map;
for (const auto& filter_chain : filter_chains) {
// Discard filter chain entries that specify destination port
if (filter_chain.filter_chain_match.destination_port != 0) continue;
- grpc_error* error = AddFilterChainDataForDestinationIpRange(
+ grpc_error_handle error = AddFilterChainDataForDestinationIpRange(
filter_chain, &internal_filter_chain_map.destination_ip_map);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -2440,12 +2857,12 @@ grpc_error* BuildFilterChainMap(
return GRPC_ERROR_NONE;
}
-grpc_error* LdsResponseParseServer(
+grpc_error_handle LdsResourceParseServer(
const EncodingContext& context,
const envoy_config_listener_v3_Listener* listener, bool is_v2,
XdsApi::LdsUpdate* lds_update) {
lds_update->type = XdsApi::LdsUpdate::ListenerType::kTcpListener;
- grpc_error* error =
+ grpc_error_handle error =
AddressParse(envoy_config_listener_v3_Listener_address(listener),
&lds_update->address);
if (error != GRPC_ERROR_NONE) return error;
@@ -2489,501 +2906,330 @@ grpc_error* LdsResponseParseServer(
return GRPC_ERROR_NONE;
}
-grpc_error* LdsResponseParse(
+grpc_error_handle LdsResourceParse(
const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_listener_names,
- XdsApi::LdsUpdateMap* lds_update_map,
- std::set<TString>* resource_names_failed) {
- std::vector<grpc_error*> errors;
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- bool is_v2 = false;
- if (!IsLds(type_url, &is_v2)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Resource is not LDS.")
- .c_str()));
- continue;
- }
- // Decode the listener.
- const upb_strview encoded_listener =
- google_protobuf_Any_value(resources[i]);
- const envoy_config_listener_v3_Listener* listener =
- envoy_config_listener_v3_Listener_parse(
- encoded_listener.data, encoded_listener.size, context.arena);
- if (listener == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Can't decode listener.")
- .c_str()));
- continue;
- }
- // Check listener name. Ignore unexpected listeners.
- TString listener_name =
- UpbStringToStdString(envoy_config_listener_v3_Listener_name(listener));
- if (expected_listener_names.find(listener_name) ==
- expected_listener_names.end()) {
- continue;
- }
- // Fail if listener name is duplicated.
- if (lds_update_map->find(listener_name) != lds_update_map->end()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate listener name \"", listener_name, "\"")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- // Serialize into JSON and store it in the LdsUpdateMap
- XdsApi::LdsResourceData& lds_resource_data =
- (*lds_update_map)[listener_name];
- XdsApi::LdsUpdate& lds_update = lds_resource_data.resource;
- lds_resource_data.serialized_proto = UpbStringToStdString(encoded_listener);
- // Check whether it's a client or server listener.
- const envoy_config_listener_v3_ApiListener* api_listener =
- envoy_config_listener_v3_Listener_api_listener(listener);
- const envoy_config_core_v3_Address* address =
- envoy_config_listener_v3_Listener_address(listener);
- if (api_listener != nullptr && address != nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(listener_name,
- ": Listener has both address and ApiListener")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- if (api_listener == nullptr && address == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(listener_name,
- ": Listener has neither address nor ApiListener")
- .c_str()));
- resource_names_failed->insert(listener_name);
- continue;
- }
- grpc_error* error = GRPC_ERROR_NONE;
- if (api_listener != nullptr) {
- error = LdsResponseParseClient(context, api_listener, is_v2, &lds_update);
- } else {
- error = LdsResponseParseServer(context, listener, is_v2, &lds_update);
- }
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(listener_name, ": validation error").c_str()),
- error));
- resource_names_failed->insert(listener_name);
- }
+ const envoy_config_listener_v3_Listener* listener, bool is_v2,
+ XdsApi::LdsUpdate* lds_update) {
+ // Check whether it's a client or server listener.
+ const envoy_config_listener_v3_ApiListener* api_listener =
+ envoy_config_listener_v3_Listener_api_listener(listener);
+ const envoy_config_core_v3_Address* address =
+ envoy_config_listener_v3_Listener_address(listener);
+ if (api_listener != nullptr && address != nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Listener has both address and ApiListener");
+ }
+ if (api_listener == nullptr && address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Listener has neither address nor ApiListener");
+ }
+ // Validate Listener fields.
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (api_listener != nullptr) {
+ error = LdsResourceParseClient(context, api_listener, is_v2, lds_update);
+ } else {
+ error = LdsResourceParseServer(context, listener, is_v2, lds_update);
}
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing LDS response", &errors);
+ return error;
}
-grpc_error* RdsResponseParse(
+grpc_error_handle UpstreamTlsContextParse(
const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- XdsApi::RdsUpdateMap* rds_update_map,
- std::set<TString>* resource_names_failed) {
- std::vector<grpc_error*> errors;
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsRds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Resource is not RDS.")
- .c_str()));
- continue;
- }
- // Decode the route_config.
- const upb_strview encoded_route_config =
- google_protobuf_Any_value(resources[i]);
- const envoy_config_route_v3_RouteConfiguration* route_config =
- envoy_config_route_v3_RouteConfiguration_parse(
- encoded_route_config.data, encoded_route_config.size,
- context.arena);
- if (route_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Can't decode route_config.")
- .c_str()));
- continue;
- }
- // Check route_config_name. Ignore unexpected route_config.
- TString route_config_name = UpbStringToStdString(
- envoy_config_route_v3_RouteConfiguration_name(route_config));
- if (expected_route_configuration_names.find(route_config_name) ==
- expected_route_configuration_names.end()) {
- continue;
- }
- // Fail if route config name is duplicated.
- if (rds_update_map->find(route_config_name) != rds_update_map->end()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate route config name \"", route_config_name,
- "\"")
- .c_str()));
- resource_names_failed->insert(route_config_name);
- continue;
- }
- // Serialize into JSON and store it in the RdsUpdateMap
- XdsApi::RdsResourceData& rds_resource_data =
- (*rds_update_map)[route_config_name];
- XdsApi::RdsUpdate& rds_update = rds_resource_data.resource;
- rds_resource_data.serialized_proto =
- UpbStringToStdString(encoded_route_config);
- // Parse the route_config.
- grpc_error* error = RouteConfigParse(context, route_config, &rds_update);
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(route_config_name, ": validation error").c_str()),
- error));
- resource_names_failed->insert(route_config_name);
+ const envoy_config_core_v3_TransportSocket* transport_socket,
+ XdsApi::CommonTlsContext* common_tls_context) {
+ // Record Upstream tls context
+ y_absl::string_view name = UpbStringToAbsl(
+ envoy_config_core_v3_TransportSocket_name(transport_socket));
+ if (name != "envoy.transport_sockets.tls") {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unrecognized transport socket: ", name));
+ }
+ auto* typed_config =
+ envoy_config_core_v3_TransportSocket_typed_config(transport_socket);
+ if (typed_config != nullptr) {
+ const upb_strview encoded_upstream_tls_context =
+ google_protobuf_Any_value(typed_config);
+ auto* upstream_tls_context =
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(
+ encoded_upstream_tls_context.data,
+ encoded_upstream_tls_context.size, context.arena);
+ if (upstream_tls_context == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't decode upstream tls context.");
+ }
+ auto* common_tls_context_proto =
+ envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
+ upstream_tls_context);
+ if (common_tls_context_proto != nullptr) {
+ grpc_error_handle error = CommonTlsContextParse(
+ context, common_tls_context_proto, common_tls_context);
+ if (error != GRPC_ERROR_NONE) {
+ return grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Error parsing UpstreamTlsContext"),
+ error);
+ }
}
}
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing RDS response", &errors);
+ if (common_tls_context->certificate_validation_context
+ .ca_certificate_provider_instance.instance_name.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "UpstreamTlsContext: TLS configuration provided but no "
+ "ca_certificate_provider_instance found.");
+ }
+ return GRPC_ERROR_NONE;
}
-grpc_error* CdsResponseParse(
+grpc_error_handle CdsLogicalDnsParse(
+ const envoy_config_cluster_v3_Cluster* cluster,
+ XdsApi::CdsUpdate* cds_update) {
+ const auto* load_assignment =
+ envoy_config_cluster_v3_Cluster_load_assignment(cluster);
+ if (load_assignment == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "load_assignment not present for LOGICAL_DNS cluster");
+ }
+ size_t num_localities;
+ const auto* const* localities =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(load_assignment,
+ &num_localities);
+ if (num_localities != 1) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("load_assignment for LOGICAL_DNS cluster must have "
+ "exactly one locality, found ",
+ num_localities));
+ }
+ size_t num_endpoints;
+ const auto* const* endpoints =
+ envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(localities[0],
+ &num_endpoints);
+ if (num_endpoints != 1) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("locality for LOGICAL_DNS cluster must have "
+ "exactly one endpoint, found ",
+ num_endpoints));
+ }
+ const auto* endpoint =
+ envoy_config_endpoint_v3_LbEndpoint_endpoint(endpoints[0]);
+ if (endpoint == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LbEndpoint endpoint field not set");
+ }
+ const auto* address = envoy_config_endpoint_v3_Endpoint_address(endpoint);
+ if (address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Endpoint address field not set");
+ }
+ const auto* socket_address =
+ envoy_config_core_v3_Address_socket_address(address);
+ if (socket_address == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Address socket_address field not set");
+ }
+ if (envoy_config_core_v3_SocketAddress_resolver_name(socket_address).size !=
+ 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "LOGICAL_DNS clusters must NOT have a custom resolver name set");
+ }
+ y_absl::string_view address_str = UpbStringToAbsl(
+ envoy_config_core_v3_SocketAddress_address(socket_address));
+ if (address_str.empty()) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "SocketAddress address field not set");
+ }
+ if (!envoy_config_core_v3_SocketAddress_has_port_value(socket_address)) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "SocketAddress port_value field not set");
+ }
+ cds_update->dns_hostname = JoinHostPort(
+ address_str,
+ envoy_config_core_v3_SocketAddress_port_value(socket_address));
+ return GRPC_ERROR_NONE;
+}
+
+grpc_error_handle CdsResourceParse(
const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_cluster_names,
- XdsApi::CdsUpdateMap* cds_update_map,
- std::set<TString>* resource_names_failed) {
- std::vector<grpc_error*> errors;
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- // Parse all the resources in the CDS response.
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsCds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Resource is not CDS.")
- .c_str()));
- continue;
- }
- // Decode the cluster.
- const upb_strview encoded_cluster = google_protobuf_Any_value(resources[i]);
- const envoy_config_cluster_v3_Cluster* cluster =
- envoy_config_cluster_v3_Cluster_parse(
- encoded_cluster.data, encoded_cluster.size, context.arena);
- if (cluster == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Can't decode cluster.")
- .c_str()));
- continue;
- }
- MaybeLogCluster(context, cluster);
- // Ignore unexpected cluster names.
- TString cluster_name =
- UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(cluster));
- if (expected_cluster_names.find(cluster_name) ==
- expected_cluster_names.end()) {
- continue;
- }
- // Fail on duplicate resources.
- if (cds_update_map->find(cluster_name) != cds_update_map->end()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate resource name \"", cluster_name, "\"")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- // Serialize into JSON and store it in the CdsUpdateMap
- XdsApi::CdsResourceData& cds_resource_data =
- (*cds_update_map)[cluster_name];
- XdsApi::CdsUpdate& cds_update = cds_resource_data.resource;
- cds_resource_data.serialized_proto = UpbStringToStdString(encoded_cluster);
- // Check the cluster_discovery_type.
- if (!envoy_config_cluster_v3_Cluster_has_type(cluster) &&
- !envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": DiscoveryType not found.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- if (envoy_config_cluster_v3_Cluster_type(cluster) ==
- envoy_config_cluster_v3_Cluster_EDS) {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::EDS;
- // Check the EDS config source.
- const envoy_config_cluster_v3_Cluster_EdsClusterConfig*
- eds_cluster_config =
- envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
- const envoy_config_core_v3_ConfigSource* eds_config =
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
- eds_cluster_config);
- if (!envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": EDS ConfigSource is not ADS.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- // Record EDS service_name (if any).
- upb_strview service_name =
- envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
- eds_cluster_config);
- if (service_name.size != 0) {
- cds_update.eds_service_name = UpbStringToStdString(service_name);
- }
- } else if (!XdsAggregateAndLogicalDnsClusterEnabled()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": DiscoveryType is not valid.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
- envoy_config_cluster_v3_Cluster_LOGICAL_DNS) {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS;
+ const envoy_config_cluster_v3_Cluster* cluster, bool /*is_v2*/,
+ XdsApi::CdsUpdate* cds_update) {
+ std::vector<grpc_error_handle> errors;
+ // Check the cluster_discovery_type.
+ if (!envoy_config_cluster_v3_Cluster_has_type(cluster) &&
+ !envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType not found."));
+ } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
+ envoy_config_cluster_v3_Cluster_EDS) {
+ cds_update->cluster_type = XdsApi::CdsUpdate::ClusterType::EDS;
+ // Check the EDS config source.
+ const envoy_config_cluster_v3_Cluster_EdsClusterConfig* eds_cluster_config =
+ envoy_config_cluster_v3_Cluster_eds_cluster_config(cluster);
+ const envoy_config_core_v3_ConfigSource* eds_config =
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_eds_config(
+ eds_cluster_config);
+ if (!envoy_config_core_v3_ConfigSource_has_ads(eds_config)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("EDS ConfigSource is not ADS."));
+ }
+ // Record EDS service_name (if any).
+ upb_strview service_name =
+ envoy_config_cluster_v3_Cluster_EdsClusterConfig_service_name(
+ eds_cluster_config);
+ if (service_name.size != 0) {
+ cds_update->eds_service_name = UpbStringToStdString(service_name);
+ }
+ } else if (!XdsAggregateAndLogicalDnsClusterEnabled()) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not valid."));
+ } else if (envoy_config_cluster_v3_Cluster_type(cluster) ==
+ envoy_config_cluster_v3_Cluster_LOGICAL_DNS) {
+ cds_update->cluster_type = XdsApi::CdsUpdate::ClusterType::LOGICAL_DNS;
+ grpc_error_handle error = CdsLogicalDnsParse(cluster, cds_update);
+ if (error != GRPC_ERROR_NONE) errors.push_back(error);
+ } else {
+ if (!envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("DiscoveryType is not valid."));
} else {
- if (envoy_config_cluster_v3_Cluster_has_cluster_type(cluster)) {
- const envoy_config_cluster_v3_Cluster_CustomClusterType*
- custom_cluster_type =
- envoy_config_cluster_v3_Cluster_cluster_type(cluster);
- upb_strview type_name =
- envoy_config_cluster_v3_Cluster_CustomClusterType_name(
+ const envoy_config_cluster_v3_Cluster_CustomClusterType*
+ custom_cluster_type =
+ envoy_config_cluster_v3_Cluster_cluster_type(cluster);
+ upb_strview type_name =
+ envoy_config_cluster_v3_Cluster_CustomClusterType_name(
+ custom_cluster_type);
+ if (UpbStringToAbsl(type_name) != "envoy.clusters.aggregate") {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "DiscoveryType is not valid."));
+ } else {
+ cds_update->cluster_type = XdsApi::CdsUpdate::ClusterType::AGGREGATE;
+ // Retrieve aggregate clusters.
+ const google_protobuf_Any* typed_config =
+ envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(
custom_cluster_type);
- if (UpbStringToAbsl(type_name) == "envoy.clusters.aggregate") {
- cds_update.cluster_type = XdsApi::CdsUpdate::ClusterType::AGGREGATE;
- // Retrieve aggregate clusters.
- const google_protobuf_Any* typed_config =
- envoy_config_cluster_v3_Cluster_CustomClusterType_typed_config(
- custom_cluster_type);
- const upb_strview aggregate_cluster_config_upb_strview =
- google_protobuf_Any_value(typed_config);
- const envoy_extensions_clusters_aggregate_v3_ClusterConfig*
- aggregate_cluster_config =
- envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(
- aggregate_cluster_config_upb_strview.data,
- aggregate_cluster_config_upb_strview.size, context.arena);
- if (aggregate_cluster_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": Can't parse aggregate cluster.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
+ const upb_strview aggregate_cluster_config_upb_strview =
+ google_protobuf_Any_value(typed_config);
+ const envoy_extensions_clusters_aggregate_v3_ClusterConfig*
+ aggregate_cluster_config =
+ envoy_extensions_clusters_aggregate_v3_ClusterConfig_parse(
+ aggregate_cluster_config_upb_strview.data,
+ aggregate_cluster_config_upb_strview.size, context.arena);
+ if (aggregate_cluster_config == nullptr) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Can't parse aggregate cluster."));
+ } else {
size_t size;
const upb_strview* clusters =
envoy_extensions_clusters_aggregate_v3_ClusterConfig_clusters(
aggregate_cluster_config, &size);
for (size_t i = 0; i < size; ++i) {
const upb_strview cluster = clusters[i];
- cds_update.prioritized_cluster_names.emplace_back(
+ cds_update->prioritized_cluster_names.emplace_back(
UpbStringToStdString(cluster));
}
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": DiscoveryType is not valid.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
}
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": DiscoveryType is not valid.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
}
}
- // Check the LB policy.
- if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
- envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
- cds_update.lb_policy = "ROUND_ROBIN";
- } else if (XdsRingHashEnabled() &&
- envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
- envoy_config_cluster_v3_Cluster_RING_HASH) {
- cds_update.lb_policy = "RING_HASH";
- // Record ring hash lb config
- auto* ring_hash_config =
- envoy_config_cluster_v3_Cluster_ring_hash_lb_config(cluster);
- if (ring_hash_config == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name,
- ": ring hash lb config required but not present.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
+ }
+ // Check the LB policy.
+ if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
+ envoy_config_cluster_v3_Cluster_ROUND_ROBIN) {
+ cds_update->lb_policy = "ROUND_ROBIN";
+ } else if (envoy_config_cluster_v3_Cluster_lb_policy(cluster) ==
+ envoy_config_cluster_v3_Cluster_RING_HASH) {
+ cds_update->lb_policy = "RING_HASH";
+ // Record ring hash lb config
+ auto* ring_hash_config =
+ envoy_config_cluster_v3_Cluster_ring_hash_lb_config(cluster);
+ if (ring_hash_config != nullptr) {
const google_protobuf_UInt64Value* max_ring_size =
envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(
ring_hash_config);
if (max_ring_size != nullptr) {
- cds_update.max_ring_size =
+ cds_update->max_ring_size =
google_protobuf_UInt64Value_value(max_ring_size);
- if (cds_update.max_ring_size > 8388608 ||
- cds_update.max_ring_size == 0) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- cluster_name,
- ": max_ring_size is not in the range of 1 to 8388608.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
+ if (cds_update->max_ring_size > 8388608 ||
+ cds_update->max_ring_size == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "max_ring_size is not in the range of 1 to 8388608."));
}
}
const google_protobuf_UInt64Value* min_ring_size =
envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(
ring_hash_config);
if (min_ring_size != nullptr) {
- cds_update.min_ring_size =
+ cds_update->min_ring_size =
google_protobuf_UInt64Value_value(min_ring_size);
- if (cds_update.min_ring_size > 8388608 ||
- cds_update.min_ring_size == 0) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- cluster_name,
- ": min_ring_size is not in the range of 1 to 8388608.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
+ if (cds_update->min_ring_size > 8388608 ||
+ cds_update->min_ring_size == 0) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "min_ring_size is not in the range of 1 to 8388608."));
}
- if (cds_update.min_ring_size > cds_update.max_ring_size) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- cluster_name,
- ": min_ring_size cannot be greater than max_ring_size.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
+ if (cds_update->min_ring_size > cds_update->max_ring_size) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "min_ring_size cannot be greater than max_ring_size."));
}
}
if (envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
- ring_hash_config) ==
+ ring_hash_config) !=
envoy_config_cluster_v3_Cluster_RingHashLbConfig_XX_HASH) {
- cds_update.hash_function = XdsApi::CdsUpdate::HashFunction::XX_HASH;
- } else if (
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_hash_function(
- ring_hash_config) ==
- envoy_config_cluster_v3_Cluster_RingHashLbConfig_MURMUR_HASH_2) {
- cds_update.hash_function =
- XdsApi::CdsUpdate::HashFunction::MURMUR_HASH_2;
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name,
- ": ring hash lb config has invalid hash function.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- } else {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": LB policy is not supported.").c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- if (XdsSecurityEnabled()) {
- // Record Upstream tls context
- auto* transport_socket =
- envoy_config_cluster_v3_Cluster_transport_socket(cluster);
- if (transport_socket != nullptr) {
- y_absl::string_view name = UpbStringToAbsl(
- envoy_config_core_v3_TransportSocket_name(transport_socket));
- if (name == "envoy.transport_sockets.tls") {
- auto* typed_config =
- envoy_config_core_v3_TransportSocket_typed_config(
- transport_socket);
- if (typed_config != nullptr) {
- const upb_strview encoded_upstream_tls_context =
- google_protobuf_Any_value(typed_config);
- auto* upstream_tls_context =
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_parse(
- encoded_upstream_tls_context.data,
- encoded_upstream_tls_context.size, context.arena);
- if (upstream_tls_context == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name,
- ": Can't decode upstream tls context.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- auto* common_tls_context =
- envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_common_tls_context(
- upstream_tls_context);
- if (common_tls_context != nullptr) {
- grpc_error* error = CommonTlsContextParse(
- common_tls_context, &cds_update.common_tls_context);
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": error in TLS context")
- .c_str()),
- error));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
- }
- if (cds_update.common_tls_context.combined_validation_context
- .validation_context_certificate_provider_instance
- .instance_name.empty()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name,
- "TLS configuration provided but no "
- "validation_context_certificate_provider_instance "
- "found.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- }
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "ring hash lb config has invalid hash function."));
}
}
- // Record LRS server name (if any).
- const envoy_config_core_v3_ConfigSource* lrs_server =
- envoy_config_cluster_v3_Cluster_lrs_server(cluster);
- if (lrs_server != nullptr) {
- if (!envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(cluster_name, ": LRS ConfigSource is not self.")
- .c_str()));
- resource_names_failed->insert(cluster_name);
- continue;
- }
- cds_update.lrs_load_reporting_server_name.emplace("");
- }
- // The Cluster resource encodes the circuit breaking parameters in a list of
- // Thresholds messages, where each message specifies the parameters for a
- // particular RoutingPriority. we will look only at the first entry in the
- // list for priority DEFAULT and default to 1024 if not found.
- if (envoy_config_cluster_v3_Cluster_has_circuit_breakers(cluster)) {
- const envoy_config_cluster_v3_CircuitBreakers* circuit_breakers =
- envoy_config_cluster_v3_Cluster_circuit_breakers(cluster);
- size_t num_thresholds;
- const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*
- thresholds = envoy_config_cluster_v3_CircuitBreakers_thresholds(
- circuit_breakers, &num_thresholds);
- for (size_t i = 0; i < num_thresholds; ++i) {
- const auto* threshold = thresholds[i];
- if (envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(
- threshold) == envoy_config_core_v3_DEFAULT) {
- const google_protobuf_UInt32Value* max_requests =
- envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(
- threshold);
- if (max_requests != nullptr) {
- cds_update.max_concurrent_requests =
- google_protobuf_UInt32Value_value(max_requests);
- }
- break;
+ } else {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("LB policy is not supported."));
+ }
+ auto* transport_socket =
+ envoy_config_cluster_v3_Cluster_transport_socket(cluster);
+ if (transport_socket != nullptr) {
+ grpc_error_handle error = UpstreamTlsContextParse(
+ context, transport_socket, &cds_update->common_tls_context);
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(
+ grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Error parsing security configuration"),
+ error));
+ }
+ }
+ // Record LRS server name (if any).
+ const envoy_config_core_v3_ConfigSource* lrs_server =
+ envoy_config_cluster_v3_Cluster_lrs_server(cluster);
+ if (lrs_server != nullptr) {
+ if (!envoy_config_core_v3_ConfigSource_has_self(lrs_server)) {
+ errors.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ ": LRS ConfigSource is not self."));
+ }
+ cds_update->lrs_load_reporting_server_name.emplace("");
+ }
+ // The Cluster resource encodes the circuit breaking parameters in a list of
+ // Thresholds messages, where each message specifies the parameters for a
+ // particular RoutingPriority. we will look only at the first entry in the
+ // list for priority DEFAULT and default to 1024 if not found.
+ if (envoy_config_cluster_v3_Cluster_has_circuit_breakers(cluster)) {
+ const envoy_config_cluster_v3_CircuitBreakers* circuit_breakers =
+ envoy_config_cluster_v3_Cluster_circuit_breakers(cluster);
+ size_t num_thresholds;
+ const envoy_config_cluster_v3_CircuitBreakers_Thresholds* const*
+ thresholds = envoy_config_cluster_v3_CircuitBreakers_thresholds(
+ circuit_breakers, &num_thresholds);
+ for (size_t i = 0; i < num_thresholds; ++i) {
+ const auto* threshold = thresholds[i];
+ if (envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(
+ threshold) == envoy_config_core_v3_DEFAULT) {
+ const google_protobuf_UInt32Value* max_requests =
+ envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(
+ threshold);
+ if (max_requests != nullptr) {
+ cds_update->max_concurrent_requests =
+ google_protobuf_UInt32Value_value(max_requests);
}
+ break;
}
}
}
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing CDS response", &errors);
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing CDS resource", &errors);
}
-grpc_error* ServerAddressParseAndAppend(
+grpc_error_handle ServerAddressParseAndAppend(
const envoy_config_endpoint_v3_LbEndpoint* lb_endpoint,
ServerAddressList* list) {
// If health_status is not HEALTHY or UNKNOWN, skip this endpoint.
@@ -3006,17 +3252,32 @@ grpc_error* ServerAddressParseAndAppend(
if (GPR_UNLIKELY(port >> 16) != 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Invalid port.");
}
+ // Find load_balancing_weight for the endpoint.
+ const google_protobuf_UInt32Value* load_balancing_weight =
+ envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(lb_endpoint);
+ const int32_t weight =
+ load_balancing_weight != nullptr
+ ? google_protobuf_UInt32Value_value(load_balancing_weight)
+ : 500;
+ if (weight == 0) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid endpoint weight of 0.");
+ }
// Populate grpc_resolved_address.
grpc_resolved_address addr;
- grpc_error* error =
- grpc_string_to_sockaddr_new(&addr, address_str.c_str(), port);
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&addr, address_str.c_str(), port);
if (error != GRPC_ERROR_NONE) return error;
// Append the address to the list.
- list->emplace_back(addr, nullptr);
+ std::map<const char*, std::unique_ptr<ServerAddress::AttributeInterface>>
+ attributes;
+ attributes[ServerAddressWeightAttribute::kServerAddressWeightAttributeKey] =
+ y_absl::make_unique<ServerAddressWeightAttribute>(weight);
+ list->emplace_back(addr, nullptr, std::move(attributes));
return GRPC_ERROR_NONE;
}
-grpc_error* LocalityParse(
+grpc_error_handle LocalityParse(
const envoy_config_endpoint_v3_LocalityLbEndpoints* locality_lb_endpoints,
XdsApi::EdsUpdate::Priority::Locality* output_locality, size_t* priority) {
// Parse LB weight.
@@ -3050,7 +3311,7 @@ grpc_error* LocalityParse(
envoy_config_endpoint_v3_LocalityLbEndpoints_lb_endpoints(
locality_lb_endpoints, &size);
for (size_t i = 0; i < size; ++i) {
- grpc_error* error = ServerAddressParseAndAppend(
+ grpc_error_handle error = ServerAddressParseAndAppend(
lb_endpoints[i], &output_locality->endpoints);
if (error != GRPC_ERROR_NONE) return error;
}
@@ -3060,7 +3321,7 @@ grpc_error* LocalityParse(
return GRPC_ERROR_NONE;
}
-grpc_error* DropParseAndAppend(
+grpc_error_handle DropParseAndAppend(
const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload*
drop_overload,
XdsApi::EdsUpdate::DropConfig* drop_config) {
@@ -3094,171 +3355,330 @@ grpc_error* DropParseAndAppend(
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unknown denominator type");
}
// Cap numerator to 1000000.
- numerator = GPR_MIN(numerator, 1000000);
+ numerator = std::min(numerator, 1000000u);
drop_config->AddCategory(std::move(category), numerator);
return GRPC_ERROR_NONE;
}
-grpc_error* EdsResponseParse(
- const EncodingContext& context,
- const envoy_service_discovery_v3_DiscoveryResponse* response,
- const std::set<y_absl::string_view>& expected_eds_service_names,
- XdsApi::EdsUpdateMap* eds_update_map,
- std::set<TString>* resource_names_failed) {
- std::vector<grpc_error*> errors;
- // Get the resources from the response.
- size_t size;
- const google_protobuf_Any* const* resources =
- envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
- for (size_t i = 0; i < size; ++i) {
- // Check the type_url of the resource.
- y_absl::string_view type_url =
- UpbStringToAbsl(google_protobuf_Any_type_url(resources[i]));
- if (!IsEds(type_url)) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i, ": Resource is not EDS.")
- .c_str()));
- continue;
- }
- // Get the cluster_load_assignment.
- upb_strview encoded_cluster_load_assignment =
- google_protobuf_Any_value(resources[i]);
- envoy_config_endpoint_v3_ClusterLoadAssignment* cluster_load_assignment =
- envoy_config_endpoint_v3_ClusterLoadAssignment_parse(
- encoded_cluster_load_assignment.data,
- encoded_cluster_load_assignment.size, context.arena);
- if (cluster_load_assignment == nullptr) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("resource index ", i,
- ": Can't parse cluster_load_assignment.")
- .c_str()));
- continue;
- }
- MaybeLogClusterLoadAssignment(context, cluster_load_assignment);
- // Check the EDS service name. Ignore unexpected names.
- TString eds_service_name = UpbStringToStdString(
- envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(
- cluster_load_assignment));
- if (expected_eds_service_names.find(eds_service_name) ==
- expected_eds_service_names.end()) {
- continue;
- }
- // Fail on duplicate resources.
- if (eds_update_map->find(eds_service_name) != eds_update_map->end()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("duplicate resource name \"", eds_service_name, "\"")
- .c_str()));
- resource_names_failed->insert(eds_service_name);
+grpc_error_handle EdsResourceParse(
+ const EncodingContext& /*context*/,
+ const envoy_config_endpoint_v3_ClusterLoadAssignment*
+ cluster_load_assignment,
+ bool /*is_v2*/, XdsApi::EdsUpdate* eds_update) {
+ std::vector<grpc_error_handle> errors;
+ // Get the endpoints.
+ size_t locality_size;
+ const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
+ cluster_load_assignment, &locality_size);
+ for (size_t j = 0; j < locality_size; ++j) {
+ size_t priority;
+ XdsApi::EdsUpdate::Priority::Locality locality;
+ grpc_error_handle error = LocalityParse(endpoints[j], &locality, &priority);
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(error);
continue;
}
- // Serialize into JSON and store it in the EdsUpdateMap
- XdsApi::EdsResourceData& eds_resource_data =
- (*eds_update_map)[eds_service_name];
- XdsApi::EdsUpdate& eds_update = eds_resource_data.resource;
- eds_resource_data.serialized_proto =
- UpbStringToStdString(encoded_cluster_load_assignment);
- // Get the endpoints.
- size_t locality_size;
- const envoy_config_endpoint_v3_LocalityLbEndpoints* const* endpoints =
- envoy_config_endpoint_v3_ClusterLoadAssignment_endpoints(
- cluster_load_assignment, &locality_size);
- grpc_error* error = GRPC_ERROR_NONE;
- for (size_t j = 0; j < locality_size; ++j) {
- size_t priority;
- XdsApi::EdsUpdate::Priority::Locality locality;
- error = LocalityParse(endpoints[j], &locality, &priority);
- if (error != GRPC_ERROR_NONE) break;
- // Filter out locality with weight 0.
- if (locality.lb_weight == 0) continue;
- // Make sure prorities is big enough. Note that they might not
- // arrive in priority order.
- while (eds_update.priorities.size() < priority + 1) {
- eds_update.priorities.emplace_back();
+ // Filter out locality with weight 0.
+ if (locality.lb_weight == 0) continue;
+ // Make sure prorities is big enough. Note that they might not
+ // arrive in priority order.
+ while (eds_update->priorities.size() < priority + 1) {
+ eds_update->priorities.emplace_back();
+ }
+ eds_update->priorities[priority].localities.emplace(locality.name.get(),
+ std::move(locality));
+ }
+ for (const auto& priority : eds_update->priorities) {
+ if (priority.localities.empty()) {
+ errors.push_back(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("sparse priority list"));
+ }
+ }
+ // Get the drop config.
+ eds_update->drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_policy(
+ cluster_load_assignment);
+ if (policy != nullptr) {
+ size_t drop_size;
+ const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
+ drop_overload =
+ envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
+ policy, &drop_size);
+ for (size_t j = 0; j < drop_size; ++j) {
+ grpc_error_handle error =
+ DropParseAndAppend(drop_overload[j], eds_update->drop_config.get());
+ if (error != GRPC_ERROR_NONE) {
+ errors.push_back(
+ grpc_error_add_child(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "drop config validation error"),
+ error));
}
- eds_update.priorities[priority].localities.emplace(locality.name.get(),
- std::move(locality));
}
+ }
+ return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing EDS resource", &errors);
+}
+
+class ListenerResourceType : public XdsResourceType {
+ public:
+ struct ListenerData : public ResourceData {
+ XdsApi::LdsUpdate resource;
+ };
+
+ y_absl::string_view type_url() const override { return XdsApi::kLdsTypeUrl; }
+ y_absl::string_view v2_type_url() const override { return kLdsV2TypeUrl; }
+
+ y_absl::StatusOr<DecodeResult> Decode(const EncodingContext& context,
+ y_absl::string_view serialized_resource,
+ bool is_v2) const override {
+ // Parse serialized proto.
+ auto* resource = envoy_config_listener_v3_Listener_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return y_absl::InvalidArgumentError("Can't parse Listener resource.");
+ }
+ MaybeLogListener(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name =
+ UpbStringToStdString(envoy_config_listener_v3_Listener_name(resource));
+ auto listener_data = y_absl::make_unique<ListenerData>();
+ grpc_error_handle error =
+ LdsResourceParse(context, resource, is_v2, &listener_data->resource);
if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(eds_service_name, ": locality validation error")
- .c_str()),
- error));
- resource_names_failed->insert(eds_service_name);
- continue;
+ result.resource =
+ y_absl::InvalidArgumentError(grpc_error_std_string(error));
+ GRPC_ERROR_UNREF(error);
+ } else {
+ result.resource = std::move(listener_data);
}
- for (const auto& priority : eds_update.priorities) {
- if (priority.localities.empty()) {
- errors.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(eds_service_name, ": sparse priority list").c_str()));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
+ return std::move(result);
+ }
+};
+
+class RouteConfigResourceType : public XdsResourceType {
+ public:
+ struct RouteConfigData : public ResourceData {
+ XdsApi::RdsUpdate resource;
+ };
+
+ y_absl::string_view type_url() const override { return XdsApi::kRdsTypeUrl; }
+ y_absl::string_view v2_type_url() const override { return kRdsV2TypeUrl; }
+
+ y_absl::StatusOr<DecodeResult> Decode(const EncodingContext& context,
+ y_absl::string_view serialized_resource,
+ bool is_v2) const override {
+ // Parse serialized proto.
+ auto* resource = envoy_config_route_v3_RouteConfiguration_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return y_absl::InvalidArgumentError("Can't parse Listener resource.");
+ }
+ MaybeLogRouteConfiguration(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name = UpbStringToStdString(
+ envoy_config_route_v3_RouteConfiguration_name(resource));
+ auto route_config_data = y_absl::make_unique<RouteConfigData>();
+ grpc_error_handle error = RouteConfigParse(context, resource, is_v2,
+ &route_config_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ result.resource =
+ y_absl::InvalidArgumentError(grpc_error_std_string(error));
+ GRPC_ERROR_UNREF(error);
+ } else {
+ result.resource = std::move(route_config_data);
}
- // Get the drop config.
- eds_update.drop_config = MakeRefCounted<XdsApi::EdsUpdate::DropConfig>();
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* policy =
- envoy_config_endpoint_v3_ClusterLoadAssignment_policy(
- cluster_load_assignment);
- if (policy != nullptr) {
- size_t drop_size;
- const envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* const*
- drop_overload =
- envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_drop_overloads(
- policy, &drop_size);
- for (size_t j = 0; j < drop_size; ++j) {
- error =
- DropParseAndAppend(drop_overload[j], eds_update.drop_config.get());
- if (error != GRPC_ERROR_NONE) break;
- }
- if (error != GRPC_ERROR_NONE) {
- errors.push_back(grpc_error_add_child(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(eds_service_name, ": drop config validation error")
- .c_str()),
- error));
- resource_names_failed->insert(eds_service_name);
- continue;
- }
+ return std::move(result);
+ }
+};
+
+class ClusterResourceType : public XdsResourceType {
+ public:
+ struct ClusterData : public ResourceData {
+ XdsApi::CdsUpdate resource;
+ };
+
+ y_absl::string_view type_url() const override { return XdsApi::kCdsTypeUrl; }
+ y_absl::string_view v2_type_url() const override { return kCdsV2TypeUrl; }
+
+ y_absl::StatusOr<DecodeResult> Decode(const EncodingContext& context,
+ y_absl::string_view serialized_resource,
+ bool is_v2) const override {
+ // Parse serialized proto.
+ auto* resource = envoy_config_cluster_v3_Cluster_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return y_absl::InvalidArgumentError("Can't parse Listener resource.");
+ }
+ MaybeLogCluster(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name =
+ UpbStringToStdString(envoy_config_cluster_v3_Cluster_name(resource));
+ auto cluster_data = y_absl::make_unique<ClusterData>();
+ grpc_error_handle error =
+ CdsResourceParse(context, resource, is_v2, &cluster_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ result.resource =
+ y_absl::InvalidArgumentError(grpc_error_std_string(error));
+ GRPC_ERROR_UNREF(error);
+ } else {
+ result.resource = std::move(cluster_data);
}
+ return std::move(result);
}
- return GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing EDS response", &errors);
-}
+};
-TString TypeUrlInternalToExternal(y_absl::string_view type_url) {
- if (type_url == kLdsV2TypeUrl) {
- return XdsApi::kLdsTypeUrl;
- } else if (type_url == kRdsV2TypeUrl) {
- return XdsApi::kRdsTypeUrl;
- } else if (type_url == kCdsV2TypeUrl) {
- return XdsApi::kCdsTypeUrl;
- } else if (type_url == kEdsV2TypeUrl) {
- return XdsApi::kEdsTypeUrl;
+class EndpointResourceType : public XdsResourceType {
+ public:
+ struct EndpointData : public ResourceData {
+ XdsApi::EdsUpdate resource;
+ };
+
+ y_absl::string_view type_url() const override { return XdsApi::kEdsTypeUrl; }
+ y_absl::string_view v2_type_url() const override { return kEdsV2TypeUrl; }
+
+ y_absl::StatusOr<DecodeResult> Decode(const EncodingContext& context,
+ y_absl::string_view serialized_resource,
+ bool is_v2) const override {
+ // Parse serialized proto.
+ auto* resource = envoy_config_endpoint_v3_ClusterLoadAssignment_parse(
+ serialized_resource.data(), serialized_resource.size(), context.arena);
+ if (resource == nullptr) {
+ return y_absl::InvalidArgumentError("Can't parse Listener resource.");
+ }
+ MaybeLogClusterLoadAssignment(context, resource);
+ // Validate resource.
+ DecodeResult result;
+ result.name = UpbStringToStdString(
+ envoy_config_endpoint_v3_ClusterLoadAssignment_cluster_name(resource));
+ auto endpoint_data = y_absl::make_unique<EndpointData>();
+ grpc_error_handle error =
+ EdsResourceParse(context, resource, is_v2, &endpoint_data->resource);
+ if (error != GRPC_ERROR_NONE) {
+ result.resource =
+ y_absl::InvalidArgumentError(grpc_error_std_string(error));
+ GRPC_ERROR_UNREF(error);
+ } else {
+ result.resource = std::move(endpoint_data);
+ }
+ return std::move(result);
}
- return TString(type_url);
-}
+};
-template <typename UpdateMap>
-void MoveUpdatesToFailedSet(UpdateMap* update_map,
- std::set<TString>* resource_names_failed) {
- for (const auto& p : *update_map) {
- resource_names_failed->insert(p.first);
+grpc_error_handle AdsResourceParse(
+ const EncodingContext& context, XdsResourceType* type, size_t idx,
+ const google_protobuf_Any* resource_any,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_resource_names,
+ std::function<grpc_error_handle(
+ y_absl::string_view, XdsApi::ResourceName,
+ std::unique_ptr<XdsResourceType::ResourceData>, TString)>
+ add_result_func,
+ std::set<XdsApi::ResourceName>* resource_names_failed) {
+ // Check the type_url of the resource.
+ y_absl::string_view type_url = y_absl::StripPrefix(
+ UpbStringToAbsl(google_protobuf_Any_type_url(resource_any)),
+ "type.googleapis.com/");
+ bool is_v2 = false;
+ if (!type->IsType(type_url, &is_v2)) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("resource index ", idx, ": found resource type ", type_url,
+ " in response for type ", type->type_url()));
+ }
+ // Parse the resource.
+ y_absl::string_view serialized_resource =
+ UpbStringToAbsl(google_protobuf_Any_value(resource_any));
+ y_absl::StatusOr<XdsResourceType::DecodeResult> result =
+ type->Decode(context, serialized_resource, is_v2);
+ if (!result.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("resource index ", idx, ": ", result.status().ToString()));
+ }
+ // Check the resource name.
+ auto resource_name = ParseResourceNameInternal(
+ result->name, [type](y_absl::string_view type_url, bool* is_v2) {
+ return type->IsType(type_url, is_v2);
+ });
+ if (!resource_name.ok()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "resource index ", idx, ": Cannot parse xDS resource name \"",
+ result->name, "\""));
+ }
+ // Ignore unexpected names.
+ auto iter = subscribed_resource_names.find(resource_name->authority);
+ if (iter == subscribed_resource_names.end() ||
+ iter->second.find(resource_name->id) == iter->second.end()) {
+ return GRPC_ERROR_NONE;
+ }
+ // Check that resource was valid.
+ if (!result->resource.ok()) {
+ resource_names_failed->insert(*resource_name);
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "resource index ", idx, ": ", result->name,
+ ": validation error: ", result->resource.status().ToString()));
+ }
+ // Add result.
+ grpc_error_handle error = add_result_func(result->name, *resource_name,
+ std::move(*result->resource),
+ TString(serialized_resource));
+ if (error != GRPC_ERROR_NONE) {
+ resource_names_failed->insert(*resource_name);
+ return grpc_error_add_child(
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "resource index ", idx, ": ", result->name, ": validation error")),
+ error);
}
- update_map->clear();
+ return GRPC_ERROR_NONE;
+}
+
+template <typename UpdateMap, typename ResourceTypeData>
+grpc_error_handle AddResult(
+ UpdateMap* update_map, y_absl::string_view resource_name_string,
+ XdsApi::ResourceName resource_name,
+ std::unique_ptr<XdsResourceType::ResourceData> resource,
+ TString serialized_resource) {
+ // Reject duplicate names.
+ if (update_map->find(resource_name) != update_map->end()) {
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("duplicate resource name \"", resource_name_string, "\""));
+ }
+ // Save result.
+ auto& resource_data = (*update_map)[resource_name];
+ ResourceTypeData* typed_resource =
+ static_cast<ResourceTypeData*>(resource.get());
+ resource_data.resource = std::move(typed_resource->resource);
+ resource_data.serialized_proto = std::move(serialized_resource);
+ return GRPC_ERROR_NONE;
}
} // namespace
XdsApi::AdsParseResult XdsApi::ParseAdsResponse(
const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
- const std::set<y_absl::string_view>& expected_listener_names,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- const std::set<y_absl::string_view>& expected_cluster_names,
- const std::set<y_absl::string_view>& expected_eds_service_names) {
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_listener_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_route_config_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_cluster_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_eds_service_names) {
AdsParseResult result;
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const EncodingContext context = {client_,
+ tracer_,
+ symtab_.ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// Decode the response.
const envoy_service_discovery_v3_DiscoveryResponse* response =
envoy_service_discovery_v3_DiscoveryResponse_parse(
@@ -3272,46 +3692,88 @@ XdsApi::AdsParseResult XdsApi::ParseAdsResponse(
}
MaybeLogDiscoveryResponse(context, response);
// Record the type_url, the version_info, and the nonce of the response.
- result.type_url = TypeUrlInternalToExternal(UpbStringToAbsl(
- envoy_service_discovery_v3_DiscoveryResponse_type_url(response)));
+ result.type_url = TypeUrlInternalToExternal(y_absl::StripPrefix(
+ UpbStringToAbsl(
+ envoy_service_discovery_v3_DiscoveryResponse_type_url(response)),
+ "type.googleapis.com/"));
result.version = UpbStringToStdString(
envoy_service_discovery_v3_DiscoveryResponse_version_info(response));
result.nonce = UpbStringToStdString(
envoy_service_discovery_v3_DiscoveryResponse_nonce(response));
- // Parse the response according to the resource type.
- if (IsLds(result.type_url)) {
- result.parse_error =
- LdsResponseParse(context, response, expected_listener_names,
- &result.lds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.lds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsRds(result.type_url)) {
- result.parse_error =
- RdsResponseParse(context, response, expected_route_configuration_names,
- &result.rds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.rds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsCds(result.type_url)) {
- result.parse_error =
- CdsResponseParse(context, response, expected_cluster_names,
- &result.cds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.cds_update_map,
- &result.resource_names_failed);
- }
- } else if (IsEds(result.type_url)) {
- result.parse_error =
- EdsResponseParse(context, response, expected_eds_service_names,
- &result.eds_update_map, &result.resource_names_failed);
- if (result.parse_error != GRPC_ERROR_NONE) {
- MoveUpdatesToFailedSet(&result.eds_update_map,
- &result.resource_names_failed);
- }
- }
+ // Get the resources from the response.
+ std::vector<grpc_error_handle> errors;
+ size_t size;
+ const google_protobuf_Any* const* resources =
+ envoy_service_discovery_v3_DiscoveryResponse_resources(response, &size);
+ for (size_t i = 0; i < size; ++i) {
+ // Parse the response according to the resource type.
+ // TODO(roth): When we have time, change the API here to avoid the need
+ // for templating and conditionals.
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
+ if (IsLds(result.type_url)) {
+ ListenerResourceType resource_type;
+ auto& update_map = result.lds_update_map;
+ parse_error = AdsResourceParse(
+ context, &resource_type, i, resources[i], subscribed_listener_names,
+ [&update_map](y_absl::string_view resource_name_string,
+ XdsApi::ResourceName resource_name,
+ std::unique_ptr<XdsResourceType::ResourceData> resource,
+ TString serialized_resource) {
+ return AddResult<LdsUpdateMap, ListenerResourceType::ListenerData>(
+ &update_map, resource_name_string, std::move(resource_name),
+ std::move(resource), std::move(serialized_resource));
+ },
+ &result.resource_names_failed);
+ } else if (IsRds(result.type_url)) {
+ RouteConfigResourceType resource_type;
+ auto& update_map = result.rds_update_map;
+ parse_error = AdsResourceParse(
+ context, &resource_type, i, resources[i],
+ subscribed_route_config_names,
+ [&update_map](y_absl::string_view resource_name_string,
+ XdsApi::ResourceName resource_name,
+ std::unique_ptr<XdsResourceType::ResourceData> resource,
+ TString serialized_resource) {
+ return AddResult<RdsUpdateMap,
+ RouteConfigResourceType::RouteConfigData>(
+ &update_map, resource_name_string, std::move(resource_name),
+ std::move(resource), std::move(serialized_resource));
+ },
+ &result.resource_names_failed);
+ } else if (IsCds(result.type_url)) {
+ ClusterResourceType resource_type;
+ auto& update_map = result.cds_update_map;
+ parse_error = AdsResourceParse(
+ context, &resource_type, i, resources[i], subscribed_cluster_names,
+ [&update_map](y_absl::string_view resource_name_string,
+ XdsApi::ResourceName resource_name,
+ std::unique_ptr<XdsResourceType::ResourceData> resource,
+ TString serialized_resource) {
+ return AddResult<CdsUpdateMap, ClusterResourceType::ClusterData>(
+ &update_map, resource_name_string, std::move(resource_name),
+ std::move(resource), std::move(serialized_resource));
+ },
+ &result.resource_names_failed);
+ } else if (IsEds(result.type_url)) {
+ EndpointResourceType resource_type;
+ auto& update_map = result.eds_update_map;
+ parse_error = AdsResourceParse(
+ context, &resource_type, i, resources[i],
+ subscribed_eds_service_names,
+ [&update_map](y_absl::string_view resource_name_string,
+ XdsApi::ResourceName resource_name,
+ std::unique_ptr<XdsResourceType::ResourceData> resource,
+ TString serialized_resource) {
+ return AddResult<EdsUpdateMap, EndpointResourceType::EndpointData>(
+ &update_map, resource_name_string, std::move(resource_name),
+ std::move(resource), std::move(serialized_resource));
+ },
+ &result.resource_names_failed);
+ }
+ if (parse_error != GRPC_ERROR_NONE) errors.push_back(parse_error);
+ }
+ result.parse_error =
+ GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing ADS response", &errors);
return result;
}
@@ -3345,8 +3807,12 @@ grpc_slice SerializeLrsRequest(
grpc_slice XdsApi::CreateLrsInitialRequest(
const XdsBootstrap::XdsServer& server) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- server.ShouldUseV3()};
+ const EncodingContext context = {client_,
+ tracer_,
+ symtab_.ptr(),
+ arena.ptr(),
+ server.ShouldUseV3(),
+ certificate_provider_definition_map_};
// Create a request.
envoy_service_load_stats_v3_LoadStatsRequest* request =
envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
@@ -3354,7 +3820,8 @@ grpc_slice XdsApi::CreateLrsInitialRequest(
envoy_config_core_v3_Node* node_msg =
envoy_service_load_stats_v3_LoadStatsRequest_mutable_node(request,
arena.ptr());
- PopulateNode(context, node_, build_version_, user_agent_name_, node_msg);
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node_msg);
envoy_config_core_v3_Node_add_client_features(
node_msg, upb_strview_makez("envoy.lrs.supports_send_all_clusters"),
arena.ptr());
@@ -3415,8 +3882,9 @@ void LocalityStatsPopulate(
grpc_slice XdsApi::CreateLrsRequest(
ClusterLoadReportMap cluster_load_report_map) {
upb::Arena arena;
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- false};
+ const EncodingContext context = {
+ client_, tracer_, symtab_.ptr(),
+ arena.ptr(), false, certificate_provider_definition_map_};
// Create a request.
envoy_service_load_stats_v3_LoadStatsRequest* request =
envoy_service_load_stats_v3_LoadStatsRequest_new(arena.ptr());
@@ -3476,10 +3944,10 @@ grpc_slice XdsApi::CreateLrsRequest(
return SerializeLrsRequest(context, request);
}
-grpc_error* XdsApi::ParseLrsResponse(const grpc_slice& encoded_response,
- bool* send_all_clusters,
- std::set<TString>* cluster_names,
- grpc_millis* load_reporting_interval) {
+grpc_error_handle XdsApi::ParseLrsResponse(
+ const grpc_slice& encoded_response, bool* send_all_clusters,
+ std::set<TString>* cluster_names,
+ grpc_millis* load_reporting_interval) {
upb::Arena arena;
// Decode the response.
const envoy_service_load_stats_v3_LoadStatsResponse* decoded_response =
@@ -3517,6 +3985,7 @@ grpc_error* XdsApi::ParseLrsResponse(const grpc_slice& encoded_response,
}
namespace {
+
google_protobuf_Timestamp* GrpcMillisToTimestamp(const EncodingContext& context,
grpc_millis value) {
google_protobuf_Timestamp* timestamp =
@@ -3527,218 +3996,6 @@ google_protobuf_Timestamp* GrpcMillisToTimestamp(const EncodingContext& context,
return timestamp;
}
-envoy_admin_v3_UpdateFailureState* CreateUpdateFailureStateUpb(
- const EncodingContext& context,
- const XdsApi::ResourceMetadata* resource_metadata) {
- auto* update_failure_state =
- envoy_admin_v3_UpdateFailureState_new(context.arena);
- envoy_admin_v3_UpdateFailureState_set_details(
- update_failure_state,
- StdStringToUpbString(resource_metadata->failed_details));
- envoy_admin_v3_UpdateFailureState_set_version_info(
- update_failure_state,
- StdStringToUpbString(resource_metadata->failed_version));
- envoy_admin_v3_UpdateFailureState_set_last_update_attempt(
- update_failure_state,
- GrpcMillisToTimestamp(context, resource_metadata->failed_update_time));
- return update_failure_state;
-}
-
-void DumpLdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kLdsTypeUrlUpb = upb_strview_makez(XdsApi::kLdsTypeUrl);
- auto* listener_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_listener_config(
- per_xds_config, context.arena);
- envoy_admin_v3_ListenersConfigDump_set_version_info(
- listener_config_dump,
- StdStringToUpbString(resource_type_metadata.version));
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- y_absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_listener =
- envoy_admin_v3_ListenersConfigDump_add_dynamic_listeners(
- listener_config_dump, context.arena);
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_name(
- dynamic_listener, name_upb);
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_client_status(
- dynamic_listener, meta->client_status);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective listeners
- auto* dynamic_listener_state =
- envoy_admin_v3_ListenersConfigDump_DynamicListener_mutable_active_state(
- dynamic_listener, context.arena);
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_version_info(
- dynamic_listener_state, StdStringToUpbString(meta->version));
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_set_last_updated(
- dynamic_listener_state,
- GrpcMillisToTimestamp(context, meta->update_time));
- auto* listener_any =
- envoy_admin_v3_ListenersConfigDump_DynamicListenerState_mutable_listener(
- dynamic_listener_state, context.arena);
- google_protobuf_Any_set_type_url(listener_any, kLdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- listener_any, StdStringToUpbString(meta->serialized_proto));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_ListenersConfigDump_DynamicListener_set_error_state(
- dynamic_listener, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpRdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kRdsTypeUrlUpb = upb_strview_makez(XdsApi::kRdsTypeUrl);
- auto* route_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_route_config(per_xds_config,
- context.arena);
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- y_absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_route_config =
- envoy_admin_v3_RoutesConfigDump_add_dynamic_route_configs(
- route_config_dump, context.arena);
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_client_status(
- dynamic_route_config, meta->client_status);
- auto* route_config_any =
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_mutable_route_config(
- dynamic_route_config, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective route configs
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_version_info(
- dynamic_route_config, StdStringToUpbString(meta->version));
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_last_updated(
- dynamic_route_config,
- GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(route_config_any, kRdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- route_config_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working route config, we still need to print the
- // name.
- auto* route_config =
- envoy_config_route_v3_RouteConfiguration_new(context.arena);
- envoy_config_route_v3_RouteConfiguration_set_name(route_config, name_upb);
- size_t length;
- char* bytes = envoy_config_route_v3_RouteConfiguration_serialize(
- route_config, context.arena, &length);
- google_protobuf_Any_set_type_url(route_config_any, kRdsTypeUrlUpb);
- google_protobuf_Any_set_value(route_config_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_set_error_state(
- dynamic_route_config, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpCdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kCdsTypeUrlUpb = upb_strview_makez(XdsApi::kCdsTypeUrl);
- auto* cluster_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_cluster_config(
- per_xds_config, context.arena);
- envoy_admin_v3_ClustersConfigDump_set_version_info(
- cluster_config_dump,
- StdStringToUpbString(resource_type_metadata.version));
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- y_absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_cluster =
- envoy_admin_v3_ClustersConfigDump_add_dynamic_active_clusters(
- cluster_config_dump, context.arena);
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_client_status(
- dynamic_cluster, meta->client_status);
- auto* cluster_any =
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_mutable_cluster(
- dynamic_cluster, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective clusters
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_version_info(
- dynamic_cluster, StdStringToUpbString(meta->version));
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_last_updated(
- dynamic_cluster, GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(cluster_any, kCdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- cluster_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working cluster, we still need to print the name.
- auto* cluster = envoy_config_cluster_v3_Cluster_new(context.arena);
- envoy_config_cluster_v3_Cluster_set_name(cluster, name_upb);
- size_t length;
- char* bytes = envoy_config_cluster_v3_Cluster_serialize(
- cluster, context.arena, &length);
- google_protobuf_Any_set_type_url(cluster_any, kCdsTypeUrlUpb);
- google_protobuf_Any_set_value(cluster_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_ClustersConfigDump_DynamicCluster_set_error_state(
- dynamic_cluster, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
-void DumpEdsConfig(const EncodingContext& context,
- const XdsApi::ResourceTypeMetadata& resource_type_metadata,
- envoy_service_status_v3_PerXdsConfig* per_xds_config) {
- upb_strview kEdsTypeUrlUpb = upb_strview_makez(XdsApi::kEdsTypeUrl);
- auto* endpoint_config_dump =
- envoy_service_status_v3_PerXdsConfig_mutable_endpoint_config(
- per_xds_config, context.arena);
- for (auto& p : resource_type_metadata.resource_metadata_map) {
- y_absl::string_view name = p.first;
- const XdsApi::ResourceMetadata* meta = p.second;
- const upb_strview name_upb = StdStringToUpbString(name);
- auto* dynamic_endpoint =
- envoy_admin_v3_EndpointsConfigDump_add_dynamic_endpoint_configs(
- endpoint_config_dump, context.arena);
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_client_status(
- dynamic_endpoint, meta->client_status);
- auto* endpoint_any =
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_mutable_endpoint_config(
- dynamic_endpoint, context.arena);
- if (!meta->serialized_proto.empty()) {
- // Set in-effective endpoints
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_version_info(
- dynamic_endpoint, StdStringToUpbString(meta->version));
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_last_updated(
- dynamic_endpoint, GrpcMillisToTimestamp(context, meta->update_time));
- google_protobuf_Any_set_type_url(endpoint_any, kEdsTypeUrlUpb);
- google_protobuf_Any_set_value(
- endpoint_any, StdStringToUpbString(meta->serialized_proto));
- } else {
- // If there isn't a working endpoint, we still need to print the name.
- auto* cluster_load_assignment =
- envoy_config_endpoint_v3_ClusterLoadAssignment_new(context.arena);
- envoy_config_endpoint_v3_ClusterLoadAssignment_set_cluster_name(
- cluster_load_assignment, name_upb);
- size_t length;
- char* bytes = envoy_config_endpoint_v3_ClusterLoadAssignment_serialize(
- cluster_load_assignment, context.arena, &length);
- google_protobuf_Any_set_type_url(endpoint_any, kEdsTypeUrlUpb);
- google_protobuf_Any_set_value(endpoint_any,
- upb_strview_make(bytes, length));
- }
- if (meta->client_status == XdsApi::ResourceMetadata::NACKED) {
- // Set error_state if NACKED
- envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_set_error_state(
- dynamic_endpoint, CreateUpdateFailureStateUpb(context, meta));
- }
- }
-}
-
} // namespace
TString XdsApi::AssembleClientConfig(
@@ -3749,36 +4006,58 @@ TString XdsApi::AssembleClientConfig(
// Fill-in the node information
auto* node = envoy_service_status_v3_ClientConfig_mutable_node(client_config,
arena.ptr());
- const EncodingContext context = {client_, tracer_, symtab_.ptr(), arena.ptr(),
- true};
- PopulateNode(context, node_, build_version_, user_agent_name_, node);
- // Dump each xDS-type config into PerXdsConfig
- for (auto& p : resource_type_metadata_map) {
+ const EncodingContext context = {
+ client_, tracer_, symtab_.ptr(),
+ arena.ptr(), true, certificate_provider_definition_map_};
+ PopulateNode(context, node_, build_version_, user_agent_name_,
+ user_agent_version_, node);
+ // Dump each resource.
+ std::vector<TString> type_url_storage;
+ for (const auto& p : resource_type_metadata_map) {
y_absl::string_view type_url = p.first;
- const ResourceTypeMetadata& resource_type_metadata = p.second;
- if (type_url == kLdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpLdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kRdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpRdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kCdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpCdsConfig(context, resource_type_metadata, per_xds_config);
- } else if (type_url == kEdsTypeUrl) {
- auto* per_xds_config =
- envoy_service_status_v3_ClientConfig_add_xds_config(client_config,
- context.arena);
- DumpEdsConfig(context, resource_type_metadata, per_xds_config);
- } else {
- gpr_log(GPR_ERROR, "invalid type_url %s", TString(type_url).c_str());
- return "";
+ const ResourceMetadataMap& resource_metadata_map = p.second;
+ type_url_storage.emplace_back(
+ y_absl::StrCat("type.googleapis.com/", type_url));
+ for (const auto& q : resource_metadata_map) {
+ y_absl::string_view resource_name = q.first;
+ const ResourceMetadata& metadata = *q.second;
+ auto* entry =
+ envoy_service_status_v3_ClientConfig_add_generic_xds_configs(
+ client_config, context.arena);
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_type_url(
+ entry, StdStringToUpbString(type_url_storage.back()));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_name(
+ entry, StdStringToUpbString(resource_name));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_client_status(
+ entry, metadata.client_status);
+ if (!metadata.serialized_proto.empty()) {
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_version_info(
+ entry, StdStringToUpbString(metadata.version));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_last_updated(
+ entry, GrpcMillisToTimestamp(context, metadata.update_time));
+ auto* any_field =
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_mutable_xds_config(
+ entry, context.arena);
+ google_protobuf_Any_set_type_url(
+ any_field, StdStringToUpbString(type_url_storage.back()));
+ google_protobuf_Any_set_value(
+ any_field, StdStringToUpbString(metadata.serialized_proto));
+ }
+ if (metadata.client_status == XdsApi::ResourceMetadata::NACKED) {
+ auto* update_failure_state =
+ envoy_admin_v3_UpdateFailureState_new(context.arena);
+ envoy_admin_v3_UpdateFailureState_set_details(
+ update_failure_state,
+ StdStringToUpbString(metadata.failed_details));
+ envoy_admin_v3_UpdateFailureState_set_version_info(
+ update_failure_state,
+ StdStringToUpbString(metadata.failed_version));
+ envoy_admin_v3_UpdateFailureState_set_last_update_attempt(
+ update_failure_state,
+ GrpcMillisToTimestamp(context, metadata.failed_update_time));
+ envoy_service_status_v3_ClientConfig_GenericXdsConfig_set_error_state(
+ entry, update_failure_state);
+ }
}
}
// Serialize the upb message to bytes
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_api.h b/contrib/libs/grpc/src/core/ext/xds/xds_api.h
index 37434c094ac..dd3c97ea22a 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_api.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_api.h
@@ -27,25 +27,23 @@
#include "y_absl/container/inlined_vector.h"
#include "y_absl/types/optional.h"
+#include "y_absl/types/variant.h"
+#include "envoy/admin/v3/config_dump.upb.h"
#include "re2/re2.h"
-
#include "upb/def.hpp"
#include <grpc/slice_buffer.h>
-#include "envoy/admin/v3/config_dump.upb.h"
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/xds/xds_bootstrap.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/matchers/matchers.h"
namespace grpc_core {
-// TODO(yashykt): Check to see if xDS security is enabled. This will be
-// removed once this feature is fully integration-tested and enabled by
-// default.
-bool XdsSecurityEnabled();
+bool XdsRbacEnabled();
class XdsClient;
@@ -57,6 +55,7 @@ class XdsApi {
static const char* kEdsTypeUrl;
struct Duration {
+ Duration() {}
int64_t seconds = 0;
int32_t nanos = 0;
bool operator==(const Duration& other) const {
@@ -70,6 +69,29 @@ class XdsApi {
using TypedPerFilterConfig =
std::map<TString, XdsHttpFilterImpl::FilterConfig>;
+ struct RetryPolicy {
+ internal::StatusCodeSet retry_on;
+ uint32_t num_retries;
+
+ struct RetryBackOff {
+ Duration base_interval;
+ Duration max_interval;
+
+ bool operator==(const RetryBackOff& other) const {
+ return base_interval == other.base_interval &&
+ max_interval == other.max_interval;
+ }
+ TString ToString() const;
+ };
+ RetryBackOff retry_back_off;
+
+ bool operator==(const RetryPolicy& other) const {
+ return (retry_on == other.retry_on && num_retries == other.num_retries &&
+ retry_back_off == other.retry_back_off);
+ }
+ TString ToString() const;
+ };
+
// TODO(donnadionne): When we can use y_absl::variant<>, consider using that
// for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
struct Route {
@@ -87,60 +109,83 @@ class XdsApi {
TString ToString() const;
};
- struct HashPolicy {
- enum Type { HEADER, CHANNEL_ID };
- Type type;
- bool terminal = false;
- // Fields used for type HEADER.
- TString header_name;
- std::unique_ptr<RE2> regex = nullptr;
- TString regex_substitution;
+ Matchers matchers;
- HashPolicy() {}
+ struct UnknownAction {
+ bool operator==(const UnknownAction& /* other */) const { return true; }
+ };
- // Copyable.
- HashPolicy(const HashPolicy& other);
- HashPolicy& operator=(const HashPolicy& other);
+ struct RouteAction {
+ struct HashPolicy {
+ enum Type { HEADER, CHANNEL_ID };
+ Type type;
+ bool terminal = false;
+ // Fields used for type HEADER.
+ TString header_name;
+ std::unique_ptr<RE2> regex = nullptr;
+ TString regex_substitution;
- // Moveable.
- HashPolicy(HashPolicy&& other) noexcept;
- HashPolicy& operator=(HashPolicy&& other) noexcept;
+ HashPolicy() {}
- bool operator==(const HashPolicy& other) const;
- TString ToString() const;
- };
+ // Copyable.
+ HashPolicy(const HashPolicy& other);
+ HashPolicy& operator=(const HashPolicy& other);
- Matchers matchers;
- std::vector<HashPolicy> hash_policies;
-
- // Action for this route.
- // TODO(roth): When we can use y_absl::variant<>, consider using that
- // here, to enforce the fact that only one of the two fields can be set.
- TString cluster_name;
- struct ClusterWeight {
- TString name;
- uint32_t weight;
- TypedPerFilterConfig typed_per_filter_config;
+ // Moveable.
+ HashPolicy(HashPolicy&& other) noexcept;
+ HashPolicy& operator=(HashPolicy&& other) noexcept;
- bool operator==(const ClusterWeight& other) const {
- return name == other.name && weight == other.weight &&
- typed_per_filter_config == other.typed_per_filter_config;
+ bool operator==(const HashPolicy& other) const;
+ TString ToString() const;
+ };
+
+ struct ClusterWeight {
+ TString name;
+ uint32_t weight;
+ TypedPerFilterConfig typed_per_filter_config;
+
+ bool operator==(const ClusterWeight& other) const {
+ return name == other.name && weight == other.weight &&
+ typed_per_filter_config == other.typed_per_filter_config;
+ }
+ TString ToString() const;
+ };
+
+ std::vector<HashPolicy> hash_policies;
+ y_absl::optional<RetryPolicy> retry_policy;
+
+ // Action for this route.
+ // TODO(roth): When we can use y_absl::variant<>, consider using that
+ // here, to enforce the fact that only one of the two fields can be set.
+ TString cluster_name;
+ std::vector<ClusterWeight> weighted_clusters;
+ // Storing the timeout duration from route action:
+ // RouteAction.max_stream_duration.grpc_timeout_header_max or
+ // RouteAction.max_stream_duration.max_stream_duration if the former is
+ // not set.
+ y_absl::optional<Duration> max_stream_duration;
+
+ bool operator==(const RouteAction& other) const {
+ return hash_policies == other.hash_policies &&
+ retry_policy == other.retry_policy &&
+ cluster_name == other.cluster_name &&
+ weighted_clusters == other.weighted_clusters &&
+ max_stream_duration == other.max_stream_duration;
}
TString ToString() const;
};
- std::vector<ClusterWeight> weighted_clusters;
- // Storing the timeout duration from route action:
- // RouteAction.max_stream_duration.grpc_timeout_header_max or
- // RouteAction.max_stream_duration.max_stream_duration if the former is
- // not set.
- y_absl::optional<Duration> max_stream_duration;
+ struct NonForwardingAction {
+ bool operator==(const NonForwardingAction& /* other */) const {
+ return true;
+ }
+ };
+
+ y_absl::variant<UnknownAction, RouteAction, NonForwardingAction> action;
TypedPerFilterConfig typed_per_filter_config;
bool operator==(const Route& other) const {
- return matchers == other.matchers && cluster_name == other.cluster_name &&
- weighted_clusters == other.weighted_clusters &&
- max_stream_duration == other.max_stream_duration &&
+ return matchers == other.matchers && action == other.action &&
typed_per_filter_config == other.typed_per_filter_config;
}
TString ToString() const;
@@ -164,26 +209,14 @@ class XdsApi {
return virtual_hosts == other.virtual_hosts;
}
TString ToString() const;
- VirtualHost* FindVirtualHostForDomain(const TString& domain);
};
struct CommonTlsContext {
- struct CertificateValidationContext {
- std::vector<StringMatcher> match_subject_alt_names;
-
- bool operator==(const CertificateValidationContext& other) const {
- return match_subject_alt_names == other.match_subject_alt_names;
- }
-
- TString ToString() const;
- bool Empty() const;
- };
-
- struct CertificateProviderInstance {
+ struct CertificateProviderPluginInstance {
TString instance_name;
TString certificate_name;
- bool operator==(const CertificateProviderInstance& other) const {
+ bool operator==(const CertificateProviderPluginInstance& other) const {
return instance_name == other.instance_name &&
certificate_name == other.certificate_name;
}
@@ -192,28 +225,28 @@ class XdsApi {
bool Empty() const;
};
- struct CombinedCertificateValidationContext {
- CertificateValidationContext default_validation_context;
- CertificateProviderInstance
- validation_context_certificate_provider_instance;
+ struct CertificateValidationContext {
+ CertificateProviderPluginInstance ca_certificate_provider_instance;
+ std::vector<StringMatcher> match_subject_alt_names;
- bool operator==(const CombinedCertificateValidationContext& other) const {
- return default_validation_context == other.default_validation_context &&
- validation_context_certificate_provider_instance ==
- other.validation_context_certificate_provider_instance;
+ bool operator==(const CertificateValidationContext& other) const {
+ return ca_certificate_provider_instance ==
+ other.ca_certificate_provider_instance &&
+ match_subject_alt_names == other.match_subject_alt_names;
}
TString ToString() const;
bool Empty() const;
};
- CertificateProviderInstance tls_certificate_certificate_provider_instance;
- CombinedCertificateValidationContext combined_validation_context;
+ CertificateValidationContext certificate_validation_context;
+ CertificateProviderPluginInstance tls_certificate_provider_instance;
bool operator==(const CommonTlsContext& other) const {
- return tls_certificate_certificate_provider_instance ==
- other.tls_certificate_certificate_provider_instance &&
- combined_validation_context == other.combined_validation_context;
+ return certificate_validation_context ==
+ other.certificate_validation_context &&
+ tls_certificate_provider_instance ==
+ other.tls_certificate_provider_instance;
}
TString ToString() const;
@@ -292,7 +325,7 @@ class XdsApi {
}
TString ToString() const;
- } filter_chain_data;
+ };
// A multi-level map used to determine which filter chain to use for a given
// incoming connection. Determining the right filter chain for a given
@@ -377,20 +410,30 @@ class XdsApi {
TString ToString() const;
};
+ struct ResourceName {
+ TString authority;
+ TString id;
+
+ bool operator<(const ResourceName& other) const {
+ if (authority < other.authority) return true;
+ if (id < other.id) return true;
+ return false;
+ }
+ };
+
struct LdsResourceData {
LdsUpdate resource;
TString serialized_proto;
};
- using LdsUpdateMap = std::map<TString /*server_name*/, LdsResourceData>;
+ using LdsUpdateMap = std::map<ResourceName, LdsResourceData>;
struct RdsResourceData {
RdsUpdate resource;
TString serialized_proto;
};
- using RdsUpdateMap =
- std::map<TString /*route_config_name*/, RdsResourceData>;
+ using RdsUpdateMap = std::map<ResourceName, RdsResourceData>;
struct CdsUpdate {
enum ClusterType { EDS, LOGICAL_DNS, AGGREGATE };
@@ -399,34 +442,42 @@ class XdsApi {
// The name to use in the EDS request.
// If empty, the cluster name will be used.
TString eds_service_name;
+ // For cluster type LOGICAL_DNS.
+ // The hostname to lookup in DNS.
+ TString dns_hostname;
+ // For cluster type AGGREGATE.
+ // The prioritized list of cluster names.
+ std::vector<TString> prioritized_cluster_names;
+
// Tls Context used by clients
CommonTlsContext common_tls_context;
+
// The LRS server to use for load reporting.
// If not set, load reporting will be disabled.
// If set to the empty string, will use the same server we obtained the CDS
// data from.
y_absl::optional<TString> lrs_load_reporting_server_name;
+
// The LB policy to use (e.g., "ROUND_ROBIN" or "RING_HASH").
TString lb_policy;
// Used for RING_HASH LB policy only.
uint64_t min_ring_size = 1024;
uint64_t max_ring_size = 8388608;
- enum HashFunction { XX_HASH, MURMUR_HASH_2 };
- HashFunction hash_function;
// Maximum number of outstanding requests can be made to the upstream
// cluster.
uint32_t max_concurrent_requests = 1024;
- // For cluster type AGGREGATE.
- // The prioritized list of cluster names.
- std::vector<TString> prioritized_cluster_names;
bool operator==(const CdsUpdate& other) const {
return cluster_type == other.cluster_type &&
eds_service_name == other.eds_service_name &&
+ dns_hostname == other.dns_hostname &&
+ prioritized_cluster_names == other.prioritized_cluster_names &&
common_tls_context == other.common_tls_context &&
lrs_load_reporting_server_name ==
other.lrs_load_reporting_server_name &&
- prioritized_cluster_names == other.prioritized_cluster_names &&
+ lb_policy == other.lb_policy &&
+ min_ring_size == other.min_ring_size &&
+ max_ring_size == other.max_ring_size &&
max_concurrent_requests == other.max_concurrent_requests;
}
@@ -438,7 +489,7 @@ class XdsApi {
TString serialized_proto;
};
- using CdsUpdateMap = std::map<TString /*cluster_name*/, CdsResourceData>;
+ using CdsUpdateMap = std::map<ResourceName, CdsResourceData>;
struct EdsUpdate {
struct Priority {
@@ -527,8 +578,7 @@ class XdsApi {
TString serialized_proto;
};
- using EdsUpdateMap =
- std::map<TString /*eds_service_name*/, EdsResourceData>;
+ using EdsUpdateMap = std::map<ResourceName, EdsResourceData>;
struct ClusterLoadReport {
XdsClusterDropStats::Snapshot dropped_requests;
@@ -577,13 +627,9 @@ class XdsApi {
grpc_millis failed_update_time = 0;
};
using ResourceMetadataMap =
- std::map<y_absl::string_view /*resource_name*/, const ResourceMetadata*>;
- struct ResourceTypeMetadata {
- y_absl::string_view version;
- ResourceMetadataMap resource_metadata_map;
- };
+ std::map<TString /*resource_name*/, const ResourceMetadata*>;
using ResourceTypeMetadataMap =
- std::map<y_absl::string_view /*type_url*/, ResourceTypeMetadata>;
+ std::map<y_absl::string_view /*type_url*/, ResourceMetadataMap>;
static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
envoy_admin_v3_REQUESTED) ==
ResourceMetadata::ClientResourceStatus::REQUESTED,
@@ -609,7 +655,7 @@ class XdsApi {
// Otherwise, one of the *_update_map fields will be populated, based
// on the type_url field.
struct AdsParseResult {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
TString version;
TString nonce;
TString type_url;
@@ -617,27 +663,53 @@ class XdsApi {
RdsUpdateMap rds_update_map;
CdsUpdateMap cds_update_map;
EdsUpdateMap eds_update_map;
- std::set<TString> resource_names_failed;
+ std::set<ResourceName> resource_names_failed;
};
- XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap::Node* node);
+ XdsApi(XdsClient* client, TraceFlag* tracer, const XdsBootstrap::Node* node,
+ const CertificateProviderStore::PluginDefinitionMap* map);
+
+ static bool IsLds(y_absl::string_view type_url);
+ static bool IsRds(y_absl::string_view type_url);
+ static bool IsCds(y_absl::string_view type_url);
+ static bool IsEds(y_absl::string_view type_url);
+
+ // A helper method to parse the resource name and return back a ResourceName
+ // struct. Optionally the parser can check the resource type portion of the
+ // resource name.
+ static y_absl::StatusOr<ResourceName> ParseResourceName(
+ y_absl::string_view name,
+ bool (*is_expected_type)(y_absl::string_view) = nullptr);
+
+ // A helper method to construct the resource name from parts.
+ static TString ConstructFullResourceName(y_absl::string_view authority,
+ y_absl::string_view resource_type,
+ y_absl::string_view name);
// Creates an ADS request.
// Takes ownership of \a error.
- grpc_slice CreateAdsRequest(const XdsBootstrap::XdsServer& server,
- const TString& type_url,
- const std::set<y_absl::string_view>& resource_names,
- const TString& version,
- const TString& nonce, grpc_error* error,
- bool populate_node);
+ grpc_slice CreateAdsRequest(
+ const XdsBootstrap::XdsServer& server, const TString& type_url,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>& resource_names,
+ const TString& version, const TString& nonce,
+ grpc_error_handle error, bool populate_node);
// Parses an ADS response.
AdsParseResult ParseAdsResponse(
const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
- const std::set<y_absl::string_view>& expected_listener_names,
- const std::set<y_absl::string_view>& expected_route_configuration_names,
- const std::set<y_absl::string_view>& expected_cluster_names,
- const std::set<y_absl::string_view>& expected_eds_service_names);
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_listener_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_route_config_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_cluster_names,
+ const std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>&
+ subscribed_eds_service_names);
// Creates an initial LRS request.
grpc_slice CreateLrsInitialRequest(const XdsBootstrap::XdsServer& server);
@@ -648,10 +720,10 @@ class XdsApi {
// Parses the LRS response and returns \a
// load_reporting_interval for client-side load reporting. If there is any
// error, the output config is invalid.
- grpc_error* ParseLrsResponse(const grpc_slice& encoded_response,
- bool* send_all_clusters,
- std::set<TString>* cluster_names,
- grpc_millis* load_reporting_interval);
+ grpc_error_handle ParseLrsResponse(const grpc_slice& encoded_response,
+ bool* send_all_clusters,
+ std::set<TString>* cluster_names,
+ grpc_millis* load_reporting_interval);
// Assemble the client config proto message and return the serialized result.
TString AssembleClientConfig(
@@ -661,9 +733,12 @@ class XdsApi {
XdsClient* client_;
TraceFlag* tracer_;
const XdsBootstrap::Node* node_; // Do not own.
+ const CertificateProviderStore::PluginDefinitionMap*
+ certificate_provider_definition_map_; // Do not own.
upb::SymbolTable symtab_;
const TString build_version_;
const TString user_agent_name_;
+ const TString user_agent_version_;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
index e8ef70f4a8d..625f19238cc 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.cc
@@ -18,11 +18,11 @@
#include "src/core/ext/xds/xds_bootstrap.h"
-#include <vector>
-
#include <errno.h>
#include <stdlib.h>
+#include <vector>
+
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_join.h"
@@ -30,7 +30,6 @@
#include "src/core/ext/xds/certificate_provider_registry.h"
#include "src/core/ext/xds/xds_api.h"
-#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/credentials.h"
@@ -60,11 +59,14 @@ RefCountedPtr<grpc_channel_credentials>
XdsChannelCredsRegistry::MakeChannelCreds(const TString& creds_type,
const Json& /*config*/) {
if (creds_type == "google_default") {
- return grpc_google_default_credentials_create(nullptr);
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_google_default_credentials_create(nullptr));
} else if (creds_type == "insecure") {
- return grpc_insecure_credentials_create();
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_insecure_credentials_create());
} else if (creds_type == "fake") {
- return grpc_fake_transport_security_credentials_create();
+ return RefCountedPtr<grpc_channel_credentials>(
+ grpc_fake_transport_security_credentials_create());
}
return nullptr;
}
@@ -81,142 +83,27 @@ bool XdsBootstrap::XdsServer::ShouldUseV3() const {
// XdsBootstrap
//
-namespace {
-
-TString BootstrapString(const XdsBootstrap& bootstrap) {
- std::vector<TString> parts;
- if (bootstrap.node() != nullptr) {
- parts.push_back(y_absl::StrFormat(
- "node={\n"
- " id=\"%s\",\n"
- " cluster=\"%s\",\n"
- " locality={\n"
- " region=\"%s\",\n"
- " zone=\"%s\",\n"
- " sub_zone=\"%s\"\n"
- " },\n"
- " metadata=%s,\n"
- "},\n",
- bootstrap.node()->id, bootstrap.node()->cluster,
- bootstrap.node()->locality_region, bootstrap.node()->locality_zone,
- bootstrap.node()->locality_sub_zone,
- bootstrap.node()->metadata.Dump()));
- }
- parts.push_back(y_absl::StrFormat(
- "servers=[\n"
- " {\n"
- " uri=\"%s\",\n"
- " creds_type=%s,\n",
- bootstrap.server().server_uri, bootstrap.server().channel_creds_type));
- if (bootstrap.server().channel_creds_config.type() != Json::Type::JSON_NULL) {
- parts.push_back(
- y_absl::StrFormat(" creds_config=%s,",
- bootstrap.server().channel_creds_config.Dump()));
- }
- if (!bootstrap.server().server_features.empty()) {
- parts.push_back(y_absl::StrCat(
- " server_features=[",
- y_absl::StrJoin(bootstrap.server().server_features, ", "), "],\n"));
- }
- parts.push_back(" }\n],\n");
- if (!bootstrap.server_listener_resource_name_template().empty()) {
- parts.push_back(
- y_absl::StrFormat("server_listener_resource_name_template=\"%s\",\n",
- bootstrap.server_listener_resource_name_template()));
- }
- parts.push_back("certificate_providers={\n");
- for (const auto& entry : bootstrap.certificate_providers()) {
- parts.push_back(
- y_absl::StrFormat(" %s={\n"
- " plugin_name=%s\n"
- " config=%s\n"
- " },\n",
- entry.first, entry.second.plugin_name,
- entry.second.config->ToString()));
- }
- parts.push_back("}");
- return y_absl::StrJoin(parts, "");
-}
-
-std::unique_ptr<XdsBootstrap> ParseJsonAndCreate(
- XdsClient* client, TraceFlag* tracer, y_absl::string_view json_string,
- y_absl::string_view bootstrap_source, grpc_error** error) {
+std::unique_ptr<XdsBootstrap> XdsBootstrap::Create(
+ y_absl::string_view json_string, grpc_error_handle* error) {
Json json = Json::Parse(json_string, error);
if (*error != GRPC_ERROR_NONE) {
- grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to parse bootstrap from ", bootstrap_source)
- .c_str(),
- error, 1);
+ grpc_error_handle error_out =
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to parse bootstrap JSON string", error, 1);
GRPC_ERROR_UNREF(*error);
*error = error_out;
return nullptr;
}
- std::unique_ptr<XdsBootstrap> result =
- y_absl::make_unique<XdsBootstrap>(std::move(json), error);
- if (*error == GRPC_ERROR_NONE && GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Bootstrap config for creating xds client:\n%s",
- client, BootstrapString(*result).c_str());
- }
- return result;
-}
-
-} // namespace
-
-std::unique_ptr<XdsBootstrap> XdsBootstrap::Create(XdsClient* client,
- TraceFlag* tracer,
- const char* fallback_config,
- grpc_error** error) {
- // First, try GRPC_XDS_BOOTSTRAP env var.
- grpc_core::UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
- if (path != nullptr) {
- if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] Got bootstrap file location from "
- "GRPC_XDS_BOOTSTRAP environment variable: %s",
- client, path.get());
- }
- grpc_slice contents;
- *error =
- grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
- if (*error != GRPC_ERROR_NONE) return nullptr;
- y_absl::string_view contents_str_view = StringViewFromSlice(contents);
- if (GRPC_TRACE_FLAG_ENABLED(*tracer)) {
- gpr_log(GPR_DEBUG, "[xds_client %p] Bootstrap file contents: %s", client,
- TString(contents_str_view).c_str());
- }
- TString bootstrap_source = y_absl::StrCat("file ", path.get());
- auto result = ParseJsonAndCreate(client, tracer, contents_str_view,
- bootstrap_source, error);
- grpc_slice_unref_internal(contents);
- return result;
- }
- // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
- grpc_core::UniquePtr<char> env_config(
- gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
- if (env_config != nullptr) {
- return ParseJsonAndCreate(client, tracer, env_config.get(),
- "GRPC_XDS_BOOTSTRAP_CONFIG env var", error);
- }
- // Finally, try fallback config.
- if (fallback_config != nullptr) {
- return ParseJsonAndCreate(client, tracer, fallback_config,
- "fallback config", error);
- }
- // No bootstrap config found.
- *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Environment variables GRPC_XDS_BOOTSTRAP or GRPC_XDS_BOOTSTRAP_CONFIG "
- "not defined");
- return nullptr;
+ return y_absl::make_unique<XdsBootstrap>(std::move(json), error);
}
-XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
+XdsBootstrap::XdsBootstrap(Json json, grpc_error_handle* error) {
if (json.type() != Json::Type::OBJECT) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"malformed JSON in bootstrap file");
return;
}
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
auto it = json.mutable_object()->find("xds_servers");
if (it == json.mutable_object()->end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -225,7 +112,7 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"xds_servers\" field is not an array"));
} else {
- grpc_error* parse_error = ParseXdsServerList(&it->second);
+ grpc_error_handle parse_error = ParseXdsServerList(&it->second);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
it = json.mutable_object()->find("node");
@@ -234,7 +121,7 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"node\" field is not an object"));
} else {
- grpc_error* parse_error = ParseNode(&it->second);
+ grpc_error_handle parse_error = ParseNode(&it->second);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
@@ -248,31 +135,29 @@ XdsBootstrap::XdsBootstrap(Json json, grpc_error** error) {
std::move(*it->second.mutable_string_value());
}
}
- if (XdsSecurityEnabled()) {
- it = json.mutable_object()->find("certificate_providers");
- if (it != json.mutable_object()->end()) {
- if (it->second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "\"certificate_providers\" field is not an object"));
- } else {
- grpc_error* parse_error = ParseCertificateProviders(&it->second);
- if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
- }
+ it = json.mutable_object()->find("certificate_providers");
+ if (it != json.mutable_object()->end()) {
+ if (it->second.type() != Json::Type::OBJECT) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "\"certificate_providers\" field is not an object"));
+ } else {
+ grpc_error_handle parse_error = ParseCertificateProviders(&it->second);
+ if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
*error = GRPC_ERROR_CREATE_FROM_VECTOR("errors parsing xds bootstrap file",
&error_list);
}
-grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseXdsServerList(Json* json) {
+ std::vector<grpc_error_handle> error_list;
for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
Json& child = json->mutable_array()->at(i);
if (child.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("array element ", i, " is not an object").c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("array element ", i, " is not an object")));
} else {
- grpc_error* parse_error = ParseXdsServer(&child, i);
+ grpc_error_handle parse_error = ParseXdsServer(&child, i);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
@@ -280,8 +165,8 @@ grpc_error* XdsBootstrap::ParseXdsServerList(Json* json) {
&error_list);
}
-grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
+ std::vector<grpc_error_handle> error_list;
servers_.emplace_back();
XdsServer& server = servers_[servers_.size() - 1];
auto it = json->mutable_object()->find("server_uri");
@@ -302,7 +187,8 @@ grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"channel_creds\" field is not an array"));
} else {
- grpc_error* parse_error = ParseChannelCredsArray(&it->second, &server);
+ grpc_error_handle parse_error =
+ ParseChannelCredsArray(&it->second, &server);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
it = json->mutable_object()->find("server_features");
@@ -311,31 +197,25 @@ grpc_error* XdsBootstrap::ParseXdsServer(Json* json, size_t idx) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"server_features\" field is not an array"));
} else {
- grpc_error* parse_error = ParseServerFeaturesArray(&it->second, &server);
+ grpc_error_handle parse_error =
+ ParseServerFeaturesArray(&it->second, &server);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- if (error_list.empty()) return GRPC_ERROR_NONE;
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", idx).c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
- }
- return error;
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("errors parsing index ", idx), &error_list);
}
-grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseChannelCredsArray(Json* json,
+ XdsServer* server) {
+ std::vector<grpc_error_handle> error_list;
for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
Json& child = json->mutable_array()->at(i);
if (child.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("array element ", i, " is not an object").c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("array element ", i, " is not an object")));
} else {
- grpc_error* parse_error = ParseChannelCreds(&child, i, server);
+ grpc_error_handle parse_error = ParseChannelCreds(&child, i, server);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
@@ -347,9 +227,9 @@ grpc_error* XdsBootstrap::ParseChannelCredsArray(Json* json,
&error_list);
}
-grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
+ XdsServer* server) {
+ std::vector<grpc_error_handle> error_list;
TString type;
auto it = json->mutable_object()->find("type");
if (it == json->mutable_object()->end()) {
@@ -375,27 +255,19 @@ grpc_error* XdsBootstrap::ParseChannelCreds(Json* json, size_t idx,
if (server->channel_creds_type.empty() &&
XdsChannelCredsRegistry::IsSupported(type)) {
if (!XdsChannelCredsRegistry::IsValidConfig(type, config)) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("invalid config for channel creds type \"", type, "\"")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "invalid config for channel creds type \"", type, "\"")));
}
server->channel_creds_type = std::move(type);
server->channel_creds_config = std::move(config);
}
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- if (error_list.empty()) return GRPC_ERROR_NONE;
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing index ", idx).c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
- }
- return error;
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("errors parsing index ", idx), &error_list);
}
-grpc_error* XdsBootstrap::ParseServerFeaturesArray(Json* json,
- XdsServer* server) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseServerFeaturesArray(Json* json,
+ XdsServer* server) {
+ std::vector<grpc_error_handle> error_list;
for (size_t i = 0; i < json->mutable_array()->size(); ++i) {
Json& child = json->mutable_array()->at(i);
if (child.type() == Json::Type::STRING &&
@@ -407,8 +279,8 @@ grpc_error* XdsBootstrap::ParseServerFeaturesArray(Json* json,
"errors parsing \"server_features\" array", &error_list);
}
-grpc_error* XdsBootstrap::ParseNode(Json* json) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseNode(Json* json) {
+ std::vector<grpc_error_handle> error_list;
node_ = y_absl::make_unique<Node>();
auto it = json->mutable_object()->find("id");
if (it != json->mutable_object()->end()) {
@@ -434,7 +306,7 @@ grpc_error* XdsBootstrap::ParseNode(Json* json) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"locality\" field is not an object"));
} else {
- grpc_error* parse_error = ParseLocality(&it->second);
+ grpc_error_handle parse_error = ParseLocality(&it->second);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
}
@@ -451,8 +323,8 @@ grpc_error* XdsBootstrap::ParseNode(Json* json) {
&error_list);
}
-grpc_error* XdsBootstrap::ParseLocality(Json* json) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseLocality(Json* json) {
+ std::vector<grpc_error_handle> error_list;
auto it = json->mutable_object()->find("region");
if (it != json->mutable_object()->end()) {
if (it->second.type() != Json::Type::STRING) {
@@ -484,16 +356,14 @@ grpc_error* XdsBootstrap::ParseLocality(Json* json) {
&error_list);
}
-grpc_error* XdsBootstrap::ParseCertificateProviders(Json* json) {
- std::vector<grpc_error*> error_list;
+grpc_error_handle XdsBootstrap::ParseCertificateProviders(Json* json) {
+ std::vector<grpc_error_handle> error_list;
for (auto& certificate_provider : *(json->mutable_object())) {
if (certificate_provider.second.type() != Json::Type::OBJECT) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("element \"", certificate_provider.first,
- "\" is not an object")
- .c_str()));
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "element \"", certificate_provider.first, "\" is not an object")));
} else {
- grpc_error* parse_error = ParseCertificateProvider(
+ grpc_error_handle parse_error = ParseCertificateProvider(
certificate_provider.first, &certificate_provider.second);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
@@ -502,9 +372,9 @@ grpc_error* XdsBootstrap::ParseCertificateProviders(Json* json) {
"errors parsing \"certificate_providers\" object", &error_list);
}
-grpc_error* XdsBootstrap::ParseCertificateProvider(
+grpc_error_handle XdsBootstrap::ParseCertificateProvider(
const TString& instance_name, Json* certificate_provider_json) {
- std::vector<grpc_error*> error_list;
+ std::vector<grpc_error_handle> error_list;
auto it = certificate_provider_json->mutable_object()->find("plugin_name");
if (it == certificate_provider_json->mutable_object()->end()) {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -517,7 +387,10 @@ grpc_error* XdsBootstrap::ParseCertificateProvider(
CertificateProviderFactory* factory =
CertificateProviderRegistry::LookupCertificateProviderFactory(
plugin_name);
- if (factory != nullptr) {
+ if (factory == nullptr) {
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Unrecognized plugin name: ", plugin_name)));
+ } else {
RefCountedPtr<CertificateProviderFactory::Config> config;
it = certificate_provider_json->mutable_object()->find("config");
if (it != certificate_provider_json->mutable_object()->end()) {
@@ -525,14 +398,14 @@ grpc_error* XdsBootstrap::ParseCertificateProvider(
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"\"config\" field is not an object"));
} else {
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
config = factory->CreateCertificateProviderConfig(it->second,
&parse_error);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
}
} else {
// "config" is an optional field, so create an empty JSON object.
- grpc_error* parse_error = GRPC_ERROR_NONE;
+ grpc_error_handle parse_error = GRPC_ERROR_NONE;
config = factory->CreateCertificateProviderConfig(Json::Object(),
&parse_error);
if (parse_error != GRPC_ERROR_NONE) error_list.push_back(parse_error);
@@ -541,15 +414,61 @@ grpc_error* XdsBootstrap::ParseCertificateProvider(
{instance_name, {std::move(plugin_name), std::move(config)}});
}
}
- // Can't use GRPC_ERROR_CREATE_FROM_VECTOR() here, because the error
- // string is not static in this case.
- if (error_list.empty()) return GRPC_ERROR_NONE;
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("errors parsing element \"", instance_name, "\"").c_str());
- for (size_t i = 0; i < error_list.size(); ++i) {
- error = grpc_error_add_child(error, error_list[i]);
+ return GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(
+ y_absl::StrCat("errors parsing element \"", instance_name, "\""),
+ &error_list);
+}
+
+TString XdsBootstrap::ToString() const {
+ std::vector<TString> parts;
+ if (node_ != nullptr) {
+ parts.push_back(y_absl::StrFormat(
+ "node={\n"
+ " id=\"%s\",\n"
+ " cluster=\"%s\",\n"
+ " locality={\n"
+ " region=\"%s\",\n"
+ " zone=\"%s\",\n"
+ " sub_zone=\"%s\"\n"
+ " },\n"
+ " metadata=%s,\n"
+ "},\n",
+ node_->id, node_->cluster, node_->locality_region, node_->locality_zone,
+ node_->locality_sub_zone, node_->metadata.Dump()));
+ }
+ parts.push_back(
+ y_absl::StrFormat("servers=[\n"
+ " {\n"
+ " uri=\"%s\",\n"
+ " creds_type=%s,\n",
+ server().server_uri, server().channel_creds_type));
+ if (server().channel_creds_config.type() != Json::Type::JSON_NULL) {
+ parts.push_back(y_absl::StrFormat(" creds_config=%s,",
+ server().channel_creds_config.Dump()));
+ }
+ if (!server().server_features.empty()) {
+ parts.push_back(y_absl::StrCat(" server_features=[",
+ y_absl::StrJoin(server().server_features, ", "),
+ "],\n"));
+ }
+ parts.push_back(" }\n],\n");
+ if (!server_listener_resource_name_template_.empty()) {
+ parts.push_back(
+ y_absl::StrFormat("server_listener_resource_name_template=\"%s\",\n",
+ server_listener_resource_name_template_));
+ }
+ parts.push_back("certificate_providers={\n");
+ for (const auto& entry : certificate_providers_) {
+ parts.push_back(
+ y_absl::StrFormat(" %s={\n"
+ " plugin_name=%s\n"
+ " config=%s\n"
+ " },\n",
+ entry.first, entry.second.plugin_name,
+ entry.second.config->ToString()));
}
- return error;
+ parts.push_back("}");
+ return y_absl::StrJoin(parts, "");
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
index ccee7372715..2aa6db01cb7 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_bootstrap.h
@@ -64,25 +64,29 @@ class XdsBootstrap {
Json channel_creds_config;
std::set<TString> server_features;
+ bool operator<(const XdsServer& other) const {
+ if (server_uri < other.server_uri) return true;
+ if (channel_creds_type < other.channel_creds_type) return true;
+ if (channel_creds_config.Dump() < other.channel_creds_config.Dump()) {
+ return true;
+ }
+ if (server_features < other.server_features) return true;
+ return false;
+ }
+
bool ShouldUseV3() const;
};
- // Creates bootstrap object, obtaining the bootstrap JSON as appropriate
- // for the environment:
- // - If the GRPC_XDS_BOOTSTRAP env var is set, reads the file it specifies
- // to obtain the bootstrap JSON.
- // - Otherwise, if the GRPC_XDS_BOOTSTRAP_CONFIG env var is set, reads the
- // content of that env var to obtain the bootstrap JSON.
- // - Otherwise, the JSON will be read from fallback_config (if non-null).
+ // Creates bootstrap object from json_string.
// If *error is not GRPC_ERROR_NONE after returning, then there was an
- // error (e.g., no config found or error reading the file).
- static std::unique_ptr<XdsBootstrap> Create(XdsClient* client,
- TraceFlag* tracer,
- const char* fallback_config,
- grpc_error** error);
+ // error parsing the contents.
+ static std::unique_ptr<XdsBootstrap> Create(y_absl::string_view json_string,
+ grpc_error_handle* error);
+
+ // Do not instantiate directly -- use Create() above instead.
+ XdsBootstrap(Json json, grpc_error_handle* error);
- // Do not instantiate directly -- use ReadFromFile() above instead.
- XdsBootstrap(Json json, grpc_error** error);
+ TString ToString() const;
// TODO(roth): We currently support only one server. Fix this when we
// add support for fallback for the xds channel.
@@ -98,16 +102,17 @@ class XdsBootstrap {
}
private:
- grpc_error* ParseXdsServerList(Json* json);
- grpc_error* ParseXdsServer(Json* json, size_t idx);
- grpc_error* ParseChannelCredsArray(Json* json, XdsServer* server);
- grpc_error* ParseChannelCreds(Json* json, size_t idx, XdsServer* server);
- grpc_error* ParseServerFeaturesArray(Json* json, XdsServer* server);
- grpc_error* ParseNode(Json* json);
- grpc_error* ParseLocality(Json* json);
- grpc_error* ParseCertificateProviders(Json* json);
- grpc_error* ParseCertificateProvider(const TString& instance_name,
- Json* certificate_provider_json);
+ grpc_error_handle ParseXdsServerList(Json* json);
+ grpc_error_handle ParseXdsServer(Json* json, size_t idx);
+ grpc_error_handle ParseChannelCredsArray(Json* json, XdsServer* server);
+ grpc_error_handle ParseChannelCreds(Json* json, size_t idx,
+ XdsServer* server);
+ grpc_error_handle ParseServerFeaturesArray(Json* json, XdsServer* server);
+ grpc_error_handle ParseNode(Json* json);
+ grpc_error_handle ParseLocality(Json* json);
+ grpc_error_handle ParseCertificateProviders(Json* json);
+ grpc_error_handle ParseCertificateProvider(const TString& instance_name,
+ Json* certificate_provider_json);
y_absl::InlinedVector<XdsServer, 1> servers_;
std::unique_ptr<Node> node_;
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc b/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc
index 92c68ab0b59..0219cf0857b 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.cc
@@ -23,8 +23,6 @@
#include "y_absl/functional/bind_front.h"
#include "y_absl/strings/str_cat.h"
-#include "src/core/lib/gpr/useful.h"
-
namespace grpc_core {
namespace {
@@ -51,8 +49,8 @@ class RootCertificatesWatcher
}
}
- void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) override {
+ void OnError(grpc_error_handle root_cert_error,
+ grpc_error_handle identity_cert_error) override {
if (root_cert_error != GRPC_ERROR_NONE) {
parent_->SetErrorForCert(cert_name_, root_cert_error /* pass the ref */,
y_absl::nullopt);
@@ -86,8 +84,8 @@ class IdentityCertificatesWatcher
}
}
- void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) override {
+ void OnError(grpc_error_handle root_cert_error,
+ grpc_error_handle identity_cert_error) override {
if (identity_cert_error != GRPC_ERROR_NONE) {
parent_->SetErrorForCert(cert_name_, y_absl::nullopt,
identity_cert_error /* pass the ref */);
@@ -379,7 +377,9 @@ void XdsCertificateProviderArgDestroy(void* p) {
xds_certificate_provider->Unref();
}
-int XdsCertificateProviderArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int XdsCertificateProviderArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
const grpc_arg_pointer_vtable kChannelArgVtable = {
XdsCertificateProviderArgCopy, XdsCertificateProviderArgDestroy,
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.h b/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.h
index 915e8037f9b..f38c8f361fd 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_certificate_provider.h
@@ -34,8 +34,7 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
XdsCertificateProvider();
~XdsCertificateProvider() override;
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
- const override {
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor() const override {
return distributor_;
}
@@ -127,9 +126,11 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
void WatchStatusCallback(TString cert_name, bool root_being_watched,
bool identity_being_watched);
+ RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
+
Mutex mu_;
std::map<TString /*cert_name*/, std::unique_ptr<ClusterCertificateState>>
- certificate_state_map_;
+ certificate_state_map_ Y_ABSL_GUARDED_BY(mu_);
// Use a separate mutex for san_matchers_ to avoid deadlocks since
// san_matchers_ needs to be accessed when a handshake is being done and we
@@ -141,9 +142,7 @@ class XdsCertificateProvider : public grpc_tls_certificate_provider {
// subject_alternative_names_matchers()
Mutex san_matchers_mu_;
std::map<TString /*cluster_name*/, std::vector<StringMatcher>>
- san_matcher_map_;
-
- RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
+ san_matcher_map_ Y_ABSL_GUARDED_BY(san_matchers_mu_);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h b/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
index a258940361d..ea6c862b497 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_channel_args.h
@@ -17,8 +17,11 @@
#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_ARGS_H
-// Pointer channel arg containing a ref to the XdsClient object.
-#define GRPC_ARG_XDS_CLIENT "grpc.xds_client"
+// Specifies channel args for the xDS client.
+// Used only when GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG
+// is set.
+#define GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS \
+ "grpc.xds_client_channel_args"
// Timeout in milliseconds to wait for a resource to be returned from
// the xds server before assuming that it does not exist.
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc b/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc
new file mode 100644
index 00000000000..bdf7e21aa5b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.cc
@@ -0,0 +1,112 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/xds_channel_stack_modifier.h"
+
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/channel_init.h"
+
+namespace grpc_core {
+namespace {
+
+void* XdsChannelStackModifierArgCopy(void* p) {
+ XdsChannelStackModifier* arg = static_cast<XdsChannelStackModifier*>(p);
+ return arg->Ref().release();
+}
+
+void XdsChannelStackModifierArgDestroy(void* p) {
+ XdsChannelStackModifier* arg = static_cast<XdsChannelStackModifier*>(p);
+ arg->Unref();
+}
+
+int XdsChannelStackModifierArgCmp(void* p, void* q) {
+ return QsortCompare(p, q);
+}
+
+const grpc_arg_pointer_vtable kChannelArgVtable = {
+ XdsChannelStackModifierArgCopy, XdsChannelStackModifierArgDestroy,
+ XdsChannelStackModifierArgCmp};
+
+const char* kXdsChannelStackModifierChannelArgName =
+ "grpc.internal.xds_channel_stack_modifier";
+
+} // namespace
+
+bool XdsChannelStackModifier::ModifyChannelStack(
+ grpc_channel_stack_builder* builder) {
+ // Insert the filters after the census filter if present.
+ grpc_channel_stack_builder_iterator* it =
+ grpc_channel_stack_builder_create_iterator_at_first(builder);
+ while (grpc_channel_stack_builder_move_next(it)) {
+ if (grpc_channel_stack_builder_iterator_is_end(it)) break;
+ const char* filter_name_at_it =
+ grpc_channel_stack_builder_iterator_filter_name(it);
+ if (strcmp("census_server", filter_name_at_it) == 0 ||
+ strcmp("opencensus_server", filter_name_at_it) == 0) {
+ break;
+ }
+ }
+ if (grpc_channel_stack_builder_iterator_is_end(it)) {
+ // No census filter found. Reset iterator to the beginning. This will result
+ // in prepending the list of xDS HTTP filters to the current stack. Note
+ // that this stage is run before the stage that adds the top server filter,
+ // resulting in these filters being finally placed after the `server`
+ // filter.
+ grpc_channel_stack_builder_iterator_destroy(it);
+ it = grpc_channel_stack_builder_create_iterator_at_first(builder);
+ }
+ GPR_ASSERT(grpc_channel_stack_builder_move_next(it));
+ for (const grpc_channel_filter* filter : filters_) {
+ GPR_ASSERT(grpc_channel_stack_builder_add_filter_before(it, filter, nullptr,
+ nullptr));
+ }
+ grpc_channel_stack_builder_iterator_destroy(it);
+ return true;
+}
+
+grpc_arg XdsChannelStackModifier::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(kXdsChannelStackModifierChannelArgName),
+ const_cast<XdsChannelStackModifier*>(this), &kChannelArgVtable);
+}
+
+RefCountedPtr<XdsChannelStackModifier>
+XdsChannelStackModifier::GetFromChannelArgs(const grpc_channel_args& args) {
+ XdsChannelStackModifier* config_selector_provider =
+ grpc_channel_args_find_pointer<XdsChannelStackModifier>(
+ &args, kXdsChannelStackModifierChannelArgName);
+ return config_selector_provider != nullptr ? config_selector_provider->Ref()
+ : nullptr;
+}
+
+void RegisterXdsChannelStackModifier(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) {
+ RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier =
+ XdsChannelStackModifier::GetFromChannelArgs(
+ *grpc_channel_stack_builder_get_channel_arguments(builder));
+ if (channel_stack_modifier != nullptr) {
+ return channel_stack_modifier->ModifyChannelStack(builder);
+ }
+ return true;
+ });
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.h b/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.h
new file mode 100644
index 00000000000..bf6d2ff3962
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_channel_stack_modifier.h
@@ -0,0 +1,52 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H
+#define GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+
+namespace grpc_core {
+
+// XdsChannelStackModifier allows for inserting xDS HTTP filters into the
+// channel stack. It is registered to mutate the `grpc_channel_stack_builder`
+// object via ChannelInit::Builder::RegisterStage.
+class XdsChannelStackModifier : public RefCounted<XdsChannelStackModifier> {
+ public:
+ explicit XdsChannelStackModifier(
+ std::vector<const grpc_channel_filter*> filters)
+ : filters_(std::move(filters)) {}
+ // Returns true on success, false otherwise.
+ bool ModifyChannelStack(grpc_channel_stack_builder* builder);
+ grpc_arg MakeChannelArg() const;
+ static RefCountedPtr<XdsChannelStackModifier> GetFromChannelArgs(
+ const grpc_channel_args& args);
+
+ private:
+ std::vector<const grpc_channel_filter*> filters_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_EXT_XDS_XDS_CHANNEL_STACK_MODIFIER_H */
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client.cc b/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
index 7ea6894529d..94106e4e254 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client.cc
@@ -1,23 +1,23 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <grpc/support/port_platform.h>
+#include "src/core/ext/xds/xds_client.h"
+
#include <inttypes.h>
#include <limits.h>
#include <string.h>
@@ -33,30 +33,29 @@
#include <grpc/support/time.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
#include "src/core/ext/xds/xds_api.h"
#include "src/core/ext/xds/xds_bootstrap.h"
#include "src/core/ext/xds/xds_channel_args.h"
-#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/ext/xds/xds_http_filters.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/uri/uri_parser.h"
#define GRPC_XDS_INITIAL_CONNECT_BACKOFF_SECONDS 1
#define GRPC_XDS_RECONNECT_BACKOFF_MULTIPLIER 1.6
@@ -72,12 +71,50 @@ TraceFlag grpc_xds_client_refcount_trace(false, "xds_client_refcount");
namespace {
Mutex* g_mu = nullptr;
-const grpc_channel_args* g_channel_args = nullptr;
-XdsClient* g_xds_client = nullptr;
-char* g_fallback_bootstrap_config = nullptr;
+
+const grpc_channel_args* g_channel_args Y_ABSL_GUARDED_BY(*g_mu) = nullptr;
+XdsClient* g_xds_client Y_ABSL_GUARDED_BY(*g_mu) = nullptr;
+char* g_fallback_bootstrap_config Y_ABSL_GUARDED_BY(*g_mu) = nullptr;
} // namespace
+class XdsClient::Notifier {
+ public:
+ // Helper template function to invoke `OnError()` on a list of watchers \a
+ // watchers_list within \a work_serializer. Works with all 4 resource types.
+ template <class T>
+ static void ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ XdsClient* xds_client, const T& watchers_list, grpc_error_handle error,
+ const DebugLocation& location) {
+ xds_client->work_serializer_.Schedule(
+ [watchers_list, error]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnError(GRPC_ERROR_REF(error));
+ }
+ GRPC_ERROR_UNREF(error);
+ },
+ location);
+ }
+
+ // Helper template function to invoke `OnResourceDoesNotExist()` on a list of
+ // watchers \a watchers_list within \a work_serializer. Works with all 4
+ // resource types.
+ template <class T>
+ static void ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
+ XdsClient* xds_client, const T& watchers_list,
+ const DebugLocation& location) {
+ xds_client->work_serializer_.Schedule(
+ [watchers_list]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnResourceDoesNotExist();
+ }
+ },
+ location);
+ }
+};
+
//
// Internal class declarations
//
@@ -88,7 +125,7 @@ template <typename T>
class XdsClient::ChannelState::RetryableCall
: public InternallyRefCounted<RetryableCall<T>> {
public:
- explicit RetryableCall(RefCountedPtr<ChannelState> chand);
+ explicit RetryableCall(WeakRefCountedPtr<ChannelState> chand);
void Orphan() override;
@@ -102,14 +139,14 @@ class XdsClient::ChannelState::RetryableCall
private:
void StartNewCallLocked();
void StartRetryTimerLocked();
- static void OnRetryTimer(void* arg, grpc_error* error);
- void OnRetryTimerLocked(grpc_error* error);
+ static void OnRetryTimer(void* arg, grpc_error_handle error);
+ void OnRetryTimerLocked(grpc_error_handle error);
// The wrapped xds call that talks to the xds server. It's instantiated
// every time we start a new call. It's null during call retry backoff.
OrphanablePtr<T> calld_;
// The owning xds channel.
- RefCountedPtr<ChannelState> chand_;
+ WeakRefCountedPtr<ChannelState> chand_;
// Retry state.
BackOff backoff_;
@@ -135,32 +172,33 @@ class XdsClient::ChannelState::AdsCallState
XdsClient* xds_client() const { return chand()->xds_client(); }
bool seen_response() const { return seen_response_; }
- void Subscribe(const TString& type_url, const TString& name);
- void Unsubscribe(const TString& type_url, const TString& name,
- bool delay_unsubscription);
+ void SubscribeLocked(const TString& type_url,
+ const XdsApi::ResourceName& name)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ void UnsubscribeLocked(const TString& type_url,
+ const XdsApi::ResourceName& name,
+ bool delay_unsubscription)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool HasSubscribedResources() const;
private:
class ResourceState : public InternallyRefCounted<ResourceState> {
public:
- ResourceState(const TString& type_url, const TString& name,
- bool sent_initial_request)
- : type_url_(type_url),
- name_(name),
- sent_initial_request_(sent_initial_request) {
+ ResourceState(const TString& type_url, const XdsApi::ResourceName& name)
+ : type_url_(type_url), name_(name) {
GRPC_CLOSURE_INIT(&timer_callback_, OnTimer, this,
grpc_schedule_on_exec_ctx);
}
void Orphan() override {
- Finish();
+ MaybeCancelTimer();
Unref(DEBUG_LOCATION, "Orphan");
}
- void Start(RefCountedPtr<AdsCallState> ads_calld) {
- if (sent_initial_request_) return;
- sent_initial_request_ = true;
+ void MaybeStartTimer(RefCountedPtr<AdsCallState> ads_calld) {
+ if (timer_started_) return;
+ timer_started_ = true;
ads_calld_ = std::move(ads_calld);
Ref(DEBUG_LOCATION, "timer").release();
timer_pending_ = true;
@@ -170,7 +208,7 @@ class XdsClient::ChannelState::AdsCallState
&timer_callback_);
}
- void Finish() {
+ void MaybeCancelTimer() {
if (timer_pending_) {
grpc_timer_cancel(&timer_);
timer_pending_ = false;
@@ -178,55 +216,59 @@ class XdsClient::ChannelState::AdsCallState
}
private:
- static void OnTimer(void* arg, grpc_error* error) {
+ static void OnTimer(void* arg, grpc_error_handle error) {
ResourceState* self = static_cast<ResourceState*>(arg);
{
MutexLock lock(&self->ads_calld_->xds_client()->mu_);
self->OnTimerLocked(GRPC_ERROR_REF(error));
}
+ self->ads_calld_->xds_client()->work_serializer_.DrainQueue();
self->ads_calld_.reset();
self->Unref(DEBUG_LOCATION, "timer");
}
- void OnTimerLocked(grpc_error* error) {
+ void OnTimerLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
if (error == GRPC_ERROR_NONE && timer_pending_) {
timer_pending_ = false;
- grpc_error* watcher_error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
+ grpc_error_handle watcher_error =
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
"timeout obtaining resource {type=%s name=%s} from xds server",
- type_url_, name_)
- .c_str());
+ type_url_,
+ XdsApi::ConstructFullResourceName(name_.authority, type_url_,
+ name_.id)));
watcher_error = grpc_error_set_int(
watcher_error, GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] %s", ads_calld_->xds_client(),
- grpc_error_string(watcher_error));
+ grpc_error_std_string(watcher_error).c_str());
}
+ auto& authority_state =
+ ads_calld_->xds_client()->authority_state_map_[name_.authority];
if (type_url_ == XdsApi::kLdsTypeUrl) {
- ListenerState& state = ads_calld_->xds_client()->listener_map_[name_];
+ ListenerState& state = authority_state.listener_map[name_.id];
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ ads_calld_->xds_client(), state.watchers,
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
} else if (type_url_ == XdsApi::kRdsTypeUrl) {
- RouteConfigState& state =
- ads_calld_->xds_client()->route_config_map_[name_];
+ RouteConfigState& state = authority_state.route_config_map[name_.id];
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ ads_calld_->xds_client(), state.watchers,
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
} else if (type_url_ == XdsApi::kCdsTypeUrl) {
- ClusterState& state = ads_calld_->xds_client()->cluster_map_[name_];
+ ClusterState& state = authority_state.cluster_map[name_.id];
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ ads_calld_->xds_client(), state.watchers,
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
} else if (type_url_ == XdsApi::kEdsTypeUrl) {
- EndpointState& state = ads_calld_->xds_client()->endpoint_map_[name_];
+ EndpointState& state = authority_state.endpoint_map[name_.id];
state.meta.client_status = XdsApi::ResourceMetadata::DOES_NOT_EXIST;
- for (const auto& p : state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(watcher_error));
- }
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ ads_calld_->xds_client(), state.watchers,
+ GRPC_ERROR_REF(watcher_error), DEBUG_LOCATION);
} else {
GPR_UNREACHABLE_CODE(return );
}
@@ -236,10 +278,10 @@ class XdsClient::ChannelState::AdsCallState
}
const TString type_url_;
- const TString name_;
+ const XdsApi::ResourceName name_;
RefCountedPtr<AdsCallState> ads_calld_;
- bool sent_initial_request_;
+ bool timer_started_ = false;
bool timer_pending_ = false;
grpc_timer timer_;
grpc_closure timer_callback_;
@@ -250,35 +292,61 @@ class XdsClient::ChannelState::AdsCallState
// Nonce and error for this resource type.
TString nonce;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Subscribed resources of this type.
- std::map<TString /* name */, OrphanablePtr<ResourceState>>
+ std::map<TString /*authority*/,
+ std::map<TString /*name*/, OrphanablePtr<ResourceState>>>
subscribed_resources;
};
- void SendMessageLocked(const TString& type_url);
-
- void AcceptLdsUpdate(TString version, grpc_millis update_time,
- XdsApi::LdsUpdateMap lds_update_map);
- void AcceptRdsUpdate(TString version, grpc_millis update_time,
- XdsApi::RdsUpdateMap rds_update_map);
- void AcceptCdsUpdate(TString version, grpc_millis update_time,
- XdsApi::CdsUpdateMap cds_update_map);
- void AcceptEdsUpdate(TString version, grpc_millis update_time,
- XdsApi::EdsUpdateMap eds_update_map);
-
- static void OnRequestSent(void* arg, grpc_error* error);
- void OnRequestSentLocked(grpc_error* error);
- static void OnResponseReceived(void* arg, grpc_error* error);
- bool OnResponseReceivedLocked();
- static void OnStatusReceived(void* arg, grpc_error* error);
- void OnStatusReceivedLocked(grpc_error* error);
+ void SendMessageLocked(const TString& type_url)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ void AcceptLdsUpdateLocked(
+ TString version, grpc_millis update_time,
+ XdsApi::LdsUpdateMap lds_update_map,
+ const std::set<XdsApi::ResourceName>& resource_names_failed)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ void AcceptRdsUpdateLocked(TString version, grpc_millis update_time,
+ XdsApi::RdsUpdateMap rds_update_map)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ void AcceptCdsUpdateLocked(
+ TString version, grpc_millis update_time,
+ XdsApi::CdsUpdateMap cds_update_map,
+ const std::set<XdsApi::ResourceName>& resource_names_failed)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ void AcceptEdsUpdateLocked(TString version, grpc_millis update_time,
+ XdsApi::EdsUpdateMap eds_update_map)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ template <typename StateMap>
+ void RejectAdsUpdateHelperLocked(const TString& resource_name,
+ grpc_millis update_time,
+ const XdsApi::AdsParseResult& result,
+ const TString& error_details,
+ StateMap* state_map)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ void RejectAdsUpdateLocked(grpc_millis update_time,
+ const XdsApi::AdsParseResult& result)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+
+ static void OnRequestSent(void* arg, grpc_error_handle error);
+ void OnRequestSentLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnResponseReceived(void* arg, grpc_error_handle error);
+ bool OnResponseReceivedLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnStatusReceived(void* arg, grpc_error_handle error);
+ void OnStatusReceivedLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool IsCurrentCallOnChannel() const;
- std::set<y_absl::string_view> ResourceNamesForRequest(
- const TString& type_url);
+ std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>
+ ResourceNamesForRequest(const TString& type_url);
// The owning RetryableCall<>.
RefCountedPtr<RetryableCall<AdsCallState>> parent_;
@@ -346,12 +414,15 @@ class XdsClient::ChannelState::LrsCallState
void Orphan() override;
private:
- void ScheduleNextReportLocked();
- static void OnNextReportTimer(void* arg, grpc_error* error);
- bool OnNextReportTimerLocked(grpc_error* error);
- bool SendReportLocked();
- static void OnReportDone(void* arg, grpc_error* error);
- bool OnReportDoneLocked(grpc_error* error);
+ void ScheduleNextReportLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnNextReportTimer(void* arg, grpc_error_handle error);
+ bool OnNextReportTimerLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ bool SendReportLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnReportDone(void* arg, grpc_error_handle error);
+ bool OnReportDoneLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool IsCurrentReporterOnCall() const {
return this == parent_->reporter_.get();
@@ -370,12 +441,15 @@ class XdsClient::ChannelState::LrsCallState
grpc_closure on_report_done_;
};
- static void OnInitialRequestSent(void* arg, grpc_error* error);
- void OnInitialRequestSentLocked();
- static void OnResponseReceived(void* arg, grpc_error* error);
- bool OnResponseReceivedLocked();
- static void OnStatusReceived(void* arg, grpc_error* error);
- void OnStatusReceivedLocked(grpc_error* error);
+ static void OnInitialRequestSent(void* arg, grpc_error_handle error);
+ void OnInitialRequestSentLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnResponseReceived(void* arg, grpc_error_handle error);
+ bool OnResponseReceivedLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ static void OnStatusReceived(void* arg, grpc_error_handle error);
+ void OnStatusReceivedLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
bool IsCurrentCallOnChannel() const;
@@ -417,27 +491,30 @@ class XdsClient::ChannelState::LrsCallState
class XdsClient::ChannelState::StateWatcher
: public AsyncConnectivityStateWatcherInterface {
public:
- explicit StateWatcher(RefCountedPtr<ChannelState> parent)
+ explicit StateWatcher(WeakRefCountedPtr<ChannelState> parent)
: parent_(std::move(parent)) {}
private:
void OnConnectivityStateChange(grpc_connectivity_state new_state,
const y_absl::Status& status) override {
- MutexLock lock(&parent_->xds_client_->mu_);
- if (!parent_->shutting_down_ &&
- new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
- // In TRANSIENT_FAILURE. Notify all watchers of error.
- gpr_log(GPR_INFO,
- "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
- "status_message:(%s)",
- parent_->xds_client(), status.ToString().c_str());
- parent_->xds_client()->NotifyOnErrorLocked(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "xds channel in TRANSIENT_FAILURE"));
+ {
+ MutexLock lock(&parent_->xds_client_->mu_);
+ if (!parent_->shutting_down_ &&
+ new_state == GRPC_CHANNEL_TRANSIENT_FAILURE) {
+ // In TRANSIENT_FAILURE. Notify all watchers of error.
+ gpr_log(GPR_INFO,
+ "[xds_client %p] xds channel in state:TRANSIENT_FAILURE "
+ "status_message:(%s)",
+ parent_->xds_client(), status.ToString().c_str());
+ parent_->xds_client_->NotifyOnErrorLocked(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "xds channel in TRANSIENT_FAILURE"));
+ }
}
+ parent_->xds_client()->work_serializer_.DrainQueue();
}
- RefCountedPtr<ChannelState> parent_;
+ WeakRefCountedPtr<ChannelState> parent_;
};
//
@@ -446,33 +523,20 @@ class XdsClient::ChannelState::StateWatcher
namespace {
-grpc_channel* CreateXdsChannel(const XdsBootstrap::XdsServer& server) {
- // Build channel args.
- y_absl::InlinedVector<grpc_arg, 2> args_to_add = {
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
- 5 * 60 * GPR_MS_PER_SEC),
- grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL), 1),
- };
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
- g_channel_args, args_to_add.data(), args_to_add.size());
- // Create channel creds.
+grpc_channel* CreateXdsChannel(grpc_channel_args* args,
+ const XdsBootstrap::XdsServer& server) {
RefCountedPtr<grpc_channel_credentials> channel_creds =
XdsChannelCredsRegistry::MakeChannelCreds(server.channel_creds_type,
server.channel_creds_config);
- // Create channel.
- grpc_channel* channel = grpc_secure_channel_create(
- channel_creds.get(), server.server_uri.c_str(), new_args, nullptr);
- grpc_channel_args_destroy(new_args);
- return channel;
+ return grpc_secure_channel_create(channel_creds.get(),
+ server.server_uri.c_str(), args, nullptr);
}
} // namespace
XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
const XdsBootstrap::XdsServer& server)
- : InternallyRefCounted<ChannelState>(
+ : DualRefCounted<ChannelState>(
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace)
? "ChannelState"
: nullptr),
@@ -482,7 +546,7 @@ XdsClient::ChannelState::ChannelState(WeakRefCountedPtr<XdsClient> xds_client,
gpr_log(GPR_INFO, "[xds_client %p] creating channel to %s",
xds_client_.get(), server.server_uri.c_str());
}
- channel_ = CreateXdsChannel(server);
+ channel_ = CreateXdsChannel(xds_client_->args_, server);
GPR_ASSERT(channel_ != nullptr);
StartConnectivityWatchLocked();
}
@@ -496,12 +560,19 @@ XdsClient::ChannelState::~ChannelState() {
xds_client_.reset(DEBUG_LOCATION, "ChannelState");
}
-void XdsClient::ChannelState::Orphan() {
+// This method should only ever be called when holding the lock, but we can't
+// use a Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED annotation, because Orphan() will be
+// called from DualRefCounted::Unref, which cannot have a lock annotation for a
+// lock in this subclass.
+void XdsClient::ChannelState::Orphan() Y_ABSL_NO_THREAD_SAFETY_ANALYSIS {
shutting_down_ = true;
CancelConnectivityWatchLocked();
+ // At this time, all strong refs are removed, remove from channel map to
+ // prevent subsequent subscription from trying to use this ChannelState as it
+ // is shutting down.
+ xds_client_->xds_server_channel_map_.erase(server_);
ads_calld_.reset();
lrs_calld_.reset();
- Unref(DEBUG_LOCATION, "ChannelState+orphaned");
}
XdsClient::ChannelState::AdsCallState* XdsClient::ChannelState::ads_calld()
@@ -520,35 +591,33 @@ bool XdsClient::ChannelState::HasActiveAdsCall() const {
void XdsClient::ChannelState::MaybeStartLrsCall() {
if (lrs_calld_ != nullptr) return;
- lrs_calld_.reset(
- new RetryableCall<LrsCallState>(Ref(DEBUG_LOCATION, "ChannelState+lrs")));
+ lrs_calld_.reset(new RetryableCall<LrsCallState>(
+ WeakRef(DEBUG_LOCATION, "ChannelState+lrs")));
}
void XdsClient::ChannelState::StopLrsCall() { lrs_calld_.reset(); }
void XdsClient::ChannelState::StartConnectivityWatchLocked() {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- watcher_ = new StateWatcher(Ref(DEBUG_LOCATION, "ChannelState+watch"));
- grpc_client_channel_start_connectivity_watch(
- client_channel_elem, GRPC_CHANNEL_IDLE,
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ watcher_ = new StateWatcher(WeakRef(DEBUG_LOCATION, "ChannelState+watch"));
+ client_channel->AddConnectivityWatcher(
+ GRPC_CHANNEL_IDLE,
OrphanablePtr<AsyncConnectivityStateWatcherInterface>(watcher_));
}
void XdsClient::ChannelState::CancelConnectivityWatchLocked() {
- grpc_channel_element* client_channel_elem =
- grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel_));
- GPR_ASSERT(client_channel_elem->filter == &grpc_client_channel_filter);
- grpc_client_channel_stop_connectivity_watch(client_channel_elem, watcher_);
+ ClientChannel* client_channel = ClientChannel::GetFromChannel(channel_);
+ GPR_ASSERT(client_channel != nullptr);
+ client_channel->RemoveConnectivityWatcher(watcher_);
}
-void XdsClient::ChannelState::Subscribe(const TString& type_url,
- const TString& name) {
+void XdsClient::ChannelState::SubscribeLocked(
+ const TString& type_url, const XdsApi::ResourceName& name) {
if (ads_calld_ == nullptr) {
// Start the ADS call if this is the first request.
ads_calld_.reset(new RetryableCall<AdsCallState>(
- Ref(DEBUG_LOCATION, "ChannelState+ads")));
+ WeakRef(DEBUG_LOCATION, "ChannelState+ads")));
// Note: AdsCallState's ctor will automatically subscribe to all
// resources that the XdsClient already has watchers for, so we can
// return here.
@@ -558,17 +627,19 @@ void XdsClient::ChannelState::Subscribe(const TString& type_url,
// because when the call is restarted it will resend all necessary requests.
if (ads_calld() == nullptr) return;
// Subscribe to this resource if the ADS call is active.
- ads_calld()->Subscribe(type_url, name);
+ ads_calld()->SubscribeLocked(type_url, name);
}
-void XdsClient::ChannelState::Unsubscribe(const TString& type_url,
- const TString& name,
- bool delay_unsubscription) {
+void XdsClient::ChannelState::UnsubscribeLocked(
+ const TString& type_url, const XdsApi::ResourceName& name,
+ bool delay_unsubscription) {
if (ads_calld_ != nullptr) {
auto* calld = ads_calld_->calld();
if (calld != nullptr) {
- calld->Unsubscribe(type_url, name, delay_unsubscription);
- if (!calld->HasSubscribedResources()) ads_calld_.reset();
+ calld->UnsubscribeLocked(type_url, name, delay_unsubscription);
+ if (!calld->HasSubscribedResources()) {
+ ads_calld_.reset();
+ }
}
}
}
@@ -579,7 +650,7 @@ void XdsClient::ChannelState::Unsubscribe(const TString& type_url,
template <typename T>
XdsClient::ChannelState::RetryableCall<T>::RetryableCall(
- RefCountedPtr<ChannelState> chand)
+ WeakRefCountedPtr<ChannelState> chand)
: chand_(std::move(chand)),
backoff_(
BackOff::Options()
@@ -637,7 +708,8 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
if (shutting_down_) return;
const grpc_millis next_attempt_time = backoff_.NextAttemptTime();
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- grpc_millis timeout = GPR_MAX(next_attempt_time - ExecCtx::Get()->Now(), 0);
+ grpc_millis timeout =
+ std::max(next_attempt_time - ExecCtx::Get()->Now(), grpc_millis(0));
gpr_log(GPR_INFO,
"[xds_client %p] Failed to connect to xds server (chand: %p) "
"retry timer will fire in %" PRId64 "ms.",
@@ -650,7 +722,7 @@ void XdsClient::ChannelState::RetryableCall<T>::StartRetryTimerLocked() {
template <typename T>
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
RetryableCall* calld = static_cast<RetryableCall*>(arg);
{
MutexLock lock(&calld->chand_->xds_client()->mu_);
@@ -661,7 +733,7 @@ void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimer(
template <typename T>
void XdsClient::ChannelState::RetryableCall<T>::OnRetryTimerLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
retry_timer_callback_pending_ = false;
if (!shutting_down_ && error == GRPC_ERROR_NONE) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
@@ -728,17 +800,26 @@ XdsClient::ChannelState::AdsCallState::AdsCallState(
// Op: send request message.
GRPC_CLOSURE_INIT(&on_request_sent_, OnRequestSent, this,
grpc_schedule_on_exec_ctx);
- for (const auto& p : xds_client()->listener_map_) {
- Subscribe(XdsApi::kLdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->route_config_map_) {
- Subscribe(XdsApi::kRdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->cluster_map_) {
- Subscribe(XdsApi::kCdsTypeUrl, TString(p.first));
- }
- for (const auto& p : xds_client()->endpoint_map_) {
- Subscribe(XdsApi::kEdsTypeUrl, TString(p.first));
+ for (const auto& a : xds_client()->authority_state_map_) {
+ const TString& authority = a.first;
+ // Skip authorities that are not using this xDS channel.
+ if (a.second.channel_state != chand()) continue;
+ for (const auto& l : a.second.listener_map) {
+ const TString& listener_name = l.first;
+ SubscribeLocked(XdsApi::kLdsTypeUrl, {authority, listener_name});
+ }
+ for (const auto& r : a.second.route_config_map) {
+ const TString& route_config_name = r.first;
+ SubscribeLocked(XdsApi::kRdsTypeUrl, {authority, route_config_name});
+ }
+ for (const auto& c : a.second.cluster_map) {
+ const TString& cluster_name = c.first;
+ SubscribeLocked(XdsApi::kCdsTypeUrl, {authority, cluster_name});
+ }
+ for (const auto& e : a.second.endpoint_map) {
+ const TString& endpoint_name = e.first;
+ SubscribeLocked(XdsApi::kEdsTypeUrl, {authority, endpoint_name});
+ }
}
// Op: recv initial metadata.
op = ops;
@@ -802,7 +883,8 @@ void XdsClient::ChannelState::AdsCallState::Orphan() {
}
void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
- const TString& type_url) {
+ const TString& type_url)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_) {
// Buffer message sending if an existing message is in flight.
if (send_message_payload_ != nullptr) {
buffered_requests_.insert(type_url);
@@ -810,11 +892,12 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
}
auto& state = state_map_[type_url];
grpc_slice request_payload_slice;
- std::set<y_absl::string_view> resource_names =
- ResourceNamesForRequest(type_url);
+ std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>
+ resource_map = ResourceNamesForRequest(type_url);
request_payload_slice = xds_client()->api_.CreateAdsRequest(
- chand()->server_, type_url, resource_names,
- xds_client()->resource_version_map_[type_url], state.nonce,
+ chand()->server_, type_url, resource_map,
+ chand()->resource_type_version_map_[type_url], state.nonce,
GRPC_ERROR_REF(state.error), !sent_initial_message_);
if (type_url != XdsApi::kLdsTypeUrl && type_url != XdsApi::kRdsTypeUrl &&
type_url != XdsApi::kCdsTypeUrl && type_url != XdsApi::kEdsTypeUrl) {
@@ -824,11 +907,10 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] sending ADS request: type=%s version=%s nonce=%s "
- "error=%s resources=%s",
+ "error=%s",
xds_client(), type_url.c_str(),
- xds_client()->resource_version_map_[type_url].c_str(),
- state.nonce.c_str(), grpc_error_string(state.error),
- y_absl::StrJoin(resource_names, " ").c_str());
+ chand()->resource_type_version_map_[type_url].c_str(),
+ state.nonce.c_str(), grpc_error_std_string(state.error).c_str());
}
GRPC_ERROR_UNREF(state.error);
state.error = GRPC_ERROR_NONE;
@@ -854,20 +936,25 @@ void XdsClient::ChannelState::AdsCallState::SendMessageLocked(
}
}
-void XdsClient::ChannelState::AdsCallState::Subscribe(
- const TString& type_url, const TString& name) {
- auto& state = state_map_[type_url].subscribed_resources[name];
+void XdsClient::ChannelState::AdsCallState::SubscribeLocked(
+ const TString& type_url, const XdsApi::ResourceName& name) {
+ auto& state =
+ state_map_[type_url].subscribed_resources[name.authority][name.id];
if (state == nullptr) {
- state = MakeOrphanable<ResourceState>(
- type_url, name, !xds_client()->resource_version_map_[type_url].empty());
+ state = MakeOrphanable<ResourceState>(type_url, name);
SendMessageLocked(type_url);
}
}
-void XdsClient::ChannelState::AdsCallState::Unsubscribe(
- const TString& type_url, const TString& name,
+void XdsClient::ChannelState::AdsCallState::UnsubscribeLocked(
+ const TString& type_url, const XdsApi::ResourceName& name,
bool delay_unsubscription) {
- state_map_[type_url].subscribed_resources.erase(name);
+ auto& type_state_map = state_map_[type_url];
+ auto& authority_map = type_state_map.subscribed_resources[name.authority];
+ authority_map.erase(name.id);
+ if (authority_map.empty()) {
+ type_state_map.subscribed_resources.erase(name.authority);
+ }
if (!delay_unsubscription) SendMessageLocked(type_url);
}
@@ -894,9 +981,10 @@ XdsApi::ResourceMetadata CreateResourceMetadataAcked(
} // namespace
-void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
+void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdateLocked(
TString version, grpc_millis update_time,
- XdsApi::LdsUpdateMap lds_update_map) {
+ XdsApi::LdsUpdateMap lds_update_map,
+ const std::set<XdsApi::ResourceName>& resource_names_failed) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] LDS update received containing %" PRIuPTR
@@ -904,30 +992,37 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
xds_client(), lds_update_map.size());
}
auto& lds_state = state_map_[XdsApi::kLdsTypeUrl];
- std::set<TString> rds_resource_names_seen;
for (auto& p : lds_update_map) {
- const TString& listener_name = p.first;
+ const XdsApi::ResourceName& name = p.first;
XdsApi::LdsUpdate& lds_update = p.second.resource;
- auto& state = lds_state.subscribed_resources[listener_name];
- if (state != nullptr) state->Finish();
+ auto it = lds_state.subscribed_resources.find(name.authority);
+ if (it != lds_state.subscribed_resources.end()) {
+ auto res_it = it->second.find(name.id);
+ if (res_it != it->second.end()) {
+ res_it->second->MaybeCancelTimer();
+ }
+ }
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] LDS resource %s: %s", xds_client(),
- listener_name.c_str(), lds_update.ToString().c_str());
- }
- // Record the RDS resource names seen.
- if (!lds_update.http_connection_manager.route_config_name.empty()) {
- rds_resource_names_seen.insert(
- lds_update.http_connection_manager.route_config_name);
+ XdsApi::ConstructFullResourceName(name.authority,
+ XdsApi::kLdsTypeUrl, name.id)
+ .c_str(),
+ lds_update.ToString().c_str());
}
+ ListenerState& listener_state = xds_client()
+ ->authority_state_map_[name.authority]
+ .listener_map[name.id];
// Ignore identical update.
- ListenerState& listener_state = xds_client()->listener_map_[listener_name];
if (listener_state.update.has_value() &&
*listener_state.update == lds_update) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] LDS update for %s identical to current, "
"ignoring.",
- xds_client(), listener_name.c_str());
+ xds_client(),
+ XdsApi::ConstructFullResourceName(name.authority,
+ XdsApi::kLdsTypeUrl, name.id)
+ .c_str());
}
continue;
}
@@ -936,49 +1031,58 @@ void XdsClient::ChannelState::AdsCallState::AcceptLdsUpdate(
listener_state.meta = CreateResourceMetadataAcked(
std::move(p.second.serialized_proto), version, update_time);
// Notify watchers.
- for (const auto& p : listener_state.watchers) {
- p.first->OnListenerChanged(*listener_state.update);
+ auto& watchers_list = listener_state.watchers;
+ auto& value = listener_state.update.value();
+ xds_client()->work_serializer_.Schedule(
+ [watchers_list, value]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnListenerChanged(value);
+ }
+ },
+ DEBUG_LOCATION);
+ }
+ // For invalid resources in the update, if they are already in the
+ // cache, pretend that they are present in the update, so that we
+ // don't incorrectly consider them deleted below.
+ for (const auto& name : resource_names_failed) {
+ auto& listener_map =
+ xds_client()->authority_state_map_[name.authority].listener_map;
+ auto it = listener_map.find(name.id);
+ if (it != listener_map.end()) {
+ auto& update = it->second.update;
+ if (!update.has_value()) continue;
+ lds_update_map[name];
}
}
// For any subscribed resource that is not present in the update,
// remove it from the cache and notify watchers that it does not exist.
- for (const auto& p : lds_state.subscribed_resources) {
- const TString& listener_name = p.first;
- if (lds_update_map.find(listener_name) == lds_update_map.end()) {
- ListenerState& listener_state =
- xds_client()->listener_map_[listener_name];
- // If the resource was newly requested but has not yet been received,
- // we don't want to generate an error for the watchers, because this LDS
- // response may be in reaction to an earlier request that did not yet
- // request the new resource, so its absence from the response does not
- // necessarily indicate that the resource does not exist.
- // For that case, we rely on the request timeout instead.
- if (!listener_state.update.has_value()) continue;
- listener_state.update.reset();
- for (const auto& p : listener_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
- // For any RDS resource that is no longer referred to by any LDS
- // resources, remove it from the cache and notify watchers that it
- // does not exist.
- auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
- for (const auto& p : rds_state.subscribed_resources) {
- const TString& rds_resource_name = p.first;
- if (rds_resource_names_seen.find(rds_resource_name) ==
- rds_resource_names_seen.end()) {
- RouteConfigState& route_config_state =
- xds_client()->route_config_map_[rds_resource_name];
- route_config_state.update.reset();
- for (const auto& p : route_config_state.watchers) {
- p.first->OnResourceDoesNotExist();
+ for (const auto& a : lds_state.subscribed_resources) {
+ const TString& authority_name = a.first;
+ for (const auto& p : a.second) {
+ const TString& listener_name = p.first;
+ if (lds_update_map.find({authority_name, listener_name}) ==
+ lds_update_map.end()) {
+ ListenerState& listener_state =
+ xds_client()
+ ->authority_state_map_[authority_name]
+ .listener_map[listener_name];
+ // If the resource was newly requested but has not yet been received,
+ // we don't want to generate an error for the watchers, because this LDS
+ // response may be in reaction to an earlier request that did not yet
+ // request the new resource, so its absence from the response does not
+ // necessarily indicate that the resource does not exist.
+ // For that case, we rely on the request timeout instead.
+ if (!listener_state.update.has_value()) continue;
+ listener_state.update.reset();
+ Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
+ xds_client(), listener_state.watchers, DEBUG_LOCATION);
}
}
}
}
-void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
+void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdateLocked(
TString version, grpc_millis update_time,
XdsApi::RdsUpdateMap rds_update_map) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
@@ -989,16 +1093,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
}
auto& rds_state = state_map_[XdsApi::kRdsTypeUrl];
for (auto& p : rds_update_map) {
- const TString& route_config_name = p.first;
+ const XdsApi::ResourceName& name = p.first;
XdsApi::RdsUpdate& rds_update = p.second.resource;
- auto& state = rds_state.subscribed_resources[route_config_name];
- if (state != nullptr) state->Finish();
+ auto it = rds_state.subscribed_resources.find(name.authority);
+ if (it != rds_state.subscribed_resources.end()) {
+ auto res_it = it->second.find(name.id);
+ if (res_it != it->second.end()) {
+ res_it->second->MaybeCancelTimer();
+ }
+ }
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] RDS resource:\n%s", xds_client(),
rds_update.ToString().c_str());
}
RouteConfigState& route_config_state =
- xds_client()->route_config_map_[route_config_name];
+ xds_client()
+ ->authority_state_map_[name.authority]
+ .route_config_map[name.id];
// Ignore identical update.
if (route_config_state.update.has_value() &&
*route_config_state.update == rds_update) {
@@ -1014,15 +1125,23 @@ void XdsClient::ChannelState::AdsCallState::AcceptRdsUpdate(
route_config_state.meta = CreateResourceMetadataAcked(
std::move(p.second.serialized_proto), version, update_time);
// Notify all watchers.
- for (const auto& p : route_config_state.watchers) {
- p.first->OnRouteConfigChanged(*route_config_state.update);
- }
+ auto& watchers_list = route_config_state.watchers;
+ auto& value = route_config_state.update.value();
+ xds_client()->work_serializer_.Schedule(
+ [watchers_list, value]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnRouteConfigChanged(value);
+ }
+ },
+ DEBUG_LOCATION);
}
}
-void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
+void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdateLocked(
TString version, grpc_millis update_time,
- XdsApi::CdsUpdateMap cds_update_map) {
+ XdsApi::CdsUpdateMap cds_update_map,
+ const std::set<XdsApi::ResourceName>& resource_names_failed) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO,
"[xds_client %p] CDS update received containing %" PRIuPTR
@@ -1030,22 +1149,26 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
xds_client(), cds_update_map.size());
}
auto& cds_state = state_map_[XdsApi::kCdsTypeUrl];
- std::set<TString> eds_resource_names_seen;
for (auto& p : cds_update_map) {
- const char* cluster_name = p.first.c_str();
+ const XdsApi::ResourceName& name = p.first;
XdsApi::CdsUpdate& cds_update = p.second.resource;
- auto& state = cds_state.subscribed_resources[cluster_name];
- if (state != nullptr) state->Finish();
+ auto it = cds_state.subscribed_resources.find(name.authority);
+ if (it != cds_state.subscribed_resources.end()) {
+ auto res_it = it->second.find(name.id);
+ if (res_it != it->second.end()) {
+ res_it->second->MaybeCancelTimer();
+ }
+ }
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] cluster=%s: %s", xds_client(),
- cluster_name, cds_update.ToString().c_str());
+ XdsApi::ConstructFullResourceName(name.authority,
+ XdsApi::kCdsTypeUrl, name.id)
+ .c_str(),
+ cds_update.ToString().c_str());
}
- // Record the EDS resource names seen.
- eds_resource_names_seen.insert(cds_update.eds_service_name.empty()
- ? cluster_name
- : cds_update.eds_service_name);
+ ClusterState& cluster_state =
+ xds_client()->authority_state_map_[name.authority].cluster_map[name.id];
// Ignore identical update.
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
if (cluster_state.update.has_value() &&
*cluster_state.update == cds_update) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
@@ -1060,48 +1183,57 @@ void XdsClient::ChannelState::AdsCallState::AcceptCdsUpdate(
cluster_state.meta = CreateResourceMetadataAcked(
std::move(p.second.serialized_proto), version, update_time);
// Notify all watchers.
- for (const auto& p : cluster_state.watchers) {
- p.first->OnClusterChanged(cluster_state.update.value());
+ auto& watchers_list = cluster_state.watchers;
+ auto& value = cluster_state.update.value();
+ xds_client()->work_serializer_.Schedule(
+ [watchers_list, value]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnClusterChanged(value);
+ }
+ },
+ DEBUG_LOCATION);
+ }
+ // For invalid resources in the update, if they are already in the
+ // cache, pretend that they are present in the update, so that we
+ // don't incorrectly consider them deleted below.
+ for (const auto& name : resource_names_failed) {
+ auto& cluster_map =
+ xds_client()->authority_state_map_[name.authority].cluster_map;
+ auto it = cluster_map.find(name.id);
+ if (it != cluster_map.end()) {
+ auto& update = it->second.update;
+ if (!update.has_value()) continue;
+ cds_update_map[name];
}
}
// For any subscribed resource that is not present in the update,
// remove it from the cache and notify watchers that it does not exist.
- for (const auto& p : cds_state.subscribed_resources) {
- const TString& cluster_name = p.first;
- if (cds_update_map.find(cluster_name) == cds_update_map.end()) {
- ClusterState& cluster_state = xds_client()->cluster_map_[cluster_name];
- // If the resource was newly requested but has not yet been received,
- // we don't want to generate an error for the watchers, because this CDS
- // response may be in reaction to an earlier request that did not yet
- // request the new resource, so its absence from the response does not
- // necessarily indicate that the resource does not exist.
- // For that case, we rely on the request timeout instead.
- if (!cluster_state.update.has_value()) continue;
- cluster_state.update.reset();
- for (const auto& p : cluster_state.watchers) {
- p.first->OnResourceDoesNotExist();
- }
- }
- }
- // For any EDS resource that is no longer referred to by any CDS
- // resources, remove it from the cache and notify watchers that it
- // does not exist.
- auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
- for (const auto& p : eds_state.subscribed_resources) {
- const TString& eds_resource_name = p.first;
- if (eds_resource_names_seen.find(eds_resource_name) ==
- eds_resource_names_seen.end()) {
- EndpointState& endpoint_state =
- xds_client()->endpoint_map_[eds_resource_name];
- endpoint_state.update.reset();
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnResourceDoesNotExist();
+ for (const auto& a : cds_state.subscribed_resources) {
+ const TString& authority = a.first;
+ for (const auto& p : a.second) {
+ const TString& cluster_name = p.first;
+ if (cds_update_map.find({authority, cluster_name}) ==
+ cds_update_map.end()) {
+ ClusterState& cluster_state = xds_client()
+ ->authority_state_map_[authority]
+ .cluster_map[cluster_name];
+ // If the resource was newly requested but has not yet been received,
+ // we don't want to generate an error for the watchers, because this CDS
+ // response may be in reaction to an earlier request that did not yet
+ // request the new resource, so its absence from the response does not
+ // necessarily indicate that the resource does not exist.
+ // For that case, we rely on the request timeout instead.
+ if (!cluster_state.update.has_value()) continue;
+ cluster_state.update.reset();
+ Notifier::ScheduleNotifyWatchersOnResourceDoesNotExistInWorkSerializer(
+ xds_client(), cluster_state.watchers, DEBUG_LOCATION);
}
}
}
}
-void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
+void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdateLocked(
TString version, grpc_millis update_time,
XdsApi::EdsUpdateMap eds_update_map) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
@@ -1112,16 +1244,25 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
}
auto& eds_state = state_map_[XdsApi::kEdsTypeUrl];
for (auto& p : eds_update_map) {
- const char* eds_service_name = p.first.c_str();
+ const XdsApi::ResourceName& name = p.first;
XdsApi::EdsUpdate& eds_update = p.second.resource;
- auto& state = eds_state.subscribed_resources[eds_service_name];
- if (state != nullptr) state->Finish();
+ auto it = eds_state.subscribed_resources.find(name.authority);
+ if (it != eds_state.subscribed_resources.end()) {
+ auto res_it = it->second.find(name.id);
+ if (res_it != it->second.end()) {
+ res_it->second->MaybeCancelTimer();
+ }
+ }
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] EDS resource %s: %s", xds_client(),
- eds_service_name, eds_update.ToString().c_str());
+ XdsApi::ConstructFullResourceName(name.authority,
+ XdsApi::kCdsTypeUrl, name.id)
+ .c_str(),
+ eds_update.ToString().c_str());
}
- EndpointState& endpoint_state =
- xds_client()->endpoint_map_[eds_service_name];
+ EndpointState& endpoint_state = xds_client()
+ ->authority_state_map_[name.authority]
+ .endpoint_map[name.id];
// Ignore identical update.
if (endpoint_state.update.has_value() &&
*endpoint_state.update == eds_update) {
@@ -1137,14 +1278,84 @@ void XdsClient::ChannelState::AdsCallState::AcceptEdsUpdate(
endpoint_state.meta = CreateResourceMetadataAcked(
std::move(p.second.serialized_proto), version, update_time);
// Notify all watchers.
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnEndpointChanged(endpoint_state.update.value());
+ auto& watchers_list = endpoint_state.watchers;
+ auto& value = endpoint_state.update.value();
+ xds_client()->work_serializer_.Schedule(
+ [watchers_list, value]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&xds_client()->work_serializer_) {
+ for (const auto& p : watchers_list) {
+ p.first->OnEndpointChanged(value);
+ }
+ },
+ DEBUG_LOCATION);
+ }
+}
+
+namespace {
+
+// Update resource_metadata for NACK.
+void UpdateResourceMetadataNacked(const TString& version,
+ const TString& details,
+ grpc_millis update_time,
+ XdsApi::ResourceMetadata* resource_metadata) {
+ resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
+ resource_metadata->failed_version = version;
+ resource_metadata->failed_details = details;
+ resource_metadata->failed_update_time = update_time;
+}
+
+} // namespace
+
+template <typename StateMap>
+void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateHelperLocked(
+ const TString& resource_name, grpc_millis update_time,
+ const XdsApi::AdsParseResult& result, const TString& error_details,
+ StateMap* state_map) {
+ auto it = state_map->find(resource_name);
+ if (it == state_map->end()) return;
+ auto& state = it->second;
+ Notifier::ScheduleNotifyWatchersOnErrorInWorkSerializer(
+ xds_client(), state.watchers, GRPC_ERROR_REF(result.parse_error),
+ DEBUG_LOCATION);
+ UpdateResourceMetadataNacked(result.version, error_details, update_time,
+ &state.meta);
+}
+
+void XdsClient::ChannelState::AdsCallState::RejectAdsUpdateLocked(
+ grpc_millis update_time, const XdsApi::AdsParseResult& result) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] %s update NACKed containing %" PRIuPTR
+ " invalid resources",
+ xds_client(), result.type_url.c_str(),
+ result.resource_names_failed.size());
+ }
+ TString details = grpc_error_std_string(result.parse_error);
+ for (auto& resource : result.resource_names_failed) {
+ auto authority_it =
+ xds_client()->authority_state_map_.find(resource.authority);
+ if (authority_it == xds_client()->authority_state_map_.end()) continue;
+ AuthorityState& authority_state = authority_it->second;
+ if (result.type_url == XdsApi::kLdsTypeUrl) {
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
+ &authority_state.listener_map);
+ } else if (result.type_url == XdsApi::kRdsTypeUrl) {
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
+ &authority_state.route_config_map);
+ } else if (result.type_url == XdsApi::kCdsTypeUrl) {
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
+ &authority_state.cluster_map);
+ } else if (result.type_url == XdsApi::kEdsTypeUrl) {
+ RejectAdsUpdateHelperLocked(resource.id, update_time, result, details,
+ &authority_state.endpoint_map);
+ } else {
+ GPR_ASSERT(0);
}
}
}
-void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
- grpc_error* error) {
+void XdsClient::ChannelState::AdsCallState::OnRequestSent(
+ void* arg, grpc_error_handle error) {
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
{
MutexLock lock(&ads_calld->xds_client()->mu_);
@@ -1154,7 +1365,7 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSent(void* arg,
}
void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
if (IsCurrentCallOnChannel() && error == GRPC_ERROR_NONE) {
// Clean up the sent message.
grpc_byte_buffer_destroy(send_message_payload_);
@@ -1178,13 +1389,14 @@ void XdsClient::ChannelState::AdsCallState::OnRequestSentLocked(
}
void XdsClient::ChannelState::AdsCallState::OnResponseReceived(
- void* arg, grpc_error* /* error */) {
+ void* arg, grpc_error_handle /* error */) {
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
bool done;
{
MutexLock lock(&ads_calld->xds_client()->mu_);
done = ads_calld->OnResponseReceivedLocked();
}
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
if (done) ads_calld->Unref(DEBUG_LOCATION, "ADS+OnResponseReceivedLocked");
}
@@ -1212,46 +1424,52 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
// Ignore unparsable response.
gpr_log(GPR_ERROR,
"[xds_client %p] Error parsing ADS response (%s) -- ignoring",
- xds_client(), grpc_error_string(result.parse_error));
+ xds_client(), grpc_error_std_string(result.parse_error).c_str());
GRPC_ERROR_UNREF(result.parse_error);
} else {
- grpc_millis update_time = grpc_core::ExecCtx::Get()->Now();
+ grpc_millis update_time = ExecCtx::Get()->Now();
// Update nonce.
auto& state = state_map_[result.type_url];
state.nonce = std::move(result.nonce);
- // NACK or ACK the response.
+ // If we got an error, we'll NACK the update.
if (result.parse_error != GRPC_ERROR_NONE) {
- xds_client()->UpdateResourceMetadataWithFailedParseResult(update_time,
- result);
- GRPC_ERROR_UNREF(state.error);
- state.error = result.parse_error;
- // NACK unacceptable update.
gpr_log(GPR_ERROR,
"[xds_client %p] ADS response invalid for resource type %s "
"version %s, will NACK: nonce=%s error=%s",
xds_client(), result.type_url.c_str(), result.version.c_str(),
- state.nonce.c_str(), grpc_error_string(result.parse_error));
- SendMessageLocked(result.type_url);
- } else {
+ state.nonce.c_str(),
+ grpc_error_std_string(result.parse_error).c_str());
+ result.parse_error =
+ grpc_error_set_int(result.parse_error, GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_UNAVAILABLE);
+ GRPC_ERROR_UNREF(state.error);
+ state.error = result.parse_error;
+ RejectAdsUpdateLocked(update_time, result);
+ }
+ // Process any valid resources.
+ bool have_valid_resources = false;
+ if (result.type_url == XdsApi::kLdsTypeUrl) {
+ have_valid_resources = !result.lds_update_map.empty();
+ AcceptLdsUpdateLocked(result.version, update_time,
+ std::move(result.lds_update_map),
+ result.resource_names_failed);
+ } else if (result.type_url == XdsApi::kRdsTypeUrl) {
+ have_valid_resources = !result.rds_update_map.empty();
+ AcceptRdsUpdateLocked(result.version, update_time,
+ std::move(result.rds_update_map));
+ } else if (result.type_url == XdsApi::kCdsTypeUrl) {
+ have_valid_resources = !result.cds_update_map.empty();
+ AcceptCdsUpdateLocked(result.version, update_time,
+ std::move(result.cds_update_map),
+ result.resource_names_failed);
+ } else if (result.type_url == XdsApi::kEdsTypeUrl) {
+ have_valid_resources = !result.eds_update_map.empty();
+ AcceptEdsUpdateLocked(result.version, update_time,
+ std::move(result.eds_update_map));
+ }
+ if (have_valid_resources) {
seen_response_ = true;
- // Accept the ADS response according to the type_url.
- if (result.type_url == XdsApi::kLdsTypeUrl) {
- AcceptLdsUpdate(result.version, update_time,
- std::move(result.lds_update_map));
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
- AcceptRdsUpdate(result.version, update_time,
- std::move(result.rds_update_map));
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
- AcceptCdsUpdate(result.version, update_time,
- std::move(result.cds_update_map));
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
- AcceptEdsUpdate(result.version, update_time,
- std::move(result.eds_update_map));
- }
- xds_client()->resource_version_map_[result.type_url] =
- std::move(result.version);
- // ACK the update.
- SendMessageLocked(result.type_url);
+ chand()->resource_type_version_map_[result.type_url] = result.version;
// Start load reporting if needed.
auto& lrs_call = chand()->lrs_calld_;
if (lrs_call != nullptr) {
@@ -1259,6 +1477,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
if (lrs_calld != nullptr) lrs_calld->MaybeStartReportingLocked();
}
}
+ // Send ACK or NACK.
+ SendMessageLocked(result.type_url);
}
if (xds_client()->shutting_down_) return true;
// Keep listening for updates.
@@ -1277,24 +1497,25 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
}
void XdsClient::ChannelState::AdsCallState::OnStatusReceived(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
AdsCallState* ads_calld = static_cast<AdsCallState*>(arg);
{
MutexLock lock(&ads_calld->xds_client()->mu_);
ads_calld->OnStatusReceivedLocked(GRPC_ERROR_REF(error));
}
+ ads_calld->xds_client()->work_serializer_.DrainQueue();
ads_calld->Unref(DEBUG_LOCATION, "ADS+OnStatusReceivedLocked");
}
void XdsClient::ChannelState::AdsCallState::OnStatusReceivedLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
char* status_details = grpc_slice_to_c_string(status_details_);
gpr_log(GPR_INFO,
"[xds_client %p] ADS call status received. Status = %d, details "
"= '%s', (chand: %p, ads_calld: %p, call: %p), error '%s'",
xds_client(), status_code_, status_details, chand(), this, call_,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
gpr_free(status_details);
}
// Ignore status from a stale call.
@@ -1315,19 +1536,23 @@ bool XdsClient::ChannelState::AdsCallState::IsCurrentCallOnChannel() const {
return this == chand()->ads_calld_->calld();
}
-std::set<y_absl::string_view>
+std::map<y_absl::string_view /*authority*/, std::set<y_absl::string_view /*name*/>>
XdsClient::ChannelState::AdsCallState::ResourceNamesForRequest(
const TString& type_url) {
- std::set<y_absl::string_view> resource_names;
+ std::map<y_absl::string_view /*authority*/,
+ std::set<y_absl::string_view /*name*/>>
+ resource_map;
auto it = state_map_.find(type_url);
if (it != state_map_.end()) {
- for (auto& p : it->second.subscribed_resources) {
- resource_names.insert(p.first);
- OrphanablePtr<ResourceState>& state = p.second;
- state->Start(Ref(DEBUG_LOCATION, "ResourceState"));
+ for (auto& a : it->second.subscribed_resources) {
+ for (auto& p : a.second) {
+ resource_map[a.first].insert(p.first);
+ OrphanablePtr<ResourceState>& state = p.second;
+ state->MaybeStartTimer(Ref(DEBUG_LOCATION, "ResourceState"));
+ }
}
}
- return resource_names;
+ return resource_map;
}
//
@@ -1349,7 +1574,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::
}
void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
Reporter* self = static_cast<Reporter*>(arg);
bool done;
{
@@ -1360,7 +1585,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimer(
}
bool XdsClient::ChannelState::LrsCallState::Reporter::OnNextReportTimerLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
next_report_timer_callback_pending_ = false;
if (error != GRPC_ERROR_NONE || !IsCurrentReporterOnCall()) {
GRPC_ERROR_UNREF(error);
@@ -1425,7 +1650,7 @@ bool XdsClient::ChannelState::LrsCallState::Reporter::SendReportLocked() {
}
void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
Reporter* self = static_cast<Reporter*>(arg);
bool done;
{
@@ -1436,7 +1661,7 @@ void XdsClient::ChannelState::LrsCallState::Reporter::OnReportDone(
}
bool XdsClient::ChannelState::LrsCallState::Reporter::OnReportDoneLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_byte_buffer_destroy(parent_->send_message_payload_);
parent_->send_message_payload_ = nullptr;
// If there are no more registered stats to report, cancel the call.
@@ -1606,7 +1831,7 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
}
void XdsClient::ChannelState::LrsCallState::OnInitialRequestSent(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
{
MutexLock lock(&lrs_calld->xds_client()->mu_);
@@ -1623,7 +1848,7 @@ void XdsClient::ChannelState::LrsCallState::OnInitialRequestSentLocked() {
}
void XdsClient::ChannelState::LrsCallState::OnResponseReceived(
- void* arg, grpc_error* /*error*/) {
+ void* arg, grpc_error_handle /*error*/) {
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
bool done;
{
@@ -1651,13 +1876,13 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
bool send_all_clusters = false;
std::set<TString> new_cluster_names;
grpc_millis new_load_reporting_interval;
- grpc_error* parse_error = xds_client()->api_.ParseLrsResponse(
+ grpc_error_handle parse_error = xds_client()->api_.ParseLrsResponse(
response_slice, &send_all_clusters, &new_cluster_names,
&new_load_reporting_interval);
if (parse_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"[xds_client %p] LRS response parsing failed. error=%s",
- xds_client(), grpc_error_string(parse_error));
+ xds_client(), grpc_error_std_string(parse_error).c_str());
GRPC_ERROR_UNREF(parse_error);
return;
}
@@ -1726,7 +1951,7 @@ bool XdsClient::ChannelState::LrsCallState::OnResponseReceivedLocked() {
}
void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
LrsCallState* lrs_calld = static_cast<LrsCallState*>(arg);
{
MutexLock lock(&lrs_calld->xds_client()->mu_);
@@ -1736,7 +1961,7 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceived(
}
void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
- grpc_error* error) {
+ grpc_error_handle error) {
GPR_ASSERT(call_ != nullptr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
char* status_details = grpc_slice_to_c_string(status_details_);
@@ -1744,7 +1969,7 @@ void XdsClient::ChannelState::LrsCallState::OnStatusReceivedLocked(
"[xds_client %p] LRS call status received. Status = %d, details "
"= '%s', (chand: %p, calld: %p, call: %p), error '%s'",
xds_client(), status_code_, status_details, chand(), this, call_,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
gpr_free(status_details);
}
// Ignore status from a stale call.
@@ -1769,64 +1994,54 @@ bool XdsClient::ChannelState::LrsCallState::IsCurrentCallOnChannel() const {
namespace {
-grpc_millis GetRequestTimeout() {
+grpc_millis GetRequestTimeout(const grpc_channel_args* args) {
return grpc_channel_args_find_integer(
- g_channel_args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
+ args, GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS,
{15000, 0, INT_MAX});
}
+grpc_channel_args* ModifyChannelArgs(const grpc_channel_args* args) {
+ y_absl::InlinedVector<grpc_arg, 1> args_to_add = {
+ grpc_channel_arg_integer_create(
+ const_cast<char*>(GRPC_ARG_KEEPALIVE_TIME_MS),
+ 5 * 60 * GPR_MS_PER_SEC),
+ };
+ return grpc_channel_args_copy_and_add(args, args_to_add.data(),
+ args_to_add.size());
+}
+
} // namespace
-XdsClient::XdsClient(grpc_error** error)
+XdsClient::XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
+ const grpc_channel_args* args)
: DualRefCounted<XdsClient>(
GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_refcount_trace) ? "XdsClient"
: nullptr),
- request_timeout_(GetRequestTimeout()),
+ bootstrap_(std::move(bootstrap)),
+ args_(ModifyChannelArgs(args)),
+ request_timeout_(GetRequestTimeout(args)),
interested_parties_(grpc_pollset_set_create()),
- bootstrap_(XdsBootstrap::Create(this, &grpc_xds_client_trace,
- g_fallback_bootstrap_config, error)),
certificate_provider_store_(MakeOrphanable<CertificateProviderStore>(
- bootstrap_ == nullptr
- ? CertificateProviderStore::PluginDefinitionMap()
- : bootstrap_->certificate_providers())),
- api_(this, &grpc_xds_client_trace,
- bootstrap_ == nullptr ? nullptr : bootstrap_->node()) {
+ bootstrap_->certificate_providers())),
+ api_(this, &grpc_xds_client_trace, bootstrap_->node(),
+ &bootstrap_->certificate_providers()) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] creating xds client", this);
}
- if (*error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "[xds_client %p] failed to read bootstrap file: %s",
- this, grpc_error_string(*error));
- return;
- }
- // Create ChannelState object.
- chand_ = MakeOrphanable<ChannelState>(
- WeakRef(DEBUG_LOCATION, "XdsClient+ChannelState"), bootstrap_->server());
+ // Calling grpc_init to ensure gRPC does not shut down until the XdsClient is
+ // destroyed.
+ grpc_init();
}
XdsClient::~XdsClient() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
gpr_log(GPR_INFO, "[xds_client %p] destroying xds client", this);
}
+ grpc_channel_args_destroy(args_);
grpc_pollset_set_destroy(interested_parties_);
-}
-
-void XdsClient::AddChannelzLinkage(
- channelz::ChannelNode* parent_channelz_node) {
- channelz::ChannelNode* xds_channelz_node =
- grpc_channel_get_channelz_node(chand_->channel());
- if (xds_channelz_node != nullptr) {
- parent_channelz_node->AddChildChannel(xds_channelz_node->uuid());
- }
-}
-
-void XdsClient::RemoveChannelzLinkage(
- channelz::ChannelNode* parent_channelz_node) {
- channelz::ChannelNode* xds_channelz_node =
- grpc_channel_get_channelz_node(chand_->channel());
- if (xds_channelz_node != nullptr) {
- parent_channelz_node->RemoveChildChannel(xds_channelz_node->uuid());
- }
+ // Calling grpc_shutdown to ensure gRPC does not shut down until the XdsClient
+ // is destroyed.
+ grpc_shutdown();
}
void XdsClient::Orphan() {
@@ -1840,39 +2055,94 @@ void XdsClient::Orphan() {
{
MutexLock lock(&mu_);
shutting_down_ = true;
- // Orphan ChannelState object.
- chand_.reset();
// We do not clear cluster_map_ and endpoint_map_ if the xds client was
// created by the XdsResolver because the maps contain refs for watchers
// which in turn hold refs to the loadbalancing policies. At this point, it
// is possible for ADS calls to be in progress. Unreffing the loadbalancing
// policies before those calls are done would lead to issues such as
// https://github.com/grpc/grpc/issues/20928.
- if (!listener_map_.empty()) {
- cluster_map_.clear();
- endpoint_map_.clear();
+ for (auto& a : authority_state_map_) {
+ a.second.channel_state.reset();
+ if (!a.second.listener_map.empty()) {
+ a.second.cluster_map.clear();
+ a.second.endpoint_map.clear();
+ }
}
+ // We clear these invalid resource watchers as cancel never came.
+ invalid_listener_watchers_.clear();
+ invalid_route_config_watchers_.clear();
+ invalid_cluster_watchers_.clear();
+ invalid_endpoint_watchers_.clear();
}
}
+RefCountedPtr<XdsClient::ChannelState> XdsClient::GetOrCreateChannelStateLocked(
+ const XdsBootstrap::XdsServer& server) {
+ auto it = xds_server_channel_map_.find(server);
+ if (it != xds_server_channel_map_.end()) {
+ return it->second->Ref(DEBUG_LOCATION, "Authority");
+ }
+ // Channel not found, so create a new one.
+ auto channel_state = MakeRefCounted<ChannelState>(
+ WeakRef(DEBUG_LOCATION, "ChannelState"), server);
+ xds_server_channel_map_[server] = channel_state.get();
+ return channel_state;
+}
+
void XdsClient::WatchListenerData(
y_absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher) {
+ RefCountedPtr<ListenerWatcherInterface> watcher) {
TString listener_name_str = TString(listener_name);
- MutexLock lock(&mu_);
- ListenerState& listener_state = listener_map_[listener_name_str];
ListenerWatcherInterface* w = watcher.get();
- listener_state.watchers[w] = std::move(watcher);
- // If we've already received an LDS update, notify the new watcher
- // immediately.
- if (listener_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached listener data for %s",
- this, listener_name_str.c_str());
+ auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
+ if (!resource.ok()) {
+ {
+ MutexLock lock(&mu_);
+ invalid_listener_watchers_[w] = watcher;
}
- w->OnListenerChanged(*listener_state.update);
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Unable to parse resource name for listener %s", listener_name));
+ work_serializer_.Run(
+ // TODO(yashykt): When we move to C++14, capture watcher using
+ // std::move()
+ [watcher, error]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ watcher->OnError(error);
+ },
+ DEBUG_LOCATION);
+ return;
}
- chand_->Subscribe(XdsApi::kLdsTypeUrl, listener_name_str);
+ {
+ MutexLock lock(&mu_);
+ AuthorityState& authority_state = authority_state_map_[resource->authority];
+ ListenerState& listener_state = authority_state.listener_map[resource->id];
+ listener_state.watchers[w] = watcher;
+ // If we've already received an LDS update, notify the new watcher
+ // immediately.
+ if (listener_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached listener data for %s", this,
+ listener_name_str.c_str());
+ }
+ auto& value = listener_state.update.value();
+ work_serializer_.Schedule(
+ // TODO(yashykt): When we move to C++14, capture watcher using
+ // std::move()
+ [watcher, value]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ watcher->OnListenerChanged(value);
+ },
+ DEBUG_LOCATION);
+ }
+ // If the authority doesn't yet have a channel, set it, creating it if
+ // needed.
+ if (authority_state.channel_state == nullptr) {
+ authority_state.channel_state =
+ GetOrCreateChannelStateLocked(bootstrap_->server());
+ }
+ authority_state.channel_state->SubscribeLocked(XdsApi::kLdsTypeUrl,
+ *resource);
+ }
+ work_serializer_.DrainQueue();
}
void XdsClient::CancelListenerDataWatch(y_absl::string_view listener_name,
@@ -1880,39 +2150,79 @@ void XdsClient::CancelListenerDataWatch(y_absl::string_view listener_name,
bool delay_unsubscription) {
MutexLock lock(&mu_);
if (shutting_down_) return;
- TString listener_name_str = TString(listener_name);
- ListenerState& listener_state = listener_map_[listener_name_str];
+ auto resource = XdsApi::ParseResourceName(listener_name, XdsApi::IsLds);
+ if (!resource.ok()) return;
+ auto& authority_state = authority_state_map_[resource->authority];
+ ListenerState& listener_state = authority_state.listener_map[resource->id];
auto it = listener_state.watchers.find(watcher);
- if (it != listener_state.watchers.end()) {
- listener_state.watchers.erase(it);
- if (listener_state.watchers.empty()) {
- listener_map_.erase(listener_name_str);
- chand_->Unsubscribe(XdsApi::kLdsTypeUrl, listener_name_str,
- delay_unsubscription);
- }
+ if (it == listener_state.watchers.end()) {
+ invalid_listener_watchers_.erase(watcher);
+ return;
+ }
+ listener_state.watchers.erase(it);
+ if (!listener_state.watchers.empty()) return;
+ authority_state.listener_map.erase(resource->id);
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
+ XdsApi::kLdsTypeUrl, *resource, delay_unsubscription);
+ if (!authority_state.HasSubscribedResources()) {
+ authority_state.channel_state.reset();
}
}
void XdsClient::WatchRouteConfigData(
y_absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher) {
+ RefCountedPtr<RouteConfigWatcherInterface> watcher) {
TString route_config_name_str = TString(route_config_name);
- MutexLock lock(&mu_);
- RouteConfigState& route_config_state =
- route_config_map_[route_config_name_str];
RouteConfigWatcherInterface* w = watcher.get();
- route_config_state.watchers[w] = std::move(watcher);
- // If we've already received an RDS update, notify the new watcher
- // immediately.
- if (route_config_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO,
- "[xds_client %p] returning cached route config data for %s", this,
- route_config_name_str.c_str());
+ auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
+ if (!resource.ok()) {
+ {
+ MutexLock lock(&mu_);
+ invalid_route_config_watchers_[w] = watcher;
}
- w->OnRouteConfigChanged(*route_config_state.update);
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Unable to parse resource name for route config %s",
+ route_config_name));
+ work_serializer_.Run(
+ // TODO(yashykt): When we move to C++14, capture watcher using
+ // std::move()
+ [watcher, error]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) {
+ watcher->OnError(error);
+ },
+ DEBUG_LOCATION);
+ return;
}
- chand_->Subscribe(XdsApi::kRdsTypeUrl, route_config_name_str);
+ {
+ MutexLock lock(&mu_);
+ auto& authority_state = authority_state_map_[resource->authority];
+ RouteConfigState& route_config_state =
+ authority_state.route_config_map[resource->id];
+ route_config_state.watchers[w] = watcher;
+ // If we've already received an RDS update, notify the new watcher
+ // immediately.
+ if (route_config_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached route config data for %s",
+ this, route_config_name_str.c_str());
+ }
+ auto& value = route_config_state.update.value();
+ work_serializer_.Schedule(
+ [watcher, value]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ watcher->OnRouteConfigChanged(value);
+ },
+ DEBUG_LOCATION);
+ }
+ // If the authority doesn't yet have a channel, set it, creating it if
+ // needed.
+ if (authority_state.channel_state == nullptr) {
+ authority_state.channel_state =
+ GetOrCreateChannelStateLocked(bootstrap_->server());
+ }
+ authority_state.channel_state->SubscribeLocked(XdsApi::kRdsTypeUrl,
+ *resource);
+ }
+ work_serializer_.DrainQueue();
}
void XdsClient::CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
@@ -1920,38 +2230,76 @@ void XdsClient::CancelRouteConfigDataWatch(y_absl::string_view route_config_name
bool delay_unsubscription) {
MutexLock lock(&mu_);
if (shutting_down_) return;
- TString route_config_name_str = TString(route_config_name);
+ auto resource = XdsApi::ParseResourceName(route_config_name, XdsApi::IsRds);
+ if (!resource.ok()) return;
+ auto& authority_state = authority_state_map_[resource->authority];
RouteConfigState& route_config_state =
- route_config_map_[route_config_name_str];
+ authority_state.route_config_map[resource->id];
auto it = route_config_state.watchers.find(watcher);
- if (it != route_config_state.watchers.end()) {
- route_config_state.watchers.erase(it);
- if (route_config_state.watchers.empty()) {
- route_config_map_.erase(route_config_name_str);
- chand_->Unsubscribe(XdsApi::kRdsTypeUrl, route_config_name_str,
- delay_unsubscription);
- }
+ if (it == route_config_state.watchers.end()) {
+ invalid_route_config_watchers_.erase(watcher);
+ return;
+ }
+ route_config_state.watchers.erase(it);
+ if (!route_config_state.watchers.empty()) return;
+ authority_state.route_config_map.erase(resource->id);
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
+ XdsApi::kRdsTypeUrl, *resource, delay_unsubscription);
+ if (!authority_state.HasSubscribedResources()) {
+ authority_state.channel_state.reset();
}
}
void XdsClient::WatchClusterData(
y_absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher) {
+ RefCountedPtr<ClusterWatcherInterface> watcher) {
TString cluster_name_str = TString(cluster_name);
- MutexLock lock(&mu_);
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
ClusterWatcherInterface* w = watcher.get();
- cluster_state.watchers[w] = std::move(watcher);
- // If we've already received a CDS update, notify the new watcher
- // immediately.
- if (cluster_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached cluster data for %s",
- this, cluster_name_str.c_str());
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
+ if (!resource.ok()) {
+ {
+ MutexLock lock(&mu_);
+ invalid_cluster_watchers_[w] = watcher;
}
- w->OnClusterChanged(cluster_state.update.value());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Unable to parse resource name for cluster %s", cluster_name));
+ work_serializer_.Run([watcher, error]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(
+ work_serializer_) { watcher->OnError(error); },
+ DEBUG_LOCATION);
+ return;
}
- chand_->Subscribe(XdsApi::kCdsTypeUrl, cluster_name_str);
+ {
+ MutexLock lock(&mu_);
+ auto& authority_state = authority_state_map_[resource->authority];
+ ClusterState& cluster_state = authority_state.cluster_map[resource->id];
+ cluster_state.watchers[w] = watcher;
+ // If we've already received a CDS update, notify the new watcher
+ // immediately.
+ if (cluster_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached cluster data for %s", this,
+ cluster_name_str.c_str());
+ }
+ auto& value = cluster_state.update.value();
+ work_serializer_.Schedule(
+ // TODO(yashykt): When we move to C++14, capture watcher using
+ // std::move()
+ [watcher, value]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ watcher->OnClusterChanged(value);
+ },
+ DEBUG_LOCATION);
+ }
+ // If the authority doesn't yet have a channel, set it, creating it if
+ // needed.
+ if (authority_state.channel_state == nullptr) {
+ authority_state.channel_state =
+ GetOrCreateChannelStateLocked(bootstrap_->server());
+ }
+ authority_state.channel_state->SubscribeLocked(XdsApi::kCdsTypeUrl,
+ *resource);
+ }
+ work_serializer_.DrainQueue();
}
void XdsClient::CancelClusterDataWatch(y_absl::string_view cluster_name,
@@ -1959,37 +2307,74 @@ void XdsClient::CancelClusterDataWatch(y_absl::string_view cluster_name,
bool delay_unsubscription) {
MutexLock lock(&mu_);
if (shutting_down_) return;
- TString cluster_name_str = TString(cluster_name);
- ClusterState& cluster_state = cluster_map_[cluster_name_str];
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
+ if (!resource.ok()) return;
+ auto& authority_state = authority_state_map_[resource->authority];
+ ClusterState& cluster_state = authority_state.cluster_map[resource->id];
auto it = cluster_state.watchers.find(watcher);
- if (it != cluster_state.watchers.end()) {
- cluster_state.watchers.erase(it);
- if (cluster_state.watchers.empty()) {
- cluster_map_.erase(cluster_name_str);
- chand_->Unsubscribe(XdsApi::kCdsTypeUrl, cluster_name_str,
- delay_unsubscription);
- }
+ if (it == cluster_state.watchers.end()) {
+ invalid_cluster_watchers_.erase(watcher);
+ return;
+ }
+ cluster_state.watchers.erase(it);
+ if (!cluster_state.watchers.empty()) return;
+ authority_state.cluster_map.erase(resource->id);
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
+ XdsApi::kCdsTypeUrl, *resource, delay_unsubscription);
+ if (!authority_state.HasSubscribedResources()) {
+ authority_state.channel_state.reset();
}
}
void XdsClient::WatchEndpointData(
y_absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher) {
+ RefCountedPtr<EndpointWatcherInterface> watcher) {
TString eds_service_name_str = TString(eds_service_name);
- MutexLock lock(&mu_);
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
EndpointWatcherInterface* w = watcher.get();
- endpoint_state.watchers[w] = std::move(watcher);
- // If we've already received an EDS update, notify the new watcher
- // immediately.
- if (endpoint_state.update.has_value()) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
- gpr_log(GPR_INFO, "[xds_client %p] returning cached endpoint data for %s",
- this, eds_service_name_str.c_str());
+ auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
+ if (!resource.ok()) {
+ {
+ MutexLock lock(&mu_);
+ invalid_endpoint_watchers_[w] = watcher;
}
- w->OnEndpointChanged(endpoint_state.update.value());
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Unable to parse resource name for endpoint service %s",
+ eds_service_name));
+ work_serializer_.Run([watcher, error]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(
+ work_serializer_) { watcher->OnError(error); },
+ DEBUG_LOCATION);
+ return;
}
- chand_->Subscribe(XdsApi::kEdsTypeUrl, eds_service_name_str);
+ {
+ MutexLock lock(&mu_);
+ auto& authority_state = authority_state_map_[resource->authority];
+ EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
+ endpoint_state.watchers[w] = watcher;
+ // If we've already received an EDS update, notify the new watcher
+ // immediately.
+ if (endpoint_state.update.has_value()) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "[xds_client %p] returning cached endpoint data for %s", this,
+ eds_service_name_str.c_str());
+ }
+ auto& value = endpoint_state.update.value();
+ work_serializer_.Schedule(
+ [watcher, value]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ watcher->OnEndpointChanged(value);
+ },
+ DEBUG_LOCATION);
+ }
+ // If the authority doesn't yet have a channel, set it, creating it if
+ // needed.
+ if (authority_state.channel_state == nullptr) {
+ authority_state.channel_state =
+ GetOrCreateChannelStateLocked(bootstrap_->server());
+ }
+ authority_state.channel_state->SubscribeLocked(XdsApi::kEdsTypeUrl,
+ *resource);
+ }
+ work_serializer_.DrainQueue();
}
void XdsClient::CancelEndpointDataWatch(y_absl::string_view eds_service_name,
@@ -1997,16 +2382,22 @@ void XdsClient::CancelEndpointDataWatch(y_absl::string_view eds_service_name,
bool delay_unsubscription) {
MutexLock lock(&mu_);
if (shutting_down_) return;
- TString eds_service_name_str = TString(eds_service_name);
- EndpointState& endpoint_state = endpoint_map_[eds_service_name_str];
+ auto resource = XdsApi::ParseResourceName(eds_service_name, XdsApi::IsEds);
+ if (!resource.ok()) return;
+ auto& authority_state = authority_state_map_[resource->authority];
+ EndpointState& endpoint_state = authority_state.endpoint_map[resource->id];
auto it = endpoint_state.watchers.find(watcher);
- if (it != endpoint_state.watchers.end()) {
- endpoint_state.watchers.erase(it);
- if (endpoint_state.watchers.empty()) {
- endpoint_map_.erase(eds_service_name_str);
- chand_->Unsubscribe(XdsApi::kEdsTypeUrl, eds_service_name_str,
- delay_unsubscription);
- }
+ if (it == endpoint_state.watchers.end()) {
+ invalid_endpoint_watchers_.erase(watcher);
+ return;
+ }
+ endpoint_state.watchers.erase(it);
+ if (!endpoint_state.watchers.empty()) return;
+ authority_state.endpoint_map.erase(resource->id);
+ xds_server_channel_map_[bootstrap_->server()]->UnsubscribeLocked(
+ XdsApi::kEdsTypeUrl, *resource, delay_unsubscription);
+ if (!authority_state.HasSubscribedResources()) {
+ authority_state.channel_state.reset();
}
}
@@ -2040,7 +2431,12 @@ RefCountedPtr<XdsClusterDropStats> XdsClient::AddClusterDropStats(
it->first.second /*eds_service_name*/);
load_report_state.drop_stats = cluster_drop_stats.get();
}
- chand_->MaybeStartLrsCall();
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
+ GPR_ASSERT(resource.ok());
+ auto a = authority_state_map_.find(resource->authority);
+ if (a != authority_state_map_.end()) {
+ a->second.channel_state->MaybeStartLrsCall();
+ }
return cluster_drop_stats;
}
@@ -2097,7 +2493,12 @@ RefCountedPtr<XdsClusterLocalityStats> XdsClient::AddClusterLocalityStats(
std::move(locality));
locality_state.locality_stats = cluster_locality_stats.get();
}
- chand_->MaybeStartLrsCall();
+ auto resource = XdsApi::ParseResourceName(cluster_name, XdsApi::IsCds);
+ GPR_ASSERT(resource.ok());
+ auto a = authority_state_map_.find(resource->authority);
+ if (a != authority_state_map_.end()) {
+ a->second.channel_state->MaybeStartLrsCall();
+ }
return cluster_locality_stats;
}
@@ -2127,37 +2528,63 @@ void XdsClient::RemoveClusterLocalityStats(
void XdsClient::ResetBackoff() {
MutexLock lock(&mu_);
- if (chand_ != nullptr) {
- grpc_channel_reset_connect_backoff(chand_->channel());
+ for (auto& p : xds_server_channel_map_) {
+ grpc_channel_reset_connect_backoff(p.second->channel());
}
}
-void XdsClient::NotifyOnErrorLocked(grpc_error* error) {
- for (const auto& p : listener_map_) {
- const ListenerState& listener_state = p.second;
- for (const auto& p : listener_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
+void XdsClient::NotifyOnErrorLocked(grpc_error_handle error) {
+ std::set<RefCountedPtr<ListenerWatcherInterface>> listener_watchers;
+ std::set<RefCountedPtr<RouteConfigWatcherInterface>> route_config_watchers;
+ std::set<RefCountedPtr<ClusterWatcherInterface>> cluster_watchers;
+ std::set<RefCountedPtr<EndpointWatcherInterface>> endpoint_watchers;
+ for (const auto& a : authority_state_map_) {
+ for (const auto& p : a.second.listener_map) {
+ const ListenerState& listener_state = p.second;
+ for (const auto& q : listener_state.watchers) {
+ listener_watchers.insert(q.second);
+ }
}
- }
- for (const auto& p : route_config_map_) {
- const RouteConfigState& route_config_state = p.second;
- for (const auto& p : route_config_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
+ for (const auto& p : a.second.route_config_map) {
+ const RouteConfigState& route_config_state = p.second;
+ for (const auto& q : route_config_state.watchers) {
+ route_config_watchers.insert(q.second);
+ }
}
- }
- for (const auto& p : cluster_map_) {
- const ClusterState& cluster_state = p.second;
- for (const auto& p : cluster_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
+ for (const auto& p : a.second.cluster_map) {
+ const ClusterState& cluster_state = p.second;
+ for (const auto& q : cluster_state.watchers) {
+ cluster_watchers.insert(q.second);
+ }
}
- }
- for (const auto& p : endpoint_map_) {
- const EndpointState& endpoint_state = p.second;
- for (const auto& p : endpoint_state.watchers) {
- p.first->OnError(GRPC_ERROR_REF(error));
+ for (const auto& p : a.second.endpoint_map) {
+ const EndpointState& endpoint_state = p.second;
+ for (const auto& q : endpoint_state.watchers) {
+ endpoint_watchers.insert(q.second);
+ }
}
}
- GRPC_ERROR_UNREF(error);
+ work_serializer_.Schedule(
+ // TODO(yashykt): When we move to C++14, capture *_watchers using
+ // std::move()
+ [listener_watchers, route_config_watchers, cluster_watchers,
+ endpoint_watchers, error]()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer_) {
+ for (const auto& watcher : listener_watchers) {
+ watcher->OnError(GRPC_ERROR_REF(error));
+ }
+ for (const auto& watcher : route_config_watchers) {
+ watcher->OnError(GRPC_ERROR_REF(error));
+ }
+ for (const auto& watcher : cluster_watchers) {
+ watcher->OnError(GRPC_ERROR_REF(error));
+ }
+ for (const auto& watcher : endpoint_watchers) {
+ watcher->OnError(GRPC_ERROR_REF(error));
+ }
+ GRPC_ERROR_UNREF(error);
+ },
+ DEBUG_LOCATION);
}
XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
@@ -2241,75 +2668,39 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
return snapshot_map;
}
-void XdsClient::UpdateResourceMetadataWithFailedParseResult(
- grpc_millis update_time, const XdsApi::AdsParseResult& result) {
- // ADS update is rejected and the resource names in the failed update is
- // available.
- y_absl::string_view details = grpc_error_string(result.parse_error);
- for (auto& name : result.resource_names_failed) {
- XdsApi::ResourceMetadata* resource_metadata = nullptr;
- if (result.type_url == XdsApi::kLdsTypeUrl) {
- auto it = listener_map_.find(name);
- if (it != listener_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kRdsTypeUrl) {
- auto it = route_config_map_.find(name);
- if (route_config_map_.find(name) != route_config_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kCdsTypeUrl) {
- auto it = cluster_map_.find(name);
- if (cluster_map_.find(name) != cluster_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- } else if (result.type_url == XdsApi::kEdsTypeUrl) {
- auto it = endpoint_map_.find(name);
- if (endpoint_map_.find(name) != endpoint_map_.end()) {
- resource_metadata = &it->second.meta;
- }
- }
- if (resource_metadata == nullptr) {
- return;
- }
- resource_metadata->client_status = XdsApi::ResourceMetadata::NACKED;
- resource_metadata->failed_version = result.version;
- resource_metadata->failed_details = TString(details);
- resource_metadata->failed_update_time = update_time;
- }
-}
-
TString XdsClient::DumpClientConfigBinary() {
MutexLock lock(&mu_);
XdsApi::ResourceTypeMetadataMap resource_type_metadata_map;
- // Update per-xds-type version if available, this version corresponding to the
- // last successful ADS update version.
- for (auto& p : resource_version_map_) {
- resource_type_metadata_map[p.first].version = p.second;
- }
- // Collect resource metadata from listeners
- auto& lds_map =
- resource_type_metadata_map[XdsApi::kLdsTypeUrl].resource_metadata_map;
- for (auto& p : listener_map_) {
- lds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from route configs
- auto& rds_map =
- resource_type_metadata_map[XdsApi::kRdsTypeUrl].resource_metadata_map;
- for (auto& p : route_config_map_) {
- rds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from clusters
- auto& cds_map =
- resource_type_metadata_map[XdsApi::kCdsTypeUrl].resource_metadata_map;
- for (auto& p : cluster_map_) {
- cds_map[p.first] = &p.second.meta;
- }
- // Collect resource metadata from endpoints
- auto& eds_map =
- resource_type_metadata_map[XdsApi::kEdsTypeUrl].resource_metadata_map;
- for (auto& p : endpoint_map_) {
- eds_map[p.first] = &p.second.meta;
+ auto& lds_map = resource_type_metadata_map[XdsApi::kLdsTypeUrl];
+ auto& rds_map = resource_type_metadata_map[XdsApi::kRdsTypeUrl];
+ auto& cds_map = resource_type_metadata_map[XdsApi::kCdsTypeUrl];
+ auto& eds_map = resource_type_metadata_map[XdsApi::kEdsTypeUrl];
+ for (auto& a : authority_state_map_) {
+ const TString& authority = a.first;
+ // Collect resource metadata from listeners
+ for (auto& p : a.second.listener_map) {
+ const TString& listener_name = p.first;
+ lds_map[XdsApi::ConstructFullResourceName(
+ authority, XdsApi::kLdsTypeUrl, listener_name)] = &p.second.meta;
+ }
+ // Collect resource metadata from route configs
+ for (auto& p : a.second.route_config_map) {
+ const TString& route_config_name = p.first;
+ rds_map[XdsApi::ConstructFullResourceName(
+ authority, XdsApi::kRdsTypeUrl, route_config_name)] = &p.second.meta;
+ }
+ // Collect resource metadata from clusters
+ for (auto& p : a.second.cluster_map) {
+ const TString& cluster_name = p.first;
+ cds_map[XdsApi::ConstructFullResourceName(authority, XdsApi::kCdsTypeUrl,
+ cluster_name)] = &p.second.meta;
+ }
+ // Collect resource metadata from endpoints
+ for (auto& p : a.second.endpoint_map) {
+ const TString& endpoint_name = p.first;
+ eds_map[XdsApi::ConstructFullResourceName(
+ authority, XdsApi::kEdsTypeUrl, endpoint_name)] = &p.second.meta;
+ }
}
// Assemble config dump messages
return api_.AssembleClientConfig(resource_type_metadata_map);
@@ -2324,24 +2715,104 @@ void XdsClientGlobalInit() {
XdsHttpFilterRegistry::Init();
}
-void XdsClientGlobalShutdown() {
- delete g_mu;
- g_mu = nullptr;
+// TODO(roth): Find a better way to clear the fallback config that does
+// not require using Y_ABSL_NO_THREAD_SAFETY_ANALYSIS.
+void XdsClientGlobalShutdown() Y_ABSL_NO_THREAD_SAFETY_ANALYSIS {
gpr_free(g_fallback_bootstrap_config);
g_fallback_bootstrap_config = nullptr;
+ delete g_mu;
+ g_mu = nullptr;
XdsHttpFilterRegistry::Shutdown();
}
-RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {
+namespace {
+
+TString GetBootstrapContents(const char* fallback_config,
+ grpc_error_handle* error) {
+ // First, try GRPC_XDS_BOOTSTRAP env var.
+ UniquePtr<char> path(gpr_getenv("GRPC_XDS_BOOTSTRAP"));
+ if (path != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "Got bootstrap file location from GRPC_XDS_BOOTSTRAP "
+ "environment variable: %s",
+ path.get());
+ }
+ grpc_slice contents;
+ *error =
+ grpc_load_file(path.get(), /*add_null_terminator=*/true, &contents);
+ if (*error != GRPC_ERROR_NONE) return "";
+ TString contents_str(StringViewFromSlice(contents));
+ grpc_slice_unref_internal(contents);
+ return contents_str;
+ }
+ // Next, try GRPC_XDS_BOOTSTRAP_CONFIG env var.
+ UniquePtr<char> env_config(gpr_getenv("GRPC_XDS_BOOTSTRAP_CONFIG"));
+ if (env_config != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO,
+ "Got bootstrap contents from GRPC_XDS_BOOTSTRAP_CONFIG "
+ "environment variable");
+ }
+ return env_config.get();
+ }
+ // Finally, try fallback config.
+ if (fallback_config != nullptr) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "Got bootstrap contents from fallback config");
+ }
+ return fallback_config;
+ }
+ // No bootstrap config found.
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Environment variables GRPC_XDS_BOOTSTRAP or GRPC_XDS_BOOTSTRAP_CONFIG "
+ "not defined");
+ return "";
+}
+
+} // namespace
+
+RefCountedPtr<XdsClient> XdsClient::GetOrCreate(const grpc_channel_args* args,
+ grpc_error_handle* error) {
RefCountedPtr<XdsClient> xds_client;
+ // If getting bootstrap from channel args, create a local XdsClient
+ // instance for the channel or server instead of using the global instance.
+ const char* bootstrap_config = grpc_channel_args_find_string(
+ args, GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG);
+ if (bootstrap_config != nullptr) {
+ std::unique_ptr<XdsBootstrap> bootstrap =
+ XdsBootstrap::Create(bootstrap_config, error);
+ if (*error == GRPC_ERROR_NONE) {
+ grpc_channel_args* xds_channel_args =
+ grpc_channel_args_find_pointer<grpc_channel_args>(
+ args,
+ GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_CLIENT_CHANNEL_ARGS);
+ return MakeRefCounted<XdsClient>(std::move(bootstrap), xds_channel_args);
+ }
+ return nullptr;
+ }
+ // Otherwise, use the global instance.
{
MutexLock lock(g_mu);
if (g_xds_client != nullptr) {
auto xds_client = g_xds_client->RefIfNonZero();
if (xds_client != nullptr) return xds_client;
}
- xds_client = MakeRefCounted<XdsClient>(error);
+ // Find bootstrap contents.
+ TString bootstrap_contents =
+ GetBootstrapContents(g_fallback_bootstrap_config, error);
if (*error != GRPC_ERROR_NONE) return nullptr;
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_client_trace)) {
+ gpr_log(GPR_INFO, "xDS bootstrap contents: %s",
+ bootstrap_contents.c_str());
+ }
+ // Parse bootstrap.
+ std::unique_ptr<XdsBootstrap> bootstrap =
+ XdsBootstrap::Create(bootstrap_contents, error);
+ if (*error != GRPC_ERROR_NONE) return nullptr;
+ // Instantiate XdsClient.
+ xds_client =
+ MakeRefCounted<XdsClient>(std::move(bootstrap), g_channel_args);
g_xds_client = xds_client.get();
}
return xds_client;
@@ -2367,14 +2838,54 @@ void SetXdsFallbackBootstrapConfig(const char* config) {
} // namespace internal
+//
+// embedding XdsClient in channel args
+//
+
+#define GRPC_ARG_XDS_CLIENT "grpc.internal.xds_client"
+
+namespace {
+
+void* XdsClientArgCopy(void* p) {
+ XdsClient* xds_client = static_cast<XdsClient*>(p);
+ xds_client->Ref(DEBUG_LOCATION, "channel arg").release();
+ return p;
+}
+
+void XdsClientArgDestroy(void* p) {
+ XdsClient* xds_client = static_cast<XdsClient*>(p);
+ xds_client->Unref(DEBUG_LOCATION, "channel arg");
+}
+
+int XdsClientArgCmp(void* p, void* q) { return QsortCompare(p, q); }
+
+const grpc_arg_pointer_vtable kXdsClientArgVtable = {
+ XdsClientArgCopy, XdsClientArgDestroy, XdsClientArgCmp};
+
+} // namespace
+
+grpc_arg XdsClient::MakeChannelArg() const {
+ return grpc_channel_arg_pointer_create(const_cast<char*>(GRPC_ARG_XDS_CLIENT),
+ const_cast<XdsClient*>(this),
+ &kXdsClientArgVtable);
+}
+
+RefCountedPtr<XdsClient> XdsClient::GetFromChannelArgs(
+ const grpc_channel_args& args) {
+ XdsClient* xds_client =
+ grpc_channel_args_find_pointer<XdsClient>(&args, GRPC_ARG_XDS_CLIENT);
+ if (xds_client == nullptr) return nullptr;
+ return xds_client->Ref(DEBUG_LOCATION, "GetFromChannelArgs");
+}
+
} // namespace grpc_core
// The returned bytes may contain NULL(0), so we can't use c-string.
grpc_slice grpc_dump_xds_configs() {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_error* error = GRPC_ERROR_NONE;
- auto xds_client = grpc_core::XdsClient::GetOrCreate(&error);
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ auto xds_client = grpc_core::XdsClient::GetOrCreate(nullptr, &error);
if (error != GRPC_ERROR_NONE) {
// If we isn't using xDS, just return an empty string.
GRPC_ERROR_UNREF(error);
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client.h b/contrib/libs/grpc/src/core/ext/xds/xds_client.h
index 8705e596950..eb0538f9564 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client.h
@@ -44,48 +44,59 @@ extern TraceFlag grpc_xds_client_refcount_trace;
class XdsClient : public DualRefCounted<XdsClient> {
public:
// Listener data watcher interface. Implemented by callers.
- class ListenerWatcherInterface {
+ class ListenerWatcherInterface : public RefCounted<ListenerWatcherInterface> {
public:
- virtual ~ListenerWatcherInterface() = default;
- virtual void OnListenerChanged(XdsApi::LdsUpdate listener) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
+ virtual void OnListenerChanged(XdsApi::LdsUpdate listener)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnError(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnResourceDoesNotExist()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
};
// RouteConfiguration data watcher interface. Implemented by callers.
- class RouteConfigWatcherInterface {
+ class RouteConfigWatcherInterface
+ : public RefCounted<RouteConfigWatcherInterface> {
public:
- virtual ~RouteConfigWatcherInterface() = default;
- virtual void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
+ virtual void OnRouteConfigChanged(XdsApi::RdsUpdate route_config)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnError(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnResourceDoesNotExist()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
};
// Cluster data watcher interface. Implemented by callers.
- class ClusterWatcherInterface {
+ class ClusterWatcherInterface : public RefCounted<ClusterWatcherInterface> {
public:
- virtual ~ClusterWatcherInterface() = default;
- virtual void OnClusterChanged(XdsApi::CdsUpdate cluster_data) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
+ virtual void OnClusterChanged(XdsApi::CdsUpdate cluster_data)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnError(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnResourceDoesNotExist()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
};
// Endpoint data watcher interface. Implemented by callers.
- class EndpointWatcherInterface {
+ class EndpointWatcherInterface : public RefCounted<EndpointWatcherInterface> {
public:
- virtual ~EndpointWatcherInterface() = default;
- virtual void OnEndpointChanged(XdsApi::EdsUpdate update) = 0;
- virtual void OnError(grpc_error* error) = 0;
- virtual void OnResourceDoesNotExist() = 0;
+ virtual void OnEndpointChanged(XdsApi::EdsUpdate update)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnError(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
+ virtual void OnResourceDoesNotExist()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&work_serializer_) = 0;
};
// Factory function to get or create the global XdsClient instance.
// If *error is not GRPC_ERROR_NONE upon return, then there was
// an error initializing the client.
- static RefCountedPtr<XdsClient> GetOrCreate(grpc_error** error);
+ static RefCountedPtr<XdsClient> GetOrCreate(const grpc_channel_args* args,
+ grpc_error_handle* error);
- // Callers should not instantiate directly. Use GetOrCreate() instead.
- explicit XdsClient(grpc_error** error);
+ // Most callers should not instantiate directly. Use GetOrCreate() instead.
+ XdsClient(std::unique_ptr<XdsBootstrap> bootstrap,
+ const grpc_channel_args* args);
~XdsClient() override;
const XdsBootstrap& bootstrap() const {
@@ -100,18 +111,6 @@ class XdsClient : public DualRefCounted<XdsClient> {
grpc_pollset_set* interested_parties() const { return interested_parties_; }
- // TODO(roth): When we add federation, there will be multiple channels
- // inside the XdsClient, and the set of channels may change over time,
- // but not every channel may use every one of the child channels, so
- // this API will need to change. At minumum, we will need to hold a
- // ref to the parent channelz node so that we can update its list of
- // children as the set of xDS channels changes. However, we may also
- // want to make this a bit more selective such that only those
- // channels on which a given parent channel is actually requesting
- // resources will actually be marked as its children.
- void AddChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
- void RemoveChannelzLinkage(channelz::ChannelNode* parent_channelz_node);
-
void Orphan() override;
// Start and cancel listener data watch for a listener.
@@ -122,7 +121,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
// If the caller is going to start a new watch after cancelling the
// old one, it should set delay_unsubscription to true.
void WatchListenerData(y_absl::string_view listener_name,
- std::unique_ptr<ListenerWatcherInterface> watcher);
+ RefCountedPtr<ListenerWatcherInterface> watcher);
void CancelListenerDataWatch(y_absl::string_view listener_name,
ListenerWatcherInterface* watcher,
bool delay_unsubscription = false);
@@ -134,9 +133,8 @@ class XdsClient : public DualRefCounted<XdsClient> {
// pointer must not be used for any other purpose.)
// If the caller is going to start a new watch after cancelling the
// old one, it should set delay_unsubscription to true.
- void WatchRouteConfigData(
- y_absl::string_view route_config_name,
- std::unique_ptr<RouteConfigWatcherInterface> watcher);
+ void WatchRouteConfigData(y_absl::string_view route_config_name,
+ RefCountedPtr<RouteConfigWatcherInterface> watcher);
void CancelRouteConfigDataWatch(y_absl::string_view route_config_name,
RouteConfigWatcherInterface* watcher,
bool delay_unsubscription = false);
@@ -149,7 +147,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
// If the caller is going to start a new watch after cancelling the
// old one, it should set delay_unsubscription to true.
void WatchClusterData(y_absl::string_view cluster_name,
- std::unique_ptr<ClusterWatcherInterface> watcher);
+ RefCountedPtr<ClusterWatcherInterface> watcher);
void CancelClusterDataWatch(y_absl::string_view cluster_name,
ClusterWatcherInterface* watcher,
bool delay_unsubscription = false);
@@ -162,7 +160,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
// If the caller is going to start a new watch after cancelling the
// old one, it should set delay_unsubscription to true.
void WatchEndpointData(y_absl::string_view eds_service_name,
- std::unique_ptr<EndpointWatcherInterface> watcher);
+ RefCountedPtr<EndpointWatcherInterface> watcher);
void CancelEndpointDataWatch(y_absl::string_view eds_service_name,
EndpointWatcherInterface* watcher,
bool delay_unsubscription = false);
@@ -200,15 +198,15 @@ class XdsClient : public DualRefCounted<XdsClient> {
// implementation.
TString DumpClientConfigBinary();
+ // Helpers for encoding the XdsClient object in channel args.
+ grpc_arg MakeChannelArg() const;
+ static RefCountedPtr<XdsClient> GetFromChannelArgs(
+ const grpc_channel_args& args);
+
private:
// Contains a channel to the xds server and all the data related to the
// channel. Holds a ref to the xds client object.
- //
- // Currently, there is only one ChannelState object per XdsClient
- // object, and it has essentially the same lifetime. But in the
- // future, when we add federation support, a single XdsClient may have
- // multiple underlying channels to talk to different xDS servers.
- class ChannelState : public InternallyRefCounted<ChannelState> {
+ class ChannelState : public DualRefCounted<ChannelState> {
public:
template <typename T>
class RetryableCall;
@@ -236,9 +234,13 @@ class XdsClient : public DualRefCounted<XdsClient> {
void StartConnectivityWatchLocked();
void CancelConnectivityWatchLocked();
- void Subscribe(const TString& type_url, const TString& name);
- void Unsubscribe(const TString& type_url, const TString& name,
- bool delay_unsubscription);
+ void SubscribeLocked(const TString& type_url,
+ const XdsApi::ResourceName& name)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
+ void UnsubscribeLocked(const TString& type_url,
+ const XdsApi::ResourceName& name,
+ bool delay_unsubscription)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&XdsClient::mu_);
private:
class StateWatcher;
@@ -251,16 +253,19 @@ class XdsClient : public DualRefCounted<XdsClient> {
// The channel and its status.
grpc_channel* channel_;
bool shutting_down_ = false;
- StateWatcher* watcher_ = nullptr;
+ StateWatcher* watcher_;
// The retryable XDS calls.
OrphanablePtr<RetryableCall<AdsCallState>> ads_calld_;
OrphanablePtr<RetryableCall<LrsCallState>> lrs_calld_;
+
+ // Stores the most recent accepted resource version for each resource type.
+ std::map<TString /*type*/, TString /*version*/>
+ resource_type_version_map_;
};
struct ListenerState {
- std::map<ListenerWatcherInterface*,
- std::unique_ptr<ListenerWatcherInterface>>
+ std::map<ListenerWatcherInterface*, RefCountedPtr<ListenerWatcherInterface>>
watchers;
// The latest data seen from LDS.
y_absl::optional<XdsApi::LdsUpdate> update;
@@ -269,7 +274,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
struct RouteConfigState {
std::map<RouteConfigWatcherInterface*,
- std::unique_ptr<RouteConfigWatcherInterface>>
+ RefCountedPtr<RouteConfigWatcherInterface>>
watchers;
// The latest data seen from RDS.
y_absl::optional<XdsApi::RdsUpdate> update;
@@ -277,7 +282,7 @@ class XdsClient : public DualRefCounted<XdsClient> {
};
struct ClusterState {
- std::map<ClusterWatcherInterface*, std::unique_ptr<ClusterWatcherInterface>>
+ std::map<ClusterWatcherInterface*, RefCountedPtr<ClusterWatcherInterface>>
watchers;
// The latest data seen from CDS.
y_absl::optional<XdsApi::CdsUpdate> update;
@@ -285,14 +290,27 @@ class XdsClient : public DualRefCounted<XdsClient> {
};
struct EndpointState {
- std::map<EndpointWatcherInterface*,
- std::unique_ptr<EndpointWatcherInterface>>
+ std::map<EndpointWatcherInterface*, RefCountedPtr<EndpointWatcherInterface>>
watchers;
// The latest data seen from EDS.
y_absl::optional<XdsApi::EdsUpdate> update;
XdsApi::ResourceMetadata meta;
};
+ struct AuthorityState {
+ RefCountedPtr<ChannelState> channel_state;
+ std::map<TString /*listener_name*/, ListenerState> listener_map;
+ std::map<TString /*route_config_name*/, RouteConfigState>
+ route_config_map;
+ std::map<TString /*cluster_name*/, ClusterState> cluster_map;
+ std::map<TString /*eds_service_name*/, EndpointState> endpoint_map;
+
+ bool HasSubscribedResources() {
+ return !listener_map.empty() || !route_config_map.empty() ||
+ !cluster_map.empty() || !endpoint_map.empty();
+ }
+ };
+
struct LoadReportState {
struct LocalityState {
XdsClusterLocalityStats* locality_stats = nullptr;
@@ -307,49 +325,55 @@ class XdsClient : public DualRefCounted<XdsClient> {
grpc_millis last_report_time = ExecCtx::Get()->Now();
};
+ class Notifier;
+
// Sends an error notification to all watchers.
- void NotifyOnErrorLocked(grpc_error* error);
+ void NotifyOnErrorLocked(grpc_error_handle error)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
XdsApi::ClusterLoadReportMap BuildLoadReportSnapshotLocked(
- bool send_all_clusters, const std::set<TString>& clusters);
+ bool send_all_clusters, const std::set<TString>& clusters)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
- void UpdateResourceMetadataWithFailedParseResult(
- grpc_millis update_time, const XdsApi::AdsParseResult& result);
- void UpdatePendingResources(
- const TString& type_url,
- XdsApi::ResourceMetadataMap* resource_metadata_map);
+ RefCountedPtr<ChannelState> GetOrCreateChannelStateLocked(
+ const XdsBootstrap::XdsServer& server) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ std::unique_ptr<XdsBootstrap> bootstrap_;
+ grpc_channel_args* args_;
const grpc_millis request_timeout_;
grpc_pollset_set* interested_parties_;
- std::unique_ptr<XdsBootstrap> bootstrap_;
OrphanablePtr<CertificateProviderStore> certificate_provider_store_;
XdsApi api_;
+ WorkSerializer work_serializer_;
Mutex mu_;
- // The channel for communicating with the xds server.
- OrphanablePtr<ChannelState> chand_;
+ // Map of existing xDS server channels.
+ std::map<XdsBootstrap::XdsServer, ChannelState*> xds_server_channel_map_
+ Y_ABSL_GUARDED_BY(mu_);
- // One entry for each watched LDS resource.
- std::map<TString /*listener_name*/, ListenerState> listener_map_;
- // One entry for each watched RDS resource.
- std::map<TString /*route_config_name*/, RouteConfigState>
- route_config_map_;
- // One entry for each watched CDS resource.
- std::map<TString /*cluster_name*/, ClusterState> cluster_map_;
- // One entry for each watched EDS resource.
- std::map<TString /*eds_service_name*/, EndpointState> endpoint_map_;
+ std::map<TString /*authority*/, AuthorityState> authority_state_map_
+ Y_ABSL_GUARDED_BY(mu_);
// Load report data.
std::map<
std::pair<TString /*cluster_name*/, TString /*eds_service_name*/>,
LoadReportState>
- load_report_map_;
-
- // Stores the most recent accepted resource version for each resource type.
- std::map<TString /*type*/, TString /*version*/> resource_version_map_;
-
- bool shutting_down_ = false;
+ load_report_map_ Y_ABSL_GUARDED_BY(mu_);
+
+ // Stores started watchers whose resource name was not parsed successfully,
+ // waiting to be cancelled or reset in Orphan().
+ std::map<ListenerWatcherInterface*, RefCountedPtr<ListenerWatcherInterface>>
+ invalid_listener_watchers_ Y_ABSL_GUARDED_BY(mu_);
+ std::map<RouteConfigWatcherInterface*,
+ RefCountedPtr<RouteConfigWatcherInterface>>
+ invalid_route_config_watchers_ Y_ABSL_GUARDED_BY(mu_);
+ std::map<ClusterWatcherInterface*, RefCountedPtr<ClusterWatcherInterface>>
+ invalid_cluster_watchers_ Y_ABSL_GUARDED_BY(mu_);
+ std::map<EndpointWatcherInterface*, RefCountedPtr<EndpointWatcherInterface>>
+ invalid_endpoint_watchers_ Y_ABSL_GUARDED_BY(mu_);
+
+ bool shutting_down_ Y_ABSL_GUARDED_BY(mu_) = false;
};
namespace internal {
@@ -362,4 +386,4 @@ void SetXdsFallbackBootstrapConfig(const char* config);
} // namespace grpc_core
-#endif /* GRPC_CORE_EXT_XDS_XDS_CLIENT_H */
+#endif // GRPC_CORE_EXT_XDS_XDS_CLIENT_H
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
index e35d8fe386e..6193a364285 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.cc
@@ -31,8 +31,8 @@ namespace grpc_core {
namespace {
-uint64_t GetAndResetCounter(Atomic<uint64_t>* from) {
- return from->Exchange(0, MemoryOrder::RELAXED);
+uint64_t GetAndResetCounter(std::atomic<uint64_t>* from) {
+ return from->exchange(0, std::memory_order_relaxed);
}
} // namespace
@@ -82,7 +82,7 @@ XdsClusterDropStats::Snapshot XdsClusterDropStats::GetSnapshotAndReset() {
}
void XdsClusterDropStats::AddUncategorizedDrops() {
- uncategorized_drops_.FetchAdd(1);
+ uncategorized_drops_.fetch_add(1);
}
void XdsClusterDropStats::AddCallDropped(const TString& category) {
@@ -132,28 +132,29 @@ XdsClusterLocalityStats::~XdsClusterLocalityStats() {
XdsClusterLocalityStats::Snapshot
XdsClusterLocalityStats::GetSnapshotAndReset() {
- Snapshot snapshot = {GetAndResetCounter(&total_successful_requests_),
- // Don't reset total_requests_in_progress because it's
- // not related to a single reporting interval.
- total_requests_in_progress_.Load(MemoryOrder::RELAXED),
- GetAndResetCounter(&total_error_requests_),
- GetAndResetCounter(&total_issued_requests_),
- {}};
+ Snapshot snapshot = {
+ GetAndResetCounter(&total_successful_requests_),
+ // Don't reset total_requests_in_progress because it's
+ // not related to a single reporting interval.
+ total_requests_in_progress_.load(std::memory_order_relaxed),
+ GetAndResetCounter(&total_error_requests_),
+ GetAndResetCounter(&total_issued_requests_),
+ {}};
MutexLock lock(&backend_metrics_mu_);
snapshot.backend_metrics = std::move(backend_metrics_);
return snapshot;
}
void XdsClusterLocalityStats::AddCallStarted() {
- total_issued_requests_.FetchAdd(1, MemoryOrder::RELAXED);
- total_requests_in_progress_.FetchAdd(1, MemoryOrder::RELAXED);
+ total_issued_requests_.fetch_add(1, std::memory_order_relaxed);
+ total_requests_in_progress_.fetch_add(1, std::memory_order_relaxed);
}
void XdsClusterLocalityStats::AddCallFinished(bool fail) {
- Atomic<uint64_t>& to_increment =
+ std::atomic<uint64_t>& to_increment =
fail ? total_error_requests_ : total_successful_requests_;
- to_increment.FetchAdd(1, MemoryOrder::RELAXED);
- total_requests_in_progress_.FetchAdd(-1, MemoryOrder::ACQ_REL);
+ to_increment.fetch_add(1, std::memory_order_relaxed);
+ total_requests_in_progress_.fetch_add(-1, std::memory_order_acq_rel);
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
index 088afe12fc3..b65f9ff76b1 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_client_stats.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <map>
#include <util/generic/string.h>
@@ -29,7 +30,6 @@
#include "y_absl/strings/string_view.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -46,7 +46,7 @@ class XdsLocalityName : public RefCounted<XdsLocalityName> {
struct Less {
bool operator()(const XdsLocalityName* lhs,
const XdsLocalityName* rhs) const {
- if (lhs == nullptr || rhs == nullptr) return GPR_ICMP(lhs, rhs);
+ if (lhs == nullptr || rhs == nullptr) return QsortCompare(lhs, rhs);
return lhs->Compare(*rhs) < 0;
}
@@ -144,12 +144,12 @@ class XdsClusterDropStats : public RefCounted<XdsClusterDropStats> {
y_absl::string_view lrs_server_name_;
y_absl::string_view cluster_name_;
y_absl::string_view eds_service_name_;
- Atomic<uint64_t> uncategorized_drops_{0};
+ std::atomic<uint64_t> uncategorized_drops_{0};
// Protects categorized_drops_. A mutex is necessary because the length of
// dropped_requests can be accessed by both the picker (from data plane
// mutex) and the load reporting thread (from the control plane combiner).
Mutex mu_;
- CategorizedDropsMap categorized_drops_;
+ CategorizedDropsMap categorized_drops_ Y_ABSL_GUARDED_BY(mu_);
};
// Locality stats for an xds cluster.
@@ -221,17 +221,18 @@ class XdsClusterLocalityStats : public RefCounted<XdsClusterLocalityStats> {
y_absl::string_view eds_service_name_;
RefCountedPtr<XdsLocalityName> name_;
- Atomic<uint64_t> total_successful_requests_{0};
- Atomic<uint64_t> total_requests_in_progress_{0};
- Atomic<uint64_t> total_error_requests_{0};
- Atomic<uint64_t> total_issued_requests_{0};
+ std::atomic<uint64_t> total_successful_requests_{0};
+ std::atomic<uint64_t> total_requests_in_progress_{0};
+ std::atomic<uint64_t> total_error_requests_{0};
+ std::atomic<uint64_t> total_issued_requests_{0};
// Protects backend_metrics_. A mutex is necessary because the length of
// backend_metrics_ can be accessed by both the callback intercepting the
// call's recv_trailing_metadata (not from the control plane work serializer)
// and the load reporting thread (from the control plane work serializer).
Mutex backend_metrics_mu_;
- std::map<TString, BackendMetric> backend_metrics_;
+ std::map<TString, BackendMetric> backend_metrics_
+ Y_ABSL_GUARDED_BY(backend_metrics_mu_);
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc b/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc
index e4ad038a697..b2a7d4df9d3 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.cc
@@ -18,8 +18,6 @@
#include "src/core/ext/xds/xds_http_fault_filter.h"
-#include <grpc/grpc.h>
-
#include <util/generic/string.h>
#include "y_absl/status/statusor.h"
@@ -33,6 +31,10 @@
#include "google/protobuf/any.upb.h"
#include "google/protobuf/duration.upb.h"
#include "google/protobuf/wrappers.upb.h"
+#include "upb/def.h"
+
+#include <grpc/grpc.h>
+
#include "src/core/ext/filters/fault_injection/fault_injection_filter.h"
#include "src/core/ext/xds/xds_http_filters.h"
#include "src/core/lib/channel/channel_args.h"
@@ -40,7 +42,6 @@
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/json/json.h"
#include "src/core/lib/transport/status_conversion.h"
-#include "upb/def.h"
namespace grpc_core {
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.h b/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.h
index 48ca530cd6a..bc90c1a21ae 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_http_fault_filter.h
@@ -19,11 +19,12 @@
#include <grpc/support/port_platform.h>
+#include "y_absl/status/statusor.h"
+#include "upb/def.h"
+
#include <grpc/grpc.h>
-#include "y_absl/status/statusor.h"
#include "src/core/ext/xds/xds_http_filters.h"
-#include "upb/def.h"
namespace grpc_core {
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc b/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc
index 7cfeecb5b41..c063a5d4f05 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.cc
@@ -20,6 +20,7 @@
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
+
#include "src/core/ext/xds/xds_http_fault_filter.h"
namespace grpc_core {
@@ -52,10 +53,9 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl {
"router filter does not support config override");
}
- // No-op -- this filter is special-cased by the xds resolver.
const grpc_channel_filter* channel_filter() const override { return nullptr; }
- // No-op -- this filter is special-cased by the xds resolver.
+ // No-op. This will never be called, since channel_filter() returns null.
y_absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
const FilterConfig& /*hcm_filter_config*/,
const FilterConfig* /*filter_config_override*/) const override {
@@ -65,6 +65,8 @@ class XdsHttpRouterFilter : public XdsHttpFilterImpl {
bool IsSupportedOnClients() const override { return true; }
bool IsSupportedOnServers() const override { return true; }
+
+ bool IsTerminalFilter() const override { return true; }
};
using FilterOwnerList = std::vector<std::unique_ptr<XdsHttpFilterImpl>>;
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.h b/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.h
index 49ff1687110..aaae50ceed6 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.h
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_http_filters.h
@@ -107,6 +107,9 @@ class XdsHttpFilterImpl {
// Returns true if the filter is supported on servers; false otherwise
virtual bool IsSupportedOnServers() const = 0;
+
+ // Returns true if the filter must be the last filter in the chain.
+ virtual bool IsTerminalFilter() const { return false; }
};
class XdsHttpFilterRegistry {
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_routing.cc b/contrib/libs/grpc/src/core/ext/xds/xds_routing.cc
new file mode 100644
index 00000000000..b0f5cee4e2b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_routing.cc
@@ -0,0 +1,247 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/ext/xds/xds_routing.h"
+
+#include <cctype>
+
+namespace grpc_core {
+
+namespace {
+enum MatchType {
+ EXACT_MATCH,
+ SUFFIX_MATCH,
+ PREFIX_MATCH,
+ UNIVERSE_MATCH,
+ INVALID_MATCH,
+};
+
+// Returns true if match succeeds.
+bool DomainMatch(MatchType match_type, y_absl::string_view domain_pattern_in,
+ y_absl::string_view expected_host_name_in) {
+ // Normalize the args to lower-case. Domain matching is case-insensitive.
+ TString domain_pattern = TString(domain_pattern_in);
+ TString expected_host_name = TString(expected_host_name_in);
+ std::transform(domain_pattern.cbegin(), domain_pattern.cend(),
+ domain_pattern.begin(),
+ [](unsigned char c) { return std::tolower(c); });
+ std::transform(expected_host_name.cbegin(), expected_host_name.cend(),
+ expected_host_name.begin(),
+ [](unsigned char c) { return std::tolower(c); });
+ if (match_type == EXACT_MATCH) {
+ return domain_pattern == expected_host_name;
+ } else if (match_type == SUFFIX_MATCH) {
+ // Asterisk must match at least one char.
+ if (expected_host_name.size() < domain_pattern.size()) return false;
+ y_absl::string_view pattern_suffix(domain_pattern.c_str() + 1);
+ y_absl::string_view host_suffix(expected_host_name.c_str() +
+ expected_host_name.size() -
+ pattern_suffix.size());
+ return pattern_suffix == host_suffix;
+ } else if (match_type == PREFIX_MATCH) {
+ // Asterisk must match at least one char.
+ if (expected_host_name.size() < domain_pattern.size()) return false;
+ y_absl::string_view pattern_prefix(domain_pattern.c_str(),
+ domain_pattern.size() - 1);
+ y_absl::string_view host_prefix(expected_host_name.c_str(),
+ pattern_prefix.size());
+ return pattern_prefix == host_prefix;
+ } else {
+ return match_type == UNIVERSE_MATCH;
+ }
+}
+
+MatchType DomainPatternMatchType(y_absl::string_view domain_pattern) {
+ if (domain_pattern.empty()) return INVALID_MATCH;
+ if (domain_pattern.find('*') == TString::npos) return EXACT_MATCH;
+ if (domain_pattern == "*") return UNIVERSE_MATCH;
+ if (domain_pattern[0] == '*') return SUFFIX_MATCH;
+ if (domain_pattern[domain_pattern.size() - 1] == '*') return PREFIX_MATCH;
+ return INVALID_MATCH;
+}
+
+} // namespace
+
+y_absl::optional<size_t> XdsRouting::FindVirtualHostForDomain(
+ const VirtualHostListIterator& vhost_iterator, y_absl::string_view domain) {
+ // Find the best matched virtual host.
+ // The search order for 4 groups of domain patterns:
+ // 1. Exact match.
+ // 2. Suffix match (e.g., "*ABC").
+ // 3. Prefix match (e.g., "ABC*").
+ // 4. Universe match (i.e., "*").
+ // Within each group, longest match wins.
+ // If the same best matched domain pattern appears in multiple virtual
+ // hosts, the first matched virtual host wins.
+ y_absl::optional<size_t> target_index;
+ MatchType best_match_type = INVALID_MATCH;
+ size_t longest_match = 0;
+ // Check each domain pattern in each virtual host to determine the best
+ // matched virtual host.
+ for (size_t i = 0; i < vhost_iterator.Size(); ++i) {
+ const auto& domains = vhost_iterator.GetDomainsForVirtualHost(i);
+ for (const TString& domain_pattern : domains) {
+ // Check the match type first. Skip the pattern if it's not better
+ // than current match.
+ const MatchType match_type = DomainPatternMatchType(domain_pattern);
+ // This should be caught by RouteConfigParse().
+ GPR_ASSERT(match_type != INVALID_MATCH);
+ if (match_type > best_match_type) continue;
+ if (match_type == best_match_type &&
+ domain_pattern.size() <= longest_match) {
+ continue;
+ }
+ // Skip if match fails.
+ if (!DomainMatch(match_type, domain_pattern, domain)) continue;
+ // Choose this match.
+ target_index = i;
+ best_match_type = match_type;
+ longest_match = domain_pattern.size();
+ if (best_match_type == EXACT_MATCH) break;
+ }
+ if (best_match_type == EXACT_MATCH) break;
+ }
+ return target_index;
+}
+
+namespace {
+
+bool HeadersMatch(const std::vector<HeaderMatcher>& header_matchers,
+ grpc_metadata_batch* initial_metadata) {
+ for (const auto& header_matcher : header_matchers) {
+ TString concatenated_value;
+ if (!header_matcher.Match(XdsRouting::GetHeaderValue(
+ initial_metadata, header_matcher.name(), &concatenated_value))) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool UnderFraction(const uint32_t fraction_per_million) {
+ // Generate a random number in [0, 1000000).
+ const uint32_t random_number = rand() % 1000000;
+ return random_number < fraction_per_million;
+}
+
+} // namespace
+
+y_absl::optional<size_t> XdsRouting::GetRouteForRequest(
+ const RouteListIterator& route_list_iterator, y_absl::string_view path,
+ grpc_metadata_batch* initial_metadata) {
+ for (size_t i = 0; i < route_list_iterator.Size(); ++i) {
+ const XdsApi::Route::Matchers& matchers =
+ route_list_iterator.GetMatchersForRoute(i);
+ if (matchers.path_matcher.Match(path) &&
+ HeadersMatch(matchers.header_matchers, initial_metadata) &&
+ (!matchers.fraction_per_million.has_value() ||
+ UnderFraction(*matchers.fraction_per_million))) {
+ return i;
+ }
+ }
+ return y_absl::nullopt;
+}
+
+bool XdsRouting::IsValidDomainPattern(y_absl::string_view domain_pattern) {
+ return DomainPatternMatchType(domain_pattern) != INVALID_MATCH;
+}
+
+y_absl::optional<y_absl::string_view> XdsRouting::GetHeaderValue(
+ grpc_metadata_batch* initial_metadata, y_absl::string_view header_name,
+ TString* concatenated_value) {
+ // Note: If we ever allow binary headers here, we still need to
+ // special-case ignore "grpc-tags-bin" and "grpc-trace-bin", since
+ // they are not visible to the LB policy in grpc-go.
+ if (y_absl::EndsWith(header_name, "-bin")) {
+ return y_absl::nullopt;
+ } else if (header_name == "content-type") {
+ return "application/grpc";
+ }
+ return grpc_metadata_batch_get_value(initial_metadata, header_name,
+ concatenated_value);
+}
+
+namespace {
+
+const XdsHttpFilterImpl::FilterConfig* FindFilterConfigOverride(
+ const TString& instance_name,
+ const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
+ const XdsApi::Route::RouteAction::ClusterWeight* cluster_weight) {
+ // Check ClusterWeight, if any.
+ if (cluster_weight != nullptr) {
+ auto it = cluster_weight->typed_per_filter_config.find(instance_name);
+ if (it != cluster_weight->typed_per_filter_config.end()) return &it->second;
+ }
+ // Check Route.
+ auto it = route.typed_per_filter_config.find(instance_name);
+ if (it != route.typed_per_filter_config.end()) return &it->second;
+ // Check VirtualHost.
+ it = vhost.typed_per_filter_config.find(instance_name);
+ if (it != vhost.typed_per_filter_config.end()) return &it->second;
+ // Not found.
+ return nullptr;
+}
+
+} // namespace
+
+XdsRouting::GeneratePerHttpFilterConfigsResult
+XdsRouting::GeneratePerHTTPFilterConfigs(
+ const std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>&
+ http_filters,
+ const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
+ const XdsApi::Route::RouteAction::ClusterWeight* cluster_weight,
+ grpc_channel_args* args) {
+ GeneratePerHttpFilterConfigsResult result;
+ result.args = args;
+ for (const auto& http_filter : http_filters) {
+ // Find filter. This is guaranteed to succeed, because it's checked
+ // at config validation time in the XdsApi code.
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ http_filter.config.config_proto_type_name);
+ GPR_ASSERT(filter_impl != nullptr);
+ // If there is not actually any C-core filter associated with this
+ // xDS filter, then it won't need any config, so skip it.
+ if (filter_impl->channel_filter() == nullptr) continue;
+ // Allow filter to add channel args that may affect service config
+ // parsing.
+ result.args = filter_impl->ModifyChannelArgs(result.args);
+ // Find config override, if any.
+ const XdsHttpFilterImpl::FilterConfig* config_override =
+ FindFilterConfigOverride(http_filter.name, vhost, route,
+ cluster_weight);
+ // Generate service config for filter.
+ auto method_config_field =
+ filter_impl->GenerateServiceConfig(http_filter.config, config_override);
+ if (!method_config_field.ok()) {
+ grpc_channel_args_destroy(result.args);
+ result.args = nullptr;
+ result.error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "failed to generate method config for HTTP filter ", http_filter.name,
+ ": ", method_config_field.status().ToString()));
+ break;
+ }
+ result.per_filter_configs[method_config_field->service_config_field_name]
+ .push_back(method_config_field->element);
+ }
+ return result;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_routing.h b/contrib/libs/grpc/src/core/ext/xds/xds_routing.h
new file mode 100644
index 00000000000..cd294e5806e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_routing.h
@@ -0,0 +1,98 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_EXT_XDS_XDS_ROUTING_H
+#define GRPC_CORE_EXT_XDS_XDS_ROUTING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/ext/xds/xds_api.h"
+#include "src/core/lib/matchers/matchers.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+class XdsRouting {
+ public:
+ class VirtualHostListIterator {
+ public:
+ virtual ~VirtualHostListIterator() = default;
+ // Returns the number of virtual hosts in the list.
+ virtual size_t Size() const = 0;
+ // Returns the domain list for the virtual host at the specified index.
+ virtual const std::vector<TString>& GetDomainsForVirtualHost(
+ size_t index) const = 0;
+ };
+
+ class RouteListIterator {
+ public:
+ virtual ~RouteListIterator() = default;
+ // Number of routes.
+ virtual size_t Size() const = 0;
+ // Returns the matchers for the route at the specified index.
+ virtual const XdsApi::Route::Matchers& GetMatchersForRoute(
+ size_t index) const = 0;
+ };
+
+ // Returns the index of the selected virtual host in the list.
+ static y_absl::optional<size_t> FindVirtualHostForDomain(
+ const VirtualHostListIterator& vhost_iterator, y_absl::string_view domain);
+
+ // Returns the index in route_list_iterator to use for a request with
+ // the specified path and metadata, or nullopt if no route matches.
+ static y_absl::optional<size_t> GetRouteForRequest(
+ const RouteListIterator& route_list_iterator, y_absl::string_view path,
+ grpc_metadata_batch* initial_metadata);
+
+ // Returns true if \a domain_pattern is a valid domain pattern, false
+ // otherwise.
+ static bool IsValidDomainPattern(y_absl::string_view domain_pattern);
+
+ // Returns the metadata value(s) for the specified key.
+ // As special cases, binary headers return a value of y_absl::nullopt, and
+ // "content-type" header returns "application/grpc".
+ static y_absl::optional<y_absl::string_view> GetHeaderValue(
+ grpc_metadata_batch* initial_metadata, y_absl::string_view header_name,
+ TString* concatenated_value);
+
+ struct GeneratePerHttpFilterConfigsResult {
+ // Map of field name to list of elements for that field
+ std::map<TString, std::vector<TString>> per_filter_configs;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ // Guaranteed to be nullptr if error is GRPC_ERROR_NONE
+ grpc_channel_args* args = nullptr;
+ };
+
+ // Generates a map of per_filter_configs. \a args is consumed.
+ static GeneratePerHttpFilterConfigsResult GeneratePerHTTPFilterConfigs(
+ const std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>&
+ http_filters,
+ const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
+ const XdsApi::Route::RouteAction::ClusterWeight* cluster_weight,
+ grpc_channel_args* args);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_EXT_XDS_XDS_ROUTING_H
diff --git a/contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc b/contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
index 021d9c7ad93..918d3127998 100644
--- a/contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
+++ b/contrib/libs/grpc/src/core/ext/xds/xds_server_config_fetcher.cc
@@ -18,41 +18,142 @@
#include <grpc/support/port_platform.h>
+#include "y_absl/strings/str_join.h"
#include "y_absl/strings/str_replace.h"
+#include "src/core/ext/filters/server_config_selector/server_config_selector.h"
+#include "src/core/ext/filters/server_config_selector/server_config_selector_filter.h"
#include "src/core/ext/xds/xds_certificate_provider.h"
+#include "src/core/ext/xds/xds_channel_stack_modifier.h"
#include "src/core/ext/xds/xds_client.h"
+#include "src/core/ext/xds/xds_routing.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/security/credentials/xds/xds_credentials.h"
+#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
+#include "src/core/lib/transport/error_utils.h"
#include "src/core/lib/uri/uri_parser.h"
namespace grpc_core {
+namespace {
TraceFlag grpc_xds_server_config_fetcher_trace(false,
"xds_server_config_fetcher");
-namespace {
+// A server config fetcher that fetches the information for configuring server
+// listeners from the xDS control plane.
+class XdsServerConfigFetcher : public grpc_server_config_fetcher {
+ public:
+ XdsServerConfigFetcher(RefCountedPtr<XdsClient> xds_client,
+ grpc_server_xds_status_notifier notifier);
+
+ void StartWatch(TString listening_address,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ watcher) override;
+
+ void CancelWatch(
+ grpc_server_config_fetcher::WatcherInterface* watcher) override;
+
+ // Return the interested parties from the xds client so that it can be polled.
+ grpc_pollset_set* interested_parties() override {
+ return xds_client_->interested_parties();
+ }
+
+ private:
+ class ListenerWatcher;
+
+ RefCountedPtr<XdsClient> xds_client_;
+ grpc_server_xds_status_notifier serving_status_notifier_;
+ Mutex mu_;
+ std::map<grpc_server_config_fetcher::WatcherInterface*, ListenerWatcher*>
+ listener_watchers_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// A watcher implementation for listening on LDS updates from the xDS control
+// plane. When a good LDS update is received, it creates a
+// FilterChainMatchManager object that would replace the existing (if any)
+// FilterChainMatchManager object after all referenced RDS resources are
+// fetched. Note that a good update also causes the server listener to start
+// listening if it isn't already. If an error LDS update is received (NACKed
+// resource, timeouts), the previous good FilterChainMatchManager, if any,
+// continues to be used. If there isn't any previous good update or if the
+// update received was a fatal error (resource does not exist), the server
+// listener is made to stop listening.
+class XdsServerConfigFetcher::ListenerWatcher
+ : public XdsClient::ListenerWatcherInterface {
+ public:
+ ListenerWatcher(RefCountedPtr<XdsClient> xds_client,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher,
+ grpc_server_xds_status_notifier serving_status_notifier,
+ TString listening_address);
+
+ void OnListenerChanged(XdsApi::LdsUpdate listener) override;
+
+ void OnError(grpc_error_handle error) override;
+
+ void OnResourceDoesNotExist() override;
+
+ const TString& listening_address() const { return listening_address_; }
-class FilterChainMatchManager
+ private:
+ class FilterChainMatchManager;
+
+ void OnFatalError(y_absl::Status status) Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ // Invoked by FilterChainMatchManager that is done fetching all referenced RDS
+ // resources. If the calling FilterChainMatchManager is the
+ // pending_filter_chain_match_manager_, it is promoted to be the
+ // filter_chain_match_manager_ in use.
+ void PendingFilterChainMatchManagerReady(
+ FilterChainMatchManager* filter_chain_match_manager) {
+ MutexLock lock(&mu_);
+ PendingFilterChainMatchManagerReadyLocked(filter_chain_match_manager);
+ }
+ void PendingFilterChainMatchManagerReadyLocked(
+ FilterChainMatchManager* filter_chain_match_manager)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&mu_);
+
+ const RefCountedPtr<XdsClient> xds_client_;
+ const std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher_;
+ const grpc_server_xds_status_notifier serving_status_notifier_;
+ const TString listening_address_;
+ Mutex mu_;
+ RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_
+ Y_ABSL_GUARDED_BY(mu_);
+ RefCountedPtr<FilterChainMatchManager> pending_filter_chain_match_manager_
+ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// A connection manager used by the server listener code to inject channel args
+// to be used for each incoming connection. This implementation chooses the
+// appropriate filter chain from the xDS Listener resource and injects channel
+// args that configure the right mTLS certs and cause the right set of HTTP
+// filters to be injected.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
: public grpc_server_config_fetcher::ConnectionManager {
public:
FilterChainMatchManager(
RefCountedPtr<XdsClient> xds_client,
XdsApi::LdsUpdate::FilterChainMap filter_chain_map,
- y_absl::optional<XdsApi::LdsUpdate::FilterChainData> default_filter_chain)
- : xds_client_(xds_client),
- filter_chain_map_(std::move(filter_chain_map)),
- default_filter_chain_(std::move(default_filter_chain)) {}
+ y_absl::optional<XdsApi::LdsUpdate::FilterChainData> default_filter_chain);
y_absl::StatusOr<grpc_channel_args*> UpdateChannelArgsForConnection(
grpc_channel_args* args, grpc_endpoint* tcp) override;
+ void Orphan() override;
+
+ // Invoked by ListenerWatcher to start fetching referenced RDS resources.
+ void StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(&ListenerWatcher::mu_);
+
const XdsApi::LdsUpdate::FilterChainMap& filter_chain_map() const {
return filter_chain_map_;
}
@@ -72,37 +173,608 @@ class FilterChainMatchManager
RefCountedPtr<XdsCertificateProvider> xds;
};
+ class RouteConfigWatcher;
+ struct RdsUpdateState {
+ RouteConfigWatcher* watcher;
+ y_absl::optional<y_absl::StatusOr<XdsApi::RdsUpdate>> rds_update;
+ };
+
+ class XdsServerConfigSelector;
+ class StaticXdsServerConfigSelectorProvider;
+ class DynamicXdsServerConfigSelectorProvider;
+
y_absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
CreateOrGetXdsCertificateProviderFromFilterChainData(
const XdsApi::LdsUpdate::FilterChainData* filter_chain);
- const RefCountedPtr<XdsClient> xds_client_;
+ // Helper functions invoked by RouteConfigWatcher when there are updates to
+ // RDS resources.
+ void OnRouteConfigChanged(const TString& resource_name,
+ XdsApi::RdsUpdate route_config);
+ void OnError(const TString& resource_name, grpc_error_handle error);
+ void OnResourceDoesNotExist(const TString& resource_name);
+
+ RefCountedPtr<XdsClient> xds_client_;
+ // This ref is only kept around till the FilterChainMatchManager becomes
+ // ready.
+ RefCountedPtr<ListenerWatcher> listener_watcher_;
const XdsApi::LdsUpdate::FilterChainMap filter_chain_map_;
const y_absl::optional<XdsApi::LdsUpdate::FilterChainData>
default_filter_chain_;
Mutex mu_;
+ size_t rds_resources_yet_to_fetch_ Y_ABSL_GUARDED_BY(mu_) = 0;
+ std::map<TString /* resource_name */, RdsUpdateState> rds_map_
+ Y_ABSL_GUARDED_BY(mu_);
std::map<const XdsApi::LdsUpdate::FilterChainData*, CertificateProviders>
certificate_providers_map_ Y_ABSL_GUARDED_BY(mu_);
};
-bool IsLoopbackIp(const grpc_resolved_address* address) {
- const grpc_sockaddr* sock_addr =
- reinterpret_cast<const grpc_sockaddr*>(&address->addr);
- if (sock_addr->sa_family == GRPC_AF_INET) {
- const grpc_sockaddr_in* addr4 =
- reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
- if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
- return true;
+// A watcher implementation for listening on RDS updates referenced to by a
+// FilterChainMatchManager object. After all referenced RDS resources are
+// fetched (errors are allowed), the FilterChainMatchManager tries to replace
+// the current object. The watcher continues to update the referenced RDS
+// resources so that new XdsServerConfigSelectorProvider objects are created
+// with the latest updates and new connections do not need to wait for the RDS
+// resources to be fetched.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ RouteConfigWatcher : public XdsClient::RouteConfigWatcherInterface {
+ public:
+ RouteConfigWatcher(
+ TString resource_name,
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager)
+ : resource_name_(std::move(resource_name)),
+ filter_chain_match_manager_(std::move(filter_chain_match_manager)) {}
+
+ void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) override {
+ filter_chain_match_manager_->OnRouteConfigChanged(resource_name_,
+ std::move(route_config));
+ }
+
+ void OnError(grpc_error_handle error) override {
+ filter_chain_match_manager_->OnError(resource_name_, error);
+ }
+
+ void OnResourceDoesNotExist() override {
+ filter_chain_match_manager_->OnResourceDoesNotExist(resource_name_);
+ }
+
+ private:
+ TString resource_name_;
+ WeakRefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
+};
+
+// An implementation of ServerConfigSelector used by
+// StaticXdsServerConfigSelectorProvider and
+// DynamicXdsServerConfigSelectorProvider to parse the RDS update and get
+// per-call configuration based on incoming metadata.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ XdsServerConfigSelector : public ServerConfigSelector {
+ public:
+ static y_absl::StatusOr<RefCountedPtr<XdsServerConfigSelector>> Create(
+ XdsApi::RdsUpdate rds_update,
+ const std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>&
+ http_filters);
+ ~XdsServerConfigSelector() override = default;
+
+ CallConfig GetCallConfig(grpc_metadata_batch* metadata) override;
+
+ private:
+ struct VirtualHost {
+ struct Route {
+ // true if an action other than kNonForwardingAction is configured.
+ bool unsupported_action;
+ XdsApi::Route::Matchers matchers;
+ RefCountedPtr<ServiceConfig> method_config;
+ };
+
+ class RouteListIterator : public XdsRouting::RouteListIterator {
+ public:
+ explicit RouteListIterator(const std::vector<Route>* routes)
+ : routes_(routes) {}
+
+ size_t Size() const override { return routes_->size(); }
+
+ const XdsApi::Route::Matchers& GetMatchersForRoute(
+ size_t index) const override {
+ return (*routes_)[index].matchers;
+ }
+
+ private:
+ const std::vector<Route>* routes_;
+ };
+
+ std::vector<TString> domains;
+ std::vector<Route> routes;
+ };
+
+ class VirtualHostListIterator : public XdsRouting::VirtualHostListIterator {
+ public:
+ explicit VirtualHostListIterator(
+ const std::vector<VirtualHost>* virtual_hosts)
+ : virtual_hosts_(virtual_hosts) {}
+
+ size_t Size() const override { return virtual_hosts_->size(); }
+
+ const std::vector<TString>& GetDomainsForVirtualHost(
+ size_t index) const override {
+ return (*virtual_hosts_)[index].domains;
}
- } else if (sock_addr->sa_family == GRPC_AF_INET6) {
- const grpc_sockaddr_in6* addr6 =
- reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
- if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
- sizeof(in6addr_loopback)) == 0) {
- return true;
+
+ private:
+ const std::vector<VirtualHost>* virtual_hosts_;
+ };
+
+ std::vector<VirtualHost> virtual_hosts_;
+};
+
+// An XdsServerConfigSelectorProvider implementation for when the
+// RouteConfiguration is available inline.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ StaticXdsServerConfigSelectorProvider
+ : public ServerConfigSelectorProvider {
+ public:
+ StaticXdsServerConfigSelectorProvider(
+ y_absl::StatusOr<XdsApi::RdsUpdate> static_resource,
+ std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>
+ http_filters)
+ : static_resource_(std::move(static_resource)),
+ http_filters_(std::move(http_filters)) {}
+
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) override {
+ GPR_ASSERT(watcher_ == nullptr);
+ watcher_ = std::move(watcher);
+ if (!static_resource_.ok()) {
+ return static_resource_.status();
}
+ return XdsServerConfigSelector::Create(static_resource_.value(),
+ http_filters_);
+ }
+
+ void CancelWatch() override { watcher_.reset(); }
+
+ private:
+ y_absl::StatusOr<XdsApi::RdsUpdate> static_resource_;
+ std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>
+ http_filters_;
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher_;
+};
+
+// An XdsServerConfigSelectorProvider implementation for when the
+// RouteConfiguration is to be fetched separately via RDS.
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider
+ : public ServerConfigSelectorProvider {
+ public:
+ DynamicXdsServerConfigSelectorProvider(
+ RefCountedPtr<XdsClient> xds_client, TString resource_name,
+ y_absl::StatusOr<XdsApi::RdsUpdate> initial_resource,
+ std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>
+ http_filters);
+
+ y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>> Watch(
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) override;
+ void CancelWatch() override;
+
+ private:
+ class RouteConfigWatcher;
+
+ void OnRouteConfigChanged(XdsApi::RdsUpdate rds_update);
+ void OnError(grpc_error_handle error);
+ void OnResourceDoesNotExist();
+
+ RefCountedPtr<XdsClient> xds_client_;
+ TString resource_name_;
+ std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>
+ http_filters_;
+ RouteConfigWatcher* route_config_watcher_ = nullptr;
+ Mutex mu_;
+ std::unique_ptr<ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher_ Y_ABSL_GUARDED_BY(mu_);
+ y_absl::StatusOr<XdsApi::RdsUpdate> resource_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// A watcher implementation for updating the RDS resource used by
+// DynamicXdsServerConfigSelectorProvider
+class XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::RouteConfigWatcher
+ : public XdsClient::RouteConfigWatcherInterface {
+ public:
+ explicit RouteConfigWatcher(
+ RefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent)
+ : parent_(std::move(parent)) {}
+
+ void OnRouteConfigChanged(XdsApi::RdsUpdate route_config) override {
+ parent_->OnRouteConfigChanged(std::move(route_config));
+ }
+
+ void OnError(grpc_error_handle error) override { parent_->OnError(error); }
+
+ void OnResourceDoesNotExist() override { parent_->OnResourceDoesNotExist(); }
+
+ private:
+ RefCountedPtr<DynamicXdsServerConfigSelectorProvider> parent_;
+};
+
+//
+// XdsServerConfigFetcher
+//
+
+XdsServerConfigFetcher::XdsServerConfigFetcher(
+ RefCountedPtr<XdsClient> xds_client,
+ grpc_server_xds_status_notifier notifier)
+ : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
+ GPR_ASSERT(xds_client_ != nullptr);
+}
+
+void XdsServerConfigFetcher::StartWatch(
+ TString listening_address,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface> watcher) {
+ grpc_server_config_fetcher::WatcherInterface* watcher_ptr = watcher.get();
+ auto listener_watcher = MakeRefCounted<ListenerWatcher>(
+ xds_client_, std::move(watcher), serving_status_notifier_,
+ listening_address);
+ auto* listener_watcher_ptr = listener_watcher.get();
+ xds_client_->WatchListenerData(
+ y_absl::StrReplaceAll(
+ xds_client_->bootstrap().server_listener_resource_name_template(),
+ {{"%s", listening_address}}),
+ std::move(listener_watcher));
+ MutexLock lock(&mu_);
+ listener_watchers_.emplace(watcher_ptr, listener_watcher_ptr);
+}
+
+void XdsServerConfigFetcher::CancelWatch(
+ grpc_server_config_fetcher::WatcherInterface* watcher) {
+ MutexLock lock(&mu_);
+ auto it = listener_watchers_.find(watcher);
+ if (it != listener_watchers_.end()) {
+ // Cancel the watch on the listener before erasing
+ xds_client_->CancelListenerDataWatch(
+ y_absl::StrReplaceAll(
+ xds_client_->bootstrap().server_listener_resource_name_template(),
+ {{"%s", it->second->listening_address()}}),
+ it->second, false /* delay_unsubscription */);
+ listener_watchers_.erase(it);
+ }
+}
+
+//
+// XdsServerConfigFetcher::ListenerWatcher
+//
+
+XdsServerConfigFetcher::ListenerWatcher::ListenerWatcher(
+ RefCountedPtr<XdsClient> xds_client,
+ std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
+ server_config_watcher,
+ grpc_server_xds_status_notifier serving_status_notifier,
+ TString listening_address)
+ : xds_client_(std::move(xds_client)),
+ server_config_watcher_(std::move(server_config_watcher)),
+ serving_status_notifier_(serving_status_notifier),
+ listening_address_(std::move(listening_address)) {}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnListenerChanged(
+ XdsApi::LdsUpdate listener) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_server_config_fetcher_trace)) {
+ gpr_log(GPR_INFO,
+ "[ListenerWatcher %p] Received LDS update from xds client %p: %s",
+ this, xds_client_.get(), listener.ToString().c_str());
+ }
+ if (listener.address != listening_address_) {
+ MutexLock lock(&mu_);
+ OnFatalError(y_absl::FailedPreconditionError(
+ "Address in LDS update does not match listening address"));
+ return;
+ }
+ auto new_filter_chain_match_manager = MakeRefCounted<FilterChainMatchManager>(
+ xds_client_, std::move(listener.filter_chain_map),
+ std::move(listener.default_filter_chain));
+ MutexLock lock(&mu_);
+ if (filter_chain_match_manager_ == nullptr ||
+ !(new_filter_chain_match_manager->filter_chain_map() ==
+ filter_chain_match_manager_->filter_chain_map() &&
+ new_filter_chain_match_manager->default_filter_chain() ==
+ filter_chain_match_manager_->default_filter_chain())) {
+ pending_filter_chain_match_manager_ =
+ std::move(new_filter_chain_match_manager);
+ if (XdsRbacEnabled()) {
+ pending_filter_chain_match_manager_->StartRdsWatch(Ref());
+ } else {
+ PendingFilterChainMatchManagerReadyLocked(
+ pending_filter_chain_match_manager_.get());
+ }
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnError(grpc_error_handle error) {
+ MutexLock lock(&mu_);
+ if (filter_chain_match_manager_ != nullptr ||
+ pending_filter_chain_match_manager_ != nullptr) {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p XdsClient reports error: %s for %s; "
+ "ignoring in favor of existing resource",
+ this, grpc_error_std_string(error).c_str(),
+ listening_address_.c_str());
+ } else {
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {GRPC_STATUS_UNAVAILABLE, grpc_error_std_string(error).c_str()});
+ } else {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
+ "not serving on %s",
+ this, grpc_error_std_string(error).c_str(),
+ listening_address_.c_str());
+ }
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnFatalError(
+ y_absl::Status status) {
+ pending_filter_chain_match_manager_.reset();
+ if (filter_chain_match_manager_ != nullptr) {
+ // The server has started listening already, so we need to gracefully
+ // stop serving.
+ server_config_watcher_->StopServing();
+ filter_chain_match_manager_.reset();
+ }
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {static_cast<grpc_status_code>(status.raw_code()),
+ TString(status.message()).c_str()});
+ } else {
+ gpr_log(GPR_ERROR,
+ "ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
+ this, status.ToString().c_str(), listening_address_.c_str());
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::OnResourceDoesNotExist() {
+ MutexLock lock(&mu_);
+ OnFatalError(y_absl::NotFoundError("Requested listener does not exist"));
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::
+ PendingFilterChainMatchManagerReadyLocked(
+ XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager*
+ filter_chain_match_manager) {
+ if (pending_filter_chain_match_manager_ != filter_chain_match_manager) {
+ // This FilterChainMatchManager is no longer the current pending resource.
+ // It should get cleaned up eventually. Ignore this update.
+ return;
+ }
+ // Let the logger know about the update if there was no previous good update.
+ if (filter_chain_match_manager_ == nullptr) {
+ if (serving_status_notifier_.on_serving_status_update != nullptr) {
+ serving_status_notifier_.on_serving_status_update(
+ serving_status_notifier_.user_data, listening_address_.c_str(),
+ {GRPC_STATUS_OK, ""});
+ } else {
+ gpr_log(GPR_INFO,
+ "xDS Listener resource obtained; will start serving on %s",
+ listening_address_.c_str());
+ }
+ }
+ // Promote the pending FilterChainMatchManager
+ filter_chain_match_manager_ = std::move(pending_filter_chain_match_manager_);
+ // TODO(yashykt): Right now, the server_config_watcher_ does not invoke
+ // XdsServerConfigFetcher while holding a lock, but that might change in the
+ // future in which case we would want to execute this update outside the
+ // critical region through a WorkSerializer similar to XdsClient.
+ server_config_watcher_->UpdateConnectionManager(filter_chain_match_manager_);
+}
+
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager
+//
+
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ FilterChainMatchManager(
+ RefCountedPtr<XdsClient> xds_client,
+ XdsApi::LdsUpdate::FilterChainMap filter_chain_map,
+ y_absl::optional<XdsApi::LdsUpdate::FilterChainData> default_filter_chain)
+ : xds_client_(std::move(xds_client)),
+ filter_chain_map_(std::move(filter_chain_map)),
+ default_filter_chain_(std::move(default_filter_chain)) {}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ StartRdsWatch(RefCountedPtr<ListenerWatcher> listener_watcher) {
+ // Get the set of RDS resources to watch on
+ std::set<TString> resource_names;
+ for (const auto& destination_ip : filter_chain_map_.destination_ip_vector) {
+ for (const auto& source_type : destination_ip.source_types_array) {
+ for (const auto& source_ip : source_type) {
+ for (const auto& source_port_pair : source_ip.ports_map) {
+ if (!source_port_pair.second.data->http_connection_manager
+ .route_config_name.empty()) {
+ resource_names.insert(
+ source_port_pair.second.data->http_connection_manager
+ .route_config_name);
+ }
+ }
+ }
+ }
+ }
+ if (default_filter_chain_.has_value() &&
+ !default_filter_chain_->http_connection_manager.route_config_name
+ .empty()) {
+ resource_names.insert(
+ default_filter_chain_->http_connection_manager.route_config_name);
+ }
+ // Start watching on referenced RDS resources
+ {
+ MutexLock lock(&mu_);
+ for (const auto& resource_name : resource_names) {
+ ++rds_resources_yet_to_fetch_;
+ auto route_config_watcher =
+ MakeRefCounted<RouteConfigWatcher>(resource_name, WeakRef());
+ rds_map_.emplace(resource_name, RdsUpdateState{route_config_watcher.get(),
+ y_absl::nullopt});
+ xds_client_->WatchRouteConfigData(resource_name,
+ std::move(route_config_watcher));
+ }
+ if (rds_resources_yet_to_fetch_ != 0) {
+ listener_watcher_ = std::move(listener_watcher);
+ listener_watcher = nullptr;
+ }
+ }
+ // Promote this filter chain match manager if all referenced resources are
+ // fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReadyLocked(this);
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ Orphan() {
+ MutexLock lock(&mu_);
+ // Cancel the RDS watches to clear up the weak refs
+ for (const auto& entry : rds_map_) {
+ xds_client_->CancelRouteConfigDataWatch(entry.first, entry.second.watcher,
+ false /* delay_unsubscription */);
+ }
+ // Also give up the ref on ListenerWatcher since it won't be needed anymore
+ listener_watcher_.reset();
+}
+
+y_absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ CreateOrGetXdsCertificateProviderFromFilterChainData(
+ const XdsApi::LdsUpdate::FilterChainData* filter_chain) {
+ MutexLock lock(&mu_);
+ auto it = certificate_providers_map_.find(filter_chain);
+ if (it != certificate_providers_map_.end()) {
+ return it->second.xds;
+ }
+ CertificateProviders certificate_providers;
+ // Configure root cert.
+ y_absl::string_view root_provider_instance_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .certificate_validation_context.ca_certificate_provider_instance
+ .instance_name;
+ y_absl::string_view root_provider_cert_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .certificate_validation_context.ca_certificate_provider_instance
+ .certificate_name;
+ if (!root_provider_instance_name.empty()) {
+ certificate_providers.root =
+ xds_client_->certificate_provider_store()
+ .CreateOrGetCertificateProvider(root_provider_instance_name);
+ if (certificate_providers.root == nullptr) {
+ return y_absl::NotFoundError(
+ y_absl::StrCat("Certificate provider instance name: \"",
+ root_provider_instance_name, "\" not recognized."));
+ }
+ }
+ // Configure identity cert.
+ y_absl::string_view identity_provider_instance_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .tls_certificate_provider_instance.instance_name;
+ y_absl::string_view identity_provider_cert_name =
+ filter_chain->downstream_tls_context.common_tls_context
+ .tls_certificate_provider_instance.certificate_name;
+ if (!identity_provider_instance_name.empty()) {
+ certificate_providers.instance =
+ xds_client_->certificate_provider_store()
+ .CreateOrGetCertificateProvider(identity_provider_instance_name);
+ if (certificate_providers.instance == nullptr) {
+ return y_absl::NotFoundError(
+ y_absl::StrCat("Certificate provider instance name: \"",
+ identity_provider_instance_name, "\" not recognized."));
+ }
+ }
+ certificate_providers.xds = MakeRefCounted<XdsCertificateProvider>();
+ certificate_providers.xds->UpdateRootCertNameAndDistributor(
+ "", root_provider_cert_name,
+ certificate_providers.root == nullptr
+ ? nullptr
+ : certificate_providers.root->distributor());
+ certificate_providers.xds->UpdateIdentityCertNameAndDistributor(
+ "", identity_provider_cert_name,
+ certificate_providers.instance == nullptr
+ ? nullptr
+ : certificate_providers.instance->distributor());
+ certificate_providers.xds->UpdateRequireClientCertificate(
+ "", filter_chain->downstream_tls_context.require_client_certificate);
+ auto xds_certificate_provider = certificate_providers.xds;
+ certificate_providers_map_.emplace(filter_chain,
+ std::move(certificate_providers));
+ return xds_certificate_provider;
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ OnRouteConfigChanged(const TString& resource_name,
+ XdsApi::RdsUpdate route_config) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ }
+ state.rds_update = std::move(route_config);
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
+ }
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::OnError(
+ const TString& resource_name, grpc_error_handle error) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ state.rds_update = grpc_error_to_absl_status(error);
+ } else {
+ // Prefer existing good version over current errored version
+ if (!state.rds_update->ok()) {
+ state.rds_update = grpc_error_to_absl_status(error);
+ }
+ }
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
+ }
+ GRPC_ERROR_UNREF(error);
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ OnResourceDoesNotExist(const TString& resource_name) {
+ RefCountedPtr<ListenerWatcher> listener_watcher;
+ {
+ MutexLock lock(&mu_);
+ auto& state = rds_map_[resource_name];
+ if (!state.rds_update.has_value()) {
+ if (--rds_resources_yet_to_fetch_ == 0) {
+ listener_watcher = std::move(listener_watcher_);
+ }
+ }
+ state.rds_update =
+ y_absl::NotFoundError("Requested route config does not exist");
+ }
+ // Promote the filter chain match manager object if all the referenced
+ // resources are fetched.
+ if (listener_watcher != nullptr) {
+ listener_watcher->PendingFilterChainMatchManagerReady(this);
}
- return false;
}
const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourcePort(
@@ -148,6 +820,26 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceIp(
return FindFilterChainDataForSourcePort(best_match->ports_map, port);
}
+bool IsLoopbackIp(const grpc_resolved_address* address) {
+ const grpc_sockaddr* sock_addr =
+ reinterpret_cast<const grpc_sockaddr*>(&address->addr);
+ if (sock_addr->sa_family == GRPC_AF_INET) {
+ const grpc_sockaddr_in* addr4 =
+ reinterpret_cast<const grpc_sockaddr_in*>(sock_addr);
+ if (addr4->sin_addr.s_addr == grpc_htonl(INADDR_LOOPBACK)) {
+ return true;
+ }
+ } else if (sock_addr->sa_family == GRPC_AF_INET6) {
+ const grpc_sockaddr_in6* addr6 =
+ reinterpret_cast<const grpc_sockaddr_in6*>(sock_addr);
+ if (memcmp(&addr6->sin6_addr, &in6addr_loopback,
+ sizeof(in6addr_loopback)) == 0) {
+ return true;
+ }
+ }
+ return false;
+}
+
const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceType(
const XdsApi::LdsUpdate::FilterChainMap::ConnectionSourceTypesArray&
source_types_array,
@@ -163,8 +855,14 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForSourceType(
return nullptr;
}
grpc_resolved_address source_addr;
- grpc_string_to_sockaddr(&source_addr, host.c_str(),
- 0 /* port doesn't matter here */);
+ grpc_error_handle error = grpc_string_to_sockaddr(
+ &source_addr, host.c_str(), 0 /* port doesn't matter here */);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_DEBUG, "Could not parse string to socket address: %s",
+ host.c_str());
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
// Use kAny only if kSameIporLoopback and kExternal are empty
if (source_types_array[static_cast<int>(
XdsApi::LdsUpdate::FilterChainMap::
@@ -208,8 +906,14 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForDestinationIp(
return nullptr;
}
grpc_resolved_address destination_addr;
- grpc_string_to_sockaddr(&destination_addr, host.c_str(),
- 0 /* port doesn't matter here */);
+ grpc_error_handle error = grpc_string_to_sockaddr(
+ &destination_addr, host.c_str(), 0 /* port doesn't matter here */);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_DEBUG, "Could not parse string to socket address: %s",
+ host.c_str());
+ GRPC_ERROR_UNREF(error);
+ return nullptr;
+ }
const XdsApi::LdsUpdate::FilterChainMap::DestinationIp* best_match = nullptr;
for (const auto& entry : destination_ip_vector) {
// Special case for catch-all
@@ -235,73 +939,9 @@ const XdsApi::LdsUpdate::FilterChainData* FindFilterChainDataForDestinationIp(
host);
}
-y_absl::StatusOr<RefCountedPtr<XdsCertificateProvider>>
-FilterChainMatchManager::CreateOrGetXdsCertificateProviderFromFilterChainData(
- const XdsApi::LdsUpdate::FilterChainData* filter_chain) {
- MutexLock lock(&mu_);
- auto it = certificate_providers_map_.find(filter_chain);
- if (it != certificate_providers_map_.end()) {
- return it->second.xds;
- }
- CertificateProviders certificate_providers;
- // Configure root cert.
- y_absl::string_view root_provider_instance_name =
- filter_chain->downstream_tls_context.common_tls_context
- .combined_validation_context
- .validation_context_certificate_provider_instance.instance_name;
- y_absl::string_view root_provider_cert_name =
- filter_chain->downstream_tls_context.common_tls_context
- .combined_validation_context
- .validation_context_certificate_provider_instance.certificate_name;
- if (!root_provider_instance_name.empty()) {
- certificate_providers.root =
- xds_client_->certificate_provider_store()
- .CreateOrGetCertificateProvider(root_provider_instance_name);
- if (certificate_providers.root == nullptr) {
- return y_absl::NotFoundError(
- y_absl::StrCat("Certificate provider instance name: \"",
- root_provider_instance_name, "\" not recognized."));
- }
- }
- // Configure identity cert.
- y_absl::string_view identity_provider_instance_name =
- filter_chain->downstream_tls_context.common_tls_context
- .tls_certificate_certificate_provider_instance.instance_name;
- y_absl::string_view identity_provider_cert_name =
- filter_chain->downstream_tls_context.common_tls_context
- .tls_certificate_certificate_provider_instance.certificate_name;
- if (!identity_provider_instance_name.empty()) {
- certificate_providers.instance =
- xds_client_->certificate_provider_store()
- .CreateOrGetCertificateProvider(identity_provider_instance_name);
- if (certificate_providers.instance == nullptr) {
- return y_absl::NotFoundError(
- y_absl::StrCat("Certificate provider instance name: \"",
- identity_provider_instance_name, "\" not recognized."));
- }
- }
- certificate_providers.xds = MakeRefCounted<XdsCertificateProvider>();
- certificate_providers.xds->UpdateRootCertNameAndDistributor(
- "", root_provider_cert_name,
- certificate_providers.root == nullptr
- ? nullptr
- : certificate_providers.root->distributor());
- certificate_providers.xds->UpdateIdentityCertNameAndDistributor(
- "", identity_provider_cert_name,
- certificate_providers.instance == nullptr
- ? nullptr
- : certificate_providers.instance->distributor());
- certificate_providers.xds->UpdateRequireClientCertificate(
- "", filter_chain->downstream_tls_context.require_client_certificate);
- auto xds_certificate_provider = certificate_providers.xds;
- certificate_providers_map_.emplace(filter_chain,
- std::move(certificate_providers));
- return xds_certificate_provider;
-}
-
-y_absl::StatusOr<grpc_channel_args*>
-FilterChainMatchManager::UpdateChannelArgsForConnection(grpc_channel_args* args,
- grpc_endpoint* tcp) {
+y_absl::StatusOr<grpc_channel_args*> XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::UpdateChannelArgsForConnection(
+ grpc_channel_args* args, grpc_endpoint* tcp) {
const auto* filter_chain = FindFilterChainDataForDestinationIp(
filter_chain_map_.destination_ip_vector, tcp);
if (filter_chain == nullptr && default_filter_chain_.has_value()) {
@@ -311,212 +951,298 @@ FilterChainMatchManager::UpdateChannelArgsForConnection(grpc_channel_args* args,
grpc_channel_args_destroy(args);
return y_absl::UnavailableError("No matching filter chain found");
}
- // Nothing to update if credentials are not xDS.
+ y_absl::InlinedVector<grpc_arg, 3> args_to_add;
+ RefCountedPtr<ServerConfigSelectorProvider> server_config_selector_provider;
+ RefCountedPtr<XdsChannelStackModifier> channel_stack_modifier;
+ RefCountedPtr<XdsCertificateProvider> xds_certificate_provider;
+ // Add config selector filter
+ if (XdsRbacEnabled()) {
+ std::vector<const grpc_channel_filter*> filters;
+ // Iterate the list of HTTP filters in reverse since in Core, received data
+ // flows *up* the stack.
+ for (auto reverse_iterator =
+ filter_chain->http_connection_manager.http_filters.rbegin();
+ reverse_iterator !=
+ filter_chain->http_connection_manager.http_filters.rend();
+ ++reverse_iterator) {
+ // Find filter. This is guaranteed to succeed, because it's checked
+ // at config validation time in the XdsApi code.
+ const XdsHttpFilterImpl* filter_impl =
+ XdsHttpFilterRegistry::GetFilterForType(
+ reverse_iterator->config.config_proto_type_name);
+ GPR_ASSERT(filter_impl != nullptr);
+ // Some filters like the router filter are no-op filters and do not have
+ // an implementation.
+ if (filter_impl->channel_filter() != nullptr) {
+ filters.push_back(filter_impl->channel_filter());
+ }
+ }
+ filters.push_back(&kServerConfigSelectorFilter);
+ channel_stack_modifier =
+ MakeRefCounted<XdsChannelStackModifier>(std::move(filters));
+ if (filter_chain->http_connection_manager.rds_update.has_value()) {
+ server_config_selector_provider =
+ MakeRefCounted<StaticXdsServerConfigSelectorProvider>(
+ filter_chain->http_connection_manager.rds_update.value(),
+ filter_chain->http_connection_manager.http_filters);
+ } else {
+ y_absl::StatusOr<XdsApi::RdsUpdate> initial_resource;
+ {
+ MutexLock lock(&mu_);
+ initial_resource =
+ rds_map_[filter_chain->http_connection_manager.route_config_name]
+ .rds_update.value();
+ }
+ server_config_selector_provider =
+ MakeRefCounted<DynamicXdsServerConfigSelectorProvider>(
+ xds_client_,
+ filter_chain->http_connection_manager.route_config_name,
+ std::move(initial_resource),
+ filter_chain->http_connection_manager.http_filters);
+ }
+ args_to_add.emplace_back(server_config_selector_provider->MakeChannelArg());
+ args_to_add.emplace_back(channel_stack_modifier->MakeChannelArg());
+ }
+ // Add XdsCertificateProvider if credentials are xDS.
grpc_server_credentials* server_creds =
grpc_find_server_credentials_in_args(args);
- if (server_creds == nullptr || server_creds->type() != kCredentialsTypeXds) {
- return args;
+ if (server_creds != nullptr && server_creds->type() == kCredentialsTypeXds) {
+ y_absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
+ CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
+ if (!result.ok()) {
+ grpc_channel_args_destroy(args);
+ return result.status();
+ }
+ xds_certificate_provider = std::move(*result);
+ GPR_ASSERT(xds_certificate_provider != nullptr);
+ args_to_add.emplace_back(xds_certificate_provider->MakeChannelArg());
}
- y_absl::StatusOr<RefCountedPtr<XdsCertificateProvider>> result =
- CreateOrGetXdsCertificateProviderFromFilterChainData(filter_chain);
- if (!result.ok()) {
+ if (!args_to_add.empty()) {
+ grpc_channel_args* updated_args = grpc_channel_args_copy_and_add(
+ args, args_to_add.data(), args_to_add.size());
grpc_channel_args_destroy(args);
- return result.status();
- }
- RefCountedPtr<XdsCertificateProvider> xds_certificate_provider =
- std::move(*result);
- GPR_ASSERT(xds_certificate_provider != nullptr);
- grpc_arg arg_to_add = xds_certificate_provider->MakeChannelArg();
- grpc_channel_args* updated_args =
- grpc_channel_args_copy_and_add(args, &arg_to_add, 1);
- grpc_channel_args_destroy(args);
- return updated_args;
-}
-
-class XdsServerConfigFetcher : public grpc_server_config_fetcher {
- public:
- explicit XdsServerConfigFetcher(RefCountedPtr<XdsClient> xds_client,
- grpc_server_xds_status_notifier notifier)
- : xds_client_(std::move(xds_client)), serving_status_notifier_(notifier) {
- GPR_ASSERT(xds_client_ != nullptr);
- }
-
- void StartWatch(TString listening_address, grpc_channel_args* args,
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- watcher) override {
- grpc_server_config_fetcher::WatcherInterface* watcher_ptr = watcher.get();
- auto listener_watcher = y_absl::make_unique<ListenerWatcher>(
- std::move(watcher), args, xds_client_, serving_status_notifier_,
- listening_address);
- auto* listener_watcher_ptr = listener_watcher.get();
- listening_address = y_absl::StrReplaceAll(
- xds_client_->bootstrap().server_listener_resource_name_template(),
- {{"%s", listening_address}});
- xds_client_->WatchListenerData(listening_address,
- std::move(listener_watcher));
- MutexLock lock(&mu_);
- auto& watcher_state = watchers_[watcher_ptr];
- watcher_state.listening_address = listening_address;
- watcher_state.listener_watcher = listener_watcher_ptr;
- }
-
- void CancelWatch(
- grpc_server_config_fetcher::WatcherInterface* watcher) override {
- MutexLock lock(&mu_);
- auto it = watchers_.find(watcher);
- if (it != watchers_.end()) {
- // Cancel the watch on the listener before erasing
- xds_client_->CancelListenerDataWatch(it->second.listening_address,
- it->second.listener_watcher,
- false /* delay_unsubscription */);
- watchers_.erase(it);
- }
+ args = updated_args;
}
+ return args;
+}
- // Return the interested parties from the xds client so that it can be polled.
- grpc_pollset_set* interested_parties() override {
- return xds_client_->interested_parties();
- }
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::XdsServerConfigSelector
+//
- private:
- class ListenerWatcher : public XdsClient::ListenerWatcherInterface {
- public:
- explicit ListenerWatcher(
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- server_config_watcher,
- grpc_channel_args* args, RefCountedPtr<XdsClient> xds_client,
- grpc_server_xds_status_notifier serving_status_notifier,
- TString listening_address)
- : server_config_watcher_(std::move(server_config_watcher)),
- args_(args),
- xds_client_(std::move(xds_client)),
- serving_status_notifier_(serving_status_notifier),
- listening_address_(std::move(listening_address)) {}
-
- ~ListenerWatcher() override { grpc_channel_args_destroy(args_); }
-
- // Deleted due to special handling required for args_. Copy the channel args
- // if we ever need these.
- ListenerWatcher(const ListenerWatcher&) = delete;
- ListenerWatcher& operator=(const ListenerWatcher&) = delete;
-
- void OnListenerChanged(XdsApi::LdsUpdate listener) override {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_server_config_fetcher_trace)) {
- gpr_log(
- GPR_INFO,
- "[ListenerWatcher %p] Received LDS update from xds client %p: %s",
- this, xds_client_.get(), listener.ToString().c_str());
+y_absl::StatusOr<
+ RefCountedPtr<XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::XdsServerConfigSelector>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ XdsServerConfigSelector::Create(
+ XdsApi::RdsUpdate rds_update,
+ const std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>&
+ http_filters) {
+ auto config_selector = MakeRefCounted<XdsServerConfigSelector>();
+ for (auto& vhost : rds_update.virtual_hosts) {
+ config_selector->virtual_hosts_.emplace_back();
+ auto& virtual_host = config_selector->virtual_hosts_.back();
+ virtual_host.domains = std::move(vhost.domains);
+ for (auto& route : vhost.routes) {
+ virtual_host.routes.emplace_back();
+ auto& config_selector_route = virtual_host.routes.back();
+ config_selector_route.matchers = std::move(route.matchers);
+ config_selector_route.unsupported_action =
+ y_absl::get_if<XdsApi::Route::NonForwardingAction>(&route.action) ==
+ nullptr;
+ XdsRouting::GeneratePerHttpFilterConfigsResult result =
+ XdsRouting::GeneratePerHTTPFilterConfigs(http_filters, vhost, route,
+ nullptr, nullptr);
+ if (result.error != GRPC_ERROR_NONE) {
+ return grpc_error_to_absl_status(result.error);
}
- if (listener.address != listening_address_) {
- OnFatalError(y_absl::FailedPreconditionError(
- "Address in LDS update does not match listening address"));
- return;
+ std::vector<TString> fields;
+ fields.reserve(result.per_filter_configs.size());
+ for (const auto& p : result.per_filter_configs) {
+ fields.emplace_back(y_absl::StrCat(" \"", p.first, "\": [\n",
+ y_absl::StrJoin(p.second, ",\n"),
+ "\n ]"));
}
- if (filter_chain_match_manager_ == nullptr) {
- if (serving_status_notifier_.on_serving_status_change != nullptr) {
- serving_status_notifier_.on_serving_status_change(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- GRPC_STATUS_OK, "");
- } else {
- gpr_log(GPR_INFO,
- "xDS Listener resource obtained; will start serving on %s",
- listening_address_.c_str());
- }
- }
- if (filter_chain_match_manager_ == nullptr ||
- !(listener.filter_chain_map ==
- filter_chain_match_manager_->filter_chain_map() &&
- listener.default_filter_chain ==
- filter_chain_match_manager_->default_filter_chain())) {
- filter_chain_match_manager_ = MakeRefCounted<FilterChainMatchManager>(
- xds_client_, std::move(listener.filter_chain_map),
- std::move(listener.default_filter_chain));
- server_config_watcher_->UpdateConnectionManager(
- filter_chain_match_manager_);
+ if (!fields.empty()) {
+ TString json = y_absl::StrCat(
+ "{\n"
+ " \"methodConfig\": [ {\n"
+ " \"name\": [\n"
+ " {}\n"
+ " ],\n"
+ " ",
+ y_absl::StrJoin(fields, ",\n"),
+ "\n } ]\n"
+ "}");
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ config_selector_route.method_config =
+ ServiceConfig::Create(result.args, json.c_str(), &error);
+ GPR_ASSERT(error == GRPC_ERROR_NONE);
}
+ grpc_channel_args_destroy(result.args);
}
+ }
+ return config_selector;
+}
- void OnError(grpc_error* error) override {
- if (filter_chain_match_manager_ != nullptr) {
- gpr_log(GPR_ERROR,
- "ListenerWatcher:%p XdsClient reports error: %s for %s; "
- "ignoring in favor of existing resource",
- this, grpc_error_string(error), listening_address_.c_str());
- } else {
- if (serving_status_notifier_.on_serving_status_change != nullptr) {
- serving_status_notifier_.on_serving_status_change(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- GRPC_STATUS_UNAVAILABLE, grpc_error_string(error));
- } else {
- gpr_log(
- GPR_ERROR,
- "ListenerWatcher:%p error obtaining xDS Listener resource: %s; "
- "not serving on %s",
- this, grpc_error_string(error), listening_address_.c_str());
- }
- }
- GRPC_ERROR_UNREF(error);
+ServerConfigSelector::CallConfig XdsServerConfigFetcher::ListenerWatcher::
+ FilterChainMatchManager::XdsServerConfigSelector::GetCallConfig(
+ grpc_metadata_batch* metadata) {
+ CallConfig call_config;
+ if (metadata->legacy_index()->named.path == nullptr) {
+ call_config.error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("No path found");
+ return call_config;
+ }
+ y_absl::string_view path = StringViewFromSlice(
+ GRPC_MDVALUE(metadata->legacy_index()->named.path->md));
+ if (metadata->legacy_index()->named.authority == nullptr) {
+ call_config.error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No authority found");
+ return call_config;
+ }
+ y_absl::string_view authority = StringViewFromSlice(
+ GRPC_MDVALUE(metadata->legacy_index()->named.authority->md));
+ auto vhost_index = XdsRouting::FindVirtualHostForDomain(
+ VirtualHostListIterator(&virtual_hosts_), authority);
+ if (!vhost_index.has_value()) {
+ call_config.error =
+ grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "could not find VirtualHost for ", authority,
+ " in RouteConfiguration")),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+ }
+ auto& virtual_host = virtual_hosts_[vhost_index.value()];
+ auto route_index = XdsRouting::GetRouteForRequest(
+ VirtualHost::RouteListIterator(&virtual_host.routes), path, metadata);
+ if (route_index.has_value()) {
+ auto& route = virtual_host.routes[route_index.value()];
+ // Found the matching route
+ if (route.unsupported_action) {
+ call_config.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Matching route has unsupported action"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
}
-
- void OnFatalError(y_absl::Status status) {
- gpr_log(
- GPR_ERROR,
- "ListenerWatcher:%p Encountered fatal error %s; not serving on %s",
- this, status.ToString().c_str(), listening_address_.c_str());
- if (filter_chain_match_manager_ != nullptr) {
- // The server has started listening already, so we need to gracefully
- // stop serving.
- server_config_watcher_->StopServing();
- filter_chain_match_manager_.reset();
- }
- if (serving_status_notifier_.on_serving_status_change != nullptr) {
- serving_status_notifier_.on_serving_status_change(
- serving_status_notifier_.user_data, listening_address_.c_str(),
- static_cast<grpc_status_code>(status.raw_code()),
- TString(status.message()).c_str());
- }
+ if (route.method_config != nullptr) {
+ call_config.method_configs =
+ route.method_config->GetMethodParsedConfigVector(grpc_empty_slice());
+ call_config.service_config = route.method_config;
}
+ return call_config;
+ }
+ call_config.error = grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("No route matched"),
+ GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
+ return call_config;
+}
- void OnResourceDoesNotExist() override {
- OnFatalError(y_absl::NotFoundError("Requested listener does not exist"));
- }
+//
+// XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::DynamicXdsServerConfigSelectorProvider
+//
- private:
- std::unique_ptr<grpc_server_config_fetcher::WatcherInterface>
- server_config_watcher_;
- grpc_channel_args* args_;
- RefCountedPtr<XdsClient> xds_client_;
- grpc_server_xds_status_notifier serving_status_notifier_;
- TString listening_address_;
- RefCountedPtr<FilterChainMatchManager> filter_chain_match_manager_;
- };
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::
+ DynamicXdsServerConfigSelectorProvider(
+ RefCountedPtr<XdsClient> xds_client, TString resource_name,
+ y_absl::StatusOr<XdsApi::RdsUpdate> initial_resource,
+ std::vector<XdsApi::LdsUpdate::HttpConnectionManager::HttpFilter>
+ http_filters)
+ : xds_client_(std::move(xds_client)),
+ resource_name_(std::move(resource_name)),
+ http_filters_(std::move(http_filters)),
+ resource_(std::move(initial_resource)) {
+ GPR_ASSERT(!resource_name_.empty());
+ auto route_config_watcher = MakeRefCounted<RouteConfigWatcher>(Ref());
+ route_config_watcher_ = route_config_watcher.get();
+ xds_client_->WatchRouteConfigData(resource_name_,
+ std::move(route_config_watcher));
+}
- struct WatcherState {
- TString listening_address;
- ListenerWatcher* listener_watcher = nullptr;
- };
+y_absl::StatusOr<RefCountedPtr<ServerConfigSelector>>
+XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::Watch(
+ std::unique_ptr<
+ ServerConfigSelectorProvider::ServerConfigSelectorWatcher>
+ watcher) {
+ y_absl::StatusOr<XdsApi::RdsUpdate> resource;
+ {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(watcher_ == nullptr);
+ watcher_ = std::move(watcher);
+ resource = resource_;
+ }
+ if (!resource.ok()) {
+ return resource.status();
+ }
+ return XdsServerConfigSelector::Create(resource.value(), http_filters_);
+}
- RefCountedPtr<XdsClient> xds_client_;
- grpc_server_xds_status_notifier serving_status_notifier_;
- Mutex mu_;
- std::map<grpc_server_config_fetcher::WatcherInterface*, WatcherState>
- watchers_;
-};
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::CancelWatch() {
+ xds_client_->CancelRouteConfigDataWatch(resource_name_, route_config_watcher_,
+ false /* delay_unsubscription */);
+ MutexLock lock(&mu_);
+ watcher_.reset();
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnRouteConfigChanged(
+ XdsApi::RdsUpdate rds_update) {
+ MutexLock lock(&mu_);
+ resource_ = std::move(rds_update);
+ if (watcher_ == nullptr) {
+ return;
+ }
+ watcher_->OnServerConfigSelectorUpdate(
+ XdsServerConfigSelector::Create(*resource_, http_filters_));
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnError(grpc_error_handle error) {
+ MutexLock lock(&mu_);
+ // Prefer existing good update.
+ if (resource_.ok()) {
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ resource_ = grpc_error_to_absl_status(error);
+ GRPC_ERROR_UNREF(error);
+ if (watcher_ == nullptr) {
+ return;
+ }
+ watcher_->OnServerConfigSelectorUpdate(resource_.status());
+}
+
+void XdsServerConfigFetcher::ListenerWatcher::FilterChainMatchManager::
+ DynamicXdsServerConfigSelectorProvider::OnResourceDoesNotExist() {
+ MutexLock lock(&mu_);
+ resource_ = y_absl::NotFoundError("Requested route config does not exist");
+ if (watcher_ == nullptr) {
+ return;
+ }
+ watcher_->OnServerConfigSelectorUpdate(resource_.status());
+}
} // namespace
} // namespace grpc_core
grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create(
- grpc_server_xds_status_notifier notifier) {
+ grpc_server_xds_status_notifier notifier, const grpc_channel_args* args) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
+ args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
GRPC_API_TRACE("grpc_server_config_fetcher_xds_create()", 0, ());
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::RefCountedPtr<grpc_core::XdsClient> xds_client =
- grpc_core::XdsClient::GetOrCreate(&error);
+ grpc_core::XdsClient::GetOrCreate(args, &error);
+ grpc_channel_args_destroy(args);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Failed to create xds client: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return nullptr;
}
diff --git a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
index e12e134cb95..6e637b3aa5e 100644
--- a/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/core/lib/.yandex_meta/licenses.list.txt
@@ -47,11 +47,15 @@
====================COPYRIGHT====================
+ * Copyright 2019 gRPC authors.
+
+
+====================COPYRIGHT====================
* Copyright 2020 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+// Copyright 2021 The gRPC Authors
====================COPYRIGHT====================
diff --git a/contrib/libs/grpc/src/core/lib/CMakeLists.txt b/contrib/libs/grpc/src/core/lib/CMakeLists.txt
index 7ec217b8dc1..2d6c9d71759 100644
--- a/contrib/libs/grpc/src/core/lib/CMakeLists.txt
+++ b/contrib/libs/grpc/src/core/lib/CMakeLists.txt
@@ -18,20 +18,26 @@ target_include_directories(src-core-lib PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/include
${CMAKE_BINARY_DIR}/contrib/libs/grpc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/third_party/upb
)
target_link_libraries(src-core-lib PUBLIC
contrib-libs-cxxsupp
yutil
+ grpc-third_party-upb
ybase-internal-spinlock_wait
abseil-cpp-tstring-y_absl-container
abseil-cpp-tstring-y_absl-memory
yabseil-cpp-tstring-y_absl-status
yabseil-cpp-tstring-y_absl-strings
+ yabsl-strings-cord
ystrings-internal-str_format
yabseil-cpp-tstring-y_absl-synchronization
yabseil-cpp-tstring-y_absl-time
)
target_sources(src-core-lib PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/protobuf/any.upb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/ext/upb-generated/google/rpc/status.upb.c
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/alloc.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/atm.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/cpu_iphone.cc
@@ -59,7 +65,6 @@ target_sources(src-core-lib PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/time_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/time_precise.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/time_windows.cc
- ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/tmpfile_msys.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gpr/tmpfile_windows.cc
@@ -72,6 +77,7 @@ target_sources(src-core-lib PRIVATE
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/stat_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/stat_windows.cc
+ ${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc
${CMAKE_SOURCE_DIR}/contrib/libs/grpc/src/core/lib/gprpp/time_util.cc
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc b/contrib/libs/grpc/src/core/lib/address_utils/parse_address.cc
index 701a24c03e9..eaaa168fa7c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.cc
+++ b/contrib/libs/grpc/src/core/lib/address_utils/parse_address.cc
@@ -18,7 +18,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/parse_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include <stdio.h>
#include <string.h>
@@ -52,10 +52,10 @@ bool grpc_parse_unix(const grpc_core::URI& uri,
uri.scheme().c_str());
return false;
}
- grpc_error* error =
+ grpc_error_handle error =
grpc_core::UnixSockaddrPopulate(uri.path(), resolved_addr);
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "%s", grpc_error_string(error));
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return false;
}
@@ -69,10 +69,10 @@ bool grpc_parse_unix_abstract(const grpc_core::URI& uri,
uri.scheme().c_str());
return false;
}
- grpc_error* error =
+ grpc_error_handle error =
grpc_core::UnixAbstractSockaddrPopulate(uri.path(), resolved_addr);
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "%s", grpc_error_string(error));
+ gpr_log(GPR_ERROR, "%s", grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return false;
}
@@ -81,16 +81,15 @@ bool grpc_parse_unix_abstract(const grpc_core::URI& uri,
namespace grpc_core {
-grpc_error* UnixSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr) {
+grpc_error_handle UnixSockaddrPopulate(y_absl::string_view path,
+ grpc_resolved_address* resolved_addr) {
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
struct sockaddr_un* un =
reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
const size_t maxlen = sizeof(un->sun_path) - 1;
if (path.size() > maxlen) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Path name should not have more than ", maxlen,
- " characters")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Path name should not have more than ", maxlen, " characters"));
}
un->sun_family = AF_UNIX;
path.copy(un->sun_path, path.size());
@@ -99,16 +98,15 @@ grpc_error* UnixSockaddrPopulate(y_absl::string_view path,
return GRPC_ERROR_NONE;
}
-grpc_error* UnixAbstractSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr) {
+grpc_error_handle UnixAbstractSockaddrPopulate(
+ y_absl::string_view path, grpc_resolved_address* resolved_addr) {
+ memset(resolved_addr, 0, sizeof(*resolved_addr));
struct sockaddr_un* un =
reinterpret_cast<struct sockaddr_un*>(resolved_addr->addr);
const size_t maxlen = sizeof(un->sun_path) - 1;
if (path.size() > maxlen) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Path name should not have more than ", maxlen,
- " characters")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Path name should not have more than ", maxlen, " characters"));
}
un->sun_family = AF_UNIX;
un->sun_path[0] = '\0';
@@ -122,25 +120,25 @@ grpc_error* UnixAbstractSockaddrPopulate(y_absl::string_view path,
#else /* GRPC_HAVE_UNIX_SOCKET */
-bool grpc_parse_unix(const grpc_core::URI& uri,
- grpc_resolved_address* resolved_addr) {
+bool grpc_parse_unix(const grpc_core::URI& /* uri */,
+ grpc_resolved_address* /* resolved_addr */) {
abort();
}
-bool grpc_parse_unix_abstract(const grpc_core::URI& uri,
- grpc_resolved_address* resolved_addr) {
+bool grpc_parse_unix_abstract(const grpc_core::URI& /* uri */,
+ grpc_resolved_address* /* resolved_addr */) {
abort();
}
namespace grpc_core {
-grpc_error* UnixSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr) {
+grpc_error_handle UnixSockaddrPopulate(
+ y_absl::string_view /* path */, grpc_resolved_address* /* resolved_addr */) {
abort();
}
-grpc_error* UnixAbstractSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr) {
+grpc_error_handle UnixAbstractSockaddrPopulate(
+ y_absl::string_view /* path */, grpc_resolved_address* /* resolved_addr */) {
abort();
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h b/contrib/libs/grpc/src/core/lib/address_utils/parse_address.h
index b841a75c40f..e6e9ffcbfa3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/parse_address.h
+++ b/contrib/libs/grpc/src/core/lib/address_utils/parse_address.h
@@ -16,8 +16,8 @@
*
*/
-#ifndef GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
-#define GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H
+#ifndef GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H
+#define GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H
#include <grpc/support/port_platform.h>
@@ -64,14 +64,14 @@ uint16_t grpc_strhtons(const char* port);
namespace grpc_core {
/** Populate \a resolved_addr to be a unix socket at |path| */
-grpc_error* UnixSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr);
+grpc_error_handle UnixSockaddrPopulate(y_absl::string_view path,
+ grpc_resolved_address* resolved_addr);
/** Populate \a resolved_addr to be a unix socket in the abstract namespace
* at |path| */
-grpc_error* UnixAbstractSockaddrPopulate(y_absl::string_view path,
- grpc_resolved_address* resolved_addr);
+grpc_error_handle UnixAbstractSockaddrPopulate(
+ y_absl::string_view path, grpc_resolved_address* resolved_addr);
} // namespace grpc_core
-#endif /* GRPC_CORE_LIB_IOMGR_PARSE_ADDRESS_H */
+#endif /* GRPC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc b/contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.cc
index cb7050df166..5e7229cd26c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.cc
@@ -18,7 +18,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include <errno.h>
#include <inttypes.h>
@@ -29,11 +29,13 @@
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
+#include <grpc/event_engine/event_engine.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/iomgr/event_engine/resolved_address_internal.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
@@ -198,8 +200,8 @@ TString grpc_sockaddr_to_string(const grpc_resolved_address* resolved_addr,
return out;
}
-void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
- int port) {
+grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
+ const char* addr, int port) {
memset(out, 0, sizeof(grpc_resolved_address));
grpc_sockaddr_in6* addr6 = reinterpret_cast<grpc_sockaddr_in6*>(out->addr);
grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(out->addr);
@@ -210,25 +212,8 @@ void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
addr4->sin_family = GRPC_AF_INET;
out->len = sizeof(grpc_sockaddr_in);
} else {
- GPR_ASSERT(0);
- }
- grpc_sockaddr_set_port(out, port);
-}
-
-grpc_error* grpc_string_to_sockaddr_new(grpc_resolved_address* out,
- const char* addr, int port) {
- memset(out, 0, sizeof(grpc_resolved_address));
- grpc_sockaddr_in6* addr6 = reinterpret_cast<grpc_sockaddr_in6*>(out->addr);
- grpc_sockaddr_in* addr4 = reinterpret_cast<grpc_sockaddr_in*>(out->addr);
- if (grpc_inet_pton(GRPC_AF_INET6, addr, &addr6->sin6_addr) == 1) {
- addr6->sin6_family = GRPC_AF_INET6;
- out->len = sizeof(grpc_sockaddr_in6);
- } else if (grpc_inet_pton(GRPC_AF_INET, addr, &addr4->sin_addr) == 1) {
- addr4->sin_family = GRPC_AF_INET;
- out->len = sizeof(grpc_sockaddr_in);
- } else {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to parse address:", addr).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Failed to parse address:", addr));
}
grpc_sockaddr_set_port(out, port);
return GRPC_ERROR_NONE;
@@ -414,3 +399,14 @@ bool grpc_sockaddr_match_subnet(const grpc_resolved_address* address,
}
return false;
}
+
+namespace grpc_event_engine {
+namespace experimental {
+
+TString ResolvedAddressToURI(const EventEngine::ResolvedAddress& addr) {
+ auto gra = CreateGRPCResolvedAddress(addr);
+ return grpc_sockaddr_to_uri(&gra);
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h b/contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.h
index c823aaed384..ddfebfa8c1c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_utils.h
+++ b/contrib/libs/grpc/src/core/lib/address_utils/sockaddr_utils.h
@@ -16,13 +16,15 @@
*
*/
-#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H
-#define GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H
+#ifndef GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H
+#define GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H
#include <grpc/support/port_platform.h>
#include <util/generic/string.h>
+#include <grpc/event_engine/event_engine.h>
+
#include "src/core/lib/iomgr/resolve_address.h"
/* Returns true if addr is an IPv4-mapped IPv6 address within the
@@ -64,17 +66,12 @@ int grpc_sockaddr_set_port(grpc_resolved_address* addr, int port);
// If the normalize flag is enabled, ::ffff:0.0.0.0/96 IPv6 addresses are
// displayed as plain IPv4.
TString grpc_sockaddr_to_string(const grpc_resolved_address* addr,
- bool normalize);
-
-// TODO(yashykt): Remove this function and replace usages with
-// `grpc_string_to_sockaddr_new`
-void grpc_string_to_sockaddr(grpc_resolved_address* out, const char* addr,
- int port);
+ bool normalize) GRPC_MUST_USE_RESULT;
// Newer form of grpc_string_to_sockaddr which returns an error instead of
// crashing if \a addr is not IPv6/IPv6
-grpc_error* grpc_string_to_sockaddr_new(grpc_resolved_address* out,
- const char* addr, int port);
+grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address* out,
+ const char* addr, int port);
/* Returns the URI string corresponding to \a addr */
TString grpc_sockaddr_to_uri(const grpc_resolved_address* addr);
@@ -102,4 +99,12 @@ bool grpc_sockaddr_match_subnet(const grpc_resolved_address* address,
const grpc_resolved_address* subnet_address,
uint32_t mask_bits);
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_UTILS_H */
+namespace grpc_event_engine {
+namespace experimental {
+
+TString ResolvedAddressToURI(const EventEngine::ResolvedAddress& addr);
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif /* GRPC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H */
diff --git a/contrib/libs/grpc/src/core/lib/avl/avl.cc b/contrib/libs/grpc/src/core/lib/avl/avl.cc
deleted file mode 100644
index e04fe35b197..00000000000
--- a/contrib/libs/grpc/src/core/lib/avl/avl.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/avl/avl.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/useful.h"
-
-grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable) {
- grpc_avl out;
- out.vtable = vtable;
- out.root = nullptr;
- return out;
-}
-
-static grpc_avl_node* ref_node(grpc_avl_node* node) {
- if (node) {
- gpr_ref(&node->refs);
- }
- return node;
-}
-
-static void unref_node(const grpc_avl_vtable* vtable, grpc_avl_node* node,
- void* user_data) {
- if (node == nullptr) {
- return;
- }
- if (gpr_unref(&node->refs)) {
- vtable->destroy_key(node->key, user_data);
- vtable->destroy_value(node->value, user_data);
- unref_node(vtable, node->left, user_data);
- unref_node(vtable, node->right, user_data);
- gpr_free(node);
- }
-}
-
-static long node_height(grpc_avl_node* node) {
- return node == nullptr ? 0 : node->height;
-}
-
-#ifndef NDEBUG
-static long calculate_height(grpc_avl_node* node) {
- return node == nullptr ? 0
- : 1 + GPR_MAX(calculate_height(node->left),
- calculate_height(node->right));
-}
-
-static grpc_avl_node* assert_invariants(grpc_avl_node* n) {
- if (n == nullptr) return nullptr;
- assert_invariants(n->left);
- assert_invariants(n->right);
- assert(calculate_height(n) == n->height);
- assert(labs(node_height(n->left) - node_height(n->right)) <= 1);
- return n;
-}
-#else
-static grpc_avl_node* assert_invariants(grpc_avl_node* n) { return n; }
-#endif
-
-grpc_avl_node* new_node(void* key, void* value, grpc_avl_node* left,
- grpc_avl_node* right) {
- grpc_avl_node* node = static_cast<grpc_avl_node*>(gpr_malloc(sizeof(*node)));
- gpr_ref_init(&node->refs, 1);
- node->key = key;
- node->value = value;
- node->left = assert_invariants(left);
- node->right = assert_invariants(right);
- node->height = 1 + GPR_MAX(node_height(left), node_height(right));
- return node;
-}
-
-static grpc_avl_node* get(const grpc_avl_vtable* vtable, grpc_avl_node* node,
- void* key, void* user_data) {
- long cmp;
-
- if (node == nullptr) {
- return nullptr;
- }
-
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- return node;
- } else if (cmp > 0) {
- return get(vtable, node->left, key, user_data);
- } else {
- return get(vtable, node->right, key, user_data);
- }
-}
-
-void* grpc_avl_get(grpc_avl avl, void* key, void* user_data) {
- grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
- return node ? node->value : nullptr;
-}
-
-int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data) {
- grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
- if (node != nullptr) {
- *value = node->value;
- return 1;
- }
- return 0;
-}
-
-static grpc_avl_node* rotate_left(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- grpc_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
- vtable->copy_value(right->value, user_data),
- new_node(key, value, left, ref_node(right->left)),
- ref_node(right->right));
- unref_node(vtable, right, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_right(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- grpc_avl_node* n =
- new_node(vtable->copy_key(left->key, user_data),
- vtable->copy_value(left->value, user_data), ref_node(left->left),
- new_node(key, value, ref_node(left->right), right));
- unref_node(vtable, left, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_left_right(const grpc_avl_vtable* vtable,
- void* key, void* value,
- grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- /* rotate_right(..., rotate_left(left), right) */
- grpc_avl_node* n =
- new_node(vtable->copy_key(left->right->key, user_data),
- vtable->copy_value(left->right->value, user_data),
- new_node(vtable->copy_key(left->key, user_data),
- vtable->copy_value(left->value, user_data),
- ref_node(left->left), ref_node(left->right->left)),
- new_node(key, value, ref_node(left->right->right), right));
- unref_node(vtable, left, user_data);
- return n;
-}
-
-static grpc_avl_node* rotate_right_left(const grpc_avl_vtable* vtable,
- void* key, void* value,
- grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- /* rotate_left(..., left, rotate_right(right)) */
- grpc_avl_node* n =
- new_node(vtable->copy_key(right->left->key, user_data),
- vtable->copy_value(right->left->value, user_data),
- new_node(key, value, left, ref_node(right->left->left)),
- new_node(vtable->copy_key(right->key, user_data),
- vtable->copy_value(right->value, user_data),
- ref_node(right->left->right), ref_node(right->right)));
- unref_node(vtable, right, user_data);
- return n;
-}
-
-static grpc_avl_node* rebalance(const grpc_avl_vtable* vtable, void* key,
- void* value, grpc_avl_node* left,
- grpc_avl_node* right, void* user_data) {
- switch (node_height(left) - node_height(right)) {
- case 2:
- if (node_height(left->left) - node_height(left->right) == -1) {
- return assert_invariants(
- rotate_left_right(vtable, key, value, left, right, user_data));
- } else {
- return assert_invariants(
- rotate_right(vtable, key, value, left, right, user_data));
- }
- case -2:
- if (node_height(right->left) - node_height(right->right) == 1) {
- return assert_invariants(
- rotate_right_left(vtable, key, value, left, right, user_data));
- } else {
- return assert_invariants(
- rotate_left(vtable, key, value, left, right, user_data));
- }
- default:
- return assert_invariants(new_node(key, value, left, right));
- }
-}
-
-static grpc_avl_node* add_key(const grpc_avl_vtable* vtable,
- grpc_avl_node* node, void* key, void* value,
- void* user_data) {
- long cmp;
- if (node == nullptr) {
- return new_node(key, value, nullptr, nullptr);
- }
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- return new_node(key, value, ref_node(node->left), ref_node(node->right));
- } else if (cmp > 0) {
- return rebalance(vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data),
- add_key(vtable, node->left, key, value, user_data),
- ref_node(node->right), user_data);
- } else {
- return rebalance(
- vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data), ref_node(node->left),
- add_key(vtable, node->right, key, value, user_data), user_data);
- }
-}
-
-grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data) {
- grpc_avl_node* old_root = avl.root;
- avl.root = add_key(avl.vtable, avl.root, key, value, user_data);
- assert_invariants(avl.root);
- unref_node(avl.vtable, old_root, user_data);
- return avl;
-}
-
-static grpc_avl_node* in_order_head(grpc_avl_node* node) {
- while (node->left != nullptr) {
- node = node->left;
- }
- return node;
-}
-
-static grpc_avl_node* in_order_tail(grpc_avl_node* node) {
- while (node->right != nullptr) {
- node = node->right;
- }
- return node;
-}
-
-static grpc_avl_node* remove_key(const grpc_avl_vtable* vtable,
- grpc_avl_node* node, void* key,
- void* user_data) {
- long cmp;
- if (node == nullptr) {
- return nullptr;
- }
- cmp = vtable->compare_keys(node->key, key, user_data);
- if (cmp == 0) {
- if (node->left == nullptr) {
- return ref_node(node->right);
- } else if (node->right == nullptr) {
- return ref_node(node->left);
- } else if (node->left->height < node->right->height) {
- grpc_avl_node* h = in_order_head(node->right);
- return rebalance(
- vtable, vtable->copy_key(h->key, user_data),
- vtable->copy_value(h->value, user_data), ref_node(node->left),
- remove_key(vtable, node->right, h->key, user_data), user_data);
- } else {
- grpc_avl_node* h = in_order_tail(node->left);
- return rebalance(vtable, vtable->copy_key(h->key, user_data),
- vtable->copy_value(h->value, user_data),
- remove_key(vtable, node->left, h->key, user_data),
- ref_node(node->right), user_data);
- }
- } else if (cmp > 0) {
- return rebalance(vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data),
- remove_key(vtable, node->left, key, user_data),
- ref_node(node->right), user_data);
- } else {
- return rebalance(
- vtable, vtable->copy_key(node->key, user_data),
- vtable->copy_value(node->value, user_data), ref_node(node->left),
- remove_key(vtable, node->right, key, user_data), user_data);
- }
-}
-
-grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data) {
- grpc_avl_node* old_root = avl.root;
- avl.root = remove_key(avl.vtable, avl.root, key, user_data);
- assert_invariants(avl.root);
- unref_node(avl.vtable, old_root, user_data);
- return avl;
-}
-
-grpc_avl grpc_avl_ref(grpc_avl avl, void* /*user_data*/) {
- ref_node(avl.root);
- return avl;
-}
-
-void grpc_avl_unref(grpc_avl avl, void* user_data) {
- unref_node(avl.vtable, avl.root, user_data);
-}
-
-int grpc_avl_is_empty(grpc_avl avl) { return avl.root == nullptr; }
diff --git a/contrib/libs/grpc/src/core/lib/avl/avl.h b/contrib/libs/grpc/src/core/lib/avl/avl.h
index 15a9d569471..9771d845a9f 100644
--- a/contrib/libs/grpc/src/core/lib/avl/avl.h
+++ b/contrib/libs/grpc/src/core/lib/avl/avl.h
@@ -1,94 +1,395 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
#ifndef GRPC_CORE_LIB_AVL_AVL_H
#define GRPC_CORE_LIB_AVL_AVL_H
#include <grpc/support/port_platform.h>
-#include <grpc/support/sync.h>
-
-/** internal node of an AVL tree */
-typedef struct grpc_avl_node {
- gpr_refcount refs;
- void* key;
- void* value;
- struct grpc_avl_node* left;
- struct grpc_avl_node* right;
- long height;
-} grpc_avl_node;
-
-/** vtable for the AVL tree
- * The optional user_data is propagated from the top level grpc_avl_XXX API.
- * From the same API call, multiple vtable functions may be called multiple
- * times.
- */
-typedef struct grpc_avl_vtable {
- /** destroy a key */
- void (*destroy_key)(void* key, void* user_data);
- /** copy a key, returning new value */
- void* (*copy_key)(void* key, void* user_data);
- /** compare key1, key2; return <0 if key1 < key2,
- >0 if key1 > key2, 0 if key1 == key2 */
- long (*compare_keys)(void* key1, void* key2, void* user_data);
- /** destroy a value */
- void (*destroy_value)(void* value, void* user_data);
- /** copy a value */
- void* (*copy_value)(void* value, void* user_data);
-} grpc_avl_vtable;
-
-/** "pointer" to an AVL tree - this is a reference
- counted object - use grpc_avl_ref to add a reference,
- grpc_avl_unref when done with a reference */
-typedef struct grpc_avl {
- const grpc_avl_vtable* vtable;
- grpc_avl_node* root;
-} grpc_avl;
-
-/** Create an immutable AVL tree. */
-grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable);
-/** Add a reference to an existing tree - returns
- the tree as a convenience. The optional user_data will be passed to vtable
- functions. */
-grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data);
-/** Remove a reference to a tree - destroying it if there
- are no references left. The optional user_data will be passed to vtable
- functions. */
-void grpc_avl_unref(grpc_avl avl, void* user_data);
-/** Return a new tree with (key, value) added to avl.
- implicitly unrefs avl to allow easy chaining.
- if key exists in avl, the new tree's key entry updated
- (i.e. a duplicate is not created). The optional user_data will be passed to
- vtable functions. */
-grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data);
-/** Return a new tree with key deleted
- implicitly unrefs avl to allow easy chaining. The optional user_data will be
- passed to vtable functions. */
-grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data);
-/** Lookup key, and return the associated value.
- Does not mutate avl.
- Returns NULL if key is not found. The optional user_data will be passed to
- vtable functions.*/
-void* grpc_avl_get(grpc_avl avl, void* key, void* user_data);
-/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
- its value. The optional user_data will be passed to vtable functions. */
-int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data);
-/** Return 1 if avl is empty, 0 otherwise */
-int grpc_avl_is_empty(grpc_avl avl);
-
-#endif /* GRPC_CORE_LIB_AVL_AVL_H */
+#include <stdlib.h>
+
+#include <algorithm>
+#include <memory>
+
+namespace grpc_core {
+
+template <class K, class V = void>
+class AVL {
+ public:
+ AVL() {}
+
+ AVL Add(K key, V value) const {
+ return AVL(AddKey(root_, std::move(key), std::move(value)));
+ }
+ AVL Remove(const K& key) const { return AVL(RemoveKey(root_, key)); }
+ const V* Lookup(const K& key) const {
+ NodePtr n = Get(root_, key);
+ return n ? &n->kv.second : nullptr;
+ }
+
+ const std::pair<K, V>* LookupBelow(const K& key) const {
+ NodePtr n = GetBelow(root_, *key);
+ return n ? &n->kv : nullptr;
+ }
+
+ bool Empty() const { return root_ == nullptr; }
+
+ template <class F>
+ void ForEach(F&& f) const {
+ ForEachImpl(root_.get(), std::forward<F>(f));
+ }
+
+ bool SameIdentity(AVL avl) const { return root_ == avl.root_; }
+
+ private:
+ struct Node;
+ typedef std::shared_ptr<Node> NodePtr;
+ struct Node : public std::enable_shared_from_this<Node> {
+ Node(K k, V v, NodePtr l, NodePtr r, long h)
+ : kv(std::move(k), std::move(v)),
+ left(std::move(l)),
+ right(std::move(r)),
+ height(h) {}
+ const std::pair<K, V> kv;
+ const NodePtr left;
+ const NodePtr right;
+ const long height;
+ };
+ NodePtr root_;
+
+ explicit AVL(NodePtr root) : root_(std::move(root)) {}
+
+ template <class F>
+ static void ForEachImpl(const Node* n, F&& f) {
+ if (n == nullptr) return;
+ ForEachImpl(n->left.get(), std::forward<F>(f));
+ f(const_cast<const K&>(n->kv.first), const_cast<const V&>(n->kv.second));
+ ForEachImpl(n->right.get(), std::forward<F>(f));
+ }
+
+ static long Height(const NodePtr& n) { return n ? n->height : 0; }
+
+ static NodePtr MakeNode(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return std::make_shared<Node>(std::move(key), std::move(value), left, right,
+ 1 + std::max(Height(left), Height(right)));
+ }
+
+ static NodePtr Get(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+
+ if (node->kv.first > key) {
+ return Get(node->left, key);
+ } else if (node->kv.first < key) {
+ return Get(node->right, key);
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr GetBelow(const NodePtr& node, const K& key) {
+ if (!node) return nullptr;
+ if (node->kv.first > key) {
+ return GetBelow(node->left, key);
+ } else if (node->kv.first < key) {
+ NodePtr n = GetBelow(node->right, key);
+ if (n == nullptr) n = node;
+ return n;
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr RotateLeft(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return MakeNode(
+ right->kv.first, right->kv.second,
+ MakeNode(std::move(key), std::move(value), left, right->left),
+ right->right);
+ }
+
+ static NodePtr RotateRight(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ return MakeNode(
+ left->kv.first, left->kv.second, left->left,
+ MakeNode(std::move(key), std::move(value), left->right, right));
+ }
+
+ static NodePtr RotateLeftRight(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_right(..., rotate_left(left), right) */
+ return MakeNode(
+ left->right->kv.first, left->right->kv.second,
+ MakeNode(left->kv.first, left->kv.second, left->left,
+ left->right->left),
+ MakeNode(std::move(key), std::move(value), left->right->right, right));
+ }
+
+ static NodePtr RotateRightLeft(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_left(..., left, rotate_right(right)) */
+ return MakeNode(
+ right->left->kv.first, right->left->kv.second,
+ MakeNode(std::move(key), std::move(value), left, right->left->left),
+ MakeNode(right->kv.first, right->kv.second, right->left->right,
+ right->right));
+ }
+
+ static NodePtr Rebalance(K key, V value, const NodePtr& left,
+ const NodePtr& right) {
+ switch (Height(left) - Height(right)) {
+ case 2:
+ if (Height(left->left) - Height(left->right) == -1) {
+ return RotateLeftRight(std::move(key), std::move(value), left, right);
+ } else {
+ return RotateRight(std::move(key), std::move(value), left, right);
+ }
+ case -2:
+ if (Height(right->left) - Height(right->right) == 1) {
+ return RotateRightLeft(std::move(key), std::move(value), left, right);
+ } else {
+ return RotateLeft(std::move(key), std::move(value), left, right);
+ }
+ default:
+ return MakeNode(key, value, left, right);
+ }
+ }
+
+ static NodePtr AddKey(const NodePtr& node, K key, V value) {
+ if (!node) {
+ return MakeNode(std::move(key), std::move(value), nullptr, nullptr);
+ }
+ if (node->kv.first < key) {
+ return Rebalance(node->kv.first, node->kv.second, node->left,
+ AddKey(node->right, std::move(key), std::move(value)));
+ }
+ if (key < node->kv.first) {
+ return Rebalance(node->kv.first, node->kv.second,
+ AddKey(node->left, std::move(key), std::move(value)),
+ node->right);
+ }
+ return MakeNode(std::move(key), std::move(value), node->left, node->right);
+ }
+
+ static NodePtr InOrderHead(NodePtr node) {
+ while (node->left != nullptr) {
+ node = node->left;
+ }
+ return node;
+ }
+
+ static NodePtr InOrderTail(NodePtr node) {
+ while (node->right != nullptr) {
+ node = node->right;
+ }
+ return node;
+ }
+
+ static NodePtr RemoveKey(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+ if (key < node->kv.first) {
+ return Rebalance(node->kv.first, node->kv.second,
+ RemoveKey(node->left, key), node->right);
+ } else if (node->kv.first < key) {
+ return Rebalance(node->kv.first, node->kv.second, node->left,
+ RemoveKey(node->right, key));
+ } else {
+ if (node->left == nullptr) {
+ return node->right;
+ } else if (node->right == nullptr) {
+ return node->left;
+ } else if (node->left->height < node->right->height) {
+ NodePtr h = InOrderHead(node->right);
+ return Rebalance(h->kv.first, h->kv.second, node->left,
+ RemoveKey(node->right, h->kv.first));
+ } else {
+ NodePtr h = InOrderTail(node->left);
+ return Rebalance(h->kv.first, h->kv.second,
+ RemoveKey(node->left, h->kv.first), node->right);
+ }
+ }
+ abort();
+ }
+};
+
+template <class K>
+class AVL<K, void> {
+ public:
+ AVL() {}
+
+ AVL Add(K key) const { return AVL(AddKey(root_, std::move(key))); }
+ AVL Remove(const K& key) const { return AVL(RemoveKey(root_, key)); }
+ bool Lookup(const K& key) const { return Get(root_, key) != nullptr; }
+ bool Empty() const { return root_ == nullptr; }
+
+ template <class F>
+ void ForEach(F&& f) const {
+ ForEachImpl(root_.get(), std::forward<F>(f));
+ }
+
+ bool SameIdentity(AVL avl) const { return root_ == avl.root_; }
+
+ private:
+ struct Node;
+ typedef std::shared_ptr<Node> NodePtr;
+ struct Node : public std::enable_shared_from_this<Node> {
+ Node(K k, NodePtr l, NodePtr r, long h)
+ : key(std::move(k)),
+ left(std::move(l)),
+ right(std::move(r)),
+ height(h) {}
+ const K key;
+ const NodePtr left;
+ const NodePtr right;
+ const long height;
+ };
+ NodePtr root_;
+
+ explicit AVL(NodePtr root) : root_(std::move(root)) {}
+
+ template <class F>
+ static void ForEachImpl(const Node* n, F&& f) {
+ if (n == nullptr) return;
+ ForEachImpl(n->left.get(), std::forward<F>(f));
+ f(const_cast<const K&>(n->key));
+ ForEachImpl(n->right.get(), std::forward<F>(f));
+ }
+
+ static long Height(const NodePtr& n) { return n ? n->height : 0; }
+
+ static NodePtr MakeNode(K key, const NodePtr& left, const NodePtr& right) {
+ return std::make_shared<Node>(std::move(key), left, right,
+ 1 + std::max(Height(left), Height(right)));
+ }
+
+ static NodePtr Get(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+
+ if (node->key > key) {
+ return Get(node->left, key);
+ } else if (node->key < key) {
+ return Get(node->right, key);
+ } else {
+ return node;
+ }
+ }
+
+ static NodePtr RotateLeft(K key, const NodePtr& left, const NodePtr& right) {
+ return MakeNode(right->key, MakeNode(std::move(key), left, right->left),
+ right->right);
+ }
+
+ static NodePtr RotateRight(K key, const NodePtr& left, const NodePtr& right) {
+ return MakeNode(left->key, left->left,
+ MakeNode(std::move(key), left->right, right));
+ }
+
+ static NodePtr RotateLeftRight(K key, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_right(..., rotate_left(left), right) */
+ return MakeNode(left->right->key,
+ MakeNode(left->key, left->left, left->right->left),
+ MakeNode(std::move(key), left->right->right, right));
+ }
+
+ static NodePtr RotateRightLeft(K key, const NodePtr& left,
+ const NodePtr& right) {
+ /* rotate_left(..., left, rotate_right(right)) */
+ return MakeNode(right->left->key,
+ MakeNode(std::move(key), left, right->left->left),
+ MakeNode(right->key, right->left->right, right->right));
+ }
+
+ static NodePtr Rebalance(K key, const NodePtr& left, const NodePtr& right) {
+ switch (Height(left) - Height(right)) {
+ case 2:
+ if (Height(left->left) - Height(left->right) == -1) {
+ return RotateLeftRight(std::move(key), left, right);
+ } else {
+ return RotateRight(std::move(key), left, right);
+ }
+ case -2:
+ if (Height(right->left) - Height(right->right) == 1) {
+ return RotateRightLeft(std::move(key), left, right);
+ } else {
+ return RotateLeft(std::move(key), left, right);
+ }
+ default:
+ return MakeNode(key, left, right);
+ }
+ }
+
+ static NodePtr AddKey(const NodePtr& node, K key) {
+ if (!node) {
+ return MakeNode(std::move(key), nullptr, nullptr);
+ }
+ if (node->key < key) {
+ return Rebalance(node->key, node->left,
+ AddKey(node->right, std::move(key)));
+ }
+ if (key < node->key) {
+ return Rebalance(node->key, AddKey(node->left, std::move(key)),
+ node->right);
+ }
+ return MakeNode(std::move(key), node->left, node->right);
+ }
+
+ static NodePtr InOrderHead(NodePtr node) {
+ while (node->left != nullptr) {
+ node = node->left;
+ }
+ return node;
+ }
+
+ static NodePtr InOrderTail(NodePtr node) {
+ while (node->right != nullptr) {
+ node = node->right;
+ }
+ return node;
+ }
+
+ static NodePtr RemoveKey(const NodePtr& node, const K& key) {
+ if (node == nullptr) {
+ return nullptr;
+ }
+ if (key < node->key) {
+ return Rebalance(node->key, RemoveKey(node->left, key), node->right);
+ } else if (node->key < key) {
+ return Rebalance(node->key, node->left, RemoveKey(node->right, key));
+ } else {
+ if (node->left == nullptr) {
+ return node->right;
+ } else if (node->right == nullptr) {
+ return node->left;
+ } else if (node->left->height < node->right->height) {
+ NodePtr h = InOrderHead(node->right);
+ return Rebalance(h->key, node->left, RemoveKey(node->right, h->key));
+ } else {
+ NodePtr h = InOrderTail(node->left);
+ return Rebalance(h->key, RemoveKey(node->left, h->key), node->right);
+ }
+ }
+ abort();
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_AVL_AVL_H
diff --git a/contrib/libs/grpc/src/core/lib/backoff/backoff.cc b/contrib/libs/grpc/src/core/lib/backoff/backoff.cc
index e536abde0a2..edca1de4ce5 100644
--- a/contrib/libs/grpc/src/core/lib/backoff/backoff.cc
+++ b/contrib/libs/grpc/src/core/lib/backoff/backoff.cc
@@ -39,7 +39,7 @@ double generate_uniform_random_number(uint32_t* rng_state) {
double generate_uniform_random_number_between(uint32_t* rng_state, double a,
double b) {
if (a == b) return a;
- if (a > b) GPR_SWAP(double, a, b); // make sure a < b
+ if (a > b) std::swap(a, b); // make sure a < b
const double range = b - a;
return a + generate_uniform_random_number(rng_state) * range;
}
@@ -55,7 +55,7 @@ BackOff::BackOff(const Options& options)
grpc_millis BackOff::NextAttemptTime() {
if (initial_) {
initial_ = false;
- return current_backoff_ + grpc_core::ExecCtx::Get()->Now();
+ return current_backoff_ + ExecCtx::Get()->Now();
}
current_backoff_ = static_cast<grpc_millis>(
std::min(current_backoff_ * options_.multiplier(),
@@ -65,7 +65,7 @@ grpc_millis BackOff::NextAttemptTime() {
options_.jitter() * current_backoff_);
const grpc_millis next_timeout =
static_cast<grpc_millis>(current_backoff_ + jitter);
- return next_timeout + grpc_core::ExecCtx::Get()->Now();
+ return next_timeout + ExecCtx::Get()->Now();
}
void BackOff::Reset() {
diff --git a/contrib/libs/grpc/src/core/lib/channel/call_tracer.h b/contrib/libs/grpc/src/core/lib/channel/call_tracer.h
new file mode 100644
index 00000000000..188afb32b56
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/channel/call_tracer.h
@@ -0,0 +1,85 @@
+//
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_CHANNEL_CALL_TRACER_H
+#define GRPC_CORE_LIB_CHANNEL_CALL_TRACER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/strings/string_view.h"
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/transport/byte_stream.h"
+#include "src/core/lib/transport/metadata_batch.h"
+
+namespace grpc_core {
+
+// Interface for a tracer that records activities on a call. Actual attempts for
+// this call are traced with CallAttemptTracer after invoking RecordNewAttempt()
+// on the CallTracer object.
+class CallTracer {
+ public:
+ // Interface for a tracer that records activities on a particular call
+ // attempt.
+ // (A single RPC can have multiple attempts due to retry/hedging policies or
+ // as transparent retry attempts.)
+ class CallAttemptTracer {
+ public:
+ virtual ~CallAttemptTracer() {}
+ // Please refer to `grpc_transport_stream_op_batch_payload` for details on
+ // arguments.
+ virtual void RecordSendInitialMetadata(
+ grpc_metadata_batch* send_initial_metadata, uint32_t flags) = 0;
+ // TODO(yashkt): We are using gpr_atm here instead of y_absl::string_view
+ // since that's what the transport API uses, and performing an atomic load
+ // is unnecessary if the census tracer does not need it at present. Fix this
+ // when the transport API changes.
+ virtual void RecordOnDoneSendInitialMetadata(gpr_atm* peer_string) = 0;
+ virtual void RecordSendTrailingMetadata(
+ grpc_metadata_batch* send_trailing_metadata) = 0;
+ virtual void RecordSendMessage(const ByteStream& send_message) = 0;
+ // The `RecordReceivedInitialMetadata()` and `RecordReceivedMessage()`
+ // methods should only be invoked when the metadata/message was
+ // successfully received, i.e., without any error.
+ virtual void RecordReceivedInitialMetadata(
+ grpc_metadata_batch* recv_initial_metadata, uint32_t flags) = 0;
+ virtual void RecordReceivedMessage(const ByteStream& recv_message) = 0;
+ virtual void RecordReceivedTrailingMetadata(
+ y_absl::Status status, grpc_metadata_batch* recv_trailing_metadata,
+ const grpc_transport_stream_stats& transport_stream_stats) = 0;
+ virtual void RecordCancel(grpc_error_handle cancel_error) = 0;
+ // Should be the last API call to the object. Once invoked, the tracer
+ // library is free to destroy the object.
+ virtual void RecordEnd(const gpr_timespec& latency) = 0;
+ };
+
+ virtual ~CallTracer() {}
+
+ // Records a new attempt for the associated call. \a transparent denotes
+ // whether the attempt is being made as a transparent retry or as a
+ // non-transparent retry/heding attempt. (There will be at least one attempt
+ // even if the call is not being retried.) The `CallTracer` object retains
+ // ownership to the newly created `CallAttemptTracer` object. RecordEnd()
+ // serves as an indication that the call stack is done with all API calls, and
+ // the tracer library is free to destroy it after that.
+ virtual CallAttemptTracer* StartNewAttempt(bool is_transparent_retry) = 0;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CALL_TRACER_H
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args.cc b/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
index 180634fdae1..d9e4d81f7a9 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args.cc
@@ -18,22 +18,23 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/channel/channel_args.h"
+
#include <limits.h>
#include <string.h>
#include <vector>
+#include "y_absl/strings/match.h"
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_join.h"
-#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/impl/codegen/log.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
@@ -145,7 +146,7 @@ grpc_channel_args* grpc_channel_args_union(const grpc_channel_args* a,
}
static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {
- int c = GPR_ICMP(a->type, b->type);
+ int c = grpc_core::QsortCompare(a->type, b->type);
if (c != 0) return c;
c = strcmp(a->key, b->key);
if (c != 0) return c;
@@ -153,11 +154,12 @@ static int cmp_arg(const grpc_arg* a, const grpc_arg* b) {
case GRPC_ARG_STRING:
return strcmp(a->value.string, b->value.string);
case GRPC_ARG_INTEGER:
- return GPR_ICMP(a->value.integer, b->value.integer);
+ return grpc_core::QsortCompare(a->value.integer, b->value.integer);
case GRPC_ARG_POINTER:
- c = GPR_ICMP(a->value.pointer.p, b->value.pointer.p);
+ c = grpc_core::QsortCompare(a->value.pointer.p, b->value.pointer.p);
if (c != 0) {
- c = GPR_ICMP(a->value.pointer.vtable, b->value.pointer.vtable);
+ c = grpc_core::QsortCompare(a->value.pointer.vtable,
+ b->value.pointer.vtable);
if (c == 0) {
c = a->value.pointer.vtable->cmp(a->value.pointer.p,
b->value.pointer.p);
@@ -174,7 +176,7 @@ static int cmp_key_stable(const void* ap, const void* bp) {
const grpc_arg* const* a = static_cast<const grpc_arg* const*>(ap);
const grpc_arg* const* b = static_cast<const grpc_arg* const*>(bp);
int c = strcmp((*a)->key, (*b)->key);
- if (c == 0) c = GPR_ICMP(*a, *b);
+ if (c == 0) c = grpc_core::QsortCompare(*a, *b);
return c;
}
@@ -224,7 +226,7 @@ int grpc_channel_args_compare(const grpc_channel_args* a,
const grpc_channel_args* b) {
if (a == nullptr && b == nullptr) return 0;
if (a == nullptr || b == nullptr) return a == nullptr ? -1 : 1;
- int c = GPR_ICMP(a->num_args, b->num_args);
+ int c = grpc_core::QsortCompare(a->num_args, b->num_args);
if (c != 0) return c;
for (size_t i = 0; i < a->num_args; i++) {
c = cmp_arg(&a->args[i], &b->args[i]);
@@ -366,6 +368,23 @@ TString grpc_channel_args_string(const grpc_channel_args* args) {
return y_absl::StrJoin(arg_strings, ", ");
}
+namespace grpc_core {
+const grpc_channel_args* RemoveGrpcInternalArgs(const grpc_channel_args* src) {
+ if (src == nullptr) return nullptr;
+ // Create result.
+ grpc_channel_args* dst =
+ static_cast<grpc_channel_args*>(gpr_malloc(sizeof(grpc_channel_args)));
+ dst->args =
+ static_cast<grpc_arg*>(gpr_malloc(sizeof(grpc_arg) * src->num_args));
+ dst->num_args = 0;
+ for (size_t i = 0; i < src->num_args; ++i) {
+ if (y_absl::StartsWith(src->args[i].key, "grpc.internal.")) continue;
+ dst->args[dst->num_args++] = copy_arg(&src->args[i]);
+ }
+ return dst;
+}
+} // namespace grpc_core
+
namespace {
grpc_channel_args_client_channel_creation_mutator g_mutator = nullptr;
} // namespace
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args.h b/contrib/libs/grpc/src/core/lib/channel/channel_args.h
index 6b973aa94d3..22fa0ae848e 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_args.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args.h
@@ -23,7 +23,7 @@
#include <util/generic/string.h>
-#include <grpc/grpc.h>
+#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/surface/channel_stack_type.h"
@@ -119,6 +119,16 @@ grpc_arg grpc_channel_arg_pointer_create(char* name, void* value,
// Returns a string representing channel args in human-readable form.
TString grpc_channel_args_string(const grpc_channel_args* args);
+namespace grpc_core {
+/** Remove any channel args prefixed with 'grpc.internal.'
+ * These are used for internal implementation details and are not intended to
+ * be exposed to users.
+ * Returns a new channel args instance.
+ * Does not take ownership of \a src.
+ * Should be called by any public API that receives channel args. */
+const grpc_channel_args* RemoveGrpcInternalArgs(const grpc_channel_args* src);
+} // namespace grpc_core
+
// Takes ownership of the old_args
typedef grpc_channel_args* (*grpc_channel_args_client_channel_creation_mutator)(
const char* target, grpc_channel_args* old_args,
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.cc b/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.cc
new file mode 100644
index 00000000000..d078499ac9e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.cc
@@ -0,0 +1,47 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_args_preconditioning.h"
+
+#include <grpc/support/alloc.h>
+
+namespace grpc_core {
+
+void ChannelArgsPreconditioning::Builder::RegisterStage(Stage stage) {
+ stages_.emplace_back(std::move(stage));
+}
+
+ChannelArgsPreconditioning ChannelArgsPreconditioning::Builder::Build() {
+ // TODO(ctiller): should probably make this registered too.
+ stages_.emplace_back(RemoveGrpcInternalArgs);
+
+ ChannelArgsPreconditioning preconditioning;
+ preconditioning.stages_ = std::move(stages_);
+ return preconditioning;
+}
+
+const grpc_channel_args* ChannelArgsPreconditioning::PreconditionChannelArgs(
+ const grpc_channel_args* args) const {
+ const grpc_channel_args* owned_args = nullptr;
+ for (auto& stage : stages_) {
+ args = stage(args);
+ grpc_channel_args_destroy(owned_args);
+ owned_args = args;
+ }
+ return args;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.h b/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.h
new file mode 100644
index 00000000000..224399fb549
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_args_preconditioning.h
@@ -0,0 +1,62 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
+#define GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <vector>
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_core {
+
+// Registry of mutators for channel args.
+// Surface APIs should call into this with channel args received from outside
+// of gRPC, in order to prepare those channel args for the expections of the
+// gRPC internals.
+class ChannelArgsPreconditioning {
+ public:
+ // Take channel args and mutate them.
+ // Does not take ownership of the channel args passed in.
+ // Returns a new channel args object that is owned by the caller.
+ using Stage =
+ std::function<const grpc_channel_args*(const grpc_channel_args*)>;
+
+ class Builder {
+ public:
+ // Register a new channel args preconditioner.
+ void RegisterStage(Stage stage);
+ // Build out the preconditioners.
+ ChannelArgsPreconditioning Build();
+
+ private:
+ std::vector<Stage> stages_;
+ };
+
+ // Take channel args and precondition them.
+ // Does not take ownership of the channel args passed in.
+ // Returns a new channel args object that is owned by the caller.
+ const grpc_channel_args* PreconditionChannelArgs(
+ const grpc_channel_args* args) const;
+
+ private:
+ std::vector<Stage> stages_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_stack.cc b/contrib/libs/grpc/src/core/lib/channel/channel_stack.cc
index 60b83667c54..a7f890e26d7 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_stack.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_stack.cc
@@ -18,14 +18,16 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_stack.h"
-#include "src/core/lib/gpr/alloc.h"
#include <stdlib.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/alloc.h"
+
grpc_core::TraceFlag grpc_trace_channel(false, "channel");
/* Memory layouts.
@@ -98,7 +100,7 @@ grpc_call_element* grpc_call_stack_element(grpc_call_stack* call_stack,
return CALL_ELEMS_FROM_STACK(call_stack) + index;
}
-grpc_error* grpc_channel_stack_init(
+grpc_error_handle grpc_channel_stack_init(
int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg,
const grpc_channel_filter** filters, size_t filter_count,
const grpc_channel_args* channel_args, grpc_transport* optional_transport,
@@ -120,7 +122,7 @@ grpc_error* grpc_channel_stack_init(
sizeof(grpc_channel_element));
/* init per-filter data */
- grpc_error* first_error = GRPC_ERROR_NONE;
+ grpc_error_handle first_error = GRPC_ERROR_NONE;
for (i = 0; i < filter_count; i++) {
args.channel_stack = stack;
args.channel_args = channel_args;
@@ -129,7 +131,8 @@ grpc_error* grpc_channel_stack_init(
args.is_last = i == (filter_count - 1);
elems[i].filter = filters[i];
elems[i].channel_data = user_data;
- grpc_error* error = elems[i].filter->init_channel_elem(&elems[i], &args);
+ grpc_error_handle error =
+ elems[i].filter->init_channel_elem(&elems[i], &args);
if (error != GRPC_ERROR_NONE) {
if (first_error == GRPC_ERROR_NONE) {
first_error = error;
@@ -161,10 +164,10 @@ void grpc_channel_stack_destroy(grpc_channel_stack* stack) {
}
}
-grpc_error* grpc_call_stack_init(grpc_channel_stack* channel_stack,
- int initial_refs, grpc_iomgr_cb_func destroy,
- void* destroy_arg,
- const grpc_call_element_args* elem_args) {
+grpc_error_handle grpc_call_stack_init(
+ grpc_channel_stack* channel_stack, int initial_refs,
+ grpc_iomgr_cb_func destroy, void* destroy_arg,
+ const grpc_call_element_args* elem_args) {
grpc_channel_element* channel_elems = CHANNEL_ELEMS_FROM_STACK(channel_stack);
size_t count = channel_stack->count;
grpc_call_element* call_elems;
@@ -178,7 +181,7 @@ grpc_error* grpc_call_stack_init(grpc_channel_stack* channel_stack,
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element));
/* init per-filter data */
- grpc_error* first_error = GRPC_ERROR_NONE;
+ grpc_error_handle first_error = GRPC_ERROR_NONE;
for (size_t i = 0; i < count; i++) {
call_elems[i].filter = channel_elems[i].filter;
call_elems[i].channel_data = channel_elems[i].channel_data;
@@ -187,7 +190,7 @@ grpc_error* grpc_call_stack_init(grpc_channel_stack* channel_stack,
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(call_elems[i].filter->sizeof_call_data);
}
for (size_t i = 0; i < count; i++) {
- grpc_error* error =
+ grpc_error_handle error =
call_elems[i].filter->init_call_elem(&call_elems[i], elem_args);
if (error != GRPC_ERROR_NONE) {
if (first_error == GRPC_ERROR_NONE) {
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_stack.h b/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
index 1573ae1e056..5e6b3594db8 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_stack.h
@@ -78,7 +78,7 @@ struct grpc_call_element_args {
const void* server_transport_data;
grpc_call_context_element* context;
const grpc_slice& path;
- gpr_cycle_counter start_time;
+ gpr_cycle_counter start_time; // Note: not populated in subchannel stack.
grpc_millis deadline;
grpc_core::Arena* arena;
grpc_core::CallCombiner* call_combiner;
@@ -125,8 +125,8 @@ struct grpc_channel_filter {
transport and is on the server. Most filters want to ignore this
argument.
Implementations may assume that elem->call_data is all zeros. */
- grpc_error* (*init_call_elem)(grpc_call_element* elem,
- const grpc_call_element_args* args);
+ grpc_error_handle (*init_call_elem)(grpc_call_element* elem,
+ const grpc_call_element_args* args);
void (*set_pollset_or_pollset_set)(grpc_call_element* elem,
grpc_polling_entity* pollent);
/* Destroy per call data.
@@ -148,8 +148,8 @@ struct grpc_channel_filter {
useful for asserting correct configuration by upper layer code.
The filter does not need to do any chaining.
Implementations may assume that elem->channel_data is all zeros. */
- grpc_error* (*init_channel_elem)(grpc_channel_element* elem,
- grpc_channel_element_args* args);
+ grpc_error_handle (*init_channel_elem)(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
/* Destroy per channel data.
The filter does not need to do any chaining */
void (*destroy_channel_elem)(grpc_channel_element* elem);
@@ -218,7 +218,7 @@ grpc_call_element* grpc_call_stack_element(grpc_call_stack* stack, size_t i);
size_t grpc_channel_stack_size(const grpc_channel_filter** filters,
size_t filter_count);
/* Initialize a channel stack given some filters */
-grpc_error* grpc_channel_stack_init(
+grpc_error_handle grpc_channel_stack_init(
int initial_refs, grpc_iomgr_cb_func destroy, void* destroy_arg,
const grpc_channel_filter** filters, size_t filter_count,
const grpc_channel_args* args, grpc_transport* optional_transport,
@@ -229,10 +229,11 @@ void grpc_channel_stack_destroy(grpc_channel_stack* stack);
/* Initialize a call stack given a channel stack. transport_server_data is
expected to be NULL on a client, or an opaque transport owned pointer on the
server. */
-grpc_error* grpc_call_stack_init(grpc_channel_stack* channel_stack,
- int initial_refs, grpc_iomgr_cb_func destroy,
- void* destroy_arg,
- const grpc_call_element_args* elem_args);
+grpc_error_handle grpc_call_stack_init(grpc_channel_stack* channel_stack,
+ int initial_refs,
+ grpc_iomgr_cb_func destroy,
+ void* destroy_arg,
+ const grpc_call_element_args* elem_args);
/* Set a pollset or a pollset_set for a call stack: must occur before the first
* op is started */
void grpc_call_stack_set_pollset_or_pollset_set(grpc_call_stack* call_stack,
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc b/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc
index 8b3008f2217..b9c0e4c7f91 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.cc
@@ -25,6 +25,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/gprpp/memory.h"
+
typedef struct filter_node {
struct filter_node* next;
struct filter_node* prev;
@@ -40,7 +42,6 @@ struct grpc_channel_stack_builder {
// various set/get-able parameters
grpc_channel_args* args;
grpc_transport* transport;
- grpc_resource_user* resource_user;
char* target;
const char* name;
};
@@ -52,15 +53,13 @@ struct grpc_channel_stack_builder_iterator {
grpc_channel_stack_builder* grpc_channel_stack_builder_create(void) {
grpc_channel_stack_builder* b =
- static_cast<grpc_channel_stack_builder*>(gpr_zalloc(sizeof(*b)));
-
+ grpc_core::Zalloc<grpc_channel_stack_builder>();
b->begin.filter = nullptr;
b->end.filter = nullptr;
b->begin.next = &b->end;
b->begin.prev = &b->end;
b->end.next = &b->begin;
b->end.prev = &b->begin;
-
return b;
}
@@ -174,17 +173,6 @@ grpc_transport* grpc_channel_stack_builder_get_transport(
return builder->transport;
}
-void grpc_channel_stack_builder_set_resource_user(
- grpc_channel_stack_builder* builder, grpc_resource_user* resource_user) {
- GPR_ASSERT(builder->resource_user == nullptr);
- builder->resource_user = resource_user;
-}
-
-grpc_resource_user* grpc_channel_stack_builder_get_resource_user(
- grpc_channel_stack_builder* builder) {
- return builder->resource_user;
-}
-
bool grpc_channel_stack_builder_append_filter(
grpc_channel_stack_builder* builder, const grpc_channel_filter* filter,
grpc_post_filter_create_init_func post_init_func, void* user_data) {
@@ -267,7 +255,7 @@ void grpc_channel_stack_builder_destroy(grpc_channel_stack_builder* builder) {
gpr_free(builder);
}
-grpc_error* grpc_channel_stack_builder_finish(
+grpc_error_handle grpc_channel_stack_builder_finish(
grpc_channel_stack_builder* builder, size_t prefix_bytes, int initial_refs,
grpc_iomgr_cb_func destroy, void* destroy_arg, void** result) {
// count the number of filters
@@ -294,7 +282,7 @@ grpc_error* grpc_channel_stack_builder_finish(
grpc_channel_stack* channel_stack = reinterpret_cast<grpc_channel_stack*>(
static_cast<char*>(*result) + prefix_bytes);
// and initialize it
- grpc_error* error = grpc_channel_stack_init(
+ grpc_error_handle error = grpc_channel_stack_init(
initial_refs, destroy, destroy_arg == nullptr ? *result : destroy_arg,
filters, num_filters, builder->args, builder->transport, builder->name,
channel_stack);
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.h b/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.h
index 89c30e0c5ea..0071aa960f5 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_stack_builder.h
@@ -54,14 +54,6 @@ void grpc_channel_stack_builder_set_transport(
grpc_transport* grpc_channel_stack_builder_get_transport(
grpc_channel_stack_builder* builder);
-/// Attach \a resource_user to the builder (does not take ownership)
-void grpc_channel_stack_builder_set_resource_user(
- grpc_channel_stack_builder* builder, grpc_resource_user* resource_user);
-
-/// Fetch attached resource user
-grpc_resource_user* grpc_channel_stack_builder_get_resource_user(
- grpc_channel_stack_builder* builder);
-
/// Set channel arguments: copies args
void grpc_channel_stack_builder_set_channel_arguments(
grpc_channel_stack_builder* builder, const grpc_channel_args* args);
@@ -156,7 +148,7 @@ void grpc_channel_stack_builder_iterator_destroy(
/// Returns the base pointer of the allocated block
/// \a initial_refs, \a destroy, \a destroy_arg are as per
/// grpc_channel_stack_init
-grpc_error* grpc_channel_stack_builder_finish(
+grpc_error_handle grpc_channel_stack_builder_finish(
grpc_channel_stack_builder* builder, size_t prefix_bytes, int initial_refs,
grpc_iomgr_cb_func destroy, void* destroy_arg, void** result);
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
index 77c3f035f08..07254a8d95b 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_trace.cc
@@ -16,17 +16,18 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channel_trace.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
@@ -45,8 +46,8 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity)
: severity_(severity),
data_(data),
- timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME)),
+ timestamp_(
+ grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)),
next_(nullptr),
referenced_entity_(std::move(referenced_entity)),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@@ -54,8 +55,8 @@ ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data,
ChannelTrace::TraceEvent::TraceEvent(Severity severity, const grpc_slice& data)
: severity_(severity),
data_(data),
- timestamp_(grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME)),
+ timestamp_(
+ grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME)),
next_(nullptr),
memory_usage_(sizeof(TraceEvent) + grpc_slice_memory_usage(data)) {}
@@ -71,8 +72,8 @@ ChannelTrace::ChannelTrace(size_t max_event_memory)
return; // tracing is disabled if max_event_memory_ == 0
}
gpr_mu_init(&tracer_mu_);
- time_created_ = grpc_millis_to_timespec(grpc_core::ExecCtx::Get()->Now(),
- GPR_CLOCK_REALTIME);
+ time_created_ =
+ grpc_millis_to_timespec(ExecCtx::Get()->Now(), GPR_CLOCK_REALTIME);
}
ChannelTrace::~ChannelTrace() {
diff --git a/contrib/libs/grpc/src/core/lib/channel/channel_trace.h b/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
index 126abc7eb9d..deff60a6f20 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channel_trace.h
@@ -19,9 +19,10 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
#define GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz.cc b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
index 1352ec55d2c..870427757bd 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz.cc
@@ -16,11 +16,15 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <atomic>
#include "y_absl/strings/escaping.h"
#include "y_absl/strings/strip.h"
@@ -29,19 +33,17 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/status_util.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/slice/b64.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
@@ -77,7 +79,7 @@ TString BaseNode::RenderJsonString() {
//
CallCountingHelper::CallCountingHelper() {
- num_cores_ = GPR_MAX(1, gpr_cpu_num_cores());
+ num_cores_ = std::max(1u, gpr_cpu_num_cores());
per_cpu_counter_data_storage_.reserve(num_cores_);
for (size_t i = 0; i < num_cores_; ++i) {
per_cpu_counter_data_storage_.emplace_back();
@@ -87,34 +89,34 @@ CallCountingHelper::CallCountingHelper() {
void CallCountingHelper::RecordCallStarted() {
AtomicCounterData& data =
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()];
- data.calls_started.FetchAdd(1, MemoryOrder::RELAXED);
- data.last_call_started_cycle.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ data.calls_started.fetch_add(1, std::memory_order_relaxed);
+ data.last_call_started_cycle.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void CallCountingHelper::RecordCallFailed() {
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()]
- .calls_failed.FetchAdd(1, MemoryOrder::RELAXED);
+ .calls_failed.fetch_add(1, std::memory_order_relaxed);
}
void CallCountingHelper::RecordCallSucceeded() {
per_cpu_counter_data_storage_[ExecCtx::Get()->starting_cpu()]
- .calls_succeeded.FetchAdd(1, MemoryOrder::RELAXED);
+ .calls_succeeded.fetch_add(1, std::memory_order_relaxed);
}
void CallCountingHelper::CollectData(CounterData* out) {
for (size_t core = 0; core < num_cores_; ++core) {
AtomicCounterData& data = per_cpu_counter_data_storage_[core];
- out->calls_started += data.calls_started.Load(MemoryOrder::RELAXED);
+ out->calls_started += data.calls_started.load(std::memory_order_relaxed);
out->calls_succeeded +=
- per_cpu_counter_data_storage_[core].calls_succeeded.Load(
- MemoryOrder::RELAXED);
- out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.Load(
- MemoryOrder::RELAXED);
+ per_cpu_counter_data_storage_[core].calls_succeeded.load(
+ std::memory_order_relaxed);
+ out->calls_failed += per_cpu_counter_data_storage_[core].calls_failed.load(
+ std::memory_order_relaxed);
const gpr_cycle_counter last_call =
- per_cpu_counter_data_storage_[core].last_call_started_cycle.Load(
- MemoryOrder::RELAXED);
+ per_cpu_counter_data_storage_[core].last_call_started_cycle.load(
+ std::memory_order_relaxed);
if (last_call > out->last_call_started_cycle) {
out->last_call_started_cycle = last_call;
}
@@ -174,7 +176,7 @@ Json ChannelNode::RenderJson() {
};
// Connectivity state.
// If low-order bit is on, then the field is set.
- int state_field = connectivity_state_.Load(MemoryOrder::RELAXED);
+ int state_field = connectivity_state_.load(std::memory_order_relaxed);
if ((state_field & 1) != 0) {
grpc_connectivity_state state =
static_cast<grpc_connectivity_state>(state_field >> 1);
@@ -228,7 +230,7 @@ void ChannelNode::PopulateChildRefs(Json::Object* json) {
void ChannelNode::SetConnectivityState(grpc_connectivity_state state) {
// Store with low-order bit set to indicate that the field is set.
int state_field = (state << 1) + 1;
- connectivity_state_.Store(state_field, MemoryOrder::RELAXED);
+ connectivity_state_.store(state_field, std::memory_order_relaxed);
}
void ChannelNode::AddChildChannel(intptr_t child_uuid) {
@@ -398,7 +400,7 @@ void SecurityArgDestroy(void* p) {
xds_certificate_provider->Unref();
}
-int SecurityArgCmp(void* p, void* q) { return GPR_ICMP(p, q); }
+int SecurityArgCmp(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kChannelArgVtable = {
SecurityArgCopy, SecurityArgDestroy, SecurityArgCmp};
@@ -439,14 +441,21 @@ void PopulateSocketAddressJson(Json::Object* json, const char* name,
port_num = atoi(port.data());
}
grpc_resolved_address resolved_host;
- grpc_string_to_sockaddr(&resolved_host, host.c_str(), port_num);
- TString packed_host = grpc_sockaddr_get_packed_host(&resolved_host);
- TString b64_host = y_absl::Base64Escape(packed_host);
- data["tcpip_address"] = Json::Object{
- {"port", port_num},
- {"ip_address", b64_host},
- };
- } else if (uri.ok() && uri->scheme() == "unix") {
+ grpc_error_handle error =
+ grpc_string_to_sockaddr(&resolved_host, host.c_str(), port_num);
+ if (error == GRPC_ERROR_NONE) {
+ TString packed_host = grpc_sockaddr_get_packed_host(&resolved_host);
+ TString b64_host = y_absl::Base64Escape(packed_host);
+ data["tcpip_address"] = Json::Object{
+ {"port", port_num},
+ {"ip_address", b64_host},
+ };
+ (*json)[name] = std::move(data);
+ return;
+ }
+ GRPC_ERROR_UNREF(error);
+ }
+ if (uri.ok() && uri->scheme() == "unix") {
data["uds_address"] = Json::Object{
{"filename", uri->path()},
};
@@ -468,37 +477,38 @@ SocketNode::SocketNode(TString local, TString remote, TString name,
security_(std::move(security)) {}
void SocketNode::RecordStreamStartedFromLocal() {
- streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
- last_local_stream_created_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ streams_started_.fetch_add(1, std::memory_order_relaxed);
+ last_local_stream_created_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordStreamStartedFromRemote() {
- streams_started_.FetchAdd(1, MemoryOrder::RELAXED);
- last_remote_stream_created_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ streams_started_.fetch_add(1, std::memory_order_relaxed);
+ last_remote_stream_created_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordMessagesSent(uint32_t num_sent) {
- messages_sent_.FetchAdd(num_sent, MemoryOrder::RELAXED);
- last_message_sent_cycle_.Store(gpr_get_cycle_counter(), MemoryOrder::RELAXED);
+ messages_sent_.fetch_add(num_sent, std::memory_order_relaxed);
+ last_message_sent_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
void SocketNode::RecordMessageReceived() {
- messages_received_.FetchAdd(1, MemoryOrder::RELAXED);
- last_message_received_cycle_.Store(gpr_get_cycle_counter(),
- MemoryOrder::RELAXED);
+ messages_received_.fetch_add(1, std::memory_order_relaxed);
+ last_message_received_cycle_.store(gpr_get_cycle_counter(),
+ std::memory_order_relaxed);
}
Json SocketNode::RenderJson() {
// Create and fill the data child.
Json::Object data;
gpr_timespec ts;
- int64_t streams_started = streams_started_.Load(MemoryOrder::RELAXED);
+ int64_t streams_started = streams_started_.load(std::memory_order_relaxed);
if (streams_started != 0) {
data["streamsStarted"] = ToString(streams_started);
gpr_cycle_counter last_local_stream_created_cycle =
- last_local_stream_created_cycle_.Load(MemoryOrder::RELAXED);
+ last_local_stream_created_cycle_.load(std::memory_order_relaxed);
if (last_local_stream_created_cycle != 0) {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_local_stream_created_cycle),
@@ -506,7 +516,7 @@ Json SocketNode::RenderJson() {
data["lastLocalStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
gpr_cycle_counter last_remote_stream_created_cycle =
- last_remote_stream_created_cycle_.Load(MemoryOrder::RELAXED);
+ last_remote_stream_created_cycle_.load(std::memory_order_relaxed);
if (last_remote_stream_created_cycle != 0) {
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(last_remote_stream_created_cycle),
@@ -514,33 +524,35 @@ Json SocketNode::RenderJson() {
data["lastRemoteStreamCreatedTimestamp"] = gpr_format_timespec(ts);
}
}
- int64_t streams_succeeded = streams_succeeded_.Load(MemoryOrder::RELAXED);
+ int64_t streams_succeeded =
+ streams_succeeded_.load(std::memory_order_relaxed);
if (streams_succeeded != 0) {
data["streamsSucceeded"] = ToString(streams_succeeded);
}
- int64_t streams_failed = streams_failed_.Load(MemoryOrder::RELAXED);
+ int64_t streams_failed = streams_failed_.load(std::memory_order_relaxed);
if (streams_failed != 0) {
data["streamsFailed"] = ToString(streams_failed);
}
- int64_t messages_sent = messages_sent_.Load(MemoryOrder::RELAXED);
+ int64_t messages_sent = messages_sent_.load(std::memory_order_relaxed);
if (messages_sent != 0) {
data["messagesSent"] = ToString(messages_sent);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
- last_message_sent_cycle_.Load(MemoryOrder::RELAXED)),
+ last_message_sent_cycle_.load(std::memory_order_relaxed)),
GPR_CLOCK_REALTIME);
data["lastMessageSentTimestamp"] = gpr_format_timespec(ts);
}
- int64_t messages_received = messages_received_.Load(MemoryOrder::RELAXED);
+ int64_t messages_received =
+ messages_received_.load(std::memory_order_relaxed);
if (messages_received != 0) {
data["messagesReceived"] = ToString(messages_received);
ts = gpr_convert_clock_type(
gpr_cycle_counter_to_time(
- last_message_received_cycle_.Load(MemoryOrder::RELAXED)),
+ last_message_received_cycle_.load(std::memory_order_relaxed)),
GPR_CLOCK_REALTIME);
data["lastMessageReceivedTimestamp"] = gpr_format_timespec(ts);
}
- int64_t keepalives_sent = keepalives_sent_.Load(MemoryOrder::RELAXED);
+ int64_t keepalives_sent = keepalives_sent_.load(std::memory_order_relaxed);
if (keepalives_sent != 0) {
data["keepAlivesSent"] = ToString(keepalives_sent);
}
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz.h b/contrib/libs/grpc/src/core/lib/channel/channelz.h
index 0245aa0a79c..2b90e9e0511 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz.h
@@ -19,19 +19,19 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
#define GRPC_CORE_LIB_CHANNEL_CHANNELZ_H
-#include <grpc/impl/codegen/port_platform.h>
-
-#include <grpc/grpc.h>
+#include <grpc/support/port_platform.h>
+#include <atomic>
#include <set>
#include <util/generic/string.h>
#include "y_absl/container/inlined_vector.h"
#include "y_absl/types/optional.h"
+#include <grpc/grpc.h>
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -41,7 +41,7 @@
#include "src/core/lib/json/json.h"
// Channel arg key for channelz node.
-#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.channelz_channel_node"
+#define GRPC_ARG_CHANNELZ_CHANNEL_NODE "grpc.internal.channelz_channel_node"
// Channel arg key for indicating an internal channel.
#define GRPC_ARG_CHANNELZ_IS_INTERNAL_CHANNEL \
@@ -134,19 +134,19 @@ class CallCountingHelper {
// Define the ctors so that we can use this structure in InlinedVector.
AtomicCounterData() = default;
AtomicCounterData(const AtomicCounterData& that)
- : calls_started(that.calls_started.Load(MemoryOrder::RELAXED)),
- calls_succeeded(that.calls_succeeded.Load(MemoryOrder::RELAXED)),
- calls_failed(that.calls_failed.Load(MemoryOrder::RELAXED)),
+ : calls_started(that.calls_started.load(std::memory_order_relaxed)),
+ calls_succeeded(that.calls_succeeded.load(std::memory_order_relaxed)),
+ calls_failed(that.calls_failed.load(std::memory_order_relaxed)),
last_call_started_cycle(
- that.last_call_started_cycle.Load(MemoryOrder::RELAXED)) {}
+ that.last_call_started_cycle.load(std::memory_order_relaxed)) {}
- Atomic<int64_t> calls_started{0};
- Atomic<int64_t> calls_succeeded{0};
- Atomic<int64_t> calls_failed{0};
- Atomic<gpr_cycle_counter> last_call_started_cycle{0};
+ std::atomic<int64_t> calls_started{0};
+ std::atomic<int64_t> calls_succeeded{0};
+ std::atomic<int64_t> calls_failed{0};
+ std::atomic<gpr_cycle_counter> last_call_started_cycle{0};
// Make sure the size is exactly one cache line.
- uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(Atomic<intptr_t>) -
- sizeof(Atomic<gpr_cycle_counter>)];
+ uint8_t padding[GPR_CACHELINE_SIZE - 3 * sizeof(std::atomic<intptr_t>) -
+ sizeof(std::atomic<gpr_cycle_counter>)];
};
// TODO(soheilhy,veblush): Revist this after abseil integration.
// This has a problem when using abseil inlined_vector because it
@@ -220,7 +220,7 @@ class ChannelNode : public BaseNode {
// Least significant bit indicates whether the value is set. Remaining
// bits are a grpc_connectivity_state value.
- Atomic<int> connectivity_state_{0};
+ std::atomic<int> connectivity_state_{0};
Mutex child_mu_; // Guards sets below.
std::set<intptr_t> child_channels_;
@@ -276,6 +276,9 @@ class SocketNode : public BaseNode {
public:
struct Security : public RefCounted<Security> {
struct Tls {
+ // This is a workaround for https://bugs.llvm.org/show_bug.cgi?id=50346
+ Tls() {}
+
enum class NameType { kUnset = 0, kStandardName = 1, kOtherName = 2 };
NameType type = NameType::kUnset;
// Holds the value of standard_name or other_names if type is not kUnset.
@@ -307,30 +310,30 @@ class SocketNode : public BaseNode {
void RecordStreamStartedFromLocal();
void RecordStreamStartedFromRemote();
void RecordStreamSucceeded() {
- streams_succeeded_.FetchAdd(1, MemoryOrder::RELAXED);
+ streams_succeeded_.fetch_add(1, std::memory_order_relaxed);
}
void RecordStreamFailed() {
- streams_failed_.FetchAdd(1, MemoryOrder::RELAXED);
+ streams_failed_.fetch_add(1, std::memory_order_relaxed);
}
void RecordMessagesSent(uint32_t num_sent);
void RecordMessageReceived();
void RecordKeepaliveSent() {
- keepalives_sent_.FetchAdd(1, MemoryOrder::RELAXED);
+ keepalives_sent_.fetch_add(1, std::memory_order_relaxed);
}
const TString& remote() { return remote_; }
private:
- Atomic<int64_t> streams_started_{0};
- Atomic<int64_t> streams_succeeded_{0};
- Atomic<int64_t> streams_failed_{0};
- Atomic<int64_t> messages_sent_{0};
- Atomic<int64_t> messages_received_{0};
- Atomic<int64_t> keepalives_sent_{0};
- Atomic<gpr_cycle_counter> last_local_stream_created_cycle_{0};
- Atomic<gpr_cycle_counter> last_remote_stream_created_cycle_{0};
- Atomic<gpr_cycle_counter> last_message_sent_cycle_{0};
- Atomic<gpr_cycle_counter> last_message_received_cycle_{0};
+ std::atomic<int64_t> streams_started_{0};
+ std::atomic<int64_t> streams_succeeded_{0};
+ std::atomic<int64_t> streams_failed_{0};
+ std::atomic<int64_t> messages_sent_{0};
+ std::atomic<int64_t> messages_received_{0};
+ std::atomic<int64_t> keepalives_sent_{0};
+ std::atomic<gpr_cycle_counter> last_local_stream_created_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_remote_stream_created_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_message_sent_cycle_{0};
+ std::atomic<gpr_cycle_counter> last_message_received_cycle_{0};
TString local_;
TString remote_;
RefCountedPtr<Security> const security_;
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
index 93f8fb30ab0..d890c12b4a1 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.cc
@@ -16,25 +16,26 @@
*
*/
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channelz_registry.h"
#include <algorithm>
#include <cstring>
#include "y_absl/container/inlined_vector.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
-#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/sync.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-
namespace grpc_core {
namespace channelz {
namespace {
diff --git a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
index fb3e623d722..743f5b67892 100644
--- a/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
+++ b/contrib/libs/grpc/src/core/lib/channel/channelz_registry.h
@@ -19,7 +19,7 @@
#ifndef GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H
#define GRPC_CORE_LIB_CHANNEL_CHANNELZ_REGISTRY_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
#include <stdint.h>
diff --git a/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc b/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
index be74d9e88bb..2a03c9cfcb3 100644
--- a/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/connected_channel.cc
@@ -28,6 +28,7 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/transport/transport.h"
@@ -53,13 +54,13 @@ typedef struct connected_channel_call_data {
callback_state recv_trailing_metadata_ready;
} call_data;
-static void run_in_call_combiner(void* arg, grpc_error* error) {
+static void run_in_call_combiner(void* arg, grpc_error_handle error) {
callback_state* state = static_cast<callback_state*>(arg);
GRPC_CALL_COMBINER_START(state->call_combiner, state->original_closure,
GRPC_ERROR_REF(error), state->reason);
}
-static void run_cancel_in_call_combiner(void* arg, grpc_error* error) {
+static void run_cancel_in_call_combiner(void* arg, grpc_error_handle error) {
run_in_call_combiner(arg, error);
gpr_free(arg);
}
@@ -146,7 +147,7 @@ static void connected_channel_start_transport_op(grpc_channel_element* elem,
}
/* Constructor for call_data */
-static grpc_error* connected_channel_init_call_elem(
+static grpc_error_handle connected_channel_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
@@ -179,7 +180,7 @@ static void connected_channel_destroy_call_elem(
}
/* Constructor for channel_data */
-static grpc_error* connected_channel_init_channel_elem(
+static grpc_error_handle connected_channel_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
channel_data* cd = static_cast<channel_data*>(elem->channel_data);
GPR_ASSERT(args->is_last);
@@ -231,9 +232,7 @@ static void bind_transport(grpc_channel_stack* channel_stack,
grpc_transport_stream_size(static_cast<grpc_transport*>(t));
}
-bool grpc_add_connected_filter(grpc_channel_stack_builder* builder,
- void* arg_must_be_null) {
- GPR_ASSERT(arg_must_be_null == nullptr);
+bool grpc_add_connected_filter(grpc_channel_stack_builder* builder) {
grpc_transport* t = grpc_channel_stack_builder_get_transport(builder);
GPR_ASSERT(t != nullptr);
return grpc_channel_stack_builder_append_filter(
diff --git a/contrib/libs/grpc/src/core/lib/channel/connected_channel.h b/contrib/libs/grpc/src/core/lib/channel/connected_channel.h
index faa1c73a21f..1aa35d7a78b 100644
--- a/contrib/libs/grpc/src/core/lib/channel/connected_channel.h
+++ b/contrib/libs/grpc/src/core/lib/channel/connected_channel.h
@@ -25,8 +25,7 @@
extern const grpc_channel_filter grpc_connected_filter;
-bool grpc_add_connected_filter(grpc_channel_stack_builder* builder,
- void* arg_must_be_null);
+bool grpc_add_connected_filter(grpc_channel_stack_builder* builder);
/* Debug helper to dig the transport stream out of a call element */
grpc_stream* grpc_connected_channel_get_stream(grpc_call_element* elem);
diff --git a/contrib/libs/grpc/src/core/lib/channel/context.h b/contrib/libs/grpc/src/core/lib/channel/context.h
index bd7fd495e4a..0c0556abcdc 100644
--- a/contrib/libs/grpc/src/core/lib/channel/context.h
+++ b/contrib/libs/grpc/src/core/lib/channel/context.h
@@ -32,6 +32,9 @@ typedef enum {
/// Value is a \a census_context.
GRPC_CONTEXT_TRACING,
+ /// Value is a CallTracer object.
+ GRPC_CONTEXT_CALL_TRACER,
+
/// Reserved for traffic_class_context.
GRPC_CONTEXT_TRAFFIC,
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker.cc b/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
index 0d4917c7227..3c401beac3b 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/channel/handshaker.h"
+
#include <string.h>
#include "y_absl/strings/str_format.h"
@@ -28,7 +30,6 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -68,7 +69,7 @@ void HandshakeManager::Add(RefCountedPtr<Handshaker> handshaker) {
HandshakeManager::~HandshakeManager() { handshakers_.clear(); }
-void HandshakeManager::Shutdown(grpc_error* why) {
+void HandshakeManager::Shutdown(grpc_error_handle why) {
{
MutexLock lock(&mu_);
// Shutdown the handshaker that's currently in progress, if any.
@@ -83,12 +84,12 @@ void HandshakeManager::Shutdown(grpc_error* why) {
// Helper function to call either the next handshaker or the
// on_handshake_done callback.
// Returns true if we've scheduled the on_handshake_done callback.
-bool HandshakeManager::CallNextHandshakerLocked(grpc_error* error) {
+bool HandshakeManager::CallNextHandshakerLocked(grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_handshaker_trace)) {
gpr_log(GPR_INFO,
"handshake_manager %p: error=%s shutdown=%d index=%" PRIuPTR
", args=%s",
- this, grpc_error_string(error), is_shutdown_, index_,
+ this, grpc_error_std_string(error).c_str(), is_shutdown_, index_,
HandshakerArgsString(&args_).c_str());
}
GPR_ASSERT(index_ <= handshakers_.size());
@@ -121,7 +122,7 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error* error) {
gpr_log(GPR_INFO,
"handshake_manager %p: handshaking complete -- scheduling "
"on_handshake_done with error=%s",
- this, grpc_error_string(error));
+ this, grpc_error_std_string(error).c_str());
}
// Cancel deadline timer, since we're invoking the on_handshake_done
// callback now.
@@ -142,7 +143,8 @@ bool HandshakeManager::CallNextHandshakerLocked(grpc_error* error) {
return is_shutdown_;
}
-void HandshakeManager::CallNextHandshakerFn(void* arg, grpc_error* error) {
+void HandshakeManager::CallNextHandshakerFn(void* arg,
+ grpc_error_handle error) {
auto* mgr = static_cast<HandshakeManager*>(arg);
bool done;
{
@@ -157,7 +159,7 @@ void HandshakeManager::CallNextHandshakerFn(void* arg, grpc_error* error) {
}
}
-void HandshakeManager::OnTimeoutFn(void* arg, grpc_error* error) {
+void HandshakeManager::OnTimeoutFn(void* arg, grpc_error_handle error) {
auto* mgr = static_cast<HandshakeManager*>(arg);
if (error == GRPC_ERROR_NONE) { // Timer fired, rather than being cancelled
mgr->Shutdown(GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshake timed out"));
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker.h b/contrib/libs/grpc/src/core/lib/channel/handshaker.h
index 2117c334ff4..062f2a93efb 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker.h
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker.h
@@ -23,9 +23,8 @@
#include "y_absl/container/inlined_vector.h"
-#include <grpc/support/string_util.h>
-
#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -78,7 +77,7 @@ struct HandshakerArgs {
class Handshaker : public RefCounted<Handshaker> {
public:
~Handshaker() override = default;
- virtual void Shutdown(grpc_error* why) = 0;
+ virtual void Shutdown(grpc_error_handle why) = 0;
virtual void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
HandshakerArgs* args) = 0;
@@ -100,7 +99,7 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
/// Shuts down the handshake manager (e.g., to clean up when the operation is
/// aborted in the middle).
- void Shutdown(grpc_error* why);
+ void Shutdown(grpc_error_handle why);
/// Invokes handshakers in the order they were added.
/// Takes ownership of \a endpoint, and then passes that ownership to
@@ -120,14 +119,14 @@ class HandshakeManager : public RefCounted<HandshakeManager> {
grpc_iomgr_cb_func on_handshake_done, void* user_data);
private:
- bool CallNextHandshakerLocked(grpc_error* error);
+ bool CallNextHandshakerLocked(grpc_error_handle error);
// A function used as the handshaker-done callback when chaining
// handshakers together.
- static void CallNextHandshakerFn(void* arg, grpc_error* error);
+ static void CallNextHandshakerFn(void* arg, grpc_error_handle error);
// Callback invoked when deadline is exceeded.
- static void OnTimeoutFn(void* arg, grpc_error* error);
+ static void OnTimeoutFn(void* arg, grpc_error_handle error);
static const size_t HANDSHAKERS_INIT_SIZE = 2;
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker_factory.h b/contrib/libs/grpc/src/core/lib/channel/handshaker_factory.h
index 520e5e4b258..0d55a6d79ac 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker_factory.h
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker_factory.h
@@ -23,12 +23,20 @@
#include <grpc/impl/codegen/grpc_types.h>
-#include "src/core/lib/channel/handshaker.h"
-
// A handshaker factory is used to create handshakers.
+// TODO(ctiller): grpc_pollset_set and HandshakeManager are forward declared in
+// this file. grpc_pollset_set ought to be eliminated when EventEngine lands IO
+// support. At the same time, we ought to be able to include handshake_manager.h
+// here and eliminate the HandshakeManager dependency - we cannot right now
+// because HandshakeManager names too many iomgr types.
+
+typedef struct grpc_pollset_set grpc_pollset_set;
+
namespace grpc_core {
+class HandshakeManager;
+
class HandshakerFactory {
public:
virtual void AddHandshakers(const grpc_channel_args* args,
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
index 614531832dd..d9d7bc9db64 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.cc
@@ -18,88 +18,33 @@
#include <grpc/support/port_platform.h>
-#include "y_absl/container/inlined_vector.h"
-
#include "src/core/lib/channel/handshaker_registry.h"
-#include "src/core/lib/gpr/alloc.h"
-#include "src/core/lib/gprpp/memory.h"
-
-#include <string.h>
-#include <algorithm>
-
-#include <grpc/support/alloc.h>
-
-//
-// grpc_handshaker_factory_list
-//
namespace grpc_core {
-namespace {
-
-class HandshakerFactoryList {
- public:
- void Register(bool at_start, std::unique_ptr<HandshakerFactory> factory);
- void AddHandshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr);
-
- private:
- y_absl::InlinedVector<std::unique_ptr<HandshakerFactory>, 2> factories_;
-};
-
-HandshakerFactoryList* g_handshaker_factory_lists = nullptr;
-
-} // namespace
-
-void HandshakerFactoryList::Register(
- bool at_start, std::unique_ptr<HandshakerFactory> factory) {
- factories_.push_back(std::move(factory));
- if (at_start) {
- auto* end = &factories_[factories_.size() - 1];
- std::rotate(&factories_[0], end, end + 1);
- }
+void HandshakerRegistry::Builder::RegisterHandshakerFactory(
+ bool at_start, HandshakerType handshaker_type,
+ std::unique_ptr<HandshakerFactory> factory) {
+ auto& vec = factories_[handshaker_type];
+ auto where = at_start ? vec.begin() : vec.end();
+ vec.insert(where, std::move(factory));
}
-void HandshakerFactoryList::AddHandshakers(const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr) {
- for (size_t idx = 0; idx < factories_.size(); ++idx) {
- auto& handshaker_factory = factories_[idx];
- handshaker_factory->AddHandshakers(args, interested_parties, handshake_mgr);
+HandshakerRegistry HandshakerRegistry::Builder::Build() {
+ HandshakerRegistry out;
+ for (size_t i = 0; i < NUM_HANDSHAKER_TYPES; i++) {
+ out.factories_[i] = std::move(factories_[i]);
}
-}
-
-//
-// plugin
-//
-
-void HandshakerRegistry::Init() {
- GPR_ASSERT(g_handshaker_factory_lists == nullptr);
- g_handshaker_factory_lists = new HandshakerFactoryList[NUM_HANDSHAKER_TYPES];
-}
-
-void HandshakerRegistry::Shutdown() {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- delete[] g_handshaker_factory_lists;
- g_handshaker_factory_lists = nullptr;
-}
-
-void HandshakerRegistry::RegisterHandshakerFactory(
- bool at_start, HandshakerType handshaker_type,
- std::unique_ptr<HandshakerFactory> factory) {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- auto& factory_list = g_handshaker_factory_lists[handshaker_type];
- factory_list.Register(at_start, std::move(factory));
+ return out;
}
void HandshakerRegistry::AddHandshakers(HandshakerType handshaker_type,
const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr) {
- GPR_ASSERT(g_handshaker_factory_lists != nullptr);
- auto& factory_list = g_handshaker_factory_lists[handshaker_type];
- factory_list.AddHandshakers(args, interested_parties, handshake_mgr);
+ HandshakeManager* handshake_mgr) const {
+ for (const auto& factory : factories_[handshaker_type]) {
+ factory->AddHandshakers(args, interested_parties, handshake_mgr);
+ }
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.h b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.h
index 4a02efc3f24..ccd61412c56 100644
--- a/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.h
+++ b/contrib/libs/grpc/src/core/lib/channel/handshaker_registry.h
@@ -21,6 +21,9 @@
#include <grpc/support/port_platform.h>
+#include <memory>
+#include <vector>
+
#include <grpc/impl/codegen/grpc_types.h>
#include "src/core/lib/channel/handshaker_factory.h"
@@ -35,18 +38,32 @@ typedef enum {
class HandshakerRegistry {
public:
- /// Registers a new handshaker factory. Takes ownership.
- /// If \a at_start is true, the new handshaker will be at the beginning of
- /// the list. Otherwise, it will be added to the end.
- static void RegisterHandshakerFactory(
- bool at_start, HandshakerType handshaker_type,
- std::unique_ptr<HandshakerFactory> factory);
- static void AddHandshakers(HandshakerType handshaker_type,
- const grpc_channel_args* args,
- grpc_pollset_set* interested_parties,
- HandshakeManager* handshake_mgr);
- static void Init();
- static void Shutdown();
+ class Builder {
+ public:
+ /// Registers a new handshaker factory. Takes ownership.
+ /// If \a at_start is true, the new handshaker will be at the beginning of
+ /// the list. Otherwise, it will be added to the end.
+ void RegisterHandshakerFactory(bool at_start,
+ HandshakerType handshaker_type,
+ std::unique_ptr<HandshakerFactory> factory);
+
+ HandshakerRegistry Build();
+
+ private:
+ std::vector<std::unique_ptr<HandshakerFactory>>
+ factories_[NUM_HANDSHAKER_TYPES];
+ };
+
+ void AddHandshakers(HandshakerType handshaker_type,
+ const grpc_channel_args* args,
+ grpc_pollset_set* interested_parties,
+ HandshakeManager* handshake_mgr) const;
+
+ private:
+ HandshakerRegistry() = default;
+
+ std::vector<std::unique_ptr<HandshakerFactory>>
+ factories_[NUM_HANDSHAKER_TYPES];
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/channel/status_util.h b/contrib/libs/grpc/src/core/lib/channel/status_util.h
index 969033ad6b6..b9245f234e2 100644
--- a/contrib/libs/grpc/src/core/lib/channel/status_util.h
+++ b/contrib/libs/grpc/src/core/lib/channel/status_util.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/status.h>
-
#include <stdbool.h>
#include <string.h>
+#include <grpc/status.h>
+
/// If \a status_str is a valid status string, sets \a status to the
/// corresponding status value and returns true.
bool grpc_status_code_from_string(const char* status_str,
@@ -53,6 +53,10 @@ class StatusCodeSet {
return status_code_mask_ & (1 << status);
}
+ bool operator==(const StatusCodeSet& other) const {
+ return status_code_mask_ == other.status_code_mask_;
+ }
+
private:
int status_code_mask_ = 0; // A bitfield of status codes in the set.
};
diff --git a/contrib/libs/grpc/src/core/lib/compression/algorithm_metadata.h b/contrib/libs/grpc/src/core/lib/compression/algorithm_metadata.h
index d58d2f541a0..d053d121e59 100644
--- a/contrib/libs/grpc/src/core/lib/compression/algorithm_metadata.h
+++ b/contrib/libs/grpc/src/core/lib/compression/algorithm_metadata.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/compression.h>
+
#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/transport/metadata.h"
diff --git a/contrib/libs/grpc/src/core/lib/compression/compression.cc b/contrib/libs/grpc/src/core/lib/compression/compression.cc
index d14b738bddb..3d5d11f6b79 100644
--- a/contrib/libs/grpc/src/core/lib/compression/compression.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/compression.cc
@@ -116,12 +116,12 @@ void grpc_compression_options_init(grpc_compression_options* opts) {
void grpc_compression_options_enable_algorithm(
grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
- GPR_BITSET(&opts->enabled_algorithms_bitset, algorithm);
+ grpc_core::SetBit(&opts->enabled_algorithms_bitset, algorithm);
}
void grpc_compression_options_disable_algorithm(
grpc_compression_options* opts, grpc_compression_algorithm algorithm) {
- GPR_BITCLEAR(&opts->enabled_algorithms_bitset, algorithm);
+ grpc_core::ClearBit(&opts->enabled_algorithms_bitset, algorithm);
}
int grpc_compression_options_is_algorithm_enabled(
diff --git a/contrib/libs/grpc/src/core/lib/compression/compression_args.cc b/contrib/libs/grpc/src/core/lib/compression/compression_args.cc
index 03e1a8881b6..0db9eb266aa 100644
--- a/contrib/libs/grpc/src/core/lib/compression/compression_args.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/compression_args.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/compression_args.h"
+
#include <limits.h>
#include <string.h>
@@ -28,7 +30,6 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/compression/compression_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
@@ -50,8 +51,9 @@ grpc_channel_args_get_channel_default_compression_algorithm(
return GRPC_COMPRESS_NONE;
}
-grpc_channel_args* grpc_channel_args_set_channel_default_compression_algorithm(
- grpc_channel_args* a, grpc_compression_algorithm algorithm) {
+const grpc_channel_args*
+grpc_channel_args_set_channel_default_compression_algorithm(
+ const grpc_channel_args* a, grpc_compression_algorithm algorithm) {
GPR_ASSERT(algorithm < GRPC_COMPRESS_ALGORITHMS_COUNT);
grpc_arg tmp;
tmp.type = GRPC_ARG_INTEGER;
@@ -82,10 +84,11 @@ static int find_compression_algorithm_states_bitset(const grpc_channel_args* a,
return 0; /* GPR_FALSE */
}
-grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
- grpc_channel_args** a, grpc_compression_algorithm algorithm, int state) {
+const grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
+ const grpc_channel_args** a, grpc_compression_algorithm algorithm,
+ int state) {
int* states_arg = nullptr;
- grpc_channel_args* result = *a;
+ const grpc_channel_args* result = *a;
const int states_arg_found =
find_compression_algorithm_states_bitset(*a, &states_arg);
@@ -100,9 +103,9 @@ grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
algo_name);
} else if (states_arg_found) {
if (state != 0) {
- GPR_BITSET((unsigned*)states_arg, algorithm);
+ grpc_core::SetBit(reinterpret_cast<unsigned*>(states_arg), algorithm);
} else if (algorithm != GRPC_COMPRESS_NONE) {
- GPR_BITCLEAR((unsigned*)states_arg, algorithm);
+ grpc_core::ClearBit(reinterpret_cast<unsigned*>(states_arg), algorithm);
}
} else {
/* create a new arg */
@@ -113,9 +116,11 @@ grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
/* all enabled by default */
tmp.value.integer = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1;
if (state != 0) {
- GPR_BITSET((unsigned*)&tmp.value.integer, algorithm);
+ grpc_core::SetBit(reinterpret_cast<unsigned*>(&tmp.value.integer),
+ algorithm);
} else if (algorithm != GRPC_COMPRESS_NONE) {
- GPR_BITCLEAR((unsigned*)&tmp.value.integer, algorithm);
+ grpc_core::ClearBit(reinterpret_cast<unsigned*>(&tmp.value.integer),
+ algorithm);
}
result = grpc_channel_args_copy_and_add(*a, &tmp, 1);
grpc_channel_args_destroy(*a);
diff --git a/contrib/libs/grpc/src/core/lib/compression/compression_args.h b/contrib/libs/grpc/src/core/lib/compression/compression_args.h
index f1abc122cea..bd203384ef6 100644
--- a/contrib/libs/grpc/src/core/lib/compression/compression_args.h
+++ b/contrib/libs/grpc/src/core/lib/compression/compression_args.h
@@ -32,8 +32,9 @@ grpc_channel_args_get_channel_default_compression_algorithm(
/** Returns a channel arg instance with compression enabled. If \a a is
* non-NULL, its args are copied. N.B. GRPC_COMPRESS_NONE disables compression
* for the channel. */
-grpc_channel_args* grpc_channel_args_set_channel_default_compression_algorithm(
- grpc_channel_args* a, grpc_compression_algorithm algorithm);
+const grpc_channel_args*
+grpc_channel_args_set_channel_default_compression_algorithm(
+ const grpc_channel_args* a, grpc_compression_algorithm algorithm);
/** Sets the support for the given compression algorithm. By default, all
* compression algorithms are enabled. It's an error to disable an algorithm set
@@ -42,8 +43,9 @@ grpc_channel_args* grpc_channel_args_set_channel_default_compression_algorithm(
* Returns an instance with the updated algorithm states. The \a a pointer is
* modified to point to the returned instance (which may be different from the
* input value of \a a). */
-grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
- grpc_channel_args** a, grpc_compression_algorithm algorithm, int state);
+const grpc_channel_args* grpc_channel_args_compression_algorithm_set_state(
+ const grpc_channel_args** a, grpc_compression_algorithm algorithm,
+ int state);
/** Returns the bitset representing the support state (true for enabled, false
* for disabled) for compression algorithms.
diff --git a/contrib/libs/grpc/src/core/lib/compression/compression_internal.cc b/contrib/libs/grpc/src/core/lib/compression/compression_internal.cc
index 50750f85b1e..ae2d7458284 100644
--- a/contrib/libs/grpc/src/core/lib/compression/compression_internal.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/compression_internal.cc
@@ -18,13 +18,14 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/compression_internal.h"
+
#include <stdlib.h>
#include <string.h>
#include <grpc/compression.h>
#include "src/core/lib/compression/algorithm_metadata.h"
-#include "src/core/lib/compression/compression_internal.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/surface/api_trace.h"
@@ -168,7 +169,6 @@ int grpc_compression_algorithm_from_message_stream_compression_algorithm(
return 0;
}
}
- return 0;
}
/* Interfaces for message compression. */
@@ -207,7 +207,7 @@ grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
}
const size_t num_supported =
- GPR_BITCOUNT(accepted_encodings) - 1; /* discard NONE */
+ grpc_core::BitCount(accepted_encodings) - 1; /* discard NONE */
if (level == GRPC_COMPRESS_LEVEL_NONE || num_supported == 0) {
return GRPC_MESSAGE_COMPRESS_NONE;
}
@@ -228,7 +228,7 @@ grpc_message_compression_algorithm grpc_message_compression_algorithm_for_level(
for (size_t i = 0; i < GPR_ARRAY_SIZE(algos_ranking); i++) {
const grpc_message_compression_algorithm alg = algos_ranking[i];
for (size_t j = 0; j < num_supported; j++) {
- if (GPR_BITGET(accepted_encodings, alg) == 1) {
+ if (grpc_core::GetBit(accepted_encodings, alg) == 1) {
/* if \a alg in supported */
sorted_supported_algos[algos_supported_idx++] = alg;
break;
@@ -265,7 +265,6 @@ int grpc_message_compression_algorithm_parse(
} else {
return 0;
}
- return 0;
}
/* Interfaces for stream compression. */
@@ -281,5 +280,4 @@ int grpc_stream_compression_algorithm_parse(
} else {
return 0;
}
- return 0;
}
diff --git a/contrib/libs/grpc/src/core/lib/compression/compression_internal.h b/contrib/libs/grpc/src/core/lib/compression/compression_internal.h
index 22977f7e056..6e1f51a198b 100644
--- a/contrib/libs/grpc/src/core/lib/compression/compression_internal.h
+++ b/contrib/libs/grpc/src/core/lib/compression/compression_internal.h
@@ -91,7 +91,7 @@ int grpc_stream_compression_algorithm_parse(
inline int grpc_compression_options_is_algorithm_enabled_internal(
const grpc_compression_options* opts,
grpc_compression_algorithm algorithm) {
- return GPR_BITGET(opts->enabled_algorithms_bitset, algorithm);
+ return grpc_core::GetBit(opts->enabled_algorithms_bitset, algorithm);
}
#endif /* GRPC_CORE_LIB_COMPRESSION_COMPRESSION_INTERNAL_H */
diff --git a/contrib/libs/grpc/src/core/lib/compression/message_compress.cc b/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
index 7c2a70bad4e..797d5edfe87 100644
--- a/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/message_compress.cc
@@ -22,11 +22,11 @@
#include <string.h>
+#include <zlib.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <zlib.h>
-
#include "src/core/lib/slice/slice_internal.h"
#define OUTPUT_BLOCK_SIZE 1024
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression.cc b/contrib/libs/grpc/src/core/lib/compression/stream_compression.cc
index e0857988643..d827aeb938c 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/stream_compression.h"
+
#include <grpc/support/log.h>
-#include "src/core/lib/compression/stream_compression.h"
#include "src/core/lib/compression/stream_compression_gzip.h"
#include "src/core/lib/slice/slice_utils.h"
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression.h b/contrib/libs/grpc/src/core/lib/compression/stream_compression.h
index 7328c3ec0f2..cfa1bf00d9e 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression.h
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression.h
@@ -23,9 +23,10 @@
#include <stdbool.h>
-#include <grpc/slice_buffer.h>
#include <zlib.h>
+#include <grpc/slice_buffer.h>
+
#include "src/core/lib/transport/static_metadata.h"
typedef struct grpc_stream_compression_vtable grpc_stream_compression_vtable;
@@ -113,4 +114,4 @@ void grpc_stream_compression_context_destroy(
int grpc_stream_compression_method_parse(
grpc_slice value, bool is_compress, grpc_stream_compression_method* method);
-#endif
+#endif // GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_H
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc b/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc
index 452b22b7628..92a44eab64f 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.cc
@@ -18,10 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/stream_compression_gzip.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/compression/stream_compression_gzip.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h"
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.h b/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.h
index 740f09734a6..0f3be6d3067 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.h
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression_gzip.h
@@ -25,4 +25,4 @@
extern const grpc_stream_compression_vtable grpc_stream_compression_gzip_vtable;
-#endif
+#endif // GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_GZIP_H
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc b/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc
index 78486f09f05..adef4c44cd8 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.cc
@@ -18,10 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/compression/stream_compression_identity.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/compression/stream_compression_identity.h"
#include "src/core/lib/slice/slice_internal.h"
#define OUTPUT_BLOCK_SIZE (1024)
diff --git a/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.h b/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.h
index cc77b63ecdf..9c3693c744d 100644
--- a/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.h
+++ b/contrib/libs/grpc/src/core/lib/compression/stream_compression_identity.h
@@ -26,4 +26,4 @@
extern const grpc_stream_compression_vtable
grpc_stream_compression_identity_vtable;
-#endif
+#endif // GRPC_CORE_LIB_COMPRESSION_STREAM_COMPRESSION_IDENTITY_H
diff --git a/contrib/libs/grpc/src/core/lib/config/core_configuration.cc b/contrib/libs/grpc/src/core/lib/config/core_configuration.cc
new file mode 100644
index 00000000000..e8bcc1e7e7a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/config/core_configuration.cc
@@ -0,0 +1,98 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/config/core_configuration.h"
+
+#include <grpc/support/log.h>
+
+namespace grpc_core {
+
+std::atomic<CoreConfiguration*> CoreConfiguration::config_{nullptr};
+std::atomic<CoreConfiguration::RegisteredBuilder*> CoreConfiguration::builders_{
+ nullptr};
+
+CoreConfiguration::Builder::Builder() = default;
+
+CoreConfiguration* CoreConfiguration::Builder::Build() {
+ return new CoreConfiguration(this);
+}
+
+CoreConfiguration::CoreConfiguration(Builder* builder)
+ : channel_args_preconditioning_(
+ builder->channel_args_preconditioning_.Build()),
+ channel_init_(builder->channel_init_.Build()),
+ handshaker_registry_(builder->handshaker_registry_.Build()) {}
+
+void CoreConfiguration::RegisterBuilder(std::function<void(Builder*)> builder) {
+ GPR_ASSERT(config_.load(std::memory_order_relaxed) == nullptr &&
+ "CoreConfiguration was already instantiated before builder "
+ "registration was completed");
+ RegisteredBuilder* n = new RegisteredBuilder();
+ n->builder = std::move(builder);
+ n->next = builders_.load(std::memory_order_relaxed);
+ while (!builders_.compare_exchange_weak(n->next, n, std::memory_order_acq_rel,
+ std::memory_order_relaxed)) {
+ }
+ GPR_ASSERT(config_.load(std::memory_order_relaxed) == nullptr &&
+ "CoreConfiguration was already instantiated before builder "
+ "registration was completed");
+}
+
+const CoreConfiguration& CoreConfiguration::BuildNewAndMaybeSet() {
+ // Construct builder, pass it up to code that knows about build configuration
+ Builder builder;
+ // The linked list of builders stores things in reverse registration order.
+ // To get things registered as systems relying on this expect however, we
+ // actually need to run things in forward registration order, so we iterate
+ // once over the linked list to build a vector of builders, and then iterate
+ // over said vector in reverse to actually run the builders.
+ std::vector<RegisteredBuilder*> registered_builders;
+ for (RegisteredBuilder* b = builders_.load(std::memory_order_acquire);
+ b != nullptr; b = b->next) {
+ registered_builders.push_back(b);
+ }
+ for (auto it = registered_builders.rbegin(); it != registered_builders.rend();
+ ++it) {
+ (*it)->builder(&builder);
+ }
+ // Finally, call the built in configuration builder.
+ BuildCoreConfiguration(&builder);
+ // Use builder to construct a confguration
+ CoreConfiguration* p = builder.Build();
+ // Try to set configuration global - it's possible another thread raced us
+ // here, in which case we drop the work we did and use the one that got set
+ // first
+ CoreConfiguration* expected = nullptr;
+ if (!config_.compare_exchange_strong(expected, p, std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ delete p;
+ return *expected;
+ }
+ return *p;
+}
+
+void CoreConfiguration::Reset() {
+ delete config_.exchange(nullptr, std::memory_order_acquire);
+ RegisteredBuilder* builder =
+ builders_.exchange(nullptr, std::memory_order_acquire);
+ while (builder != nullptr) {
+ RegisteredBuilder* next = builder->next;
+ delete builder;
+ builder = next;
+ }
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/config/core_configuration.h b/contrib/libs/grpc/src/core/lib/config/core_configuration.h
new file mode 100644
index 00000000000..b3fed2100b8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/config/core_configuration.h
@@ -0,0 +1,157 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H
+#define GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+#include "src/core/lib/channel/channel_args_preconditioning.h"
+#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/surface/channel_init.h"
+
+namespace grpc_core {
+
+// Global singleton that stores library configuration - factories, etc...
+// that plugins might choose to extend.
+class CoreConfiguration {
+ public:
+ CoreConfiguration(const CoreConfiguration&) = delete;
+ CoreConfiguration& operator=(const CoreConfiguration&) = delete;
+
+ // Builder is passed to plugins, etc... at initialization time to collect
+ // their configuration and assemble the published CoreConfiguration.
+ class Builder {
+ public:
+ ChannelArgsPreconditioning::Builder* channel_args_preconditioning() {
+ return &channel_args_preconditioning_;
+ }
+
+ ChannelInit::Builder* channel_init() { return &channel_init_; }
+
+ HandshakerRegistry::Builder* handshaker_registry() {
+ return &handshaker_registry_;
+ }
+
+ private:
+ friend class CoreConfiguration;
+
+ ChannelArgsPreconditioning::Builder channel_args_preconditioning_;
+ ChannelInit::Builder channel_init_;
+ HandshakerRegistry::Builder handshaker_registry_;
+
+ Builder();
+ CoreConfiguration* Build();
+ };
+
+ // Lifetime methods
+
+ // Get the core configuration; if it does not exist, create it.
+ static const CoreConfiguration& Get() {
+ CoreConfiguration* p = config_.load(std::memory_order_acquire);
+ if (p != nullptr) {
+ return *p;
+ }
+ return BuildNewAndMaybeSet();
+ }
+
+ // Build a special core configuration.
+ // Requires no concurrent Get() be called.
+ // Doesn't call the regular BuildCoreConfiguration function, instead calls
+ // `build`.
+ // BuildFunc is a callable that takes a Builder* and returns void.
+ // We use a template instead of std::function<void(Builder*)> to avoid
+ // including std::function in this widely used header, and to ensure no code
+ // is generated in programs that do not use this function.
+ // This is sometimes useful for testing.
+ template <typename BuildFunc>
+ static void BuildSpecialConfiguration(BuildFunc build) {
+ // Build bespoke configuration
+ Builder builder;
+ build(&builder);
+ CoreConfiguration* p = builder.Build();
+ // Swap in final configuration, deleting anything that was already present.
+ delete config_.exchange(p, std::memory_order_release);
+ }
+
+ // Attach a registration function globally.
+ // Each registration function is called *in addition to*
+ // BuildCoreConfiguration for the default core configuration. When using
+ // BuildSpecialConfiguration, one can use CallRegisteredBuilders to call them.
+ // Must be called before a configuration is built.
+ static void RegisterBuilder(std::function<void(Builder*)> builder);
+
+ // Call all registered builders.
+ // See RegisterBuilder for why you might want to call this.
+ static void CallRegisteredBuilders(Builder* builder);
+
+ // Drop the core configuration. Users must ensure no other threads are
+ // accessing the configuration.
+ // Clears any dynamically registered builders.
+ static void Reset();
+
+ // Helper for tests: Reset the configuration, build a special one, run some
+ // code, and then reset the configuration again.
+ // Templatized to be sure no codegen in normal builds.
+ template <typename BuildFunc, typename RunFunc>
+ static void RunWithSpecialConfiguration(BuildFunc build_configuration,
+ RunFunc code_to_run) {
+ Reset();
+ BuildSpecialConfiguration(build_configuration);
+ code_to_run();
+ Reset();
+ }
+
+ // Accessors
+
+ const ChannelArgsPreconditioning& channel_args_preconditioning() const {
+ return channel_args_preconditioning_;
+ }
+
+ const ChannelInit& channel_init() const { return channel_init_; }
+
+ const HandshakerRegistry& handshaker_registry() const {
+ return handshaker_registry_;
+ }
+
+ private:
+ explicit CoreConfiguration(Builder* builder);
+
+ // Stores a builder for RegisterBuilder
+ struct RegisteredBuilder {
+ std::function<void(Builder*)> builder;
+ RegisteredBuilder* next;
+ };
+
+ // Create a new CoreConfiguration, and either set it or throw it away.
+ // We allow multiple CoreConfiguration's to be created in parallel.
+ static const CoreConfiguration& BuildNewAndMaybeSet();
+
+ // The configuration
+ static std::atomic<CoreConfiguration*> config_;
+ // Extra registered builders
+ static std::atomic<RegisteredBuilder*> builders_;
+
+ ChannelArgsPreconditioning channel_args_preconditioning_;
+ ChannelInit channel_init_;
+ HandshakerRegistry handshaker_registry_;
+};
+
+extern void BuildCoreConfiguration(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_CONFIG_CORE_CONFIGURATION_H */
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats.cc b/contrib/libs/grpc/src/core/lib/debug/stats.cc
index 1bcd1af25a2..1ce09e55e44 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats.cc
+++ b/contrib/libs/grpc/src/core/lib/debug/stats.cc
@@ -38,7 +38,7 @@ grpc_stats_data* grpc_stats_per_cpu_storage = nullptr;
static size_t g_num_cores;
void grpc_stats_init(void) {
- g_num_cores = GPR_MAX(1, gpr_cpu_num_cores());
+ g_num_cores = std::max(1u, gpr_cpu_num_cores());
grpc_stats_per_cpu_storage = static_cast<grpc_stats_data*>(
gpr_zalloc(sizeof(grpc_stats_data) * g_num_cores));
}
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats.h b/contrib/libs/grpc/src/core/lib/debug/stats.h
index 0957bcfffc9..03659c319a0 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats.h
+++ b/contrib/libs/grpc/src/core/lib/debug/stats.h
@@ -24,6 +24,7 @@
#include <util/generic/string.h>
#include <grpc/support/atm.h>
+
#include "src/core/lib/debug/stats_data.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -67,4 +68,4 @@ double grpc_stats_histo_percentile(const grpc_stats_data* stats,
size_t grpc_stats_histo_count(const grpc_stats_data* stats,
grpc_stats_histograms histogram);
-#endif
+#endif // GRPC_CORE_LIB_DEBUG_STATS_H
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats_data.cc b/contrib/libs/grpc/src/core/lib/debug/stats_data.cc
index ceacc571603..21e27f2b7ff 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats_data.cc
+++ b/contrib/libs/grpc/src/core/lib/debug/stats_data.cc
@@ -20,8 +20,9 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/stats_data.h"
+
+#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -352,7 +353,7 @@ const uint8_t grpc_stats_table_7[102] = {
const int grpc_stats_table_8[9] = {0, 1, 2, 4, 7, 13, 23, 39, 64};
const uint8_t grpc_stats_table_9[9] = {0, 0, 1, 2, 2, 3, 4, 4, 5};
void grpc_stats_inc_call_initial_size(int value) {
- value = GPR_CLAMP(value, 0, 262144);
+ value = grpc_core::Clamp(value, 0, 262144);
if (value < 6) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_CALL_INITIAL_SIZE, value);
return;
@@ -375,7 +376,7 @@ void grpc_stats_inc_call_initial_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_0, 64));
}
void grpc_stats_inc_poll_events_returned(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 29) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_POLL_EVENTS_RETURNED, value);
return;
@@ -398,7 +399,7 @@ void grpc_stats_inc_poll_events_returned(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_2, 128));
}
void grpc_stats_inc_tcp_write_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_SIZE, value);
return;
@@ -421,7 +422,7 @@ void grpc_stats_inc_tcp_write_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_write_iov_size(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_WRITE_IOV_SIZE, value);
return;
@@ -444,7 +445,7 @@ void grpc_stats_inc_tcp_write_iov_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_tcp_read_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_SIZE, value);
return;
@@ -467,7 +468,7 @@ void grpc_stats_inc_tcp_read_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_read_offer(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER, value);
return;
@@ -490,7 +491,7 @@ void grpc_stats_inc_tcp_read_offer(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_tcp_read_offer_iov_size(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_TCP_READ_OFFER_IOV_SIZE,
value);
@@ -515,7 +516,7 @@ void grpc_stats_inc_tcp_read_offer_iov_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_message_size(int value) {
- value = GPR_CLAMP(value, 0, 16777216);
+ value = grpc_core::Clamp(value, 0, 16777216);
if (value < 5) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_SIZE,
value);
@@ -540,7 +541,7 @@ void grpc_stats_inc_http2_send_message_size(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_4, 64));
}
void grpc_stats_inc_http2_send_initial_metadata_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(
GRPC_STATS_HISTOGRAM_HTTP2_SEND_INITIAL_METADATA_PER_WRITE, value);
@@ -565,7 +566,7 @@ void grpc_stats_inc_http2_send_initial_metadata_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_message_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_MESSAGE_PER_WRITE,
value);
@@ -590,7 +591,7 @@ void grpc_stats_inc_http2_send_message_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(
GRPC_STATS_HISTOGRAM_HTTP2_SEND_TRAILING_METADATA_PER_WRITE, value);
@@ -615,7 +616,7 @@ void grpc_stats_inc_http2_send_trailing_metadata_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_http2_send_flowctl_per_write(int value) {
- value = GPR_CLAMP(value, 0, 1024);
+ value = grpc_core::Clamp(value, 0, 1024);
if (value < 13) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_HTTP2_SEND_FLOWCTL_PER_WRITE,
value);
@@ -640,7 +641,7 @@ void grpc_stats_inc_http2_send_flowctl_per_write(int value) {
grpc_stats_histo_find_bucket_slow(value, grpc_stats_table_6, 64));
}
void grpc_stats_inc_server_cqs_checked(int value) {
- value = GPR_CLAMP(value, 0, 64);
+ value = grpc_core::Clamp(value, 0, 64);
if (value < 3) {
GRPC_STATS_INC_HISTOGRAM(GRPC_STATS_HISTOGRAM_SERVER_CQS_CHECKED, value);
return;
diff --git a/contrib/libs/grpc/src/core/lib/debug/stats_data.h b/contrib/libs/grpc/src/core/lib/debug/stats_data.h
index c1356c44cd0..61c3d103f48 100644
--- a/contrib/libs/grpc/src/core/lib/debug/stats_data.h
+++ b/contrib/libs/grpc/src/core/lib/debug/stats_data.h
@@ -24,6 +24,7 @@
#include <grpc/support/port_platform.h>
#include <inttypes.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
typedef enum {
diff --git a/contrib/libs/grpc/src/core/lib/debug/trace.cc b/contrib/libs/grpc/src/core/lib/debug/trace.cc
index 84c0a3805d3..87b61446386 100644
--- a/contrib/libs/grpc/src/core/lib/debug/trace.cc
+++ b/contrib/libs/grpc/src/core/lib/debug/trace.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/debug/trace.h"
#include <string.h>
+
#include <type_traits>
#include <grpc/grpc.h>
diff --git a/contrib/libs/grpc/src/core/lib/debug/trace.h b/contrib/libs/grpc/src/core/lib/debug/trace.h
index ac7b40e58a5..91d15b3f010 100644
--- a/contrib/libs/grpc/src/core/lib/debug/trace.h
+++ b/contrib/libs/grpc/src/core/lib/debug/trace.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
#include <stdbool.h>
+#include <grpc/support/atm.h>
+
#include "src/core/lib/gprpp/global_config.h"
GPR_GLOBAL_CONFIG_DECLARE_STRING(grpc_trace);
@@ -55,7 +56,7 @@ class TraceFlagList {
};
namespace testing {
-void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag);
+void grpc_tracer_enable_flag(TraceFlag* flag);
}
class TraceFlag {
@@ -89,7 +90,7 @@ class TraceFlag {
#endif /* defined(GRPC_USE_TRACERS) || !defined(NDEBUG) */
private:
- friend void grpc_core::testing::grpc_tracer_enable_flag(TraceFlag* flag);
+ friend void testing::grpc_tracer_enable_flag(TraceFlag* flag);
friend class TraceFlagList;
void set_enabled(bool enabled) {
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc b/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc
new file mode 100644
index 00000000000..2fa62acff25
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.cc
@@ -0,0 +1,46 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
+
+#include <grpc/event_engine/endpoint_config.h>
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/impl/codegen/log.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/useful.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EndpointConfig::Setting ChannelArgsEndpointConfig::Get(
+ y_absl::string_view key) const {
+ const grpc_arg* arg = grpc_channel_args_find(args_, TString(key).c_str());
+ if (arg == nullptr) {
+ return y_absl::monostate();
+ }
+ switch (arg->type) {
+ case GRPC_ARG_STRING:
+ return y_absl::string_view(arg->value.string);
+ case GRPC_ARG_INTEGER:
+ return arg->value.integer;
+ case GRPC_ARG_POINTER:
+ return arg->value.pointer.p;
+ }
+ GPR_UNREACHABLE_CODE(return y_absl::monostate());
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h b/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h
new file mode 100644
index 00000000000..440eb97d13f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/channel_args_endpoint_config.h
@@ -0,0 +1,42 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/endpoint_config.h>
+
+#include "src/core/lib/channel/channel_args.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// A readonly \a EndpointConfig based on grpc_channel_args. This class does not
+/// take ownership of the grpc_endpoint_args*, and instances of this class
+/// should not be used after the underlying args are destroyed.
+class ChannelArgsEndpointConfig : public EndpointConfig {
+ public:
+ explicit ChannelArgsEndpointConfig(const grpc_channel_args* args)
+ : args_(args) {}
+ Setting Get(y_absl::string_view key) const override;
+
+ private:
+ const grpc_channel_args* args_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_CHANNEL_ARGS_ENDPOINT_CONFIG_H
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/event_engine.cc b/contrib/libs/grpc/src/core/lib/event_engine/event_engine.cc
new file mode 100644
index 00000000000..447544c7b43
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/event_engine.cc
@@ -0,0 +1,37 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/event_engine/port.h>
+#include <grpc/support/log.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress::ResolvedAddress(const sockaddr* address,
+ socklen_t size)
+ : size_(size) {
+ GPR_ASSERT(size <= sizeof(address_));
+ memcpy(&address_, address, size);
+}
+
+const struct sockaddr* EventEngine::ResolvedAddress::address() const {
+ return reinterpret_cast<const struct sockaddr*>(address_);
+}
+
+socklen_t EventEngine::ResolvedAddress::size() const { return size_; }
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.cc b/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.cc
new file mode 100644
index 00000000000..3d29543b698
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.cc
@@ -0,0 +1,49 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+std::function<std::unique_ptr<EventEngine>()>* g_event_engine_factory = nullptr;
+grpc_core::Mutex* g_mu = new grpc_core::Mutex();
+} // namespace
+
+EventEngine* GetDefaultEventEngine() {
+ static EventEngine* default_event_engine = CreateEventEngine().release();
+ return default_event_engine;
+}
+
+void SetDefaultEventEngineFactory(
+ std::function<std::unique_ptr<EventEngine>()>* factory) {
+ grpc_core::MutexLock lock(g_mu);
+ g_event_engine_factory = factory;
+}
+
+std::unique_ptr<EventEngine> CreateEventEngine() {
+ grpc_core::MutexLock lock(g_mu);
+ if (g_event_engine_factory == nullptr) {
+ // TODO(hork): call LibuvEventEngineFactory
+ abort();
+ }
+ return (*g_event_engine_factory)();
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.h b/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.h
new file mode 100644
index 00000000000..92e25e0252a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/event_engine_factory.h
@@ -0,0 +1,33 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Access the shared global EventEngine instance.
+///
+/// The concept of a global EventEngine may go away in a post-iomgr world.
+/// Strongly consider whether you could use \a CreateEventEngine instead.
+EventEngine* GetDefaultEventEngine();
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_EVENT_ENGINE_FACTORY_H
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/memory_allocator.cc b/contrib/libs/grpc/src/core/lib/event_engine/memory_allocator.cc
new file mode 100644
index 00000000000..8b6994e76d8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/memory_allocator.cc
@@ -0,0 +1,70 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/memory_allocator.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/slice/slice_refcount.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+
+// Reference count for a slice allocated by MemoryAllocator::MakeSlice.
+// Takes care of releasing memory back when the slice is destroyed.
+class SliceRefCount {
+ public:
+ static void Destroy(void* p) {
+ auto* rc = static_cast<SliceRefCount*>(p);
+ rc->~SliceRefCount();
+ gpr_free(rc);
+ }
+ SliceRefCount(std::shared_ptr<internal::MemoryAllocatorImpl> allocator,
+ size_t size)
+ : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
+ &base_),
+ allocator_(std::move(allocator)),
+ size_(size) {
+ // Nothing to do here.
+ }
+ ~SliceRefCount() { allocator_->Release(size_); }
+
+ grpc_slice_refcount* base_refcount() { return &base_; }
+
+ private:
+ grpc_slice_refcount base_;
+ std::atomic<size_t> refs_{1};
+ std::shared_ptr<internal::MemoryAllocatorImpl> allocator_;
+ size_t size_;
+};
+
+} // namespace
+
+grpc_slice MemoryAllocator::MakeSlice(MemoryRequest request) {
+ auto size = Reserve(request.Increase(sizeof(SliceRefCount)));
+ void* p = gpr_malloc(size);
+ new (p) SliceRefCount(allocator_, size);
+ grpc_slice slice;
+ slice.refcount = static_cast<SliceRefCount*>(p)->base_refcount();
+ slice.data.refcounted.bytes =
+ static_cast<uint8_t*>(p) + sizeof(SliceRefCount);
+ slice.data.refcounted.length = size - sizeof(SliceRefCount);
+ return slice;
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.cc b/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.cc
new file mode 100644
index 00000000000..dab44f938a2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.cc
@@ -0,0 +1,40 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <string.h>
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/event_engine/port.h>
+#include <grpc/support/log.h>
+
+uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
+
+uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
+
+uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
+
+uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
+
+int grpc_inet_pton(int af, const char* src, void* dst) {
+ return inet_pton(af, src, dst);
+}
+
+const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
+ inet_ntop(af, src, dst, size);
+ return dst;
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.h b/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.h
new file mode 100644
index 00000000000..23b83dde567
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/event_engine/sockaddr.h
@@ -0,0 +1,44 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
+#define GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/port.h>
+
+#include "src/core/lib/iomgr/port.h"
+
+typedef struct sockaddr grpc_sockaddr;
+typedef struct sockaddr_in grpc_sockaddr_in;
+typedef struct sockaddr_in6 grpc_sockaddr_in6;
+typedef struct in_addr grpc_in_addr;
+typedef struct in6_addr grpc_in6_addr;
+
+#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
+#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
+
+#define GRPC_SOCK_STREAM SOCK_STREAM
+#define GRPC_SOCK_DGRAM SOCK_DGRAM
+
+#define GRPC_AF_UNSPEC AF_UNSPEC
+#define GRPC_AF_UNIX AF_UNIX
+#define GRPC_AF_INET AF_INET
+#define GRPC_AF_INET6 AF_INET6
+
+#define GRPC_AI_PASSIVE AI_PASSIVE
+
+#endif
+#endif // GRPC_CORE_LIB_EVENT_ENGINE_SOCKADDR_H
diff --git a/contrib/libs/grpc/src/core/lib/gpr/alloc.cc b/contrib/libs/grpc/src/core/lib/gpr/alloc.cc
index 5bfdc8d1562..9a46ff85fe7 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/alloc.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/alloc.cc
@@ -18,11 +18,12 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-
-#include <grpc/support/log.h>
#include <stdlib.h>
#include <string.h>
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
#include "src/core/lib/profiling/timers.h"
void* gpr_malloc(size_t size) {
diff --git a/contrib/libs/grpc/src/core/lib/gpr/arena.h b/contrib/libs/grpc/src/core/lib/gpr/arena.h
deleted file mode 100644
index 4d70695149c..00000000000
--- a/contrib/libs/grpc/src/core/lib/gpr/arena.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// \file Arena based allocator
-// Allows very fast allocation of memory, but that memory cannot be freed until
-// the arena as a whole is freed
-// Tracks the total memory allocated against it, so that future arenas can
-// pre-allocate the right amount of memory
-// This transitional API is deprecated and will be removed soon in favour of
-// src/core/lib/gprpp/arena.h .
-
-#ifndef GRPC_CORE_LIB_GPR_ARENA_H
-#define GRPC_CORE_LIB_GPR_ARENA_H
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/gprpp/arena.h"
-
-// TODO(arjunroy) : Remove deprecated gpr_arena API once all callers are gone.
-typedef class grpc_core::Arena gpr_arena;
-// Create an arena, with \a initial_size bytes in the first allocated buffer
-inline gpr_arena* gpr_arena_create(size_t initial_size) {
- return grpc_core::Arena::Create(initial_size);
-}
-// Destroy an arena, returning the total number of bytes allocated
-inline size_t gpr_arena_destroy(gpr_arena* arena) { return arena->Destroy(); }
-// Allocate \a size bytes from the arena
-inline void* gpr_arena_alloc(gpr_arena* arena, size_t size) {
- return arena->Alloc(size);
-}
-
-#endif /* GRPC_CORE_LIB_GPR_ARENA_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/atm.cc b/contrib/libs/grpc/src/core/lib/gpr/atm.cc
index 649d400d38e..c40e97ea771 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/atm.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/atm.cc
@@ -28,7 +28,7 @@ gpr_atm gpr_atm_no_barrier_clamped_add(gpr_atm* value, gpr_atm delta,
gpr_atm new_value;
do {
current_value = gpr_atm_no_barrier_load(value);
- new_value = GPR_CLAMP(current_value + delta, min, max);
+ new_value = grpc_core::Clamp(current_value + delta, min, max);
if (new_value == current_value) break;
} while (!gpr_atm_no_barrier_cas(value, current_value, new_value));
return new_value;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/cpu_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/cpu_posix.cc
index 982ccbd6ffe..7a1d5460590 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/cpu_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/cpu_posix.cc
@@ -77,7 +77,7 @@ unsigned gpr_cpu_current_cpu(void) {
pthread_setspecific(thread_id_key, thread_id);
}
- return (unsigned)GPR_HASH_POINTER(thread_id, gpr_cpu_num_cores());
+ return (unsigned)grpc_core::HashPointer(thread_id, gpr_cpu_num_cores());
}
#endif /* GPR_CPU_POSIX */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/env_linux.cc b/contrib/libs/grpc/src/core/lib/gpr/env_linux.cc
index 6a78dc14155..4b332468104 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/env_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/env_linux.cc
@@ -25,8 +25,6 @@
#ifdef GPR_LINUX_ENV
-#include "src/core/lib/gpr/env.h"
-
#include <dlfcn.h>
#include <features.h>
#include <stdlib.h>
@@ -35,6 +33,7 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
diff --git a/contrib/libs/grpc/src/core/lib/gpr/env_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/env_posix.cc
index 232095b4e22..fb2a21c6699 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/env_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/env_posix.cc
@@ -20,13 +20,12 @@
#ifdef GPR_POSIX_ENV
-#include "src/core/lib/gpr/env.h"
-
#include <stdlib.h>
#include <grpc/support/log.h>
-
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
char* gpr_getenv(const char* name) {
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log.cc b/contrib/libs/grpc/src/core/lib/gpr/log.cc
index 9400f7c4bfa..d18f52b432d 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log.cc
@@ -18,6 +18,9 @@
#include <grpc/support/port_platform.h>
+#include <stdio.h>
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
@@ -25,9 +28,6 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/global_config.h"
-#include <stdio.h>
-#include <string.h>
-
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log_android.cc b/contrib/libs/grpc/src/core/lib/gpr/log_android.cc
index 40ef4c640da..11ffd64d604 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log_android.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log_android.cc
@@ -21,12 +21,13 @@
#ifdef GPR_ANDROID
#include <android/log.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
static android_LogPriority severity_to_log_priority(gpr_log_severity severity) {
switch (severity) {
case GPR_LOG_SEVERITY_DEBUG:
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc b/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
index 3949c128d6d..c71ef70e7f0 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log_linux.cc
@@ -28,9 +28,6 @@
#ifdef GPR_LINUX_LOG
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
@@ -42,6 +39,12 @@
#include <util/generic/string.h>
#include "y_absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity);
@@ -74,7 +77,7 @@ void gpr_default_log(gpr_log_func_args* args) {
time_t timer;
gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
struct tm tm;
- static __thread long tid = 0;
+ static GPR_THREAD_LOCAL(long) tid(0);
if (tid == 0) tid = sys_gettid();
timer = static_cast<time_t>(now.tv_sec);
diff --git a/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
index 600a1f7617c..1310ac8715b 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/log_posix.cc
@@ -20,18 +20,21 @@
#ifdef GPR_POSIX_LOG
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
+
#include <util/generic/string.h>
#include "y_absl/strings/str_format.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
#include "src/core/lib/gprpp/examine_stack.h"
int gpr_should_log_stacktrace(gpr_log_severity severity);
diff --git a/contrib/libs/grpc/src/core/lib/gpr/murmur_hash.cc b/contrib/libs/grpc/src/core/lib/gpr/murmur_hash.cc
index 95d11d3ce70..d4ede8feff4 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/murmur_hash.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/murmur_hash.cc
@@ -22,6 +22,8 @@
#include <string.h>
+#include "y_absl/base/attributes.h"
+
#define ROTL32(x, r) (((x) << (r)) | ((x) >> (32 - (r))))
#define FMIX32(h) \
@@ -61,10 +63,10 @@ uint32_t gpr_murmur_hash3(const void* key, size_t len, uint32_t seed) {
switch (len & 3) {
case 3:
k1 ^= (static_cast<uint32_t>(keyptr[2])) << 16;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 2:
k1 ^= (static_cast<uint32_t>(keyptr[1])) << 8;
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case 1:
k1 ^= keyptr[0];
k1 *= c1;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/string.cc b/contrib/libs/grpc/src/core/lib/gpr/string.cc
index 767a465e1bd..16fd687ffd3 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/string.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/string.cc
@@ -89,7 +89,7 @@ static dump_out dump_out_create(void) {
static void dump_out_append(dump_out* out, char c) {
if (out->length == out->capacity) {
- out->capacity = GPR_MAX(8, 2 * out->capacity);
+ out->capacity = std::max(size_t(8), 2 * out->capacity);
out->data = static_cast<char*>(gpr_realloc(out->data, out->capacity));
}
out->data[out->length++] = c;
@@ -290,7 +290,7 @@ static void add_string_to_split(const char* beg, const char* end, char*** strs,
memcpy(out, beg, static_cast<size_t>(end - beg));
out[end - beg] = 0;
if (*nstrs == *capstrs) {
- *capstrs = GPR_MAX(8, 2 * *capstrs);
+ *capstrs = std::max(size_t(8), 2 * *capstrs);
*strs = static_cast<char**>(gpr_realloc(*strs, sizeof(*strs) * *capstrs));
}
(*strs)[*nstrs] = out;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/string.h b/contrib/libs/grpc/src/core/lib/gpr/string.h
index ab9d16bbb29..03c01f9498d 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/string.h
+++ b/contrib/libs/grpc/src/core/lib/gpr/string.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/gpr_types.h>
-
#include <stdbool.h>
#include <stddef.h>
#include <util/generic/string.h>
+#include <grpc/impl/codegen/gpr_types.h>
+
/* String utility functions */
/* Flags for gpr_dump function. */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync.cc b/contrib/libs/grpc/src/core/lib/gpr/sync.cc
index 36c35da38df..28d506f7f90 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync.cc
@@ -20,12 +20,12 @@
#include <grpc/support/port_platform.h>
+#include <assert.h>
+
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include <assert.h>
-
/* Number of mutexes to allocate for events, to avoid lock contention.
Should be a prime. */
enum { event_sync_partitions = 31 };
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc b/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
index 982f748ee1f..03854947b9f 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync_abseil.cc
@@ -20,20 +20,21 @@
#if defined(GPR_ABSEIL_SYNC) && !defined(GPR_CUSTOM_SYNC)
-#include <grpc/support/alloc.h>
-
#include <errno.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
#include <time.h>
-#include "src/core/lib/profiling/timers.h"
#include "y_absl/base/call_once.h"
#include "y_absl/synchronization/mutex.h"
#include "y_absl/time/clock.h"
#include "y_absl/time/time.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/profiling/timers.h"
+
#ifdef GPR_LOW_LEVEL_COUNTERS
gpr_atm gpr_mu_locks = 0;
gpr_atm gpr_counter_atm_cas = 0;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
index fdd278be233..7ed5403a045 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/sync_posix.cc
@@ -21,14 +21,14 @@
#if defined(GPR_POSIX_SYNC) && !defined(GPR_ABSEIL_SYNC) && \
!defined(GPR_CUSTOM_SYNC)
+#include <errno.h>
+#include <time.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <errno.h>
-#include <time.h>
-
#include "src/core/lib/profiling/timers.h"
#ifdef GPR_LOW_LEVEL_COUNTERS
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time.cc b/contrib/libs/grpc/src/core/lib/gpr/time.cc
index 14df70d7d66..d796f41422b 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/time.cc
@@ -20,12 +20,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
int gpr_time_cmp(gpr_timespec a, gpr_timespec b) {
int cmp = (a.tv_sec > b.tv_sec) - (a.tv_sec < b.tv_sec);
GPR_ASSERT(a.clock_type == b.clock_type);
diff --git a/contrib/libs/grpc/src/core/lib/gpr/time_windows.cc b/contrib/libs/grpc/src/core/lib/gpr/time_windows.cc
index 247cc164682..39bca1b0940 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/time_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/time_windows.cc
@@ -22,12 +22,13 @@
#ifdef GPR_WINDOWS_TIME
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
#include <limits.h>
#include <process.h>
#include <sys/timeb.h>
+#include <grpc/support/log.h>
+#include <grpc/support/time.h>
+
#include "src/core/lib/gpr/time_precise.h"
static LARGE_INTEGER g_start_time;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls.h b/contrib/libs/grpc/src/core/lib/gpr/tls.h
index 5eb69512001..9c2349e597d 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/tls.h
+++ b/contrib/libs/grpc/src/core/lib/gpr/tls.h
@@ -21,52 +21,137 @@
#include <grpc/support/port_platform.h>
-/** Thread local storage.
-
- A minimal wrapper that should be implementable across many compilers,
- and implementable efficiently across most modern compilers.
-
- Thread locals have type intptr_t.
-
- Declaring a thread local variable 'foo':
- GPR_TLS_DECL(foo);
- Thread locals always have static scope.
-
- Declaring a thread local class variable 'foo':
- GPR_TLS_CLASS_DECL(foo);
-
- Defining the thread local class variable:
- GPR_TLS_CLASS_DEF(foo);
-
- Initializing a thread local (must be done at library initialization
- time):
- gpr_tls_init(&foo);
+#include <type_traits>
- Destroying a thread local:
- gpr_tls_destroy(&foo);
-
- Setting a thread local (returns new_value):
- gpr_tls_set(&foo, new_value);
+/** Thread local storage.
- Accessing a thread local:
- current_value = gpr_tls_get(&foo);
+ Usage is the same as C++ thread_local. Declaring a thread local:
+ static GPR_THREAD_LOCAL(uint32_t) foo;
ALL functions here may be implemented as macros. */
-#ifdef GPR_STDCPP_TLS
-#include "src/core/lib/gpr/tls_stdcpp.h"
-#endif
-
-#ifdef GPR_GCC_TLS
-#include "src/core/lib/gpr/tls_gcc.h"
-#endif
-
-#ifdef GPR_MSVC_TLS
-#include "src/core/lib/gpr/tls_msvc.h"
-#endif
+namespace grpc_core {
+
+// This class is never instantiated. It exists to statically ensure that all
+// TLS usage is compatible with the most restrictive implementation, allowing
+// developers to write correct code regardless of the platform they develop on.
+template <typename T>
+class TlsTypeConstrainer {
+ static_assert(std::is_trivial<T>::value,
+ "TLS support is limited to trivial types");
+
+ public:
+ using Type = T;
+};
+
+} // namespace grpc_core
+
+#if defined(GPR_PTHREAD_TLS)
+
+#include <pthread.h>
+
+#include <array>
+#include <cstring>
+
+#include <grpc/support/log.h> /* for GPR_ASSERT */
+
+namespace grpc_core {
+
+template <typename T>
+class PthreadTlsImpl : TlsTypeConstrainer<T> {
+ public:
+ PthreadTlsImpl(const PthreadTlsImpl&) = delete;
+ PthreadTlsImpl& operator=(const PthreadTlsImpl&) = delete;
+
+ // Achtung! This class emulates C++ `thread_local` using pthread keys. Each
+ // instance of this class is a stand in for a C++ `thread_local`. Think of
+ // each `thread_local` as a *global* pthread_key_t and a type tag. An
+ // important consequence of this is that the lifetime of a `pthread_key_t`
+ // is precisely the lifetime of an instance of this class. To understand why
+ // this is, consider the following scenario given a fictional implementation
+ // of this class which creates and destroys its `pthread_key_t` each time
+ // a given block of code runs (all actions take place on a single thread):
+ //
+ // - instance 1 (type tag = T*) is initialized, is assigned `pthread_key_t` 1
+ // - instance 2 (type tag = int) is initialized, is assigned `pthread_key_t` 2
+ // - instances 1 and 2 store and retrieve values; all is well
+ // - instances 1 and 2 are de-initialized; their keys are released to the pool
+ //
+ // - another run commences
+ // - instance 1 receives key 2
+ // - a value is read from instance 1, it observes a value of type int, but
+ // interprets it as T*; undefined behavior, kaboom
+ //
+ // To properly ensure these invariants are upheld the `pthread_key_t` must be
+ // `const`, which means it can only be released in the destructor. This is a
+ // a violation of the style guide, since these objects are always static (see
+ // footnote) but this code is used in sufficiently narrow circumstances to
+ // justify the deviation.
+ //
+ // https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
+ PthreadTlsImpl()
+ : keys_([]() {
+ typename std::remove_const<decltype(PthreadTlsImpl::keys_)>::type
+ keys;
+ for (pthread_key_t& key : keys) {
+ GPR_ASSERT(0 == pthread_key_create(&key, nullptr));
+ }
+ return keys;
+ }()) {}
+ PthreadTlsImpl(T t) : PthreadTlsImpl() { *this = t; }
+ ~PthreadTlsImpl() {
+ for (pthread_key_t key : keys_) {
+ GPR_ASSERT(0 == pthread_key_delete(key));
+ }
+ }
+
+ operator T() const {
+ T t;
+ char* dst = reinterpret_cast<char*>(&t);
+ for (pthread_key_t key : keys_) {
+ uintptr_t src = uintptr_t(pthread_getspecific(key));
+ size_t remaining = reinterpret_cast<char*>(&t + 1) - dst;
+ size_t step = std::min(sizeof(src), remaining);
+ memcpy(dst, &src, step);
+ dst += step;
+ }
+ return t;
+ }
+
+ T operator->() const {
+ static_assert(std::is_pointer<T>::value,
+ "operator-> only usable on pointers");
+ return this->operator T();
+ }
+
+ T operator=(T t) {
+ char* src = reinterpret_cast<char*>(&t);
+ for (pthread_key_t key : keys_) {
+ uintptr_t dst;
+ size_t remaining = reinterpret_cast<char*>(&t + 1) - src;
+ size_t step = std::min(sizeof(dst), remaining);
+ memcpy(&dst, src, step);
+ GPR_ASSERT(0 == pthread_setspecific(key, reinterpret_cast<void*>(dst)));
+ src += step;
+ }
+ return t;
+ }
+
+ private:
+ const std::array<pthread_key_t,
+ (sizeof(T) + sizeof(void*) - 1) / sizeof(void*)>
+ keys_;
+};
+
+} // namespace grpc_core
+
+#define GPR_THREAD_LOCAL(type) grpc_core::PthreadTlsImpl<type>
+
+#else
+
+#define GPR_THREAD_LOCAL(type) \
+ thread_local typename grpc_core::TlsTypeConstrainer<type>::Type
-#ifdef GPR_PTHREAD_TLS
-#include "src/core/lib/gpr/tls_pthread.h"
#endif
#endif /* GRPC_CORE_LIB_GPR_TLS_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls_gcc.h b/contrib/libs/grpc/src/core/lib/gpr/tls_gcc.h
deleted file mode 100644
index 72b360b0211..00000000000
--- a/contrib/libs/grpc/src/core/lib/gpr/tls_gcc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPR_TLS_GCC_H
-#define GRPC_CORE_LIB_GPR_TLS_GCC_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stdbool.h>
-
-#include <grpc/support/log.h>
-
-/** Thread local storage based on gcc compiler primitives.
- #include tls.h to use this - and see that file for documentation */
-
-struct gpr_gcc_thread_local {
- intptr_t value;
-};
-
-#define GPR_TLS_DECL(name) \
- static __thread struct gpr_gcc_thread_local name = {0}
-
-#define GPR_TLS_CLASS_DECL(name) \
- static __thread struct gpr_gcc_thread_local name
-
-#define GPR_TLS_CLASS_DEF(name) __thread struct gpr_gcc_thread_local name = {0}
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value))
-#define gpr_tls_get(tls) ((tls)->value)
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_GCC_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls_msvc.h b/contrib/libs/grpc/src/core/lib/gpr/tls_msvc.h
deleted file mode 100644
index 73e67345d6e..00000000000
--- a/contrib/libs/grpc/src/core/lib/gpr/tls_msvc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPR_TLS_MSVC_H
-#define GRPC_CORE_LIB_GPR_TLS_MSVC_H
-
-/** Thread local storage based on ms visual c compiler primitives.
-#include <grpc/support/port_platform.h>
-
- #include tls.h to use this - and see that file for documentation */
-
-#include <cstdint>
-
-struct gpr_msvc_thread_local {
- intptr_t value;
-};
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) \
- static __declspec(thread) struct gpr_msvc_thread_local name = {0}
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) \
- static __declspec(thread) struct gpr_msvc_thread_local name
-
-#define GPR_TLS_CLASS_DEF(name) \
- __declspec(thread) struct gpr_msvc_thread_local name = {0}
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-#define gpr_tls_set(tls, new_value) (((tls)->value) = (new_value))
-#define gpr_tls_get(tls) ((tls)->value)
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_MSVC_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.h b/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.h
deleted file mode 100644
index a15f2f33897..00000000000
--- a/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPR_TLS_PTHREAD_H
-#define GRPC_CORE_LIB_GPR_TLS_PTHREAD_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/support/log.h> /* for GPR_ASSERT */
-#include <pthread.h>
-
-/** Thread local storage based on pthread library calls.
- #include tls.h to use this - and see that file for documentation */
-
-struct gpr_pthread_thread_local {
- pthread_key_t key;
-};
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) static struct gpr_pthread_thread_local name = {0}
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) static struct gpr_pthread_thread_local name
-
-/** Use GPR_TLS_CLASS_DEF to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DEF(name) struct gpr_pthread_thread_local name = {0}
-
-#define gpr_tls_init(tls) GPR_ASSERT(0 == pthread_key_create(&(tls)->key, NULL))
-#define gpr_tls_destroy(tls) pthread_key_delete((tls)->key)
-#define gpr_tls_get(tls) ((intptr_t)pthread_getspecific((tls)->key))
-#ifdef __cplusplus
-extern "C" {
-#endif
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value);
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_PTHREAD_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls_stdcpp.h b/contrib/libs/grpc/src/core/lib/gpr/tls_stdcpp.h
deleted file mode 100644
index b5b422a5c87..00000000000
--- a/contrib/libs/grpc/src/core/lib/gpr/tls_stdcpp.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2020 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPR_TLS_STDCPP_H
-#define GRPC_CORE_LIB_GPR_TLS_STDCPP_H
-
-#include <grpc/support/port_platform.h>
-
-/** Thread local storage based on C++ thread_local.
- #include tls.h to use this - and see that file for documentation */
-
-/** Use GPR_TLS_DECL to declare tls static variables outside a class */
-#define GPR_TLS_DECL(name) thread_local static intptr_t name = 0
-
-/** Use GPR_TLS_CLASS_DECL to declare tls static variable members of a class.
- * GPR_TLS_CLASS_DEF needs to be called to define this member. */
-#define GPR_TLS_CLASS_DECL(name) thread_local static intptr_t name
-
-#define GPR_TLS_CLASS_DEF(name) thread_local intptr_t name = 0
-
-#define gpr_tls_init(tls) \
- do { \
- } while (0)
-
-#define gpr_tls_destroy(tls) \
- do { \
- } while (0)
-
-#define gpr_tls_set(tls, new_value) (*(tls) = (new_value))
-
-#define gpr_tls_get(tls) (*(tls))
-
-#endif /* GRPC_CORE_LIB_GPR_TLS_STDCPP_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc b/contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc
index ffdad335d67..166cdf68f24 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/tmpfile_posix.cc
@@ -20,8 +20,6 @@
#ifdef GPR_POSIX_TMPFILE
-#include "src/core/lib/gpr/tmpfile.h"
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -32,6 +30,7 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gpr/tmpfile.h"
FILE* gpr_tmpfile(const char* prefix, char** tmp_filename) {
FILE* result = nullptr;
diff --git a/contrib/libs/grpc/src/core/lib/gpr/useful.h b/contrib/libs/grpc/src/core/lib/gpr/useful.h
index 8382a50e8db..2e0025752bb 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/useful.h
+++ b/contrib/libs/grpc/src/core/lib/gpr/useful.h
@@ -19,48 +19,95 @@
#ifndef GRPC_CORE_LIB_GPR_USEFUL_H
#define GRPC_CORE_LIB_GPR_USEFUL_H
-/** useful macros that don't belong anywhere else */
+#include <grpc/support/port_platform.h>
+
+#include <cstddef>
+
+/** useful utilities that don't belong anywhere else */
+
+namespace grpc_core {
+
+template <typename T>
+T Clamp(T val, T min, T max) {
+ if (val < min) return min;
+ if (max < val) return max;
+ return val;
+}
-#define GPR_MIN(a, b) ((a) < (b) ? (a) : (b))
-#define GPR_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define GPR_CLAMP(a, min, max) ((a) < (min) ? (min) : (a) > (max) ? (max) : (a))
/** rotl, rotr assume x is unsigned */
-#define GPR_ROTL(x, n) (((x) << (n)) | ((x) >> (sizeof(x) * 8 - (n))))
-#define GPR_ROTR(x, n) (((x) >> (n)) | ((x) << (sizeof(x) * 8 - (n))))
+template <typename T>
+constexpr T RotateLeft(T x, T n) {
+ return ((x << n) | (x >> (sizeof(x) * 8 - n)));
+}
+template <typename T>
+constexpr T RotateRight(T x, T n) {
+ return ((x >> n) | (x << (sizeof(x) * 8 - n)));
+}
-#define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array)))
+// Set the n-th bit of i
+template <typename T>
+T SetBit(T* i, size_t n) {
+ return *i |= (T(1) << n);
+}
+
+// Clear the n-th bit of i
+template <typename T>
+T ClearBit(T* i, size_t n) {
+ return *i &= ~(T(1) << n);
+}
-#define GPR_SWAP(type, a, b) \
- do { \
- type x = a; \
- (a) = b; \
- (b) = x; \
- } while (0)
+// Get the n-th bit of i
+template <typename T>
+bool GetBit(T i, size_t n) {
+ return (i & (T(1) << n)) != 0;
+}
-/** Set the \a n-th bit of \a i (a mutable pointer). */
-#define GPR_BITSET(i, n) ((*(i)) |= (1u << (n)))
+namespace useful_detail {
+inline constexpr uint32_t HexdigitBitcount(uint32_t x) {
+ return (x - ((x >> 1) & 0x77777777) - ((x >> 2) & 0x33333333) -
+ ((x >> 3) & 0x11111111));
+}
+} // namespace useful_detail
-/** Clear the \a n-th bit of \a i (a mutable pointer). */
-#define GPR_BITCLEAR(i, n) ((*(i)) &= ~(1u << (n)))
+inline constexpr uint32_t BitCount(uint32_t i) {
+ return (((useful_detail::HexdigitBitcount(i) +
+ (useful_detail::HexdigitBitcount(i) >> 4)) &
+ 0x0f0f0f0f) %
+ 255);
+}
-/** Get the \a n-th bit of \a i */
-#define GPR_BITGET(i, n) (((i) & (1u << (n))) != 0)
+inline constexpr uint32_t BitCount(uint64_t i) {
+ return BitCount(uint32_t(i)) + BitCount(uint32_t(i >> 32));
+}
-#define GPR_INTERNAL_HEXDIGIT_BITCOUNT(x) \
- ((x) - (((x) >> 1) & 0x77777777) - (((x) >> 2) & 0x33333333) - \
- (((x) >> 3) & 0x11111111))
+inline constexpr uint32_t BitCount(uint16_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(uint8_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(int64_t i) { return BitCount(uint64_t(i)); }
+inline constexpr uint32_t BitCount(int32_t i) { return BitCount(uint32_t(i)); }
+inline constexpr uint32_t BitCount(int16_t i) { return BitCount(uint16_t(i)); }
+inline constexpr uint32_t BitCount(int8_t i) { return BitCount(uint8_t(i)); }
-/** Returns number of bits set in bitset \a i */
-#define GPR_BITCOUNT(i) \
- (((GPR_INTERNAL_HEXDIGIT_BITCOUNT(i) + \
- (GPR_INTERNAL_HEXDIGIT_BITCOUNT(i) >> 4)) & \
- 0x0f0f0f0f) % \
- 255)
+// This function uses operator< to implement a qsort-style comparison, whereby:
+// if a is smaller than b, a number smaller than 0 is returned.
+// if a is bigger than b, a number greater than 0 is returned.
+// if a is neither smaller nor bigger than b, 0 is returned.
+template <typename T>
+int QsortCompare(const T& a, const T& b) {
+ if (a < b) return -1;
+ if (b < a) return 1;
+ return 0;
+}
-#define GPR_ICMP(a, b) ((a) < (b) ? -1 : ((a) > (b) ? 1 : 0))
+template <typename T>
+constexpr size_t HashPointer(T* p, size_t range) {
+ return (((reinterpret_cast<size_t>(p)) >> 4) ^
+ ((reinterpret_cast<size_t>(p)) >> 9) ^
+ ((reinterpret_cast<size_t>(p)) >> 14)) %
+ range;
+}
-#define GPR_HASH_POINTER(x, range) \
- (((((size_t)(x)) >> 4) ^ (((size_t)(x)) >> 9) ^ (((size_t)(x)) >> 14)) % \
- (range))
+} // namespace grpc_core
+
+#define GPR_ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array)))
#endif /* GRPC_CORE_LIB_GPR_USEFUL_H */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/wrap_memcpy.cc b/contrib/libs/grpc/src/core/lib/gpr/wrap_memcpy.cc
index 9b8608e056c..51efc93aa61 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/wrap_memcpy.cc
+++ b/contrib/libs/grpc/src/core/lib/gpr/wrap_memcpy.cc
@@ -28,7 +28,8 @@
extern "C" {
#ifdef __linux__
-#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT)
+#if defined(__x86_64__) && !defined(GPR_MUSL_LIBC_COMPAT) && \
+ !defined(__ANDROID__)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
void* __wrap_memcpy(void* destination, const void* source, size_t num) {
return memcpy(destination, source, num);
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/arena.cc b/contrib/libs/grpc/src/core/lib/gprpp/arena.cc
index 61688258a1c..9e979de39ae 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/arena.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/arena.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/gprpp/arena.h"
#include <string.h>
+
#include <new>
#include <grpc/support/alloc.h>
@@ -75,7 +76,7 @@ std::pair<Arena*, void*> Arena::CreateWithAlloc(size_t initial_size,
}
size_t Arena::Destroy() {
- size_t size = total_used_.Load(MemoryOrder::RELAXED);
+ size_t size = total_used_.load(std::memory_order_relaxed);
this->~Arena();
gpr_free_aligned(this);
return size;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/arena.h b/contrib/libs/grpc/src/core/lib/gprpp/arena.h
index baca5a75e86..3967f2f8e85 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/arena.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/arena.h
@@ -27,6 +27,10 @@
#include <grpc/support/port_platform.h>
+#include <stddef.h>
+
+#include <atomic>
+#include <memory>
#include <new>
#include <utility>
@@ -35,9 +39,6 @@
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/gpr/spinlock.h"
-#include "src/core/lib/gprpp/atomic.h"
-
-#include <stddef.h>
namespace grpc_core {
@@ -59,7 +60,7 @@ class Arena {
static constexpr size_t base_size =
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(Arena));
size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(size);
- size_t begin = total_used_.FetchAdd(size, MemoryOrder::RELAXED);
+ size_t begin = total_used_.fetch_add(size, std::memory_order_relaxed);
if (begin + size <= initial_zone_size_) {
return reinterpret_cast<char*>(this) + base_size + begin;
} else {
@@ -105,7 +106,7 @@ class Arena {
// Keep track of the total used size. We use this in our call sizing
// hysteresis.
- Atomic<size_t> total_used_;
+ std::atomic<size_t> total_used_{0};
const size_t initial_zone_size_;
gpr_spinlock arena_growth_spinlock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
// If the initial arena allocation wasn't enough, we allocate additional zones
@@ -116,6 +117,15 @@ class Arena {
Zone* last_zone_ = nullptr;
};
+// Smart pointer for arenas when the final size is not required.
+struct ScopedArenaDeleter {
+ void operator()(Arena* arena) { arena->Destroy(); }
+};
+using ScopedArenaPtr = std::unique_ptr<Arena, ScopedArenaDeleter>;
+inline ScopedArenaPtr MakeScopedArena(size_t initial_size) {
+ return ScopedArenaPtr(Arena::Create(initial_size));
+}
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_ARENA_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/atomic.h b/contrib/libs/grpc/src/core/lib/gprpp/atomic.h
deleted file mode 100644
index dd99d9ed4d7..00000000000
--- a/contrib/libs/grpc/src/core/lib/gprpp/atomic.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_GPRPP_ATOMIC_H
-#define GRPC_CORE_LIB_GPRPP_ATOMIC_H
-
-#include <grpc/support/port_platform.h>
-
-#include <atomic>
-
-#include <grpc/support/atm.h>
-
-namespace grpc_core {
-
-enum class MemoryOrder {
- RELAXED = static_cast<int>(std::memory_order_relaxed),
- CONSUME = static_cast<int>(std::memory_order_consume),
- ACQUIRE = static_cast<int>(std::memory_order_acquire),
- RELEASE = static_cast<int>(std::memory_order_release),
- ACQ_REL = static_cast<int>(std::memory_order_acq_rel),
- SEQ_CST = static_cast<int>(std::memory_order_seq_cst)
-};
-
-template <typename T>
-class Atomic {
- public:
- explicit Atomic(T val = T()) : storage_(val) {}
-
- T Load(MemoryOrder order) const {
- return storage_.load(static_cast<std::memory_order>(order));
- }
-
- void Store(T val, MemoryOrder order) {
- storage_.store(val, static_cast<std::memory_order>(order));
- }
-
- T Exchange(T desired, MemoryOrder order) {
- return storage_.exchange(desired, static_cast<std::memory_order>(order));
- }
-
- bool CompareExchangeWeak(T* expected, T desired, MemoryOrder success,
- MemoryOrder failure) {
- return GPR_ATM_INC_CAS_THEN(storage_.compare_exchange_weak(
- *expected, desired, static_cast<std::memory_order>(success),
- static_cast<std::memory_order>(failure)));
- }
-
- bool CompareExchangeStrong(T* expected, T desired, MemoryOrder success,
- MemoryOrder failure) {
- return GPR_ATM_INC_CAS_THEN(storage_.compare_exchange_strong(
- *expected, desired, static_cast<std::memory_order>(success),
- static_cast<std::memory_order>(failure)));
- }
-
- template <typename Arg>
- T FetchAdd(Arg arg, MemoryOrder order = MemoryOrder::SEQ_CST) {
- return GPR_ATM_INC_ADD_THEN(storage_.fetch_add(
- static_cast<Arg>(arg), static_cast<std::memory_order>(order)));
- }
-
- template <typename Arg>
- T FetchSub(Arg arg, MemoryOrder order = MemoryOrder::SEQ_CST) {
- return GPR_ATM_INC_ADD_THEN(storage_.fetch_sub(
- static_cast<Arg>(arg), static_cast<std::memory_order>(order)));
- }
-
- // Atomically increment a counter only if the counter value is not zero.
- // Returns true if increment took place; false if counter is zero.
- bool IncrementIfNonzero() {
- T count = storage_.load(std::memory_order_acquire);
- do {
- // If zero, we are done (without an increment). If not, we must do a CAS
- // to maintain the contract: do not increment the counter if it is already
- // zero
- if (count == 0) {
- return false;
- }
- } while (!CompareExchangeWeak(&count, count + 1, MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
- return true;
- }
-
- private:
- std::atomic<T> storage_;
-};
-
-} // namespace grpc_core
-
-#endif /* GRPC_CORE_LIB_GPRPP_ATOMIC_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/atomic_utils.h b/contrib/libs/grpc/src/core/lib/gprpp/atomic_utils.h
new file mode 100644
index 00000000000..c059ade62fc
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/atomic_utils.h
@@ -0,0 +1,47 @@
+/*
+ *
+ * Copyright 2017 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H
+#define GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+namespace grpc_core {
+
+// Atomically increment a counter only if the counter value is not zero.
+// Returns true if increment took place; false if counter is zero.
+template <typename T>
+inline bool IncrementIfNonzero(std::atomic<T>* p) {
+ T count = p->load(std::memory_order_acquire);
+ do {
+ // If zero, we are done (without an increment). If not, we must do a CAS
+ // to maintain the contract: do not increment the counter if it is already
+ // zero
+ if (count == 0) {
+ return false;
+ }
+ } while (!p->compare_exchange_weak(
+ count, count + 1, std::memory_order_acq_rel, std::memory_order_acquire));
+ return true;
+}
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_GPRPP_ATOMIC_UTILS_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/bitset.h b/contrib/libs/grpc/src/core/lib/gprpp/bitset.h
new file mode 100644
index 00000000000..1732f4e0e4e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/bitset.h
@@ -0,0 +1,188 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_BITSET_H
+#define GRPC_CORE_LIB_GPRPP_BITSET_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "src/core/lib/gpr/useful.h"
+
+#if __cplusplus > 201103l
+#define GRPC_BITSET_CONSTEXPR_MUTATOR constexpr
+#else
+#define GRPC_BITSET_CONSTEXPR_MUTATOR
+#endif
+
+namespace grpc_core {
+
+// Given a bit count as an integer, vend as member type `Type` a type with
+// exactly that number of bits. Undefined if that bit count is not available.
+template <size_t kBits>
+struct UintSelector;
+template <>
+struct UintSelector<8> {
+ typedef uint8_t Type;
+};
+template <>
+struct UintSelector<16> {
+ typedef uint16_t Type;
+};
+template <>
+struct UintSelector<32> {
+ typedef uint32_t Type;
+};
+template <>
+struct UintSelector<64> {
+ typedef uint64_t Type;
+};
+
+// An unsigned integer of some number of bits.
+template <size_t kBits>
+using Uint = typename UintSelector<kBits>::Type;
+
+// Given the total number of bits that need to be stored, choose the size of
+// 'unit' for a BitSet... We'll use an array of units to store the total set.
+// For small bit counts we are selective in the type to try and balance byte
+// size and performance
+// - the details will likely be tweaked into the future.
+// Once we get over 96 bits, we just use uint64_t for everything.
+constexpr size_t ChooseUnitBitsForBitSet(size_t total_bits) {
+ return total_bits <= 8 ? 8
+ : total_bits <= 16 ? 16
+ : total_bits <= 24 ? 8
+ : total_bits <= 32 ? 32
+ : total_bits <= 48 ? 16
+ : total_bits <= 64 ? 64
+ : total_bits <= 96 ? 32
+ : 64;
+}
+
+// A BitSet that's configurable.
+// Contains storage for kTotalBits, stored as an array of integers of size
+// kUnitBits. e.g. to store 72 bits in 8 bit chunks, we'd say BitSet<72, 8>.
+// Since most users shouldn't care about the size of unit used, we default
+// kUnitBits to whatever is selected by ChooseUnitBitsForBitSet
+template <size_t kTotalBits,
+ size_t kUnitBits = ChooseUnitBitsForBitSet(kTotalBits)>
+class BitSet {
+ static constexpr size_t kUnits = (kTotalBits + kUnitBits - 1) / kUnitBits;
+
+ public:
+ // Initialize to all bits false
+ constexpr BitSet() : units_{} {}
+
+ // Set bit i to true
+ GRPC_BITSET_CONSTEXPR_MUTATOR void set(int i) {
+ units_[unit_for(i)] |= mask_for(i);
+ }
+
+ // Set bit i to is_set
+ GRPC_BITSET_CONSTEXPR_MUTATOR void set(int i, bool is_set) {
+ if (is_set) {
+ set(i);
+ } else {
+ clear(i);
+ }
+ }
+
+ // Set bit i to false
+ GRPC_BITSET_CONSTEXPR_MUTATOR void clear(int i) {
+ units_[unit_for(i)] &= ~mask_for(i);
+ }
+
+ // Return true if bit i is set
+ constexpr bool is_set(int i) const {
+ return (units_[unit_for(i)] & mask_for(i)) != 0;
+ }
+
+ // Return true if all bits are set
+ bool all() const {
+ if (kTotalBits % kUnitBits == 0) {
+ // kTotalBits is a multiple of kUnitBits ==> we can just check for all
+ // ones in each unit.
+ for (size_t i = 0; i < kUnits; i++) {
+ if (units_[i] != all_ones()) return false;
+ }
+ return true;
+ } else {
+ // kTotalBits is not a multiple of kUnitBits ==> we need special handling
+ // for checking partial filling of the last unit (since not all of its
+ // bits are used!)
+ for (size_t i = 0; i < kUnits - 1; i++) {
+ if (units_[i] != all_ones()) return false;
+ }
+ return units_[kUnits - 1] == n_ones(kTotalBits % kUnitBits);
+ }
+ }
+
+ // Return true if *no* bits are set.
+ bool none() const {
+ for (size_t i = 0; i < kUnits; i++) {
+ if (units_[i] != 0) return false;
+ }
+ return true;
+ }
+
+ // Return a count of how many bits are set.
+ uint32_t count() const {
+ uint32_t count = 0;
+ for (size_t i = 0; i < kUnits; i++) {
+ count += BitCount(units_[i]);
+ }
+ return count;
+ }
+
+ private:
+ // Given a bit index, return which unit it's stored in.
+ static constexpr size_t unit_for(size_t bit) { return bit / kUnitBits; }
+
+ // Given a bit index, return a mask to access that bit within it's unit.
+ static constexpr Uint<kUnitBits> mask_for(size_t bit) {
+ return Uint<kUnitBits>{1} << (bit % kUnitBits);
+ }
+
+ // Return a value that is all ones
+ static constexpr Uint<kUnitBits> all_ones() {
+ return Uint<kUnitBits>(~Uint<kUnitBits>(0));
+ }
+
+ // Return a value with n bottom bits ones
+ static constexpr Uint<kUnitBits> n_ones(size_t n) {
+ return n == kUnitBits ? all_ones() : (Uint<kUnitBits>(1) << n) - 1;
+ }
+
+ // The set of units - kUnitBits sized integers that store kUnitBits bits!
+ Uint<kUnitBits> units_[kUnits];
+};
+
+// Zero-size specialization of BitSet.
+// Useful for generic programming.
+// Make a compile time error out of get/set type accesses, and hard-codes
+// queries that do make sense.
+template <>
+class BitSet<0> {
+ public:
+ constexpr BitSet() {}
+
+ bool all() const { return true; }
+ bool none() const { return true; }
+ uint32_t count() const { return 0; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_BITSET_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/capture.h b/contrib/libs/grpc/src/core/lib/gprpp/capture.h
new file mode 100644
index 00000000000..07949fd1c91
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/capture.h
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_CAPTURE_H
+#define GRPC_CORE_LIB_GPRPP_CAPTURE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <utility>
+
+#include "y_absl/utility/utility.h"
+
+namespace grpc_core {
+
+namespace detail {
+
+template <typename F, typename... Captures>
+class Capture {
+ public:
+ explicit Capture(F f, Captures... captures)
+ : f_(std::move(f)), captures_(std::move(captures)...) {}
+
+ template <typename... Args>
+ decltype(std::declval<F>()(static_cast<Captures*>(nullptr)...,
+ std::declval<Args>()...))
+ operator()(Args... args) {
+ auto f = &f_;
+ return y_absl::apply(
+ [f, &args...](Captures&... captures) {
+ return (*f)(&captures..., std::move(args)...);
+ },
+ captures_);
+ }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+ GPR_NO_UNIQUE_ADDRESS std::tuple<Captures...> captures_;
+};
+
+} // namespace detail
+
+// C++11 helper - best explained by usage:
+//
+// BigThing big_thing;
+// auto f = Capture(
+// [](BigThing* c, int a, int b) { /*...*/ },
+// std::move(big_thing));
+//
+// results in: f being a callable that takes arguments (int a, int b), and
+// captures the original value of big_thing by move. Each call, a pointer to
+// each captured thing is inserted into the argument list at the beginning so it
+// can be manipulated.
+//
+// Captured values are mutable, and it's the users responsibility to ensure,
+// should this callable be invoked from different threads, that proper locking
+// is implemented.
+template <typename F, typename... Captures>
+detail::Capture<F, Captures...> Capture(F f, Captures... captures) {
+ return detail::Capture<F, Captures...>(std::move(f), std::move(captures)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CAPTURE_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/chunked_vector.h b/contrib/libs/grpc/src/core/lib/gprpp/chunked_vector.h
new file mode 100644
index 00000000000..256fa908b4e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/chunked_vector.h
@@ -0,0 +1,211 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
+#define GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/gprpp/manual_constructor.h"
+
+namespace grpc_core {
+
+// Arena-friendly vector type.
+// This "vector" allocates non-contiguous runs of kChunkSize T's at a time.
+// Expectation is that most usage will fit in one chunk, sometimes two will be
+// needed, and very rarely three. Appending is constant time, calculating the
+// size is O(n_chunks).
+template <typename T, size_t kChunkSize>
+class ChunkedVector {
+ private:
+ // One chunk of allocated memory.
+ struct Chunk {
+ Chunk() = default;
+ Chunk* next = nullptr;
+ size_t count = 0;
+ ManualConstructor<T> data[kChunkSize];
+ };
+
+ public:
+ explicit ChunkedVector(Arena* arena) : arena_(arena) {}
+ template <class Iterator>
+ ChunkedVector(Arena* arena, Iterator begin, Iterator end) : arena_(arena) {
+ for (; begin != end; ++begin) {
+ EmplaceBack(*begin);
+ }
+ }
+ ChunkedVector(const ChunkedVector& other)
+ : ChunkedVector(other.arena_, other.begin(), other.end()) {}
+ ChunkedVector& operator=(ChunkedVector other) {
+ Swap(&other);
+ return *this;
+ }
+ ChunkedVector(ChunkedVector&& other) noexcept
+ : arena_(other.arena_), first_(other.first_), append_(other.append_) {
+ other.first_ = nullptr;
+ other.append_ = nullptr;
+ }
+ ChunkedVector& operator=(ChunkedVector&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+ ~ChunkedVector() { Clear(); }
+ void Swap(ChunkedVector* other) {
+ std::swap(other->arena_, arena_);
+ std::swap(other->first_, first_);
+ std::swap(other->append_, append_);
+ }
+
+ Arena* arena() const { return arena_; }
+
+ // Append a new element to the end of the vector.
+ template <typename... Args>
+ T* EmplaceBack(Args&&... args) {
+ auto* p = AppendSlot();
+ p->Init(std::forward<Args>(args)...);
+ return &**p;
+ }
+
+ // Remove the last element and return it.
+ T PopBack() {
+ GPR_ASSERT(append_ != nullptr);
+ if (append_->count == 0) {
+ GPR_ASSERT(first_ != append_);
+ Chunk* chunk = first_;
+ while (chunk->next != append_) {
+ chunk = chunk->next;
+ }
+ append_ = chunk;
+ }
+ const auto last = append_->count - 1;
+ T result = std::move(*append_->data[last]);
+ append_->data[last].Destroy();
+ append_->count = last;
+ return result;
+ }
+
+ void Clear() {
+ Chunk* chunk = first_;
+ while (chunk != nullptr && chunk->count != 0) {
+ for (size_t i = 0; i < chunk->count; i++) {
+ chunk->data[i].Destroy();
+ }
+ chunk->count = 0;
+ chunk = chunk->next;
+ }
+ append_ = first_;
+ }
+
+ // Forward-only iterator.
+ class ForwardIterator {
+ public:
+ ForwardIterator(Chunk* chunk, size_t n) : chunk_(chunk), n_(n) {}
+
+ T& operator*() const { return *chunk_->data[n_]; }
+ T* operator->() const { return &*chunk_->data[n_]; }
+ ForwardIterator& operator++() {
+ ++n_;
+ while (chunk_ != nullptr && n_ == chunk_->count) {
+ chunk_ = chunk_->next;
+ n_ = 0;
+ }
+ return *this;
+ }
+ bool operator==(const ForwardIterator& other) const {
+ return chunk_ == other.chunk_ && n_ == other.n_;
+ }
+ bool operator!=(const ForwardIterator& other) const {
+ return !(*this == other);
+ }
+
+ private:
+ Chunk* chunk_;
+ size_t n_;
+ };
+
+ // Const Forward-only iterator.
+ class ConstForwardIterator {
+ public:
+ ConstForwardIterator(const Chunk* chunk, size_t n) : chunk_(chunk), n_(n) {}
+
+ const T& operator*() const { return *chunk_->data[n_]; }
+ const T* operator->() const { return &*chunk_->data[n_]; }
+ ConstForwardIterator& operator++() {
+ ++n_;
+ while (chunk_ != nullptr && n_ == chunk_->count) {
+ chunk_ = chunk_->next;
+ n_ = 0;
+ }
+ return *this;
+ }
+ bool operator==(const ConstForwardIterator& other) const {
+ return chunk_ == other.chunk_ && n_ == other.n_;
+ }
+ bool operator!=(const ConstForwardIterator& other) const {
+ return !(*this == other);
+ }
+
+ private:
+ const Chunk* chunk_;
+ size_t n_;
+ };
+
+ ForwardIterator begin() {
+ if (first_ != nullptr && first_->count == 0) return end();
+ return ForwardIterator(first_, 0);
+ }
+ ForwardIterator end() { return ForwardIterator(nullptr, 0); }
+
+ ConstForwardIterator begin() const {
+ if (first_ != nullptr && first_->count == 0) return cend();
+ return ConstForwardIterator(first_, 0);
+ }
+ ConstForwardIterator end() const { return ConstForwardIterator(nullptr, 0); }
+
+ ConstForwardIterator cbegin() const { return begin(); }
+ ConstForwardIterator cend() const { return end(); }
+
+ // Count the number of elements in the vector.
+ size_t size() const {
+ size_t n = 0;
+ for (const Chunk* chunk = first_; chunk != nullptr; chunk = chunk->next) {
+ n += chunk->count;
+ }
+ return n;
+ }
+
+ private:
+ ManualConstructor<T>* AppendSlot() {
+ if (append_ == nullptr) {
+ GPR_ASSERT(first_ == nullptr);
+ first_ = arena_->New<Chunk>();
+ append_ = first_;
+ } else if (append_->count == kChunkSize) {
+ if (append_->next == nullptr) {
+ append_->next = arena_->New<Chunk>();
+ }
+ append_ = append_->next;
+ }
+ return &append_->data[append_->count++];
+ }
+
+ Arena* arena_;
+ Chunk* first_ = nullptr;
+ Chunk* append_ = nullptr;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
diff --git a/contrib/libs/grpc/src/core/lib/transport/authority_override.cc b/contrib/libs/grpc/src/core/lib/gprpp/construct_destruct.h
index b902c33216d..73fdb1f3d53 100644
--- a/contrib/libs/grpc/src/core/lib/transport/authority_override.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/construct_destruct.h
@@ -1,5 +1,4 @@
-//
-// Copyright 2020 gRPC authors.
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,29 +11,29 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-//
-
-#include <grpc/support/port_platform.h>
-#include "y_absl/strings/string_view.h"
+#ifndef GRPC_CORE_LIB_GPRPP_CONSTRUCT_DESTRUCT_H
+#define GRPC_CORE_LIB_GPRPP_CONSTRUCT_DESTRUCT_H
-#include "src/core/lib/channel/channel_args.h"
+#include <grpc/support/port_platform.h>
-// Channel arg key for the authority override.
-#define GRPC_ARG_AUTHORITY_OVERRIDE "grpc.authority_override"
+#include <utility>
namespace grpc_core {
-grpc_arg CreateAuthorityOverrideChannelArg(const char* authority) {
- return grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_AUTHORITY_OVERRIDE),
- const_cast<char*>(authority));
+// Call the destructor of p without having to name the type of p.
+template <typename T>
+void Destruct(T* p) {
+ p->~T();
}
-y_absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args) {
- const char* found =
- grpc_channel_args_find_string(args, GRPC_ARG_AUTHORITY_OVERRIDE);
- return found == nullptr ? "" : found;
+// Call the constructor of p without having to name the type of p and forward
+// any arguments
+template <typename T, typename... Args>
+void Construct(T* p, Args&&... args) {
+ new (p) T(std::forward<Args>(args)...);
}
} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CONSTRUCT_DESTRUCT_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/cpp_impl_of.h b/contrib/libs/grpc/src/core/lib/gprpp/cpp_impl_of.h
new file mode 100644
index 00000000000..8d61dc8adf6
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/cpp_impl_of.h
@@ -0,0 +1,45 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_CPP_IMPL_OF_H
+#define GRPC_CORE_LIB_GPRPP_CPP_IMPL_OF_H
+
+namespace grpc_core {
+
+// Declares CppType to be the backing implementation of CType.
+// Use via the curiously recursive template:
+// class Foo : public CppImplOf<Foo, grpc_foo> {};
+// Provides casting methods each way.
+// grpc_foo should be `typedef struct grpc_foo grpc_foo` and otherwise
+// not defined.
+template <typename CppType, typename CType>
+class CppImplOf {
+ public:
+ // Convert the C struct to C++
+ static CppType* FromC(CType* c_type) {
+ return reinterpret_cast<CppType*>(c_type);
+ }
+
+ // Retrieve a c pointer (of the same ownership as this)
+ CType* c_ptr() {
+ return reinterpret_cast<CType*>(static_cast<CppType*>(this));
+ }
+
+ protected:
+ ~CppImplOf() = default;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_CPP_IMPL_OF_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h b/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
index 5217bfa1067..560e08d04bf 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/dual_ref_counted.h
@@ -19,15 +19,14 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
#include <atomic>
#include <cassert>
#include <cinttypes>
-#include "src/core/lib/gprpp/atomic.h"
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -67,7 +66,7 @@ class DualRefCounted : public Orphanable {
void Unref() {
// Convert strong ref to weak ref.
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_add(MakeRefPair(-1, 1), std::memory_order_acq_rel);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
@@ -85,7 +84,7 @@ class DualRefCounted : public Orphanable {
}
void Unref(const DebugLocation& location, const char* reason) {
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(-1, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_add(MakeRefPair(-1, 1), std::memory_order_acq_rel);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
@@ -108,7 +107,7 @@ class DualRefCounted : public Orphanable {
}
RefCountedPtr<Child> RefIfNonZero() GRPC_MUST_USE_RESULT {
- uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
+ uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire);
do {
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
@@ -119,15 +118,15 @@ class DualRefCounted : public Orphanable {
}
#endif
if (strong_refs == 0) return nullptr;
- } while (!refs_.CompareExchangeWeak(
- &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
+ } while (!refs_.compare_exchange_weak(
+ prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0),
+ std::memory_order_acq_rel, std::memory_order_acquire));
return RefCountedPtr<Child>(static_cast<Child*>(this));
}
RefCountedPtr<Child> RefIfNonZero(const DebugLocation& location,
const char* reason) GRPC_MUST_USE_RESULT {
- uint64_t prev_ref_pair = refs_.Load(MemoryOrder::ACQUIRE);
+ uint64_t prev_ref_pair = refs_.load(std::memory_order_acquire);
do {
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
#ifndef NDEBUG
@@ -144,9 +143,9 @@ class DualRefCounted : public Orphanable {
(void)reason;
#endif
if (strong_refs == 0) return nullptr;
- } while (!refs_.CompareExchangeWeak(
- &prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0), MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE));
+ } while (!refs_.compare_exchange_weak(
+ prev_ref_pair, prev_ref_pair + MakeRefPair(1, 0),
+ std::memory_order_acq_rel, std::memory_order_acquire));
return RefCountedPtr<Child>(static_cast<Child*>(this));
}
@@ -169,7 +168,7 @@ class DualRefCounted : public Orphanable {
const char* trace = trace_;
#endif
const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
@@ -191,7 +190,7 @@ class DualRefCounted : public Orphanable {
const char* trace = trace_;
#endif
const uint64_t prev_ref_pair =
- refs_.FetchSub(MakeRefPair(0, 1), MemoryOrder::ACQ_REL);
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
#ifndef NDEBUG
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
@@ -254,7 +253,7 @@ class DualRefCounted : public Orphanable {
void IncrementRefCount() {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
GPR_ASSERT(strong_refs != 0);
@@ -263,13 +262,13 @@ class DualRefCounted : public Orphanable {
strong_refs, strong_refs + 1, weak_refs);
}
#else
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
#endif
}
void IncrementRefCount(const DebugLocation& location, const char* reason) {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
GPR_ASSERT(strong_refs != 0);
@@ -282,14 +281,14 @@ class DualRefCounted : public Orphanable {
// Use conditionally-important parameters
(void)location;
(void)reason;
- refs_.FetchAdd(MakeRefPair(1, 0), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(1, 0), std::memory_order_relaxed);
#endif
}
void IncrementWeakRefCount() {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
if (trace_ != nullptr) {
@@ -297,14 +296,14 @@ class DualRefCounted : public Orphanable {
weak_refs, weak_refs + 1, strong_refs);
}
#else
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
#endif
}
void IncrementWeakRefCount(const DebugLocation& location,
const char* reason) {
#ifndef NDEBUG
const uint64_t prev_ref_pair =
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
const uint32_t strong_refs = GetStrongRefs(prev_ref_pair);
const uint32_t weak_refs = GetWeakRefs(prev_ref_pair);
if (trace_ != nullptr) {
@@ -316,14 +315,14 @@ class DualRefCounted : public Orphanable {
// Use conditionally-important parameters
(void)location;
(void)reason;
- refs_.FetchAdd(MakeRefPair(0, 1), MemoryOrder::RELAXED);
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_relaxed);
#endif
}
#ifndef NDEBUG
const char* trace_;
#endif
- Atomic<uint64_t> refs_;
+ std::atomic<uint64_t> refs_{0};
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/fork.cc b/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
index 45a4a894f82..675f8e4d409 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/fork.cc
@@ -168,28 +168,30 @@ class ThreadState {
void Fork::GlobalInit() {
if (!override_enabled_) {
- support_enabled_.Store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
- MemoryOrder::RELAXED);
+ support_enabled_.store(GPR_GLOBAL_CONFIG_GET(grpc_enable_fork_support),
+ std::memory_order_relaxed);
}
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
exec_ctx_state_ = new internal::ExecCtxState();
thread_state_ = new internal::ThreadState();
}
}
void Fork::GlobalShutdown() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
delete exec_ctx_state_;
delete thread_state_;
}
}
-bool Fork::Enabled() { return support_enabled_.Load(MemoryOrder::RELAXED); }
+bool Fork::Enabled() {
+ return support_enabled_.load(std::memory_order_relaxed);
+}
// Testing Only
void Fork::Enable(bool enable) {
override_enabled_ = true;
- support_enabled_.Store(enable, MemoryOrder::RELAXED);
+ support_enabled_.store(enable, std::memory_order_relaxed);
}
void Fork::DoIncExecCtxCount() { exec_ctx_state_->IncExecCtxCount(); }
@@ -205,38 +207,38 @@ Fork::child_postfork_func Fork::GetResetChildPollingEngineFunc() {
}
bool Fork::BlockExecCtx() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
return exec_ctx_state_->BlockExecCtx();
}
return false;
}
void Fork::AllowExecCtx() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
exec_ctx_state_->AllowExecCtx();
}
}
void Fork::IncThreadCount() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->IncThreadCount();
}
}
void Fork::DecThreadCount() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->DecThreadCount();
}
}
void Fork::AwaitThreads() {
- if (support_enabled_.Load(MemoryOrder::RELAXED)) {
+ if (support_enabled_.load(std::memory_order_relaxed)) {
thread_state_->AwaitThreads();
}
}
internal::ExecCtxState* Fork::exec_ctx_state_ = nullptr;
internal::ThreadState* Fork::thread_state_ = nullptr;
-Atomic<bool> Fork::support_enabled_(false);
+std::atomic<bool> Fork::support_enabled_(false);
bool Fork::override_enabled_ = false;
Fork::child_postfork_func Fork::reset_child_polling_engine_ = nullptr;
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/fork.h b/contrib/libs/grpc/src/core/lib/gprpp/fork.h
index 3601d7ca925..d6ef16130a8 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/fork.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/fork.h
@@ -21,7 +21,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/atomic.h"
+#include <atomic>
/*
* NOTE: FORKING IS NOT GENERALLY SUPPORTED, THIS IS ONLY INTENDED TO WORK
@@ -48,14 +48,14 @@ class Fork {
// Increment the count of active ExecCtxs.
// Will block until a pending fork is complete if one is in progress.
static void IncExecCtxCount() {
- if (GPR_UNLIKELY(support_enabled_.Load(MemoryOrder::RELAXED))) {
+ if (GPR_UNLIKELY(support_enabled_.load(std::memory_order_relaxed))) {
DoIncExecCtxCount();
}
}
// Decrement the count of active ExecCtxs
static void DecExecCtxCount() {
- if (GPR_UNLIKELY(support_enabled_.Load(MemoryOrder::RELAXED))) {
+ if (GPR_UNLIKELY(support_enabled_.load(std::memory_order_relaxed))) {
DoDecExecCtxCount();
}
}
@@ -93,7 +93,7 @@ class Fork {
static internal::ExecCtxState* exec_ctx_state_;
static internal::ThreadState* thread_state_;
- static grpc_core::Atomic<bool> support_enabled_;
+ static std::atomic<bool> support_enabled_;
static bool override_enabled_;
static child_postfork_func reset_child_polling_engine_;
};
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/global_config.h b/contrib/libs/grpc/src/core/lib/gprpp/global_config.h
index ed986b8e04d..150c7385638 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/global_config.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/global_config.h
@@ -89,8 +89,7 @@
// bool gpr_global_config_get_test();
// void gpr_global_config_set_test(bool value);
-#include "src/core/lib/gprpp/global_config_env.h"
-
#include "src/core/lib/gprpp/global_config_custom.h"
+#include "src/core/lib/gprpp/global_config_env.h"
#endif /* GRPC_CORE_LIB_GPRPP_GLOBAL_CONFIG_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
index 72e3760661f..2b529068e86 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.cc
@@ -20,13 +20,6 @@
#include "src/core/lib/gprpp/global_config_env.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-
#include <ctype.h>
#include <string.h>
@@ -34,6 +27,13 @@
#include "y_absl/strings/str_format.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gpr/string.h"
+
namespace grpc_core {
namespace {
@@ -58,8 +58,8 @@ void SetGlobalConfigEnvErrorFunction(GlobalConfigEnvErrorFunctionType func) {
g_global_config_env_error_func = func;
}
-grpc_core::UniquePtr<char> GlobalConfigEnv::GetValue() {
- return grpc_core::UniquePtr<char>(gpr_getenv(GetName()));
+UniquePtr<char> GlobalConfigEnv::GetValue() {
+ return UniquePtr<char>(gpr_getenv(GetName()));
}
void GlobalConfigEnv::SetValue(const char* value) {
@@ -80,7 +80,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvBool>::value,
"GlobalConfigEnvBool needs to be trivially destructible.");
bool GlobalConfigEnvBool::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
@@ -101,7 +101,7 @@ static_assert(std::is_trivially_destructible<GlobalConfigEnvInt32>::value,
"GlobalConfigEnvInt32 needs to be trivially destructible.");
int32_t GlobalConfigEnvInt32::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
return default_value_;
}
@@ -124,10 +124,10 @@ void GlobalConfigEnvInt32::Set(int32_t value) {
static_assert(std::is_trivially_destructible<GlobalConfigEnvString>::value,
"GlobalConfigEnvString needs to be trivially destructible.");
-grpc_core::UniquePtr<char> GlobalConfigEnvString::Get() {
- grpc_core::UniquePtr<char> str = GetValue();
+UniquePtr<char> GlobalConfigEnvString::Get() {
+ UniquePtr<char> str = GetValue();
if (str == nullptr) {
- return grpc_core::UniquePtr<char>(gpr_strdup(default_value_));
+ return UniquePtr<char>(gpr_strdup(default_value_));
}
return str;
}
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.h b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.h
index b6d7d574ecf..3d3038895d3 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/global_config_env.h
@@ -43,7 +43,7 @@ class GlobalConfigEnv {
public:
// Returns the value of `name` variable.
- grpc_core::UniquePtr<char> GetValue();
+ UniquePtr<char> GetValue();
// Sets the value of `name` variable.
void SetValue(const char* value);
@@ -87,7 +87,7 @@ class GlobalConfigEnvString : public GlobalConfigEnv {
constexpr GlobalConfigEnvString(char* name, const char* default_value)
: GlobalConfigEnv(name), default_value_(default_value) {}
- grpc_core::UniquePtr<char> Get();
+ UniquePtr<char> Get();
void Set(const char* value);
private:
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/global_config_generic.h b/contrib/libs/grpc/src/core/lib/gprpp/global_config_generic.h
index d3e3e2a2dbe..6bdadb09804 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/global_config_generic.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/global_config_generic.h
@@ -21,10 +21,10 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/memory.h"
-
#include <stdint.h>
+#include "src/core/lib/gprpp/memory.h"
+
#define GPR_GLOBAL_CONFIG_GET(name) gpr_global_config_get_##name()
#define GPR_GLOBAL_CONFIG_SET(name, value) gpr_global_config_set_##name(value)
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/manual_constructor.h b/contrib/libs/grpc/src/core/lib/gprpp/manual_constructor.h
index 7ee13796eea..6ef55570357 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/manual_constructor.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/manual_constructor.h
@@ -25,12 +25,15 @@
#include <stddef.h>
#include <stdlib.h>
+
#include <new>
#include <type_traits>
#include <utility>
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/construct_destruct.h"
+
namespace grpc_core {
// this contains templated helpers needed to implement the ManualConstructors
@@ -160,9 +163,8 @@ class PolymorphicManualConstructor {
}
typename std::aligned_storage<
- grpc_core::manual_ctor_impl::max_size_of<DerivedTypes...>::value,
- grpc_core::manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type
- space_;
+ manual_ctor_impl::max_size_of<DerivedTypes...>::value,
+ manual_ctor_impl::max_align_of<DerivedTypes...>::value>::type space_;
};
template <typename Type>
@@ -182,7 +184,7 @@ class ManualConstructor {
Type& operator*() { return *get(); }
const Type& operator*() const { return *get(); }
- void Init() { new (&space_) Type; }
+ void Init() { Construct(get()); }
// Init() constructs the Type instance using the given arguments
// (which are forwarded to Type's constructor).
@@ -192,17 +194,17 @@ class ManualConstructor {
// "new Type();"), so it will leave non-class types uninitialized.
template <typename... Ts>
void Init(Ts&&... args) {
- new (&space_) Type(std::forward<Ts>(args)...);
+ Construct(get(), std::forward<Ts>(args)...);
}
// Init() that is equivalent to copy and move construction.
// Enables usage like this:
// ManualConstructor<std::vector<int>> v;
// v.Init({1, 2, 3});
- void Init(const Type& x) { new (&space_) Type(x); }
- void Init(Type&& x) { new (&space_) Type(std::move(x)); }
+ void Init(const Type& x) { Construct(get(), x); }
+ void Init(Type&& x) { Construct(get(), std::forward<Type>(x)); }
- void Destroy() { get()->~Type(); }
+ void Destroy() { Destruct(get()); }
private:
typename std::aligned_storage<sizeof(Type), alignof(Type)>::type space_;
@@ -210,4 +212,4 @@ class ManualConstructor {
} // namespace grpc_core
-#endif
+#endif // GRPC_CORE_LIB_GPRPP_MANUAL_CONSTRUCTOR_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/match.h b/contrib/libs/grpc/src/core/lib/gprpp/match.h
new file mode 100644
index 00000000000..39892fe4731
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/match.h
@@ -0,0 +1,73 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_MATCH_H
+#define GRPC_CORE_LIB_GPRPP_MATCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/gprpp/overload.h"
+
+namespace grpc_core {
+
+namespace detail {
+
+template <typename... Cases>
+struct MatchPointerExtractor {
+ OverloadType<Cases...> cases;
+ template <typename T>
+ auto operator()(T& value) -> decltype(cases(&value)) {
+ return cases(&value);
+ }
+};
+
+} // namespace detail
+
+/// Match on a variant.
+/// Given variant \a value, and a set of callables \a fs, call the appropriate
+/// callable based on the type contained in \a value.
+///
+/// Example (prints "hoorah"):
+/// variant<int, string> v = 42;
+/// Match(v,
+/// [](int i) { puts("hoorah"); },
+/// [](string s) { puts("boo"); });
+template <typename... Fs, typename T0, typename... Ts>
+auto Match(const y_absl::variant<T0, Ts...>& value, Fs... fs)
+ -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0>())) {
+ return y_absl::visit(Overload(std::move(fs)...), value);
+}
+
+/// A version of Match that takes a mutable pointer to a variant and calls its
+/// overload callables with a mutable pointer to the current variant value.
+///
+/// Example:
+/// variant<int, string> v = 42;
+/// MatchMutable(&v,
+/// [](int* i) { *i = 1; },
+/// [](string* s) { *s = "foo"; });
+/// // v now contains 1.
+template <typename... Fs, typename T0, typename... Ts>
+auto MatchMutable(y_absl::variant<T0, Ts...>* value, Fs... fs)
+ -> decltype(std::declval<OverloadType<Fs...>>()(std::declval<T0*>())) {
+ return y_absl::visit(detail::MatchPointerExtractor<Fs...>{OverloadType<Fs...>(
+ std::move(fs)...)},
+ *value);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_MATCH_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/memory.h b/contrib/libs/grpc/src/core/lib/gprpp/memory.h
index becf273510f..1e9568a4374 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/memory.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/memory.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
#include <limits>
#include <memory>
#include <utility>
#include "y_absl/memory/memory.h"
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
namespace grpc_core {
class DefaultDeleteChar {
@@ -46,6 +46,12 @@ class DefaultDeleteChar {
template <typename T>
using UniquePtr = std::unique_ptr<T, DefaultDeleteChar>;
+template <class T>
+T* Zalloc() {
+ static_assert(std::is_trivial<T>::value, "Type should be trivial");
+ return static_cast<T*>(gpr_zalloc(sizeof(T)));
+}
+
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_GPRPP_MEMORY_H */
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc b/contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc
index 373ec09f8e9..b5a1717341d 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/mpscq.cc
@@ -27,9 +27,9 @@ namespace grpc_core {
//
bool MultiProducerSingleConsumerQueue::Push(Node* node) {
- node->next.Store(nullptr, MemoryOrder::RELAXED);
- Node* prev = head_.Exchange(node, MemoryOrder::ACQ_REL);
- prev->next.Store(node, MemoryOrder::RELEASE);
+ node->next.store(nullptr, std::memory_order_relaxed);
+ Node* prev = head_.exchange(node, std::memory_order_acq_rel);
+ prev->next.store(node, std::memory_order_release);
return prev == &stub_;
}
@@ -42,7 +42,7 @@ MultiProducerSingleConsumerQueue::Pop() {
MultiProducerSingleConsumerQueue::Node*
MultiProducerSingleConsumerQueue::PopAndCheckEnd(bool* empty) {
Node* tail = tail_;
- Node* next = tail_->next.Load(MemoryOrder::ACQUIRE);
+ Node* next = tail_->next.load(std::memory_order_acquire);
if (tail == &stub_) {
// indicates the list is actually (ephemerally) empty
if (next == nullptr) {
@@ -51,21 +51,21 @@ MultiProducerSingleConsumerQueue::PopAndCheckEnd(bool* empty) {
}
tail_ = next;
tail = next;
- next = tail->next.Load(MemoryOrder::ACQUIRE);
+ next = tail->next.load(std::memory_order_acquire);
}
if (next != nullptr) {
*empty = false;
tail_ = next;
return tail;
}
- Node* head = head_.Load(MemoryOrder::ACQUIRE);
+ Node* head = head_.load(std::memory_order_acquire);
if (tail != head) {
*empty = false;
// indicates a retry is in order: we're still adding
return nullptr;
}
Push(&stub_);
- next = tail->next.Load(MemoryOrder::ACQUIRE);
+ next = tail->next.load(std::memory_order_acquire);
if (next != nullptr) {
*empty = false;
tail_ = next;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/mpscq.h b/contrib/libs/grpc/src/core/lib/gprpp/mpscq.h
index a1c04cae23c..38e016c1cc8 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/mpscq.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/mpscq.h
@@ -21,11 +21,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
+#include <atomic>
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/sync.h"
+
namespace grpc_core {
// Multiple-producer single-consumer lock free queue, based upon the
@@ -35,12 +36,12 @@ class MultiProducerSingleConsumerQueue {
public:
// List node. Application node types can inherit from this.
struct Node {
- Atomic<Node*> next;
+ std::atomic<Node*> next{nullptr};
};
MultiProducerSingleConsumerQueue() : head_{&stub_}, tail_(&stub_) {}
~MultiProducerSingleConsumerQueue() {
- GPR_ASSERT(head_.Load(MemoryOrder::RELAXED) == &stub_);
+ GPR_ASSERT(head_.load(std::memory_order_relaxed) == &stub_);
GPR_ASSERT(tail_ == &stub_);
}
@@ -61,7 +62,7 @@ class MultiProducerSingleConsumerQueue {
// make sure head & tail don't share a cacheline
union {
char padding_[GPR_CACHELINE_SIZE];
- Atomic<Node*> head_;
+ std::atomic<Node*> head_{nullptr};
};
Node* tail_;
Node stub_;
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/orphanable.h b/contrib/libs/grpc/src/core/lib/gprpp/orphanable.h
index 2a95b9df13b..bdd26d562b2 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/orphanable.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/orphanable.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
#include <cinttypes>
#include <memory>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
@@ -72,7 +72,7 @@ inline OrphanablePtr<T> MakeOrphanable(Args&&... args) {
}
// A type of Orphanable with internal ref-counting.
-template <typename Child>
+template <typename Child, UnrefBehavior UnrefBehaviorArg = kUnrefDelete>
class InternallyRefCounted : public Orphanable {
public:
// Not copyable nor movable.
@@ -102,12 +102,12 @@ class InternallyRefCounted : public Orphanable {
void Unref() {
if (GPR_UNLIKELY(refs_.Unref())) {
- delete this;
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
void Unref(const DebugLocation& location, const char* reason) {
if (GPR_UNLIKELY(refs_.Unref(location, reason))) {
- delete this;
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
@@ -117,7 +117,7 @@ class InternallyRefCounted : public Orphanable {
refs_.Ref(location, reason);
}
- grpc_core::RefCount refs_;
+ RefCount refs_;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/overload.h b/contrib/libs/grpc/src/core/lib/gprpp/overload.h
new file mode 100644
index 00000000000..c243a8c010e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/overload.h
@@ -0,0 +1,59 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_OVERLOAD_H
+#define GRPC_CORE_LIB_GPRPP_OVERLOAD_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+namespace grpc_core {
+
+template <typename... Cases>
+struct OverloadType;
+// Compose one overload with N more -- use inheritance to leverage using and the
+// empty base class optimization.
+template <typename Case, typename... Cases>
+struct OverloadType<Case, Cases...> : public Case,
+ public OverloadType<Cases...> {
+ explicit OverloadType(Case&& c, Cases&&... cases)
+ : Case(std::forward<Case>(c)),
+ OverloadType<Cases...>(std::forward<Cases>(cases)...) {}
+ using Case::operator();
+ using OverloadType<Cases...>::operator();
+};
+// Overload of a single case is just that case itself
+template <typename Case>
+struct OverloadType<Case> : public Case {
+ explicit OverloadType(Case&& c) : Case(std::forward<Case>(c)) {}
+ using Case::operator();
+};
+
+/// Compose callables into a single callable.
+/// e.g. given [](int i) { puts("a"); } and [](double d) { puts("b"); },
+/// return a callable object like:
+/// struct {
+/// void operator()(int i) { puts("a"); }
+/// void operator()(double i) { puts("b"); }
+/// };
+/// Preserves all captures.
+template <typename... Cases>
+OverloadType<Cases...> Overload(Cases... cases) {
+ return OverloadType<Cases...>(std::move(cases)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_OVERLOAD_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
index 47e2aadc374..733ec5e9383 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/atm.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-
#include <atomic>
#include <cassert>
#include <cinttypes>
-#include "src/core/lib/gprpp/atomic.h"
+#include <grpc/support/atm.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+
+#include "src/core/lib/gprpp/atomic_utils.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -70,18 +70,18 @@ class RefCount {
// Increases the ref-count by `n`.
void Ref(Value n = 1) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(n, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(n, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p ref %" PRIdPTR " -> %" PRIdPTR, trace_, this,
prior, prior + n);
}
#else
- value_.FetchAdd(n, MemoryOrder::RELAXED);
+ value_.fetch_add(n, std::memory_order_relaxed);
#endif
}
void Ref(const DebugLocation& location, const char* reason, Value n = 1) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(n, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(n, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s",
trace_, this, location.file(), location.line(), prior, prior + n,
@@ -91,26 +91,26 @@ class RefCount {
// Use conditionally-important parameters
(void)location;
(void)reason;
- value_.FetchAdd(n, MemoryOrder::RELAXED);
+ value_.fetch_add(n, std::memory_order_relaxed);
#endif
}
// Similar to Ref() with an assert on the ref-count being non-zero.
void RefNonZero() {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(1, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(1, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p ref %" PRIdPTR " -> %" PRIdPTR, trace_, this,
prior, prior + 1);
}
assert(prior > 0);
#else
- value_.FetchAdd(1, MemoryOrder::RELAXED);
+ value_.fetch_add(1, std::memory_order_relaxed);
#endif
}
void RefNonZero(const DebugLocation& location, const char* reason) {
#ifndef NDEBUG
- const Value prior = value_.FetchAdd(1, MemoryOrder::RELAXED);
+ const Value prior = value_.fetch_add(1, std::memory_order_relaxed);
if (trace_ != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d ref %" PRIdPTR " -> %" PRIdPTR " %s",
trace_, this, location.file(), location.line(), prior, prior + 1,
@@ -133,7 +133,7 @@ class RefCount {
trace_, this, prior, prior + 1);
}
#endif
- return value_.IncrementIfNonzero();
+ return IncrementIfNonzero(&value_);
}
bool RefIfNonZero(const DebugLocation& location, const char* reason) {
#ifndef NDEBUG
@@ -148,7 +148,7 @@ class RefCount {
// Avoid unused-parameter warnings for debug-only parameters
(void)location;
(void)reason;
- return value_.IncrementIfNonzero();
+ return IncrementIfNonzero(&value_);
}
// Decrements the ref-count and returns true if the ref-count reaches 0.
@@ -159,7 +159,7 @@ class RefCount {
// safely access it, since another thread might free us in the interim.
auto* trace = trace_;
#endif
- const Value prior = value_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const Value prior = value_.fetch_sub(1, std::memory_order_acq_rel);
#ifndef NDEBUG
if (trace != nullptr) {
gpr_log(GPR_INFO, "%s:%p unref %" PRIdPTR " -> %" PRIdPTR, trace, this,
@@ -176,7 +176,7 @@ class RefCount {
// safely access it, since another thread might free us in the interim.
auto* trace = trace_;
#endif
- const Value prior = value_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const Value prior = value_.fetch_sub(1, std::memory_order_acq_rel);
#ifndef NDEBUG
if (trace != nullptr) {
gpr_log(GPR_INFO, "%s:%p %s:%d unref %" PRIdPTR " -> %" PRIdPTR " %s",
@@ -193,12 +193,12 @@ class RefCount {
}
private:
- Value get() const { return value_.Load(MemoryOrder::RELAXED); }
+ Value get() const { return value_.load(std::memory_order_relaxed); }
#ifndef NDEBUG
const char* trace_;
#endif
- Atomic<Value> value_;
+ std::atomic<Value> value_{0};
};
// PolymorphicRefCount enforces polymorphic destruction of RefCounted.
@@ -208,38 +208,52 @@ class PolymorphicRefCount {
};
// NonPolymorphicRefCount does not enforce polymorphic destruction of
-// RefCounted. Please refer to grpc_core::RefCounted for more details, and
+// RefCounted. Please refer to RefCounted for more details, and
// when in doubt use PolymorphicRefCount.
class NonPolymorphicRefCount {
public:
~NonPolymorphicRefCount() = default;
};
+// Behavior of RefCounted<> upon ref count reaching 0.
+enum UnrefBehavior {
+ // Default behavior: Delete the object.
+ kUnrefDelete,
+ // Do not delete the object upon unref. This is useful in cases where all
+ // existing objects must be tracked in a registry but the object's entry in
+ // the registry cannot be removed from the object's dtor due to
+ // synchronization issues. In this case, the registry can be cleaned up
+ // later by identifying entries for which RefIfNonZero() returns null.
+ kUnrefNoDelete,
+ // Call the object's dtor but do not delete it. This is useful for cases
+ // where the object is stored in memory allocated elsewhere (e.g., the call
+ // arena).
+ kUnrefCallDtor,
+};
+
namespace internal {
-template <typename T, bool DoDelete>
+template <typename T, UnrefBehavior UnrefBehaviorArg>
class Delete;
template <typename T>
-class Delete<T, true> {
+class Delete<T, kUnrefDelete> {
public:
explicit Delete(T* t) { delete t; }
};
template <typename T>
-class Delete<T, false> {
+class Delete<T, kUnrefNoDelete> {
public:
explicit Delete(T* /*t*/) {}
};
+template <typename T>
+class Delete<T, kUnrefCallDtor> {
+ public:
+ explicit Delete(T* t) { t->~T(); }
+};
} // namespace internal
// A base class for reference-counted objects.
// New objects should be created via new and start with a refcount of 1.
-// When the refcount reaches 0, the object will be deleted via delete.
-//
-// If DeleteUponUnref is false, deletion will not occur when the ref
-// count reaches 0. This is useful in cases where all existing objects
-// must be tracked in a registry but the object's entry in the registry
-// cannot be removed from the object's dtor due to synchronization issues.
-// In this case, the registry can be cleaned up later by identifying
-// entries for which RefIfNonZero() returns null.
+// When the refcount reaches 0, executes the specified UnrefBehavior.
//
// This will commonly be used by CRTP (curiously-recurring template pattern)
// e.g., class MyClass : public RefCounted<MyClass>
@@ -264,7 +278,7 @@ class Delete<T, false> {
// ch->Unref();
//
template <typename Child, typename Impl = PolymorphicRefCount,
- bool DeleteUponUnref = true>
+ UnrefBehavior UnrefBehaviorArg = kUnrefDelete>
class RefCounted : public Impl {
public:
// Note: Depending on the Impl used, this dtor can be implicitly virtual.
@@ -287,12 +301,12 @@ class RefCounted : public Impl {
// friend of this class.
void Unref() {
if (GPR_UNLIKELY(refs_.Unref())) {
- internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
void Unref(const DebugLocation& location, const char* reason) {
if (GPR_UNLIKELY(refs_.Unref(location, reason))) {
- internal::Delete<Child, DeleteUponUnref>(static_cast<Child*>(this));
+ internal::Delete<Child, UnrefBehaviorArg>(static_cast<Child*>(this));
}
}
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
index 4ee1b950818..047ae95aec4 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/ref_counted_ptr.h
@@ -40,8 +40,7 @@ class RefCountedPtr {
// If value is non-null, we take ownership of a ref to it.
template <typename Y>
- // NOLINTNEXTLINE(google-explicit-constructor)
- RefCountedPtr(Y* value) : value_(value) {}
+ explicit RefCountedPtr(Y* value) : value_(value) {}
// Move ctors.
RefCountedPtr(RefCountedPtr&& other) noexcept {
@@ -191,8 +190,7 @@ class WeakRefCountedPtr {
// If value is non-null, we take ownership of a ref to it.
template <typename Y>
- // NOLINTNEXTLINE(google-explicit-constructor)
- WeakRefCountedPtr(Y* value) {
+ explicit WeakRefCountedPtr(Y* value) {
value_ = value;
}
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
new file mode 100644
index 00000000000..cbc25deae69
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.cc
@@ -0,0 +1,429 @@
+//
+//
+// Copyright 2021 the gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/status_helper.h"
+
+#include "y_absl/strings/cord.h"
+#include "y_absl/strings/escaping.h"
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/time/clock.h"
+#include "google/protobuf/any.upb.h"
+#include "google/rpc/status.upb.h"
+#include "upb/upb.hpp"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gprpp/time_util.h"
+
+#include <util/string/cast.h>
+
+namespace grpc_core {
+
+namespace {
+
+#define TYPE_URL_PREFIX "type.googleapis.com/grpc.status."
+#define TYPE_INT_TAG "int."
+#define TYPE_STR_TAG "str."
+#define TYPE_TIME_TAG "time."
+#define TYPE_CHILDREN_TAG "children"
+#define TYPE_URL(name) (TYPE_URL_PREFIX name)
+const y_absl::string_view kTypeUrlPrefix = TYPE_URL_PREFIX;
+const y_absl::string_view kTypeIntTag = TYPE_INT_TAG;
+const y_absl::string_view kTypeStrTag = TYPE_STR_TAG;
+const y_absl::string_view kTypeTimeTag = TYPE_TIME_TAG;
+const y_absl::string_view kTypeChildrenTag = TYPE_CHILDREN_TAG;
+const y_absl::string_view kChildrenPropertyUrl = TYPE_URL(TYPE_CHILDREN_TAG);
+
+const char* GetStatusIntPropertyUrl(StatusIntProperty key) {
+ switch (key) {
+ case StatusIntProperty::kErrorNo:
+ return TYPE_URL(TYPE_INT_TAG "errno");
+ case StatusIntProperty::kFileLine:
+ return TYPE_URL(TYPE_INT_TAG "file_line");
+ case StatusIntProperty::kStreamId:
+ return TYPE_URL(TYPE_INT_TAG "stream_id");
+ case StatusIntProperty::kRpcStatus:
+ return TYPE_URL(TYPE_INT_TAG "grpc_status");
+ case StatusIntProperty::kOffset:
+ return TYPE_URL(TYPE_INT_TAG "offset");
+ case StatusIntProperty::kIndex:
+ return TYPE_URL(TYPE_INT_TAG "index");
+ case StatusIntProperty::kSize:
+ return TYPE_URL(TYPE_INT_TAG "size");
+ case StatusIntProperty::kHttp2Error:
+ return TYPE_URL(TYPE_INT_TAG "http2_error");
+ case StatusIntProperty::kTsiCode:
+ return TYPE_URL(TYPE_INT_TAG "tsi_code");
+ case StatusIntProperty::kWsaError:
+ return TYPE_URL(TYPE_INT_TAG "wsa_error");
+ case StatusIntProperty::kFd:
+ return TYPE_URL(TYPE_INT_TAG "fd");
+ case StatusIntProperty::kHttpStatus:
+ return TYPE_URL(TYPE_INT_TAG "http_status");
+ case StatusIntProperty::kOccurredDuringWrite:
+ return TYPE_URL(TYPE_INT_TAG "occurred_during_write");
+ case StatusIntProperty::ChannelConnectivityState:
+ return TYPE_URL(TYPE_INT_TAG "channel_connectivity_state");
+ case StatusIntProperty::kLbPolicyDrop:
+ return TYPE_URL(TYPE_INT_TAG "lb_policy_drop");
+ }
+ GPR_UNREACHABLE_CODE(return "unknown");
+}
+
+const char* GetStatusStrPropertyUrl(StatusStrProperty key) {
+ switch (key) {
+ case StatusStrProperty::kDescription:
+ return TYPE_URL(TYPE_STR_TAG "description");
+ case StatusStrProperty::kFile:
+ return TYPE_URL(TYPE_STR_TAG "file");
+ case StatusStrProperty::kOsError:
+ return TYPE_URL(TYPE_STR_TAG "os_error");
+ case StatusStrProperty::kSyscall:
+ return TYPE_URL(TYPE_STR_TAG "syscall");
+ case StatusStrProperty::kTargetAddress:
+ return TYPE_URL(TYPE_STR_TAG "target_address");
+ case StatusStrProperty::kGrpcMessage:
+ return TYPE_URL(TYPE_STR_TAG "grpc_message");
+ case StatusStrProperty::kRawBytes:
+ return TYPE_URL(TYPE_STR_TAG "raw_bytes");
+ case StatusStrProperty::kTsiError:
+ return TYPE_URL(TYPE_STR_TAG "tsi_error");
+ case StatusStrProperty::kFilename:
+ return TYPE_URL(TYPE_STR_TAG "filename");
+ case StatusStrProperty::kKey:
+ return TYPE_URL(TYPE_STR_TAG "key");
+ case StatusStrProperty::kValue:
+ return TYPE_URL(TYPE_STR_TAG "value");
+ }
+ GPR_UNREACHABLE_CODE(return "unknown");
+}
+
+const char* GetStatusTimePropertyUrl(StatusTimeProperty key) {
+ switch (key) {
+ case StatusTimeProperty::kCreated:
+ return TYPE_URL(TYPE_TIME_TAG "created_time");
+ }
+ GPR_UNREACHABLE_CODE(return "unknown");
+}
+
+void EncodeUInt32ToBytes(uint32_t v, char* buf) {
+ buf[0] = v & 0xFF;
+ buf[1] = (v >> 8) & 0xFF;
+ buf[2] = (v >> 16) & 0xFF;
+ buf[3] = (v >> 24) & 0xFF;
+}
+
+uint32_t DecodeUInt32FromBytes(const char* buf) {
+ const unsigned char* ubuf = reinterpret_cast<const unsigned char*>(buf);
+ return ubuf[0] | (uint32_t(ubuf[1]) << 8) | (uint32_t(ubuf[2]) << 16) |
+ (uint32_t(ubuf[3]) << 24);
+}
+
+std::vector<y_absl::Status> ParseChildren(y_absl::Cord children) {
+ std::vector<y_absl::Status> result;
+ upb::Arena arena;
+ // Cord is flattened to iterate the buffer easily at the cost of memory copy.
+ // TODO(veblush): Optimize this once CordReader is introduced.
+ y_absl::string_view buf = children.Flatten();
+ size_t cur = 0;
+ while (buf.size() - cur >= sizeof(uint32_t)) {
+ size_t msg_size = DecodeUInt32FromBytes(buf.data() + cur);
+ cur += sizeof(uint32_t);
+ GPR_ASSERT(buf.size() - cur >= msg_size);
+ google_rpc_Status* msg =
+ google_rpc_Status_parse(buf.data() + cur, msg_size, arena.ptr());
+ cur += msg_size;
+ result.push_back(internal::StatusFromProto(msg));
+ }
+ return result;
+}
+
+} // namespace
+
+y_absl::Status StatusCreate(y_absl::StatusCode code, y_absl::string_view msg,
+ const DebugLocation& location,
+ std::initializer_list<y_absl::Status> children) {
+ y_absl::Status s(code, msg);
+ if (location.file() != nullptr) {
+ StatusSetStr(&s, StatusStrProperty::kFile, location.file());
+ }
+ if (location.line() != -1) {
+ StatusSetInt(&s, StatusIntProperty::kFileLine, location.line());
+ }
+ StatusSetTime(&s, StatusTimeProperty::kCreated, y_absl::Now());
+ for (const y_absl::Status& child : children) {
+ if (!child.ok()) {
+ StatusAddChild(&s, child);
+ }
+ }
+ return s;
+}
+
+void StatusSetInt(y_absl::Status* status, StatusIntProperty key, intptr_t value) {
+ status->SetPayload(GetStatusIntPropertyUrl(key),
+ y_absl::Cord(ToString(value)));
+}
+
+y_absl::optional<intptr_t> StatusGetInt(const y_absl::Status& status,
+ StatusIntProperty key) {
+ y_absl::optional<y_absl::Cord> p =
+ status.GetPayload(GetStatusIntPropertyUrl(key));
+ if (p.has_value()) {
+ y_absl::optional<y_absl::string_view> sv = p->TryFlat();
+ intptr_t value;
+ if (sv.has_value()) {
+ if (y_absl::SimpleAtoi(*sv, &value)) {
+ return value;
+ }
+ } else {
+ if (y_absl::SimpleAtoi(TString(*p), &value)) {
+ return value;
+ }
+ }
+ }
+ return {};
+}
+
+void StatusSetStr(y_absl::Status* status, StatusStrProperty key,
+ y_absl::string_view value) {
+ status->SetPayload(GetStatusStrPropertyUrl(key), y_absl::Cord(value));
+}
+
+y_absl::optional<TString> StatusGetStr(const y_absl::Status& status,
+ StatusStrProperty key) {
+ y_absl::optional<y_absl::Cord> p =
+ status.GetPayload(GetStatusStrPropertyUrl(key));
+ if (p.has_value()) {
+ return TString(*p);
+ }
+ return {};
+}
+
+void StatusSetTime(y_absl::Status* status, StatusTimeProperty key,
+ y_absl::Time time) {
+ status->SetPayload(GetStatusTimePropertyUrl(key),
+ y_absl::Cord(y_absl::string_view(
+ reinterpret_cast<const char*>(&time), sizeof(time))));
+}
+
+y_absl::optional<y_absl::Time> StatusGetTime(const y_absl::Status& status,
+ StatusTimeProperty key) {
+ y_absl::optional<y_absl::Cord> p =
+ status.GetPayload(GetStatusTimePropertyUrl(key));
+ if (p.has_value()) {
+ y_absl::optional<y_absl::string_view> sv = p->TryFlat();
+ if (sv.has_value()) {
+ return *reinterpret_cast<const y_absl::Time*>(sv->data());
+ } else {
+ TString s = TString(*p);
+ return *reinterpret_cast<const y_absl::Time*>(s.c_str());
+ }
+ }
+ return {};
+}
+
+void StatusAddChild(y_absl::Status* status, y_absl::Status child) {
+ upb::Arena arena;
+ // Serialize msg to buf
+ google_rpc_Status* msg = internal::StatusToProto(child, arena.ptr());
+ size_t buf_len = 0;
+ char* buf = google_rpc_Status_serialize(msg, arena.ptr(), &buf_len);
+ // Append (msg-length and msg) to children payload
+ y_absl::optional<y_absl::Cord> old_children =
+ status->GetPayload(kChildrenPropertyUrl);
+ y_absl::Cord children;
+ if (old_children.has_value()) {
+ children = *old_children;
+ }
+ char head_buf[sizeof(uint32_t)];
+ EncodeUInt32ToBytes(buf_len, head_buf);
+ children.Append(y_absl::string_view(head_buf, sizeof(uint32_t)));
+ children.Append(y_absl::string_view(buf, buf_len));
+ status->SetPayload(kChildrenPropertyUrl, std::move(children));
+}
+
+std::vector<y_absl::Status> StatusGetChildren(y_absl::Status status) {
+ y_absl::optional<y_absl::Cord> children = status.GetPayload(kChildrenPropertyUrl);
+ return children.has_value() ? ParseChildren(*children)
+ : std::vector<y_absl::Status>();
+}
+
+TString StatusToString(const y_absl::Status& status) {
+ if (status.ok()) {
+ return "OK";
+ }
+ TString head;
+ y_absl::StrAppend(&head, y_absl::StatusCodeToString(status.code()));
+ if (!status.message().empty()) {
+ y_absl::StrAppend(&head, ":", status.message());
+ }
+ std::vector<TString> kvs;
+ y_absl::optional<y_absl::Cord> children;
+ status.ForEachPayload([&](y_absl::string_view type_url,
+ const y_absl::Cord& payload) {
+ if (y_absl::StartsWith(type_url, kTypeUrlPrefix)) {
+ type_url.remove_prefix(kTypeUrlPrefix.size());
+ if (type_url == kTypeChildrenTag) {
+ children = payload;
+ return;
+ }
+ y_absl::string_view payload_view;
+ TString payload_storage;
+ if (payload.TryFlat().has_value()) {
+ payload_view = payload.TryFlat().value();
+ } else {
+ payload_storage = TString(payload);
+ payload_view = payload_storage;
+ }
+ if (y_absl::StartsWith(type_url, kTypeIntTag)) {
+ type_url.remove_prefix(kTypeIntTag.size());
+ kvs.push_back(y_absl::StrCat(type_url, ":", payload_view));
+ } else if (y_absl::StartsWith(type_url, kTypeStrTag)) {
+ type_url.remove_prefix(kTypeStrTag.size());
+ kvs.push_back(y_absl::StrCat(type_url, ":\"",
+ y_absl::CHexEscape(payload_view), "\""));
+ } else if (y_absl::StartsWith(type_url, kTypeTimeTag)) {
+ type_url.remove_prefix(kTypeTimeTag.size());
+ y_absl::Time t =
+ *reinterpret_cast<const y_absl::Time*>(payload_view.data());
+ kvs.push_back(y_absl::StrCat(type_url, ":\"", y_absl::FormatTime(t), "\""));
+ } else {
+ kvs.push_back(y_absl::StrCat(type_url, ":\"",
+ y_absl::CHexEscape(payload_view), "\""));
+ }
+ } else {
+ y_absl::optional<y_absl::string_view> payload_view = payload.TryFlat();
+ TString payload_str = y_absl::CHexEscape(
+ payload_view.has_value() ? *payload_view : TString(payload));
+ kvs.push_back(y_absl::StrCat(type_url, ":\"", payload_str, "\""));
+ }
+ });
+ if (children.has_value()) {
+ std::vector<y_absl::Status> children_status = ParseChildren(*children);
+ std::vector<TString> children_text;
+ children_text.reserve(children_status.size());
+ for (const y_absl::Status& child_status : children_status) {
+ children_text.push_back(StatusToString(child_status));
+ }
+ kvs.push_back(
+ y_absl::StrCat("children:[", y_absl::StrJoin(children_text, ", "), "]"));
+ }
+ return kvs.empty() ? head
+ : y_absl::StrCat(head, " {", y_absl::StrJoin(kvs, ", "), "}");
+}
+
+namespace internal {
+
+google_rpc_Status* StatusToProto(const y_absl::Status& status, upb_arena* arena) {
+ google_rpc_Status* msg = google_rpc_Status_new(arena);
+ google_rpc_Status_set_code(msg, int32_t(status.code()));
+ google_rpc_Status_set_message(
+ msg, upb_strview_make(status.message().data(), status.message().size()));
+ status.ForEachPayload([&](y_absl::string_view type_url,
+ const y_absl::Cord& payload) {
+ google_protobuf_Any* any = google_rpc_Status_add_details(msg, arena);
+ char* type_url_buf =
+ reinterpret_cast<char*>(upb_arena_malloc(arena, type_url.size()));
+ memcpy(type_url_buf, type_url.data(), type_url.size());
+ google_protobuf_Any_set_type_url(
+ any, upb_strview_make(type_url_buf, type_url.size()));
+ y_absl::optional<y_absl::string_view> v_view = payload.TryFlat();
+ if (v_view.has_value()) {
+ google_protobuf_Any_set_value(
+ any, upb_strview_make(v_view->data(), v_view->size()));
+ } else {
+ char* buf =
+ reinterpret_cast<char*>(upb_arena_malloc(arena, payload.size()));
+ char* cur = buf;
+ for (y_absl::string_view chunk : payload.Chunks()) {
+ memcpy(cur, chunk.data(), chunk.size());
+ cur += chunk.size();
+ }
+ google_protobuf_Any_set_value(any, upb_strview_make(buf, payload.size()));
+ }
+ });
+ return msg;
+}
+
+y_absl::Status StatusFromProto(google_rpc_Status* msg) {
+ int32_t code = google_rpc_Status_code(msg);
+ upb_strview message = google_rpc_Status_message(msg);
+ y_absl::Status status(static_cast<y_absl::StatusCode>(code),
+ y_absl::string_view(message.data, message.size));
+ size_t detail_len;
+ const google_protobuf_Any* const* details =
+ google_rpc_Status_details(msg, &detail_len);
+ for (size_t i = 0; i < detail_len; i++) {
+ upb_strview type_url = google_protobuf_Any_type_url(details[i]);
+ upb_strview value = google_protobuf_Any_value(details[i]);
+ status.SetPayload(y_absl::string_view(type_url.data, type_url.size),
+ y_absl::Cord(y_absl::string_view(value.data, value.size)));
+ }
+ return status;
+}
+
+uintptr_t StatusAllocPtr(y_absl::Status s) {
+ // This relies the fact that y_absl::Status has only one member, StatusRep*
+ // so the sizeof(y_absl::Status) has the same size of intptr_t and StatusRep*
+ // can be stolen using placement allocation.
+ static_assert(sizeof(intptr_t) == sizeof(y_absl::Status),
+ "y_absl::Status should be as big as intptr_t");
+ // This does two things;
+ // 1. Copies StatusRep* of y_absl::Status to ptr
+ // 2. Increases the counter of StatusRep if it's not inlined
+ uintptr_t ptr;
+ new (&ptr) y_absl::Status(s);
+ return ptr;
+}
+
+void StatusFreePtr(uintptr_t ptr) {
+ // Decreases the counter of StatusRep if it's not inlined.
+ reinterpret_cast<y_absl::Status*>(&ptr)->~Status();
+}
+
+y_absl::Status StatusGetFromPtr(uintptr_t ptr) {
+ // Constructs Status from ptr having the address of StatusRep.
+ return *reinterpret_cast<y_absl::Status*>(&ptr);
+}
+
+uintptr_t StatusAllocHeapPtr(y_absl::Status s) {
+ if (s.ok()) return kOkStatusPtr;
+ y_absl::Status* ptr = new y_absl::Status(s);
+ return reinterpret_cast<uintptr_t>(ptr);
+}
+
+void StatusFreeHeapPtr(uintptr_t ptr) {
+ y_absl::Status* s = reinterpret_cast<y_absl::Status*>(ptr);
+ delete s;
+}
+
+y_absl::Status StatusGetFromHeapPtr(uintptr_t ptr) {
+ if (ptr == kOkStatusPtr) {
+ return y_absl::OkStatus();
+ } else {
+ return *reinterpret_cast<y_absl::Status*>(ptr);
+ }
+}
+
+} // namespace internal
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/status_helper.h b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.h
new file mode 100644
index 00000000000..b66ed35d260
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/status_helper.h
@@ -0,0 +1,194 @@
+//
+//
+// Copyright 2021 the gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+
+#ifndef GRPC_CORE_LIB_GPRPP_STATUS_HELPER_H
+#define GRPC_CORE_LIB_GPRPP_STATUS_HELPER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <vector>
+
+#include "y_absl/status/status.h"
+#include "y_absl/time/time.h"
+#include "y_absl/types/optional.h"
+
+#include "src/core/lib/gprpp/debug_location.h"
+
+extern "C" {
+struct google_rpc_Status;
+struct upb_arena;
+}
+
+namespace grpc_core {
+
+/// This enum should have the same value of grpc_error_ints
+// TODO(veblush): Use camel-case names once migration to y_absl::Status is done.
+enum class StatusIntProperty {
+ /// 'errno' from the operating system
+ kErrorNo,
+ /// __LINE__ from the call site creating the error
+ kFileLine,
+ /// stream identifier: for errors that are associated with an individual
+ /// wire stream
+ kStreamId,
+ /// grpc status code representing this error
+ // TODO(veblush): Remove this after grpc_error is replaced with y_absl::Status
+ kRpcStatus,
+ /// offset into some binary blob (usually represented by
+ /// RAW_BYTES) where the error occurred
+ kOffset,
+ /// context sensitive index associated with the error
+ kIndex,
+ /// context sensitive size associated with the error
+ kSize,
+ /// http2 error code associated with the error (see the HTTP2 RFC)
+ kHttp2Error,
+ /// TSI status code associated with the error
+ kTsiCode,
+ /// WSAGetLastError() reported when this error occurred
+ kWsaError,
+ /// File descriptor associated with this error
+ kFd,
+ /// HTTP status (i.e. 404)
+ kHttpStatus,
+ /// chttp2: did the error occur while a write was in progress
+ kOccurredDuringWrite,
+ /// channel connectivity state associated with the error
+ ChannelConnectivityState,
+ /// LB policy drop
+ kLbPolicyDrop,
+};
+
+/// This enum should have the same value of grpc_error_strs
+// TODO(veblush): Use camel-case names once migration to y_absl::Status is done.
+enum class StatusStrProperty {
+ /// top-level textual description of this error
+ kDescription,
+ /// source file in which this error occurred
+ kFile,
+ /// operating system description of this error
+ kOsError,
+ /// syscall that generated this error
+ kSyscall,
+ /// peer that we were trying to communicate when this error occurred
+ kTargetAddress,
+ /// grpc status message associated with this error
+ kGrpcMessage,
+ /// hex dump (or similar) with the data that generated this error
+ kRawBytes,
+ /// tsi error string associated with this error
+ kTsiError,
+ /// filename that we were trying to read/write when this error occurred
+ kFilename,
+ /// key associated with the error
+ kKey,
+ /// value associated with the error
+ kValue,
+};
+
+/// This enum should have the same value of grpc_error_times
+enum class StatusTimeProperty {
+ /// timestamp of error creation
+ kCreated,
+};
+
+/// Creates a status with given additional information
+y_absl::Status StatusCreate(
+ y_absl::StatusCode code, y_absl::string_view msg, const DebugLocation& location,
+ std::initializer_list<y_absl::Status> children) GRPC_MUST_USE_RESULT;
+
+/// Sets the int property to the status
+void StatusSetInt(y_absl::Status* status, StatusIntProperty key, intptr_t value);
+
+/// Gets the int property from the status
+y_absl::optional<intptr_t> StatusGetInt(
+ const y_absl::Status& status, StatusIntProperty key) GRPC_MUST_USE_RESULT;
+
+/// Sets the str property to the status
+void StatusSetStr(y_absl::Status* status, StatusStrProperty key,
+ y_absl::string_view value);
+
+/// Gets the str property from the status
+y_absl::optional<TString> StatusGetStr(
+ const y_absl::Status& status, StatusStrProperty key) GRPC_MUST_USE_RESULT;
+
+/// Sets the time property to the status
+void StatusSetTime(y_absl::Status* status, StatusTimeProperty key,
+ y_absl::Time time);
+
+/// Gets the time property from the status
+y_absl::optional<y_absl::Time> StatusGetTime(
+ const y_absl::Status& status, StatusTimeProperty key) GRPC_MUST_USE_RESULT;
+
+/// Adds a child status to status
+void StatusAddChild(y_absl::Status* status, y_absl::Status child);
+
+/// Returns all children status from a status
+std::vector<y_absl::Status> StatusGetChildren(y_absl::Status status)
+ GRPC_MUST_USE_RESULT;
+
+/// Returns a string representation from status
+/// Error status will be like
+/// STATUS[:MESSAGE] [{PAYLOADS[, children:[CHILDREN-STATUS-LISTS]]}]
+/// e.g.
+/// CANCELLATION:SampleMessage {errno:'2021', line:'54', children:[ABORTED]}
+TString StatusToString(const y_absl::Status& status) GRPC_MUST_USE_RESULT;
+
+namespace internal {
+
+/// Builds a upb message, google_rpc_Status from a status
+/// This is for internal implementation & test only
+google_rpc_Status* StatusToProto(const y_absl::Status& status,
+ upb_arena* arena) GRPC_MUST_USE_RESULT;
+
+/// Builds a status from a upb message, google_rpc_Status
+/// This is for internal implementation & test only
+y_absl::Status StatusFromProto(google_rpc_Status* msg) GRPC_MUST_USE_RESULT;
+
+/// The same value of internal::StatusAllocPtr(y_absl::OkStatus())
+static constexpr uintptr_t kOkStatusPtr = 0;
+
+/// Returns ptr where the given status is copied into.
+/// This ptr can be used to get Status later and should be freed by
+/// StatusFreePtr. This shouldn't be used except migration purpose.
+uintptr_t StatusAllocPtr(y_absl::Status s);
+
+/// Frees the allocated status at ptr.
+/// This shouldn't be used except migration purpose.
+void StatusFreePtr(uintptr_t ptr);
+
+/// Get the status from ptr.
+/// This shouldn't be used except migration purpose.
+y_absl::Status StatusGetFromPtr(uintptr_t ptr);
+
+/// Returns ptr that is allocated in the heap memory and the given status is
+/// copied into. This ptr can be used to get Status later and should be
+/// freed by StatusFreeHeapPtr. This can be 0 in case of OkStatus.
+uintptr_t StatusAllocHeapPtr(y_absl::Status s);
+
+/// Frees the allocated status at heap ptr.
+void StatusFreeHeapPtr(uintptr_t ptr);
+
+/// Get the status from a heap ptr.
+y_absl::Status StatusGetFromHeapPtr(uintptr_t ptr);
+
+} // namespace internal
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_STATUS_HELPER_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/sync.h b/contrib/libs/grpc/src/core/lib/gprpp/sync.h
index 6bb0512f67f..eb1705795b9 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/sync.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/sync.h
@@ -19,14 +19,14 @@
#ifndef GRPC_CORE_LIB_GPRPP_SYNC_H
#define GRPC_CORE_LIB_GPRPP_SYNC_H
-#include <grpc/impl/codegen/port_platform.h>
+#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
-#include <grpc/impl/codegen/sync.h>
+#include "y_absl/synchronization/mutex.h"
+
+#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include "y_absl/synchronization/mutex.h"
#include "src/core/lib/gprpp/time_util.h"
// The core library is not accessible in C++ codegen headers, and vice versa.
@@ -69,6 +69,7 @@ class Y_ABSL_LOCKABLE Mutex {
bool TryLock() Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) {
return gpr_mu_trylock(&mu_) != 0;
}
+ void AssertHeld() Y_ABSL_ASSERT_EXCLUSIVE_LOCK() {}
private:
gpr_mu mu_;
@@ -145,33 +146,6 @@ class CondVar {
#endif // GPR_ABSEIL_SYNC
-template <typename Predicate>
-static void WaitUntil(CondVar* cv, Mutex* mu, Predicate pred) {
- while (!pred()) {
- cv->Wait(mu);
- }
-}
-
-// Returns true iff we timed-out
-template <typename Predicate>
-static bool WaitUntilWithTimeout(CondVar* cv, Mutex* mu, Predicate pred,
- y_absl::Duration timeout) {
- while (!pred()) {
- if (cv->WaitWithTimeout(mu, timeout)) return true;
- }
- return false;
-}
-
-// Returns true iff we timed-out
-template <typename Predicate>
-static bool WaitUntilWithDeadline(CondVar* cv, Mutex* mu, Predicate pred,
- y_absl::Time deadline) {
- while (!pred()) {
- if (cv->WaitWithDeadline(mu, deadline)) return true;
- }
- return false;
-}
-
// Deprecated. Prefer MutexLock
class MutexLockForGprMu {
public:
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/table.h b/contrib/libs/grpc/src/core/lib/gprpp/table.h
new file mode 100644
index 00000000000..570a3d5d9b3
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/gprpp/table.h
@@ -0,0 +1,423 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_GPRPP_TABLE_H
+#define GRPC_CORE_LIB_GPRPP_TABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "y_absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/bitset.h"
+
+namespace grpc_core {
+
+// Meta-programming detail types to aid in building up a Table
+namespace table_detail {
+
+// A tuple-like type that contains manually constructed elements.
+template <typename... Ts>
+struct Elements;
+template <typename T, typename... Ts>
+struct Elements<T, Ts...> : Elements<Ts...> {
+ union U {
+ U() {}
+ ~U() {}
+ GPR_NO_UNIQUE_ADDRESS T x;
+ };
+ U u;
+};
+template <>
+struct Elements<> {};
+
+// Element accessor for Elements<>
+// Provides a static method f that returns a pointer to the value of element I
+// for Elements<Ts...>
+template <size_t I, typename... Ts>
+struct GetElem;
+
+template <typename T, typename... Ts>
+struct GetElem<0, T, Ts...> {
+ static T* f(Elements<T, Ts...>* e) { return &e->u.x; }
+ static const T* f(const Elements<T, Ts...>* e) { return &e->u.x; }
+};
+
+template <size_t I, typename T, typename... Ts>
+struct GetElem<I, T, Ts...> {
+ static auto f(Elements<T, Ts...>* e)
+ -> decltype(GetElem<I - 1, Ts...>::f(e)) {
+ return GetElem<I - 1, Ts...>::f(e);
+ }
+ static auto f(const Elements<T, Ts...>* e)
+ -> decltype(GetElem<I - 1, Ts...>::f(e)) {
+ return GetElem<I - 1, Ts...>::f(e);
+ }
+};
+
+// CountIncludedStruct is the backing for the CountIncluded function below.
+// Sets a member constant N to the number of times Needle is in Haystack.
+template <typename Needle, typename... Haystack>
+struct CountIncludedStruct;
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct CountIncludedStruct<Needle, Straw, RestOfHaystack...> {
+ static constexpr size_t N =
+ static_cast<size_t>(std::is_same<Needle, Straw>::value) +
+ CountIncludedStruct<Needle, RestOfHaystack...>::N;
+};
+template <typename Needle>
+struct CountIncludedStruct<Needle> {
+ static constexpr size_t N = 0;
+};
+// Returns the number of times Needle is in Haystack.
+template <typename Needle, typename... Haystack>
+constexpr size_t CountIncluded() {
+ return CountIncludedStruct<Needle, Haystack...>::N;
+}
+
+// IndexOfStruct is the backing for IndexOf below.
+// Set a member constant N to the index of Needle in Haystack.
+// Ignored should be void always, and is used for enable_if_t.
+template <typename Ignored, typename Needle, typename... Haystack>
+struct IndexOfStruct;
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct IndexOfStruct<y_absl::enable_if_t<std::is_same<Needle, Straw>::value>,
+ Needle, Straw, RestOfHaystack...> {
+ // The first element is the one we're looking for. Done.
+ static constexpr size_t N = 0;
+};
+template <typename Needle, typename Straw, typename... RestOfHaystack>
+struct IndexOfStruct<y_absl::enable_if_t<!std::is_same<Needle, Straw>::value>,
+ Needle, Straw, RestOfHaystack...> {
+ // The first element is not the one we're looking for, recurse looking at the
+ // tail, and sum the number of recursions.
+ static constexpr size_t N =
+ 1 + IndexOfStruct<void, Needle, RestOfHaystack...>::N;
+};
+// Return the index of Needle in Haystack.
+// Guarded by CountIncluded to ensure that the return type is unambiguous.
+// If you got here from a compiler error using Table, it's likely that you've
+// used the type-based accessor/mutators, but the type you're using is repeated
+// more than once in the Table type arguments. Consider either using the indexed
+// accessor/mutator variants, or eliminating the ambiguity in type resolution.
+template <typename Needle, typename... Haystack>
+constexpr y_absl::enable_if_t<CountIncluded<Needle, Haystack...>() == 1, size_t>
+IndexOf() {
+ return IndexOfStruct<void, Needle, Haystack...>::N;
+}
+
+// TypeIndexStruct is the backing for TypeIndex below.
+// Sets member type Type to the type at index I in Ts.
+// Implemented as a simple type recursion.
+template <size_t I, typename... Ts>
+struct TypeIndexStruct;
+template <typename T, typename... Ts>
+struct TypeIndexStruct<0, T, Ts...> {
+ using Type = T;
+};
+template <size_t I, typename T, typename... Ts>
+struct TypeIndexStruct<I, T, Ts...> : TypeIndexStruct<I - 1, Ts...> {};
+// TypeIndex is the type at index I in Ts.
+template <size_t I, typename... Ts>
+using TypeIndex = typename TypeIndexStruct<I, Ts...>::Type;
+
+// Helper to call the destructor of p if p is non-null.
+template <typename T>
+void DestructIfNotNull(T* p) {
+ if (p) p->~T();
+}
+
+// Helper function... just ignore the initializer list passed into it.
+// Allows doing 'statements' via parameter pack expansion in C++11 - given
+// template <typename... Ts>:
+// do_these_things({(foo<Ts>(), 1)});
+// will execute foo<T>() for each T in Ts.
+// In this example we also leverage the comma operator to make the resultant
+// type of each statement be a consistant int so that C++ type deduction works
+// as we'd like (note that in the expression (a, 1) in C++, the 'result' of the
+// expression is the value after the right-most ',' -- in this case 1, with a
+// executed as a side effect.
+template <typename T>
+void do_these_things(std::initializer_list<T>) {}
+
+} // namespace table_detail
+
+// A Table<Ts> is much like a tuple<optional<Ts>...> - a set of values that are
+// optionally present. Table efficiently packs the presence bits for size, and
+// provides a slightly more convenient interface.
+template <typename... Ts>
+class Table {
+ // Helper - TypeIndex<I> is the type at index I in Ts
+ template <size_t I>
+ using TypeIndex = table_detail::TypeIndex<I, Ts...>;
+
+ public:
+ // Construct a table with no values set.
+ Table() = default;
+ // Destruct - forwards to the Destruct member with an integer sequence so we
+ // can destruct field-wise.
+ ~Table() { Destruct(y_absl::make_index_sequence<sizeof...(Ts)>()); }
+
+ // Copy another table
+ Table(const Table& rhs) {
+ // Since we know all fields are clear initially, pass false for or_clear.
+ Copy<false>(y_absl::make_index_sequence<sizeof...(Ts)>(), rhs);
+ }
+
+ // Copy another table
+ Table& operator=(const Table& rhs) {
+ // Since we may not be all clear, pass true for or_clear to have Copy()
+ // clear newly emptied fields.
+ Copy<true>(y_absl::make_index_sequence<sizeof...(Ts)>(), rhs);
+ return *this;
+ }
+
+ // Move from another table
+ Table(Table&& rhs) noexcept {
+ // Since we know all fields are clear initially, pass false for or_clear.
+ Move<false>(y_absl::make_index_sequence<sizeof...(Ts)>(),
+ std::forward<Table>(rhs));
+ }
+
+ // Move from another table
+ Table& operator=(Table&& rhs) noexcept {
+ // Since we may not be all clear, pass true for or_clear to have Move()
+ // clear newly emptied fields.
+ Move<true>(y_absl::make_index_sequence<sizeof...(Ts)>(),
+ std::forward<Table>(rhs));
+ return *this;
+ }
+
+ // Check if this table has a value for type T.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ bool has() const {
+ return has<index_of<T>()>();
+ }
+
+ // Check if this table has index I.
+ template <size_t I>
+ y_absl::enable_if_t < I<sizeof...(Ts), bool> has() const {
+ return present_bits_.is_set(I);
+ }
+
+ // Return the value for type T, or nullptr if it is un-set.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ T* get() {
+ return get<index_of<T>()>();
+ }
+
+ // Return the value for type T, or nullptr if it is un-set.
+ // Only available if there exists only one T in Ts.
+ template <typename T>
+ const T* get() const {
+ return get<index_of<T>()>();
+ }
+
+ // Return the value for index I, or nullptr if it is un-set.
+ template <size_t I>
+ TypeIndex<I>* get() {
+ if (has<I>()) return element_ptr<I>();
+ return nullptr;
+ }
+
+ // Return the value for index I, or nullptr if it is un-set.
+ template <size_t I>
+ const TypeIndex<I>* get() const {
+ if (has<I>()) return element_ptr<I>();
+ return nullptr;
+ }
+
+ // Return the value for type T, default constructing it if it is un-set.
+ template <typename T>
+ T* get_or_create() {
+ return get_or_create<index_of<T>()>();
+ }
+
+ // Return the value for index I, default constructing it if it is un-set.
+ template <size_t I>
+ TypeIndex<I>* get_or_create() {
+ auto* p = element_ptr<I>();
+ if (!set_present<I>(true)) {
+ new (p) TypeIndex<I>();
+ }
+ return element_ptr<I>();
+ }
+
+ // Set the value for type T - using Args as construction arguments.
+ template <typename T, typename... Args>
+ T* set(Args&&... args) {
+ return set<index_of<T>()>(std::forward<Args>(args)...);
+ }
+
+ // Set the value for index I - using Args as construction arguments.
+ template <size_t I, typename... Args>
+ TypeIndex<I>* set(Args&&... args) {
+ auto* p = element_ptr<I>();
+ if (set_present<I>(true)) {
+ TypeIndex<I> replacement(std::forward<Args>(args)...);
+ *p = std::move(replacement);
+ } else {
+ new (p) TypeIndex<I>(std::forward<Args>(args)...);
+ }
+ return p;
+ }
+
+ template <size_t I>
+ TypeIndex<I>* set(TypeIndex<I>&& value) {
+ auto* p = element_ptr<I>();
+ if (set_present<I>(true)) {
+ *p = std::forward<TypeIndex<I>>(value);
+ } else {
+ new (p) TypeIndex<I>(std::forward<TypeIndex<I>>(value));
+ }
+ return p;
+ }
+
+ // Clear the value for type T, leaving it un-set.
+ template <typename T>
+ void clear() {
+ clear<index_of<T>()>();
+ }
+
+ // Clear the value for index I, leaving it un-set.
+ template <size_t I>
+ void clear() {
+ if (set_present<I>(false)) {
+ using T = TypeIndex<I>;
+ element_ptr<I>()->~T();
+ }
+ }
+
+ // Iterate through each set field in the table
+ template <typename F>
+ void ForEach(F f) const {
+ ForEachImpl(std::move(f), y_absl::make_index_sequence<sizeof...(Ts)>());
+ }
+
+ // Count the number of set fields in the table
+ size_t count() const { return present_bits_.count(); }
+
+ private:
+ // Bit field for which elements of the table are set (true) or un-set (false,
+ // the default) -- one bit for each type in Ts.
+ using PresentBits = BitSet<sizeof...(Ts)>;
+ // The tuple-like backing structure for Table.
+ using Elements = table_detail::Elements<Ts...>;
+ // Extractor from Elements
+ template <size_t I>
+ using GetElem = table_detail::GetElem<I, Ts...>;
+
+ // Given a T, return the unambiguous index of it within Ts.
+ template <typename T>
+ static constexpr size_t index_of() {
+ return table_detail::IndexOf<T, Ts...>();
+ }
+
+ // Given an index, return a point to the (maybe uninitialized!) data value at
+ // index I.
+ template <size_t I>
+ TypeIndex<I>* element_ptr() {
+ return GetElem<I>::f(&elements_);
+ }
+
+ // Given an index, return a point to the (maybe uninitialized!) data value at
+ // index I.
+ template <size_t I>
+ const TypeIndex<I>* element_ptr() const {
+ return GetElem<I>::f(&elements_);
+ }
+
+ // Set the present bit to value (if true - value is present/set, if false,
+ // value is un-set). Returns the old value so that calling code can note
+ // transition edges.
+ template <size_t I>
+ bool set_present(bool value) {
+ bool out = present_bits_.is_set(I);
+ present_bits_.set(I, value);
+ return out;
+ }
+
+ // Set the value of index I to the value held in rhs index I if it is set.
+ // If it is unset, if or_clear is true, then clear our value, otherwise do
+ // nothing.
+ template <bool or_clear, size_t I>
+ void CopyIf(const Table& rhs) {
+ if (auto* p = rhs.get<I>()) {
+ set<I>(*p);
+ } else if (or_clear) {
+ clear<I>();
+ }
+ }
+
+ // Set the value of index I to the value moved from rhs index I if it was set.
+ // If it is unset, if or_clear is true, then clear our value, otherwise do
+ // nothing.
+ template <bool or_clear, size_t I>
+ void MoveIf(Table&& rhs) {
+ if (auto* p = rhs.get<I>()) {
+ set<I>(std::move(*p));
+ } else if (or_clear) {
+ clear<I>();
+ }
+ }
+
+ // Call (*f)(value) if that value is in the table.
+ template <size_t I, typename F>
+ void CallIf(F* f) const {
+ if (auto* p = get<I>()) {
+ (*f)(*p);
+ }
+ }
+
+ // For each field (element I=0, 1, ...) if that field is present, call its
+ // destructor.
+ template <size_t... I>
+ void Destruct(y_absl::index_sequence<I...>) {
+ table_detail::do_these_things<int>(
+ {(table_detail::DestructIfNotNull(get<I>()), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) copy that field into this table -
+ // or_clear as per CopyIf().
+ template <bool or_clear, size_t... I>
+ void Copy(y_absl::index_sequence<I...>, const Table& rhs) {
+ table_detail::do_these_things<int>({(CopyIf<or_clear, I>(rhs), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) move that field into this table -
+ // or_clear as per MoveIf().
+ template <bool or_clear, size_t... I>
+ void Move(y_absl::index_sequence<I...>, Table&& rhs) {
+ table_detail::do_these_things<int>(
+ {(MoveIf<or_clear, I>(std::forward<Table>(rhs)), 1)...});
+ }
+
+ // For each field (element I=0, 1, ...) if that field is present, call f.
+ template <typename F, size_t... I>
+ void ForEachImpl(F f, y_absl::index_sequence<I...>) const {
+ table_detail::do_these_things<int>({(CallIf<I>(&f), 1)...});
+ }
+
+ // Bit field indicating which elements are set.
+ GPR_NO_UNIQUE_ADDRESS PresentBits present_bits_;
+ // The memory to store the elements themselves.
+ GPR_NO_UNIQUE_ADDRESS Elements elements_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_GPRPP_TABLE_H
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc b/contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc
index de43687da62..210294a4aa2 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/thd_posix.cc
@@ -23,20 +23,20 @@
#ifdef GPR_POSIX_SYNC
-#include "src/core/lib/gprpp/thd.h"
+#include <pthread.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
-#include <pthread.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/fork.h"
#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/gprpp/thd.h"
namespace grpc_core {
namespace {
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc b/contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc
index fb90afd0f70..ce1a753995b 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/thd_windows.cc
@@ -22,22 +22,15 @@
#ifdef GPR_WINDOWS
-#include "src/core/lib/gprpp/thd.h"
+#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/thd_id.h>
-#include <string.h>
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/memory.h"
-
-#if defined(_MSC_VER)
-#define thread_local __declspec(thread)
-#elif defined(__GNUC__)
-#define thread_local __thread
-#else
-#error "Unknown compiler - please file a bug report"
-#endif
+#include "src/core/lib/gprpp/thd.h"
namespace {
class ThreadInternalsWindows;
@@ -49,7 +42,7 @@ struct thd_info {
bool joinable; /* whether it is joinable */
};
-thread_local struct thd_info* g_thd_info;
+GPR_THREAD_LOCAL(struct thd_info*) g_thd_info;
class ThreadInternalsWindows
: public grpc_core::internal::ThreadInternalsInterface {
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/time_util.cc b/contrib/libs/grpc/src/core/lib/gprpp/time_util.cc
index 33a9c54adeb..c543e4b5120 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/time_util.cc
+++ b/contrib/libs/grpc/src/core/lib/gprpp/time_util.cc
@@ -16,10 +16,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-
#include "src/core/lib/gprpp/time_util.h"
+#include <grpc/support/log.h>
+
namespace grpc_core {
gpr_timespec ToGprTimeSpec(y_absl::Duration duration) {
diff --git a/contrib/libs/grpc/src/core/lib/gprpp/time_util.h b/contrib/libs/grpc/src/core/lib/gprpp/time_util.h
index b7b40bb426d..4ad0997997b 100644
--- a/contrib/libs/grpc/src/core/lib/gprpp/time_util.h
+++ b/contrib/libs/grpc/src/core/lib/gprpp/time_util.h
@@ -19,10 +19,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/time.h>
-
#include "y_absl/time/time.h"
+#include <grpc/support/time.h>
+
namespace grpc_core {
// Converts y_absl::Duration to gpr_timespec(GPR_TIMESPAN)
diff --git a/contrib/libs/grpc/src/core/lib/http/format_request.cc b/contrib/libs/grpc/src/core/lib/http/format_request.cc
index d9294324bd0..66320cf6fad 100644
--- a/contrib/libs/grpc/src/core/lib/http/format_request.cc
+++ b/contrib/libs/grpc/src/core/lib/http/format_request.cc
@@ -32,6 +32,7 @@
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+
#include "src/core/lib/gpr/string.h"
static void fill_common_header(const grpc_httpcli_request* request,
diff --git a/contrib/libs/grpc/src/core/lib/http/format_request.h b/contrib/libs/grpc/src/core/lib/http/format_request.h
index bcc332fe6e7..30c870fb692 100644
--- a/contrib/libs/grpc/src/core/lib/http/format_request.h
+++ b/contrib/libs/grpc/src/core/lib/http/format_request.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/http/httpcli.h"
grpc_slice grpc_httpcli_format_get_request(const grpc_httpcli_request* request);
diff --git a/contrib/libs/grpc/src/core/lib/http/httpcli.cc b/contrib/libs/grpc/src/core/lib/http/httpcli.cc
index b2077ef004b..9b53dc1f1f9 100644
--- a/contrib/libs/grpc/src/core/lib/http/httpcli.cc
+++ b/contrib/libs/grpc/src/core/lib/http/httpcli.cc
@@ -25,11 +25,14 @@
#include <util/generic/string.h>
#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/string_view.h"
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
@@ -38,236 +41,255 @@
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
-struct internal_request {
- grpc_slice request_text;
- grpc_http_parser parser;
- grpc_resolved_addresses* addresses;
- size_t next_address;
- grpc_endpoint* ep;
- char* host;
- char* ssl_host_override;
- grpc_millis deadline;
- int have_read_byte;
- const grpc_httpcli_handshaker* handshaker;
- grpc_closure* on_done;
- grpc_httpcli_context* context;
- grpc_polling_entity* pollent;
- grpc_iomgr_object iomgr_obj;
- grpc_slice_buffer incoming;
- grpc_slice_buffer outgoing;
- grpc_closure on_read;
- grpc_closure done_write;
- grpc_closure connected;
- grpc_error* overall_error;
- grpc_resource_quota* resource_quota;
-};
-static grpc_httpcli_get_override g_get_override = nullptr;
-static grpc_httpcli_post_override g_post_override = nullptr;
-
-static void plaintext_handshake(void* arg, grpc_endpoint* endpoint,
- const char* /*host*/, grpc_millis /*deadline*/,
- void (*on_done)(void* arg,
- grpc_endpoint* endpoint)) {
- on_done(arg, endpoint);
-}
-
-const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
- plaintext_handshake};
+namespace grpc_core {
+namespace {
+
+class InternalRequest {
+ public:
+ InternalRequest(const grpc_slice& request_text,
+ grpc_httpcli_response* response,
+ ResourceQuotaRefPtr resource_quota, y_absl::string_view host,
+ y_absl::string_view ssl_host_override, grpc_millis deadline,
+ const grpc_httpcli_handshaker* handshaker,
+ grpc_closure* on_done, grpc_httpcli_context* context,
+ grpc_polling_entity* pollent, const char* name)
+ : request_text_(request_text),
+ resource_quota_(std::move(resource_quota)),
+ host_(host),
+ ssl_host_override_(ssl_host_override),
+ deadline_(deadline),
+ handshaker_(handshaker),
+ on_done_(on_done),
+ context_(context),
+ pollent_(pollent) {
+ grpc_http_parser_init(&parser_, GRPC_HTTP_RESPONSE, response);
+ grpc_slice_buffer_init(&incoming_);
+ grpc_slice_buffer_init(&outgoing_);
+ grpc_iomgr_register_object(&iomgr_obj_, name);
+
+ GRPC_CLOSURE_INIT(&on_read_, OnRead, this, grpc_schedule_on_exec_ctx);
+ GRPC_CLOSURE_INIT(&done_write_, DoneWrite, this, grpc_schedule_on_exec_ctx);
+ GPR_ASSERT(pollent);
+ grpc_polling_entity_add_to_pollset_set(pollent_, context->pollset_set);
+ grpc_resolve_address(
+ host_.c_str(), handshaker_->default_port, context_->pollset_set,
+ GRPC_CLOSURE_CREATE(OnResolved, this, grpc_schedule_on_exec_ctx),
+ &addresses_);
+ }
-void grpc_httpcli_context_init(grpc_httpcli_context* context) {
- context->pollset_set = grpc_pollset_set_create();
-}
+ ~InternalRequest() {
+ grpc_http_parser_destroy(&parser_);
+ if (addresses_ != nullptr) {
+ grpc_resolved_addresses_destroy(addresses_);
+ }
+ if (ep_ != nullptr) {
+ grpc_endpoint_destroy(ep_);
+ }
+ grpc_slice_unref_internal(request_text_);
+ grpc_iomgr_unregister_object(&iomgr_obj_);
+ grpc_slice_buffer_destroy_internal(&incoming_);
+ grpc_slice_buffer_destroy_internal(&outgoing_);
+ GRPC_ERROR_UNREF(overall_error_);
+ }
-void grpc_httpcli_context_destroy(grpc_httpcli_context* context) {
- grpc_pollset_set_destroy(context->pollset_set);
-}
+ private:
+ void Finish(grpc_error_handle error) {
+ grpc_polling_entity_del_from_pollset_set(pollent_, context_->pollset_set);
+ ExecCtx::Run(DEBUG_LOCATION, on_done_, error);
+ delete this;
+ }
-static void next_address(internal_request* req, grpc_error* due_to_error);
+ void AppendError(grpc_error_handle error) {
+ if (overall_error_ == GRPC_ERROR_NONE) {
+ overall_error_ =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
+ }
+ grpc_resolved_address* addr = &addresses_->addrs[next_address_ - 1];
+ TString addr_text = grpc_sockaddr_to_uri(addr);
+ overall_error_ = grpc_error_add_child(
+ overall_error_,
+ grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, addr_text));
+ }
-static void finish(internal_request* req, grpc_error* error) {
- grpc_polling_entity_del_from_pollset_set(req->pollent,
- req->context->pollset_set);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, req->on_done, error);
- grpc_http_parser_destroy(&req->parser);
- if (req->addresses != nullptr) {
- grpc_resolved_addresses_destroy(req->addresses);
+ void DoRead() {
+ grpc_endpoint_read(ep_, &incoming_, &on_read_, /*urgent=*/true);
}
- if (req->ep != nullptr) {
- grpc_endpoint_destroy(req->ep);
+
+ static void OnRead(void* user_data, grpc_error_handle error) {
+ InternalRequest* req = static_cast<InternalRequest*>(user_data);
+ req->OnReadInternal(error);
}
- grpc_slice_unref_internal(req->request_text);
- gpr_free(req->host);
- gpr_free(req->ssl_host_override);
- grpc_iomgr_unregister_object(&req->iomgr_obj);
- grpc_slice_buffer_destroy_internal(&req->incoming);
- grpc_slice_buffer_destroy_internal(&req->outgoing);
- GRPC_ERROR_UNREF(req->overall_error);
- grpc_resource_quota_unref_internal(req->resource_quota);
- gpr_free(req);
-}
-static void append_error(internal_request* req, grpc_error* error) {
- if (req->overall_error == GRPC_ERROR_NONE) {
- req->overall_error =
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed HTTP/1 client request");
+ void OnReadInternal(grpc_error_handle error) {
+ size_t i;
+
+ for (i = 0; i < incoming_.count; i++) {
+ if (GRPC_SLICE_LENGTH(incoming_.slices[i])) {
+ have_read_byte_ = 1;
+ grpc_error_handle err =
+ grpc_http_parser_parse(&parser_, incoming_.slices[i], nullptr);
+ if (err != GRPC_ERROR_NONE) {
+ Finish(err);
+ return;
+ }
+ }
+ }
+
+ if (error == GRPC_ERROR_NONE) {
+ DoRead();
+ } else if (!have_read_byte_) {
+ NextAddress(GRPC_ERROR_REF(error));
+ } else {
+ Finish(grpc_http_parser_eof(&parser_));
+ }
}
- grpc_resolved_address* addr = &req->addresses->addrs[req->next_address - 1];
- TString addr_text = grpc_sockaddr_to_uri(addr);
- req->overall_error = grpc_error_add_child(
- req->overall_error,
- grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(std::move(addr_text))));
-}
-static void do_read(internal_request* req) {
- grpc_endpoint_read(req->ep, &req->incoming, &req->on_read, /*urgent=*/true);
-}
+ void OnWritten() { DoRead(); }
-static void on_read(void* user_data, grpc_error* error) {
- internal_request* req = static_cast<internal_request*>(user_data);
- size_t i;
-
- for (i = 0; i < req->incoming.count; i++) {
- if (GRPC_SLICE_LENGTH(req->incoming.slices[i])) {
- req->have_read_byte = 1;
- grpc_error* err = grpc_http_parser_parse(
- &req->parser, req->incoming.slices[i], nullptr);
- if (err != GRPC_ERROR_NONE) {
- finish(req, err);
- return;
- }
+ static void DoneWrite(void* arg, grpc_error_handle error) {
+ InternalRequest* req = static_cast<InternalRequest*>(arg);
+ if (error == GRPC_ERROR_NONE) {
+ req->OnWritten();
+ } else {
+ req->NextAddress(GRPC_ERROR_REF(error));
}
}
- if (error == GRPC_ERROR_NONE) {
- do_read(req);
- } else if (!req->have_read_byte) {
- next_address(req, GRPC_ERROR_REF(error));
- } else {
- finish(req, grpc_http_parser_eof(&req->parser));
+ void StartWrite() {
+ grpc_slice_ref_internal(request_text_);
+ grpc_slice_buffer_add(&outgoing_, request_text_);
+ grpc_endpoint_write(ep_, &outgoing_, &done_write_, nullptr);
}
-}
-static void on_written(internal_request* req) { do_read(req); }
+ static void OnHandshakeDone(void* arg, grpc_endpoint* ep) {
+ InternalRequest* req = static_cast<InternalRequest*>(arg);
-static void done_write(void* arg, grpc_error* error) {
- internal_request* req = static_cast<internal_request*>(arg);
- if (error == GRPC_ERROR_NONE) {
- on_written(req);
- } else {
- next_address(req, GRPC_ERROR_REF(error));
+ if (!ep) {
+ req->NextAddress(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Unexplained handshake failure"));
+ return;
+ }
+
+ req->ep_ = ep;
+ req->StartWrite();
}
-}
-static void start_write(internal_request* req) {
- grpc_slice_ref_internal(req->request_text);
- grpc_slice_buffer_add(&req->outgoing, req->request_text);
- grpc_endpoint_write(req->ep, &req->outgoing, &req->done_write, nullptr);
-}
+ static void OnConnected(void* arg, grpc_error_handle error) {
+ InternalRequest* req = static_cast<InternalRequest*>(arg);
-static void on_handshake_done(void* arg, grpc_endpoint* ep) {
- internal_request* req = static_cast<internal_request*>(arg);
+ if (!req->ep_) {
+ req->NextAddress(GRPC_ERROR_REF(error));
+ return;
+ }
+ req->handshaker_->handshake(req, req->ep_,
+ req->ssl_host_override_.empty()
+ ? req->host_.c_str()
+ : req->ssl_host_override_.c_str(),
+ req->deadline_, OnHandshakeDone);
+ }
- if (!ep) {
- next_address(req, GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unexplained handshake failure"));
- return;
+ void NextAddress(grpc_error_handle error) {
+ grpc_resolved_address* addr;
+ if (error != GRPC_ERROR_NONE) {
+ AppendError(error);
+ }
+ if (next_address_ == addresses_->naddrs) {
+ Finish(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed HTTP requests to all targets", &overall_error_, 1));
+ return;
+ }
+ addr = &addresses_->addrs[next_address_++];
+ GRPC_CLOSURE_INIT(&connected_, OnConnected, this,
+ grpc_schedule_on_exec_ctx);
+ grpc_arg rq_arg = grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA), resource_quota_->c_ptr(),
+ grpc_resource_quota_arg_vtable());
+ grpc_channel_args channel_args{1, &rq_arg};
+ auto* args = CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(&channel_args);
+ grpc_tcp_client_connect(&connected_, &ep_, context_->pollset_set, args,
+ addr, deadline_);
+ grpc_channel_args_destroy(args);
}
- req->ep = ep;
- start_write(req);
-}
+ static void OnResolved(void* arg, grpc_error_handle error) {
+ InternalRequest* req = static_cast<InternalRequest*>(arg);
+ if (error != GRPC_ERROR_NONE) {
+ req->Finish(GRPC_ERROR_REF(error));
+ return;
+ }
+ req->next_address_ = 0;
+ req->NextAddress(GRPC_ERROR_NONE);
+ }
-static void on_connected(void* arg, grpc_error* error) {
- internal_request* req = static_cast<internal_request*>(arg);
+ grpc_slice request_text_;
+ grpc_http_parser parser_;
+ grpc_resolved_addresses* addresses_ = nullptr;
+ size_t next_address_ = 0;
+ grpc_endpoint* ep_ = nullptr;
+ ResourceQuotaRefPtr resource_quota_;
+ TString host_;
+ TString ssl_host_override_;
+ grpc_millis deadline_;
+ int have_read_byte_ = 0;
+ const grpc_httpcli_handshaker* handshaker_;
+ grpc_closure* on_done_;
+ grpc_httpcli_context* context_;
+ grpc_polling_entity* pollent_;
+ grpc_iomgr_object iomgr_obj_;
+ grpc_slice_buffer incoming_;
+ grpc_slice_buffer outgoing_;
+ grpc_closure on_read_;
+ grpc_closure done_write_;
+ grpc_closure connected_;
+ grpc_error_handle overall_error_ = GRPC_ERROR_NONE;
+};
- if (!req->ep) {
- next_address(req, GRPC_ERROR_REF(error));
- return;
- }
- req->handshaker->handshake(
- req, req->ep, req->ssl_host_override ? req->ssl_host_override : req->host,
- req->deadline, on_handshake_done);
+} // namespace
+} // namespace grpc_core
+
+static grpc_httpcli_get_override g_get_override = nullptr;
+static grpc_httpcli_post_override g_post_override = nullptr;
+
+static void plaintext_handshake(void* arg, grpc_endpoint* endpoint,
+ const char* /*host*/, grpc_millis /*deadline*/,
+ void (*on_done)(void* arg,
+ grpc_endpoint* endpoint)) {
+ on_done(arg, endpoint);
}
-static void next_address(internal_request* req, grpc_error* error) {
- grpc_resolved_address* addr;
- if (error != GRPC_ERROR_NONE) {
- append_error(req, error);
- }
- if (req->next_address == req->addresses->naddrs) {
- finish(req,
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed HTTP requests to all targets", &req->overall_error, 1));
- return;
- }
- addr = &req->addresses->addrs[req->next_address++];
- GRPC_CLOSURE_INIT(&req->connected, on_connected, req,
- grpc_schedule_on_exec_ctx);
- grpc_arg arg = grpc_channel_arg_pointer_create(
- const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA), req->resource_quota,
- grpc_resource_quota_arg_vtable());
- grpc_channel_args args = {1, &arg};
- grpc_tcp_client_connect(&req->connected, &req->ep, req->context->pollset_set,
- &args, addr, req->deadline);
+const grpc_httpcli_handshaker grpc_httpcli_plaintext = {"http",
+ plaintext_handshake};
+
+void grpc_httpcli_context_init(grpc_httpcli_context* context) {
+ context->pollset_set = grpc_pollset_set_create();
}
-static void on_resolved(void* arg, grpc_error* error) {
- internal_request* req = static_cast<internal_request*>(arg);
- if (error != GRPC_ERROR_NONE) {
- finish(req, GRPC_ERROR_REF(error));
- return;
- }
- req->next_address = 0;
- next_address(req, GRPC_ERROR_NONE);
+void grpc_httpcli_context_destroy(grpc_httpcli_context* context) {
+ grpc_pollset_set_destroy(context->pollset_set);
}
-static void internal_request_begin(grpc_httpcli_context* context,
- grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
- const grpc_httpcli_request* request,
- grpc_millis deadline, grpc_closure* on_done,
- grpc_httpcli_response* response,
- const char* name,
- const grpc_slice& request_text) {
- internal_request* req =
- static_cast<internal_request*>(gpr_malloc(sizeof(internal_request)));
- memset(req, 0, sizeof(*req));
- req->request_text = request_text;
- grpc_http_parser_init(&req->parser, GRPC_HTTP_RESPONSE, response);
- req->on_done = on_done;
- req->deadline = deadline;
- req->handshaker =
- request->handshaker ? request->handshaker : &grpc_httpcli_plaintext;
- req->context = context;
- req->pollent = pollent;
- req->overall_error = GRPC_ERROR_NONE;
- req->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
- GRPC_CLOSURE_INIT(&req->on_read, on_read, req, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&req->done_write, done_write, req,
- grpc_schedule_on_exec_ctx);
- grpc_slice_buffer_init(&req->incoming);
- grpc_slice_buffer_init(&req->outgoing);
- grpc_iomgr_register_object(&req->iomgr_obj, name);
- req->host = gpr_strdup(request->host);
- req->ssl_host_override = gpr_strdup(request->ssl_host_override);
-
- GPR_ASSERT(pollent);
- grpc_polling_entity_add_to_pollset_set(req->pollent,
- req->context->pollset_set);
- grpc_resolve_address(
- request->host, req->handshaker->default_port, req->context->pollset_set,
- GRPC_CLOSURE_CREATE(on_resolved, req, grpc_schedule_on_exec_ctx),
- &req->addresses);
+static void internal_request_begin(
+ grpc_httpcli_context* context, grpc_polling_entity* pollent,
+ grpc_core::ResourceQuotaRefPtr resource_quota,
+ const grpc_httpcli_request* request, grpc_millis deadline,
+ grpc_closure* on_done, grpc_httpcli_response* response, const char* name,
+ const grpc_slice& request_text) {
+ new grpc_core::InternalRequest(
+ request_text, response, std::move(resource_quota), request->host,
+ request->ssl_host_override, deadline,
+ request->handshaker ? request->handshaker : &grpc_httpcli_plaintext,
+ on_done, context, pollent, name);
}
void grpc_httpcli_get(grpc_httpcli_context* context,
grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
+ grpc_core::ResourceQuotaRefPtr resource_quota,
const grpc_httpcli_request* request, grpc_millis deadline,
grpc_closure* on_done, grpc_httpcli_response* response) {
if (g_get_override && g_get_override(request, deadline, on_done, response)) {
@@ -275,14 +297,14 @@ void grpc_httpcli_get(grpc_httpcli_context* context,
}
TString name =
y_absl::StrFormat("HTTP:GET:%s:%s", request->host, request->http.path);
- internal_request_begin(context, pollent, resource_quota, request, deadline,
- on_done, response, name.c_str(),
+ internal_request_begin(context, pollent, std::move(resource_quota), request,
+ deadline, on_done, response, name.c_str(),
grpc_httpcli_format_get_request(request));
}
void grpc_httpcli_post(grpc_httpcli_context* context,
grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
+ grpc_core::ResourceQuotaRefPtr resource_quota,
const grpc_httpcli_request* request,
const char* body_bytes, size_t body_size,
grpc_millis deadline, grpc_closure* on_done,
@@ -294,8 +316,8 @@ void grpc_httpcli_post(grpc_httpcli_context* context,
TString name =
y_absl::StrFormat("HTTP:POST:%s:%s", request->host, request->http.path);
internal_request_begin(
- context, pollent, resource_quota, request, deadline, on_done, response,
- name.c_str(),
+ context, pollent, std::move(resource_quota), request, deadline, on_done,
+ response, name.c_str(),
grpc_httpcli_format_post_request(request, body_bytes, body_size));
}
diff --git a/contrib/libs/grpc/src/core/lib/http/httpcli.h b/contrib/libs/grpc/src/core/lib/http/httpcli.h
index b61bb06874a..6c257900f12 100644
--- a/contrib/libs/grpc/src/core/lib/http/httpcli.h
+++ b/contrib/libs/grpc/src/core/lib/http/httpcli.h
@@ -30,6 +30,7 @@
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
/* User agent this library reports */
#define GRPC_HTTPCLI_USER_AGENT "grpc-httpcli/0.0"
@@ -72,24 +73,28 @@ void grpc_httpcli_context_destroy(grpc_httpcli_context* context);
/* Asynchronously perform a HTTP GET.
'context' specifies the http context under which to do the get
- 'pollset' indicates a grpc_pollset that is interested in the result
- of the get - work on this pollset may be used to progress the get
+ 'pollent' indicates a grpc_polling_entity that is interested in the result
+ of the get - work on this entity may be used to progress the get
operation
- 'request' contains request parameters - these are caller owned and can be
- destroyed once the call returns
- 'deadline' contains a deadline for the request (or gpr_inf_future)
+ 'resource_quota' allows the caller to specify the quota against which to
+ allocate
+ 'request' contains request parameters - these are caller owned and
+ can be destroyed once the call returns 'deadline' contains a deadline for the
+ request (or gpr_inf_future)
'on_response' is a callback to report results to */
void grpc_httpcli_get(grpc_httpcli_context* context,
grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
+ grpc_core::ResourceQuotaRefPtr resource_quota,
const grpc_httpcli_request* request, grpc_millis deadline,
grpc_closure* on_done, grpc_httpcli_response* response);
/* Asynchronously perform a HTTP POST.
'context' specifies the http context under which to do the post
- 'pollset' indicates a grpc_pollset that is interested in the result
- of the post - work on this pollset may be used to progress the post
+ 'pollent' indicates a grpc_polling_entity that is interested in the result
+ of the post - work on this entity may be used to progress the post
operation
+ 'resource_quota' allows the caller to specify the quota against which to
+ allocate
'request' contains request parameters - these are caller owned and can be
destroyed once the call returns
'body_bytes' and 'body_size' specify the payload for the post.
@@ -101,7 +106,7 @@ void grpc_httpcli_get(grpc_httpcli_context* context,
Does not support ?var1=val1&var2=val2 in the path. */
void grpc_httpcli_post(grpc_httpcli_context* context,
grpc_polling_entity* pollent,
- grpc_resource_quota* resource_quota,
+ grpc_core::ResourceQuotaRefPtr resource_quota,
const grpc_httpcli_request* request,
const char* body_bytes, size_t body_size,
grpc_millis deadline, grpc_closure* on_done,
diff --git a/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc b/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
index 514b26bdcf6..0f0ec38dd8b 100644
--- a/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/http/httpcli_security_connector.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/http/httpcli.h"
-
#include <string.h>
#include "y_absl/strings/str_cat.h"
@@ -30,9 +28,10 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
@@ -91,20 +90,23 @@ class grpc_httpcli_ssl_channel_security_connector final
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
grpc_core::RefCountedPtr<grpc_auth_context>* /*auth_context*/,
grpc_closure* on_peer_checked) override {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
/* Check the peer name. */
if (secure_peer_name_ != nullptr &&
!tsi_ssl_peer_matches_name(&peer, secure_peer_name_)) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", secure_peer_name_,
- " is not in peer certificate")
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Peer name ", secure_peer_name_, " is not in peer certificate"));
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
tsi_peer_destruct(&peer);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other_sc) const override {
auto* other =
reinterpret_cast<const grpc_httpcli_ssl_channel_security_connector*>(
@@ -115,13 +117,13 @@ class grpc_httpcli_ssl_channel_security_connector final
bool check_call_host(y_absl::string_view /*host*/,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
- grpc_error** error) override {
+ grpc_error_handle* error) override {
*error = GRPC_ERROR_NONE;
return true;
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error* error) override {
+ grpc_error_handle error) override {
GRPC_ERROR_UNREF(error);
}
@@ -160,13 +162,12 @@ struct on_done_closure {
void* arg;
grpc_core::RefCountedPtr<grpc_core::HandshakeManager> handshake_mgr;
};
-static void on_handshake_done(void* arg, grpc_error* error) {
+static void on_handshake_done(void* arg, grpc_error_handle error) {
auto* args = static_cast<grpc_core::HandshakerArgs*>(arg);
on_done_closure* c = static_cast<on_done_closure*>(args->user_data);
if (error != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(error);
- gpr_log(GPR_ERROR, "Secure transport setup failed: %s", msg);
-
+ gpr_log(GPR_ERROR, "Secure transport setup failed: %s",
+ grpc_error_std_string(error).c_str());
c->func(c->arg, nullptr);
} else {
grpc_channel_args_destroy(args->args);
@@ -202,7 +203,7 @@ static void ssl_handshake(void* arg, grpc_endpoint* tcp, const char* host,
grpc_arg channel_arg = grpc_security_connector_to_arg(sc.get());
grpc_channel_args args = {1, &channel_arg};
c->handshake_mgr = grpc_core::MakeRefCounted<grpc_core::HandshakeManager>();
- grpc_core::HandshakerRegistry::AddHandshakers(
+ grpc_core::CoreConfiguration::Get().handshaker_registry().AddHandshakers(
grpc_core::HANDSHAKER_CLIENT, &args,
/*interested_parties=*/nullptr, c->handshake_mgr.get());
c->handshake_mgr->DoHandshake(tcp, /*channel_args=*/nullptr, deadline,
diff --git a/contrib/libs/grpc/src/core/lib/http/parser.cc b/contrib/libs/grpc/src/core/lib/http/parser.cc
index 3a0b2be4a85..d88ebdb4015 100644
--- a/contrib/libs/grpc/src/core/lib/http/parser.cc
+++ b/contrib/libs/grpc/src/core/lib/http/parser.cc
@@ -37,7 +37,7 @@ static char* buf2str(void* buffer, size_t length) {
return out;
}
-static grpc_error* handle_response_line(grpc_http_parser* parser) {
+static grpc_error_handle handle_response_line(grpc_http_parser* parser) {
uint8_t* beg = parser->cur_line;
uint8_t* cur = beg;
uint8_t* end = beg + parser->cur_line_length;
@@ -90,7 +90,7 @@ static grpc_error* handle_response_line(grpc_http_parser* parser) {
return GRPC_ERROR_NONE;
}
-static grpc_error* handle_request_line(grpc_http_parser* parser) {
+static grpc_error_handle handle_request_line(grpc_http_parser* parser) {
uint8_t* beg = parser->cur_line;
uint8_t* cur = beg;
uint8_t* end = beg + parser->cur_line_length;
@@ -161,7 +161,7 @@ static grpc_error* handle_request_line(grpc_http_parser* parser) {
return GRPC_ERROR_NONE;
}
-static grpc_error* handle_first_line(grpc_http_parser* parser) {
+static grpc_error_handle handle_first_line(grpc_http_parser* parser) {
switch (parser->type) {
case GRPC_HTTP_REQUEST:
return handle_request_line(parser);
@@ -172,14 +172,14 @@ static grpc_error* handle_first_line(grpc_http_parser* parser) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here"));
}
-static grpc_error* add_header(grpc_http_parser* parser) {
+static grpc_error_handle add_header(grpc_http_parser* parser) {
uint8_t* beg = parser->cur_line;
uint8_t* cur = beg;
uint8_t* end = beg + parser->cur_line_length;
size_t* hdr_count = nullptr;
grpc_http_header** hdrs = nullptr;
grpc_http_header hdr = {nullptr, nullptr};
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
GPR_ASSERT(cur != end);
@@ -221,7 +221,7 @@ static grpc_error* add_header(grpc_http_parser* parser) {
if (*hdr_count == parser->hdr_capacity) {
parser->hdr_capacity =
- GPR_MAX(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
+ std::max(parser->hdr_capacity + 1, parser->hdr_capacity * 3 / 2);
*hdrs = static_cast<grpc_http_header*>(
gpr_realloc(*hdrs, parser->hdr_capacity * sizeof(**hdrs)));
}
@@ -235,9 +235,9 @@ done:
return error;
}
-static grpc_error* finish_line(grpc_http_parser* parser,
- bool* found_body_start) {
- grpc_error* err;
+static grpc_error_handle finish_line(grpc_http_parser* parser,
+ bool* found_body_start) {
+ grpc_error_handle err;
switch (parser->state) {
case GRPC_HTTP_FIRST_LINE:
err = handle_first_line(parser);
@@ -264,7 +264,7 @@ static grpc_error* finish_line(grpc_http_parser* parser,
return GRPC_ERROR_NONE;
}
-static grpc_error* addbyte_body(grpc_http_parser* parser, uint8_t byte) {
+static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
size_t* body_length = nullptr;
char** body = nullptr;
@@ -280,7 +280,7 @@ static grpc_error* addbyte_body(grpc_http_parser* parser, uint8_t byte) {
}
if (*body_length == parser->body_capacity) {
- parser->body_capacity = GPR_MAX(8, parser->body_capacity * 3 / 2);
+ parser->body_capacity = std::max(size_t(8), parser->body_capacity * 3 / 2);
*body = static_cast<char*>(gpr_realloc(*body, parser->body_capacity));
}
(*body)[*body_length] = static_cast<char>(byte);
@@ -313,8 +313,8 @@ static bool check_line(grpc_http_parser* parser) {
return false;
}
-static grpc_error* addbyte(grpc_http_parser* parser, uint8_t byte,
- bool* found_body_start) {
+static grpc_error_handle addbyte(grpc_http_parser* parser, uint8_t byte,
+ bool* found_body_start) {
switch (parser->state) {
case GRPC_HTTP_FIRST_LINE:
case GRPC_HTTP_HEADERS:
@@ -371,12 +371,12 @@ void grpc_http_response_destroy(grpc_http_response* response) {
gpr_free(response->hdrs);
}
-grpc_error* grpc_http_parser_parse(grpc_http_parser* parser,
- const grpc_slice& slice,
- size_t* start_of_body) {
+grpc_error_handle grpc_http_parser_parse(grpc_http_parser* parser,
+ const grpc_slice& slice,
+ size_t* start_of_body) {
for (size_t i = 0; i < GRPC_SLICE_LENGTH(slice); i++) {
bool found_body_start = false;
- grpc_error* err =
+ grpc_error_handle err =
addbyte(parser, GRPC_SLICE_START_PTR(slice)[i], &found_body_start);
if (err != GRPC_ERROR_NONE) return err;
if (found_body_start && start_of_body != nullptr) *start_of_body = i + 1;
@@ -384,7 +384,7 @@ grpc_error* grpc_http_parser_parse(grpc_http_parser* parser,
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_http_parser_eof(grpc_http_parser* parser) {
+grpc_error_handle grpc_http_parser_eof(grpc_http_parser* parser) {
if (parser->state != GRPC_HTTP_BODY) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Did not finish headers");
}
diff --git a/contrib/libs/grpc/src/core/lib/http/parser.h b/contrib/libs/grpc/src/core/lib/http/parser.h
index 2da21903e63..1f8c3889b10 100644
--- a/contrib/libs/grpc/src/core/lib/http/parser.h
+++ b/contrib/libs/grpc/src/core/lib/http/parser.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/error.h"
@@ -100,10 +101,10 @@ void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type,
void grpc_http_parser_destroy(grpc_http_parser* parser);
/* Sets \a start_of_body to the offset in \a slice of the start of the body. */
-grpc_error* grpc_http_parser_parse(grpc_http_parser* parser,
- const grpc_slice& slice,
- size_t* start_of_body);
-grpc_error* grpc_http_parser_eof(grpc_http_parser* parser);
+grpc_error_handle grpc_http_parser_parse(grpc_http_parser* parser,
+ const grpc_slice& slice,
+ size_t* start_of_body);
+grpc_error_handle grpc_http_parser_eof(grpc_http_parser* parser);
void grpc_http_request_destroy(grpc_http_request* request);
void grpc_http_response_destroy(grpc_http_response* response);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
index e1b87da4d0c..395002287c1 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.cc
@@ -19,10 +19,11 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/buffer_list.h"
-#include "src/core/lib/iomgr/port.h"
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/port.h"
+
#ifdef GRPC_LINUX_ERRQUEUE
#include <netinet/in.h>
#include <string.h>
@@ -39,15 +40,15 @@ void fill_gpr_from_timestamp(gpr_timespec* gts, const struct timespec* ts) {
gts->clock_type = GPR_CLOCK_REALTIME;
}
-void default_timestamps_callback(void* /*arg*/, grpc_core::Timestamps* /*ts*/,
- grpc_error* /*shudown_err*/) {
+void default_timestamps_callback(void* /*arg*/, Timestamps* /*ts*/,
+ grpc_error_handle /*shudown_err*/) {
gpr_log(GPR_DEBUG, "Timestamps callback has not been registered");
}
/** The saved callback function that will be invoked when we get all the
* timestamps that we are going to get for a TracedBuffer. */
-void (*timestamps_callback)(void*, grpc_core::Timestamps*,
- grpc_error* shutdown_err) =
+void (*timestamps_callback)(void*, Timestamps*,
+ grpc_error_handle shutdown_err) =
default_timestamps_callback;
/* Used to extract individual opt stats from cmsg, so as to avoid troubles with
@@ -61,11 +62,11 @@ T read_unaligned(const void* ptr) {
/* Extracts opt stats from the tcp_info struct \a info to \a metrics */
void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
- const grpc_core::tcp_info* info) {
+ const tcp_info* info) {
if (info == nullptr) {
return;
}
- if (info->length > offsetof(grpc_core::tcp_info, tcpi_sndbuf_limited)) {
+ if (info->length > offsetof(tcp_info, tcpi_sndbuf_limited)) {
metrics->recurring_retrans.emplace(info->tcpi_retransmits);
metrics->is_delivery_rate_app_limited.emplace(
info->tcpi_delivery_rate_app_limited);
@@ -83,7 +84,7 @@ void extract_opt_stats_from_tcp_info(ConnectionMetrics* metrics,
metrics->rwnd_limited_usec.emplace(info->tcpi_rwnd_limited);
metrics->sndbuf_limited_usec.emplace(info->tcpi_sndbuf_limited);
}
- if (info->length > offsetof(grpc_core::tcp_info, tcpi_dsack_dups)) {
+ if (info->length > offsetof(tcp_info, tcpi_dsack_dups)) {
metrics->data_sent.emplace(info->tcpi_bytes_sent);
metrics->data_retx.emplace(info->tcpi_bytes_retrans);
metrics->packet_spurious_retx.emplace(info->tcpi_dsack_dups);
@@ -188,9 +189,9 @@ void extract_opt_stats_from_cmsg(ConnectionMetrics* metrics,
}
}
-static int get_socket_tcp_info(grpc_core::tcp_info* info, int fd) {
+int get_socket_tcp_info(tcp_info* info, int fd) {
memset(info, 0, sizeof(*info));
- info->length = sizeof(*info) - sizeof(socklen_t);
+ info->length = offsetof(tcp_info, length);
return getsockopt(fd, IPPROTO_TCP, TCP_INFO, info, &(info->length));
}
} /* namespace */
@@ -268,7 +269,7 @@ void TracedBuffer::ProcessTimestamp(TracedBuffer** head,
}
void TracedBuffer::Shutdown(TracedBuffer** head, void* remaining,
- grpc_error* shutdown_err) {
+ grpc_error_handle shutdown_err) {
GPR_DEBUG_ASSERT(head != nullptr);
TracedBuffer* elem = *head;
while (elem != nullptr) {
@@ -284,9 +285,8 @@ void TracedBuffer::Shutdown(TracedBuffer** head, void* remaining,
GRPC_ERROR_UNREF(shutdown_err);
}
-void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*,
- grpc_core::Timestamps*,
- grpc_error* error)) {
+void grpc_tcp_set_write_timestamps_callback(
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
timestamps_callback = fn;
}
} /* namespace grpc_core */
@@ -294,9 +294,8 @@ void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*,
#else /* GRPC_LINUX_ERRQUEUE */
namespace grpc_core {
-void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*,
- grpc_core::Timestamps*,
- grpc_error* error)) {
+void grpc_tcp_set_write_timestamps_callback(
+ void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
// Cast value of fn to void to avoid unused parameter warning.
// Can't comment out the name because some compilers and formatters don't
// like the sequence */* , which would arise from */*fn*/.
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
index 81af2c910c7..773f001e23b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/buffer_list.h
@@ -23,13 +23,12 @@
#include "y_absl/types/optional.h"
-#include "src/core/lib/iomgr/port.h"
-
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/internal_errqueue.h"
+#include "src/core/lib/iomgr/port.h"
namespace grpc_core {
@@ -97,8 +96,8 @@ struct Timestamps {
uint32_t byte_offset; /* byte offset relative to the start of the RPC */
#ifdef GRPC_LINUX_ERRQUEUE
- grpc_core::tcp_info info; /* tcp_info collected on sendmsg */
-#endif /* GRPC_LINUX_ERRQUEUE */
+ tcp_info info; /* tcp_info collected on sendmsg */
+#endif /* GRPC_LINUX_ERRQUEUE */
};
/** TracedBuffer is a class to keep track of timestamps for a specific buffer in
@@ -106,7 +105,7 @@ struct Timestamps {
* this class would only be used by Linux platforms. For all other platforms,
* TracedBuffer would be an empty class.
*
- * The timestamps collected are according to grpc_core::Timestamps declared
+ * The timestamps collected are according to Timestamps declared
* above.
*
* A TracedBuffer list is kept track of using the head element of the list. If
@@ -121,34 +120,34 @@ class TracedBuffer {
/** Add a new entry in the TracedBuffer list pointed to by head. Also saves
* sendmsg_time with the current timestamp. */
- static void AddNewEntry(grpc_core::TracedBuffer** head, uint32_t seq_no,
- int fd, void* arg);
+ static void AddNewEntry(TracedBuffer** head, uint32_t seq_no, int fd,
+ void* arg);
/** Processes a received timestamp based on sock_extended_err and
* scm_timestamping structures. It will invoke the timestamps callback if the
* timestamp type is SCM_TSTAMP_ACK. */
- static void ProcessTimestamp(grpc_core::TracedBuffer** head,
+ static void ProcessTimestamp(TracedBuffer** head,
struct sock_extended_err* serr,
struct cmsghdr* opt_stats,
struct scm_timestamping* tss);
/** Cleans the list by calling the callback for each traced buffer in the list
* with timestamps that it has. */
- static void Shutdown(grpc_core::TracedBuffer** head, void* remaining,
- grpc_error* shutdown_err);
+ static void Shutdown(TracedBuffer** head, void* remaining,
+ grpc_error_handle shutdown_err);
private:
- uint32_t seq_no_; /* The sequence number for the last byte in the buffer */
- void* arg_; /* The arg to pass to timestamps_callback */
- grpc_core::Timestamps ts_; /* The timestamps corresponding to this buffer */
- grpc_core::TracedBuffer* next_; /* The next TracedBuffer in the list */
+ uint32_t seq_no_; /* The sequence number for the last byte in the buffer */
+ void* arg_; /* The arg to pass to timestamps_callback */
+ Timestamps ts_; /* The timestamps corresponding to this buffer */
+ TracedBuffer* next_; /* The next TracedBuffer in the list */
};
#else /* GRPC_LINUX_ERRQUEUE */
class TracedBuffer {
public:
/* Phony shutdown function */
- static void Shutdown(grpc_core::TracedBuffer** /*head*/, void* /*remaining*/,
- grpc_error* shutdown_err) {
+ static void Shutdown(TracedBuffer** /*head*/, void* /*remaining*/,
+ grpc_error_handle shutdown_err) {
GRPC_ERROR_UNREF(shutdown_err);
}
};
@@ -156,9 +155,8 @@ class TracedBuffer {
/** Sets the callback function to call when timestamps for a write are
* collected. The callback does not own a reference to error. */
-void grpc_tcp_set_write_timestamps_callback(void (*fn)(void*,
- grpc_core::Timestamps*,
- grpc_error* error));
+void grpc_tcp_set_write_timestamps_callback(
+ void (*fn)(void*, Timestamps*, grpc_error_handle error));
} /* namespace grpc_core */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.cc b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.cc
index 043b3bb4032..d2c40d38e43 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.cc
@@ -23,6 +23,7 @@
#include <inttypes.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/profiling/timers.h"
@@ -32,18 +33,20 @@ DebugOnlyTraceFlag grpc_call_combiner_trace(false, "call_combiner");
namespace {
-grpc_error* DecodeCancelStateError(gpr_atm cancel_state) {
- if (cancel_state & 1) {
- return reinterpret_cast<grpc_error*>(cancel_state &
- ~static_cast<gpr_atm>(1));
+// grpc_error LSB can be used
+constexpr intptr_t kErrorBit = 1;
+
+grpc_error_handle DecodeCancelStateError(gpr_atm cancel_state) {
+ if (cancel_state & kErrorBit) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ return internal::StatusGetFromHeapPtr(cancel_state & ~kErrorBit);
+#else
+ return reinterpret_cast<grpc_error_handle>(cancel_state & ~kErrorBit);
+#endif
}
return GRPC_ERROR_NONE;
}
-gpr_atm EncodeCancelStateError(grpc_error* error) {
- return static_cast<gpr_atm>(1) | reinterpret_cast<gpr_atm>(error);
-}
-
} // namespace
CallCombiner::CallCombiner() {
@@ -56,11 +59,18 @@ CallCombiner::CallCombiner() {
}
CallCombiner::~CallCombiner() {
- GRPC_ERROR_UNREF(DecodeCancelStateError(cancel_state_));
+ if (cancel_state_ & kErrorBit) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(cancel_state_ & ~kErrorBit);
+#else
+ GRPC_ERROR_UNREF(reinterpret_cast<grpc_error_handle>(
+ cancel_state_ & ~static_cast<gpr_atm>(kErrorBit)));
+#endif
+ }
}
#ifdef GRPC_TSAN_ENABLED
-void CallCombiner::TsanClosure(void* arg, grpc_error* error) {
+void CallCombiner::TsanClosure(void* arg, grpc_error_handle error) {
CallCombiner* self = static_cast<CallCombiner*>(arg);
// We ref-count the lock, and check if it's already taken.
// If it was taken, we should do nothing. Otherwise, we will mark it as
@@ -81,8 +91,7 @@ void CallCombiner::TsanClosure(void* arg, grpc_error* error) {
} else {
lock.reset();
}
- grpc_core::Closure::Run(DEBUG_LOCATION, self->original_closure_,
- GRPC_ERROR_REF(error));
+ Closure::Run(DEBUG_LOCATION, self->original_closure_, GRPC_ERROR_REF(error));
if (lock != nullptr) {
TSAN_ANNOTATE_RWLOCK_RELEASED(&lock->taken, true);
bool prev = true;
@@ -91,7 +100,8 @@ void CallCombiner::TsanClosure(void* arg, grpc_error* error) {
}
#endif
-void CallCombiner::ScheduleClosure(grpc_closure* closure, grpc_error* error) {
+void CallCombiner::ScheduleClosure(grpc_closure* closure,
+ grpc_error_handle error) {
#ifdef GRPC_TSAN_ENABLED
original_closure_ = closure;
ExecCtx::Run(DEBUG_LOCATION, &tsan_closure_, error);
@@ -110,14 +120,15 @@ void CallCombiner::ScheduleClosure(grpc_closure* closure, grpc_error* error) {
#define DEBUG_FMT_ARGS
#endif
-void CallCombiner::Start(grpc_closure* closure, grpc_error* error,
+void CallCombiner::Start(grpc_closure* closure, grpc_error_handle error,
DEBUG_ARGS const char* reason) {
GPR_TIMER_SCOPE("CallCombiner::Start", 0);
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
gpr_log(GPR_INFO,
"==> CallCombiner::Start() [%p] closure=%p [" DEBUG_FMT_STR
"%s] error=%s",
- this, closure DEBUG_FMT_ARGS, reason, grpc_error_string(error));
+ this, closure DEBUG_FMT_ARGS, reason,
+ grpc_error_std_string(error).c_str());
}
size_t prev_size =
static_cast<size_t>(gpr_atm_full_fetch_add(&size_, (gpr_atm)1));
@@ -176,7 +187,8 @@ void CallCombiner::Stop(DEBUG_ARGS const char* reason) {
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_combiner_trace)) {
gpr_log(GPR_INFO, " EXECUTING FROM QUEUE: closure=%p error=%s",
- closure, grpc_error_string(closure->error_data.error));
+ closure,
+ grpc_error_std_string(closure->error_data.error).c_str());
}
ScheduleClosure(closure, closure->error_data.error);
break;
@@ -191,7 +203,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) {
while (true) {
// Decode original state.
gpr_atm original_state = gpr_atm_acq_load(&cancel_state_);
- grpc_error* original_error = DecodeCancelStateError(original_state);
+ grpc_error_handle original_error = DecodeCancelStateError(original_state);
// If error is set, invoke the cancellation closure immediately.
// Otherwise, store the new closure.
if (original_error != GRPC_ERROR_NONE) {
@@ -229,17 +241,26 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) {
}
}
-void CallCombiner::Cancel(grpc_error* error) {
+void CallCombiner::Cancel(grpc_error_handle error) {
GRPC_STATS_INC_CALL_COMBINER_CANCELLED();
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ intptr_t status_ptr = internal::StatusAllocHeapPtr(error);
+ gpr_atm new_state = kErrorBit | status_ptr;
+#else
+ gpr_atm new_state = kErrorBit | reinterpret_cast<gpr_atm>(error);
+#endif
while (true) {
gpr_atm original_state = gpr_atm_acq_load(&cancel_state_);
- grpc_error* original_error = DecodeCancelStateError(original_state);
+ grpc_error_handle original_error = DecodeCancelStateError(original_state);
if (original_error != GRPC_ERROR_NONE) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(status_ptr);
+#else
GRPC_ERROR_UNREF(error);
+#endif
break;
}
- if (gpr_atm_full_cas(&cancel_state_, original_state,
- EncodeCancelStateError(error))) {
+ if (gpr_atm_full_cas(&cancel_state_, original_state, new_state)) {
if (original_state != 0) {
grpc_closure* notify_on_cancel =
reinterpret_cast<grpc_closure*>(original_state);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
index aed847c9728..c80377b410f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/call_combiner.h
@@ -58,7 +58,7 @@ class CallCombiner {
#define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
(call_combiner)->Stop(__FILE__, __LINE__, (reason))
/// Starts processing \a closure.
- void Start(grpc_closure* closure, grpc_error* error, const char* file,
+ void Start(grpc_closure* closure, grpc_error_handle error, const char* file,
int line, const char* reason);
/// Yields the call combiner to the next closure in the queue, if any.
void Stop(const char* file, int line, const char* reason);
@@ -68,7 +68,8 @@ class CallCombiner {
#define GRPC_CALL_COMBINER_STOP(call_combiner, reason) \
(call_combiner)->Stop((reason))
/// Starts processing \a closure.
- void Start(grpc_closure* closure, grpc_error* error, const char* reason);
+ void Start(grpc_closure* closure, grpc_error_handle error,
+ const char* reason);
/// Yields the call combiner to the next closure in the queue, if any.
void Stop(const char* reason);
#endif
@@ -94,26 +95,22 @@ class CallCombiner {
/// cancellation; this effectively unregisters the previously set closure.
/// However, most filters will not need to explicitly unregister their
/// callbacks, as this is done automatically when the call is destroyed.
- /// Filters that schedule the cancellation closure on ExecCtx do not need
- /// to take a ref on the call stack to guarantee closure liveness. This is
- /// done by explicitly flushing ExecCtx after the unregistration during
- /// call destruction.
void SetNotifyOnCancel(grpc_closure* closure);
/// Indicates that the call has been cancelled.
- void Cancel(grpc_error* error);
+ void Cancel(grpc_error_handle error);
private:
- void ScheduleClosure(grpc_closure* closure, grpc_error* error);
+ void ScheduleClosure(grpc_closure* closure, grpc_error_handle error);
#ifdef GRPC_TSAN_ENABLED
- static void TsanClosure(void* arg, grpc_error* error);
+ static void TsanClosure(void* arg, grpc_error_handle error);
#endif
gpr_atm size_ = 0; // size_t, num closures in queue or currently executing
MultiProducerSingleConsumerQueue queue_;
// Either 0 (if not cancelled and no cancellation closure set),
// a grpc_closure* (if the lowest bit is 0),
- // or a grpc_error* (if the lowest bit is 1).
+ // or a grpc_error_handle (if the lowest bit is 1).
gpr_atm cancel_state_ = 0;
#ifdef GRPC_TSAN_ENABLED
// A fake ref-counted lock that is kept alive after the destruction of
@@ -150,7 +147,7 @@ class CallCombinerClosureList {
// Adds a closure to the list. The closure must eventually result in
// the call combiner being yielded.
- void Add(grpc_closure* closure, grpc_error* error, const char* reason) {
+ void Add(grpc_closure* closure, grpc_error_handle error, const char* reason) {
closures_.emplace_back(closure, error, reason);
}
@@ -176,7 +173,8 @@ class CallCombinerClosureList {
"CallCombinerClosureList executing closure while already "
"holding call_combiner %p: closure=%p error=%s reason=%s",
call_combiner, closures_[0].closure,
- grpc_error_string(closures_[0].error), closures_[0].reason);
+ grpc_error_std_string(closures_[0].error).c_str(),
+ closures_[0].reason);
}
// This will release the call combiner.
ExecCtx::Run(DEBUG_LOCATION, closures_[0].closure, closures_[0].error);
@@ -199,10 +197,10 @@ class CallCombinerClosureList {
private:
struct CallCombinerClosure {
grpc_closure* closure;
- grpc_error* error;
+ grpc_error_handle error;
const char* reason;
- CallCombinerClosure(grpc_closure* closure, grpc_error* error,
+ CallCombinerClosure(grpc_closure* closure, grpc_error_handle error,
const char* reason)
: closure(closure), error(error), reason(reason) {}
};
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
index 2f70a2995be..b94711c6fd9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.cc
@@ -23,13 +23,13 @@
#ifdef GRPC_CFSTREAM
#import <CoreFoundation/CoreFoundation.h>
-#import "src/core/lib/iomgr/cfstream_handle.h"
#include <grpc/grpc.h>
#include <grpc/support/atm.h>
#include <grpc/support/sync.h>
#include "src/core/lib/debug/trace.h"
+#import "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error_cfstream.h"
#include "src/core/lib/iomgr/ev_apple.h"
@@ -62,7 +62,7 @@ void CFStreamHandle::ReadCallback(CFReadStreamRef stream,
void* client_callback_info) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_error* error;
+ grpc_error_handle error;
CFErrorRef stream_error;
CFStreamHandle* handle = static_cast<CFStreamHandle*>(client_callback_info);
if (grpc_tcp_trace.enabled()) {
@@ -97,7 +97,7 @@ void CFStreamHandle::WriteCallback(CFWriteStreamRef stream,
void* clientCallBackInfo) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- grpc_error* error;
+ grpc_error_handle error;
CFErrorRef stream_error;
CFStreamHandle* handle = static_cast<CFStreamHandle*>(clientCallBackInfo);
if (grpc_tcp_trace.enabled()) {
@@ -171,7 +171,7 @@ void CFStreamHandle::NotifyOnWrite(grpc_closure* closure) {
write_event_.NotifyOn(closure);
}
-void CFStreamHandle::Shutdown(grpc_error* error) {
+void CFStreamHandle::Shutdown(grpc_error_handle error) {
open_event_.SetShutdown(GRPC_ERROR_REF(error));
read_event_.SetShutdown(GRPC_ERROR_REF(error));
write_event_.SetShutdown(GRPC_ERROR_REF(error));
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.h b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.h
index b0f0664a04f..2358758f147 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/cfstream_handle.h
@@ -53,7 +53,7 @@ class CFStreamHandle : public GrpcLibraryInitHolder {
void NotifyOnOpen(grpc_closure* closure);
void NotifyOnRead(grpc_closure* closure);
void NotifyOnWrite(grpc_closure* closure);
- void Shutdown(grpc_error* error);
+ void Shutdown(grpc_error_handle error);
void Ref(const char* file = "", int line = 0, const char* reason = nullptr);
void Unref(const char* file = "", int line = 0, const char* reason = nullptr);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/closure.h b/contrib/libs/grpc/src/core/lib/iomgr/closure.h
index 6bb65340d1a..b429c9e3ebd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/closure.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/closure.h
@@ -50,7 +50,7 @@ typedef struct grpc_closure_list {
* describing what went wrong.
* Error contract: it is not the cb's job to unref this error;
* the closure scheduler will do that after the cb returns */
-typedef void (*grpc_iomgr_cb_func)(void* arg, grpc_error* error);
+typedef void (*grpc_iomgr_cb_func)(void* arg, grpc_error_handle error);
/** A closure over a grpc_iomgr_cb_func. */
struct grpc_closure {
@@ -72,7 +72,7 @@ struct grpc_closure {
/** Once queued, the result of the closure. Before then: scratch space */
union {
- grpc_error* error;
+ grpc_error_handle error;
uintptr_t scratch;
} error_data;
@@ -126,7 +126,7 @@ struct wrapped_closure {
void* cb_arg;
grpc_closure wrapper;
};
-inline void closure_wrapper(void* arg, grpc_error* error) {
+inline void closure_wrapper(void* arg, grpc_error_handle error) {
wrapped_closure* wc = static_cast<wrapped_closure*>(arg);
grpc_iomgr_cb_func cb = wc->cb;
void* cb_arg = wc->cb_arg;
@@ -175,7 +175,8 @@ inline void grpc_closure_list_init(grpc_closure_list* closure_list) {
and set \a closure's result to \a error
Returns true if \a list becomes non-empty */
inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure,
+ grpc_error_handle error) {
if (closure == nullptr) {
GRPC_ERROR_UNREF(error);
return false;
@@ -194,7 +195,7 @@ inline bool grpc_closure_list_append(grpc_closure_list* closure_list,
/** force all success bits in \a list to false */
inline void grpc_closure_list_fail_all(grpc_closure_list* list,
- grpc_error* forced_failure) {
+ grpc_error_handle forced_failure) {
for (grpc_closure* c = list->head; c != nullptr; c = c->next_data.next) {
if (c->error_data.error == GRPC_ERROR_NONE) {
c->error_data.error = GRPC_ERROR_REF(forced_failure);
@@ -227,7 +228,7 @@ namespace grpc_core {
class Closure {
public:
static void Run(const DebugLocation& location, grpc_closure* closure,
- grpc_error* error) {
+ grpc_error_handle error) {
(void)location;
if (closure == nullptr) {
GRPC_ERROR_UNREF(error);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/combiner.cc b/contrib/libs/grpc/src/core/lib/iomgr/combiner.cc
index aa5a2ea44f4..1b5add88cd2 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/combiner.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/combiner.cc
@@ -27,11 +27,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");
@@ -46,11 +44,12 @@ grpc_core::DebugOnlyTraceFlag grpc_combiner_trace(false, "combiner");
#define STATE_ELEM_COUNT_LOW_BIT 2
static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
static void combiner_finally_exec(grpc_core::Combiner* lock,
- grpc_closure* closure, grpc_error* error);
+ grpc_closure* closure,
+ grpc_error_handle error);
-static void offload(void* arg, grpc_error* error);
+static void offload(void* arg, grpc_error_handle error);
grpc_core::Combiner* grpc_combiner_create(void) {
grpc_core::Combiner* lock = new grpc_core::Combiner();
@@ -126,18 +125,15 @@ static void push_first_on_exec_ctx(grpc_core::Combiner* lock) {
}
static void combiner_exec(grpc_core::Combiner* lock, grpc_closure* cl,
- grpc_error* error) {
- GPR_TIMER_SCOPE("combiner.execute", 0);
- GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_ITEMS();
+ grpc_error_handle error) {
gpr_atm last = gpr_atm_full_fetch_add(&lock->state, STATE_ELEM_COUNT_LOW_BIT);
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO,
"C:%p grpc_combiner_execute c=%p last=%" PRIdPTR,
lock, cl, last));
if (last == 1) {
- GRPC_STATS_INC_COMBINER_LOCKS_INITIATED();
- GPR_TIMER_MARK("combiner.initiated", 0);
- gpr_atm_no_barrier_store(&lock->initiating_exec_ctx_or_null,
- (gpr_atm)grpc_core::ExecCtx::Get());
+ gpr_atm_no_barrier_store(
+ &lock->initiating_exec_ctx_or_null,
+ reinterpret_cast<gpr_atm>(grpc_core::ExecCtx::Get()));
// first element on this list: add it to the list of combiner locks
// executing within this exec_ctx
push_last_on_exec_ctx(lock);
@@ -167,20 +163,18 @@ static void move_next() {
}
}
-static void offload(void* arg, grpc_error* /*error*/) {
+static void offload(void* arg, grpc_error_handle /*error*/) {
grpc_core::Combiner* lock = static_cast<grpc_core::Combiner*>(arg);
push_last_on_exec_ctx(lock);
}
static void queue_offload(grpc_core::Combiner* lock) {
- GRPC_STATS_INC_COMBINER_LOCKS_OFFLOADED();
move_next();
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p queue_offload", lock));
grpc_core::Executor::Run(&lock->offload, GRPC_ERROR_NONE);
}
bool grpc_combiner_continue_exec_ctx() {
- GPR_TIMER_SCOPE("combiner.continue_exec_ctx", 0);
grpc_core::Combiner* lock =
grpc_core::ExecCtx::Get()->combiner_data()->active_combiner;
if (lock == nullptr) {
@@ -205,9 +199,8 @@ bool grpc_combiner_continue_exec_ctx() {
// 3. the current thread is not a worker for any background poller
// 4. the DEFAULT executor is threaded
if (contended && grpc_core::ExecCtx::Get()->IsReadyToFinish() &&
- !grpc_iomgr_is_any_background_poller_thread() &&
+ !grpc_iomgr_platform_is_any_background_poller_thread() &&
grpc_core::Executor::IsThreadedDefault()) {
- GPR_TIMER_MARK("offload_from_finished_exec_ctx", 0);
// this execution context wants to move on: schedule remaining work to be
// picked up on the executor
queue_offload(lock);
@@ -224,13 +217,11 @@ bool grpc_combiner_continue_exec_ctx() {
if (n == nullptr) {
// queue is in an inconsistent state: use this as a cue that we should
// go off and do something else for a while (and come back later)
- GPR_TIMER_MARK("delay_busy", 0);
queue_offload(lock);
return true;
}
- GPR_TIMER_SCOPE("combiner.exec1", 0);
grpc_closure* cl = reinterpret_cast<grpc_closure*>(n);
- grpc_error* cl_err = cl->error_data.error;
+ grpc_error_handle cl_err = cl->error_data.error;
#ifndef NDEBUG
cl->scheduled = false;
#endif
@@ -242,11 +233,10 @@ bool grpc_combiner_continue_exec_ctx() {
grpc_closure_list_init(&lock->final_list);
int loops = 0;
while (c != nullptr) {
- GPR_TIMER_SCOPE("combiner.exec_1final", 0);
GRPC_COMBINER_TRACE(
gpr_log(GPR_INFO, "C:%p execute_final[%d] c=%p", lock, loops, c));
grpc_closure* next = c->next_data.next;
- grpc_error* error = c->error_data.error;
+ grpc_error_handle error = c->error_data.error;
#ifndef NDEBUG
c->scheduled = false;
#endif
@@ -256,7 +246,6 @@ bool grpc_combiner_continue_exec_ctx() {
}
}
- GPR_TIMER_MARK("unref", 0);
move_next();
lock->time_to_execute_final_list = false;
gpr_atm old_state =
@@ -297,18 +286,16 @@ bool grpc_combiner_continue_exec_ctx() {
return true;
}
-static void enqueue_finally(void* closure, grpc_error* error);
+static void enqueue_finally(void* closure, grpc_error_handle error);
static void combiner_finally_exec(grpc_core::Combiner* lock,
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure,
+ grpc_error_handle error) {
GPR_ASSERT(lock != nullptr);
- GPR_TIMER_SCOPE("combiner.execute_finally", 0);
- GRPC_STATS_INC_COMBINER_LOCKS_SCHEDULED_FINAL_ITEMS();
GRPC_COMBINER_TRACE(gpr_log(
GPR_INFO, "C:%p grpc_combiner_execute_finally c=%p; ac=%p", lock, closure,
grpc_core::ExecCtx::Get()->combiner_data()->active_combiner));
if (grpc_core::ExecCtx::Get()->combiner_data()->active_combiner != lock) {
- GPR_TIMER_MARK("slowpath", 0);
// Using error_data.scratch to store the combiner so that it can be accessed
// in enqueue_finally.
closure->error_data.scratch = reinterpret_cast<uintptr_t>(lock);
@@ -322,19 +309,20 @@ static void combiner_finally_exec(grpc_core::Combiner* lock,
grpc_closure_list_append(&lock->final_list, closure, error);
}
-static void enqueue_finally(void* closure, grpc_error* error) {
+static void enqueue_finally(void* closure, grpc_error_handle error) {
grpc_closure* cl = static_cast<grpc_closure*>(closure);
- combiner_finally_exec(
- reinterpret_cast<grpc_core::Combiner*>(cl->error_data.scratch), cl,
- GRPC_ERROR_REF(error));
+ grpc_core::Combiner* lock =
+ reinterpret_cast<grpc_core::Combiner*>(cl->error_data.scratch);
+ cl->error_data.scratch = 0;
+ combiner_finally_exec(lock, cl, GRPC_ERROR_REF(error));
}
namespace grpc_core {
-void Combiner::Run(grpc_closure* closure, grpc_error* error) {
+void Combiner::Run(grpc_closure* closure, grpc_error_handle error) {
combiner_exec(this, closure, error);
}
-void Combiner::FinallyRun(grpc_closure* closure, grpc_error* error) {
+void Combiner::FinallyRun(grpc_closure* closure, grpc_error_handle error) {
combiner_finally_exec(this, closure, error);
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/combiner.h b/contrib/libs/grpc/src/core/lib/iomgr/combiner.h
index 32712066bef..3b9ddfcec13 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/combiner.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/combiner.h
@@ -24,6 +24,7 @@
#include <stddef.h>
#include <grpc/support/atm.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -32,9 +33,9 @@ namespace grpc_core {
// use ExecCtx
class Combiner {
public:
- void Run(grpc_closure* closure, grpc_error* error);
+ void Run(grpc_closure* closure, grpc_error_handle error);
// TODO(yashkt) : Remove this method
- void FinallyRun(grpc_closure* closure, grpc_error* error);
+ void FinallyRun(grpc_closure* closure, grpc_error_handle error);
Combiner* next_combiner_on_this_exec_ctx = nullptr;
MultiProducerSingleConsumerQueue queue;
// either:
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
index dc0eafebf98..2d7711339f5 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/dualstack_socket_posix.cc
@@ -23,6 +23,7 @@
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
#include <netinet/in.h>
+
#include "src/core/lib/iomgr/socket_utils_posix.h"
#ifndef GRPC_SET_SOCKET_DUALSTACK_CUSTOM
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
index 37e04001022..1e22671055b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.cc
@@ -46,7 +46,7 @@ void grpc_endpoint_delete_from_pollset_set(grpc_endpoint* ep,
ep->vtable->delete_from_pollset_set(ep, pollset_set);
}
-void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error* why) {
+void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
ep->vtable->shutdown(ep, why);
}
@@ -62,10 +62,6 @@ y_absl::string_view grpc_endpoint_get_local_address(grpc_endpoint* ep) {
int grpc_endpoint_get_fd(grpc_endpoint* ep) { return ep->vtable->get_fd(ep); }
-grpc_resource_user* grpc_endpoint_get_resource_user(grpc_endpoint* ep) {
- return ep->vtable->get_resource_user(ep);
-}
-
bool grpc_endpoint_can_track_err(grpc_endpoint* ep) {
return ep->vtable->can_track_err(ep);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
index 021325833b0..7e270460d94 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint.h
@@ -26,9 +26,9 @@
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/pollset_set.h"
-#include "src/core/lib/iomgr/resource_quota.h"
/* An endpoint caps a streaming channel between two communicating processes.
Examples may be: a tcp socket, <stdin+stdout>, or some shared memory. */
@@ -44,9 +44,8 @@ struct grpc_endpoint_vtable {
void (*add_to_pollset)(grpc_endpoint* ep, grpc_pollset* pollset);
void (*add_to_pollset_set)(grpc_endpoint* ep, grpc_pollset_set* pollset);
void (*delete_from_pollset_set)(grpc_endpoint* ep, grpc_pollset_set* pollset);
- void (*shutdown)(grpc_endpoint* ep, grpc_error* why);
+ void (*shutdown)(grpc_endpoint* ep, grpc_error_handle why);
void (*destroy)(grpc_endpoint* ep);
- grpc_resource_user* (*get_resource_user)(grpc_endpoint* ep);
y_absl::string_view (*get_peer)(grpc_endpoint* ep);
y_absl::string_view (*get_local_address)(grpc_endpoint* ep);
int (*get_fd)(grpc_endpoint* ep);
@@ -86,7 +85,7 @@ void grpc_endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
/* Causes any pending and future read/write callbacks to run immediately with
success==0 */
-void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error* why);
+void grpc_endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why);
void grpc_endpoint_destroy(grpc_endpoint* ep);
/* Add an endpoint to a pollset or pollset_set, so that when the pollset is
@@ -99,8 +98,6 @@ void grpc_endpoint_add_to_pollset_set(grpc_endpoint* ep,
void grpc_endpoint_delete_from_pollset_set(grpc_endpoint* ep,
grpc_pollset_set* pollset_set);
-grpc_resource_user* grpc_endpoint_get_resource_user(grpc_endpoint* ep);
-
bool grpc_endpoint_can_track_err(grpc_endpoint* ep);
struct grpc_endpoint {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
index d3a9c9b2002..daaa154e714 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.cc
@@ -23,19 +23,19 @@
#ifdef GRPC_CFSTREAM_ENDPOINT
#import <CoreFoundation/CoreFoundation.h>
-#import "src/core/lib/iomgr/endpoint_cfstream.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
+#import "src/core/lib/iomgr/endpoint_cfstream.h"
#include "src/core/lib/iomgr/error_cfstream.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -59,11 +59,8 @@ struct CFStreamEndpoint {
TString peer_string;
TString local_address;
- grpc_resource_user* resource_user;
- grpc_resource_user_slice_allocator slice_allocator;
};
static void CFStreamFree(CFStreamEndpoint* ep) {
- grpc_resource_user_unref(ep->resource_user);
CFRelease(ep->read_stream);
CFRelease(ep->write_stream);
CFSTREAM_HANDLE_UNREF(ep->stream_sync, "free");
@@ -106,22 +103,20 @@ static void CFStreamUnref(CFStreamEndpoint* ep) {
static void CFStreamRef(CFStreamEndpoint* ep) { gpr_ref(&ep->refcount); }
#endif
-static grpc_error* CFStreamAnnotateError(grpc_error* src_error,
- CFStreamEndpoint* ep) {
+static grpc_error_handle CFStreamAnnotateError(grpc_error_handle src_error,
+ CFStreamEndpoint* ep) {
return grpc_error_set_str(
grpc_error_set_int(src_error, GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE),
- GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(ep->peer_string.c_str()));
+ GRPC_ERROR_STR_TARGET_ADDRESS, ep->peer_string);
}
-static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) {
+static void CallReadCb(CFStreamEndpoint* ep, grpc_error_handle error) {
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_read_cb %p %p:%p", ep,
ep->read_cb, ep->read_cb->cb, ep->read_cb->cb_arg);
size_t i;
- const char* str = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "read: error=%s", str);
+ gpr_log(GPR_DEBUG, "read: error=%s", grpc_error_std_string(error).c_str());
for (i = 0; i < ep->read_slices->count; i++) {
char* dump = grpc_dump_slice(ep->read_slices->slices[i],
@@ -137,12 +132,11 @@ static void CallReadCb(CFStreamEndpoint* ep, grpc_error* error) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
}
-static void CallWriteCb(CFStreamEndpoint* ep, grpc_error* error) {
+static void CallWriteCb(CFStreamEndpoint* ep, grpc_error_handle error) {
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG, "CFStream endpoint:%p call_write_cb %p %p:%p", ep,
ep->write_cb, ep->write_cb->cb, ep->write_cb->cb_arg);
- const char* str = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "write: error=%s", str);
+ gpr_log(GPR_DEBUG, "write: error=%s", grpc_error_std_string(error).c_str());
}
grpc_closure* cb = ep->write_cb;
ep->write_cb = nullptr;
@@ -150,10 +144,10 @@ static void CallWriteCb(CFStreamEndpoint* ep, grpc_error* error) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
}
-static void ReadAction(void* arg, grpc_error* error) {
+static void ReadAction(void* arg, grpc_error_handle error) {
CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
GPR_ASSERT(ep->read_cb != nullptr);
- if (error) {
+ if (error != GRPC_ERROR_NONE) {
grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
CallReadCb(ep, GRPC_ERROR_REF(error));
EP_UNREF(ep, "read");
@@ -192,10 +186,10 @@ static void ReadAction(void* arg, grpc_error* error) {
}
}
-static void WriteAction(void* arg, grpc_error* error) {
+static void WriteAction(void* arg, grpc_error_handle error) {
CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
GPR_ASSERT(ep->write_cb != nullptr);
- if (error) {
+ if (error != GRPC_ERROR_NONE) {
grpc_slice_buffer_reset_and_unref_internal(ep->write_slices);
CallWriteCb(ep, GRPC_ERROR_REF(error));
EP_UNREF(ep, "write");
@@ -242,17 +236,6 @@ static void WriteAction(void* arg, grpc_error* error) {
grpc_slice_unref_internal(slice);
}
-static void CFStreamReadAllocationDone(void* arg, grpc_error* error) {
- CFStreamEndpoint* ep = static_cast<CFStreamEndpoint*>(arg);
- if (error == GRPC_ERROR_NONE) {
- ep->stream_sync->NotifyOnRead(&ep->read_action);
- } else {
- grpc_slice_buffer_reset_and_unref_internal(ep->read_slices);
- CallReadCb(ep, error);
- EP_UNREF(ep, "read");
- }
-}
-
static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, bool urgent) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
@@ -264,12 +247,10 @@ static void CFStreamRead(grpc_endpoint* ep, grpc_slice_buffer* slices,
ep_impl->read_cb = cb;
ep_impl->read_slices = slices;
grpc_slice_buffer_reset_and_unref_internal(slices);
+ grpc_slice_buffer_add_indexed(
+ slices, GRPC_SLICE_MALLOC(GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
EP_REF(ep_impl, "read");
- if (grpc_resource_user_alloc_slices(&ep_impl->slice_allocator,
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1,
- ep_impl->read_slices)) {
- ep_impl->stream_sync->NotifyOnRead(&ep_impl->read_action);
- }
+ ep_impl->stream_sync->NotifyOnRead(&ep_impl->read_action);
}
static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
@@ -286,17 +267,18 @@ static void CFStreamWrite(grpc_endpoint* ep, grpc_slice_buffer* slices,
ep_impl->stream_sync->NotifyOnWrite(&ep_impl->write_action);
}
-void CFStreamShutdown(grpc_endpoint* ep, grpc_error* why) {
+void CFStreamShutdown(grpc_endpoint* ep, grpc_error_handle why) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%p)", ep_impl, why);
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown (%s)", ep_impl,
+ grpc_error_std_string(why).c_str());
}
CFReadStreamClose(ep_impl->read_stream);
CFWriteStreamClose(ep_impl->write_stream);
ep_impl->stream_sync->Shutdown(why);
- grpc_resource_user_shutdown(ep_impl->resource_user);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%p)", ep_impl, why);
+ gpr_log(GPR_DEBUG, "CFStream endpoint:%p shutdown DONE (%s)", ep_impl,
+ grpc_error_std_string(why).c_str());
}
}
@@ -308,11 +290,6 @@ void CFStreamDestroy(grpc_endpoint* ep) {
EP_UNREF(ep_impl, "destroy");
}
-grpc_resource_user* CFStreamGetResourceUser(grpc_endpoint* ep) {
- CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
- return ep_impl->resource_user;
-}
-
y_absl::string_view CFStreamGetPeer(grpc_endpoint* ep) {
CFStreamEndpoint* ep_impl = reinterpret_cast<CFStreamEndpoint*>(ep);
return ep_impl->peer_string;
@@ -339,16 +316,15 @@ static const grpc_endpoint_vtable vtable = {CFStreamRead,
CFStreamDeleteFromPollsetSet,
CFStreamShutdown,
CFStreamDestroy,
- CFStreamGetResourceUser,
CFStreamGetPeer,
CFStreamGetLocalAddress,
CFStreamGetFD,
CFStreamCanTrackErr};
-grpc_endpoint* grpc_cfstream_endpoint_create(
- CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
- const char* peer_string, grpc_resource_quota* resource_quota,
- CFStreamHandle* stream_sync) {
+grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream,
+ const char* peer_string,
+ CFStreamHandle* stream_sync) {
CFStreamEndpoint* ep_impl = new CFStreamEndpoint;
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_DEBUG,
@@ -389,11 +365,6 @@ grpc_endpoint* grpc_cfstream_endpoint_create(
static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&ep_impl->write_action, WriteAction,
static_cast<void*>(ep_impl), grpc_schedule_on_exec_ctx);
- ep_impl->resource_user =
- grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(&ep_impl->slice_allocator,
- ep_impl->resource_user,
- CFStreamReadAllocationDone, ep_impl);
return &ep_impl->base;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.h b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.h
index ef957c1f111..6f2cf1c6e02 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_cfstream.h
@@ -39,10 +39,10 @@
#include "src/core/lib/iomgr/cfstream_handle.h"
#include "src/core/lib/iomgr/endpoint.h"
-grpc_endpoint* grpc_cfstream_endpoint_create(
- CFReadStreamRef read_stream, CFWriteStreamRef write_stream,
- const char* peer_string, grpc_resource_quota* resource_quota,
- CFStreamHandle* stream_sync);
+grpc_endpoint* grpc_cfstream_endpoint_create(CFReadStreamRef read_stream,
+ CFWriteStreamRef write_stream,
+ const char* peer_string,
+ CFStreamHandle* stream_sync);
#endif /* GRPC_CFSTREAM */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair.h b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair.h
index e01185b9fb2..6150b5bb02b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair.h
@@ -27,6 +27,7 @@ struct grpc_endpoint_pair {
grpc_endpoint* client;
grpc_endpoint* server;
};
+
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
grpc_channel_args* args);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc
new file mode 100644
index 00000000000..7c0c1008a18
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_event_engine.cc
@@ -0,0 +1,32 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <stdlib.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/port.h"
+
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
+ const char* /* name */, grpc_channel_args* /* args */) {
+ // TODO(hork): determine what's needed here in the long run
+ GPR_ASSERT(
+ false &&
+ "grpc_iomgr_create_endpoint_pair is not suppoted with event_engine");
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
index 7f95da7365f..7aa649a6cb9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_posix.cc
@@ -22,10 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_TCP
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
#include <errno.h>
#include <fcntl.h>
#include <string.h>
@@ -38,8 +34,13 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
+#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
static void create_sockets(int sv[2]) {
int flags;
@@ -57,16 +58,17 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
int sv[2];
grpc_endpoint_pair p;
create_sockets(sv);
-
grpc_core::ExecCtx exec_ctx;
-
TString final_name = y_absl::StrCat(name, ":client");
+ const grpc_channel_args* new_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name.c_str(), false),
- args, "socketpair-server");
+ new_args, "socketpair-server");
final_name = y_absl::StrCat(name, ":server");
p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name.c_str(), false),
- args, "socketpair-client");
-
+ new_args, "socketpair-client");
+ grpc_channel_args_destroy(new_args);
return p;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc
deleted file mode 100644
index b99d178cb67..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_uv.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#include <stdlib.h>
-
-#include <grpc/support/log.h>
-
-#include "src/core/lib/iomgr/endpoint_pair.h"
-
-grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,
- grpc_channel_args* args) {
- grpc_endpoint_pair endpoint_pair;
- // TODO(mlumish): implement this properly under libuv
- GPR_ASSERT(false &&
- "grpc_iomgr_create_endpoint_pair is not suppoted with libuv");
- return endpoint_pair;
-}
-
-#endif /* GRPC_UV */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
index 9962809a27b..386057b8951 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/endpoint_pair_windows.cc
@@ -21,15 +21,15 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/endpoint_pair.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <grpc/support/log.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/iomgr/endpoint_pair.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -71,7 +71,7 @@ static void create_sockets(SOCKET sv[2]) {
}
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
- const char* name, grpc_channel_args* channel_args) {
+ const char*, grpc_channel_args* channel_args) {
SOCKET sv[2];
grpc_endpoint_pair p;
create_sockets(sv);
@@ -80,7 +80,6 @@ grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(
channel_args, "endpoint:server");
p.server = grpc_tcp_create(grpc_winsocket_create(sv[0], "endpoint:server"),
channel_args, "endpoint:client");
-
return p;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error.cc b/contrib/libs/grpc/src/core/lib/iomgr/error.cc
index b5f8dc8c724..4366536f7d8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error.cc
@@ -22,7 +22,7 @@
#include <inttypes.h>
#include <string.h>
-#include <grpc/status.h>
+#include <grpc/impl/codegen/status.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -34,13 +34,192 @@
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/error_internal.h"
-#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/slice/slice_utils.h"
grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount(false,
"error_refcount");
grpc_core::DebugOnlyTraceFlag grpc_trace_closure(false, "closure");
+static gpr_atm g_error_creation_allowed = true;
+
+void grpc_disable_error_creation() {
+ gpr_atm_no_barrier_store(&g_error_creation_allowed, false);
+}
+
+void grpc_enable_error_creation() {
+ gpr_atm_no_barrier_store(&g_error_creation_allowed, true);
+}
+
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+
+y_absl::Status grpc_status_create(y_absl::StatusCode code, y_absl::string_view msg,
+ const grpc_core::DebugLocation& location,
+ size_t children_count, y_absl::Status* children) {
+ y_absl::Status s = StatusCreate(code, msg, location, {});
+ for (size_t i = 0; i < children_count; ++i) {
+ if (!children[i].ok()) {
+ grpc_core::StatusAddChild(&s, children[i]);
+ }
+ }
+ return s;
+}
+
+TString grpc_error_std_string(y_absl::Status error) {
+ return grpc_core::StatusToString(error);
+}
+
+y_absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err,
+ const char* call_name) {
+ y_absl::Status s =
+ StatusCreate(y_absl::StatusCode::kUnknown, "OS Error", location, {});
+ grpc_core::StatusSetInt(&s, grpc_core::StatusIntProperty::kErrorNo, err);
+ grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError,
+ strerror(err));
+ grpc_core::StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall,
+ call_name);
+ return s;
+}
+
+#ifdef GPR_WINDOWS
+y_absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err,
+ const char* call_name) {
+ char* utf8_message = gpr_format_message(err);
+ y_absl::Status s =
+ StatusCreate(y_absl::StatusCode::kUnknown, "WSA Error", location, {});
+ StatusSetInt(&s, grpc_core::StatusIntProperty::kWsaError, err);
+ StatusSetStr(&s, grpc_core::StatusStrProperty::kOsError, utf8_message);
+ StatusSetStr(&s, grpc_core::StatusStrProperty::kSyscall, call_name);
+ return s;
+}
+#endif
+
+grpc_error_handle grpc_error_set_int(grpc_error_handle src,
+ grpc_error_ints which, intptr_t value) {
+ if (src == GRPC_ERROR_NONE) {
+ src = y_absl::UnknownError("");
+ StatusSetInt(&src, grpc_core::StatusIntProperty::kRpcStatus,
+ GRPC_STATUS_OK);
+ }
+ grpc_core::StatusSetInt(
+ &src, static_cast<grpc_core::StatusIntProperty>(which), value);
+ return src;
+}
+
+bool grpc_error_get_int(grpc_error_handle error, grpc_error_ints which,
+ intptr_t* p) {
+ y_absl::optional<intptr_t> value = grpc_core::StatusGetInt(
+ error, static_cast<grpc_core::StatusIntProperty>(which));
+ if (value.has_value()) {
+ *p = *value;
+ return true;
+ } else {
+ // TODO(veblush): Remove this once y_absl::Status migration is done
+ if (which == GRPC_ERROR_INT_GRPC_STATUS) {
+ switch (error.code()) {
+ case y_absl::StatusCode::kOk:
+ *p = GRPC_STATUS_OK;
+ return true;
+ case y_absl::StatusCode::kResourceExhausted:
+ *p = GRPC_STATUS_RESOURCE_EXHAUSTED;
+ return true;
+ case y_absl::StatusCode::kCancelled:
+ *p = GRPC_STATUS_CANCELLED;
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+ }
+}
+
+grpc_error_handle grpc_error_set_str(grpc_error_handle src,
+ grpc_error_strs which,
+ y_absl::string_view str) {
+ if (src == GRPC_ERROR_NONE) {
+ src = y_absl::UnknownError("");
+ StatusSetInt(&src, grpc_core::StatusIntProperty::kRpcStatus,
+ GRPC_STATUS_OK);
+ }
+ if (which == GRPC_ERROR_STR_DESCRIPTION) {
+ // To change the message of y_absl::Status, a new instance should be created
+ // with a code and payload because it doesn't have a setter for it.
+ y_absl::Status s = y_absl::Status(src.code(), str);
+ src.ForEachPayload(
+ [&](y_absl::string_view type_url, const y_absl::Cord& payload) {
+ s.SetPayload(type_url, payload);
+ });
+ return s;
+ } else {
+ grpc_core::StatusSetStr(
+ &src, static_cast<grpc_core::StatusStrProperty>(which), str);
+ }
+ return src;
+}
+
+bool grpc_error_get_str(grpc_error_handle error, grpc_error_strs which,
+ TString* s) {
+ if (which == GRPC_ERROR_STR_DESCRIPTION) {
+ // y_absl::Status uses the message field for GRPC_ERROR_STR_DESCRIPTION
+ // instead of using payload.
+ y_absl::string_view msg = error.message();
+ if (msg.empty()) {
+ return false;
+ } else {
+ *s = TString(msg);
+ return true;
+ }
+ } else {
+ y_absl::optional<TString> value = grpc_core::StatusGetStr(
+ error, static_cast<grpc_core::StatusStrProperty>(which));
+ if (value.has_value()) {
+ *s = std::move(*value);
+ return true;
+ } else {
+ // TODO(veblush): Remove this once y_absl::Status migration is done
+ if (which == GRPC_ERROR_STR_GRPC_MESSAGE) {
+ switch (error.code()) {
+ case y_absl::StatusCode::kOk:
+ *s = "";
+ return true;
+ case y_absl::StatusCode::kResourceExhausted:
+ *s = "RESOURCE_EXHAUSTED";
+ return true;
+ case y_absl::StatusCode::kCancelled:
+ *s = "CANCELLED";
+ return true;
+ default:
+ break;
+ }
+ }
+ return false;
+ }
+ }
+}
+
+grpc_error_handle grpc_error_add_child(grpc_error_handle src,
+ grpc_error_handle child) {
+ if (src.ok()) {
+ return child;
+ } else {
+ if (!child.ok()) {
+ grpc_core::StatusAddChild(&src, child);
+ }
+ return src;
+ }
+}
+
+bool grpc_log_error(const char* what, grpc_error_handle error, const char* file,
+ int line) {
+ GPR_DEBUG_ASSERT(error != GRPC_ERROR_NONE);
+ gpr_log(file, line, GPR_LOG_SEVERITY_ERROR, "%s: %s", what,
+ grpc_core::StatusToString(error).c_str());
+ return false;
+}
+
+#else // GRPC_ERROR_IS_ABSEIL_STATUS
+
static const char* error_int_name(grpc_error_ints key) {
switch (key) {
case GRPC_ERROR_INT_ERRNO:
@@ -61,20 +240,18 @@ static const char* error_int_name(grpc_error_ints key) {
return "http2_error";
case GRPC_ERROR_INT_TSI_CODE:
return "tsi_code";
- case GRPC_ERROR_INT_SECURITY_STATUS:
- return "security_status";
case GRPC_ERROR_INT_FD:
return "fd";
case GRPC_ERROR_INT_WSA_ERROR:
return "wsa_error";
case GRPC_ERROR_INT_HTTP_STATUS:
return "http_status";
- case GRPC_ERROR_INT_LIMIT:
- return "limit";
case GRPC_ERROR_INT_OCCURRED_DURING_WRITE:
return "occurred_during_write";
case GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE:
return "channel_connectivity_state";
+ case GRPC_ERROR_INT_LB_POLICY_DROP:
+ return "lb_policy_drop";
case GRPC_ERROR_INT_MAX:
GPR_UNREACHABLE_CODE(return "unknown");
}
@@ -105,8 +282,6 @@ static const char* error_str_name(grpc_error_strs key) {
return "tsi_error";
case GRPC_ERROR_STR_FILENAME:
return "filename";
- case GRPC_ERROR_STR_QUEUED_BUFFERS:
- return "queued_buffers";
case GRPC_ERROR_STR_MAX:
GPR_UNREACHABLE_CODE(return "unknown");
}
@@ -124,7 +299,8 @@ static const char* error_time_name(grpc_error_times key) {
}
#ifndef NDEBUG
-grpc_error* grpc_error_do_ref(grpc_error* err, const char* file, int line) {
+grpc_error_handle grpc_error_do_ref(grpc_error_handle err, const char* file,
+ int line) {
if (grpc_trace_error_refcount.enabled()) {
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d]", err,
gpr_atm_no_barrier_load(&err->atomics.refs.count),
@@ -134,13 +310,13 @@ grpc_error* grpc_error_do_ref(grpc_error* err, const char* file, int line) {
return err;
}
#else
-grpc_error* grpc_error_do_ref(grpc_error* err) {
+grpc_error_handle grpc_error_do_ref(grpc_error_handle err) {
gpr_ref(&err->atomics.refs);
return err;
}
#endif
-static void unref_errs(grpc_error* err) {
+static void unref_errs(grpc_error_handle err) {
uint8_t slot = err->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
@@ -152,7 +328,7 @@ static void unref_errs(grpc_error* err) {
}
}
-static void unref_strs(grpc_error* err) {
+static void unref_strs(grpc_error_handle err) {
for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
@@ -162,7 +338,7 @@ static void unref_strs(grpc_error* err) {
}
}
-static void error_destroy(grpc_error* err) {
+static void error_destroy(grpc_error_handle err) {
GPR_ASSERT(!grpc_error_is_special(err));
unref_errs(err);
unref_strs(err);
@@ -172,7 +348,7 @@ static void error_destroy(grpc_error* err) {
}
#ifndef NDEBUG
-void grpc_error_do_unref(grpc_error* err, const char* file, int line) {
+void grpc_error_do_unref(grpc_error_handle err, const char* file, int line) {
if (grpc_trace_error_refcount.enabled()) {
gpr_log(GPR_DEBUG, "%p: %" PRIdPTR " -> %" PRIdPTR " [%s:%d]", err,
gpr_atm_no_barrier_load(&err->atomics.refs.count),
@@ -183,26 +359,26 @@ void grpc_error_do_unref(grpc_error* err, const char* file, int line) {
}
}
#else
-void grpc_error_do_unref(grpc_error* err) {
+void grpc_error_do_unref(grpc_error_handle err) {
if (gpr_unref(&err->atomics.refs)) {
error_destroy(err);
}
}
#endif
-static uint8_t get_placement(grpc_error** err, size_t size) {
+static uint8_t get_placement(grpc_error_handle* err, size_t size) {
GPR_ASSERT(*err);
uint8_t slots = static_cast<uint8_t>(size / sizeof(intptr_t));
if ((*err)->arena_size + slots > (*err)->arena_capacity) {
- (*err)->arena_capacity = static_cast<uint8_t> GPR_MIN(
- UINT8_MAX - 1, (3 * (*err)->arena_capacity / 2));
+ (*err)->arena_capacity = static_cast<uint8_t>(std::min(
+ size_t(UINT8_MAX - 1), size_t(3 * (*err)->arena_capacity / 2)));
if ((*err)->arena_size + slots > (*err)->arena_capacity) {
return UINT8_MAX;
}
#ifndef NDEBUG
- grpc_error* orig = *err;
+ grpc_error_handle orig = *err;
#endif
- *err = static_cast<grpc_error*>(gpr_realloc(
+ *err = static_cast<grpc_error_handle>(gpr_realloc(
*err, sizeof(grpc_error) + (*err)->arena_capacity * sizeof(intptr_t)));
#ifndef NDEBUG
if (grpc_trace_error_refcount.enabled()) {
@@ -217,7 +393,7 @@ static uint8_t get_placement(grpc_error** err, size_t size) {
return placement;
}
-static void internal_set_int(grpc_error** err, grpc_error_ints which,
+static void internal_set_int(grpc_error_handle* err, grpc_error_ints which,
intptr_t value) {
uint8_t slot = (*err)->ints[which];
if (slot == UINT8_MAX) {
@@ -232,7 +408,7 @@ static void internal_set_int(grpc_error** err, grpc_error_ints which,
(*err)->arena[slot] = value;
}
-static void internal_set_str(grpc_error** err, grpc_error_strs which,
+static void internal_set_str(grpc_error_handle* err, grpc_error_strs which,
const grpc_slice& value) {
uint8_t slot = (*err)->strs[which];
if (slot == UINT8_MAX) {
@@ -253,7 +429,7 @@ static void internal_set_str(grpc_error** err, grpc_error_strs which,
}
static char* fmt_time(gpr_timespec tm);
-static void internal_set_time(grpc_error** err, grpc_error_times which,
+static void internal_set_time(grpc_error_handle* err, grpc_error_times which,
gpr_timespec value) {
uint8_t slot = (*err)->times[which];
if (slot == UINT8_MAX) {
@@ -270,7 +446,8 @@ static void internal_set_time(grpc_error** err, grpc_error_times which,
memcpy((*err)->arena + slot, &value, sizeof(value));
}
-static void internal_add_error(grpc_error** err, grpc_error* new_err) {
+static void internal_add_error(grpc_error_handle* err,
+ grpc_error_handle new_err) {
grpc_linked_error new_last = {new_err, UINT8_MAX};
uint8_t slot = get_placement(err, sizeof(grpc_linked_error));
if (slot == UINT8_MAX) {
@@ -306,25 +483,15 @@ static void internal_add_error(grpc_error** err, grpc_error* new_err) {
// It is very common to include and extra int and string in an error
#define SURPLUS_CAPACITY (2 * SLOTS_PER_INT + SLOTS_PER_TIME)
-static gpr_atm g_error_creation_allowed = true;
-
-void grpc_disable_error_creation() {
- gpr_atm_no_barrier_store(&g_error_creation_allowed, false);
-}
-
-void grpc_enable_error_creation() {
- gpr_atm_no_barrier_store(&g_error_creation_allowed, true);
-}
-
-grpc_error* grpc_error_create(const char* file, int line,
- const grpc_slice& desc, grpc_error** referencing,
- size_t num_referencing) {
- GPR_TIMER_SCOPE("grpc_error_create", 0);
+grpc_error_handle grpc_error_create(const char* file, int line,
+ const grpc_slice& desc,
+ grpc_error_handle* referencing,
+ size_t num_referencing) {
uint8_t initial_arena_capacity = static_cast<uint8_t>(
DEFAULT_ERROR_CAPACITY +
static_cast<uint8_t>(num_referencing * SLOTS_PER_LINKED_ERROR) +
SURPLUS_CAPACITY);
- grpc_error* err = static_cast<grpc_error*>(
+ grpc_error_handle err = static_cast<grpc_error_handle>(
gpr_malloc(sizeof(*err) + initial_arena_capacity * sizeof(intptr_t)));
if (err == nullptr) { // TODO(ctiller): make gpr_malloc return NULL
return GRPC_ERROR_OOM;
@@ -370,7 +537,7 @@ grpc_error* grpc_error_create(const char* file, int line,
return err;
}
-static void ref_strs(grpc_error* err) {
+static void ref_strs(grpc_error_handle err) {
for (size_t i = 0; i < GRPC_ERROR_STR_MAX; ++i) {
uint8_t slot = err->strs[i];
if (slot != UINT8_MAX) {
@@ -380,19 +547,18 @@ static void ref_strs(grpc_error* err) {
}
}
-static void ref_errs(grpc_error* err) {
+static void ref_errs(grpc_error_handle err) {
uint8_t slot = err->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
reinterpret_cast<grpc_linked_error*>(err->arena + slot);
- GRPC_ERROR_REF(lerr->err);
+ (void)GRPC_ERROR_REF(lerr->err);
slot = lerr->next;
}
}
-static grpc_error* copy_error_and_unref(grpc_error* in) {
- GPR_TIMER_SCOPE("copy_error_and_unref", 0);
- grpc_error* out;
+static grpc_error_handle copy_error_and_unref(grpc_error_handle in) {
+ grpc_error_handle out;
if (grpc_error_is_special(in)) {
out = GRPC_ERROR_CREATE_FROM_STATIC_STRING("unknown");
if (in == GRPC_ERROR_NONE) {
@@ -417,7 +583,7 @@ static grpc_error* copy_error_and_unref(grpc_error* in) {
static_cast<uint8_t> SLOTS_PER_STR) {
new_arena_capacity = static_cast<uint8_t>(3 * new_arena_capacity / 2);
}
- out = static_cast<grpc_error*>(
+ out = static_cast<grpc_error_handle>(
gpr_malloc(sizeof(*in) + new_arena_capacity * sizeof(intptr_t)));
#ifndef NDEBUG
if (grpc_trace_error_refcount.enabled()) {
@@ -441,10 +607,9 @@ static grpc_error* copy_error_and_unref(grpc_error* in) {
return out;
}
-grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which,
- intptr_t value) {
- GPR_TIMER_SCOPE("grpc_error_set_int", 0);
- grpc_error* new_err = copy_error_and_unref(src);
+grpc_error_handle grpc_error_set_int(grpc_error_handle src,
+ grpc_error_ints which, intptr_t value) {
+ grpc_error_handle new_err = copy_error_and_unref(src);
internal_set_int(&new_err, which, value);
return new_err;
}
@@ -457,15 +622,15 @@ struct special_error_status_map {
const special_error_status_map error_status_map[] = {
{GRPC_STATUS_OK, "", 0}, // GRPC_ERROR_NONE
{GRPC_STATUS_INVALID_ARGUMENT, "", 0}, // GRPC_ERROR_RESERVED_1
- {GRPC_STATUS_RESOURCE_EXHAUSTED, "Out of memory",
- strlen("Out of memory")}, // GRPC_ERROR_OOM
+ {GRPC_STATUS_RESOURCE_EXHAUSTED, "RESOURCE_EXHAUSTED",
+ strlen("RESOURCE_EXHAUSTED")}, // GRPC_ERROR_OOM
{GRPC_STATUS_INVALID_ARGUMENT, "", 0}, // GRPC_ERROR_RESERVED_2
- {GRPC_STATUS_CANCELLED, "Cancelled",
- strlen("Cancelled")}, // GRPC_ERROR_CANCELLED
+ {GRPC_STATUS_CANCELLED, "CANCELLED",
+ strlen("CANCELLED")}, // GRPC_ERROR_CANCELLED
};
-bool grpc_error_get_int(grpc_error* err, grpc_error_ints which, intptr_t* p) {
- GPR_TIMER_SCOPE("grpc_error_get_int", 0);
+bool grpc_error_get_int(grpc_error_handle err, grpc_error_ints which,
+ intptr_t* p) {
if (grpc_error_is_special(err)) {
if (which != GRPC_ERROR_INT_GRPC_STATUS) return false;
*p = error_status_map[reinterpret_cast<size_t>(err)].code;
@@ -479,43 +644,42 @@ bool grpc_error_get_int(grpc_error* err, grpc_error_ints which, intptr_t* p) {
return false;
}
-grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which,
- const grpc_slice& str) {
- GPR_TIMER_SCOPE("grpc_error_set_str", 0);
- grpc_error* new_err = copy_error_and_unref(src);
- internal_set_str(&new_err, which, str);
+grpc_error_handle grpc_error_set_str(grpc_error_handle src,
+ grpc_error_strs which,
+ y_absl::string_view str) {
+ grpc_error_handle new_err = copy_error_and_unref(src);
+ internal_set_str(&new_err, which,
+ grpc_slice_from_copied_buffer(str.data(), str.length()));
return new_err;
}
-bool grpc_error_get_str(grpc_error* err, grpc_error_strs which,
- grpc_slice* str) {
+bool grpc_error_get_str(grpc_error_handle err, grpc_error_strs which,
+ TString* s) {
if (grpc_error_is_special(err)) {
if (which != GRPC_ERROR_STR_GRPC_MESSAGE) return false;
const special_error_status_map& msg =
error_status_map[reinterpret_cast<size_t>(err)];
- str->refcount = &grpc_core::kNoopRefcount;
- str->data.refcounted.bytes =
- reinterpret_cast<uint8_t*>(const_cast<char*>(msg.msg));
- str->data.refcounted.length = msg.len;
+ *s = TString(msg.msg, msg.len);
return true;
}
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
- *str = *reinterpret_cast<grpc_slice*>(err->arena + slot);
+ grpc_slice* slice = reinterpret_cast<grpc_slice*>(err->arena + slot);
+ *s = TString(grpc_core::StringViewFromSlice(*slice));
return true;
} else {
return false;
}
}
-grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) {
- GPR_TIMER_SCOPE("grpc_error_add_child", 0);
+grpc_error_handle grpc_error_add_child(grpc_error_handle src,
+ grpc_error_handle child) {
if (src != GRPC_ERROR_NONE) {
if (child == GRPC_ERROR_NONE) {
/* \a child is empty. Simply return the ref to \a src */
return src;
} else if (child != src) {
- grpc_error* new_err = copy_error_and_unref(src);
+ grpc_error_handle new_err = copy_error_and_unref(src);
internal_add_error(&new_err, child);
return new_err;
} else {
@@ -530,9 +694,9 @@ grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) {
}
}
-static const char* no_error_string = "\"No Error\"";
-static const char* oom_error_string = "\"Out of memory\"";
-static const char* cancelled_error_string = "\"Cancelled\"";
+static const char* no_error_string = "\"OK\"";
+static const char* oom_error_string = "\"RESOURCE_EXHAUSTED\"";
+static const char* cancelled_error_string = "\"CANCELLED\"";
struct kv_pair {
char* key;
@@ -545,7 +709,7 @@ struct kv_pairs {
};
static void append_chr(char c, char** s, size_t* sz, size_t* cap) {
if (*sz == *cap) {
- *cap = GPR_MAX(8, 3 * *cap / 2);
+ *cap = std::max(size_t(8), 3 * *cap / 2);
*s = static_cast<char*>(gpr_realloc(*s, *cap));
}
(*s)[(*sz)++] = c;
@@ -597,7 +761,7 @@ static void append_esc_str(const uint8_t* str, size_t len, char** s, size_t* sz,
static void append_kv(kv_pairs* kvs, char* key, char* value) {
if (kvs->num_kvs == kvs->cap_kvs) {
- kvs->cap_kvs = GPR_MAX(3 * kvs->cap_kvs / 2, 4);
+ kvs->cap_kvs = std::max(3 * kvs->cap_kvs / 2, size_t(4));
kvs->kvs = static_cast<kv_pair*>(
gpr_realloc(kvs->kvs, sizeof(*kvs->kvs) * kvs->cap_kvs));
}
@@ -616,7 +780,7 @@ static char* fmt_int(intptr_t p) {
return s;
}
-static void collect_ints_kvs(grpc_error* err, kv_pairs* kvs) {
+static void collect_ints_kvs(grpc_error_handle err, kv_pairs* kvs) {
for (size_t which = 0; which < GRPC_ERROR_INT_MAX; ++which) {
uint8_t slot = err->ints[which];
if (slot != UINT8_MAX) {
@@ -640,7 +804,7 @@ static char* fmt_str(const grpc_slice& slice) {
return s;
}
-static void collect_strs_kvs(grpc_error* err, kv_pairs* kvs) {
+static void collect_strs_kvs(grpc_error_handle err, kv_pairs* kvs) {
for (size_t which = 0; which < GRPC_ERROR_STR_MAX; ++which) {
uint8_t slot = err->strs[which];
if (slot != UINT8_MAX) {
@@ -675,7 +839,7 @@ static char* fmt_time(gpr_timespec tm) {
return out;
}
-static void collect_times_kvs(grpc_error* err, kv_pairs* kvs) {
+static void collect_times_kvs(grpc_error_handle err, kv_pairs* kvs) {
for (size_t which = 0; which < GRPC_ERROR_TIME_MAX; ++which) {
uint8_t slot = err->times[which];
if (slot != UINT8_MAX) {
@@ -685,7 +849,7 @@ static void collect_times_kvs(grpc_error* err, kv_pairs* kvs) {
}
}
-static void add_errs(grpc_error* err, char** s, size_t* sz, size_t* cap) {
+static void add_errs(grpc_error_handle err, char** s, size_t* sz, size_t* cap) {
uint8_t slot = err->first_err;
bool first = true;
while (slot != UINT8_MAX) {
@@ -701,7 +865,7 @@ static void add_errs(grpc_error* err, char** s, size_t* sz, size_t* cap) {
}
}
-static char* errs_string(grpc_error* err) {
+static char* errs_string(grpc_error_handle err) {
char* s = nullptr;
size_t sz = 0;
size_t cap = 0;
@@ -743,8 +907,7 @@ static char* finish_kvs(kv_pairs* kvs) {
// Newly allocated error string is stored into err object via atomic cas, and this drives coverity crazy
// Disable allocation checks as the code is fine.
// coverity[-alloc]
-const char* grpc_error_string(grpc_error* err) {
- GPR_TIMER_SCOPE("grpc_error_string", 0);
+const char* grpc_error_string(grpc_error_handle err) {
if (err == GRPC_ERROR_NONE) return no_error_string;
if (err == GRPC_ERROR_OOM) return oom_error_string;
if (err == GRPC_ERROR_CANCELLED) return cancelled_error_string;
@@ -778,8 +941,12 @@ const char* grpc_error_string(grpc_error* err) {
return out;
}
-grpc_error* grpc_os_error(const char* file, int line, int err,
- const char* call_name) {
+TString grpc_error_std_string(grpc_error_handle error) {
+ return TString(grpc_error_string(error));
+}
+
+grpc_error_handle grpc_os_error(const char* file, int line, int err,
+ const char* call_name) {
return grpc_error_set_str(
grpc_error_set_str(
grpc_error_set_int(
@@ -787,30 +954,29 @@ grpc_error* grpc_os_error(const char* file, int line, int err,
grpc_slice_from_static_string(strerror(err)),
nullptr, 0),
GRPC_ERROR_INT_ERRNO, err),
- GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(strerror(err))),
- GRPC_ERROR_STR_SYSCALL, grpc_slice_from_copied_string(call_name));
+ GRPC_ERROR_STR_OS_ERROR, strerror(err)),
+ GRPC_ERROR_STR_SYSCALL, call_name);
}
#ifdef GPR_WINDOWS
-grpc_error* grpc_wsa_error(const char* file, int line, int err,
- const char* call_name) {
+grpc_error_handle grpc_wsa_error(const char* file, int line, int err,
+ const char* call_name) {
char* utf8_message = gpr_format_message(err);
- grpc_error* error = grpc_error_set_str(
+ grpc_error_handle error = grpc_error_set_str(
grpc_error_set_str(
grpc_error_set_int(
grpc_error_create(file, line,
grpc_slice_from_static_string("OS Error"), NULL,
0),
GRPC_ERROR_INT_WSA_ERROR, err),
- GRPC_ERROR_STR_OS_ERROR, grpc_slice_from_copied_string(utf8_message)),
- GRPC_ERROR_STR_SYSCALL, grpc_slice_from_static_string(call_name));
+ GRPC_ERROR_STR_OS_ERROR, utf8_message),
+ GRPC_ERROR_STR_SYSCALL, call_name);
gpr_free(utf8_message);
return error;
}
#endif
-bool grpc_log_error(const char* what, grpc_error* error, const char* file,
+bool grpc_log_error(const char* what, grpc_error_handle error, const char* file,
int line) {
GPR_DEBUG_ASSERT(error != GRPC_ERROR_NONE);
const char* msg = grpc_error_string(error);
@@ -818,3 +984,5 @@ bool grpc_log_error(const char* what, grpc_error* error, const char* file,
GRPC_ERROR_UNREF(error);
return false;
}
+
+#endif // GRPC_ERROR_IS_ABSEIL_STATUS
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error.h b/contrib/libs/grpc/src/core/lib/iomgr/error.h
index ca520fa5678..35244bdcf64 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error.h
@@ -24,56 +24,78 @@
#include <inttypes.h>
#include <stdbool.h>
+#include "y_absl/status/status.h"
+
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/gpr/spinlock.h"
+#include "src/core/lib/gprpp/status_helper.h"
+#include "src/core/lib/slice/slice_internal.h"
/// Opaque representation of an error.
/// See https://github.com/grpc/grpc/blob/master/doc/core/grpc-error.md for a
/// full write up of this object.
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+
+typedef y_absl::Status grpc_error_handle;
+
+#else // GRPC_ERROR_IS_ABSEIL_STATUS
+
typedef struct grpc_error grpc_error;
+typedef grpc_error* grpc_error_handle;
-extern grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount;
+#endif // GRPC_ERROR_IS_ABSEIL_STATUS
typedef enum {
/// 'errno' from the operating system
- GRPC_ERROR_INT_ERRNO,
+ GRPC_ERROR_INT_ERRNO =
+ static_cast<int>(grpc_core::StatusIntProperty::kErrorNo),
/// __LINE__ from the call site creating the error
- GRPC_ERROR_INT_FILE_LINE,
+ GRPC_ERROR_INT_FILE_LINE =
+ static_cast<int>(grpc_core::StatusIntProperty::kFileLine),
/// stream identifier: for errors that are associated with an individual
/// wire stream
- GRPC_ERROR_INT_STREAM_ID,
+ GRPC_ERROR_INT_STREAM_ID =
+ static_cast<int>(grpc_core::StatusIntProperty::kStreamId),
/// grpc status code representing this error
- GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_ERROR_INT_GRPC_STATUS =
+ static_cast<int>(grpc_core::StatusIntProperty::kRpcStatus),
/// offset into some binary blob (usually represented by
/// GRPC_ERROR_STR_RAW_BYTES) where the error occurred
- GRPC_ERROR_INT_OFFSET,
+ GRPC_ERROR_INT_OFFSET =
+ static_cast<int>(grpc_core::StatusIntProperty::kOffset),
/// context sensitive index associated with the error
- GRPC_ERROR_INT_INDEX,
+ GRPC_ERROR_INT_INDEX = static_cast<int>(grpc_core::StatusIntProperty::kIndex),
/// context sensitive size associated with the error
- GRPC_ERROR_INT_SIZE,
+ GRPC_ERROR_INT_SIZE = static_cast<int>(grpc_core::StatusIntProperty::kSize),
/// http2 error code associated with the error (see the HTTP2 RFC)
- GRPC_ERROR_INT_HTTP2_ERROR,
+ GRPC_ERROR_INT_HTTP2_ERROR =
+ static_cast<int>(grpc_core::StatusIntProperty::kHttp2Error),
/// TSI status code associated with the error
- GRPC_ERROR_INT_TSI_CODE,
- /// grpc_security_status associated with the error
- GRPC_ERROR_INT_SECURITY_STATUS,
+ GRPC_ERROR_INT_TSI_CODE =
+ static_cast<int>(grpc_core::StatusIntProperty::kTsiCode),
/// WSAGetLastError() reported when this error occurred
- GRPC_ERROR_INT_WSA_ERROR,
+ GRPC_ERROR_INT_WSA_ERROR =
+ static_cast<int>(grpc_core::StatusIntProperty::kWsaError),
/// File descriptor associated with this error
- GRPC_ERROR_INT_FD,
+ GRPC_ERROR_INT_FD = static_cast<int>(grpc_core::StatusIntProperty::kFd),
/// HTTP status (i.e. 404)
- GRPC_ERROR_INT_HTTP_STATUS,
- /// context sensitive limit associated with the error
- GRPC_ERROR_INT_LIMIT,
+ GRPC_ERROR_INT_HTTP_STATUS =
+ static_cast<int>(grpc_core::StatusIntProperty::kHttpStatus),
/// chttp2: did the error occur while a write was in progress
- GRPC_ERROR_INT_OCCURRED_DURING_WRITE,
+ GRPC_ERROR_INT_OCCURRED_DURING_WRITE =
+ static_cast<int>(grpc_core::StatusIntProperty::kOccurredDuringWrite),
/// channel connectivity state associated with the error
- GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE,
+ GRPC_ERROR_INT_CHANNEL_CONNECTIVITY_STATE =
+ static_cast<int>(grpc_core::StatusIntProperty::ChannelConnectivityState),
+ /// LB policy drop
+ GRPC_ERROR_INT_LB_POLICY_DROP =
+ static_cast<int>(grpc_core::StatusIntProperty::kLbPolicyDrop),
/// Must always be last
GRPC_ERROR_INT_MAX,
@@ -81,29 +103,35 @@ typedef enum {
typedef enum {
/// top-level textual description of this error
- GRPC_ERROR_STR_DESCRIPTION,
+ GRPC_ERROR_STR_DESCRIPTION =
+ static_cast<int>(grpc_core::StatusStrProperty::kDescription),
/// source file in which this error occurred
- GRPC_ERROR_STR_FILE,
+ GRPC_ERROR_STR_FILE = static_cast<int>(grpc_core::StatusStrProperty::kFile),
/// operating system description of this error
- GRPC_ERROR_STR_OS_ERROR,
+ GRPC_ERROR_STR_OS_ERROR =
+ static_cast<int>(grpc_core::StatusStrProperty::kOsError),
/// syscall that generated this error
- GRPC_ERROR_STR_SYSCALL,
+ GRPC_ERROR_STR_SYSCALL =
+ static_cast<int>(grpc_core::StatusStrProperty::kSyscall),
/// peer that we were trying to communicate when this error occurred
- GRPC_ERROR_STR_TARGET_ADDRESS,
+ GRPC_ERROR_STR_TARGET_ADDRESS =
+ static_cast<int>(grpc_core::StatusStrProperty::kTargetAddress),
/// grpc status message associated with this error
- GRPC_ERROR_STR_GRPC_MESSAGE,
+ GRPC_ERROR_STR_GRPC_MESSAGE =
+ static_cast<int>(grpc_core::StatusStrProperty::kGrpcMessage),
/// hex dump (or similar) with the data that generated this error
- GRPC_ERROR_STR_RAW_BYTES,
+ GRPC_ERROR_STR_RAW_BYTES =
+ static_cast<int>(grpc_core::StatusStrProperty::kRawBytes),
/// tsi error string associated with this error
- GRPC_ERROR_STR_TSI_ERROR,
+ GRPC_ERROR_STR_TSI_ERROR =
+ static_cast<int>(grpc_core::StatusStrProperty::kTsiError),
/// filename that we were trying to read/write when this error occurred
- GRPC_ERROR_STR_FILENAME,
- /// which data was queued for writing when the error occurred
- GRPC_ERROR_STR_QUEUED_BUFFERS,
+ GRPC_ERROR_STR_FILENAME =
+ static_cast<int>(grpc_core::StatusStrProperty::kFilename),
/// key associated with the error
- GRPC_ERROR_STR_KEY,
+ GRPC_ERROR_STR_KEY = static_cast<int>(grpc_core::StatusStrProperty::kKey),
/// value associated with the error
- GRPC_ERROR_STR_VALUE,
+ GRPC_ERROR_STR_VALUE = static_cast<int>(grpc_core::StatusStrProperty::kValue),
/// Must always be last
GRPC_ERROR_STR_MAX,
@@ -117,32 +145,139 @@ typedef enum {
GRPC_ERROR_TIME_MAX,
} grpc_error_times;
+// DEPRECATED: Use grpc_error_std_string instead
+const char* grpc_error_string(grpc_error_handle error);
+TString grpc_error_std_string(grpc_error_handle error);
+
+// debug only toggles that allow for a sanity to check that ensures we will
+// never create any errors in the per-RPC hotpath.
+void grpc_disable_error_creation();
+void grpc_enable_error_creation();
+
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+
+#define GRPC_ERROR_NONE y_absl::OkStatus()
+#define GRPC_ERROR_OOM y_absl::Status(y_absl::ResourceExhaustedError(""))
+#define GRPC_ERROR_CANCELLED y_absl::CancelledError()
+
+#define GRPC_ERROR_REF(err) (err)
+#define GRPC_ERROR_UNREF(err) (void)(err)
+
+#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc) \
+ StatusCreate(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+#define GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) \
+ StatusCreate(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc) \
+ StatusCreate(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+#define GRPC_ERROR_CREATE_FROM_STRING_VIEW(desc) \
+ StatusCreate(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, {})
+
+y_absl::Status grpc_status_create(y_absl::StatusCode code, y_absl::string_view msg,
+ const grpc_core::DebugLocation& location,
+ size_t children_count,
+ y_absl::Status* children) GRPC_MUST_USE_RESULT;
+
+// Create an error that references some other errors. This function adds a
+// reference to each error in errs - it does not consume an existing reference
+#define GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(desc, errs, count) \
+ grpc_status_create(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, count, \
+ errs)
+#define GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(desc, errs, count) \
+ grpc_status_create(y_absl::StatusCode::kUnknown, desc, DEBUG_LOCATION, count, \
+ errs)
+
+// Consumes all the errors in the vector and forms a referencing error from
+// them. If the vector is empty, return GRPC_ERROR_NONE.
+template <typename VectorType>
+static y_absl::Status grpc_status_create_from_vector(
+ const grpc_core::DebugLocation& location, y_absl::string_view desc,
+ VectorType* error_list) {
+ y_absl::Status error = GRPC_ERROR_NONE;
+ if (error_list->size() != 0) {
+ error = grpc_status_create(y_absl::StatusCode::kUnknown, desc, location,
+ error_list->size(), error_list->data());
+ error_list->clear();
+ }
+ return error;
+}
+
+#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) \
+ grpc_status_create_from_vector(DEBUG_LOCATION, desc, error_list)
+#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(desc, error_list) \
+ grpc_status_create_from_vector(DEBUG_LOCATION, desc, error_list)
+
+y_absl::Status grpc_os_error(const grpc_core::DebugLocation& location, int err,
+ const char* call_name) GRPC_MUST_USE_RESULT;
+
+inline y_absl::Status grpc_assert_never_ok(y_absl::Status error) {
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ return error;
+}
+
+/// create an error associated with errno!=0 (an 'operating system' error)
+#define GRPC_OS_ERROR(err, call_name) \
+ grpc_assert_never_ok(grpc_os_error(DEBUG_LOCATION, err, call_name))
+
+y_absl::Status grpc_wsa_error(const grpc_core::DebugLocation& location, int err,
+ const char* call_name) GRPC_MUST_USE_RESULT;
+
+/// windows only: create an error associated with WSAGetLastError()!=0
+#define GRPC_WSA_ERROR(err, call_name) \
+ grpc_wsa_error(DEBUG_LOCATION, err, call_name)
+
+#else // GRPC_ERROR_IS_ABSEIL_STATUS
+
/// The following "special" errors can be propagated without allocating memory.
/// They are always even so that other code (particularly combiner locks,
/// polling engines) can safely use the lower bit for themselves.
-#define GRPC_ERROR_NONE ((grpc_error*)NULL)
-#define GRPC_ERROR_RESERVED_1 ((grpc_error*)1)
-#define GRPC_ERROR_OOM ((grpc_error*)2)
-#define GRPC_ERROR_RESERVED_2 ((grpc_error*)3)
-#define GRPC_ERROR_CANCELLED ((grpc_error*)4)
+#define GRPC_ERROR_NONE ((grpc_error_handle)NULL)
+#define GRPC_ERROR_RESERVED_1 ((grpc_error_handle)1)
+#define GRPC_ERROR_OOM ((grpc_error_handle)2)
+#define GRPC_ERROR_RESERVED_2 ((grpc_error_handle)3)
+#define GRPC_ERROR_CANCELLED ((grpc_error_handle)4)
#define GRPC_ERROR_SPECIAL_MAX GRPC_ERROR_CANCELLED
-inline bool grpc_error_is_special(struct grpc_error* err) {
+inline bool grpc_error_is_special(grpc_error_handle err) {
return err <= GRPC_ERROR_SPECIAL_MAX;
}
-// debug only toggles that allow for a sanity to check that ensures we will
-// never create any errors in the per-RPC hotpath.
-void grpc_disable_error_creation();
-void grpc_enable_error_creation();
-
-const char* grpc_error_string(grpc_error* error);
+#ifndef NDEBUG
+grpc_error_handle grpc_error_do_ref(grpc_error_handle err, const char* file,
+ int line);
+void grpc_error_do_unref(grpc_error_handle err, const char* file, int line);
+inline grpc_error_handle grpc_error_ref(grpc_error_handle err, const char* file,
+ int line) {
+ if (grpc_error_is_special(err)) return err;
+ return grpc_error_do_ref(err, file, line);
+}
+inline void grpc_error_unref(grpc_error_handle err, const char* file,
+ int line) {
+ if (grpc_error_is_special(err)) return;
+ grpc_error_do_unref(err, file, line);
+}
+#define GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__)
+#define GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__)
+#else
+grpc_error_handle grpc_error_do_ref(grpc_error_handle err);
+void grpc_error_do_unref(grpc_error_handle err);
+inline grpc_error_handle grpc_error_ref(grpc_error_handle err) {
+ if (grpc_error_is_special(err)) return err;
+ return grpc_error_do_ref(err);
+}
+inline void grpc_error_unref(grpc_error_handle err) {
+ if (grpc_error_is_special(err)) return;
+ grpc_error_do_unref(err);
+}
+#define GRPC_ERROR_REF(err) grpc_error_ref(err)
+#define GRPC_ERROR_UNREF(err) grpc_error_unref(err)
+#endif
/// Create an error - but use GRPC_ERROR_CREATE instead
-grpc_error* grpc_error_create(const char* file, int line,
- const grpc_slice& desc, grpc_error** referencing,
- size_t num_referencing);
+grpc_error_handle grpc_error_create(const char* file, int line,
+ const grpc_slice& desc,
+ grpc_error_handle* referencing,
+ size_t num_referencing);
/// Create an error (this is the preferred way of generating an error that is
/// not due to a system call - for system calls, use GRPC_OS_ERROR or
/// GRPC_WSA_ERROR as appropriate)
@@ -157,6 +292,13 @@ grpc_error* grpc_error_create(const char* file, int line,
#define GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) \
grpc_error_create(__FILE__, __LINE__, grpc_slice_from_copied_string(desc), \
NULL, 0)
+#define GRPC_ERROR_CREATE_FROM_CPP_STRING(desc) \
+ grpc_error_create(__FILE__, __LINE__, grpc_slice_from_cpp_string(desc), \
+ NULL, 0)
+#define GRPC_ERROR_CREATE_FROM_STRING_VIEW(desc) \
+ grpc_error_create( \
+ __FILE__, __LINE__, \
+ grpc_slice_from_copied_buffer((desc).data(), (desc).size()), NULL, 0)
// Create an error that references some other errors. This function adds a
// reference to each error in errs - it does not consume an existing reference
@@ -168,45 +310,24 @@ grpc_error* grpc_error_create(const char* file, int line,
errs, count)
#define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) \
- grpc_error_create_from_vector(__FILE__, __LINE__, desc, error_list)
-
-#ifndef NDEBUG
-grpc_error* grpc_error_do_ref(grpc_error* err, const char* file, int line);
-void grpc_error_do_unref(grpc_error* err, const char* file, int line);
-inline grpc_error* grpc_error_ref(grpc_error* err, const char* file, int line) {
- if (grpc_error_is_special(err)) return err;
- return grpc_error_do_ref(err, file, line);
-}
-inline void grpc_error_unref(grpc_error* err, const char* file, int line) {
- if (grpc_error_is_special(err)) return;
- grpc_error_do_unref(err, file, line);
-}
-#define GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__)
-#define GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__)
-#else
-grpc_error* grpc_error_do_ref(grpc_error* err);
-void grpc_error_do_unref(grpc_error* err);
-inline grpc_error* grpc_error_ref(grpc_error* err) {
- if (grpc_error_is_special(err)) return err;
- return grpc_error_do_ref(err);
-}
-inline void grpc_error_unref(grpc_error* err) {
- if (grpc_error_is_special(err)) return;
- grpc_error_do_unref(err);
-}
-#define GRPC_ERROR_REF(err) grpc_error_ref(err)
-#define GRPC_ERROR_UNREF(err) grpc_error_unref(err)
-#endif
+ grpc_error_create_from_vector( \
+ __FILE__, __LINE__, grpc_slice_from_static_string, desc, error_list)
+#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING(desc, error_list) \
+ grpc_error_create_from_vector(__FILE__, __LINE__, \
+ grpc_slice_from_cpp_string, desc, error_list)
// Consumes all the errors in the vector and forms a referencing error from
// them. If the vector is empty, return GRPC_ERROR_NONE.
-template <typename VectorType>
-static grpc_error* grpc_error_create_from_vector(const char* file, int line,
- const char* desc,
- VectorType* error_list) {
- grpc_error* error = GRPC_ERROR_NONE;
+template <typename VectorType, typename StringType,
+ typename SliceFromStringFunction>
+static grpc_error_handle grpc_error_create_from_vector(
+ const char* file, int line,
+ SliceFromStringFunction slice_from_string_function, StringType desc,
+ VectorType* error_list) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (error_list->size() != 0) {
- error = grpc_error_create(file, line, grpc_slice_from_static_string(desc),
+ error = grpc_error_create(file, line,
+ slice_from_string_function(std::move(desc)),
error_list->data(), error_list->size());
// Remove refs to all errors in error_list.
for (size_t i = 0; i < error_list->size(); i++) {
@@ -217,19 +338,38 @@ static grpc_error* grpc_error_create_from_vector(const char* file, int line,
return error;
}
-grpc_error* grpc_error_set_int(grpc_error* src, grpc_error_ints which,
- intptr_t value) GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_os_error(const char* file, int line, int err,
+ const char* call_name) GRPC_MUST_USE_RESULT;
+
+inline grpc_error_handle grpc_assert_never_ok(grpc_error_handle error) {
+ GPR_ASSERT(error != GRPC_ERROR_NONE);
+ return error;
+}
+
+/// create an error associated with errno!=0 (an 'operating system' error)
+#define GRPC_OS_ERROR(err, call_name) \
+ grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name))
+grpc_error_handle grpc_wsa_error(const char* file, int line, int err,
+ const char* call_name) GRPC_MUST_USE_RESULT;
+/// windows only: create an error associated with WSAGetLastError()!=0
+#define GRPC_WSA_ERROR(err, call_name) \
+ grpc_wsa_error(__FILE__, __LINE__, err, call_name)
+
+#endif // GRPC_ERROR_IS_ABSEIL_STATUS
+
+grpc_error_handle grpc_error_set_int(grpc_error_handle src,
+ grpc_error_ints which,
+ intptr_t value) GRPC_MUST_USE_RESULT;
/// It is an error to pass nullptr as `p`. Caller should allocate a phony
/// intptr_t for `p`, even if the value of `p` is not used.
-bool grpc_error_get_int(grpc_error* error, grpc_error_ints which, intptr_t* p);
-/// This call takes ownership of the slice; the error is responsible for
-/// eventually unref-ing it.
-grpc_error* grpc_error_set_str(grpc_error* src, grpc_error_strs which,
- const grpc_slice& str) GRPC_MUST_USE_RESULT;
+bool grpc_error_get_int(grpc_error_handle error, grpc_error_ints which,
+ intptr_t* p);
+grpc_error_handle grpc_error_set_str(
+ grpc_error_handle src, grpc_error_strs which,
+ y_absl::string_view str) GRPC_MUST_USE_RESULT;
/// Returns false if the specified string is not set.
-/// Caller does NOT own the slice.
-bool grpc_error_get_str(grpc_error* error, grpc_error_strs which,
- grpc_slice* s);
+bool grpc_error_get_str(grpc_error_handle error, grpc_error_strs which,
+ TString* str);
/// Add a child error: an error that is believed to have contributed to this
/// error occurring. Allows root causing high level errors from lower level
@@ -242,29 +382,12 @@ bool grpc_error_get_str(grpc_error* error, grpc_error_strs which,
/// returns GRPC_ERROR_NONE. 3) If \a src and \a child point to the same error,
/// returns a single reference. (Note that, 2 references should have been
/// received to the error in this case.)
-grpc_error* grpc_error_add_child(grpc_error* src,
- grpc_error* child) GRPC_MUST_USE_RESULT;
-
-grpc_error* grpc_os_error(const char* file, int line, int err,
- const char* call_name) GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_error_add_child(
+ grpc_error_handle src, grpc_error_handle child) GRPC_MUST_USE_RESULT;
-inline grpc_error* grpc_assert_never_ok(grpc_error* error) {
- GPR_ASSERT(error != GRPC_ERROR_NONE);
- return error;
-}
-
-/// create an error associated with errno!=0 (an 'operating system' error)
-#define GRPC_OS_ERROR(err, call_name) \
- grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name))
-grpc_error* grpc_wsa_error(const char* file, int line, int err,
- const char* call_name) GRPC_MUST_USE_RESULT;
-/// windows only: create an error associated with WSAGetLastError()!=0
-#define GRPC_WSA_ERROR(err, call_name) \
- grpc_wsa_error(__FILE__, __LINE__, err, call_name)
-
-bool grpc_log_error(const char* what, grpc_error* error, const char* file,
+bool grpc_log_error(const char* what, grpc_error_handle error, const char* file,
int line);
-inline bool grpc_log_if_error(const char* what, grpc_error* error,
+inline bool grpc_log_if_error(const char* what, grpc_error_handle error,
const char* file, int line) {
return error == GRPC_ERROR_NONE ? true
: grpc_log_error(what, error, file, line);
@@ -273,4 +396,47 @@ inline bool grpc_log_if_error(const char* what, grpc_error* error,
#define GRPC_LOG_IF_ERROR(what, error) \
(grpc_log_if_error((what), (error), __FILE__, __LINE__))
+/// Helper class to get & set grpc_error_handle in a thread-safe fashion.
+/// This could be considered as atomic<grpc_error_handle>.
+class AtomicError {
+ public:
+ AtomicError() {
+ error_ = GRPC_ERROR_NONE;
+ lock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
+ }
+ explicit AtomicError(grpc_error_handle error) {
+ error_ = GRPC_ERROR_REF(error);
+ }
+ ~AtomicError() { GRPC_ERROR_UNREF(error_); }
+
+ AtomicError(const AtomicError&) = delete;
+ AtomicError& operator=(const AtomicError&) = delete;
+
+ /// returns get() == GRPC_ERROR_NONE
+ bool ok() {
+ gpr_spinlock_lock(&lock_);
+ bool ret = error_ == GRPC_ERROR_NONE;
+ gpr_spinlock_unlock(&lock_);
+ return ret;
+ }
+
+ grpc_error_handle get() {
+ gpr_spinlock_lock(&lock_);
+ grpc_error_handle ret = error_;
+ gpr_spinlock_unlock(&lock_);
+ return ret;
+ }
+
+ void set(grpc_error_handle error) {
+ gpr_spinlock_lock(&lock_);
+ GRPC_ERROR_UNREF(error_);
+ error_ = GRPC_ERROR_REF(error);
+ gpr_spinlock_unlock(&lock_);
+ }
+
+ private:
+ grpc_error_handle error_;
+ gpr_spinlock lock_;
+};
+
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
index 62f6bc1d407..3fd87129a04 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.cc
@@ -19,20 +19,21 @@
#include <grpc/support/port_platform.h>
#ifdef GRPC_CFSTREAM
+#include <CoreFoundation/CoreFoundation.h>
+
#include <util/generic/string.h>
#include "y_absl/strings/str_format.h"
-#include <CoreFoundation/CoreFoundation.h>
-
#include <grpc/support/alloc.h>
#include "src/core/lib/iomgr/error.h"
#define MAX_ERROR_DESCRIPTION 256
-grpc_error* grpc_error_create_from_cferror(const char* file, int line,
- void* arg, const char* custom_desc) {
+grpc_error_handle grpc_error_create_from_cferror(const char* file, int line,
+ void* arg,
+ const char* custom_desc) {
CFErrorRef error = static_cast<CFErrorRef>(arg);
char buf_domain[MAX_ERROR_DESCRIPTION];
char buf_desc[MAX_ERROR_DESCRIPTION];
@@ -47,7 +48,12 @@ grpc_error* grpc_error_create_from_cferror(const char* file, int line,
y_absl::StrFormat("%s (error domain:%s, code:%ld, description:%s)",
custom_desc, buf_domain, code, buf_desc);
CFRelease(desc);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ return StatusCreate(y_absl::StatusCode::kUnknown, error_msg,
+ grpc_core::DebugLocation(file, line), {});
+#else
return grpc_error_create(
file, line, grpc_slice_from_copied_string(error_msg.c_str()), NULL, 0);
+#endif
}
#endif /* GRPC_CFSTREAM */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.h b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.h
index 06ab7513296..2d5b744c74e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error_cfstream.h
@@ -24,8 +24,8 @@
#define GRPC_ERROR_CREATE_FROM_CFERROR(error, desc) \
grpc_error_create_from_cferror(__FILE__, __LINE__, \
static_cast<void*>((error)), (desc))
-grpc_error* grpc_error_create_from_cferror(const char* file, int line,
- void* arg, const char* desc);
+grpc_error_handle grpc_error_create_from_cferror(const char* file, int line,
+ void* arg, const char* desc);
#endif /* GRPC_CFSTREAM */
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_CFSTREAM_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/error_internal.h b/contrib/libs/grpc/src/core/lib/iomgr/error_internal.h
index 33c233b9b67..8959ed13b45 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/error_internal.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/error_internal.h
@@ -25,12 +25,15 @@
#include <stdbool.h> // TODO(unknown): , do we need this?
#include <grpc/support/sync.h>
+
#include "src/core/lib/iomgr/error.h"
+#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
+
typedef struct grpc_linked_error grpc_linked_error;
struct grpc_linked_error {
- grpc_error* err;
+ grpc_error_handle err;
uint8_t next;
};
@@ -58,4 +61,6 @@ struct grpc_error {
intptr_t arena[0];
};
+#endif // GRPC_ERROR_IS_ABSEIL_STATUS
+
#endif /* GRPC_CORE_LIB_IOMGR_ERROR_INTERNAL_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
index 67c1cf850d0..9d248b0b9e7 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.cc
@@ -219,9 +219,9 @@ static void pollset_global_shutdown(void) {
/// The Apple pollset simply waits on a condition variable until it is kicked.
/// The network events are handled in the global run loop thread. Processing of
/// these events will eventually trigger the kick.
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
GRPC_POLLING_TRACE("pollset work: %p, worker: %p, deadline: %" PRIu64,
pollset, worker, deadline);
GrpcApplePollset* apple_pollset =
@@ -272,8 +272,8 @@ static void kick_worker(GrpcAppleWorker* worker) {
/// The caller must acquire the lock GrpcApplePollset.mu before calling this
/// function. The kick action simply signals the condition variable of the
/// worker.
-static grpc_error* pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
GrpcApplePollset* apple_pollset =
reinterpret_cast<GrpcApplePollset*>(pollset);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
index a05f91ce15f..6397ed4cf06 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_apple.h
@@ -40,4 +40,4 @@ extern grpc_pollset_set_vtable grpc_apple_pollset_set_vtable;
#endif
-#endif
+#endif // GRPC_CORE_LIB_IOMGR_EV_APPLE_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
index ab2d511bd05..e21ac969973 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_epoll1_linux.cc
@@ -18,15 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/port.h"
+
/* This polling engine is only relevant on linux kernels supporting epoll
epoll_create() or epoll_create1() */
#ifdef GRPC_LINUX_EPOLL
-#include "src/core/lib/iomgr/ev_epoll1_linux.h"
-
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
@@ -54,6 +52,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/block_annotate.h"
+#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/lockfree_event.h"
@@ -196,7 +195,7 @@ struct grpc_pollset_worker {
(worker)->kick_state_mutator = __LINE__; \
} while (false)
-#define MAX_NEIGHBORHOODS 1024
+#define MAX_NEIGHBORHOODS 1024u
typedef struct pollset_neighborhood {
union {
@@ -241,7 +240,7 @@ struct grpc_pollset_set {
* Common helpers
*/
-static bool append_error(grpc_error** composite, grpc_error* error,
+static bool append_error(grpc_error_handle* composite, grpc_error_handle error,
const char* desc) {
if (error == GRPC_ERROR_NONE) return true;
if (*composite == GRPC_ERROR_NONE) {
@@ -382,7 +381,7 @@ static int fd_wrapped_fd(grpc_fd* fd) { return fd->fd; }
/* if 'releasing_fd' is true, it means that we are going to detach the internal
* fd from grpc_fd structure (i.e which means we should not be calling
* shutdown() syscall on that fd) */
-static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
+static void fd_shutdown_internal(grpc_fd* fd, grpc_error_handle why,
bool releasing_fd) {
if (fd->read_closure->SetShutdown(GRPC_ERROR_REF(why))) {
if (!releasing_fd) {
@@ -402,13 +401,13 @@ static void fd_shutdown_internal(grpc_fd* fd, grpc_error* why,
}
/* Might be called multiple times */
-static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
+static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
fd_shutdown_internal(fd, why, false);
}
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
const char* reason) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
bool is_release_fd = (release_fd != nullptr);
if (!fd->read_closure->IsShutdown()) {
@@ -464,8 +463,8 @@ static void fd_has_errors(grpc_fd* fd) { fd->error_closure->SetReady(); }
* Pollset Definitions
*/
-GPR_TLS_DECL(g_current_thread_pollset);
-GPR_TLS_DECL(g_current_thread_worker);
+static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_pollset;
+static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker;
/* The designated poller */
static gpr_atm g_active_poller;
@@ -514,12 +513,10 @@ static size_t choose_neighborhood(void) {
return static_cast<size_t>(gpr_cpu_current_cpu()) % g_num_neighborhoods;
}
-static grpc_error* pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_pollset);
- gpr_tls_init(&g_current_thread_worker);
+static grpc_error_handle pollset_global_init(void) {
gpr_atm_no_barrier_store(&g_active_poller, 0);
global_wakeup_fd.read_fd = -1;
- grpc_error* err = grpc_wakeup_fd_init(&global_wakeup_fd);
+ grpc_error_handle err = grpc_wakeup_fd_init(&global_wakeup_fd);
if (err != GRPC_ERROR_NONE) return err;
struct epoll_event ev;
ev.events = static_cast<uint32_t>(EPOLLIN | EPOLLET);
@@ -528,7 +525,8 @@ static grpc_error* pollset_global_init(void) {
&ev) != 0) {
return GRPC_OS_ERROR(errno, "epoll_ctl");
}
- g_num_neighborhoods = GPR_CLAMP(gpr_cpu_num_cores(), 1, MAX_NEIGHBORHOODS);
+ g_num_neighborhoods =
+ grpc_core::Clamp(gpr_cpu_num_cores(), 1u, MAX_NEIGHBORHOODS);
g_neighborhoods = static_cast<pollset_neighborhood*>(
gpr_zalloc(sizeof(*g_neighborhoods) * g_num_neighborhoods));
for (size_t i = 0; i < g_num_neighborhoods; i++) {
@@ -538,8 +536,6 @@ static grpc_error* pollset_global_init(void) {
}
static void pollset_global_shutdown(void) {
- gpr_tls_destroy(&g_current_thread_pollset);
- gpr_tls_destroy(&g_current_thread_worker);
if (global_wakeup_fd.read_fd != -1) grpc_wakeup_fd_destroy(&global_wakeup_fd);
for (size_t i = 0; i < g_num_neighborhoods; i++) {
gpr_mu_destroy(&g_neighborhoods[i].mu);
@@ -589,9 +585,9 @@ static void pollset_destroy(grpc_pollset* pollset) {
gpr_mu_destroy(&pollset->mu);
}
-static grpc_error* pollset_kick_all(grpc_pollset* pollset) {
+static grpc_error_handle pollset_kick_all(grpc_pollset* pollset) {
GPR_TIMER_SCOPE("pollset_kick_all", 0);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (pollset->root_worker != nullptr) {
grpc_pollset_worker* worker = pollset->root_worker;
do {
@@ -663,11 +659,11 @@ static int poll_deadline_to_millis_timeout(grpc_millis millis) {
NOTE ON SYNCRHONIZATION: Similar to do_epoll_wait(), this function is only
called by g_active_poller thread. So there is no need for synchronization
when accessing fields in g_epoll_set */
-static grpc_error* process_epoll_events(grpc_pollset* /*pollset*/) {
+static grpc_error_handle process_epoll_events(grpc_pollset* /*pollset*/) {
GPR_TIMER_SCOPE("process_epoll_events", 0);
static const char* err_desc = "process_events";
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
long num_events = gpr_atm_acq_load(&g_epoll_set.num_events);
long cursor = gpr_atm_acq_load(&g_epoll_set.cursor);
for (int idx = 0;
@@ -715,7 +711,7 @@ static grpc_error* process_epoll_events(grpc_pollset* /*pollset*/) {
NOTE ON SYNCHRONIZATION: At any point of time, only the g_active_poller
(i.e the designated poller thread) will be calling this function. So there is
no need for any synchronization when accesing fields in g_epoll_set */
-static grpc_error* do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) {
+static grpc_error_handle do_epoll_wait(grpc_pollset* ps, grpc_millis deadline) {
GPR_TIMER_SCOPE("do_epoll_wait", 0);
int r;
@@ -1014,12 +1010,12 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
The function pollset_work() may temporarily release the lock (pollset->po.mu)
during the course of its execution but it will always re-acquire the lock and
ensure that it is held by the time the function returns */
-static grpc_error* pollset_work(grpc_pollset* ps,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* ps,
+ grpc_pollset_worker** worker_hdl,
+ grpc_millis deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
grpc_pollset_worker worker;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "pollset_work";
if (ps->kicked_without_poller) {
ps->kicked_without_poller = false;
@@ -1027,8 +1023,8 @@ static grpc_error* pollset_work(grpc_pollset* ps,
}
if (begin_worker(ps, &worker, worker_hdl, deadline)) {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)ps);
- gpr_tls_set(&g_current_thread_worker, (intptr_t)&worker);
+ g_current_thread_pollset = ps;
+ g_current_thread_worker = &worker;
GPR_ASSERT(!ps->shutting_down);
GPR_ASSERT(!ps->seen_inactive);
@@ -1055,28 +1051,27 @@ static grpc_error* pollset_work(grpc_pollset* ps,
gpr_mu_lock(&ps->mu); /* lock */
- gpr_tls_set(&g_current_thread_worker, 0);
+ g_current_thread_worker = nullptr;
} else {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)ps);
+ g_current_thread_pollset = ps;
}
end_worker(ps, &worker, worker_hdl);
- gpr_tls_set(&g_current_thread_pollset, 0);
+ g_current_thread_pollset = nullptr;
return error;
}
-static grpc_error* pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
GPR_TIMER_SCOPE("pollset_kick", 0);
GRPC_STATS_INC_POLLSET_KICK();
- grpc_error* ret_err = GRPC_ERROR_NONE;
+ grpc_error_handle ret_err = GRPC_ERROR_NONE;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
std::vector<TString> log;
log.push_back(y_absl::StrFormat(
"PS:%p KICK:%p curps=%p curworker=%p root=%p", pollset, specific_worker,
- reinterpret_cast<void*>(gpr_tls_get(&g_current_thread_pollset)),
- reinterpret_cast<void*>(gpr_tls_get(&g_current_thread_worker)),
- pollset->root_worker));
+ static_cast<void*>(g_current_thread_pollset),
+ static_cast<void*>(g_current_thread_worker), pollset->root_worker));
if (pollset->root_worker != nullptr) {
log.push_back(y_absl::StrFormat(
" {kick_state=%s next=%p {kick_state=%s}}",
@@ -1092,8 +1087,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset,
}
if (specific_worker == nullptr) {
- if (gpr_tls_get(&g_current_thread_pollset) !=
- reinterpret_cast<intptr_t>(pollset)) {
+ if (g_current_thread_pollset != pollset) {
grpc_pollset_worker* root_worker = pollset->root_worker;
if (root_worker == nullptr) {
GRPC_STATS_INC_POLLSET_KICKED_WITHOUT_POLLER();
@@ -1185,8 +1179,7 @@ static grpc_error* pollset_kick(grpc_pollset* pollset,
gpr_log(GPR_INFO, " .. specific worker already kicked");
}
goto done;
- } else if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ } else if (g_current_thread_worker == specific_worker) {
GRPC_STATS_INC_POLLSET_KICK_OWN_THREAD();
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, " .. mark %p kicked", specific_worker);
@@ -1260,7 +1253,7 @@ static bool is_any_background_poller_thread(void) { return false; }
static void shutdown_background_closure(void) {}
static bool add_closure_to_background_poller(grpc_closure* /*closure*/,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
index 5b94623d25c..28169d5fec8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -18,15 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/port.h"
+
/* This polling engine is only relevant on linux kernels supporting epoll() */
#ifdef GRPC_LINUX_EPOLL_CREATE1
-#include "src/core/lib/iomgr/ev_epollex_linux.h"
-
#include <assert.h>
#include <errno.h>
#include <limits.h>
@@ -54,6 +52,7 @@
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/block_annotate.h"
+#include "src/core/lib/iomgr/ev_epollex_linux.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/is_epollexclusive_available.h"
#include "src/core/lib/iomgr/lockfree_event.h"
@@ -134,7 +133,7 @@ static TString pollable_desc(pollable* p) {
/// added
static pollable* g_empty_pollable;
-static grpc_error* pollable_create(pollable_type type, pollable** p);
+static grpc_error_handle pollable_create(pollable_type type, pollable** p);
static pollable* pollable_ref(pollable* p,
const grpc_core::DebugLocation& dbg_loc,
const char* reason) {
@@ -314,7 +313,7 @@ struct grpc_pollset_set {
* Common helpers
*/
-static bool append_error(grpc_error** composite, grpc_error* error,
+static bool append_error(grpc_error_handle* composite, grpc_error_handle error,
const char* desc) {
if (error == GRPC_ERROR_NONE) return true;
if (*composite == GRPC_ERROR_NONE) {
@@ -372,7 +371,7 @@ static void ref_by(grpc_fd* fd, int n) {
}
/* Uninitialize and add to the freelist */
-static void fd_destroy(void* arg, grpc_error* /*error*/) {
+static void fd_destroy(void* arg, grpc_error_handle /*error*/) {
grpc_fd* fd = static_cast<grpc_fd*>(arg);
fd->destroy();
@@ -509,7 +508,7 @@ static bool fd_is_shutdown(grpc_fd* fd) {
}
/* Might be called multiple times */
-static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
+static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
if (fd->read_closure.SetShutdown(GRPC_ERROR_REF(why))) {
if (shutdown(fd->fd, SHUT_RDWR)) {
if (errno != ENOTCONN) {
@@ -556,7 +555,7 @@ static void fd_add_pollset(grpc_fd* fd, grpc_pollset* pollset) {
* Pollable Definitions
*/
-static grpc_error* pollable_create(pollable_type type, pollable** p) {
+static grpc_error_handle pollable_create(pollable_type type, pollable** p) {
*p = nullptr;
int epfd = epoll_create1(EPOLL_CLOEXEC);
@@ -565,7 +564,7 @@ static grpc_error* pollable_create(pollable_type type, pollable** p) {
}
GRPC_FD_TRACE("Pollable_create: created epfd: %d (type: %d)", epfd, type);
*p = static_cast<pollable*>(gpr_malloc(sizeof(**p)));
- grpc_error* err = grpc_wakeup_fd_init(&(*p)->wakeup);
+ grpc_error_handle err = grpc_wakeup_fd_init(&(*p)->wakeup);
if (err != GRPC_ERROR_NONE) {
GRPC_FD_TRACE(
"Pollable_create: closed epfd: %d (type: %d). wakeupfd_init error",
@@ -609,8 +608,8 @@ static grpc_error* pollable_create(pollable_type type, pollable** p) {
return GRPC_ERROR_NONE;
}
-static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
- grpc_error* error = GRPC_ERROR_NONE;
+static grpc_error_handle pollable_add_fd(pollable* p, grpc_fd* fd) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "pollable_add_fd";
const int epfd = p->epfd;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
@@ -643,20 +642,16 @@ static grpc_error* pollable_add_fd(pollable* p, grpc_fd* fd) {
* Pollset Definitions
*/
-GPR_TLS_DECL(g_current_thread_pollset);
-GPR_TLS_DECL(g_current_thread_worker);
+static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_pollset;
+static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker;
/* Global state management */
-static grpc_error* pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_pollset);
- gpr_tls_init(&g_current_thread_worker);
+static grpc_error_handle pollset_global_init(void) {
return pollable_create(PO_EMPTY, &g_empty_pollable);
}
static void pollset_global_shutdown(void) {
POLLABLE_UNREF(g_empty_pollable, "g_empty_pollable");
- gpr_tls_destroy(&g_current_thread_pollset);
- gpr_tls_destroy(&g_current_thread_worker);
}
/* pollset->mu must be held while calling this function */
@@ -681,7 +676,7 @@ static void pollset_maybe_finish_shutdown(grpc_pollset* pollset) {
/* pollset->mu must be held before calling this function,
* pollset->active_pollable->mu & specific_worker->pollable_obj->mu must not be
* held */
-static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) {
+static grpc_error_handle kick_one_worker(grpc_pollset_worker* specific_worker) {
GPR_TIMER_SCOPE("kick_one_worker", 0);
pollable* p = specific_worker->pollable_obj;
grpc_core::MutexLockForGprMu lock(&p->mu);
@@ -693,8 +688,7 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) {
GRPC_STATS_INC_POLLSET_KICKED_AGAIN();
return GRPC_ERROR_NONE;
}
- if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ if (g_current_thread_worker == specific_worker) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PS:%p kicked_specific_but_awake", p);
}
@@ -708,7 +702,7 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) {
gpr_log(GPR_INFO, "PS:%p kicked_specific_via_wakeup_fd", p);
}
specific_worker->kicked = true;
- grpc_error* error = grpc_wakeup_fd_wakeup(&p->wakeup);
+ grpc_error_handle error = grpc_wakeup_fd_wakeup(&p->wakeup);
return error;
}
if (specific_worker->initialized_cv) {
@@ -725,20 +719,19 @@ static grpc_error* kick_one_worker(grpc_pollset_worker* specific_worker) {
return GRPC_ERROR_NONE;
}
-static grpc_error* pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
GPR_TIMER_SCOPE("pollset_kick", 0);
GRPC_STATS_INC_POLLSET_KICK();
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO,
- "PS:%p kick %p tls_pollset=%" PRIxPTR " tls_worker=%" PRIxPTR
- " pollset.root_worker=%p",
- pollset, specific_worker, gpr_tls_get(&g_current_thread_pollset),
- gpr_tls_get(&g_current_thread_worker), pollset->root_worker);
+ "PS:%p kick %p tls_pollset=%p tls_worker=%p pollset.root_worker=%p",
+ pollset, specific_worker,
+ static_cast<void*>(g_current_thread_pollset),
+ static_cast<void*>(g_current_thread_worker), pollset->root_worker);
}
if (specific_worker == nullptr) {
- if (gpr_tls_get(&g_current_thread_pollset) !=
- reinterpret_cast<intptr_t>(pollset)) {
+ if (g_current_thread_pollset != pollset) {
if (pollset->root_worker == nullptr) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PS:%p kicked_any_without_poller", pollset);
@@ -777,9 +770,9 @@ static grpc_error* pollset_kick(grpc_pollset* pollset,
}
}
-static grpc_error* pollset_kick_all(grpc_pollset* pollset) {
+static grpc_error_handle pollset_kick_all(grpc_pollset* pollset) {
GPR_TIMER_SCOPE("pollset_kick_all", 0);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
const char* err_desc = "pollset_kick_all";
grpc_pollset_worker* w = pollset->root_worker;
if (w != nullptr) {
@@ -828,9 +821,9 @@ static void fd_has_errors(grpc_fd* fd) { fd->error_closure.SetReady(); }
*
* Note that if a pollable object is already attached to the fd, it may be of
* either PO_FD or PO_MULTI type */
-static grpc_error* get_fd_pollable(grpc_fd* fd, pollable** p) {
+static grpc_error_handle get_fd_pollable(grpc_fd* fd, pollable** p) {
gpr_mu_lock(&fd->pollable_mu);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "get_fd_pollable";
if (fd->pollable_obj == nullptr) {
if (append_error(&error, pollable_create(PO_FD, &fd->pollable_obj),
@@ -863,8 +856,9 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
pollset_maybe_finish_shutdown(pollset);
}
-static grpc_error* pollable_process_events(grpc_pollset* pollset,
- pollable* pollable_obj, bool drain) {
+static grpc_error_handle pollable_process_events(grpc_pollset* pollset,
+ pollable* pollable_obj,
+ bool drain) {
GPR_TIMER_SCOPE("pollable_process_events", 0);
static const char* err_desc = "pollset_process_events";
// Use a simple heuristic to determine how many fd events to process
@@ -877,7 +871,7 @@ static grpc_error* pollable_process_events(grpc_pollset* pollset,
if (handle_count == 0) {
handle_count = 1;
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
for (int i = 0; (drain || i < handle_count) &&
pollable_obj->event_cursor != pollable_obj->event_count;
i++) {
@@ -932,7 +926,7 @@ static void pollset_destroy(grpc_pollset* pollset) {
gpr_mu_destroy(&pollset->mu);
}
-static grpc_error* pollable_epoll(pollable* p, grpc_millis deadline) {
+static grpc_error_handle pollable_epoll(pollable* p, grpc_millis deadline) {
GPR_TIMER_SCOPE("pollable_epoll", 0);
int timeout = poll_deadline_to_millis_timeout(deadline);
@@ -1077,7 +1071,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
case WRR_EMPTIED:
if (pollset->active_pollable != worker->pollable_obj) {
// pollable no longer being polled: flush events
- pollable_process_events(pollset, worker->pollable_obj, true);
+ (void)pollable_process_events(pollset, worker->pollable_obj, true);
}
break;
case WRR_REMOVED:
@@ -1103,9 +1097,9 @@ static long sys_gettid(void) { return syscall(__NR_gettid); }
The function pollset_work() may temporarily release the lock (pollset->po.mu)
during the course of its execution but it will always re-acquire the lock and
ensure that it is held by the time the function returns */
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker_hdl,
+ grpc_millis deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
#ifdef GRPC_EPOLLEX_CREATE_WORKERS_ON_HEAP
grpc_pollset_worker* worker =
@@ -1126,13 +1120,13 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
deadline, pollset->kicked_without_poller, pollset->active_pollable);
}
static const char* err_desc = "pollset_work";
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (pollset->kicked_without_poller) {
pollset->kicked_without_poller = false;
} else {
if (begin_worker(pollset, WORKER_PTR, worker_hdl, deadline)) {
- gpr_tls_set(&g_current_thread_pollset, (intptr_t)pollset);
- gpr_tls_set(&g_current_thread_worker, (intptr_t)WORKER_PTR);
+ g_current_thread_pollset = pollset;
+ g_current_thread_worker = WORKER_PTR;
if (WORKER_PTR->pollable_obj->event_cursor ==
WORKER_PTR->pollable_obj->event_count) {
append_error(&error, pollable_epoll(WORKER_PTR->pollable_obj, deadline),
@@ -1143,8 +1137,8 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
pollable_process_events(pollset, WORKER_PTR->pollable_obj, false),
err_desc);
grpc_core::ExecCtx::Get()->Flush();
- gpr_tls_set(&g_current_thread_pollset, 0);
- gpr_tls_set(&g_current_thread_worker, 0);
+ g_current_thread_pollset = nullptr;
+ g_current_thread_worker = nullptr;
}
end_worker(pollset, WORKER_PTR, worker_hdl);
}
@@ -1155,10 +1149,10 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
return error;
}
-static grpc_error* pollset_transition_pollable_from_empty_to_fd_locked(
+static grpc_error_handle pollset_transition_pollable_from_empty_to_fd_locked(
grpc_pollset* pollset, grpc_fd* fd) {
static const char* err_desc = "pollset_transition_pollable_from_empty_to_fd";
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO,
"PS:%p add fd %p (%d); transition pollable from empty to fd",
@@ -1171,10 +1165,10 @@ static grpc_error* pollset_transition_pollable_from_empty_to_fd_locked(
return error;
}
-static grpc_error* pollset_transition_pollable_from_fd_to_multi_locked(
+static grpc_error_handle pollset_transition_pollable_from_fd_to_multi_locked(
grpc_pollset* pollset, grpc_fd* and_add_fd) {
static const char* err_desc = "pollset_transition_pollable_from_fd_to_multi";
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(
GPR_INFO,
@@ -1200,8 +1194,9 @@ static grpc_error* pollset_transition_pollable_from_fd_to_multi_locked(
}
/* expects pollsets locked, flag whether fd is locked or not */
-static grpc_error* pollset_add_fd_locked(grpc_pollset* pollset, grpc_fd* fd) {
- grpc_error* error = GRPC_ERROR_NONE;
+static grpc_error_handle pollset_add_fd_locked(grpc_pollset* pollset,
+ grpc_fd* fd) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
pollable* po_at_start =
POLLABLE_REF(pollset->active_pollable, "pollset_add_fd");
switch (pollset->active_pollable->type) {
@@ -1236,9 +1231,9 @@ static grpc_error* pollset_add_fd_locked(grpc_pollset* pollset, grpc_fd* fd) {
return error;
}
-static grpc_error* pollset_as_multipollable_locked(grpc_pollset* pollset,
- pollable** pollable_obj) {
- grpc_error* error = GRPC_ERROR_NONE;
+static grpc_error_handle pollset_as_multipollable_locked(
+ grpc_pollset* pollset, pollable** pollable_obj) {
+ grpc_error_handle error = GRPC_ERROR_NONE;
pollable* po_at_start =
POLLABLE_REF(pollset->active_pollable, "pollset_as_multipollable");
switch (pollset->active_pollable->type) {
@@ -1297,7 +1292,7 @@ static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {
}
grpc_core::MutexLockForGprMu lock(&pollset->mu);
- grpc_error* error = pollset_add_fd_locked(pollset, fd);
+ grpc_error_handle error = pollset_add_fd_locked(pollset, fd);
// If we are in PO_MULTI mode, we should update the pollsets of the FD.
if (gpr_atm_no_barrier_load(&pollset->active_pollable_type) == PO_MULTI) {
@@ -1354,7 +1349,7 @@ static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PSS:%p: add fd %p (%d)", pss, fd, fd->fd);
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "pollset_set_add_fd";
pss = pss_lock_adam(pss);
for (size_t i = 0; i < pss->pollset_count; i++) {
@@ -1362,7 +1357,7 @@ static void pollset_set_add_fd(grpc_pollset_set* pss, grpc_fd* fd) {
err_desc);
}
if (pss->fd_count == pss->fd_capacity) {
- pss->fd_capacity = GPR_MAX(pss->fd_capacity * 2, 8);
+ pss->fd_capacity = std::max(pss->fd_capacity * 2, size_t(8));
pss->fds = static_cast<grpc_fd**>(
gpr_realloc(pss->fds, pss->fd_capacity * sizeof(*pss->fds)));
}
@@ -1421,13 +1416,14 @@ static void pollset_set_del_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {
// add all fds to pollables, and output a new array of unorphaned out_fds
// assumes pollsets are multipollable
-static grpc_error* add_fds_to_pollsets(grpc_fd** fds, size_t fd_count,
- grpc_pollset** pollsets,
- size_t pollset_count,
- const char* err_desc, grpc_fd** out_fds,
- size_t* out_fd_count) {
+static grpc_error_handle add_fds_to_pollsets(grpc_fd** fds, size_t fd_count,
+ grpc_pollset** pollsets,
+ size_t pollset_count,
+ const char* err_desc,
+ grpc_fd** out_fds,
+ size_t* out_fd_count) {
GPR_TIMER_SCOPE("add_fds_to_pollsets", 0);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
for (size_t i = 0; i < fd_count; i++) {
gpr_mu_lock(&fds[i]->orphan_mu);
if ((gpr_atm_no_barrier_load(&fds[i]->refst) & 1) == 0) {
@@ -1451,7 +1447,7 @@ static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PSS:%p: add pollset %p", pss, ps);
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "pollset_set_add_pollset";
pollable* pollable_obj = nullptr;
gpr_mu_lock(&ps->mu);
@@ -1471,7 +1467,7 @@ static void pollset_set_add_pollset(grpc_pollset_set* pss, grpc_pollset* ps) {
pss->fds, &pss->fd_count),
err_desc);
if (pss->pollset_count == pss->pollset_capacity) {
- pss->pollset_capacity = GPR_MAX(pss->pollset_capacity * 2, 8);
+ pss->pollset_capacity = std::max(pss->pollset_capacity * 2, size_t(8));
pss->pollsets = static_cast<grpc_pollset**>(gpr_realloc(
pss->pollsets, pss->pollset_capacity * sizeof(*pss->pollsets)));
}
@@ -1488,7 +1484,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a,
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PSS: merge (%p, %p)", a, b);
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
static const char* err_desc = "pollset_set_add_fd";
for (;;) {
if (a == b) {
@@ -1496,7 +1492,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a,
return;
}
if (a > b) {
- GPR_SWAP(grpc_pollset_set*, a, b);
+ std::swap(a, b);
}
gpr_mu* a_mu = &a->mu;
gpr_mu* b_mu = &b->mu;
@@ -1517,7 +1513,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a,
const size_t a_size = a->fd_count + a->pollset_count;
const size_t b_size = b->fd_count + b->pollset_count;
if (b_size > a_size) {
- GPR_SWAP(grpc_pollset_set*, a, b);
+ std::swap(a, b);
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO, "PSS: parent %p to %p", b, a);
@@ -1525,7 +1521,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a,
a->refs.Ref();
b->parent = a;
if (a->fd_capacity < a->fd_count + b->fd_count) {
- a->fd_capacity = GPR_MAX(2 * a->fd_capacity, a->fd_count + b->fd_count);
+ a->fd_capacity = std::max(2 * a->fd_capacity, a->fd_count + b->fd_count);
a->fds = static_cast<grpc_fd**>(
gpr_realloc(a->fds, a->fd_capacity * sizeof(*a->fds)));
}
@@ -1543,7 +1539,7 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* a,
err_desc);
if (a->pollset_capacity < a->pollset_count + b->pollset_count) {
a->pollset_capacity =
- GPR_MAX(2 * a->pollset_capacity, a->pollset_count + b->pollset_count);
+ std::max(2 * a->pollset_capacity, a->pollset_count + b->pollset_count);
a->pollsets = static_cast<grpc_pollset**>(
gpr_realloc(a->pollsets, a->pollset_capacity * sizeof(*a->pollsets)));
}
@@ -1573,7 +1569,7 @@ static bool is_any_background_poller_thread(void) { return false; }
static void shutdown_background_closure(void) {}
static bool add_closure_to_background_poller(grpc_closure* /*closure*/,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
index c83d3d09bc0..03d15d30bd5 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_poll_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_EV_POLL
-#include "src/core/lib/iomgr/ev_poll_posix.h"
-
#include <assert.h>
#include <errno.h>
#include <limits.h>
@@ -45,6 +43,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/block_annotate.h"
+#include "src/core/lib/iomgr/ev_poll_posix.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include "src/core/lib/profiling/timers.h"
@@ -89,7 +88,7 @@ struct grpc_fd {
int closed;
int released;
gpr_atm pollhup;
- grpc_error* shutdown_error;
+ grpc_error_handle shutdown_error;
/* The watcher list.
@@ -230,9 +229,9 @@ static int poll_deadline_to_millis_timeout(grpc_millis deadline);
#define GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP 2
/* As per pollset_kick, with an extended set of flags (defined above)
-- mostly for fd_posix's use. */
-static grpc_error* pollset_kick_ext(grpc_pollset* p,
- grpc_pollset_worker* specific_worker,
- uint32_t flags) GRPC_MUST_USE_RESULT;
+static grpc_error_handle pollset_kick_ext(grpc_pollset* p,
+ grpc_pollset_worker* specific_worker,
+ uint32_t flags) GRPC_MUST_USE_RESULT;
/* Return 1 if the pollset has active threads in pollset_work (pollset must
* be locked) */
@@ -358,7 +357,12 @@ static void unref_by(grpc_fd* fd, int n) {
gpr_mu_destroy(&fd->mu);
grpc_iomgr_unregister_object(&fd->iomgr_object);
fork_fd_list_remove_node(fd->fork_fd_list);
- if (fd->shutdown) GRPC_ERROR_UNREF(fd->shutdown_error);
+ if (fd->shutdown) {
+ GRPC_ERROR_UNREF(fd->shutdown_error);
+ }
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ fd->shutdown_error.~Status();
+#endif
gpr_free(fd);
} else {
GPR_ASSERT(old > n);
@@ -373,6 +377,9 @@ static grpc_fd* fd_create(int fd, const char* name, bool track_err) {
gpr_mu_init(&r->mu);
gpr_atm_rel_store(&r->refst, 1);
r->shutdown = 0;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ new (&r->shutdown_error) y_absl::Status();
+#endif
r->read_closure = CLOSURE_NOT_READY;
r->write_closure = CLOSURE_NOT_READY;
r->fd = fd;
@@ -394,22 +401,23 @@ static bool fd_is_orphaned(grpc_fd* fd) {
return (gpr_atm_acq_load(&fd->refst) & 1) == 0;
}
-static grpc_error* pollset_kick_locked(grpc_fd_watcher* watcher) {
+static grpc_error_handle pollset_kick_locked(grpc_fd_watcher* watcher) {
gpr_mu_lock(&watcher->pollset->mu);
GPR_ASSERT(watcher->worker);
- grpc_error* err = pollset_kick_ext(watcher->pollset, watcher->worker,
- GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
+ grpc_error_handle err =
+ pollset_kick_ext(watcher->pollset, watcher->worker,
+ GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP);
gpr_mu_unlock(&watcher->pollset->mu);
return err;
}
static void maybe_wake_one_watcher_locked(grpc_fd* fd) {
if (fd->inactive_watcher_root.next != &fd->inactive_watcher_root) {
- pollset_kick_locked(fd->inactive_watcher_root.next);
+ (void)pollset_kick_locked(fd->inactive_watcher_root.next);
} else if (fd->read_watcher) {
- pollset_kick_locked(fd->read_watcher);
+ (void)pollset_kick_locked(fd->read_watcher);
} else if (fd->write_watcher) {
- pollset_kick_locked(fd->write_watcher);
+ (void)pollset_kick_locked(fd->write_watcher);
}
}
@@ -417,13 +425,13 @@ static void wake_all_watchers_locked(grpc_fd* fd) {
grpc_fd_watcher* watcher;
for (watcher = fd->inactive_watcher_root.next;
watcher != &fd->inactive_watcher_root; watcher = watcher->next) {
- pollset_kick_locked(watcher);
+ (void)pollset_kick_locked(watcher);
}
if (fd->read_watcher) {
- pollset_kick_locked(fd->read_watcher);
+ (void)pollset_kick_locked(fd->read_watcher);
}
if (fd->write_watcher && fd->write_watcher != fd->read_watcher) {
- pollset_kick_locked(fd->write_watcher);
+ (void)pollset_kick_locked(fd->write_watcher);
}
}
@@ -484,7 +492,7 @@ static void fd_ref(grpc_fd* fd) { ref_by(fd, 2); }
static void fd_unref(grpc_fd* fd) { unref_by(fd, 2); }
#endif
-static grpc_error* fd_shutdown_error(grpc_fd* fd) {
+static grpc_error_handle fd_shutdown_error(grpc_fd* fd) {
if (!fd->shutdown) {
return GRPC_ERROR_NONE;
} else {
@@ -537,7 +545,7 @@ static int set_ready_locked(grpc_fd* fd, grpc_closure** st) {
}
}
-static void fd_shutdown(grpc_fd* fd, grpc_error* why) {
+static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
gpr_mu_lock(&fd->mu);
/* only shutdown once */
if (!fd->shutdown) {
@@ -705,8 +713,8 @@ static void fd_end_poll(grpc_fd_watcher* watcher, int got_read, int got_write) {
* pollset_posix.c
*/
-GPR_TLS_DECL(g_current_thread_poller);
-GPR_TLS_DECL(g_current_thread_worker);
+static GPR_THREAD_LOCAL(grpc_pollset*) g_current_thread_poller;
+static GPR_THREAD_LOCAL(grpc_pollset_worker*) g_current_thread_worker;
static void remove_worker(grpc_pollset* /*p*/, grpc_pollset_worker* worker) {
worker->prev->next = worker->next;
@@ -747,7 +755,8 @@ static void push_front_worker(grpc_pollset* p, grpc_pollset_worker* worker) {
worker->prev->next = worker->next->prev = worker;
}
-static void kick_append_error(grpc_error** composite, grpc_error* error) {
+static void kick_append_error(grpc_error_handle* composite,
+ grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) return;
if (*composite == GRPC_ERROR_NONE) {
*composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Kick Failure");
@@ -755,11 +764,11 @@ static void kick_append_error(grpc_error** composite, grpc_error* error) {
*composite = grpc_error_add_child(*composite, error);
}
-static grpc_error* pollset_kick_ext(grpc_pollset* p,
- grpc_pollset_worker* specific_worker,
- uint32_t flags) {
+static grpc_error_handle pollset_kick_ext(grpc_pollset* p,
+ grpc_pollset_worker* specific_worker,
+ uint32_t flags) {
GPR_TIMER_SCOPE("pollset_kick_ext", 0);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
GRPC_STATS_INC_POLLSET_KICK();
/* pollset->mu already held */
@@ -774,8 +783,7 @@ static grpc_error* pollset_kick_ext(grpc_pollset* p,
&error, grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd));
}
p->kicked_without_pollers = true;
- } else if (gpr_tls_get(&g_current_thread_worker) !=
- reinterpret_cast<intptr_t>(specific_worker)) {
+ } else if (g_current_thread_worker != specific_worker) {
GPR_TIMER_MARK("different_thread_worker", 0);
if ((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) != 0) {
specific_worker->reevaluate_polling_on_wakeup = true;
@@ -792,20 +800,17 @@ static grpc_error* pollset_kick_ext(grpc_pollset* p,
kick_append_error(&error,
grpc_wakeup_fd_wakeup(&specific_worker->wakeup_fd->fd));
}
- } else if (gpr_tls_get(&g_current_thread_poller) !=
- reinterpret_cast<intptr_t>(p)) {
+ } else if (g_current_thread_poller != p) {
GPR_ASSERT((flags & GRPC_POLLSET_REEVALUATE_POLLING_ON_WAKEUP) == 0);
GPR_TIMER_MARK("kick_anonymous", 0);
specific_worker = pop_front_worker(p);
if (specific_worker != nullptr) {
- if (gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ if (g_current_thread_worker == specific_worker) {
GPR_TIMER_MARK("kick_anonymous_not_self", 0);
push_back_worker(p, specific_worker);
specific_worker = pop_front_worker(p);
if ((flags & GRPC_POLLSET_CAN_KICK_SELF) == 0 &&
- gpr_tls_get(&g_current_thread_worker) ==
- reinterpret_cast<intptr_t>(specific_worker)) {
+ g_current_thread_worker == specific_worker) {
push_back_worker(p, specific_worker);
specific_worker = nullptr;
}
@@ -826,23 +831,16 @@ static grpc_error* pollset_kick_ext(grpc_pollset* p,
return error;
}
-static grpc_error* pollset_kick(grpc_pollset* p,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* p,
+ grpc_pollset_worker* specific_worker) {
return pollset_kick_ext(p, specific_worker, 0);
}
/* global state management */
-static grpc_error* pollset_global_init(void) {
- gpr_tls_init(&g_current_thread_poller);
- gpr_tls_init(&g_current_thread_worker);
- return GRPC_ERROR_NONE;
-}
+static grpc_error_handle pollset_global_init(void) { return GRPC_ERROR_NONE; }
-static void pollset_global_shutdown(void) {
- gpr_tls_destroy(&g_current_thread_poller);
- gpr_tls_destroy(&g_current_thread_worker);
-}
+static void pollset_global_shutdown(void) {}
/* main interface */
@@ -883,13 +881,13 @@ static void pollset_add_fd(grpc_pollset* pollset, grpc_fd* fd) {
}
if (pollset->fd_count == pollset->fd_capacity) {
pollset->fd_capacity =
- GPR_MAX(pollset->fd_capacity + 8, pollset->fd_count * 3 / 2);
+ std::max(pollset->fd_capacity + 8, pollset->fd_count * 3 / 2);
pollset->fds = static_cast<grpc_fd**>(
gpr_realloc(pollset->fds, sizeof(grpc_fd*) * pollset->fd_capacity));
}
pollset->fds[pollset->fd_count++] = fd;
GRPC_FD_REF(fd, "multipoller");
- pollset_kick(pollset, nullptr);
+ (void)pollset_kick(pollset, nullptr);
exit:
gpr_mu_unlock(&pollset->mu);
}
@@ -904,7 +902,8 @@ static void finish_shutdown(grpc_pollset* pollset) {
GRPC_ERROR_NONE);
}
-static void work_combine_error(grpc_error** composite, grpc_error* error) {
+static void work_combine_error(grpc_error_handle* composite,
+ grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) return;
if (*composite == GRPC_ERROR_NONE) {
*composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("pollset_work");
@@ -912,13 +911,13 @@ static void work_combine_error(grpc_error** composite, grpc_error* error) {
*composite = grpc_error_add_child(*composite, error);
}
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker_hdl,
+ grpc_millis deadline) {
GPR_TIMER_SCOPE("pollset_work", 0);
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
/* Avoid malloc for small number of elements. */
enum { inline_elements = 96 };
@@ -956,7 +955,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
re-evaluate our pollers (this allows poll() based pollers to
ensure they don't miss wakeups) */
keep_polling = 1;
- gpr_tls_set(&g_current_thread_poller, (intptr_t)pollset);
+ g_current_thread_poller = pollset;
while (keep_polling) {
keep_polling = 0;
if (!pollset->kicked_without_pollers ||
@@ -964,7 +963,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
if (!added_worker) {
push_front_worker(pollset, &worker);
added_worker = 1;
- gpr_tls_set(&g_current_thread_worker, (intptr_t)&worker);
+ g_current_thread_worker = &worker;
}
GPR_TIMER_SCOPE("maybe_work_and_unlock", 0);
#define POLLOUT_CHECK (POLLOUT | POLLHUP | POLLERR)
@@ -1112,10 +1111,10 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
keep_polling = 1;
}
}
- gpr_tls_set(&g_current_thread_poller, 0);
+ g_current_thread_poller = nullptr;
if (added_worker) {
remove_worker(pollset, &worker);
- gpr_tls_set(&g_current_thread_worker, 0);
+ g_current_thread_worker = nullptr;
}
/* release wakeup fd to the local pool */
worker.wakeup_fd->next = pollset->local_wakeup_cache;
@@ -1123,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
/* check shutdown conditions */
if (pollset->shutting_down) {
if (pollset_has_workers(pollset)) {
- pollset_kick(pollset, nullptr);
+ (void)pollset_kick(pollset, nullptr);
} else if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
pollset->called_shutdown = 1;
gpr_mu_unlock(&pollset->mu);
@@ -1145,7 +1144,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
GPR_ASSERT(!pollset->shutting_down);
pollset->shutting_down = 1;
pollset->shutdown_done = closure;
- pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
+ (void)pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
if (!pollset->called_shutdown && !pollset_has_observers(pollset)) {
pollset->called_shutdown = 1;
finish_shutdown(pollset);
@@ -1207,7 +1206,7 @@ static void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
gpr_mu_lock(&pollset_set->mu);
if (pollset_set->pollset_count == pollset_set->pollset_capacity) {
pollset_set->pollset_capacity =
- GPR_MAX(8, 2 * pollset_set->pollset_capacity);
+ std::max(size_t(8), 2 * pollset_set->pollset_capacity);
pollset_set->pollsets = static_cast<grpc_pollset**>(gpr_realloc(
pollset_set->pollsets,
pollset_set->pollset_capacity * sizeof(*pollset_set->pollsets)));
@@ -1232,8 +1231,8 @@ static void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
for (i = 0; i < pollset_set->pollset_count; i++) {
if (pollset_set->pollsets[i] == pollset) {
pollset_set->pollset_count--;
- GPR_SWAP(grpc_pollset*, pollset_set->pollsets[i],
- pollset_set->pollsets[pollset_set->pollset_count]);
+ std::swap(pollset_set->pollsets[i],
+ pollset_set->pollsets[pollset_set->pollset_count]);
break;
}
}
@@ -1256,7 +1255,8 @@ static void pollset_set_add_pollset_set(grpc_pollset_set* bag,
size_t i, j;
gpr_mu_lock(&bag->mu);
if (bag->pollset_set_count == bag->pollset_set_capacity) {
- bag->pollset_set_capacity = GPR_MAX(8, 2 * bag->pollset_set_capacity);
+ bag->pollset_set_capacity =
+ std::max(size_t(8), 2 * bag->pollset_set_capacity);
bag->pollset_sets = static_cast<grpc_pollset_set**>(
gpr_realloc(bag->pollset_sets,
bag->pollset_set_capacity * sizeof(*bag->pollset_sets)));
@@ -1281,8 +1281,8 @@ static void pollset_set_del_pollset_set(grpc_pollset_set* bag,
for (i = 0; i < bag->pollset_set_count; i++) {
if (bag->pollset_sets[i] == item) {
bag->pollset_set_count--;
- GPR_SWAP(grpc_pollset_set*, bag->pollset_sets[i],
- bag->pollset_sets[bag->pollset_set_count]);
+ std::swap(bag->pollset_sets[i],
+ bag->pollset_sets[bag->pollset_set_count]);
break;
}
}
@@ -1293,7 +1293,8 @@ static void pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
size_t i;
gpr_mu_lock(&pollset_set->mu);
if (pollset_set->fd_count == pollset_set->fd_capacity) {
- pollset_set->fd_capacity = GPR_MAX(8, 2 * pollset_set->fd_capacity);
+ pollset_set->fd_capacity =
+ std::max(size_t(8), 2 * pollset_set->fd_capacity);
pollset_set->fds = static_cast<grpc_fd**>(
gpr_realloc(pollset_set->fds,
pollset_set->fd_capacity * sizeof(*pollset_set->fds)));
@@ -1315,8 +1316,7 @@ static void pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd) {
for (i = 0; i < pollset_set->fd_count; i++) {
if (pollset_set->fds[i] == fd) {
pollset_set->fd_count--;
- GPR_SWAP(grpc_fd*, pollset_set->fds[i],
- pollset_set->fds[pollset_set->fd_count]);
+ std::swap(pollset_set->fds[i], pollset_set->fds[pollset_set->fd_count]);
GRPC_FD_UNREF(fd, "pollset_set");
break;
}
@@ -1336,7 +1336,7 @@ static bool is_any_background_poller_thread(void) { return false; }
static void shutdown_background_closure(void) {}
static bool add_closure_to_background_poller(grpc_closure* /*closure*/,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc
index 07aeb7f2478..bae0f15ce03 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_EV
-#include "src/core/lib/iomgr/ev_posix.h"
-
#include <string.h>
#include <grpc/support/alloc.h>
@@ -36,6 +34,7 @@
#include "src/core/lib/iomgr/ev_epoll1_linux.h"
#include "src/core/lib/iomgr/ev_epollex_linux.h"
#include "src/core/lib/iomgr/ev_poll_posix.h"
+#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/internal_errqueue.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(
@@ -270,7 +269,7 @@ void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
g_event_engine->fd_orphan(fd, on_done, release_fd, reason);
}
-void grpc_fd_shutdown(grpc_fd* fd, grpc_error* why) {
+void grpc_fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
GRPC_POLLING_API_TRACE("fd_shutdown(%d)", grpc_fd_wrapped_fd(fd));
GRPC_FD_TRACE("fd_shutdown(%d)", grpc_fd_wrapped_fd(fd));
g_event_engine->fd_shutdown(fd, why);
@@ -315,19 +314,20 @@ static void pollset_destroy(grpc_pollset* pollset) {
g_event_engine->pollset_destroy(pollset);
}
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
GRPC_POLLING_API_TRACE("pollset_work(%p, %" PRId64 ") begin", pollset,
deadline);
- grpc_error* err = g_event_engine->pollset_work(pollset, worker, deadline);
+ grpc_error_handle err =
+ g_event_engine->pollset_work(pollset, worker, deadline);
GRPC_POLLING_API_TRACE("pollset_work(%p, %" PRId64 ") end", pollset,
deadline);
return err;
}
-static grpc_error* pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
GRPC_POLLING_API_TRACE("pollset_kick(%p, %p)", pollset, specific_worker);
return g_event_engine->pollset_kick(pollset, specific_worker);
}
@@ -406,7 +406,7 @@ bool grpc_is_any_background_poller_thread(void) {
}
bool grpc_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error) {
+ grpc_error_handle error) {
return g_event_engine->add_closure_to_background_poller(closure, error);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.h
index 84edabce71e..479921ae169 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/ev_posix.h
@@ -52,7 +52,7 @@ typedef struct grpc_event_engine_vtable {
int (*fd_wrapped_fd)(grpc_fd* fd);
void (*fd_orphan)(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
const char* reason);
- void (*fd_shutdown)(grpc_fd* fd, grpc_error* why);
+ void (*fd_shutdown)(grpc_fd* fd, grpc_error_handle why);
void (*fd_notify_on_read)(grpc_fd* fd, grpc_closure* closure);
void (*fd_notify_on_write)(grpc_fd* fd, grpc_closure* closure);
void (*fd_notify_on_error)(grpc_fd* fd, grpc_closure* closure);
@@ -64,11 +64,11 @@ typedef struct grpc_event_engine_vtable {
void (*pollset_init)(grpc_pollset* pollset, gpr_mu** mu);
void (*pollset_shutdown)(grpc_pollset* pollset, grpc_closure* closure);
void (*pollset_destroy)(grpc_pollset* pollset);
- grpc_error* (*pollset_work)(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline);
- grpc_error* (*pollset_kick)(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker);
+ grpc_error_handle (*pollset_work)(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline);
+ grpc_error_handle (*pollset_kick)(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker);
void (*pollset_add_fd)(grpc_pollset* pollset, struct grpc_fd* fd);
grpc_pollset_set* (*pollset_set_create)(void);
@@ -88,7 +88,7 @@ typedef struct grpc_event_engine_vtable {
void (*shutdown_background_closure)(void);
void (*shutdown_engine)(void);
bool (*add_closure_to_background_poller)(grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
} grpc_event_engine_vtable;
/* register a new event engine factory */
@@ -139,7 +139,7 @@ void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
bool grpc_fd_is_shutdown(grpc_fd* fd);
/* Cause any current and future callbacks to fail. */
-void grpc_fd_shutdown(grpc_fd* fd, grpc_error* why);
+void grpc_fd_shutdown(grpc_fd* fd, grpc_error_handle why);
/* Register read interest, causing read_cb to be called once when fd becomes
readable, on deadline specified by deadline, or on shutdown triggered by
@@ -195,7 +195,7 @@ bool grpc_is_any_background_poller_thread();
* that the closure may or may not run yet when this function returns, and the
* closure should not be blocking or long-running. */
bool grpc_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
/* Shut down all the closures registered in the background poller. */
void grpc_shutdown_background_closure();
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.cc
new file mode 100644
index 00000000000..e495d3c901b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.cc
@@ -0,0 +1,77 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+namespace {
+
+void RunClosure(grpc_closure* closure, grpc_error_handle error) {
+ GPR_ASSERT(closure != nullptr);
+#ifndef NDEBUG
+ closure->scheduled = false;
+ if (grpc_trace_closure.enabled()) {
+ gpr_log(GPR_DEBUG,
+ "EventEngine: running closure %p: created [%s:%d]: %s [%s:%d]",
+ closure, closure->file_created, closure->line_created,
+ closure->run ? "run" : "scheduled", closure->file_initiated,
+ closure->line_initiated);
+ }
+#endif
+ closure->cb(closure->cb_arg, error);
+#ifndef NDEBUG
+ if (grpc_trace_closure.enabled()) {
+ gpr_log(GPR_DEBUG, "EventEngine: closure %p finished", closure);
+ }
+#endif
+}
+
+} // namespace
+
+std::function<void(y_absl::Status)> GrpcClosureToStatusCallback(
+ grpc_closure* closure) {
+ return [closure](y_absl::Status status) {
+ RunClosure(closure, absl_status_to_grpc_error(status));
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure) {
+ return [closure]() {
+ RunClosure(closure, GRPC_ERROR_NONE);
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure,
+ grpc_error_handle error) {
+ return [closure, error]() {
+ RunClosure(closure, error);
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.h b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.h
new file mode 100644
index 00000000000..5e26cf0044c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/closure.h
@@ -0,0 +1,42 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// Creates a callback that takes an error status argument.
+std::function<void(y_absl::Status)> GrpcClosureToStatusCallback(
+ grpc_closure* closure);
+
+/// Create a callback that *does not* take an error status argument.
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure);
+
+/// Creates a callback that *does not* take an error status argument.
+/// This version has a pre-bound error.
+std::function<void()> GrpcClosureToCallback(grpc_closure* closure,
+ grpc_error_handle error);
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_CLOSURE_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.cc
new file mode 100644
index 00000000000..2a9da2e2a80
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.cc
@@ -0,0 +1,172 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/slice.h>
+#include <grpc/slice_buffer.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/endpoint.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#error #include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/transport/error_utils.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+namespace {
+
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::ResolvedAddressToURI;
+using ::grpc_event_engine::experimental::SliceBuffer;
+
+void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb, bool /* urgent */) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_CANCELLED);
+ return;
+ }
+ SliceBuffer* read_buffer = new (&eeep->read_buffer) SliceBuffer(slices);
+ eeep->endpoint->Read(
+ [eeep, cb](y_absl::Status status) {
+ auto* read_buffer = reinterpret_cast<SliceBuffer*>(&eeep->read_buffer);
+ read_buffer->~SliceBuffer();
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
+ absl_status_to_grpc_error(status));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ read_buffer);
+}
+
+void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
+ grpc_closure* cb, void* arg) {
+ // TODO(hork): adapt arg to some metrics collection mechanism.
+ (void)arg;
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_CANCELLED);
+ return;
+ }
+ SliceBuffer* write_buffer = new (&eeep->write_buffer) SliceBuffer(slices);
+ eeep->endpoint->Write(
+ [eeep, cb](y_absl::Status status) {
+ auto* write_buffer =
+ reinterpret_cast<SliceBuffer*>(&eeep->write_buffer);
+ write_buffer->~SliceBuffer();
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
+ absl_status_to_grpc_error(status));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ write_buffer);
+}
+void endpoint_add_to_pollset(grpc_endpoint* /* ep */,
+ grpc_pollset* /* pollset */) {}
+void endpoint_add_to_pollset_set(grpc_endpoint* /* ep */,
+ grpc_pollset_set* /* pollset */) {}
+void endpoint_delete_from_pollset_set(grpc_endpoint* /* ep */,
+ grpc_pollset_set* /* pollset */) {}
+/// After shutdown, all endpoint operations except destroy are no-op,
+/// and will return some kind of sane default (empty strings, nullptrs, etc). It
+/// is the caller's responsibility to ensure that calls to endpoint_shutdown are
+/// synchronized.
+void endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
+ TString str = grpc_error_std_string(why);
+ gpr_log(GPR_INFO, "TCP Endpoint %p shutdown why=%s", eeep->endpoint.get(),
+ str.c_str());
+ }
+ eeep->endpoint.reset();
+}
+
+void endpoint_destroy(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ delete eeep;
+}
+
+y_absl::string_view endpoint_get_peer(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ return "";
+ }
+ if (eeep->peer_address.empty()) {
+ const EventEngine::ResolvedAddress& addr = eeep->endpoint->GetPeerAddress();
+ eeep->peer_address = ResolvedAddressToURI(addr);
+ }
+ return eeep->peer_address;
+}
+
+y_absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
+ auto* eeep = reinterpret_cast<grpc_event_engine_endpoint*>(ep);
+ if (eeep->endpoint == nullptr) {
+ return "";
+ }
+ if (eeep->local_address.empty()) {
+ const EventEngine::ResolvedAddress& addr =
+ eeep->endpoint->GetLocalAddress();
+ eeep->local_address = ResolvedAddressToURI(addr);
+ }
+ return eeep->local_address;
+}
+
+int endpoint_get_fd(grpc_endpoint* /* ep */) { return -1; }
+
+bool endpoint_can_track_err(grpc_endpoint* /* ep */) { return false; }
+
+grpc_endpoint_vtable grpc_event_engine_endpoint_vtable = {
+ endpoint_read,
+ endpoint_write,
+ endpoint_add_to_pollset,
+ endpoint_add_to_pollset_set,
+ endpoint_delete_from_pollset_set,
+ endpoint_shutdown,
+ endpoint_destroy,
+ endpoint_get_peer,
+ endpoint_get_local_address,
+ endpoint_get_fd,
+ endpoint_can_track_err};
+
+} // namespace
+
+grpc_event_engine_endpoint* grpc_tcp_server_endpoint_create(
+ std::unique_ptr<EventEngine::Endpoint> ee_endpoint) {
+ auto endpoint = new grpc_event_engine_endpoint;
+ endpoint->base.vtable = &grpc_event_engine_endpoint_vtable;
+ endpoint->endpoint = std::move(ee_endpoint);
+ return endpoint;
+}
+
+grpc_endpoint* grpc_tcp_create(const grpc_channel_args* /* channel_args */,
+ y_absl::string_view /* peer_address */) {
+ auto endpoint = new grpc_event_engine_endpoint;
+ endpoint->base.vtable = &grpc_event_engine_endpoint_vtable;
+ return &endpoint->base;
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.h b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.h
new file mode 100644
index 00000000000..d2d16a89b98
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/endpoint.h
@@ -0,0 +1,52 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/endpoint.h"
+#error #include "src/core/lib/iomgr/resource_quota.h"
+
+struct grpc_event_engine_endpoint {
+ grpc_endpoint base;
+ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
+ endpoint;
+ TString peer_address;
+ TString local_address;
+ std::aligned_storage<
+ sizeof(grpc_event_engine::experimental::SliceBuffer),
+ alignof(grpc_event_engine::experimental::SliceBuffer)>::type read_buffer;
+ std::aligned_storage<
+ sizeof(grpc_event_engine::experimental::SliceBuffer),
+ alignof(grpc_event_engine::experimental::SliceBuffer)>::type write_buffer;
+};
+
+/// Creates an internal grpc_endpoint struct from an EventEngine Endpoint.
+/// Server code needs to create grpc_endpoints after the EventEngine has made
+/// connections.
+grpc_event_engine_endpoint* grpc_tcp_server_endpoint_create(
+ std::unique_ptr<grpc_event_engine::experimental::EventEngine::Endpoint> ee);
+
+/// Creates a new internal grpc_endpoint struct, when no EventEngine Endpoint
+/// has yet been created. This is used in client code before connections are
+/// established. Takes ownership of the slice_allocator.
+grpc_endpoint* grpc_tcp_create(const grpc_channel_args* channel_args,
+ y_absl::string_view peer_address);
+
+#endif
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_ENDPOINT_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/iomgr.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/iomgr.cc
new file mode 100644
index 00000000000..c392100855b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/iomgr.cc
@@ -0,0 +1,84 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/surface/init.h"
+
+extern grpc_tcp_client_vtable grpc_event_engine_tcp_client_vtable;
+extern grpc_tcp_server_vtable grpc_event_engine_tcp_server_vtable;
+extern grpc_timer_vtable grpc_event_engine_timer_vtable;
+extern grpc_pollset_vtable grpc_event_engine_pollset_vtable;
+extern grpc_pollset_set_vtable grpc_event_engine_pollset_set_vtable;
+extern grpc_address_resolver_vtable grpc_event_engine_resolver_vtable;
+
+// Disabled by default. grpc_polling_trace must be defined in all iomgr
+// implementations due to its usage in lockfree_event.
+grpc_core::DebugOnlyTraceFlag grpc_polling_trace(false, "polling");
+
+namespace {
+
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+
+// TODO(nnoble): Instantiate the default EventEngine if none have been provided.
+void iomgr_platform_init(void) {}
+
+void iomgr_platform_flush(void) {}
+
+void iomgr_platform_shutdown(void) {}
+
+void iomgr_platform_shutdown_background_closure(void) {}
+
+bool iomgr_platform_is_any_background_poller_thread(void) {
+ return grpc_event_engine::experimental::GetDefaultEventEngine()
+ ->IsWorkerThread();
+}
+
+bool iomgr_platform_add_closure_to_background_poller(
+ grpc_closure* /* closure */, grpc_error_handle /* error */) {
+ return false;
+}
+
+grpc_iomgr_platform_vtable vtable = {
+ iomgr_platform_init,
+ iomgr_platform_flush,
+ iomgr_platform_shutdown,
+ iomgr_platform_shutdown_background_closure,
+ iomgr_platform_is_any_background_poller_thread,
+ iomgr_platform_add_closure_to_background_poller};
+
+} // namespace
+
+void grpc_set_default_iomgr_platform() {
+ grpc_set_tcp_client_impl(&grpc_event_engine_tcp_client_vtable);
+ grpc_set_tcp_server_impl(&grpc_event_engine_tcp_server_vtable);
+ grpc_set_timer_impl(&grpc_event_engine_timer_vtable);
+ grpc_set_pollset_vtable(&grpc_event_engine_pollset_vtable);
+ grpc_set_pollset_set_vtable(&grpc_event_engine_pollset_set_vtable);
+ grpc_set_resolver_impl(&grpc_event_engine_resolver_vtable);
+ grpc_set_iomgr_platform_vtable(&vtable);
+}
+
+bool grpc_iomgr_run_in_background() { return false; }
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.cc
new file mode 100644
index 00000000000..b8e08d06950
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.cc
@@ -0,0 +1,88 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+
+namespace {
+
+static gpr_mu g_mu;
+static gpr_cv g_cv;
+
+// --- pollset vtable API ---
+void pollset_global_init(void) {
+ gpr_mu_init(&g_mu);
+ gpr_cv_init(&g_cv);
+}
+void pollset_global_shutdown(void) {
+ gpr_cv_destroy(&g_cv);
+ gpr_mu_destroy(&g_mu);
+}
+void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { *mu = &g_mu; }
+void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
+}
+void pollset_destroy(grpc_pollset* pollset) {}
+grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
+ (void)worker;
+ gpr_cv_wait(&g_cv, &g_mu,
+ grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME));
+ return GRPC_ERROR_NONE;
+}
+grpc_error_handle pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
+ (void)pollset;
+ (void)specific_worker;
+ return GRPC_ERROR_NONE;
+}
+size_t pollset_size(void) { return 1; }
+
+// --- pollset_set vtable API ---
+grpc_pollset_set* pollset_set_create(void) { return nullptr; }
+void pollset_set_destroy(grpc_pollset_set* pollset_set) {}
+void pollset_set_add_pollset(grpc_pollset_set* pollset_set,
+ grpc_pollset* pollset) {}
+
+void pollset_set_del_pollset(grpc_pollset_set* pollset_set,
+ grpc_pollset* pollset) {}
+void pollset_set_add_pollset_set(grpc_pollset_set* bag,
+ grpc_pollset_set* item) {}
+void pollset_set_del_pollset_set(grpc_pollset_set* bag,
+ grpc_pollset_set* item) {}
+
+} // namespace
+
+void grpc_pollset_ee_broadcast_event() { gpr_cv_signal(&g_cv); }
+
+// --- vtables ---
+grpc_pollset_vtable grpc_event_engine_pollset_vtable = {
+ pollset_global_init, pollset_global_shutdown,
+ pollset_init, pollset_shutdown,
+ pollset_destroy, pollset_work,
+ pollset_kick, pollset_size};
+
+grpc_pollset_set_vtable grpc_event_engine_pollset_set_vtable = {
+ pollset_set_create, pollset_set_destroy,
+ pollset_set_add_pollset, pollset_set_del_pollset,
+ pollset_set_add_pollset_set, pollset_set_del_pollset_set};
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.h b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.h
new file mode 100644
index 00000000000..94a46c0a723
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/pollset.h
@@ -0,0 +1,25 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
+
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+
+/// Signals pollset_work that some work has been done.
+void grpc_pollset_ee_broadcast_event();
+
+#endif
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_POLLSET_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/promise.h b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/promise.h
new file mode 100644
index 00000000000..9b34e2aed60
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/promise.h
@@ -0,0 +1,51 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+/// A minimal promise implementation.
+///
+/// This is light-duty, syntactical sugar around cv wait & signal, which is
+/// useful in some cases. A more robust implementation is being worked on
+/// separately.
+template <typename T>
+class Promise {
+ public:
+ T& Get() {
+ y_absl::MutexLock lock(&mu_);
+ cv_.Wait(&mu_);
+ return val_;
+ }
+ void Set(T&& val) {
+ y_absl::MutexLock lock(&mu_);
+ val_ = std::move(val);
+ cv_.Signal();
+ }
+
+ private:
+ y_absl::Mutex mu_;
+ y_absl::CondVar cv_;
+ T val_;
+};
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_PROMISE_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc
new file mode 100644
index 00000000000..561d91ed011
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.cc
@@ -0,0 +1,41 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/event_engine/resolved_address_internal.h"
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress CreateResolvedAddress(
+ const grpc_resolved_address& addr) {
+ return EventEngine::ResolvedAddress(
+ reinterpret_cast<const sockaddr*>(addr.addr), addr.len);
+}
+
+grpc_resolved_address CreateGRPCResolvedAddress(
+ const EventEngine::ResolvedAddress& ra) {
+ grpc_resolved_address grpc_addr;
+ memcpy(grpc_addr.addr, ra.address(), ra.size());
+ grpc_addr.len = ra.size();
+ return grpc_addr;
+}
+
+} // namespace experimental
+} // namespace grpc_event_engine
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h
new file mode 100644
index 00000000000..ae794805250
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolved_address_internal.h
@@ -0,0 +1,35 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#ifndef GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
+#define GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/iomgr/resolve_address.h"
+
+namespace grpc_event_engine {
+namespace experimental {
+
+EventEngine::ResolvedAddress CreateResolvedAddress(
+ const grpc_resolved_address& addr);
+
+grpc_resolved_address CreateGRPCResolvedAddress(
+ const EventEngine::ResolvedAddress& ra);
+
+} // namespace experimental
+} // namespace grpc_event_engine
+
+#endif // GRPC_CORE_LIB_IOMGR_EVENT_ENGINE_RESOLVED_ADDRESS_INTERNAL_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolver.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolver.cc
new file mode 100644
index 00000000000..c455563ccdf
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/resolver.cc
@@ -0,0 +1,115 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include "y_absl/functional/bind_front.h"
+
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/promise.h"
+#include "src/core/lib/iomgr/event_engine/resolved_address_internal.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/work_serializer.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace {
+using ::grpc_event_engine::experimental::CreateGRPCResolvedAddress;
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::Promise;
+
+/// A fire-and-forget class representing an individual DNS request.
+///
+/// This provides a place to store the ownership of the DNSResolver object until
+/// the request is complete.
+class DnsRequest {
+ public:
+ DnsRequest(std::unique_ptr<EventEngine::DNSResolver> dns_resolver,
+ y_absl::string_view address, y_absl::string_view default_port,
+ grpc_closure* on_done, grpc_resolved_addresses** addresses)
+ : dns_resolver_(std::move(dns_resolver)),
+ cb_(on_done),
+ addresses_(addresses) {
+ dns_resolver_->LookupHostname(
+ y_absl::bind_front(&DnsRequest::OnLookupComplete, this), address,
+ default_port, y_absl::InfiniteFuture());
+ }
+
+ private:
+ void OnLookupComplete(
+ y_absl::StatusOr<std::vector<EventEngine::ResolvedAddress>> addresses) {
+ grpc_core::ExecCtx exec_ctx;
+ // Convert addresses to iomgr form.
+ *addresses_ = static_cast<grpc_resolved_addresses*>(
+ gpr_malloc(sizeof(grpc_resolved_addresses)));
+ (*addresses_)->naddrs = addresses->size();
+ (*addresses_)->addrs = static_cast<grpc_resolved_address*>(
+ gpr_malloc(sizeof(grpc_resolved_address) * addresses->size()));
+ for (size_t i = 0; i < addresses->size(); ++i) {
+ (*addresses_)->addrs[i] = CreateGRPCResolvedAddress((*addresses)[i]);
+ }
+ grpc_closure* cb = cb_;
+ delete this;
+ grpc_core::Closure::Run(DEBUG_LOCATION, cb,
+ absl_status_to_grpc_error(addresses.status()));
+ }
+
+ std::unique_ptr<EventEngine::DNSResolver> dns_resolver_;
+ grpc_closure* cb_;
+ grpc_resolved_addresses** addresses_;
+};
+
+void resolve_address(const char* addr, const char* default_port,
+ grpc_pollset_set* /* interested_parties */,
+ grpc_closure* on_done,
+ grpc_resolved_addresses** addresses) {
+ std::unique_ptr<EventEngine::DNSResolver> dns_resolver =
+ GetDefaultEventEngine()->GetDNSResolver();
+ if (dns_resolver == nullptr) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION, on_done,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to get DNS Resolver."));
+ return;
+ }
+ new DnsRequest(std::move(dns_resolver), addr, default_port, on_done,
+ addresses);
+}
+
+void blocking_handle_async_resolve_done(void* arg, grpc_error_handle error) {
+ static_cast<Promise<grpc_error_handle>*>(arg)->Set(std::move(error));
+}
+
+grpc_error_handle blocking_resolve_address(
+ const char* name, const char* default_port,
+ grpc_resolved_addresses** addresses) {
+ grpc_closure on_done;
+ Promise<grpc_error_handle> evt;
+ GRPC_CLOSURE_INIT(&on_done, blocking_handle_async_resolve_done, &evt,
+ grpc_schedule_on_exec_ctx);
+ resolve_address(name, default_port, nullptr, &on_done, addresses);
+ return evt.Get();
+}
+
+} // namespace
+
+grpc_address_resolver_vtable grpc_event_engine_resolver_vtable{
+ resolve_address, blocking_resolve_address};
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/tcp.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/tcp.cc
new file mode 100644
index 00000000000..4e1baf18073
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/tcp.cc
@@ -0,0 +1,295 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/event_engine/channel_args_endpoint_config.h"
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/event_engine/sockaddr.h"
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/event_engine/endpoint.h"
+#include "src/core/lib/iomgr/event_engine/pollset.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/tcp_client.h"
+#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+extern grpc_core::TraceFlag grpc_tcp_trace;
+
+namespace {
+using ::grpc_event_engine::experimental::ChannelArgsEndpointConfig;
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::GrpcClosureToStatusCallback;
+using ::grpc_event_engine::experimental::SliceAllocator;
+using ::grpc_event_engine::experimental::SliceAllocatorFactory;
+using ::grpc_event_engine::experimental::SliceBuffer;
+} // namespace
+
+class WrappedInternalSliceAllocator : public SliceAllocator {
+ public:
+ explicit WrappedInternalSliceAllocator(grpc_slice_allocator* slice_allocator)
+ : slice_allocator_(slice_allocator) {}
+
+ ~WrappedInternalSliceAllocator() {
+ grpc_slice_allocator_destroy(slice_allocator_);
+ }
+
+ y_absl::Status Allocate(size_t size, SliceBuffer* dest,
+ SliceAllocator::AllocateCallback cb) override {
+ // TODO(nnoble): requires the SliceBuffer definition.
+ grpc_slice_allocator_allocate(
+ slice_allocator_, size, 1, grpc_slice_allocator_intent::kReadBuffer,
+ dest->RawSliceBuffer(),
+ [](void* arg, grpc_error_handle error) {
+ auto cb = static_cast<SliceAllocator::AllocateCallback*>(arg);
+ (*cb)(grpc_error_to_absl_status(error));
+ delete cb;
+ },
+ new SliceAllocator::AllocateCallback(cb));
+ return y_absl::OkStatus();
+ }
+
+ private:
+ grpc_slice_allocator* slice_allocator_;
+};
+
+class WrappedInternalSliceAllocatorFactory : public SliceAllocatorFactory {
+ public:
+ explicit WrappedInternalSliceAllocatorFactory(
+ grpc_slice_allocator_factory* slice_allocator_factory)
+ : slice_allocator_factory_(slice_allocator_factory) {}
+
+ ~WrappedInternalSliceAllocatorFactory() {
+ grpc_slice_allocator_factory_destroy(slice_allocator_factory_);
+ }
+
+ std::unique_ptr<SliceAllocator> CreateSliceAllocator(
+ y_absl::string_view peer_name) override {
+ return y_absl::make_unique<WrappedInternalSliceAllocator>(
+ grpc_slice_allocator_factory_create_slice_allocator(
+ slice_allocator_factory_, peer_name));
+ };
+
+ private:
+ grpc_slice_allocator_factory* slice_allocator_factory_;
+};
+
+struct grpc_tcp_server {
+ explicit grpc_tcp_server(std::unique_ptr<EventEngine::Listener> listener)
+ : refcount(1, GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace) ? "tcp" : nullptr),
+ listener(std::move(listener)) {
+ shutdown_starting.head = nullptr;
+ shutdown_starting.tail = nullptr;
+ };
+ ~grpc_tcp_server() {
+ grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &shutdown_starting);
+ grpc_core::ExecCtx::Get()->Flush();
+ }
+ grpc_core::RefCount refcount;
+ grpc_core::Mutex mu;
+ std::unique_ptr<EventEngine::Listener> listener;
+ grpc_closure_list shutdown_starting Y_ABSL_GUARDED_BY(mu);
+ grpc_tcp_server_cb on_accept_internal;
+ void* on_accept_internal_arg;
+};
+
+namespace {
+
+/// Converts a grpc_closure to an EventEngine Callback. The closure is expected
+/// to already be initialized.
+EventEngine::OnConnectCallback GrpcClosureToOnConnectCallback(
+ grpc_closure* closure, grpc_endpoint** endpoint_ptr) {
+ return [closure, endpoint_ptr](
+ y_absl::StatusOr<std::unique_ptr<EventEngine::Endpoint>> endpoint) {
+ grpc_core::ExecCtx exec_ctx;
+ if (endpoint.ok()) {
+ auto* grpc_endpoint_out =
+ reinterpret_cast<grpc_event_engine_endpoint*>(*endpoint_ptr);
+ grpc_endpoint_out->endpoint = std::move(*endpoint);
+ } else {
+ grpc_endpoint_destroy(*endpoint_ptr);
+ *endpoint_ptr = nullptr;
+ }
+ grpc_core::Closure::Run(DEBUG_LOCATION, closure,
+ absl_status_to_grpc_error(endpoint.status()));
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ };
+}
+
+/// Usage note: this method does not take ownership of any pointer arguments.
+void tcp_connect(grpc_closure* on_connect, grpc_endpoint** endpoint,
+ grpc_slice_allocator* slice_allocator,
+ grpc_pollset_set* /* interested_parties */,
+ const grpc_channel_args* channel_args,
+ const grpc_resolved_address* addr, grpc_millis deadline) {
+ grpc_event_engine_endpoint* ee_endpoint =
+ reinterpret_cast<grpc_event_engine_endpoint*>(
+ grpc_tcp_create(channel_args, grpc_sockaddr_to_uri(addr)));
+ *endpoint = &ee_endpoint->base;
+ EventEngine::OnConnectCallback ee_on_connect =
+ GrpcClosureToOnConnectCallback(on_connect, endpoint);
+ auto ee_slice_allocator =
+ y_absl::make_unique<WrappedInternalSliceAllocator>(slice_allocator);
+ EventEngine::ResolvedAddress ra(reinterpret_cast<const sockaddr*>(addr->addr),
+ addr->len);
+ y_absl::Time ee_deadline = grpc_core::ToAbslTime(
+ grpc_millis_to_timespec(deadline, GPR_CLOCK_MONOTONIC));
+ ChannelArgsEndpointConfig endpoint_config(channel_args);
+ y_absl::Status connected = GetDefaultEventEngine()->Connect(
+ ee_on_connect, ra, endpoint_config, std::move(ee_slice_allocator),
+ ee_deadline);
+ if (!connected.ok()) {
+ // EventEngine failed to start an asynchronous connect.
+ grpc_endpoint_destroy(*endpoint);
+ *endpoint = nullptr;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_connect,
+ absl_status_to_grpc_error(connected));
+ }
+}
+
+grpc_error_handle tcp_server_create(
+ grpc_closure* shutdown_complete, const grpc_channel_args* args,
+ grpc_slice_allocator_factory* slice_allocator_factory,
+ grpc_tcp_server** server) {
+ ChannelArgsEndpointConfig endpoint_config(args);
+ auto ee_slice_allocator_factory =
+ y_absl::make_unique<WrappedInternalSliceAllocatorFactory>(
+ slice_allocator_factory);
+ EventEngine* event_engine = GetDefaultEventEngine();
+ y_absl::StatusOr<std::unique_ptr<EventEngine::Listener>> listener =
+ event_engine->CreateListener(
+ [server](std::unique_ptr<EventEngine::Endpoint> ee_endpoint,
+ const SliceAllocator& /*slice_allocator*/) {
+ grpc_core::ExecCtx exec_ctx;
+ GPR_ASSERT((*server)->on_accept_internal != nullptr);
+ grpc_event_engine_endpoint* iomgr_endpoint =
+ grpc_tcp_server_endpoint_create(std::move(ee_endpoint));
+ grpc_tcp_server_acceptor* acceptor =
+ static_cast<grpc_tcp_server_acceptor*>(
+ gpr_zalloc(sizeof(*acceptor)));
+ acceptor->from_server = *server;
+ acceptor->external_connection = false;
+ (*server)->on_accept_internal((*server)->on_accept_internal_arg,
+ &iomgr_endpoint->base, nullptr,
+ acceptor);
+ exec_ctx.Flush();
+ grpc_pollset_ee_broadcast_event();
+ },
+ GrpcClosureToStatusCallback(shutdown_complete), endpoint_config,
+ std::move(ee_slice_allocator_factory));
+ if (!listener.ok()) {
+ return absl_status_to_grpc_error(listener.status());
+ }
+ *server = new grpc_tcp_server(std::move(*listener));
+ return GRPC_ERROR_NONE;
+}
+
+void tcp_server_start(grpc_tcp_server* server,
+ const std::vector<grpc_pollset*>* /* pollsets */,
+ grpc_tcp_server_cb on_accept_cb, void* cb_arg) {
+ server->on_accept_internal = on_accept_cb;
+ server->on_accept_internal_arg = cb_arg;
+ // The iomgr API does not handle situations where the server cannot start, so
+ // a crash may be preferable for now.
+ GPR_ASSERT(server->listener->Start().ok());
+}
+
+grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port) {
+ EventEngine::ResolvedAddress ra(reinterpret_cast<const sockaddr*>(addr->addr),
+ addr->len);
+ auto port = s->listener->Bind(ra);
+ if (!port.ok()) {
+ return absl_status_to_grpc_error(port.status());
+ }
+ *out_port = *port;
+ return GRPC_ERROR_NONE;
+}
+
+grpc_core::TcpServerFdHandler* tcp_server_create_fd_handler(
+ grpc_tcp_server* /* s */) {
+ // EventEngine-iomgr does not support fds.
+ return nullptr;
+}
+
+unsigned tcp_server_port_fd_count(grpc_tcp_server* /* s */,
+ unsigned /* port_index */) {
+ return 0;
+}
+
+int tcp_server_port_fd(grpc_tcp_server* /* s */, unsigned /* port_index */,
+ unsigned /* fd_index */) {
+ // Note: only used internally
+ return -1;
+}
+
+grpc_tcp_server* tcp_server_ref(grpc_tcp_server* s) {
+ s->refcount.Ref(DEBUG_LOCATION, "server ref");
+ return s;
+}
+
+void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
+ grpc_closure* shutdown_starting) {
+ grpc_core::MutexLock lock(&s->mu);
+ grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
+ GRPC_ERROR_NONE);
+}
+
+void tcp_server_unref(grpc_tcp_server* s) {
+ if (GPR_UNLIKELY(s->refcount.Unref(DEBUG_LOCATION, "server unref"))) {
+ delete s;
+ }
+}
+
+// No-op, all are handled on listener unref
+void tcp_server_shutdown_listeners(grpc_tcp_server* /* s */) {}
+
+} // namespace
+
+grpc_tcp_client_vtable grpc_event_engine_tcp_client_vtable = {tcp_connect};
+grpc_tcp_server_vtable grpc_event_engine_tcp_server_vtable = {
+ tcp_server_create, tcp_server_start,
+ tcp_server_add_port, tcp_server_create_fd_handler,
+ tcp_server_port_fd_count, tcp_server_port_fd,
+ tcp_server_ref, tcp_server_shutdown_starting_add,
+ tcp_server_unref, tcp_server_shutdown_listeners};
+
+// Methods that are expected to exist elsewhere in the codebase.
+
+struct grpc_fd {
+ int fd;
+};
+
+grpc_fd* grpc_fd_create(int /* fd */, const char* /* name */,
+ bool /* track_err */) {
+ return nullptr;
+}
+
+grpc_endpoint* grpc_tcp_client_create_from_fd(
+ grpc_fd* /* fd */, const grpc_channel_args* /* channel_args */,
+ y_absl::string_view /* addr_str */,
+ grpc_slice_allocator* slice_allocator /* slice_allocator */) {
+ grpc_slice_allocator_destroy(slice_allocator);
+ return nullptr;
+}
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/event_engine/timer.cc b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/timer.cc
new file mode 100644
index 00000000000..6ac49f11c93
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/iomgr/event_engine/timer.cc
@@ -0,0 +1,63 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <grpc/support/port_platform.h>
+
+#ifdef GRPC_USE_EVENT_ENGINE
+#include <grpc/event_engine/event_engine.h>
+
+#include "src/core/lib/event_engine/event_engine_factory.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/event_engine/closure.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/timer.h"
+#include "src/core/lib/surface/init.h"
+#include "src/core/lib/transport/error_utils.h"
+
+namespace {
+using ::grpc_event_engine::experimental::EventEngine;
+using ::grpc_event_engine::experimental::GetDefaultEventEngine;
+using ::grpc_event_engine::experimental::GrpcClosureToCallback;
+
+void timer_init(grpc_timer* timer, grpc_millis deadline,
+ grpc_closure* closure) {
+ timer->ee_task_handle = GetDefaultEventEngine()->RunAt(
+ grpc_core::ToAbslTime(
+ grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME)),
+ GrpcClosureToCallback(closure));
+ timer->closure = closure;
+}
+
+void timer_cancel(grpc_timer* timer) {
+ auto handle = timer->ee_task_handle;
+ if (!GetDefaultEventEngine()->Cancel(handle)) {
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure,
+ GRPC_ERROR_CANCELLED);
+ }
+}
+
+/* Internal API */
+grpc_timer_check_result timer_check(grpc_millis* /* next */) {
+ return GRPC_TIMERS_NOT_CHECKED;
+}
+void timer_list_init() {}
+void timer_list_shutdown(void) {}
+void timer_consume_kick(void) {}
+
+} // namespace
+
+grpc_timer_vtable grpc_event_engine_timer_vtable = {
+ timer_init, timer_cancel, timer_check,
+ timer_list_init, timer_list_shutdown, timer_consume_kick};
+
+#endif // GRPC_USE_EVENT_ENGINE
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc
index a2b6e7b38f2..ed480d8f742 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.cc
@@ -23,11 +23,11 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/combiner.h"
+#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/profiling/timers.h"
-static void exec_ctx_run(grpc_closure* closure, grpc_error* error) {
+static void exec_ctx_run(grpc_closure* closure, grpc_error_handle error) {
#ifndef NDEBUG
closure->scheduled = false;
if (grpc_trace_closure.enabled()) {
@@ -46,7 +46,7 @@ static void exec_ctx_run(grpc_closure* closure, grpc_error* error) {
GRPC_ERROR_UNREF(error);
}
-static void exec_ctx_sched(grpc_closure* closure, grpc_error* error) {
+static void exec_ctx_sched(grpc_closure* closure, grpc_error_handle error) {
grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(), closure,
error);
}
@@ -123,13 +123,13 @@ grpc_millis grpc_cycle_counter_to_millis_round_up(gpr_cycle_counter cycles) {
}
namespace grpc_core {
-GPR_TLS_CLASS_DEF(ExecCtx::exec_ctx_);
-GPR_TLS_CLASS_DEF(ApplicationCallbackExecCtx::callback_exec_ctx_);
+GPR_THREAD_LOCAL(ExecCtx*) ExecCtx::exec_ctx_;
+GPR_THREAD_LOCAL(ApplicationCallbackExecCtx*)
+ApplicationCallbackExecCtx::callback_exec_ctx_;
// WARNING: for testing purposes only!
void ExecCtx::TestOnlyGlobalInit(gpr_timespec new_val) {
g_start_time = new_val;
- gpr_tls_init(&exec_ctx_);
}
void ExecCtx::GlobalInit(void) {
@@ -140,7 +140,6 @@ void ExecCtx::GlobalInit(void) {
g_start_time = gpr_now(GPR_CLOCK_MONOTONIC);
const gpr_cycle_counter cycle_after = gpr_get_cycle_counter();
g_start_cycle = (cycle_before + cycle_after) / 2;
- gpr_tls_init(&exec_ctx_);
}
bool ExecCtx::Flush() {
@@ -152,7 +151,7 @@ bool ExecCtx::Flush() {
closure_list_.head = closure_list_.tail = nullptr;
while (c != nullptr) {
grpc_closure* next = c->next_data.next;
- grpc_error* error = c->error_data.error;
+ grpc_error_handle error = c->error_data.error;
did_something = true;
exec_ctx_run(c, error);
c = next;
@@ -174,7 +173,7 @@ grpc_millis ExecCtx::Now() {
}
void ExecCtx::Run(const DebugLocation& location, grpc_closure* closure,
- grpc_error* error) {
+ grpc_error_handle error) {
(void)location;
if (closure == nullptr) {
GRPC_ERROR_UNREF(error);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
index c993133ef1c..a427100ef84 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/exec_ctx.h
@@ -73,10 +73,10 @@ class Combiner;
* Generally, to create an exec_ctx instance, add the following line at the top
* of the public API entry point or at the start of a thread's work function :
*
- * grpc_core::ExecCtx exec_ctx;
+ * ExecCtx exec_ctx;
*
* Access the created ExecCtx instance using :
- * grpc_core::ExecCtx::Get()
+ * ExecCtx::Get()
*
* Specific responsibilities (this may grow in the future):
* - track a list of core work that needs to be delayed until the base of the
@@ -90,7 +90,7 @@ class Combiner;
* - Instance of this must ALWAYS be constructed on the stack, never
* heap allocated.
* - Do not pass exec_ctx as a parameter to a function. Always access it using
- * grpc_core::ExecCtx::Get().
+ * ExecCtx::Get().
* - NOTE: In the future, the convention is likely to change to allow only one
* ExecCtx on a thread's stack at the same time. The TODO below
* discusses this plan in more detail.
@@ -108,14 +108,14 @@ class ExecCtx {
/** Default Constructor */
ExecCtx() : flags_(GRPC_EXEC_CTX_FLAG_IS_FINISHED) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
Set(this);
}
/** Parameterised Constructor */
explicit ExecCtx(uintptr_t fl) : flags_(fl) {
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
}
Set(this);
}
@@ -126,7 +126,7 @@ class ExecCtx {
Flush();
Set(last_exec_ctx_);
if (!(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::DecExecCtxCount();
+ Fork::DecExecCtxCount();
}
}
@@ -216,19 +216,15 @@ class ExecCtx {
static void GlobalInit(void);
/** Global shutdown for ExecCtx. Called by iomgr. */
- static void GlobalShutdown(void) { gpr_tls_destroy(&exec_ctx_); }
+ static void GlobalShutdown(void) {}
/** Gets pointer to current exec_ctx. */
- static ExecCtx* Get() {
- return reinterpret_cast<ExecCtx*>(gpr_tls_get(&exec_ctx_));
- }
+ static ExecCtx* Get() { return exec_ctx_; }
- static void Set(ExecCtx* exec_ctx) {
- gpr_tls_set(&exec_ctx_, reinterpret_cast<intptr_t>(exec_ctx));
- }
+ static void Set(ExecCtx* exec_ctx) { exec_ctx_ = exec_ctx; }
static void Run(const DebugLocation& location, grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
static void RunList(const DebugLocation& location, grpc_closure_list* list);
@@ -251,7 +247,7 @@ class ExecCtx {
bool now_is_valid_ = false;
grpc_millis now_ = 0;
- GPR_TLS_CLASS_DECL(exec_ctx_);
+ static GPR_THREAD_LOCAL(ExecCtx*) exec_ctx_;
ExecCtx* last_exec_ctx_ = Get();
};
@@ -280,7 +276,7 @@ class ExecCtx {
* stacks of core re-entries. Instead, any application callbacks instead should
* not be invoked until other core work is done and other application callbacks
* have completed. To accomplish this, any application callback should be
- * enqueued using grpc_core::ApplicationCallbackExecCtx::Enqueue .
+ * enqueued using ApplicationCallbackExecCtx::Enqueue .
*
* CONVENTIONS:
* - Instances of this must ALWAYS be constructed on the stack, never
@@ -293,8 +289,8 @@ class ExecCtx {
* Generally, core entry points that may trigger application-level callbacks
* will have the following declarations:
*
- * grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
- * grpc_core::ExecCtx exec_ctx;
+ * ApplicationCallbackExecCtx callback_exec_ctx;
+ * ExecCtx exec_ctx;
*
* This ordering is important to make sure that the ApplicationCallbackExecCtx
* is destroyed after the ExecCtx (to prevent the re-entry problem described
@@ -313,8 +309,7 @@ class ApplicationCallbackExecCtx {
}
~ApplicationCallbackExecCtx() {
- if (reinterpret_cast<ApplicationCallbackExecCtx*>(
- gpr_tls_get(&callback_exec_ctx_)) == this) {
+ if (Get() == this) {
while (head_ != nullptr) {
auto* f = head_;
head_ = f->internal_next;
@@ -323,9 +318,9 @@ class ApplicationCallbackExecCtx {
}
(*f->functor_run)(f, f->internal_success);
}
- gpr_tls_set(&callback_exec_ctx_, reinterpret_cast<intptr_t>(nullptr));
+ callback_exec_ctx_ = nullptr;
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags_)) {
- grpc_core::Fork::DecExecCtxCount();
+ Fork::DecExecCtxCount();
}
} else {
GPR_DEBUG_ASSERT(head_ == nullptr);
@@ -335,22 +330,18 @@ class ApplicationCallbackExecCtx {
uintptr_t Flags() { return flags_; }
- static ApplicationCallbackExecCtx* Get() {
- return reinterpret_cast<ApplicationCallbackExecCtx*>(
- gpr_tls_get(&callback_exec_ctx_));
- }
+ static ApplicationCallbackExecCtx* Get() { return callback_exec_ctx_; }
static void Set(ApplicationCallbackExecCtx* exec_ctx, uintptr_t flags) {
if (Get() == nullptr) {
if (!(GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD & flags)) {
- grpc_core::Fork::IncExecCtxCount();
+ Fork::IncExecCtxCount();
}
- gpr_tls_set(&callback_exec_ctx_, reinterpret_cast<intptr_t>(exec_ctx));
+ callback_exec_ctx_ = exec_ctx;
}
}
- static void Enqueue(grpc_experimental_completion_queue_functor* functor,
- int is_success) {
+ static void Enqueue(grpc_completion_queue_functor* functor, int is_success) {
functor->internal_success = is_success;
functor->internal_next = nullptr;
@@ -366,18 +357,18 @@ class ApplicationCallbackExecCtx {
}
/** Global initialization for ApplicationCallbackExecCtx. Called by init. */
- static void GlobalInit(void) { gpr_tls_init(&callback_exec_ctx_); }
+ static void GlobalInit(void) {}
/** Global shutdown for ApplicationCallbackExecCtx. Called by init. */
- static void GlobalShutdown(void) { gpr_tls_destroy(&callback_exec_ctx_); }
+ static void GlobalShutdown(void) {}
static bool Available() { return Get() != nullptr; }
private:
uintptr_t flags_{0u};
- grpc_experimental_completion_queue_functor* head_{nullptr};
- grpc_experimental_completion_queue_functor* tail_{nullptr};
- GPR_TLS_CLASS_DECL(callback_exec_ctx_);
+ grpc_completion_queue_functor* head_{nullptr};
+ grpc_completion_queue_functor* tail_{nullptr};
+ static GPR_THREAD_LOCAL(ApplicationCallbackExecCtx*) callback_exec_ctx_;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
index ae1a3e7b742..32df2219061 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor.cc
@@ -27,12 +27,11 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/exec_ctx.h"
-#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/iomgr_internal.h"
#define MAX_DEPTH 2
@@ -53,31 +52,31 @@
namespace grpc_core {
namespace {
-GPR_TLS_DECL(g_this_thread_state);
+GPR_THREAD_LOCAL(ThreadState*) g_this_thread_state;
Executor* executors[static_cast<size_t>(ExecutorType::NUM_EXECUTORS)];
-void default_enqueue_short(grpc_closure* closure, grpc_error* error) {
+void default_enqueue_short(grpc_closure* closure, grpc_error_handle error) {
executors[static_cast<size_t>(ExecutorType::DEFAULT)]->Enqueue(
closure, error, true /* is_short */);
}
-void default_enqueue_long(grpc_closure* closure, grpc_error* error) {
+void default_enqueue_long(grpc_closure* closure, grpc_error_handle error) {
executors[static_cast<size_t>(ExecutorType::DEFAULT)]->Enqueue(
closure, error, false /* is_short */);
}
-void resolver_enqueue_short(grpc_closure* closure, grpc_error* error) {
+void resolver_enqueue_short(grpc_closure* closure, grpc_error_handle error) {
executors[static_cast<size_t>(ExecutorType::RESOLVER)]->Enqueue(
closure, error, true /* is_short */);
}
-void resolver_enqueue_long(grpc_closure* closure, grpc_error* error) {
+void resolver_enqueue_long(grpc_closure* closure, grpc_error_handle error) {
executors[static_cast<size_t>(ExecutorType::RESOLVER)]->Enqueue(
closure, error, false /* is_short */);
}
-using EnqueueFunc = void (*)(grpc_closure* closure, grpc_error* error);
+using EnqueueFunc = void (*)(grpc_closure* closure, grpc_error_handle error);
const EnqueueFunc
executor_enqueue_fns_[static_cast<size_t>(ExecutorType::NUM_EXECUTORS)]
@@ -94,9 +93,9 @@ TraceFlag executor_trace(false, "executor");
Executor::Executor(const char* name) : name_(name) {
adding_thread_lock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
gpr_atm_rel_store(&num_threads_, 0);
- max_threads_ = GPR_MAX(1, 2 * gpr_cpu_num_cores());
+ max_threads_ = std::max(1u, 2 * gpr_cpu_num_cores());
if (threads_limit_) {
- max_threads_ = GPR_MIN(max_threads_, threads_limit_);
+ max_threads_ = std::min(max_threads_, threads_limit_);
}
}
@@ -120,13 +119,13 @@ size_t Executor::RunClosures(const char* executor_name,
// invoked on its destruction, which will be after completing any closures in
// the executor's closure list (which were explicitly scheduled onto the
// executor).
- grpc_core::ApplicationCallbackExecCtx callback_exec_ctx(
+ ApplicationCallbackExecCtx callback_exec_ctx(
GRPC_APP_CALLBACK_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
grpc_closure* c = list.head;
while (c != nullptr) {
grpc_closure* next = c->next_data.next;
- grpc_error* error = c->error_data.error;
+ grpc_error_handle error = c->error_data.error;
#ifndef NDEBUG
EXECUTOR_TRACE("(%s) run %p [created by %s:%d]", executor_name, c,
c->file_created, c->line_created);
@@ -138,7 +137,7 @@ size_t Executor::RunClosures(const char* executor_name,
GRPC_ERROR_UNREF(error);
c = next;
n++;
- grpc_core::ExecCtx::Get()->Flush();
+ ExecCtx::Get()->Flush();
}
return n;
@@ -168,12 +167,11 @@ void Executor::SetThreading(bool threading) {
gpr_cv_init(&thd_state_[i].cv);
thd_state_[i].id = i;
thd_state_[i].name = name_;
- thd_state_[i].thd = grpc_core::Thread();
+ thd_state_[i].thd = Thread();
thd_state_[i].elems = GRPC_CLOSURE_LIST_INIT;
}
- thd_state_[0].thd =
- grpc_core::Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
+ thd_state_[0].thd = Thread(name_, &Executor::ThreadMain, &thd_state_[0]);
thd_state_[0].thd.Start();
} else { // !threading
if (curr_num_threads == 0) {
@@ -214,8 +212,8 @@ void Executor::SetThreading(bool threading) {
// finish. Thus, never call Executor::SetThreading(false) in the middle of
// an application.
// TODO(guantaol): create another method to finish all the pending closures
- // registered in the background poller by grpc_core::Executor.
- grpc_iomgr_shutdown_background_closure();
+ // registered in the background poller by Executor.
+ grpc_iomgr_platform_shutdown_background_closure();
}
EXECUTOR_TRACE("(%s) SetThreading(%d) done", name_, threading);
@@ -225,9 +223,9 @@ void Executor::Shutdown() { SetThreading(false); }
void Executor::ThreadMain(void* arg) {
ThreadState* ts = static_cast<ThreadState*>(arg);
- gpr_tls_set(&g_this_thread_state, reinterpret_cast<intptr_t>(ts));
+ g_this_thread_state = ts;
- grpc_core::ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
+ ExecCtx exec_ctx(GRPC_EXEC_CTX_FLAG_IS_INTERNAL_THREAD);
size_t subtract_depth = 0;
for (;;) {
@@ -248,28 +246,22 @@ void Executor::ThreadMain(void* arg) {
break;
}
- GRPC_STATS_INC_EXECUTOR_QUEUE_DRAINED();
grpc_closure_list closures = ts->elems;
ts->elems = GRPC_CLOSURE_LIST_INIT;
gpr_mu_unlock(&ts->mu);
EXECUTOR_TRACE("(%s) [%" PRIdPTR "]: execute", ts->name, ts->id);
- grpc_core::ExecCtx::Get()->InvalidateNow();
+ ExecCtx::Get()->InvalidateNow();
subtract_depth = RunClosures(ts->name, closures);
}
- gpr_tls_set(&g_this_thread_state, reinterpret_cast<intptr_t>(nullptr));
+ g_this_thread_state = nullptr;
}
-void Executor::Enqueue(grpc_closure* closure, grpc_error* error,
+void Executor::Enqueue(grpc_closure* closure, grpc_error_handle error,
bool is_short) {
bool retry_push;
- if (is_short) {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_SHORT_ITEMS();
- } else {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_LONG_ITEMS();
- }
do {
retry_push = false;
@@ -285,22 +277,17 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error* error,
#else
EXECUTOR_TRACE("(%s) schedule %p inline", name_, closure);
#endif
- grpc_closure_list_append(grpc_core::ExecCtx::Get()->closure_list(),
- closure, error);
+ grpc_closure_list_append(ExecCtx::Get()->closure_list(), closure, error);
return;
}
- if (grpc_iomgr_add_closure_to_background_poller(closure, error)) {
+ if (grpc_iomgr_platform_add_closure_to_background_poller(closure, error)) {
return;
}
- ThreadState* ts =
- reinterpret_cast<ThreadState*>(gpr_tls_get(&g_this_thread_state));
+ ThreadState* ts = g_this_thread_state;
if (ts == nullptr) {
- ts = &thd_state_[GPR_HASH_POINTER(grpc_core::ExecCtx::Get(),
- cur_thread_count)];
- } else {
- GRPC_STATS_INC_EXECUTOR_SCHEDULED_TO_SELF();
+ ts = &thd_state_[HashPointer(ExecCtx::Get(), cur_thread_count)];
}
ThreadState* orig_ts = ts;
@@ -353,7 +340,6 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error* error,
// - Note that gpr_cv_signal() won't immediately wakeup the thread. That
// happens after we release the mutex &ts->mu a few lines below
if (grpc_closure_list_empty(ts->elems) && !ts->shutdown) {
- GRPC_STATS_INC_EXECUTOR_WAKEUP_INITIATED();
gpr_cv_signal(&ts->cv);
}
@@ -378,16 +364,12 @@ void Executor::Enqueue(grpc_closure* closure, grpc_error* error,
// always increment num_threads under the 'adding_thread_lock')
gpr_atm_rel_store(&num_threads_, cur_thread_count + 1);
- thd_state_[cur_thread_count].thd = grpc_core::Thread(
- name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]);
+ thd_state_[cur_thread_count].thd =
+ Thread(name_, &Executor::ThreadMain, &thd_state_[cur_thread_count]);
thd_state_[cur_thread_count].thd.Start();
}
gpr_spinlock_unlock(&adding_thread_lock_);
}
-
- if (retry_push) {
- GRPC_STATS_INC_EXECUTOR_PUSH_RETRIES();
- }
} while (retry_push);
}
@@ -415,7 +397,7 @@ void Executor::InitAll() {
EXECUTOR_TRACE0("Executor::InitAll() done");
}
-void Executor::Run(grpc_closure* closure, grpc_error* error,
+void Executor::Run(grpc_closure* closure, grpc_error_handle error,
ExecutorType executor_type, ExecutorJobType job_type) {
executor_enqueue_fns_[static_cast<size_t>(executor_type)]
[static_cast<size_t>(job_type)](closure, error);
@@ -476,6 +458,6 @@ void Executor::SetThreadingDefault(bool enable) {
executors[static_cast<size_t>(ExecutorType::DEFAULT)]->SetThreading(enable);
}
-void grpc_executor_global_init() { gpr_tls_init(&g_this_thread_state); }
+void grpc_executor_global_init() {}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor.h b/contrib/libs/grpc/src/core/lib/iomgr/executor.h
index 288d23de584..c205b8e234d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor.h
@@ -36,7 +36,7 @@ struct ThreadState {
size_t depth; // Number of closures in the closure list
bool shutdown;
bool queued_long_job;
- grpc_core::Thread thd;
+ Thread thd;
};
enum class ExecutorType {
@@ -70,7 +70,7 @@ class Executor {
/** Enqueue the closure onto the executor. is_short is true if the closure is
* a short job (i.e expected to not block and complete quickly) */
- void Enqueue(grpc_closure* closure, grpc_error* error, bool is_short);
+ void Enqueue(grpc_closure* closure, grpc_error_handle error, bool is_short);
// TODO(sreek): Currently we have two executors (available globally): The
// default executor and the resolver executor.
@@ -83,7 +83,7 @@ class Executor {
// Initialize ALL the executors
static void InitAll();
- static void Run(grpc_closure* closure, grpc_error* error,
+ static void Run(grpc_closure* closure, grpc_error_handle error,
ExecutorType executor_type = ExecutorType::DEFAULT,
ExecutorJobType job_type = ExecutorJobType::SHORT);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc b/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
index 74096a4c5b0..e4d9d21dc31 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.cc
@@ -29,7 +29,8 @@ inline void* InfLenFIFOQueue::PopFront() {
// mutex. This function will assume that there is at least one element in the
// queue (i.e. queue_head_->content is valid).
void* result = queue_head_->content;
- count_.Store(count_.Load(MemoryOrder::RELAXED) - 1, MemoryOrder::RELAXED);
+ count_.store(count_.load(std::memory_order_relaxed) - 1,
+ std::memory_order_relaxed);
// Updates Stats when trace flag turned on.
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace)) {
@@ -40,7 +41,7 @@ inline void* InfLenFIFOQueue::PopFront() {
stats_.max_queue_time = gpr_time_max(
gpr_convert_clock_type(stats_.max_queue_time, GPR_TIMESPAN), wait_time);
- if (count_.Load(MemoryOrder::RELAXED) == 0) {
+ if (count_.load(std::memory_order_relaxed) == 0) {
stats_.busy_queue_time =
gpr_time_add(stats_.busy_queue_time,
gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), busy_time));
@@ -57,7 +58,7 @@ inline void* InfLenFIFOQueue::PopFront() {
queue_head_ = queue_head_->next;
// Signal waiting thread
- if (count_.Load(MemoryOrder::RELAXED) > 0) {
+ if (count_.load(std::memory_order_relaxed) > 0) {
TopWaiter()->cv.Signal();
}
@@ -66,7 +67,7 @@ inline void* InfLenFIFOQueue::PopFront() {
InfLenFIFOQueue::Node* InfLenFIFOQueue::AllocateNodes(int num) {
num_nodes_ = num_nodes_ + num;
- Node* new_chunk = static_cast<Node*>(gpr_zalloc(sizeof(Node) * num));
+ Node* new_chunk = new Node[num];
new_chunk[0].next = &new_chunk[1];
new_chunk[num - 1].prev = &new_chunk[num - 2];
for (int i = 1; i < num - 1; ++i) {
@@ -78,8 +79,7 @@ InfLenFIFOQueue::Node* InfLenFIFOQueue::AllocateNodes(int num) {
InfLenFIFOQueue::InfLenFIFOQueue() {
delete_list_size_ = kDeleteListInitSize;
- delete_list_ =
- static_cast<Node**>(gpr_zalloc(sizeof(Node*) * delete_list_size_));
+ delete_list_ = new Node*[delete_list_size_];
Node* new_chunk = AllocateNodes(kQueueInitNumNodes);
delete_list_[delete_list_count_++] = new_chunk;
@@ -92,17 +92,17 @@ InfLenFIFOQueue::InfLenFIFOQueue() {
}
InfLenFIFOQueue::~InfLenFIFOQueue() {
- GPR_ASSERT(count_.Load(MemoryOrder::RELAXED) == 0);
+ GPR_ASSERT(count_.load(std::memory_order_relaxed) == 0);
for (size_t i = 0; i < delete_list_count_; ++i) {
- gpr_free(delete_list_[i]);
+ delete[] delete_list_[i];
}
- gpr_free(delete_list_);
+ delete[] delete_list_;
}
void InfLenFIFOQueue::Put(void* elem) {
MutexLock l(&mu_);
- int curr_count = count_.Load(MemoryOrder::RELAXED);
+ int curr_count = count_.load(std::memory_order_relaxed);
if (queue_tail_ == queue_head_ && curr_count != 0) {
// List is full. Expands list to double size by inserting new chunk of nodes
@@ -111,8 +111,7 @@ void InfLenFIFOQueue::Put(void* elem) {
// Expands delete list on full.
if (delete_list_count_ == delete_list_size_) {
delete_list_size_ = delete_list_size_ * 2;
- delete_list_ = static_cast<Node**>(
- gpr_realloc(delete_list_, sizeof(Node*) * delete_list_size_));
+ delete_list_ = new Node*[delete_list_size_];
}
new_chunk[0].prev = queue_tail_->prev;
new_chunk[curr_count - 1].next = queue_head_;
@@ -134,7 +133,7 @@ void InfLenFIFOQueue::Put(void* elem) {
queue_tail_->insert_time = current_time;
}
- count_.Store(curr_count + 1, MemoryOrder::RELAXED);
+ count_.store(curr_count + 1, std::memory_order_relaxed);
queue_tail_ = queue_tail_->next;
TopWaiter()->cv.Signal();
@@ -143,7 +142,7 @@ void InfLenFIFOQueue::Put(void* elem) {
void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) {
MutexLock l(&mu_);
- if (count_.Load(MemoryOrder::RELAXED) == 0) {
+ if (count_.load(std::memory_order_relaxed) == 0) {
gpr_timespec start_time;
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace) &&
wait_time != nullptr) {
@@ -154,14 +153,14 @@ void* InfLenFIFOQueue::Get(gpr_timespec* wait_time) {
PushWaiter(&self);
do {
self.cv.Wait(&mu_);
- } while (count_.Load(MemoryOrder::RELAXED) == 0);
+ } while (count_.load(std::memory_order_relaxed) == 0);
RemoveWaiter(&self);
if (GRPC_TRACE_FLAG_ENABLED(grpc_thread_pool_trace) &&
wait_time != nullptr) {
*wait_time = gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), start_time);
}
}
- GPR_DEBUG_ASSERT(count_.Load(MemoryOrder::RELAXED) > 0);
+ GPR_DEBUG_ASSERT(count_.load(std::memory_order_relaxed) > 0);
return PopFront();
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.h b/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
index 46e88b8c9dc..f3bc346e487 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor/mpmcqueue.h
@@ -21,8 +21,9 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
+
#include "src/core/lib/debug/stats.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/sync.h"
namespace grpc_core {
@@ -70,18 +71,13 @@ class InfLenFIFOQueue : public MPMCQueueInterface {
// Returns number of elements in queue currently.
// There might be concurrently add/remove on queue, so count might change
// quickly.
- int count() const override { return count_.Load(MemoryOrder::RELAXED); }
+ int count() const override { return count_.load(std::memory_order_relaxed); }
struct Node {
- Node* next; // Linking
- Node* prev;
- void* content; // Points to actual element
+ Node* next = nullptr; // Linking
+ Node* prev = nullptr;
+ void* content = nullptr; // Points to actual element
gpr_timespec insert_time; // Time for stats
-
- Node() {
- next = prev = nullptr;
- content = nullptr;
- }
};
// For test purpose only. Returns number of nodes allocated in queue.
@@ -157,7 +153,7 @@ class InfLenFIFOQueue : public MPMCQueueInterface {
Node* queue_head_ = nullptr; // Head of the queue, remove position
Node* queue_tail_ = nullptr; // End of queue, insert position
- Atomic<int> count_{0}; // Number of elements in queue
+ std::atomic<int> count_{0}; // Number of elements in queue
int num_nodes_ = 0; // Number of nodes allocated
Stats stats_; // Stats info
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.cc b/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.cc
index 859c49a3eab..8bd954ccd0c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.cc
@@ -41,8 +41,7 @@ void ThreadPoolWorker::Run() {
break;
}
// Runs closure
- auto* closure =
- static_cast<grpc_experimental_completion_queue_functor*>(elem);
+ auto* closure = static_cast<grpc_completion_queue_functor*>(elem);
closure->functor_run(closure, closure->internal_success);
}
}
@@ -73,7 +72,7 @@ size_t ThreadPool::DefaultStackSize() {
void ThreadPool::AssertHasNotBeenShutDown() {
// For debug checking purpose, using RELAXED order is sufficient.
- GPR_DEBUG_ASSERT(!shut_down_.Load(MemoryOrder::RELAXED));
+ GPR_DEBUG_ASSERT(!shut_down_.load(std::memory_order_relaxed));
}
ThreadPool::ThreadPool(int num_threads) : num_threads_(num_threads) {
@@ -103,7 +102,7 @@ ThreadPool::ThreadPool(int num_threads, const char* thd_name,
ThreadPool::~ThreadPool() {
// For debug checking purpose, using RELAXED order is sufficient.
- shut_down_.Store(true, MemoryOrder::RELAXED);
+ shut_down_.store(true, std::memory_order_relaxed);
for (int i = 0; i < num_threads_; ++i) {
queue_->Put(nullptr);
@@ -120,7 +119,7 @@ ThreadPool::~ThreadPool() {
delete queue_;
}
-void ThreadPool::Add(grpc_experimental_completion_queue_functor* closure) {
+void ThreadPool::Add(grpc_completion_queue_functor* closure) {
AssertHasNotBeenShutDown();
queue_->Put(static_cast<void*>(closure));
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.h b/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.h
index 66218b52b62..e0e5eb07cd0 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/executor/threadpool.h
@@ -43,7 +43,7 @@ class ThreadPoolInterface {
// current thread to be blocked (in case of unable to schedule).
// Closure should contain a function pointer and arguments it will take, more
// details for closure struct at /grpc/include/grpc/impl/codegen/grpc_types.h
- virtual void Add(grpc_experimental_completion_queue_functor* closure) = 0;
+ virtual void Add(grpc_completion_queue_functor* closure) = 0;
// Returns the current number of pending closures
virtual int num_pending_closures() const = 0;
@@ -120,7 +120,7 @@ class ThreadPool : public ThreadPoolInterface {
// Adds given closure into pending queue immediately. Since closure queue has
// infinite length, this routine will not block.
- void Add(grpc_experimental_completion_queue_functor* closure) override;
+ void Add(grpc_completion_queue_functor* closure) override;
int num_pending_closures() const override;
int pool_capacity() const override;
@@ -134,7 +134,8 @@ class ThreadPool : public ThreadPoolInterface {
ThreadPoolWorker** threads_ = nullptr; // Array of worker threads
MPMCQueueInterface* queue_ = nullptr; // Closure queue
- Atomic<bool> shut_down_{false}; // Destructor has been called if set to true
+ std::atomic<bool> shut_down_{
+ false}; // Destructor has been called if set to true
void SharedThreadPoolConstructor();
// For ThreadPool, default stack size for mobile platform is 1952K. for other
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
index f1ba20dcec7..8916eac984e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_posix.cc
@@ -22,13 +22,13 @@
#if GRPC_IF_NAMETOINDEX == 1 && defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
-#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
-
#include <errno.h>
#include <net/if.h>
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
uint32_t grpc_if_nametoindex(char* name) {
uint32_t out = if_nametoindex(name);
if (out == 0) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc b/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
index 08644cccf3e..63062433e6b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/grpc_if_nametoindex_unsupported.cc
@@ -22,10 +22,10 @@
#if GRPC_IF_NAMETOINDEX == 0 || !defined(GRPC_POSIX_SOCKET_IF_NAMETOINDEX)
-#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/iomgr/grpc_if_nametoindex.h"
+
uint32_t grpc_if_nametoindex(char* name) {
gpr_log(GPR_DEBUG,
"Not attempting to convert interface name %s to index for current "
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/internal_errqueue.cc b/contrib/libs/grpc/src/core/lib/iomgr/internal_errqueue.cc
index b68c66b7575..ac644b2f43f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/internal_errqueue.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/internal_errqueue.cc
@@ -18,10 +18,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/internal_errqueue.h"
#include <grpc/impl/codegen/log.h>
-#include "src/core/lib/iomgr/internal_errqueue.h"
+
+#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_TCP
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iocp_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/iocp_windows.cc
index 29a05ee3099..d4c76eca8a2 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iocp_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iocp_windows.cc
@@ -23,6 +23,7 @@
#ifdef GRPC_WINSOCK_SOCKET
#include <winsock2.h>
+
#include <limits>
#include <grpc/support/alloc.h>
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr.cc
index 02646db428d..8bfcebf9996 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr.cc
@@ -53,7 +53,9 @@ static bool g_grpc_abort_on_leaks;
void grpc_iomgr_init() {
grpc_core::ExecCtx exec_ctx;
- grpc_determine_iomgr_platform();
+ if (!grpc_have_determined_iomgr_platform()) {
+ grpc_set_default_iomgr_platform();
+ }
g_shutdown = 0;
gpr_mu_init(&g_mu);
gpr_cv_init(&g_rcv);
@@ -94,7 +96,6 @@ void grpc_iomgr_shutdown() {
{
grpc_timer_manager_shutdown();
grpc_iomgr_platform_flush();
- grpc_core::Executor::ShutdownAll();
gpr_mu_lock(&g_mu);
g_shutdown = 1;
@@ -149,6 +150,7 @@ void grpc_iomgr_shutdown() {
gpr_mu_unlock(&g_mu);
grpc_timer_list_shutdown();
grpc_core::ExecCtx::Get()->Flush();
+ grpc_core::Executor::ShutdownAll();
}
/* ensure all threads have left g_mu */
@@ -169,7 +171,7 @@ bool grpc_iomgr_is_any_background_poller_thread() {
}
bool grpc_iomgr_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error) {
+ grpc_error_handle error) {
return grpc_iomgr_platform_add_closure_to_background_poller(closure, error);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr.h b/contrib/libs/grpc/src/core/lib/iomgr/iomgr.h
index e02f15e551c..190942bbeed 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
+#include <stdlib.h>
+
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/port.h"
-#include <stdlib.h>
-
/** Initializes the iomgr. */
void grpc_iomgr_init();
@@ -52,7 +52,7 @@ bool grpc_iomgr_is_any_background_poller_thread();
* that the closure may or may not run yet when this function returns, and the
* closure should not be blocking or long-running. */
bool grpc_iomgr_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
/* Exposed only for testing */
size_t grpc_iomgr_count_objects_for_testing();
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.cc
index 684044a5bbf..70f4e1b7b13 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.cc
@@ -18,16 +18,16 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/iomgr_custom.h"
#include <grpc/support/thd_id.h>
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/pollset_custom.h"
#include "src/core/lib/iomgr/pollset_set_custom.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/resolve_address_custom.h"
gpr_thd_id g_init_thread;
@@ -45,7 +45,7 @@ static bool iomgr_platform_is_any_background_poller_thread(void) {
return false;
}
static bool iomgr_platform_add_closure_to_background_poller(
- grpc_closure* /*closure*/, grpc_error* /*error*/) {
+ grpc_closure* /*closure*/, grpc_error_handle /*error*/) {
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.h
index e6a88843e5c..36b75b8e8dd 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_custom.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
+#include <grpc/support/thd_id.h>
+
#include "src/core/lib/iomgr/pollset_custom.h"
#include "src/core/lib/iomgr/resolve_address_custom.h"
#include "src/core/lib/iomgr/tcp_custom.h"
#include "src/core/lib/iomgr/timer_custom.h"
-#include <grpc/support/thd_id.h>
-
/* The thread ID of the thread on which grpc was initialized. Used to verify
* that all calls into the custom iomgr are made on that same thread */
extern gpr_thd_id g_init_thread;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc
index 896d9fce67c..87ec71ad577 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.cc
@@ -18,22 +18,18 @@
#include <grpc/support/port_platform.h>
-#include <stddef.h>
-
#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_manager.h"
+
+#include <stddef.h>
static grpc_iomgr_platform_vtable* iomgr_platform_vtable = nullptr;
-void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
- iomgr_platform_vtable = vtable;
+bool grpc_have_determined_iomgr_platform() {
+ return iomgr_platform_vtable != nullptr;
}
-void grpc_determine_iomgr_platform() {
- if (iomgr_platform_vtable == nullptr) {
- grpc_set_default_iomgr_platform();
- }
+void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable) {
+ iomgr_platform_vtable = vtable;
}
void grpc_iomgr_platform_init() { iomgr_platform_vtable->init(); }
@@ -50,8 +46,8 @@ bool grpc_iomgr_platform_is_any_background_poller_thread() {
return iomgr_platform_vtable->is_any_background_poller_thread();
}
-bool grpc_iomgr_platform_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error) {
+bool grpc_iomgr_platform_add_closure_to_background_poller(
+ grpc_closure* closure, grpc_error_handle error) {
return iomgr_platform_vtable->add_closure_to_background_poller(closure,
error);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.h b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.h
index 17607f98f11..b9e7eacbc90 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_internal.h
@@ -23,7 +23,8 @@
#include <stdbool.h>
-#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
typedef struct grpc_iomgr_object {
char* name;
@@ -38,13 +39,13 @@ typedef struct grpc_iomgr_platform_vtable {
void (*shutdown_background_closure)(void);
bool (*is_any_background_poller_thread)(void);
bool (*add_closure_to_background_poller)(grpc_closure* closure,
- grpc_error* error);
+ grpc_error_handle error);
} grpc_iomgr_platform_vtable;
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
void grpc_iomgr_unregister_object(grpc_iomgr_object* obj);
-void grpc_determine_iomgr_platform();
+bool grpc_have_determined_iomgr_platform();
void grpc_set_iomgr_platform_vtable(grpc_iomgr_platform_vtable* vtable);
@@ -65,8 +66,8 @@ bool grpc_iomgr_platform_is_any_background_poller_thread(void);
/** Return true if the closure is registered into the background poller. Note
* that the closure may or may not run yet when this function returns, and the
* closure should not be blocking or long-running. */
-bool grpc_iomgr_platform_add_closure_to_background_poller(grpc_closure* closure,
- grpc_error* error);
+bool grpc_iomgr_platform_add_closure_to_background_poller(
+ grpc_closure* closure, grpc_error_handle error);
bool grpc_iomgr_abort_on_leaks(void);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc
index 5e778814905..2450ef0beee 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix.cc
@@ -41,11 +41,13 @@ extern grpc_address_resolver_vtable grpc_posix_resolver_vtable;
static void iomgr_platform_init(void) {
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
+ grpc_tcp_posix_init();
}
static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) {
+ grpc_tcp_posix_shutdown();
grpc_event_engine_shutdown();
grpc_wakeup_fd_global_destroy();
}
@@ -59,7 +61,7 @@ static bool iomgr_platform_is_any_background_poller_thread(void) {
}
static bool iomgr_platform_add_closure_to_background_poller(
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure, grpc_error_handle error) {
return grpc_add_closure_to_background_poller(closure, error);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
index 9db5e2235f6..27af38e4b0c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_posix_cfstream.cc
@@ -72,7 +72,7 @@ static bool apple_iomgr_platform_is_any_background_poller_thread(void) {
}
static bool apple_iomgr_platform_add_closure_to_background_poller(
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure, grpc_error_handle error) {
return false;
}
@@ -84,7 +84,43 @@ static grpc_iomgr_platform_vtable apple_vtable = {
apple_iomgr_platform_is_any_background_poller_thread,
apple_iomgr_platform_add_closure_to_background_poller};
+namespace {
+struct CFStreamEnv {
+ bool enable_cfstream;
+ bool enable_cfstream_run_loop;
+};
+
+// Parses environment variables for CFStream specific settings
+CFStreamEnv ParseEnvForCFStream() {
+ CFStreamEnv env;
+ char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
+ env.enable_cfstream =
+ enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
+ char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
+ // CFStream run-loop is disabled by default. The user has to enable it
+ // explicitly with environment variable.
+ env.enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
+ enable_cfstream_run_loop_str[0] == '1';
+ return env;
+}
+
+void MaybeInitializeTcpPosix(void) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
+ grpc_tcp_posix_init();
+ }
+}
+
+void MaybeShutdownTcpPosix(void) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.enable_cfstream || !env.enable_cfstream_run_loop) {
+ grpc_tcp_posix_shutdown();
+ }
+}
+} // namespace
+
static void iomgr_platform_init(void) {
+ MaybeInitializeTcpPosix();
grpc_wakeup_fd_global_init();
grpc_event_engine_init();
}
@@ -94,6 +130,7 @@ static void iomgr_platform_flush(void) {}
static void iomgr_platform_shutdown(void) {
grpc_event_engine_shutdown();
grpc_wakeup_fd_global_destroy();
+ MaybeShutdownTcpPosix();
}
static void iomgr_platform_shutdown_background_closure(void) {
@@ -105,7 +142,7 @@ static bool iomgr_platform_is_any_background_poller_thread(void) {
}
static bool iomgr_platform_add_closure_to_background_poller(
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure, grpc_error_handle error) {
return grpc_add_closure_to_background_poller(closure, error);
}
@@ -118,22 +155,15 @@ static grpc_iomgr_platform_vtable vtable = {
iomgr_platform_add_closure_to_background_poller};
void grpc_set_default_iomgr_platform() {
- char* enable_cfstream_str = getenv(grpc_cfstream_env_var);
- bool enable_cfstream =
- enable_cfstream_str == nullptr || enable_cfstream_str[0] != '0';
- char* enable_cfstream_run_loop_str = getenv(grpc_cfstream_run_loop_env_var);
- // CFStream run-loop is disabled by default. The user has to enable it
- // explicitly with environment variable.
- bool enable_cfstream_run_loop = enable_cfstream_run_loop_str != nullptr &&
- enable_cfstream_run_loop_str[0] == '1';
- if (!enable_cfstream) {
+ CFStreamEnv env = ParseEnvForCFStream();
+ if (!env.enable_cfstream) {
// Use POSIX sockets for both client and server
grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
grpc_set_pollset_vtable(&grpc_posix_pollset_vtable);
grpc_set_pollset_set_vtable(&grpc_posix_pollset_set_vtable);
grpc_set_iomgr_platform_vtable(&vtable);
- } else if (enable_cfstream && !enable_cfstream_run_loop) {
+ } else if (env.enable_cfstream && !env.enable_cfstream_run_loop) {
// Use CFStream with dispatch queue for client; use POSIX sockets for server
grpc_set_tcp_client_impl(&grpc_cfstream_client_vtable);
grpc_set_tcp_server_impl(&grpc_posix_tcp_server_vtable);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_uv.cc
deleted file mode 100644
index a617239678e..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_uv.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#if defined(GRPC_CUSTOM_SOCKET) && defined(GRPC_UV)
-
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/pollset_custom.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-extern grpc_socket_vtable grpc_uv_socket_vtable;
-extern grpc_custom_resolver_vtable uv_resolver_vtable;
-extern grpc_custom_timer_vtable uv_timer_vtable;
-extern grpc_custom_poller_vtable uv_pollset_vtable;
-
-void grpc_set_default_iomgr_platform() {
- grpc_custom_iomgr_init(&grpc_uv_socket_vtable, &uv_resolver_vtable,
- &uv_timer_vtable, &uv_pollset_vtable);
-}
-
-bool grpc_iomgr_run_in_background() { return false; }
-
-#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc
index 728d4040818..93fdaf85879 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/iomgr_windows.cc
@@ -22,14 +22,13 @@
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr_windows.h"
-
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/iomgr/pollset_windows.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -79,7 +78,7 @@ static bool iomgr_platform_is_any_background_poller_thread(void) {
}
static bool iomgr_platform_add_closure_to_background_poller(
- grpc_closure* closure, grpc_error* error) {
+ grpc_closure* closure, grpc_error_handle error) {
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc b/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
index abc901efbe0..80cac4a5af0 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/is_epollexclusive_available.cc
@@ -18,19 +18,19 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/iomgr/is_epollexclusive_available.h"
-#ifdef GRPC_LINUX_EPOLL_CREATE1
+#include "src/core/lib/iomgr/port.h"
-#include <grpc/support/log.h>
+#ifdef GRPC_LINUX_EPOLL_CREATE1
#include <errno.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <unistd.h>
+#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/sys_epoll_wrapper.h"
/* This polling engine is only relevant on linux kernels supporting epoll() */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc b/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
index 4bed6275dca..9068670118d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/load_file.cc
@@ -30,14 +30,14 @@
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/block_annotate.h"
-grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
- grpc_slice* output) {
+grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator,
+ grpc_slice* output) {
unsigned char* contents = nullptr;
size_t contents_size = 0;
grpc_slice result = grpc_empty_slice();
FILE* file;
size_t bytes_read = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
GRPC_SCHEDULING_START_BLOCKING_REGION;
file = fopen(filename, "rb");
@@ -67,12 +67,12 @@ end:
*output = result;
if (file != nullptr) fclose(file);
if (error != GRPC_ERROR_NONE) {
- grpc_error* error_out =
+ grpc_error_handle error_out =
grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Failed to load file", &error, 1),
GRPC_ERROR_STR_FILENAME,
- grpc_slice_from_copied_string(
- filename)); // TODO(ncteisen), always static?
+
+ filename);
GRPC_ERROR_UNREF(error);
error = error_out;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/load_file.h b/contrib/libs/grpc/src/core/lib/iomgr/load_file.h
index d7f8175aaea..a0206e21a35 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/load_file.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/load_file.h
@@ -29,7 +29,7 @@
/* Loads the content of a file into a slice. add_null_terminator will add
a NULL terminator if non-zero. */
-grpc_error* grpc_load_file(const char* filename, int add_null_terminator,
- grpc_slice* output);
+grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator,
+ grpc_slice* output);
#endif /* GRPC_CORE_LIB_IOMGR_LOAD_FILE_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc b/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc
index b3fd8e0b63f..d41e502984c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.cc
@@ -77,7 +77,11 @@ void LockfreeEvent::DestroyEvent() {
do {
curr = gpr_atm_no_barrier_load(&state_);
if (curr & kShutdownBit) {
- GRPC_ERROR_UNREF((grpc_error*)(curr & ~kShutdownBit));
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(curr & ~kShutdownBit);
+#else
+ GRPC_ERROR_UNREF((grpc_error_handle)(curr & ~kShutdownBit));
+#endif
} else {
GPR_ASSERT(curr == kClosureNotReady || curr == kClosureReady);
}
@@ -139,8 +143,13 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
contains a pointer to the shutdown-error). If the fd is shutdown,
schedule the closure with the shutdown error */
if ((curr & kShutdownBit) > 0) {
- grpc_error* shutdown_err =
- reinterpret_cast<grpc_error*>(curr & ~kShutdownBit);
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ grpc_error_handle shutdown_err =
+ internal::StatusGetFromHeapPtr(curr & ~kShutdownBit);
+#else
+ grpc_error_handle shutdown_err =
+ reinterpret_cast<grpc_error_handle>(curr & ~kShutdownBit);
+#endif
ExecCtx::Run(DEBUG_LOCATION, closure,
GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"FD Shutdown", &shutdown_err, 1));
@@ -159,15 +168,20 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
GPR_UNREACHABLE_CODE(return );
}
-bool LockfreeEvent::SetShutdown(grpc_error* shutdown_error) {
+bool LockfreeEvent::SetShutdown(grpc_error_handle shutdown_error) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ intptr_t status_ptr = internal::StatusAllocHeapPtr(shutdown_error);
+ gpr_atm new_state = status_ptr | kShutdownBit;
+#else
gpr_atm new_state = reinterpret_cast<gpr_atm>(shutdown_error) | kShutdownBit;
+#endif
while (true) {
gpr_atm curr = gpr_atm_no_barrier_load(&state_);
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_DEBUG,
"LockfreeEvent::SetShutdown: %p curr=%" PRIxPTR " err=%s",
- &state_, curr, grpc_error_string(shutdown_error));
+ &state_, curr, grpc_error_std_string(shutdown_error).c_str());
}
switch (curr) {
case kClosureReady:
@@ -184,7 +198,11 @@ bool LockfreeEvent::SetShutdown(grpc_error* shutdown_error) {
/* If fd is already shutdown, we are done */
if ((curr & kShutdownBit) > 0) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ internal::StatusFreeHeapPtr(status_ptr);
+#else
GRPC_ERROR_UNREF(shutdown_error);
+#endif
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.h b/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.h
index f7e855409f6..944f364b422 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/lockfree_event.h
@@ -56,7 +56,7 @@ class LockfreeEvent {
// Sets the shutdown state. If a closure had been provided by NotifyOn and has
// not yet been scheduled, it will be scheduled with \a shutdown_error.
- bool SetShutdown(grpc_error* shutdown_error);
+ bool SetShutdown(grpc_error_handle shutdown_error);
// Signals that the event has been received.
void SetReady();
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_interface.h b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_interface.h
deleted file mode 100644
index b4fbaeb7bbb..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_interface.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H
-#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H
-
-namespace grpc {
-namespace experimental {
-
-class BaseEventManagerInterface {
- public:
- virtual ~BaseEventManagerInterface() {}
-};
-
-class EpollEventManagerInterface : public BaseEventManagerInterface {};
-
-} // namespace experimental
-} // namespace grpc
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_INTERFACE_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
deleted file mode 100644
index c34430aebdb..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/poller/eventmanager_libuv.h"
-
-#include <grpc/support/time.h>
-
-grpc::experimental::LibuvEventManager::Options::Options() : num_workers_(-1) {}
-grpc::experimental::LibuvEventManager::Options::Options(int num_workers)
- : num_workers_(num_workers) {}
-
-grpc::experimental::LibuvEventManager::LibuvEventManager(const Options& options)
- : options_(options) {
- int num_workers = options_.num_workers();
- // Number of workers can't be 0 if we do not accept thread donation.
- // TODO(guantaol): replaces the hard-coded number with a flag.
- if (num_workers <= 0) num_workers = 32;
-
- for (int i = 0; i < num_workers; i++) {
- workers_.emplace_back(
- options_.thread_name_prefix().c_str(),
- [](void* em) { static_cast<LibuvEventManager*>(em)->RunWorkerLoop(); },
- this);
- workers_.back().Start();
- }
-}
-
-grpc::experimental::LibuvEventManager::~LibuvEventManager() {
- Shutdown();
- for (auto& th : workers_) {
- th.Join();
- }
-}
-
-void grpc::experimental::LibuvEventManager::RunWorkerLoop() {
- while (true) {
- // TODO(guantaol): extend the worker loop with real work.
- if (ShouldStop()) return;
- gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
- gpr_time_from_micros(10, GPR_TIMESPAN)));
- }
-}
-
-bool grpc::experimental::LibuvEventManager::ShouldStop() {
- return should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE) != 0;
-}
-
-void grpc::experimental::LibuvEventManager::Shutdown() {
- if (should_stop_.Load(grpc_core::MemoryOrder::ACQUIRE)) {
- return; // Already shut down.
- }
-
- {
- grpc_core::MutexLock lock(&shutdown_mu_);
- while (shutdown_refcount_.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) {
- shutdown_cv_.Wait(&shutdown_mu_);
- }
- }
- should_stop_.Store(true, grpc_core::MemoryOrder::RELEASE);
-}
-
-void grpc::experimental::LibuvEventManager::ShutdownRef() {
- shutdown_refcount_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
-}
-
-void grpc::experimental::LibuvEventManager::ShutdownUnref() {
- if (shutdown_refcount_.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
- grpc_core::MutexLock lock(&shutdown_mu_);
- shutdown_cv_.Signal();
- }
-}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h b/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h
deleted file mode 100644
index d0ca9cdbdc6..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/poller/eventmanager_libuv.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
-#define GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H
-
-#include <grpc/support/port_platform.h>
-
-#include <util/generic/string.h>
-#include <vector>
-
-#include "src/core/lib/gprpp/atomic.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/gprpp/thd.h"
-
-namespace grpc {
-namespace experimental {
-
-class LibuvEventManager {
- public:
- class Options {
- public:
- Options();
- explicit Options(int num_workers);
-
- int num_workers() const { return num_workers_; }
- void set_num_workers(int num) { num_workers_ = num; }
-
- const TString& thread_name_prefix() const {
- return thread_name_prefix_;
- }
- void set_thread_name_prefix(const TString& name) {
- thread_name_prefix_ = name;
- }
-
- private:
- // Number of worker threads to create at startup. If less than 0, uses the
- // default value of 32.
- int num_workers_;
- // Name prefix used for worker.
- TString thread_name_prefix_;
- };
-
- explicit LibuvEventManager(const Options& options);
- virtual ~LibuvEventManager();
-
- void Shutdown();
- void ShutdownRef();
- void ShutdownUnref();
-
- private:
- // Function run by the worker threads.
- void RunWorkerLoop();
-
- // Whether the EventManager has been shut down.
- bool ShouldStop();
-
- const Options options_;
- // Whether the EventManager workers should be stopped.
- grpc_core::Atomic<bool> should_stop_{false};
- // A refcount preventing the EventManager from shutdown.
- grpc_core::Atomic<int> shutdown_refcount_{0};
- // Worker threads of the EventManager.
- std::vector<grpc_core::Thread> workers_;
- // Mutex and condition variable used for shutdown.
- grpc_core::Mutex shutdown_mu_;
- grpc_core::CondVar shutdown_cv_;
-};
-
-} // namespace experimental
-} // namespace grpc
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLER_EVENTMANAGER_LIBUV_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc b/contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc
index dea07cae537..0c1788a6938 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/polling_entity.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/iomgr/polling_entity.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/polling_entity.h"
-
grpc_polling_entity grpc_polling_entity_create_from_pollset_set(
grpc_pollset_set* pollset_set) {
grpc_polling_entity pollent;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset.cc
index ebfef1dbc76..ba2a58d85ae 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset.cc
@@ -42,14 +42,14 @@ void grpc_pollset_destroy(grpc_pollset* pollset) {
grpc_pollset_impl->destroy(pollset);
}
-grpc_error* grpc_pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) {
+grpc_error_handle grpc_pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
return grpc_pollset_impl->work(pollset, worker, deadline);
}
-grpc_error* grpc_pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+grpc_error_handle grpc_pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker) {
return grpc_pollset_impl->kick(pollset, specific_worker);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset.h b/contrib/libs/grpc/src/core/lib/iomgr/pollset.h
index 28472b360d6..7c87a827cdf 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset.h
@@ -44,10 +44,10 @@ typedef struct grpc_pollset_vtable {
void (*init)(grpc_pollset* pollset, gpr_mu** mu);
void (*shutdown)(grpc_pollset* pollset, grpc_closure* closure);
void (*destroy)(grpc_pollset* pollset);
- grpc_error* (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
- grpc_millis deadline);
- grpc_error* (*kick)(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker);
+ grpc_error_handle (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
+ grpc_millis deadline);
+ grpc_error_handle (*kick)(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker);
size_t (*pollset_size)(void);
} grpc_pollset_vtable;
@@ -86,14 +86,14 @@ void grpc_pollset_destroy(grpc_pollset* pollset);
May call grpc_closure_list_run on grpc_closure_list, without holding the
pollset
lock */
-grpc_error* grpc_pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) GRPC_MUST_USE_RESULT;
/* Break one polling thread out of polling work for this pollset.
If specific_worker is non-NULL, then kick that worker. */
-grpc_error* grpc_pollset_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker)
+grpc_error_handle grpc_pollset_kick(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker)
GRPC_MUST_USE_RESULT;
#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc
index 98c8e64e2f0..f70c2bcf3d5 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.cc
@@ -18,7 +18,7 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/pollset_custom.h"
#include <stddef.h>
#include <string.h>
@@ -27,14 +27,13 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/iomgr/pollset_custom.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/debug/trace.h"
-
static grpc_custom_poller_vtable* poller_vtable;
struct grpc_pollset {
@@ -63,9 +62,9 @@ static void pollset_destroy(grpc_pollset* pollset) {
gpr_mu_destroy(&pollset->mu);
}
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** /*worker_hdl*/,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** /*worker_hdl*/,
+ grpc_millis deadline) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
gpr_mu_unlock(&pollset->mu);
grpc_millis now = grpc_core::ExecCtx::Get()->Now();
@@ -77,18 +76,18 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
// control back to the application
grpc_core::ExecCtx* curr = grpc_core::ExecCtx::Get();
grpc_core::ExecCtx::Set(nullptr);
- poller_vtable->poll(static_cast<size_t>(timeout));
+ grpc_error_handle err = poller_vtable->poll(static_cast<size_t>(timeout));
grpc_core::ExecCtx::Set(curr);
grpc_core::ExecCtx::Get()->InvalidateNow();
if (grpc_core::ExecCtx::Get()->HasWork()) {
grpc_core::ExecCtx::Get()->Flush();
}
gpr_mu_lock(&pollset->mu);
- return GRPC_ERROR_NONE;
+ return err;
}
-static grpc_error* pollset_kick(grpc_pollset* /*pollset*/,
- grpc_pollset_worker* /*specific_worker*/) {
+static grpc_error_handle pollset_kick(
+ grpc_pollset* /*pollset*/, grpc_pollset_worker* /*specific_worker*/) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
poller_vtable->kick();
return GRPC_ERROR_NONE;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.h
index 9e2027f7f4a..f5c836e5239 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_custom.h
@@ -23,9 +23,11 @@
#include <stddef.h>
+#include "src/core/lib/iomgr/error.h"
+
typedef struct grpc_custom_poller_vtable {
void (*init)();
- void (*poll)(size_t timeout_ms);
+ grpc_error_handle (*poll)(size_t timeout_ms);
void (*kick)();
void (*shutdown)();
} grpc_custom_poller_vtable;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
index 0cc90891c4c..db105bfd9e2 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_custom.cc
@@ -18,9 +18,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/iomgr/port.h"
static grpc_pollset_set* pollset_set_create(void) {
return reinterpret_cast<grpc_pollset_set*>(static_cast<intptr_t>(0xdeafbeef));
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc
index bb9e7f5d28d..1b105a2453b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_set_windows.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <stdint.h>
+
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.cc
deleted file mode 100644
index 5421a584e95..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include "src/core/lib/iomgr/pollset_custom.h"
-
-#error #include <uv.h>
-
-/* Indicates that grpc_pollset_work should run an iteration of the UV loop
- before running callbacks. This defaults to 1, and should be disabled if
- grpc_pollset_work will be called within the callstack of uv_run */
-int grpc_pollset_work_run_loop = 1;
-
-static bool g_kicked = false;
-
-typedef struct uv_poller_handle {
- uv_timer_t poll_timer;
- uv_timer_t kick_timer;
- int refs;
-} uv_poller_handle;
-
-static uv_poller_handle* g_handle;
-
-static void init() {
- g_handle = (uv_poller_handle*)gpr_malloc(sizeof(uv_poller_handle));
- g_handle->refs = 2;
- uv_timer_init(uv_default_loop(), &g_handle->poll_timer);
- uv_timer_init(uv_default_loop(), &g_handle->kick_timer);
-}
-
-static void empty_timer_cb(uv_timer_t* handle) {}
-
-static void kick_timer_cb(uv_timer_t* handle) { g_kicked = false; }
-
-static void run_loop(size_t timeout) {
- if (grpc_pollset_work_run_loop) {
- if (timeout == 0) {
- uv_run(uv_default_loop(), UV_RUN_NOWAIT);
- } else {
- uv_timer_start(&g_handle->poll_timer, empty_timer_cb, timeout, 0);
- uv_run(uv_default_loop(), UV_RUN_ONCE);
- uv_timer_stop(&g_handle->poll_timer);
- }
- }
-}
-
-static void kick() {
- if (!g_kicked) {
- g_kicked = true;
- uv_timer_start(&g_handle->kick_timer, kick_timer_cb, 0, 0);
- }
-}
-
-static void close_timer_cb(uv_handle_t* handle) {
- g_handle->refs--;
- if (g_handle->refs == 0) {
- gpr_free(g_handle);
- }
-}
-
-static void shutdown() {
- uv_close((uv_handle_t*)&g_handle->poll_timer, close_timer_cb);
- uv_close((uv_handle_t*)&g_handle->kick_timer, close_timer_cb);
- if (grpc_pollset_work_run_loop) {
- GPR_ASSERT(uv_run(uv_default_loop(), UV_RUN_DEFAULT) == 0);
- }
-}
-
-grpc_custom_poller_vtable uv_pollset_vtable = {init, run_loop, kick, shutdown};
-
-#endif /* GRPC_UV */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.h b/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.h
deleted file mode 100644
index de82bcc1d31..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_uv.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
-#define GRPC_CORE_LIB_IOMGR_POLLSET_UV_H
-
-extern int grpc_pollset_work_run_loop;
-
-typedef struct grpc_custom_poller_vtable {
- void (*init)(void);
- void (*run_loop)(int blocking);
-} grpc_custom_poller_vtable;
-
-void grpc_custom_pollset_global_init(grpc_custom_poller_vtable* vtable);
-void grpc_custom_pollset_global_shutdown(void);
-
-#endif /* GRPC_CORE_LIB_IOMGR_POLLSET_UV_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc
index 184c330cf7c..f8758a3f73e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/pollset_windows.cc
@@ -106,9 +106,9 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
static void pollset_destroy(grpc_pollset* pollset) {}
-static grpc_error* pollset_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker_hdl,
- grpc_millis deadline) {
+static grpc_error_handle pollset_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker_hdl,
+ grpc_millis deadline) {
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
@@ -183,8 +183,8 @@ done:
return GRPC_ERROR_NONE;
}
-static grpc_error* pollset_kick(grpc_pollset* p,
- grpc_pollset_worker* specific_worker) {
+static grpc_error_handle pollset_kick(grpc_pollset* p,
+ grpc_pollset_worker* specific_worker) {
bool should_kick_global = false;
if (specific_worker != NULL) {
if (specific_worker == GRPC_POLLSET_KICK_BROADCAST) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/port.h b/contrib/libs/grpc/src/core/lib/iomgr/port.h
index 2a8d67b261c..3e32429d41f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/port.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/port.h
@@ -15,17 +15,11 @@
* limitations under the License.
*
*/
-
-#include <grpc/support/port_platform.h>
-
#ifndef GRPC_CORE_LIB_IOMGR_PORT_H
#define GRPC_CORE_LIB_IOMGR_PORT_H
-#ifdef GRPC_UV
-#ifndef GRPC_CUSTOM_SOCKET
-#define GRPC_CUSTOM_SOCKET
-#endif
-#endif
+#include <grpc/support/port_platform.h>
+
/* This needs to be separate from the other conditions because it needs to
* apply to custom sockets too */
#ifdef GPR_WINDOWS
@@ -33,6 +27,8 @@
#endif
#if defined(GRPC_CUSTOM_SOCKET)
// Do Nothing
+#elif defined(GRPC_USE_EVENT_ENGINE)
+// Do Nothing
#elif defined(GPR_WINDOWS)
#define GRPC_WINSOCK_SOCKET 1
#define GRPC_WINDOWS_SOCKETUTILS 1
@@ -189,10 +185,11 @@
#endif
#if defined(GRPC_POSIX_SOCKET) + defined(GRPC_WINSOCK_SOCKET) + \
- defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) != \
+ defined(GRPC_CUSTOM_SOCKET) + defined(GRPC_CFSTREAM) + \
+ defined(GRPC_USE_EVENT_ENGINE) != \
1
#error \
- "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET"
+ "Must define exactly one of GRPC_POSIX_SOCKET, GRPC_WINSOCK_SOCKET, GRPC_CUSTOM_SOCKET, GRPC_CFSTREAM, GRPC_USE_EVENT_ENGINE"
#endif
#ifdef GRPC_POSIX_SOCKET
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/python_util.h b/contrib/libs/grpc/src/core/lib/iomgr/python_util.h
index 05d72a58ad0..5b7eeccbd2f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/python_util.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/python_util.h
@@ -23,13 +23,14 @@
#include <grpc/impl/codegen/slice.h>
#include <grpc/status.h>
+
#include "src/core/lib/iomgr/error.h"
// These are only used by the gRPC Python extensions.
// They are easier to define here (rather than in Cython)
// because Cython doesn't handle #defines well.
-inline grpc_error* grpc_socket_error(char* error) {
+inline grpc_error_handle grpc_socket_error(char* error) {
return grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(error),
GRPC_ERROR_INT_GRPC_STATUS,
GRPC_STATUS_UNAVAILABLE);
@@ -43,4 +44,4 @@ inline int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i) {
return GRPC_SLICE_LENGTH(buffer->slices[i]);
}
-#endif
+#endif // GRPC_CORE_LIB_IOMGR_PYTHON_UTIL_H
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc
index 7479836df74..a2e159a6703 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.cc
@@ -15,12 +15,17 @@
* limitations under the License.
*
*/
-
#include <grpc/support/port_platform.h>
-#include <grpc/support/alloc.h>
#include "src/core/lib/iomgr/resolve_address.h"
+#include <grpc/event_engine/event_engine.h>
+#include <grpc/support/alloc.h>
+
+namespace grpc_core {
+const char* kDefaultSecurePort = "https";
+} // namespace grpc_core
+
grpc_address_resolver_vtable* grpc_resolve_address_impl;
void grpc_set_resolver_impl(grpc_address_resolver_vtable* vtable) {
@@ -42,9 +47,9 @@ void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addresses) {
gpr_free(addresses);
}
-grpc_error* grpc_blocking_resolve_address(const char* name,
- const char* default_port,
- grpc_resolved_addresses** addresses) {
+grpc_error_handle grpc_blocking_resolve_address(
+ const char* name, const char* default_port,
+ grpc_resolved_addresses** addresses) {
return grpc_resolve_address_impl->blocking_resolve_address(name, default_port,
addresses);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.h b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.h
index 57126c7c938..b9e25b0f77e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address.h
@@ -25,10 +25,6 @@
#include "src/core/lib/iomgr/port.h"
-#ifdef GRPC_UV
-#error #include <uv.h>
-#endif
-
#ifdef GRPC_WINSOCK_SOCKET
#include <ws2tcpip.h>
#endif
@@ -49,14 +45,20 @@ struct grpc_resolved_addresses {
size_t naddrs;
grpc_resolved_address* addrs;
};
+
+namespace grpc_core {
+extern const char* kDefaultSecurePort;
+constexpr int kDefaultSecurePortInt = 443;
+} // namespace grpc_core
+
typedef struct grpc_address_resolver_vtable {
void (*resolve_address)(const char* addr, const char* default_port,
grpc_pollset_set* interested_parties,
grpc_closure* on_done,
grpc_resolved_addresses** addresses);
- grpc_error* (*blocking_resolve_address)(const char* name,
- const char* default_port,
- grpc_resolved_addresses** addresses);
+ grpc_error_handle (*blocking_resolve_address)(
+ const char* name, const char* default_port,
+ grpc_resolved_addresses** addresses);
} grpc_address_resolver_vtable;
void grpc_set_resolver_impl(grpc_address_resolver_vtable* vtable);
@@ -74,8 +76,8 @@ void grpc_resolved_addresses_destroy(grpc_resolved_addresses* addresses);
/* Resolve addr in a blocking fashion. On success,
result must be freed with grpc_resolved_addresses_destroy. */
-grpc_error* grpc_blocking_resolve_address(const char* name,
- const char* default_port,
- grpc_resolved_addresses** addresses);
+grpc_error_handle grpc_blocking_resolve_address(
+ const char* name, const char* default_port,
+ grpc_resolved_addresses** addresses);
#endif /* GRPC_CORE_LIB_IOMGR_RESOLVE_ADDRESS_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
index 69b4382b2be..7e356c6b6ee 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.cc
@@ -29,12 +29,12 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
#include "src/core/lib/iomgr/port.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
struct grpc_custom_resolver {
grpc_closure* on_done = nullptr;
@@ -53,7 +53,7 @@ static int retry_named_port_failure(grpc_custom_resolver* r,
if (r->port == svc[i][0]) {
r->port = svc[i][1];
if (res) {
- grpc_error* error = resolve_address_vtable->resolve(
+ grpc_error_handle error = resolve_address_vtable->resolve(
r->host.c_str(), r->port.c_str(), res);
if (error != GRPC_ERROR_NONE) {
GRPC_ERROR_UNREF(error);
@@ -71,7 +71,7 @@ static int retry_named_port_failure(grpc_custom_resolver* r,
void grpc_custom_resolve_callback(grpc_custom_resolver* r,
grpc_resolved_addresses* result,
- grpc_error* error) {
+ grpc_error_handle error) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
@@ -86,33 +86,34 @@ void grpc_custom_resolve_callback(grpc_custom_resolver* r,
delete r;
}
-static grpc_error* try_split_host_port(const char* name,
- const char* default_port,
- TString* host, TString* port) {
+static grpc_error_handle try_split_host_port(const char* name,
+ const char* default_port,
+ TString* host,
+ TString* port) {
/* parse name, splitting it into host and port parts */
grpc_core::SplitHostPort(name, host, port);
if (host->empty()) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("unparseable host:port: '%s'", name));
}
if (port->empty()) {
// TODO(murgatroid99): add tests for this case
if (default_port == nullptr) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("no port in name '%s'", name).c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("no port in name '%s'", name));
}
*port = default_port;
}
return GRPC_ERROR_NONE;
}
-static grpc_error* blocking_resolve_address_impl(
+static grpc_error_handle blocking_resolve_address_impl(
const char* name, const char* default_port,
grpc_resolved_addresses** addresses) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
grpc_custom_resolver resolver;
- grpc_error* err =
+ grpc_error_handle err =
try_split_host_port(name, default_port, &resolver.host, &resolver.port);
if (err != GRPC_ERROR_NONE) {
return err;
@@ -144,7 +145,7 @@ static void resolve_address_impl(const char* name, const char* default_port,
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
TString host;
TString port;
- grpc_error* err = try_split_host_port(name, default_port, &host, &port);
+ grpc_error_handle err = try_split_host_port(name, default_port, &host, &port);
if (err != GRPC_ERROR_NONE) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_done, err);
return;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
index f5f68ca32dd..4063dcf155a 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_custom.h
@@ -22,22 +22,21 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
typedef struct grpc_custom_resolver grpc_custom_resolver;
typedef struct grpc_custom_resolver_vtable {
- grpc_error* (*resolve)(const char* host, const char* port,
- grpc_resolved_addresses** res);
+ grpc_error_handle (*resolve)(const char* host, const char* port,
+ grpc_resolved_addresses** res);
void (*resolve_async)(grpc_custom_resolver* resolver, const char* host,
const char* port);
} grpc_custom_resolver_vtable;
void grpc_custom_resolve_callback(grpc_custom_resolver* resolver,
grpc_resolved_addresses* result,
- grpc_error* error);
+ grpc_error_handle error);
/* Internal APIs */
void grpc_custom_resolver_init(grpc_custom_resolver_vtable* impl);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
index 6fde3e7260e..9f329666b49 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_posix.cc
@@ -21,10 +21,6 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_RESOLVE_ADDRESS
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <string.h>
#include <sys/types.h>
@@ -40,9 +36,11 @@
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
-static grpc_error* posix_blocking_resolve_address(
+static grpc_error_handle posix_blocking_resolve_address(
const char* name, const char* default_port,
grpc_resolved_addresses** addresses) {
grpc_core::ExecCtx exec_ctx;
@@ -50,7 +48,7 @@ static grpc_error* posix_blocking_resolve_address(
struct addrinfo *result = nullptr, *resp;
int s;
size_t i;
- grpc_error* err;
+ grpc_error_handle err;
TString host;
TString port;
@@ -59,7 +57,7 @@ static grpc_error* posix_blocking_resolve_address(
if (host.empty()) {
err = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("unparseable host:port"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
@@ -67,7 +65,7 @@ static grpc_error* posix_blocking_resolve_address(
if (default_port == nullptr) {
err = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("no port in name"),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
port = default_port;
@@ -103,11 +101,9 @@ static grpc_error* posix_blocking_resolve_address(
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(gai_strerror(s)),
GRPC_ERROR_INT_ERRNO, s),
- GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(gai_strerror(s))),
- GRPC_ERROR_STR_SYSCALL,
- grpc_slice_from_static_string("getaddrinfo")),
- GRPC_ERROR_STR_TARGET_ADDRESS, grpc_slice_from_copied_string(name));
+ GRPC_ERROR_STR_OS_ERROR, gai_strerror(s)),
+ GRPC_ERROR_STR_SYSCALL, "getaddrinfo"),
+ GRPC_ERROR_STR_TARGET_ADDRESS, name);
goto done;
}
@@ -145,7 +141,7 @@ struct request {
};
/* Callback to be passed to grpc Executor to asynch-ify
* grpc_blocking_resolve_address */
-static void do_request_thread(void* rp, grpc_error* /*error*/) {
+static void do_request_thread(void* rp, grpc_error_handle /*error*/) {
request* r = static_cast<request*>(rp);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, r->on_done,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
index 9922b88065b..733de96a700 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/resolve_address_windows.cc
@@ -21,10 +21,6 @@
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <inttypes.h>
#include <string.h>
#include <sys/types.h>
@@ -39,13 +35,15 @@
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/block_annotate.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
struct request {
char* name;
@@ -54,7 +52,7 @@ struct request {
grpc_closure* on_done;
grpc_resolved_addresses** addresses;
};
-static grpc_error* windows_blocking_resolve_address(
+static grpc_error_handle windows_blocking_resolve_address(
const char* name, const char* default_port,
grpc_resolved_addresses** addresses) {
grpc_core::ExecCtx exec_ctx;
@@ -62,21 +60,21 @@ static grpc_error* windows_blocking_resolve_address(
struct addrinfo *result = NULL, *resp;
int s;
size_t i;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
/* parse name, splitting it into host and port parts */
TString host;
TString port;
grpc_core::SplitHostPort(name, &host, &port);
if (host.empty()) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("unparseable host:port: '%s'", name).c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("unparseable host:port: '%s'", name));
goto done;
}
if (port.empty()) {
if (default_port == NULL) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("no port in name '%s'", name).c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("no port in name '%s'", name));
goto done;
}
port = default_port;
@@ -121,7 +119,7 @@ done:
/* Callback to be passed to grpc_executor to asynch-ify
* grpc_blocking_resolve_address */
-static void do_request_thread(void* rp, grpc_error* error) {
+static void do_request_thread(void* rp, grpc_error_handle error) {
request* r = (request*)rp;
if (error == GRPC_ERROR_NONE) {
error =
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc b/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
deleted file mode 100644
index 861f70f2263..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.cc
+++ /dev/null
@@ -1,1016 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/resource_quota.h"
-
-#include <inttypes.h>
-#include <limits.h>
-#include <stdint.h>
-#include <string.h>
-
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_cat.h"
-
-#include <grpc/slice_buffer.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/iomgr/combiner.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota");
-
-#define MEMORY_USAGE_ESTIMATION_MAX 65536
-
-/* Internal linked list pointers for a resource user */
-struct grpc_resource_user_link {
- grpc_resource_user* next;
- grpc_resource_user* prev;
-};
-/* Resource users are kept in (potentially) several intrusive linked lists
- at once. These are the list names. */
-typedef enum {
- /* Resource users that are waiting for an allocation */
- GRPC_RULIST_AWAITING_ALLOCATION,
- /* Resource users that have free memory available for internal reclamation */
- GRPC_RULIST_NON_EMPTY_FREE_POOL,
- /* Resource users that have published a benign reclamation is available */
- GRPC_RULIST_RECLAIMER_BENIGN,
- /* Resource users that have published a destructive reclamation is
- available */
- GRPC_RULIST_RECLAIMER_DESTRUCTIVE,
- /* Number of lists: must be last */
- GRPC_RULIST_COUNT
-} grpc_rulist;
-
-struct grpc_resource_user {
- /* The quota this resource user consumes from */
- grpc_resource_quota* resource_quota;
-
- /* Closure to schedule an allocation under the resource quota combiner lock */
- grpc_closure allocate_closure;
- /* Closure to publish a non empty free pool under the resource quota combiner
- lock */
- grpc_closure add_to_free_pool_closure;
-
- /* one ref for each ref call (released by grpc_resource_user_unref), and one
- ref for each byte allocated (released by grpc_resource_user_free) */
- gpr_atm refs;
- /* is this resource user unlocked? starts at 0, increases for each shutdown
- call */
- gpr_atm shutdown;
-
- gpr_mu mu;
- /* The amount of memory (in bytes) this user has cached for its own use: to
- avoid quota contention, each resource user can keep some memory in
- addition to what it is immediately using (e.g., for caching), and the quota
- can pull it back under memory pressure.
- This value can become negative if more memory has been requested than
- existed in the free pool, at which point the quota is consulted to bring
- this value non-negative (asynchronously). */
- int64_t free_pool;
- /* A list of closures to call once free_pool becomes non-negative - ie when
- all outstanding allocations have been granted. */
- grpc_closure_list on_allocated;
- /* True if we are currently trying to allocate from the quota, false if not */
- bool allocating;
- /* The amount of memory (in bytes) that has been requested from this user
- * asynchronously but hasn't been granted yet. */
- int64_t outstanding_allocations;
- /* True if we are currently trying to add ourselves to the non-free quota
- list, false otherwise */
- bool added_to_free_pool;
-
- /* The number of threads currently allocated to this resource user */
- gpr_atm num_threads_allocated;
-
- /* Reclaimers: index 0 is the benign reclaimer, 1 is the destructive reclaimer
- */
- grpc_closure* reclaimers[2];
- /* Reclaimers just posted: once we're in the combiner lock, we'll move them
- to the array above */
- grpc_closure* new_reclaimers[2];
- /* Trampoline closures to finish reclamation and re-enter the quota combiner
- lock */
- grpc_closure post_reclaimer_closure[2];
-
- /* Closure to execute under the quota combiner to de-register and shutdown the
- resource user */
- grpc_closure destroy_closure;
-
- /* Links in the various grpc_rulist lists */
- grpc_resource_user_link links[GRPC_RULIST_COUNT];
-
- /* The name of this resource user, for debugging/tracing */
- TString name;
-};
-
-struct grpc_resource_quota {
- /* refcount */
- gpr_refcount refs;
-
- /* estimate of current memory usage
- scaled to the range [0..RESOURCE_USAGE_ESTIMATION_MAX] */
- gpr_atm memory_usage_estimation;
-
- /* Main combiner lock: all activity on a quota executes under this combiner
- * (so no mutex is needed for this data structure) */
- grpc_core::Combiner* combiner;
- /* Size of the resource quota */
- int64_t size;
- /* Amount of free memory in the resource quota */
- int64_t free_pool;
- /* Used size of memory in the resource quota. Updated as soon as the resource
- * users start to allocate or free the memory. */
- gpr_atm used;
-
- gpr_atm last_size;
-
- /* Mutex to protect max_threads and num_threads_allocated */
- /* Note: We could have used gpr_atm for max_threads and num_threads_allocated
- * and avoid having this mutex; but in that case, each invocation of the
- * function grpc_resource_user_allocate_threads() would have had to do at
- * least two atomic loads (for max_threads and num_threads_allocated) followed
- * by a CAS (on num_threads_allocated).
- * Moreover, we expect grpc_resource_user_allocate_threads() to be often
- * called concurrently thereby increasing the chances of failing the CAS
- * operation. This additional complexity is not worth the tiny perf gain we
- * may (or may not) have by using atomics */
- gpr_mu thread_count_mu;
-
- /* Max number of threads allowed */
- int max_threads;
-
- /* Number of threads currently allocated via this resource_quota object */
- int num_threads_allocated;
-
- /* Has rq_step been scheduled to occur? */
- bool step_scheduled;
-
- /* Are we currently reclaiming memory */
- bool reclaiming;
-
- /* Closure around rq_step */
- grpc_closure rq_step_closure;
-
- /* Closure around rq_reclamation_done */
- grpc_closure rq_reclamation_done_closure;
-
- /* This is only really usable for debugging: it's always a stale pointer, but
- a stale pointer that might just be fresh enough to guide us to where the
- reclamation system is stuck */
- grpc_closure* debug_only_last_initiated_reclaimer;
- grpc_resource_user* debug_only_last_reclaimer_resource_user;
-
- /* Roots of all resource user lists */
- grpc_resource_user* roots[GRPC_RULIST_COUNT];
-
- TString name;
-};
-
-static void ru_unref_by(grpc_resource_user* resource_user, gpr_atm amount);
-
-/*******************************************************************************
- * list management
- */
-
-static void rulist_add_head(grpc_resource_user* resource_user,
- grpc_rulist list) {
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- grpc_resource_user** root = &resource_quota->roots[list];
- if (*root == nullptr) {
- *root = resource_user;
- resource_user->links[list].next = resource_user->links[list].prev =
- resource_user;
- } else {
- resource_user->links[list].next = *root;
- resource_user->links[list].prev = (*root)->links[list].prev;
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev->links[list].next = resource_user;
- *root = resource_user;
- }
-}
-
-static void rulist_add_tail(grpc_resource_user* resource_user,
- grpc_rulist list) {
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- grpc_resource_user** root = &resource_quota->roots[list];
- if (*root == nullptr) {
- *root = resource_user;
- resource_user->links[list].next = resource_user->links[list].prev =
- resource_user;
- } else {
- resource_user->links[list].next = (*root)->links[list].next;
- resource_user->links[list].prev = *root;
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev->links[list].next = resource_user;
- }
-}
-
-static bool rulist_empty(grpc_resource_quota* resource_quota,
- grpc_rulist list) {
- return resource_quota->roots[list] == nullptr;
-}
-
-static grpc_resource_user* rulist_pop_head(grpc_resource_quota* resource_quota,
- grpc_rulist list) {
- grpc_resource_user** root = &resource_quota->roots[list];
- grpc_resource_user* resource_user = *root;
- if (resource_user == nullptr) {
- return nullptr;
- }
- if (resource_user->links[list].next == resource_user) {
- *root = nullptr;
- } else {
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev;
- resource_user->links[list].prev->links[list].next =
- resource_user->links[list].next;
- *root = resource_user->links[list].next;
- }
- resource_user->links[list].next = resource_user->links[list].prev = nullptr;
- return resource_user;
-}
-
-static void rulist_remove(grpc_resource_user* resource_user, grpc_rulist list) {
- if (resource_user->links[list].next == nullptr) return;
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- if (resource_quota->roots[list] == resource_user) {
- resource_quota->roots[list] = resource_user->links[list].next;
- if (resource_quota->roots[list] == resource_user) {
- resource_quota->roots[list] = nullptr;
- }
- }
- resource_user->links[list].next->links[list].prev =
- resource_user->links[list].prev;
- resource_user->links[list].prev->links[list].next =
- resource_user->links[list].next;
- resource_user->links[list].next = resource_user->links[list].prev = nullptr;
-}
-
-/*******************************************************************************
- * resource quota state machine
- */
-
-static bool rq_alloc(grpc_resource_quota* resource_quota);
-static bool rq_reclaim_from_per_user_free_pool(
- grpc_resource_quota* resource_quota);
-static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive);
-
-static void rq_step(void* rq, grpc_error* /*error*/) {
- grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
- resource_quota->step_scheduled = false;
- do {
- if (rq_alloc(resource_quota)) goto done;
- } while (rq_reclaim_from_per_user_free_pool(resource_quota));
-
- if (!rq_reclaim(resource_quota, false)) {
- rq_reclaim(resource_quota, true);
- }
-
-done:
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-static void rq_step_sched(grpc_resource_quota* resource_quota) {
- if (resource_quota->step_scheduled) return;
- resource_quota->step_scheduled = true;
- grpc_resource_quota_ref_internal(resource_quota);
- resource_quota->combiner->FinallyRun(&resource_quota->rq_step_closure,
- GRPC_ERROR_NONE);
-}
-
-/* update the atomically available resource estimate - use no barriers since
- timeliness of delivery really doesn't matter much */
-static void rq_update_estimate(grpc_resource_quota* resource_quota) {
- gpr_atm memory_usage_estimation = MEMORY_USAGE_ESTIMATION_MAX;
- if (resource_quota->size != 0) {
- memory_usage_estimation =
- GPR_CLAMP((gpr_atm)((1.0 - ((double)resource_quota->free_pool) /
- ((double)resource_quota->size)) *
- MEMORY_USAGE_ESTIMATION_MAX),
- 0, MEMORY_USAGE_ESTIMATION_MAX);
- }
- gpr_atm_no_barrier_store(&resource_quota->memory_usage_estimation,
- memory_usage_estimation);
-}
-
-/* returns true if all allocations are completed */
-static bool rq_alloc(grpc_resource_quota* resource_quota) {
- grpc_resource_user* resource_user;
- while ((resource_user = rulist_pop_head(resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION))) {
- gpr_mu_lock(&resource_user->mu);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO,
- "RQ: check allocation for user %p shutdown=%" PRIdPTR
- " free_pool=%" PRId64 " outstanding_allocations=%" PRId64,
- resource_user, gpr_atm_no_barrier_load(&resource_user->shutdown),
- resource_user->free_pool, resource_user->outstanding_allocations);
- }
- if (gpr_atm_no_barrier_load(&resource_user->shutdown)) {
- resource_user->allocating = false;
- grpc_closure_list_fail_all(
- &resource_user->on_allocated,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource user shutdown"));
- int64_t aborted_allocations = resource_user->outstanding_allocations;
- resource_user->outstanding_allocations = 0;
- resource_user->free_pool += aborted_allocations;
- grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
- gpr_mu_unlock(&resource_user->mu);
- if (aborted_allocations > 0) {
- ru_unref_by(resource_user, static_cast<gpr_atm>(aborted_allocations));
- }
- continue;
- }
- if (resource_user->free_pool < 0 &&
- -resource_user->free_pool <= resource_quota->free_pool) {
- int64_t amt = -resource_user->free_pool;
- resource_user->free_pool = 0;
- resource_quota->free_pool -= amt;
- rq_update_estimate(resource_quota);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO,
- "RQ %s %s: grant alloc %" PRId64
- " bytes; rq_free_pool -> %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(), amt,
- resource_quota->free_pool);
- }
- } else if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace) &&
- resource_user->free_pool >= 0) {
- gpr_log(GPR_INFO, "RQ %s %s: discard already satisfied alloc request",
- resource_quota->name.c_str(), resource_user->name.c_str());
- }
- if (resource_user->free_pool >= 0) {
- resource_user->allocating = false;
- resource_user->outstanding_allocations = 0;
- grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &resource_user->on_allocated);
- gpr_mu_unlock(&resource_user->mu);
- } else {
- rulist_add_head(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
- gpr_mu_unlock(&resource_user->mu);
- return false;
- }
- }
- return true;
-}
-
-/* returns true if any memory could be reclaimed from buffers */
-static bool rq_reclaim_from_per_user_free_pool(
- grpc_resource_quota* resource_quota) {
- grpc_resource_user* resource_user;
- while ((resource_user = rulist_pop_head(resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL))) {
- gpr_mu_lock(&resource_user->mu);
- resource_user->added_to_free_pool = false;
- if (resource_user->free_pool > 0) {
- int64_t amt = resource_user->free_pool;
- resource_user->free_pool = 0;
- resource_quota->free_pool += amt;
- rq_update_estimate(resource_quota);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO,
- "RQ %s %s: reclaim_from_per_user_free_pool %" PRId64
- " bytes; rq_free_pool -> %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(), amt,
- resource_quota->free_pool);
- }
- gpr_mu_unlock(&resource_user->mu);
- return true;
- } else {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO,
- "RQ %s %s: failed to reclaim_from_per_user_free_pool; "
- "free_pool = %" PRId64 "; rq_free_pool = %" PRId64,
- resource_quota->name.c_str(), resource_user->name.c_str(),
- resource_user->free_pool, resource_quota->free_pool);
- }
- gpr_mu_unlock(&resource_user->mu);
- }
- }
- return false;
-}
-
-/* returns true if reclamation is proceeding */
-static bool rq_reclaim(grpc_resource_quota* resource_quota, bool destructive) {
- if (resource_quota->reclaiming) return true;
- grpc_rulist list = destructive ? GRPC_RULIST_RECLAIMER_DESTRUCTIVE
- : GRPC_RULIST_RECLAIMER_BENIGN;
- grpc_resource_user* resource_user = rulist_pop_head(resource_quota, list);
- if (resource_user == nullptr) return false;
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RQ %s %s: initiate %s reclamation",
- resource_quota->name.c_str(), resource_user->name.c_str(),
- destructive ? "destructive" : "benign");
- }
- resource_quota->reclaiming = true;
- grpc_resource_quota_ref_internal(resource_quota);
- grpc_closure* c = resource_user->reclaimers[destructive];
- GPR_ASSERT(c);
- resource_quota->debug_only_last_reclaimer_resource_user = resource_user;
- resource_quota->debug_only_last_initiated_reclaimer = c;
- resource_user->reclaimers[destructive] = nullptr;
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, GRPC_ERROR_NONE);
- return true;
-}
-
-/*******************************************************************************
- * ru_slice: a slice implementation that is backed by a grpc_resource_user
- */
-
-namespace grpc_core {
-
-class RuSliceRefcount {
- public:
- static void Destroy(void* p) {
- auto* rc = static_cast<RuSliceRefcount*>(p);
- rc->~RuSliceRefcount();
- gpr_free(rc);
- }
- RuSliceRefcount(grpc_resource_user* resource_user, size_t size)
- : base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
- &base_),
- resource_user_(resource_user),
- size_(size) {
- // Nothing to do here.
- }
- ~RuSliceRefcount() { grpc_resource_user_free(resource_user_, size_); }
-
- grpc_slice_refcount* base_refcount() { return &base_; }
-
- private:
- grpc_slice_refcount base_;
- RefCount refs_;
- grpc_resource_user* resource_user_;
- size_t size_;
-};
-
-} // namespace grpc_core
-
-static grpc_slice ru_slice_create(grpc_resource_user* resource_user,
- size_t size) {
- auto* rc = static_cast<grpc_core::RuSliceRefcount*>(
- gpr_malloc(sizeof(grpc_core::RuSliceRefcount) + size));
- new (rc) grpc_core::RuSliceRefcount(resource_user, size);
- grpc_slice slice;
-
- slice.refcount = rc->base_refcount();
- slice.data.refcounted.bytes = reinterpret_cast<uint8_t*>(rc + 1);
- slice.data.refcounted.length = size;
- return slice;
-}
-
-/*******************************************************************************
- * grpc_resource_quota internal implementation: resource user manipulation under
- * the combiner
- */
-
-static void ru_allocate(void* ru, grpc_error* /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_AWAITING_ALLOCATION);
-}
-
-static void ru_add_to_free_pool(void* ru, grpc_error* /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_NON_EMPTY_FREE_POOL);
-}
-
-static bool ru_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive) {
- grpc_closure* closure = resource_user->new_reclaimers[destructive];
- GPR_ASSERT(closure != nullptr);
- resource_user->new_reclaimers[destructive] = nullptr;
- GPR_ASSERT(resource_user->reclaimers[destructive] == nullptr);
- if (gpr_atm_acq_load(&resource_user->shutdown) > 0) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_CANCELLED);
- return false;
- }
- resource_user->reclaimers[destructive] = closure;
- return true;
-}
-
-static void ru_post_benign_reclaimer(void* ru, grpc_error* /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!ru_post_reclaimer(resource_user, false)) return;
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_BENIGN)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
-}
-
-static void ru_post_destructive_reclaimer(void* ru, grpc_error* /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- if (!ru_post_reclaimer(resource_user, true)) return;
- if (!rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_AWAITING_ALLOCATION) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_NON_EMPTY_FREE_POOL) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_BENIGN) &&
- rulist_empty(resource_user->resource_quota,
- GRPC_RULIST_RECLAIMER_DESTRUCTIVE)) {
- rq_step_sched(resource_user->resource_quota);
- }
- rulist_add_tail(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
-}
-
-static void ru_shutdown(void* ru, grpc_error* /*error*/) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RU shutdown %p", ru);
- }
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- gpr_mu_lock(&resource_user->mu);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
- GRPC_ERROR_CANCELLED);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
- GRPC_ERROR_CANCELLED);
- resource_user->reclaimers[0] = nullptr;
- resource_user->reclaimers[1] = nullptr;
- rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_BENIGN);
- rulist_remove(resource_user, GRPC_RULIST_RECLAIMER_DESTRUCTIVE);
- if (resource_user->allocating) {
- rq_step_sched(resource_user->resource_quota);
- }
- gpr_mu_unlock(&resource_user->mu);
-}
-
-static void ru_destroy(void* ru, grpc_error* /*error*/) {
- grpc_resource_user* resource_user = static_cast<grpc_resource_user*>(ru);
- GPR_ASSERT(gpr_atm_no_barrier_load(&resource_user->refs) == 0);
- // Free all the remaining thread quota
- grpc_resource_user_free_threads(resource_user,
- static_cast<int>(gpr_atm_no_barrier_load(
- &resource_user->num_threads_allocated)));
-
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- rulist_remove(resource_user, static_cast<grpc_rulist>(i));
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[0],
- GRPC_ERROR_CANCELLED);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, resource_user->reclaimers[1],
- GRPC_ERROR_CANCELLED);
- if (resource_user->free_pool != 0) {
- resource_user->resource_quota->free_pool += resource_user->free_pool;
- rq_step_sched(resource_user->resource_quota);
- }
- grpc_resource_quota_unref_internal(resource_user->resource_quota);
- gpr_mu_destroy(&resource_user->mu);
- delete resource_user;
-}
-
-static void ru_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator) {
- for (size_t i = 0; i < slice_allocator->count; i++) {
- grpc_slice_buffer_add_indexed(
- slice_allocator->dest, ru_slice_create(slice_allocator->resource_user,
- slice_allocator->length));
- }
-}
-
-static void ru_allocated_slices(void* arg, grpc_error* error) {
- grpc_resource_user_slice_allocator* slice_allocator =
- static_cast<grpc_resource_user_slice_allocator*>(arg);
- if (error == GRPC_ERROR_NONE) ru_alloc_slices(slice_allocator);
- grpc_core::Closure::Run(DEBUG_LOCATION, &slice_allocator->on_done,
- GRPC_ERROR_REF(error));
-}
-
-/*******************************************************************************
- * grpc_resource_quota internal implementation: quota manipulation under the
- * combiner
- */
-
-struct rq_resize_args {
- int64_t size;
- grpc_resource_quota* resource_quota;
- grpc_closure closure;
-};
-static void rq_resize(void* args, grpc_error* /*error*/) {
- rq_resize_args* a = static_cast<rq_resize_args*>(args);
- int64_t delta = a->size - a->resource_quota->size;
- a->resource_quota->size += delta;
- a->resource_quota->free_pool += delta;
- rq_update_estimate(a->resource_quota);
- rq_step_sched(a->resource_quota);
- grpc_resource_quota_unref_internal(a->resource_quota);
- gpr_free(a);
-}
-
-static void rq_reclamation_done(void* rq, grpc_error* /*error*/) {
- grpc_resource_quota* resource_quota = static_cast<grpc_resource_quota*>(rq);
- resource_quota->reclaiming = false;
- rq_step_sched(resource_quota);
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-/*******************************************************************************
- * grpc_resource_quota api
- */
-
-/* Public API */
-grpc_resource_quota* grpc_resource_quota_create(const char* name) {
- grpc_resource_quota* resource_quota = new grpc_resource_quota;
- gpr_ref_init(&resource_quota->refs, 1);
- resource_quota->combiner = grpc_combiner_create();
- resource_quota->free_pool = INT64_MAX;
- resource_quota->size = INT64_MAX;
- resource_quota->used = 0;
- gpr_atm_no_barrier_store(&resource_quota->last_size, GPR_ATM_MAX);
- gpr_mu_init(&resource_quota->thread_count_mu);
- resource_quota->max_threads = INT_MAX;
- resource_quota->num_threads_allocated = 0;
- resource_quota->step_scheduled = false;
- resource_quota->reclaiming = false;
- gpr_atm_no_barrier_store(&resource_quota->memory_usage_estimation, 0);
- if (name != nullptr) {
- resource_quota->name = name;
- } else {
- resource_quota->name = y_absl::StrCat(
- "anonymous_pool_", reinterpret_cast<intptr_t>(resource_quota));
- }
- GRPC_CLOSURE_INIT(&resource_quota->rq_step_closure, rq_step, resource_quota,
- nullptr);
- GRPC_CLOSURE_INIT(&resource_quota->rq_reclamation_done_closure,
- rq_reclamation_done, resource_quota, nullptr);
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- resource_quota->roots[i] = nullptr;
- }
- return resource_quota;
-}
-
-void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota) {
- if (gpr_unref(&resource_quota->refs)) {
- // No outstanding thread quota
- GPR_ASSERT(resource_quota->num_threads_allocated == 0);
- GRPC_COMBINER_UNREF(resource_quota->combiner, "resource_quota");
- gpr_mu_destroy(&resource_quota->thread_count_mu);
- delete resource_quota;
- }
-}
-
-/* Public API */
-void grpc_resource_quota_unref(grpc_resource_quota* resource_quota) {
- grpc_core::ExecCtx exec_ctx;
- grpc_resource_quota_unref_internal(resource_quota);
-}
-
-grpc_resource_quota* grpc_resource_quota_ref_internal(
- grpc_resource_quota* resource_quota) {
- gpr_ref(&resource_quota->refs);
- return resource_quota;
-}
-
-/* Public API */
-void grpc_resource_quota_ref(grpc_resource_quota* resource_quota) {
- grpc_resource_quota_ref_internal(resource_quota);
-}
-
-double grpc_resource_quota_get_memory_pressure(
- grpc_resource_quota* resource_quota) {
- return (static_cast<double>(gpr_atm_no_barrier_load(
- &resource_quota->memory_usage_estimation))) /
- (static_cast<double>(MEMORY_USAGE_ESTIMATION_MAX));
-}
-
-/* Public API */
-void grpc_resource_quota_set_max_threads(grpc_resource_quota* resource_quota,
- int new_max_threads) {
- GPR_ASSERT(new_max_threads >= 0);
- gpr_mu_lock(&resource_quota->thread_count_mu);
- resource_quota->max_threads = new_max_threads;
- gpr_mu_unlock(&resource_quota->thread_count_mu);
-}
-
-/* Public API */
-void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
- size_t size) {
- grpc_core::ExecCtx exec_ctx;
- rq_resize_args* a = static_cast<rq_resize_args*>(gpr_malloc(sizeof(*a)));
- a->resource_quota = grpc_resource_quota_ref_internal(resource_quota);
- a->size = static_cast<int64_t>(size);
- gpr_atm_no_barrier_store(&resource_quota->last_size,
- (gpr_atm)GPR_MIN((size_t)GPR_ATM_MAX, size));
- GRPC_CLOSURE_INIT(&a->closure, rq_resize, a, grpc_schedule_on_exec_ctx);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, &a->closure, GRPC_ERROR_NONE);
-}
-
-size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota) {
- return static_cast<size_t>(
- gpr_atm_no_barrier_load(&resource_quota->last_size));
-}
-
-/*******************************************************************************
- * grpc_resource_user channel args api
- */
-
-grpc_resource_quota* grpc_resource_quota_from_channel_args(
- const grpc_channel_args* channel_args, bool create) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- if (channel_args->args[i].type == GRPC_ARG_POINTER) {
- return grpc_resource_quota_ref_internal(
- static_cast<grpc_resource_quota*>(
- channel_args->args[i].value.pointer.p));
- } else {
- gpr_log(GPR_DEBUG, GRPC_ARG_RESOURCE_QUOTA " should be a pointer");
- }
- }
- }
- return create ? grpc_resource_quota_create(nullptr) : nullptr;
-}
-
-static void* rq_copy(void* rq) {
- grpc_resource_quota_ref(static_cast<grpc_resource_quota*>(rq));
- return rq;
-}
-
-static void rq_destroy(void* rq) {
- grpc_resource_quota_unref_internal(static_cast<grpc_resource_quota*>(rq));
-}
-
-static int rq_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
-
-const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void) {
- static const grpc_arg_pointer_vtable vtable = {rq_copy, rq_destroy, rq_cmp};
- return &vtable;
-}
-
-/*******************************************************************************
- * grpc_resource_user api
- */
-
-grpc_resource_user* grpc_resource_user_create(
- grpc_resource_quota* resource_quota, const char* name) {
- grpc_resource_user* resource_user = new grpc_resource_user;
- resource_user->resource_quota =
- grpc_resource_quota_ref_internal(resource_quota);
- GRPC_CLOSURE_INIT(&resource_user->allocate_closure, &ru_allocate,
- resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->add_to_free_pool_closure,
- &ru_add_to_free_pool, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->post_reclaimer_closure[0],
- &ru_post_benign_reclaimer, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->post_reclaimer_closure[1],
- &ru_post_destructive_reclaimer, resource_user, nullptr);
- GRPC_CLOSURE_INIT(&resource_user->destroy_closure, &ru_destroy, resource_user,
- nullptr);
- gpr_mu_init(&resource_user->mu);
- gpr_atm_rel_store(&resource_user->refs, 1);
- gpr_atm_rel_store(&resource_user->shutdown, 0);
- resource_user->free_pool = 0;
- grpc_closure_list_init(&resource_user->on_allocated);
- resource_user->allocating = false;
- resource_user->added_to_free_pool = false;
- gpr_atm_no_barrier_store(&resource_user->num_threads_allocated, 0);
- resource_user->reclaimers[0] = nullptr;
- resource_user->reclaimers[1] = nullptr;
- resource_user->new_reclaimers[0] = nullptr;
- resource_user->new_reclaimers[1] = nullptr;
- resource_user->outstanding_allocations = 0;
- for (int i = 0; i < GRPC_RULIST_COUNT; i++) {
- resource_user->links[i].next = resource_user->links[i].prev = nullptr;
- }
- if (name != nullptr) {
- resource_user->name = name;
- } else {
- resource_user->name = y_absl::StrCat(
- "anonymous_resource_user_", reinterpret_cast<intptr_t>(resource_user));
- }
- return resource_user;
-}
-
-grpc_resource_quota* grpc_resource_user_quota(
- grpc_resource_user* resource_user) {
- return resource_user->resource_quota;
-}
-
-static void ru_ref_by(grpc_resource_user* resource_user, gpr_atm amount) {
- GPR_ASSERT(amount > 0);
- GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0);
-}
-
-static void ru_unref_by(grpc_resource_user* resource_user, gpr_atm amount) {
- GPR_ASSERT(amount > 0);
- gpr_atm old = gpr_atm_full_fetch_add(&resource_user->refs, -amount);
- GPR_ASSERT(old >= amount);
- if (old == amount) {
- resource_user->resource_quota->combiner->Run(
- &resource_user->destroy_closure, GRPC_ERROR_NONE);
- }
-}
-
-void grpc_resource_user_ref(grpc_resource_user* resource_user) {
- ru_ref_by(resource_user, 1);
-}
-
-void grpc_resource_user_unref(grpc_resource_user* resource_user) {
- ru_unref_by(resource_user, 1);
-}
-
-void grpc_resource_user_shutdown(grpc_resource_user* resource_user) {
- if (gpr_atm_full_fetch_add(&resource_user->shutdown, 1) == 0) {
- resource_user->resource_quota->combiner->Run(
- GRPC_CLOSURE_CREATE(ru_shutdown, resource_user, nullptr),
- GRPC_ERROR_NONE);
- }
-}
-
-bool grpc_resource_user_allocate_threads(grpc_resource_user* resource_user,
- int thread_count) {
- GPR_ASSERT(thread_count >= 0);
- bool is_success = false;
- gpr_mu_lock(&resource_user->resource_quota->thread_count_mu);
- grpc_resource_quota* rq = resource_user->resource_quota;
- if (rq->num_threads_allocated + thread_count <= rq->max_threads) {
- rq->num_threads_allocated += thread_count;
- gpr_atm_no_barrier_fetch_add(&resource_user->num_threads_allocated,
- thread_count);
- is_success = true;
- }
- gpr_mu_unlock(&resource_user->resource_quota->thread_count_mu);
- return is_success;
-}
-
-void grpc_resource_user_free_threads(grpc_resource_user* resource_user,
- int thread_count) {
- GPR_ASSERT(thread_count >= 0);
- gpr_mu_lock(&resource_user->resource_quota->thread_count_mu);
- grpc_resource_quota* rq = resource_user->resource_quota;
- rq->num_threads_allocated -= thread_count;
- int old_count = static_cast<int>(gpr_atm_no_barrier_fetch_add(
- &resource_user->num_threads_allocated, -thread_count));
- if (old_count < thread_count || rq->num_threads_allocated < 0) {
- gpr_log(GPR_ERROR,
- "Releasing more threads (%d) than currently allocated (rq threads: "
- "%d, ru threads: %d)",
- thread_count, rq->num_threads_allocated + thread_count, old_count);
- abort();
- }
- gpr_mu_unlock(&resource_user->resource_quota->thread_count_mu);
-}
-
-static bool resource_user_alloc_locked(grpc_resource_user* resource_user,
- size_t size,
- grpc_closure* optional_on_done) {
- ru_ref_by(resource_user, static_cast<gpr_atm>(size));
- resource_user->free_pool -= static_cast<int64_t>(size);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RQ %s %s: alloc %" PRIdPTR "; free_pool -> %" PRId64,
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str(), size, resource_user->free_pool);
- }
- if (GPR_LIKELY(resource_user->free_pool >= 0)) return true;
- // Slow path: We need to wait for the free pool to refill.
- if (optional_on_done != nullptr) {
- resource_user->outstanding_allocations += static_cast<int64_t>(size);
- grpc_closure_list_append(&resource_user->on_allocated, optional_on_done,
- GRPC_ERROR_NONE);
- }
- if (!resource_user->allocating) {
- resource_user->allocating = true;
- resource_user->resource_quota->combiner->Run(
- &resource_user->allocate_closure, GRPC_ERROR_NONE);
- }
- return false;
-}
-
-bool grpc_resource_user_safe_alloc(grpc_resource_user* resource_user,
- size_t size) {
- if (gpr_atm_no_barrier_load(&resource_user->shutdown)) return false;
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- bool cas_success;
- do {
- gpr_atm used = gpr_atm_no_barrier_load(&resource_quota->used);
- gpr_atm new_used = used + size;
- if (static_cast<size_t>(new_used) >
- grpc_resource_quota_peek_size(resource_quota)) {
- gpr_mu_unlock(&resource_user->mu);
- return false;
- }
- cas_success = gpr_atm_full_cas(&resource_quota->used, used, new_used);
- } while (!cas_success);
- resource_user_alloc_locked(resource_user, size, nullptr);
- gpr_mu_unlock(&resource_user->mu);
- return true;
-}
-
-bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
- grpc_closure* optional_on_done) {
- // TODO(juanlishen): Maybe return immediately if shutting down. Deferring this
- // because some tests become flaky after the change.
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- gpr_atm_no_barrier_fetch_add(&resource_quota->used, size);
- const bool ret =
- resource_user_alloc_locked(resource_user, size, optional_on_done);
- gpr_mu_unlock(&resource_user->mu);
- return ret;
-}
-
-void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size) {
- gpr_mu_lock(&resource_user->mu);
- grpc_resource_quota* resource_quota = resource_user->resource_quota;
- gpr_atm prior = gpr_atm_no_barrier_fetch_add(&resource_quota->used, -size);
- GPR_ASSERT(prior >= static_cast<long>(size));
- bool was_zero_or_negative = resource_user->free_pool <= 0;
- resource_user->free_pool += static_cast<int64_t>(size);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RQ %s %s: free %" PRIdPTR "; free_pool -> %" PRId64,
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str(), size, resource_user->free_pool);
- }
- bool is_bigger_than_zero = resource_user->free_pool > 0;
- if (is_bigger_than_zero && was_zero_or_negative &&
- !resource_user->added_to_free_pool) {
- resource_user->added_to_free_pool = true;
- resource_quota->combiner->Run(&resource_user->add_to_free_pool_closure,
- GRPC_ERROR_NONE);
- }
- gpr_mu_unlock(&resource_user->mu);
- ru_unref_by(resource_user, static_cast<gpr_atm>(size));
-}
-
-void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive,
- grpc_closure* closure) {
- GPR_ASSERT(resource_user->new_reclaimers[destructive] == nullptr);
- resource_user->new_reclaimers[destructive] = closure;
- resource_user->resource_quota->combiner->Run(
- &resource_user->post_reclaimer_closure[destructive], GRPC_ERROR_NONE);
-}
-
-void grpc_resource_user_finish_reclamation(grpc_resource_user* resource_user) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
- gpr_log(GPR_INFO, "RQ %s %s: reclamation complete",
- resource_user->resource_quota->name.c_str(),
- resource_user->name.c_str());
- }
- resource_user->resource_quota->combiner->Run(
- &resource_user->resource_quota->rq_reclamation_done_closure,
- GRPC_ERROR_NONE);
-}
-
-void grpc_resource_user_slice_allocator_init(
- grpc_resource_user_slice_allocator* slice_allocator,
- grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p) {
- GRPC_CLOSURE_INIT(&slice_allocator->on_allocated, ru_allocated_slices,
- slice_allocator, grpc_schedule_on_exec_ctx);
- GRPC_CLOSURE_INIT(&slice_allocator->on_done, cb, p,
- grpc_schedule_on_exec_ctx);
- slice_allocator->resource_user = resource_user;
-}
-
-bool grpc_resource_user_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator, size_t length,
- size_t count, grpc_slice_buffer* dest) {
- if (GPR_UNLIKELY(
- gpr_atm_no_barrier_load(&slice_allocator->resource_user->shutdown))) {
- grpc_core::ExecCtx::Run(
- DEBUG_LOCATION, &slice_allocator->on_allocated,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Resource user shutdown"));
- return false;
- }
- slice_allocator->length = length;
- slice_allocator->count = count;
- slice_allocator->dest = dest;
- const bool ret =
- grpc_resource_user_alloc(slice_allocator->resource_user, count * length,
- &slice_allocator->on_allocated);
- if (ret) ru_alloc_slices(slice_allocator);
- return ret;
-}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.h b/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.h
deleted file mode 100644
index ec89a920201..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/resource_quota.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H
-#define GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H
-
-#include <grpc/support/port_platform.h>
-
-#include <grpc/grpc.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/closure.h"
-
-/** \file Tracks resource usage against a pool.
-
- The current implementation tracks only memory usage, but in the future
- this may be extended to (for example) threads and file descriptors.
-
- A grpc_resource_quota represents the pooled resources, and
- grpc_resource_user instances attach to the quota and consume those
- resources. They also offer a vector for reclamation: if we become
- resource constrained, grpc_resource_user instances are asked (in turn) to
- free up whatever they can so that the system as a whole can make progress.
-
- There are three kinds of reclamation that take place, in order of increasing
- invasiveness:
- - an internal reclamation, where cached resource at the resource user level
- is returned to the quota
- - a benign reclamation phase, whereby resources that are in use but are not
- helping anything make progress are reclaimed
- - a destructive reclamation, whereby resources that are helping something
- make progress may be enacted so that at least one part of the system can
- complete.
-
- Only one reclamation will be outstanding for a given quota at a given time.
- On each reclamation attempt, the kinds of reclamation are tried in order of
- increasing invasiveness, stopping at the first one that succeeds. Thus, on a
- given reclamation attempt, if internal and benign reclamation both fail, it
- will wind up doing a destructive reclamation. However, the next reclamation
- attempt may then be able to get what it needs via internal or benign
- reclamation, due to resources that may have been freed up by the destructive
- reclamation in the previous attempt.
-
- Future work will be to expose the current resource pressure so that back
- pressure can be applied to avoid reclamation phases starting.
-
- Resource users own references to resource quotas, and resource quotas
- maintain lists of users (which users arrange to leave before they are
- destroyed) */
-
-extern grpc_core::TraceFlag grpc_resource_quota_trace;
-
-// TODO(juanlishen): This is a hack. We need to do real accounting instead of
-// hard coding.
-constexpr size_t GRPC_RESOURCE_QUOTA_CALL_SIZE = 15 * 1024;
-constexpr size_t GRPC_RESOURCE_QUOTA_CHANNEL_SIZE = 50 * 1024;
-
-grpc_resource_quota* grpc_resource_quota_ref_internal(
- grpc_resource_quota* resource_quota);
-void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota);
-grpc_resource_quota* grpc_resource_quota_from_channel_args(
- const grpc_channel_args* channel_args, bool create = true);
-
-/* Return a number indicating current memory pressure:
- 0.0 ==> no memory usage
- 1.0 ==> maximum memory usage */
-double grpc_resource_quota_get_memory_pressure(
- grpc_resource_quota* resource_quota);
-
-size_t grpc_resource_quota_peek_size(grpc_resource_quota* resource_quota);
-
-typedef struct grpc_resource_user grpc_resource_user;
-
-grpc_resource_user* grpc_resource_user_create(
- grpc_resource_quota* resource_quota, const char* name);
-
-/* Returns a borrowed reference to the underlying resource quota for this
- resource user. */
-grpc_resource_quota* grpc_resource_user_quota(
- grpc_resource_user* resource_user);
-
-void grpc_resource_user_ref(grpc_resource_user* resource_user);
-void grpc_resource_user_unref(grpc_resource_user* resource_user);
-void grpc_resource_user_shutdown(grpc_resource_user* resource_user);
-
-/* Attempts to get quota from the resource_user to create 'thread_count' number
- * of threads. Returns true if successful (i.e the caller is now free to create
- * 'thread_count' number of threads) or false if quota is not available */
-bool grpc_resource_user_allocate_threads(grpc_resource_user* resource_user,
- int thread_count);
-/* Releases 'thread_count' worth of quota back to the resource user. The quota
- * should have been previously obtained successfully by calling
- * grpc_resource_user_allocate_threads().
- *
- * Note: There need not be an exact one-to-one correspondence between
- * grpc_resource_user_allocate_threads() and grpc_resource_user_free_threads()
- * calls. The only requirement is that the number of threads allocated should
- * all be eventually released */
-void grpc_resource_user_free_threads(grpc_resource_user* resource_user,
- int thread_count);
-
-/* Allocates from the resource user 'size' worth of memory if this won't exceed
- * the resource quota's total size. Returns whether the allocation is done
- * successfully. If allocated successfully, the memory should be freed by the
- * caller eventually. */
-bool grpc_resource_user_safe_alloc(grpc_resource_user* resource_user,
- size_t size);
-/* Allocates from the resource user 'size' worth of memory.
- * If optional_on_done is NULL, then allocate immediately. This may push the
- * quota over-limit, at which point reclamation will kick in. The caller is
- * always responsible to free the memory eventually.
- * Returns true if the allocation was successful. Otherwise, if optional_on_done
- * is non-NULL, it will be scheduled without error when the allocation has been
- * granted by the quota, and the caller is responsible to free the memory
- * eventually. Or it may be scheduled with an error, in which case the caller
- * fails to allocate the memory and shouldn't free the memory.
- */
-bool grpc_resource_user_alloc(grpc_resource_user* resource_user, size_t size,
- grpc_closure* optional_on_done)
- GRPC_MUST_USE_RESULT;
-/* Release memory back to the quota */
-void grpc_resource_user_free(grpc_resource_user* resource_user, size_t size);
-/* Post a memory reclaimer to the resource user. Only one benign and one
- destructive reclaimer can be posted at once. When executed, the reclaimer
- MUST call grpc_resource_user_finish_reclamation before it completes, to
- return control to the resource quota. */
-void grpc_resource_user_post_reclaimer(grpc_resource_user* resource_user,
- bool destructive, grpc_closure* closure);
-/* Finish a reclamation step */
-void grpc_resource_user_finish_reclamation(grpc_resource_user* resource_user);
-
-/* Helper to allocate slices from a resource user */
-typedef struct grpc_resource_user_slice_allocator {
- /* Closure for when a resource user allocation completes */
- grpc_closure on_allocated;
- /* Closure to call when slices have been allocated */
- grpc_closure on_done;
- /* Length of slices to allocate on the current request */
- size_t length;
- /* Number of slices to allocate on the current request */
- size_t count;
- /* Destination for slices to allocate on the current request */
- grpc_slice_buffer* dest;
- /* Parent resource user */
- grpc_resource_user* resource_user;
-} grpc_resource_user_slice_allocator;
-
-/* Initialize a slice allocator.
- When an allocation is completed, calls \a cb with arg \p. */
-void grpc_resource_user_slice_allocator_init(
- grpc_resource_user_slice_allocator* slice_allocator,
- grpc_resource_user* resource_user, grpc_iomgr_cb_func cb, void* p);
-
-/* Allocate \a count slices of length \a length into \a dest. Only one request
- can be outstanding at a time.
- Returns whether the slice was allocated inline in the function. If true,
- the \a slice_allocator->on_allocated callback will not be called. */
-bool grpc_resource_user_alloc_slices(
- grpc_resource_user_slice_allocator* slice_allocator, size_t length,
- size_t count, grpc_slice_buffer* dest) GRPC_MUST_USE_RESULT;
-
-#endif /* GRPC_CORE_LIB_IOMGR_RESOURCE_QUOTA_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr.h b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr.h
index 5edf735cd18..7abb82ddb2b 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr.h
@@ -25,7 +25,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/sockaddr_custom.h"
+#include "src/core/lib/event_engine/sockaddr.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/sockaddr_posix.h"
#include "src/core/lib/iomgr/sockaddr_windows.h"
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_custom.h
deleted file mode 100644
index a5d2a6c3a68..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/sockaddr_custom.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H
-#define GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H
-
-#include <grpc/support/port_platform.h>
-
-#include <stddef.h>
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#error #include <uv.h>
-
-// TODO(kpayson) It would be nice to abstract this so we don't
-// depend on anything uv specific
-typedef struct sockaddr grpc_sockaddr;
-typedef struct sockaddr_in grpc_sockaddr_in;
-typedef struct in_addr grpc_in_addr;
-typedef struct sockaddr_in6 grpc_sockaddr_in6;
-typedef struct in6_addr grpc_in6_addr;
-
-#define GRPC_INET_ADDRSTRLEN INET_ADDRSTRLEN
-#define GRPC_INET6_ADDRSTRLEN INET6_ADDRSTRLEN
-
-#define GRPC_SOCK_STREAM SOCK_STREAM
-#define GRPC_SOCK_DGRAM SOCK_DGRAM
-
-#define GRPC_AF_UNSPEC AF_UNSPEC
-#define GRPC_AF_UNIX AF_UNIX
-#define GRPC_AF_INET AF_INET
-#define GRPC_AF_INET6 AF_INET6
-
-#define GRPC_AI_PASSIVE AI_PASSIVE
-
-#endif // GRPC_UV
-
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_CUSTOM_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc
index 8d1bd71a111..11f865697c8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.cc
@@ -22,13 +22,13 @@
#ifdef GRPC_POSIX_SOCKET_SOCKET_FACTORY
+#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/sync.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/socket_factory_posix.h"
-#include <grpc/impl/codegen/grpc_types.h>
-#include <grpc/support/sync.h>
-
void grpc_socket_factory_init(grpc_socket_factory* factory,
const grpc_socket_factory_vtable* vtable) {
factory->vtable = vtable;
@@ -47,11 +47,11 @@ int grpc_socket_factory_bind(grpc_socket_factory* factory, int sockfd,
int grpc_socket_factory_compare(grpc_socket_factory* a,
grpc_socket_factory* b) {
- int c = GPR_ICMP(a, b);
+ int c = grpc_core::QsortCompare(a, b);
if (c != 0) {
grpc_socket_factory* sma = a;
grpc_socket_factory* smb = b;
- c = GPR_ICMP(sma->vtable, smb->vtable);
+ c = grpc_core::QsortCompare(sma->vtable, smb->vtable);
if (c == 0) {
c = sma->vtable->compare(sma, smb);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.h
index 92ea6c16b70..287ae5f0ef3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_factory_posix.h
@@ -23,6 +23,7 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
+
#include "src/core/lib/iomgr/resolve_address.h"
/** The virtual table of grpc_socket_factory */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc
index 918754adb07..b908e22f753 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.cc
@@ -21,6 +21,7 @@
#include "src/core/lib/iomgr/socket_mutator.h"
#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include "src/core/lib/channel/channel_args.h"
@@ -37,17 +38,29 @@ grpc_socket_mutator* grpc_socket_mutator_ref(grpc_socket_mutator* mutator) {
return mutator;
}
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd) {
- return mutator->vtable->mutate_fd(fd, mutator);
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd,
+ grpc_fd_usage usage) {
+ if (mutator->vtable->mutate_fd_2 != nullptr) {
+ grpc_mutate_socket_info info{fd, usage};
+ return mutator->vtable->mutate_fd_2(&info, mutator);
+ }
+ switch (usage) {
+ case GRPC_FD_SERVER_CONNECTION_USAGE:
+ return true;
+ case GRPC_FD_CLIENT_CONNECTION_USAGE:
+ case GRPC_FD_SERVER_LISTENER_USAGE:
+ return mutator->vtable->mutate_fd(fd, mutator);
+ }
+ GPR_UNREACHABLE_CODE(return false);
}
int grpc_socket_mutator_compare(grpc_socket_mutator* a,
grpc_socket_mutator* b) {
- int c = GPR_ICMP(a, b);
+ int c = grpc_core::QsortCompare(a, b);
if (c != 0) {
grpc_socket_mutator* sma = a;
grpc_socket_mutator* smb = b;
- c = GPR_ICMP(sma->vtable, smb->vtable);
+ c = grpc_core::QsortCompare(sma->vtable, smb->vtable);
if (c == 0) {
c = sma->vtable->compare(sma, smb);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h b/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h
index 9f77a3b2661..f7564da56c9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h
@@ -21,20 +21,43 @@
#include <grpc/support/port_platform.h>
+#include <stdbool.h>
+
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/sync.h>
-#include <stdbool.h>
+/** How is an fd to be used? */
+typedef enum {
+ /** Used for client connection */
+ GRPC_FD_CLIENT_CONNECTION_USAGE,
+ /** Used for server listening */
+ GRPC_FD_SERVER_LISTENER_USAGE,
+ /** Used for server connection */
+ GRPC_FD_SERVER_CONNECTION_USAGE,
+} grpc_fd_usage;
+
+/** Information about an fd to mutate */
+typedef struct {
+ /** File descriptor to mutate */
+ int fd;
+ /** How the fd will be used */
+ grpc_fd_usage usage;
+} grpc_mutate_socket_info;
/** The virtual table of grpc_socket_mutator */
struct grpc_socket_mutator_vtable {
- /** Mutates the socket options of \a fd */
+ /** Mutates the socket options of \a fd -- deprecated, prefer mutate_fd_2 */
bool (*mutate_fd)(int fd, grpc_socket_mutator* mutator);
/** Compare socket mutator \a a and \a b */
int (*compare)(grpc_socket_mutator* a, grpc_socket_mutator* b);
/** Destroys the socket mutator instance */
void (*destroy)(grpc_socket_mutator* mutator);
+ /** Mutates the socket options of the fd in \a info - if set takes preference
+ * to mutate_fd */
+ bool (*mutate_fd_2)(const grpc_mutate_socket_info* info,
+ grpc_socket_mutator* mutator);
};
+
/** The Socket Mutator interface allows changes on socket options */
struct grpc_socket_mutator {
const grpc_socket_mutator_vtable* vtable;
@@ -49,7 +72,8 @@ void grpc_socket_mutator_init(grpc_socket_mutator* mutator,
grpc_arg grpc_socket_mutator_to_arg(grpc_socket_mutator* mutator);
/** Perform the file descriptor mutation operation of \a mutator on \a fd */
-bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd);
+bool grpc_socket_mutator_mutate_fd(grpc_socket_mutator* mutator, int fd,
+ grpc_fd_usage usage);
/** Compare if \a a and \a b are the same mutator or have same settings */
int grpc_socket_mutator_compare(grpc_socket_mutator* a, grpc_socket_mutator* b);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
index 6941423b8a5..c134c71f469 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc
@@ -22,14 +22,14 @@
#ifdef GRPC_POSIX_SOCKET_UTILS_COMMON
-#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <netinet/in.h>
+
+#include "src/core/lib/iomgr/socket_utils.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
#ifdef GRPC_LINUX_TCP_H
#include <linux/tcp.h>
#else
@@ -47,10 +47,10 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include <stdbool.h>
extern "C" bool IsReusePortAvailable();
@@ -64,7 +64,7 @@ extern "C" bool IsReusePortAvailable();
#endif
/* set a socket to use zerocopy */
-grpc_error* grpc_set_socket_zerocopy(int fd) {
+grpc_error_handle grpc_set_socket_zerocopy(int fd) {
#ifdef GRPC_LINUX_ERRQUEUE
const int enable = 1;
auto err = setsockopt(fd, SOL_SOCKET, SO_ZEROCOPY, &enable, sizeof(enable));
@@ -79,7 +79,7 @@ grpc_error* grpc_set_socket_zerocopy(int fd) {
}
/* set a socket to non blocking mode */
-grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking) {
+grpc_error_handle grpc_set_socket_nonblocking(int fd, int non_blocking) {
int oldflags = fcntl(fd, F_GETFL, 0);
if (oldflags < 0) {
return GRPC_OS_ERROR(errno, "fcntl");
@@ -98,7 +98,7 @@ grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd) {
+grpc_error_handle grpc_set_socket_no_sigpipe_if_possible(int fd) {
#ifdef GRPC_HAVE_SO_NOSIGPIPE
int val = 1;
int newval;
@@ -119,7 +119,7 @@ grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) {
+grpc_error_handle grpc_set_socket_ip_pktinfo_if_possible(int fd) {
// Use conditionally-important parameter to avoid warning
(void)fd;
#ifdef GRPC_HAVE_IP_PKTINFO
@@ -132,7 +132,7 @@ grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
+grpc_error_handle grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
// Use conditionally-important parameter to avoid warning
(void)fd;
#ifdef GRPC_HAVE_IPV6_RECVPKTINFO
@@ -145,14 +145,14 @@ grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_set_socket_sndbuf(int fd, int buffer_size_bytes) {
+grpc_error_handle grpc_set_socket_sndbuf(int fd, int buffer_size_bytes) {
return 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buffer_size_bytes,
sizeof(buffer_size_bytes))
? GRPC_ERROR_NONE
: GRPC_OS_ERROR(errno, "setsockopt(SO_SNDBUF)");
}
-grpc_error* grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
+grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
return 0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buffer_size_bytes,
sizeof(buffer_size_bytes))
? GRPC_ERROR_NONE
@@ -160,7 +160,7 @@ grpc_error* grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
}
/* set a socket to close on exec */
-grpc_error* grpc_set_socket_cloexec(int fd, int close_on_exec) {
+grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec) {
int oldflags = fcntl(fd, F_GETFD, 0);
if (oldflags < 0) {
return GRPC_OS_ERROR(errno, "fcntl");
@@ -180,7 +180,7 @@ grpc_error* grpc_set_socket_cloexec(int fd, int close_on_exec) {
}
/* set a socket to reuse old addresses */
-grpc_error* grpc_set_socket_reuse_addr(int fd, int reuse) {
+grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse) {
int val = (reuse != 0);
int newval;
socklen_t intlen = sizeof(newval);
@@ -198,7 +198,7 @@ grpc_error* grpc_set_socket_reuse_addr(int fd, int reuse) {
}
/* set a socket to reuse old addresses */
-grpc_error *grpc_set_socket_reuse_port(int fd, int reuse) {
+grpc_error_handle grpc_set_socket_reuse_port(int fd, int reuse) {
if (!IsReusePortAvailable()) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"SO_REUSEPORT unavailable on host system");
@@ -242,7 +242,7 @@ bool grpc_is_socket_reuse_port_supported() {
}
/* disable nagle */
-grpc_error* grpc_set_socket_low_latency(int fd, int low_latency) {
+grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency) {
int val = (low_latency != 0);
int newval;
socklen_t intlen = sizeof(newval);
@@ -307,7 +307,7 @@ void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client) {
}
/* Set TCP_USER_TIMEOUT */
-grpc_error* grpc_set_socket_tcp_user_timeout(
+grpc_error_handle grpc_set_socket_tcp_user_timeout(
int fd, const grpc_channel_args* channel_args, bool is_client) {
// Use conditionally-important parameter to avoid warning
(void)fd;
@@ -398,16 +398,17 @@ grpc_error* grpc_set_socket_tcp_user_timeout(
}
/* set a socket using a grpc_socket_mutator */
-grpc_error* grpc_set_socket_with_mutator(int fd, grpc_socket_mutator* mutator) {
+grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage,
+ grpc_socket_mutator* mutator) {
GPR_ASSERT(mutator);
- if (!grpc_socket_mutator_mutate_fd(mutator, fd)) {
+ if (!grpc_socket_mutator_mutate_fd(mutator, fd, usage)) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("grpc_socket_mutator failed.");
}
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_apply_socket_mutator_in_args(int fd,
- const grpc_channel_args* args) {
+grpc_error_handle grpc_apply_socket_mutator_in_args(
+ int fd, grpc_fd_usage usage, const grpc_channel_args* args) {
const grpc_arg* socket_mutator_arg =
grpc_channel_args_find(args, GRPC_ARG_SOCKET_MUTATOR);
if (socket_mutator_arg == nullptr) {
@@ -416,7 +417,7 @@ grpc_error* grpc_apply_socket_mutator_in_args(int fd,
GPR_DEBUG_ASSERT(socket_mutator_arg->type == GRPC_ARG_POINTER);
grpc_socket_mutator* mutator =
static_cast<grpc_socket_mutator*>(socket_mutator_arg->value.pointer.p);
- return grpc_set_socket_with_mutator(fd, mutator);
+ return grpc_set_socket_with_mutator(fd, usage, mutator);
}
static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT;
@@ -447,16 +448,16 @@ int grpc_ipv6_loopback_available(void) {
return g_ipv6_loopback_available;
}
-static grpc_error* error_for_fd(int fd, const grpc_resolved_address* addr) {
+static grpc_error_handle error_for_fd(int fd,
+ const grpc_resolved_address* addr) {
if (fd >= 0) return GRPC_ERROR_NONE;
TString addr_str = grpc_sockaddr_to_string(addr, false);
- grpc_error* err = grpc_error_set_str(
- GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(addr_str.c_str()));
+ grpc_error_handle err = grpc_error_set_str(
+ GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS, addr_str);
return err;
}
-grpc_error* grpc_create_dualstack_socket(
+grpc_error_handle grpc_create_dualstack_socket(
const grpc_resolved_address* resolved_addr, int type, int protocol,
grpc_dualstack_mode* dsmode, int* newfd) {
return grpc_create_dualstack_socket_using_factory(
@@ -470,7 +471,7 @@ static int create_socket(grpc_socket_factory* factory, int domain, int type,
: socket(domain, type, protocol);
}
-grpc_error* grpc_create_dualstack_socket_using_factory(
+grpc_error_handle grpc_create_dualstack_socket_using_factory(
grpc_socket_factory* factory, const grpc_resolved_address* resolved_addr,
int type, int protocol, grpc_dualstack_mode* dsmode, int* newfd) {
const grpc_sockaddr* addr =
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc
index 34f93cc4b09..ef5d975b579 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_linux.cc
@@ -22,13 +22,13 @@
#ifdef GRPC_LINUX_SOCKETUTILS
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include <sys/socket.h>
+#include <sys/types.h>
#include <grpc/support/log.h>
-#include <sys/socket.h>
-#include <sys/types.h>
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc
index c48da52ffb2..333e60db782 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.cc
@@ -22,14 +22,14 @@
#ifdef GRPC_POSIX_SOCKETUTILS
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-
#include <fcntl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils_posix.h"
int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
index b4dc909d1e0..d79a4a15ed8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_posix.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/resolve_address.h"
-
#include <sys/socket.h>
#include <unistd.h>
#include <grpc/impl/codegen/grpc_types.h>
+
#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/socket_factory_posix.h"
#include "src/core/lib/iomgr/socket_mutator.h"
@@ -45,31 +45,31 @@ int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec);
/* set a socket to use zerocopy */
-grpc_error* grpc_set_socket_zerocopy(int fd);
+grpc_error_handle grpc_set_socket_zerocopy(int fd);
/* set a socket to non blocking mode */
-grpc_error* grpc_set_socket_nonblocking(int fd, int non_blocking);
+grpc_error_handle grpc_set_socket_nonblocking(int fd, int non_blocking);
/* set a socket to close on exec */
-grpc_error* grpc_set_socket_cloexec(int fd, int close_on_exec);
+grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec);
/* set a socket to reuse old addresses */
-grpc_error* grpc_set_socket_reuse_addr(int fd, int reuse);
+grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse);
/* return true if SO_REUSEPORT is supported */
bool grpc_is_socket_reuse_port_supported();
/* disable nagle */
-grpc_error* grpc_set_socket_low_latency(int fd, int low_latency);
+grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency);
/* set SO_REUSEPORT */
-grpc_error* grpc_set_socket_reuse_port(int fd, int reuse);
+grpc_error_handle grpc_set_socket_reuse_port(int fd, int reuse);
/* Configure the default values for TCP_USER_TIMEOUT */
void config_default_tcp_user_timeout(bool enable, int timeout, bool is_client);
/* Set TCP_USER_TIMEOUT */
-grpc_error* grpc_set_socket_tcp_user_timeout(
+grpc_error_handle grpc_set_socket_tcp_user_timeout(
int fd, const grpc_channel_args* channel_args, bool is_client);
/* Returns true if this system can create AF_INET6 sockets bound to ::1.
@@ -84,28 +84,29 @@ int grpc_ipv6_loopback_available(void);
/* Tries to set SO_NOSIGPIPE if available on this platform.
If SO_NO_SIGPIPE is not available, returns 1. */
-grpc_error* grpc_set_socket_no_sigpipe_if_possible(int fd);
+grpc_error_handle grpc_set_socket_no_sigpipe_if_possible(int fd);
/* Tries to set IP_PKTINFO if available on this platform.
If IP_PKTINFO is not available, returns 1. */
-grpc_error* grpc_set_socket_ip_pktinfo_if_possible(int fd);
+grpc_error_handle grpc_set_socket_ip_pktinfo_if_possible(int fd);
/* Tries to set IPV6_RECVPKTINFO if available on this platform.
If IPV6_RECVPKTINFO is not available, returns 1. */
-grpc_error* grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd);
+grpc_error_handle grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd);
/* Tries to set the socket's send buffer to given size. */
-grpc_error* grpc_set_socket_sndbuf(int fd, int buffer_size_bytes);
+grpc_error_handle grpc_set_socket_sndbuf(int fd, int buffer_size_bytes);
/* Tries to set the socket's receive buffer to given size. */
-grpc_error* grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes);
+grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes);
/* Tries to set the socket using a grpc_socket_mutator */
-grpc_error* grpc_set_socket_with_mutator(int fd, grpc_socket_mutator* mutator);
+grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage,
+ grpc_socket_mutator* mutator);
/* Extracts the first socket mutator from args if any and applies on the fd. */
-grpc_error* grpc_apply_socket_mutator_in_args(int fd,
- const grpc_channel_args* args);
+grpc_error_handle grpc_apply_socket_mutator_in_args(
+ int fd, grpc_fd_usage usage, const grpc_channel_args* args);
/* An enum to keep track of IPv4/IPv6 socket modes.
@@ -149,14 +150,13 @@ int grpc_set_socket_dualstack(int fd);
IPv4, so that bind() or connect() see the correct family.
Also, it's important to distinguish between DUALSTACK and IPV6 when
listening on the [::] wildcard address. */
-grpc_error* grpc_create_dualstack_socket(const grpc_resolved_address* addr,
- int type, int protocol,
- grpc_dualstack_mode* dsmode,
- int* newfd);
+grpc_error_handle grpc_create_dualstack_socket(
+ const grpc_resolved_address* addr, int type, int protocol,
+ grpc_dualstack_mode* dsmode, int* newfd);
/* Same as grpc_create_dualstack_socket(), but use the given socket factory (if
non-null) to create the socket, rather than calling socket() directly. */
-grpc_error* grpc_create_dualstack_socket_using_factory(
+grpc_error_handle grpc_create_dualstack_socket_using_factory(
grpc_socket_factory* factory, const grpc_resolved_address* addr, int type,
int protocol, grpc_dualstack_mode* dsmode, int* newfd);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_uv.cc
deleted file mode 100644
index 96f193ddcc1..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_uv.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
-
-#include <grpc/support/log.h>
-
-#error #include <uv.h>
-
-uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
-
-uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
-
-uint32_t grpc_htonl(uint32_t hostlong) { return htonl(hostlong); }
-
-uint32_t grpc_ntohl(uint32_t netlong) { return ntohl(netlong); }
-
-int grpc_inet_pton(int af, const char* src, void* dst) {
- return inet_pton(af, src, dst);
-}
-
-const char* grpc_inet_ntop(int af, const void* src, char* dst, size_t size) {
- uv_inet_ntop(af, src, dst, size);
- return dst;
-}
-
-#endif /* GRPC_UV */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc
index 9137ab98e60..4f483f0723d 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/socket_utils_windows.cc
@@ -22,11 +22,11 @@
#ifdef GRPC_WINDOWS_SOCKETUTILS
+#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_utils.h"
-#include <grpc/support/log.h>
-
uint16_t grpc_htons(uint16_t hostshort) { return htons(hostshort); }
uint16_t grpc_ntohs(uint16_t netshort) { return ntohs(netshort); }
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client.h
index d209eeb8c23..3e785182ea4 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client.h
@@ -23,9 +23,11 @@
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
typedef struct grpc_tcp_client_vtable {
void (*connect)(grpc_closure* on_connect, grpc_endpoint** endpoint,
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
index eafa885e2c9..f178538534a 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_cfstream.cc
@@ -24,15 +24,14 @@
#ifdef GRPC_CFSTREAM_CLIENT
#include <CoreFoundation/CoreFoundation.h>
-
+#include <netinet/in.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
-#include <netinet/in.h>
-
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/iomgr/cfstream_handle.h"
@@ -40,7 +39,6 @@
#include "src/core/lib/iomgr/endpoint_cfstream.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/error_cfstream.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/timer.h"
@@ -66,11 +64,9 @@ struct CFStreamConnect {
grpc_endpoint** endpoint;
int refs;
TString addr_name;
- grpc_resource_quota* resource_quota;
};
static void CFStreamConnectCleanup(CFStreamConnect* connect) {
- grpc_resource_quota_unref_internal(connect->resource_quota);
CFSTREAM_HANDLE_UNREF(connect->stream_handle, "async connect clean up");
CFRelease(connect->read_stream);
CFRelease(connect->write_stream);
@@ -78,10 +74,11 @@ static void CFStreamConnectCleanup(CFStreamConnect* connect) {
delete connect;
}
-static void OnAlarm(void* arg, grpc_error* error) {
+static void OnAlarm(void* arg, grpc_error_handle error) {
CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%p", connect, error);
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnAlarm, error:%s", connect,
+ grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&connect->mu);
grpc_closure* closure = connect->closure;
@@ -93,16 +90,17 @@ static void OnAlarm(void* arg, grpc_error* error) {
if (done) {
CFStreamConnectCleanup(connect);
} else {
- grpc_error* error =
+ grpc_error_handle error =
GRPC_ERROR_CREATE_FROM_STATIC_STRING("connect() timed out");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
}
}
-static void OnOpen(void* arg, grpc_error* error) {
+static void OnOpen(void* arg, grpc_error_handle error) {
CFStreamConnect* connect = static_cast<CFStreamConnect*>(arg);
if (grpc_tcp_trace.enabled()) {
- gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%p", connect, error);
+ gpr_log(GPR_DEBUG, "CLIENT_CONNECT :%p OnOpen, error:%s", connect,
+ grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&connect->mu);
grpc_timer_cancel(&connect->alarm);
@@ -130,11 +128,10 @@ static void OnOpen(void* arg, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
*endpoint = grpc_cfstream_endpoint_create(
connect->read_stream, connect->write_stream,
- connect->addr_name.c_str(), connect->resource_quota,
- connect->stream_handle);
+ connect->addr_name.c_str(), connect->stream_handle);
}
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
gpr_mu_unlock(&connect->mu);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
@@ -161,7 +158,6 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
connect->closure = closure;
connect->endpoint = ep;
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
- // connect->resource_quota = resource_quota;
connect->refs = 2; // One for the connect operation, one for the timer.
gpr_ref_init(&connect->refcount, 1);
gpr_mu_init(&connect->mu);
@@ -171,18 +167,6 @@ static void CFStreamClientConnect(grpc_closure* closure, grpc_endpoint** ep,
connect, connect->addr_name.c_str());
}
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
- if (channel_args != NULL) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota = grpc_resource_quota_ref_internal(
- (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
- }
- }
- }
- connect->resource_quota = resource_quota;
-
CFReadStreamRef read_stream;
CFWriteStreamRef write_stream;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
index 35b5bc29d3c..5a247ae357a 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_custom.cc
@@ -18,16 +18,15 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_custom.h"
#include "src/core/lib/iomgr/timer.h"
@@ -43,14 +42,11 @@ struct grpc_custom_tcp_connect {
grpc_endpoint** endpoint;
int refs;
TString addr_name;
- grpc_resource_quota* resource_quota;
};
static void custom_tcp_connect_cleanup(grpc_custom_tcp_connect* connect) {
grpc_custom_socket* socket = connect->socket;
- grpc_resource_quota_unref_internal(connect->resource_quota);
delete connect;
- socket->refs--;
if (socket->refs == 0) {
grpc_custom_socket_vtable->destroy(socket);
gpr_free(socket);
@@ -59,14 +55,13 @@ static void custom_tcp_connect_cleanup(grpc_custom_tcp_connect* connect) {
static void custom_close_callback(grpc_custom_socket* /*socket*/) {}
-static void on_alarm(void* acp, grpc_error* error) {
+static void on_alarm(void* acp, grpc_error_handle error) {
int done;
grpc_custom_socket* socket = static_cast<grpc_custom_socket*>(acp);
grpc_custom_tcp_connect* connect = socket->connector;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
- connect->addr_name.c_str(), str);
+ connect->addr_name.c_str(), grpc_error_std_string(error).c_str());
}
if (error == GRPC_ERROR_NONE) {
/* error == NONE implies that the timer ran out, and wasn't cancelled. If
@@ -75,22 +70,24 @@ static void on_alarm(void* acp, grpc_error* error) {
grpc_custom_socket_vtable->close(socket, custom_close_callback);
}
done = (--connect->refs == 0);
+ socket->refs--;
if (done) {
custom_tcp_connect_cleanup(connect);
}
}
static void custom_connect_callback_internal(grpc_custom_socket* socket,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_custom_tcp_connect* connect = socket->connector;
int done;
grpc_closure* closure = connect->closure;
grpc_timer_cancel(&connect->alarm);
if (error == GRPC_ERROR_NONE) {
- *connect->endpoint = custom_tcp_endpoint_create(
- socket, connect->resource_quota, connect->addr_name.c_str());
+ *connect->endpoint =
+ custom_tcp_endpoint_create(socket, connect->addr_name.c_str());
}
done = (--connect->refs == 0);
+ socket->refs--;
if (done) {
grpc_core::ExecCtx::Get()->Flush();
custom_tcp_connect_cleanup(connect);
@@ -99,7 +96,7 @@ static void custom_connect_callback_internal(grpc_custom_socket* socket,
}
static void custom_connect_callback(grpc_custom_socket* socket,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
if (grpc_core::ExecCtx::Get() == nullptr) {
/* If we are being run on a thread which does not have an exec_ctx created
@@ -119,26 +116,14 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
(void)channel_args;
(void)interested_parties;
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(nullptr);
- if (channel_args != nullptr) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota =
- grpc_resource_quota_ref_internal(static_cast<grpc_resource_quota*>(
- channel_args->args[i].value.pointer.p));
- }
- }
- }
grpc_custom_socket* socket =
static_cast<grpc_custom_socket*>(gpr_malloc(sizeof(grpc_custom_socket)));
socket->refs = 2;
- grpc_custom_socket_vtable->init(socket, GRPC_AF_UNSPEC);
+ (void)grpc_custom_socket_vtable->init(socket, GRPC_AF_UNSPEC);
grpc_custom_tcp_connect* connect = new grpc_custom_tcp_connect();
connect->closure = closure;
connect->endpoint = ep;
connect->addr_name = grpc_sockaddr_to_uri(resolved_addr);
- connect->resource_quota = resource_quota;
connect->socket = socket;
socket->connector = connect;
socket->endpoint = nullptr;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
index c6719ff98ec..b65583fcb23 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_TCP_CLIENT
-#include "src/core/lib/iomgr/tcp_client_posix.h"
-
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
@@ -35,14 +33,16 @@
#include <grpc/support/log.h>
#include <grpc/support/time.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr_internal.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_mutator.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/tcp_client_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
@@ -64,9 +64,10 @@ struct async_connect {
grpc_channel_args* channel_args;
};
-static grpc_error* prepare_socket(const grpc_resolved_address* addr, int fd,
- const grpc_channel_args* channel_args) {
- grpc_error* err = GRPC_ERROR_NONE;
+static grpc_error_handle prepare_socket(const grpc_resolved_address* addr,
+ int fd,
+ const grpc_channel_args* channel_args) {
+ grpc_error_handle err = GRPC_ERROR_NONE;
GPR_ASSERT(fd >= 0);
@@ -86,7 +87,8 @@ static grpc_error* prepare_socket(const grpc_resolved_address* addr, int fd,
err = grpc_set_socket_no_sigpipe_if_possible(fd);
if (err != GRPC_ERROR_NONE) goto error;
- err = grpc_apply_socket_mutator_in_args(fd, channel_args);
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_CLIENT_CONNECTION_USAGE,
+ channel_args);
if (err != GRPC_ERROR_NONE) goto error;
goto done;
@@ -99,13 +101,12 @@ done:
return err;
}
-static void tc_on_alarm(void* acp, grpc_error* error) {
+static void tc_on_alarm(void* acp, grpc_error_handle error) {
int done;
async_connect* ac = static_cast<async_connect*>(acp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_alarm: error=%s",
- ac->addr_str.c_str(), str);
+ ac->addr_str.c_str(), grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&ac->mu);
if (ac->fd != nullptr) {
@@ -122,11 +123,12 @@ static void tc_on_alarm(void* acp, grpc_error* error) {
}
grpc_endpoint* grpc_tcp_client_create_from_fd(
- grpc_fd* fd, const grpc_channel_args* channel_args, const char* addr_str) {
+ grpc_fd* fd, const grpc_channel_args* channel_args,
+ y_absl::string_view addr_str) {
return grpc_tcp_create(fd, channel_args, addr_str);
}
-static void on_writable(void* acp, grpc_error* error) {
+static void on_writable(void* acp, grpc_error_handle error) {
async_connect* ac = static_cast<async_connect*>(acp);
int so_error = 0;
socklen_t so_error_size;
@@ -136,12 +138,11 @@ static void on_writable(void* acp, grpc_error* error) {
grpc_closure* closure = ac->closure;
grpc_fd* fd;
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "CLIENT_CONNECT: %s: on_writable: error=%s",
- ac->addr_str.c_str(), str);
+ ac->addr_str.c_str(), grpc_error_std_string(error).c_str());
}
gpr_mu_lock(&ac->mu);
@@ -155,8 +156,7 @@ static void on_writable(void* acp, grpc_error* error) {
gpr_mu_lock(&ac->mu);
if (error != GRPC_ERROR_NONE) {
error =
- grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string("Timeout occurred"));
+ grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR, "Timeout occurred");
goto finish;
}
@@ -173,8 +173,7 @@ static void on_writable(void* acp, grpc_error* error) {
switch (so_error) {
case 0:
grpc_pollset_set_del_fd(ac->interested_parties, fd);
- *ep = grpc_tcp_client_create_from_fd(fd, ac->channel_args,
- ac->addr_str.c_str());
+ *ep = grpc_tcp_client_create_from_fd(fd, ac->channel_args, ac->addr_str);
fd = nullptr;
break;
case ENOBUFS:
@@ -214,23 +213,16 @@ finish:
fd = nullptr;
}
done = (--ac->refs == 0);
- // Create a copy of the data from "ac" to be accessed after the unlock, as
- // "ac" and its contents may be deallocated by the time they are read.
- const grpc_slice addr_str_slice = grpc_slice_from_cpp_string(ac->addr_str);
gpr_mu_unlock(&ac->mu);
if (error != GRPC_ERROR_NONE) {
- grpc_slice str;
+ TString str;
bool ret = grpc_error_get_str(error, GRPC_ERROR_STR_DESCRIPTION, &str);
GPR_ASSERT(ret);
- TString description = y_absl::StrCat("Failed to connect to remote host: ",
- grpc_core::StringViewFromSlice(str));
+ TString description =
+ y_absl::StrCat("Failed to connect to remote host: ", str);
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION, description);
error =
- grpc_error_set_str(error, GRPC_ERROR_STR_DESCRIPTION,
- grpc_slice_from_cpp_string(std::move(description)));
- error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
- addr_str_slice /* takes ownership */);
- } else {
- grpc_slice_unref_internal(addr_str_slice);
+ grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS, ac->addr_str);
}
if (done) {
// This is safe even outside the lock, because "done", the sentinel, is
@@ -239,15 +231,17 @@ finish:
grpc_channel_args_destroy(ac->channel_args);
delete ac;
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
+ // Push async connect closure to the executor since this may actually be
+ // called during the shutdown process, in which case a deadlock could form
+ // between the core shutdown mu and the connector mu (b/188239051)
+ grpc_core::Executor::Run(closure, error);
}
-grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
- const grpc_resolved_address* addr,
- grpc_resolved_address* mapped_addr,
- int* fd) {
+grpc_error_handle grpc_tcp_client_prepare_fd(
+ const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
+ grpc_resolved_address* mapped_addr, int* fd) {
grpc_dualstack_mode dsmode;
- grpc_error* error;
+ grpc_error_handle error;
*fd = -1;
/* Use dualstack sockets where available. Set mapped to v6 or v4 mapped to
v6. */
@@ -288,15 +282,14 @@ void grpc_tcp_client_create_from_prepared_fd(
if (err >= 0) {
*ep = grpc_tcp_client_create_from_fd(fdobj, channel_args,
- grpc_sockaddr_to_uri(addr).c_str());
+ grpc_sockaddr_to_uri(addr));
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
return;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
- grpc_error* error = GRPC_OS_ERROR(errno, "connect");
- error = grpc_error_set_str(
- error, GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr)));
+ grpc_error_handle error = GRPC_OS_ERROR(errno, "connect");
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_sockaddr_to_uri(addr));
grpc_fd_orphan(fdobj, nullptr, nullptr, "tcp_client_connect_error");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return;
@@ -335,7 +328,7 @@ static void tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
grpc_millis deadline) {
grpc_resolved_address mapped_addr;
int fd = -1;
- grpc_error* error;
+ grpc_error_handle error;
*ep = nullptr;
if ((error = grpc_tcp_client_prepare_fd(channel_args, addr, &mapped_addr,
&fd)) != GRPC_ERROR_NONE) {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
index 6f61866fc4f..eac56cdc03e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_posix.h
@@ -30,10 +30,12 @@
fd: a connected FD. Ownership is taken.
channel_args: may contain custom settings for the endpoint
addr_str: destination address in printable format
+ slice_allocator: ownership is taken by client.
Returns: a new endpoint
*/
grpc_endpoint* grpc_tcp_client_create_from_fd(
- grpc_fd* fd, const grpc_channel_args* channel_args, const char* addr_str);
+ grpc_fd* fd, const grpc_channel_args* channel_args,
+ y_absl::string_view addr_str);
/* Return a configured, unbound, unconnected TCP client fd.
@@ -45,10 +47,9 @@ grpc_endpoint* grpc_tcp_client_create_from_fd(
fd: out parameter. The new FD
Returns: error, if any. Out parameters are not set on error
*/
-grpc_error* grpc_tcp_client_prepare_fd(const grpc_channel_args* channel_args,
- const grpc_resolved_address* addr,
- grpc_resolved_address* mapped_addr,
- int* fd);
+grpc_error_handle grpc_tcp_client_prepare_fd(
+ const grpc_channel_args* channel_args, const grpc_resolved_address* addr,
+ grpc_resolved_address* mapped_addr, int* fd);
/* Connect a configured TCP client fd.
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
index a57e7539f2a..9dfc4208fcc 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_client_windows.cc
@@ -18,23 +18,22 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <inttypes.h>
-#ifdef GRPC_WINSOCK_SOCKET
+#include "src/core/lib/iomgr/port.h"
-#include "src/core/lib/iomgr/sockaddr_windows.h"
+#ifdef GRPC_WINSOCK_SOCKET
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -66,7 +65,7 @@ static void async_connect_unlock_and_cleanup(async_connect* ac,
if (socket != NULL) grpc_winsocket_destroy(socket);
}
-static void on_alarm(void* acp, grpc_error* error) {
+static void on_alarm(void* acp, grpc_error_handle error) {
async_connect* ac = (async_connect*)acp;
gpr_mu_lock(&ac->mu);
grpc_winsocket* socket = ac->socket;
@@ -77,13 +76,13 @@ static void on_alarm(void* acp, grpc_error* error) {
async_connect_unlock_and_cleanup(ac, socket);
}
-static void on_connect(void* acp, grpc_error* error) {
+static void on_connect(void* acp, grpc_error_handle error) {
async_connect* ac = (async_connect*)acp;
grpc_endpoint** ep = ac->endpoint;
GPR_ASSERT(*ep == NULL);
grpc_closure* on_done = ac->on_done;
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
gpr_mu_lock(&ac->mu);
grpc_winsocket* socket = ac->socket;
@@ -106,8 +105,8 @@ static void on_connect(void* acp, grpc_error* error) {
error = GRPC_WSA_ERROR(WSAGetLastError(), "ConnectEx");
closesocket(socket->socket);
} else {
- *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name.c_str());
- socket = NULL;
+ *ep = grpc_tcp_create(socket, ac->channel_args, ac->addr_name);
+ socket = nullptr;
}
} else {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("socket is null");
@@ -137,7 +136,7 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
GUID guid = WSAID_CONNECTEX;
DWORD ioctl_num_bytes;
grpc_winsocket_callback_info* info;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
async_connect* ac = NULL;
*endpoint = NULL;
@@ -206,18 +205,19 @@ static void tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
GRPC_CLOSURE_INIT(&ac->on_connect, on_connect, ac, grpc_schedule_on_exec_ctx);
GRPC_CLOSURE_INIT(&ac->on_alarm, on_alarm, ac, grpc_schedule_on_exec_ctx);
+ gpr_mu_lock(&ac->mu);
grpc_timer_init(&ac->alarm, deadline, &ac->on_alarm);
grpc_socket_notify_on_write(socket, &ac->on_connect);
+ gpr_mu_unlock(&ac->mu);
return;
failure:
GPR_ASSERT(error != GRPC_ERROR_NONE);
TString target_uri = grpc_sockaddr_to_uri(addr);
- grpc_error* final_error =
+ grpc_error_handle final_error =
grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Failed to connect", &error, 1),
- GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(std::move(target_uri)));
+ GRPC_ERROR_STR_TARGET_ADDRESS, target_uri);
GRPC_ERROR_UNREF(error);
if (socket != NULL) {
grpc_winsocket_destroy(socket);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
index 5dafe1773cb..1dd43fcd6bc 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.cc
@@ -18,23 +18,21 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/tcp_custom.h"
#include <limits.h>
#include <string.h>
#include <grpc/slice_buffer.h>
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/resource_quota.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/tcp_client.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -64,9 +62,6 @@ struct custom_tcp_endpoint {
grpc_slice_buffer* read_slices = nullptr;
grpc_slice_buffer* write_slices = nullptr;
- grpc_resource_user* resource_user;
- grpc_resource_user_slice_allocator slice_allocator;
-
bool shutting_down;
TString peer_string;
@@ -75,7 +70,6 @@ struct custom_tcp_endpoint {
static void tcp_free(grpc_custom_socket* s) {
custom_tcp_endpoint* tcp =
reinterpret_cast<custom_tcp_endpoint*>(s->endpoint);
- grpc_resource_user_unref(tcp->resource_user);
delete tcp;
s->refs--;
if (s->refs == 0) {
@@ -122,15 +116,13 @@ static void tcp_unref(custom_tcp_endpoint* tcp) {
static void tcp_ref(custom_tcp_endpoint* tcp) { gpr_ref(&tcp->refcount); }
#endif
-static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error* error) {
+static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error_handle error) {
grpc_closure* cb = tcp->read_cb;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp->socket, cb, cb->cb,
cb->cb_arg);
size_t i;
- const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "read: error=%s", str);
-
+ gpr_log(GPR_INFO, "read: error=%s", grpc_error_std_string(error).c_str());
for (i = 0; i < tcp->read_slices->count; i++) {
char* dump = grpc_dump_slice(tcp->read_slices->slices[i],
GPR_DUMP_HEX | GPR_DUMP_ASCII);
@@ -146,7 +138,7 @@ static void call_read_cb(custom_tcp_endpoint* tcp, grpc_error* error) {
}
static void custom_read_callback(grpc_custom_socket* socket, size_t nread,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_slice_buffer garbage;
@@ -171,31 +163,6 @@ static void custom_read_callback(grpc_custom_socket* socket, size_t nread,
call_read_cb(tcp, error);
}
-static void tcp_read_allocation_done(void* tcpp, grpc_error* error) {
- custom_tcp_endpoint* tcp = static_cast<custom_tcp_endpoint*>(tcpp);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp->socket,
- grpc_error_string(error));
- }
- if (error == GRPC_ERROR_NONE) {
- /* Before calling read, we allocate a buffer with exactly one slice
- * to tcp->read_slices and wait for the callback indicating that the
- * allocation was successful. So slices[0] should always exist here */
- char* buffer = reinterpret_cast<char*>(
- GRPC_SLICE_START_PTR(tcp->read_slices->slices[0]));
- size_t len = GRPC_SLICE_LENGTH(tcp->read_slices->slices[0]);
- grpc_custom_socket_vtable->read(tcp->socket, buffer, len,
- custom_read_callback);
- } else {
- grpc_slice_buffer_reset_and_unref_internal(tcp->read_slices);
- call_read_cb(tcp, GRPC_ERROR_REF(error));
- }
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "Initiating read on %p: error=%s", tcp->socket, str);
- }
-}
-
static void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
grpc_closure* cb, bool /*urgent*/) {
custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
@@ -205,15 +172,20 @@ static void endpoint_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
tcp->read_slices = read_slices;
grpc_slice_buffer_reset_and_unref_internal(read_slices);
TCP_REF(tcp, "read");
- if (grpc_resource_user_alloc_slices(&tcp->slice_allocator,
- GRPC_TCP_DEFAULT_READ_SLICE_SIZE, 1,
- tcp->read_slices)) {
- tcp_read_allocation_done(tcp, GRPC_ERROR_NONE);
+ if (tcp->read_slices->length < GRPC_TCP_DEFAULT_READ_SLICE_SIZE) {
+ grpc_slice_buffer_add_indexed(
+ tcp->read_slices, GRPC_SLICE_MALLOC(GRPC_TCP_DEFAULT_READ_SLICE_SIZE));
}
+ /* slices[0] should always exist here since we just added it if it did not */
+ char* buffer = reinterpret_cast<char*>(
+ GRPC_SLICE_START_PTR(tcp->read_slices->slices[0]));
+ size_t len = GRPC_SLICE_LENGTH(tcp->read_slices->slices[0]);
+ grpc_custom_socket_vtable->read(tcp->socket, buffer, len,
+ custom_read_callback);
}
static void custom_write_callback(grpc_custom_socket* socket,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
custom_tcp_endpoint* tcp =
@@ -221,8 +193,8 @@ static void custom_write_callback(grpc_custom_socket* socket,
grpc_closure* cb = tcp->write_cb;
tcp->write_cb = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "write complete on %p: error=%s", tcp->socket, str);
+ gpr_log(GPR_INFO, "write complete on %p: error=%s", tcp->socket,
+ grpc_error_std_string(error).c_str());
}
TCP_UNREF(tcp, "write");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
@@ -256,8 +228,7 @@ static void endpoint_write(grpc_endpoint* ep, grpc_slice_buffer* write_slices,
tcp->write_slices = write_slices;
GPR_ASSERT(tcp->write_slices->count <= UINT_MAX);
if (tcp->write_slices->count == 0) {
- // No slices means we don't have to do anything,
- // and libuv doesn't like empty writes
+ // No slices means we don't have to do anything
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
return;
}
@@ -287,19 +258,18 @@ static void endpoint_delete_from_pollset_set(grpc_endpoint* ep,
(void)pollset;
}
-static void endpoint_shutdown(grpc_endpoint* ep, grpc_error* why) {
+static void endpoint_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
if (!tcp->shutting_down) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(why);
- gpr_log(GPR_INFO, "TCP %p shutdown why=%s", tcp->socket, str);
+ gpr_log(GPR_INFO, "TCP %p shutdown why=%s", tcp->socket,
+ grpc_error_std_string(why).c_str());
}
tcp->shutting_down = true;
// grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->read_cb,
// GRPC_ERROR_REF(why));
// grpc_core::ExecCtx::Run(DEBUG_LOCATION,tcp->write_cb,
// GRPC_ERROR_REF(why)); tcp->read_cb = nullptr; tcp->write_cb = nullptr;
- grpc_resource_user_shutdown(tcp->resource_user);
grpc_custom_socket_vtable->shutdown(tcp->socket);
}
GRPC_ERROR_UNREF(why);
@@ -334,11 +304,6 @@ static y_absl::string_view endpoint_get_local_address(grpc_endpoint* ep) {
return tcp->local_address;
}
-static grpc_resource_user* endpoint_get_resource_user(grpc_endpoint* ep) {
- custom_tcp_endpoint* tcp = reinterpret_cast<custom_tcp_endpoint*>(ep);
- return tcp->resource_user;
-}
-
static int endpoint_get_fd(grpc_endpoint* /*ep*/) { return -1; }
static bool endpoint_can_track_err(grpc_endpoint* /*ep*/) { return false; }
@@ -350,14 +315,12 @@ static grpc_endpoint_vtable vtable = {endpoint_read,
endpoint_delete_from_pollset_set,
endpoint_shutdown,
endpoint_destroy,
- endpoint_get_resource_user,
endpoint_get_peer,
endpoint_get_local_address,
endpoint_get_fd,
endpoint_can_track_err};
grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
- grpc_resource_quota* resource_quota,
const char* peer_string) {
custom_tcp_endpoint* tcp = new custom_tcp_endpoint;
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
@@ -383,9 +346,5 @@ grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
}
tcp->shutting_down = false;
- tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(
- &tcp->slice_allocator, tcp->resource_user, tcp_read_allocation_done, tcp);
-
return &tcp->base;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
index d32ed2b4b61..6385d044a5e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_custom.h
@@ -40,18 +40,19 @@ typedef struct grpc_custom_socket {
} grpc_custom_socket;
typedef void (*grpc_custom_connect_callback)(grpc_custom_socket* socket,
- grpc_error* error);
+ grpc_error_handle error);
typedef void (*grpc_custom_write_callback)(grpc_custom_socket* socket,
- grpc_error* error);
+ grpc_error_handle error);
typedef void (*grpc_custom_read_callback)(grpc_custom_socket* socket,
- size_t nread, grpc_error* error);
+ size_t nread,
+ grpc_error_handle error);
typedef void (*grpc_custom_accept_callback)(grpc_custom_socket* socket,
grpc_custom_socket* client,
- grpc_error* error);
+ grpc_error_handle error);
typedef void (*grpc_custom_close_callback)(grpc_custom_socket* socket);
typedef struct grpc_socket_vtable {
- grpc_error* (*init)(grpc_custom_socket* socket, int domain);
+ grpc_error_handle (*init)(grpc_custom_socket* socket, int domain);
void (*connect)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
size_t len, grpc_custom_connect_callback cb);
void (*destroy)(grpc_custom_socket* socket);
@@ -61,13 +62,13 @@ typedef struct grpc_socket_vtable {
grpc_custom_write_callback cb);
void (*read)(grpc_custom_socket* socket, char* buffer, size_t length,
grpc_custom_read_callback cb);
- grpc_error* (*getpeername)(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, int* len);
- grpc_error* (*getsockname)(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, int* len);
- grpc_error* (*bind)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
- size_t len, int flags);
- grpc_error* (*listen)(grpc_custom_socket* socket);
+ grpc_error_handle (*getpeername)(grpc_custom_socket* socket,
+ const grpc_sockaddr* addr, int* len);
+ grpc_error_handle (*getsockname)(grpc_custom_socket* socket,
+ const grpc_sockaddr* addr, int* len);
+ grpc_error_handle (*bind)(grpc_custom_socket* socket,
+ const grpc_sockaddr* addr, size_t len, int flags);
+ grpc_error_handle (*listen)(grpc_custom_socket* socket);
void (*accept)(grpc_custom_socket* socket, grpc_custom_socket* client,
grpc_custom_accept_callback cb);
} grpc_socket_vtable;
@@ -77,8 +78,8 @@ void grpc_custom_endpoint_init(grpc_socket_vtable* impl);
void grpc_custom_close_server_callback(grpc_tcp_listener* listener);
+/// Takes ownership of \a slice_allocator.
grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
- grpc_resource_quota* resource_quota,
const char* peer_string);
#endif /* GRPC_CORE_LIB_IOMGR_TCP_CUSTOM_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
index 102ab5bdd70..0e4438946e8 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.cc
@@ -18,12 +18,12 @@
#include <grpc/support/port_platform.h>
+#include <grpc/impl/codegen/grpc_types.h>
+
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_POSIX_SOCKET_TCP
-#include "src/core/lib/iomgr/tcp_posix.h"
-
#include <errno.h>
#include <limits.h>
#include <netinet/in.h>
@@ -35,6 +35,7 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
+
#include <algorithm>
#include <unordered_map>
@@ -45,6 +46,7 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/trace.h"
@@ -54,9 +56,11 @@
#include "src/core/lib/iomgr/buffer_list.h"
#include "src/core/lib/iomgr/ev_posix.h"
#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/resource_quota/api.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -136,12 +140,12 @@ class TcpZerocopySendRecord {
}
// References: 1 reference per sendmsg(), and 1 for the tcp_write().
- void Ref() { ref_.FetchAdd(1, MemoryOrder::RELAXED); }
+ void Ref() { ref_.fetch_add(1, std::memory_order_relaxed); }
// Unref: called when we get an error queue notification for a sendmsg(), if a
// sendmsg() failed or when tcp_write() is done.
bool Unref() {
- const intptr_t prior = ref_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const intptr_t prior = ref_.fetch_sub(1, std::memory_order_acq_rel);
GPR_DEBUG_ASSERT(prior > 0);
if (prior == 1) {
AllSendsComplete();
@@ -159,7 +163,7 @@ class TcpZerocopySendRecord {
void AssertEmpty() {
GPR_DEBUG_ASSERT(buf_.count == 0);
GPR_DEBUG_ASSERT(buf_.length == 0);
- GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
+ GPR_DEBUG_ASSERT(ref_.load(std::memory_order_relaxed) == 0);
}
// When all sendmsg() calls associated with this tcp_write() have been
@@ -167,12 +171,12 @@ class TcpZerocopySendRecord {
// for each sendmsg()) and all reference counts have been dropped, drop our
// reference to the underlying data since we no longer need it.
void AllSendsComplete() {
- GPR_DEBUG_ASSERT(ref_.Load(MemoryOrder::RELAXED) == 0);
+ GPR_DEBUG_ASSERT(ref_.load(std::memory_order_relaxed) == 0);
grpc_slice_buffer_reset_and_unref_internal(&buf_);
}
grpc_slice_buffer buf_;
- Atomic<intptr_t> ref_;
+ std::atomic<intptr_t> ref_{0};
OutgoingOffset out_offset_;
};
@@ -286,7 +290,7 @@ class TcpZerocopySendCtx {
// Indicate that we are disposing of this zerocopy context. This indicator
// will prevent new zerocopy writes from being issued.
- void Shutdown() { shutdown_.Store(true, MemoryOrder::RELEASE); }
+ void Shutdown() { shutdown_.store(true, std::memory_order_release); }
// Indicates that there are no inflight tcp_write() instances with zerocopy
// enabled.
@@ -317,7 +321,7 @@ class TcpZerocopySendCtx {
}
TcpZerocopySendRecord* TryGetSendRecordLocked() {
- if (shutdown_.Load(MemoryOrder::ACQUIRE)) {
+ if (shutdown_.load(std::memory_order_acquire)) {
return nullptr;
}
if (free_send_records_size_ == 0) {
@@ -339,7 +343,7 @@ class TcpZerocopySendCtx {
int free_send_records_size_;
Mutex lock_;
uint32_t last_send_ = 0;
- Atomic<bool> shutdown_;
+ std::atomic<bool> shutdown_{false};
bool enabled_ = false;
size_t threshold_bytes_ = kDefaultSendBytesThreshold;
std::unordered_map<uint32_t, TcpZerocopySendRecord*> ctx_lookup_;
@@ -392,8 +396,8 @@ struct grpc_tcp {
TString peer_string;
TString local_address;
- grpc_resource_user* resource_user;
- grpc_resource_user_slice_allocator slice_allocator;
+ grpc_core::MemoryOwner memory_owner;
+ grpc_core::MemoryAllocator::Reservation self_reservation;
grpc_core::TracedBuffer* tb_head; /* List of traced buffers */
gpr_mu tb_mu; /* Lock for access to list of traced buffers */
@@ -432,15 +436,17 @@ static void ZerocopyDisableAndWaitForRemaining(grpc_tcp* tcp);
#define BACKUP_POLLER_POLLSET(b) ((grpc_pollset*)((b) + 1))
-static gpr_atm g_uncovered_notifications_pending;
-static gpr_atm g_backup_poller; /* backup_poller* */
+static grpc_core::Mutex* g_backup_poller_mu = nullptr;
+static int g_uncovered_notifications_pending
+ Y_ABSL_GUARDED_BY(g_backup_poller_mu);
+static backup_poller* g_backup_poller Y_ABSL_GUARDED_BY(g_backup_poller_mu);
-static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error);
-static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error);
+static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
+static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error_handle error);
static void tcp_drop_uncovered_then_handle_write(void* arg /* grpc_tcp */,
- grpc_error* error);
+ grpc_error_handle error);
-static void done_poller(void* bp, grpc_error* /*error_ignored*/) {
+static void done_poller(void* bp, grpc_error_handle /*error_ignored*/) {
backup_poller* p = static_cast<backup_poller*>(bp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p destroy", p);
@@ -449,7 +455,7 @@ static void done_poller(void* bp, grpc_error* /*error_ignored*/) {
gpr_free(p);
}
-static void run_poller(void* bp, grpc_error* /*error_ignored*/) {
+static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
backup_poller* p = static_cast<backup_poller*>(bp);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p run", p);
@@ -461,17 +467,13 @@ static void run_poller(void* bp, grpc_error* /*error_ignored*/) {
"backup_poller:pollset_work",
grpc_pollset_work(BACKUP_POLLER_POLLSET(p), nullptr, deadline));
gpr_mu_unlock(p->pollset_mu);
- /* last "uncovered" notification is the ref that keeps us polling, if we get
- * there try a cas to release it */
- if (gpr_atm_no_barrier_load(&g_uncovered_notifications_pending) == 1 &&
- gpr_atm_full_cas(&g_uncovered_notifications_pending, 1, 0)) {
- gpr_mu_lock(p->pollset_mu);
- bool cas_ok =
- gpr_atm_full_cas(&g_backup_poller, reinterpret_cast<gpr_atm>(p), 0);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p done cas_ok=%d", p, cas_ok);
- }
- gpr_mu_unlock(p->pollset_mu);
+ g_backup_poller_mu->Lock();
+ /* last "uncovered" notification is the ref that keeps us polling */
+ if (g_uncovered_notifications_pending == 1) {
+ GPR_ASSERT(g_backup_poller == p);
+ g_backup_poller = nullptr;
+ g_uncovered_notifications_pending = 0;
+ g_backup_poller_mu->Unlock();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p shutdown", p);
}
@@ -479,6 +481,7 @@ static void run_poller(void* bp, grpc_error* /*error_ignored*/) {
GRPC_CLOSURE_INIT(&p->run_poller, done_poller, p,
grpc_schedule_on_exec_ctx));
} else {
+ g_backup_poller_mu->Unlock();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p);
}
@@ -489,15 +492,17 @@ static void run_poller(void* bp, grpc_error* /*error_ignored*/) {
}
static void drop_uncovered(grpc_tcp* /*tcp*/) {
- backup_poller* p =
- reinterpret_cast<backup_poller*>(gpr_atm_acq_load(&g_backup_poller));
- gpr_atm old_count =
- gpr_atm_full_fetch_add(&g_uncovered_notifications_pending, -1);
+ int old_count;
+ backup_poller* p;
+ g_backup_poller_mu->Lock();
+ p = g_backup_poller;
+ old_count = g_uncovered_notifications_pending--;
+ g_backup_poller_mu->Unlock();
+ GPR_ASSERT(old_count > 1);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p,
- static_cast<int>(old_count), static_cast<int>(old_count) - 1);
+ gpr_log(GPR_INFO, "BACKUP_POLLER:%p uncover cnt %d->%d", p, old_count,
+ old_count - 1);
}
- GPR_ASSERT(old_count != 1);
}
// gRPC API considers a Write operation to be done the moment it clears ‘flow
@@ -509,38 +514,33 @@ static void drop_uncovered(grpc_tcp* /*tcp*/) {
// polling thread and progress is made) and hence add it to a backup poller here
static void cover_self(grpc_tcp* tcp) {
backup_poller* p;
- gpr_atm old_count =
- gpr_atm_no_barrier_fetch_add(&g_uncovered_notifications_pending, 2);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER: cover cnt %d->%d",
- static_cast<int>(old_count), 2 + static_cast<int>(old_count));
- }
- if (old_count == 0) {
- GRPC_STATS_INC_TCP_BACKUP_POLLERS_CREATED();
+ g_backup_poller_mu->Lock();
+ int old_count = 0;
+ if (g_uncovered_notifications_pending == 0) {
+ g_uncovered_notifications_pending = 2;
p = static_cast<backup_poller*>(
gpr_zalloc(sizeof(*p) + grpc_pollset_size()));
+ g_backup_poller = p;
+ grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu);
+ g_backup_poller_mu->Unlock();
+ GRPC_STATS_INC_TCP_BACKUP_POLLERS_CREATED();
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p create", p);
}
- grpc_pollset_init(BACKUP_POLLER_POLLSET(p), &p->pollset_mu);
- gpr_atm_rel_store(&g_backup_poller, (gpr_atm)p);
grpc_core::Executor::Run(
GRPC_CLOSURE_INIT(&p->run_poller, run_poller, p, nullptr),
GRPC_ERROR_NONE, grpc_core::ExecutorType::DEFAULT,
grpc_core::ExecutorJobType::LONG);
} else {
- while ((p = reinterpret_cast<backup_poller*>(
- gpr_atm_acq_load(&g_backup_poller))) == nullptr) {
- // spin waiting for backup poller
- }
+ old_count = g_uncovered_notifications_pending++;
+ p = g_backup_poller;
+ g_backup_poller_mu->Unlock();
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p", p, tcp);
+ gpr_log(GPR_INFO, "BACKUP_POLLER:%p add %p cnt %d->%d", p, tcp,
+ old_count - 1, old_count);
}
grpc_pollset_add_fd(BACKUP_POLLER_POLLSET(p), tcp->em_fd);
- if (old_count != 0) {
- drop_uncovered(tcp);
- }
}
static void notify_on_read(grpc_tcp* tcp) {
@@ -560,9 +560,11 @@ static void notify_on_write(grpc_tcp* tcp) {
grpc_fd_notify_on_write(tcp->em_fd, &tcp->write_done_closure);
}
-static void tcp_drop_uncovered_then_handle_write(void* arg, grpc_error* error) {
+static void tcp_drop_uncovered_then_handle_write(void* arg,
+ grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p got_write: %s", arg, grpc_error_string(error));
+ gpr_log(GPR_INFO, "TCP:%p got_write: %s", arg,
+ grpc_error_std_string(error).c_str());
}
drop_uncovered(static_cast<grpc_tcp*>(arg));
tcp_handle_write(arg, error);
@@ -578,7 +580,7 @@ static void finish_estimate(grpc_tcp* tcp) {
value */
if (tcp->bytes_read_this_round > tcp->target_length * 0.8) {
tcp->target_length =
- GPR_MAX(2 * tcp->target_length, tcp->bytes_read_this_round);
+ std::max(2 * tcp->target_length, tcp->bytes_read_this_round);
} else {
tcp->target_length =
0.99 * tcp->target_length + 0.01 * tcp->bytes_read_this_round;
@@ -586,50 +588,30 @@ static void finish_estimate(grpc_tcp* tcp) {
tcp->bytes_read_this_round = 0;
}
-static size_t get_target_read_size(grpc_tcp* tcp) {
- grpc_resource_quota* rq = grpc_resource_user_quota(tcp->resource_user);
- double pressure = grpc_resource_quota_get_memory_pressure(rq);
- double target =
- tcp->target_length * (pressure > 0.8 ? (1.0 - pressure) / 0.2 : 1.0);
- size_t sz = ((static_cast<size_t> GPR_CLAMP(target, tcp->min_read_chunk_size,
- tcp->max_read_chunk_size)) +
- 255) &
- ~static_cast<size_t>(255);
- /* don't use more than 1/16th of the overall resource quota for a single read
- * alloc */
- size_t rqmax = grpc_resource_quota_peek_size(rq);
- if (sz > rqmax / 16 && rqmax > 1024) {
- sz = rqmax / 16;
- }
- return sz;
-}
-
-static grpc_error* tcp_annotate_error(grpc_error* src_error, grpc_tcp* tcp) {
+static grpc_error_handle tcp_annotate_error(grpc_error_handle src_error,
+ grpc_tcp* tcp) {
return grpc_error_set_str(
grpc_error_set_int(
grpc_error_set_int(src_error, GRPC_ERROR_INT_FD, tcp->fd),
/* All tcp errors are marked with UNAVAILABLE so that application may
* choose to retry. */
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE),
- GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_copied_string(tcp->peer_string.c_str()));
+ GRPC_ERROR_STR_TARGET_ADDRESS, tcp->peer_string);
}
-static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error);
-static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error);
+static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error);
+static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error_handle error);
-static void tcp_shutdown(grpc_endpoint* ep, grpc_error* why) {
+static void tcp_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
ZerocopyDisableAndWaitForRemaining(tcp);
grpc_fd_shutdown(tcp->em_fd, why);
- grpc_resource_user_shutdown(tcp->resource_user);
}
static void tcp_free(grpc_tcp* tcp) {
grpc_fd_orphan(tcp->em_fd, tcp->release_fd_cb, tcp->release_fd,
"tcp_unref_orphan");
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
- grpc_resource_user_unref(tcp->resource_user);
/* The lock is not really necessary here, since all refs have been released */
gpr_mu_lock(&tcp->tb_mu);
grpc_core::TracedBuffer::Shutdown(
@@ -678,16 +660,14 @@ static void tcp_destroy(grpc_endpoint* ep) {
TCP_UNREF(tcp, "destroy");
}
-static void call_read_cb(grpc_tcp* tcp, grpc_error* error) {
+static void call_read_cb(grpc_tcp* tcp, grpc_error_handle error) {
grpc_closure* cb = tcp->read_cb;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "TCP:%p call_cb %p %p:%p", tcp, cb, cb->cb, cb->cb_arg);
size_t i;
- const char* str = grpc_error_string(error);
gpr_log(GPR_INFO, "READ %p (peer=%s) error=%s", tcp,
- tcp->peer_string.c_str(), str);
-
+ tcp->peer_string.c_str(), grpc_error_std_string(error).c_str());
if (gpr_should_log(GPR_LOG_SEVERITY_DEBUG)) {
for (i = 0; i < tcp->incoming_buffer->count; i++) {
char* dump = grpc_dump_slice(tcp->incoming_buffer->slices[i],
@@ -724,6 +704,8 @@ static void tcp_do_read(grpc_tcp* tcp) {
iov[i].iov_len = GRPC_SLICE_LENGTH(tcp->incoming_buffer->slices[i]);
}
+ GPR_ASSERT(tcp->incoming_buffer->length != 0);
+
do {
/* Assume there is something on the queue. If we receive TCP_INQ from
* kernel, we will update this value, otherwise, we have to assume there is
@@ -810,7 +792,6 @@ static void tcp_do_read(grpc_tcp* tcp) {
total_read_bytes += read_bytes;
if (tcp->inq == 0 || total_read_bytes == tcp->incoming_buffer->length) {
- /* We have filled incoming_buffer, and we cannot read any more. */
break;
}
@@ -850,36 +831,25 @@ static void tcp_do_read(grpc_tcp* tcp) {
TCP_UNREF(tcp, "read");
}
-static void tcp_read_allocation_done(void* tcpp, grpc_error* error) {
- grpc_tcp* tcp = static_cast<grpc_tcp*>(tcpp);
- if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p read_allocation_done: %s", tcp,
- grpc_error_string(error));
- }
- if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
- grpc_slice_buffer_reset_and_unref_internal(tcp->incoming_buffer);
- grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
- call_read_cb(tcp, GRPC_ERROR_REF(error));
- TCP_UNREF(tcp, "read");
- } else {
- tcp_do_read(tcp);
- }
-}
-
static void tcp_continue_read(grpc_tcp* tcp) {
- size_t target_read_size = get_target_read_size(tcp);
- /* Wait for allocation only when there is no buffer left. */
if (tcp->incoming_buffer->length == 0 &&
tcp->incoming_buffer->count < MAX_READ_IOVEC) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p alloc_slices", tcp);
- }
- if (GPR_UNLIKELY(!grpc_resource_user_alloc_slices(&tcp->slice_allocator,
- target_read_size, 1,
- tcp->incoming_buffer))) {
- // Wait for allocation.
- return;
+ gpr_log(GPR_INFO,
+ "TCP:%p alloc_slices; min_chunk=%d max_chunk=%d target=%lf "
+ "buf_len=%" PRIdPTR,
+ tcp, tcp->min_read_chunk_size, tcp->max_read_chunk_size,
+ tcp->target_length, tcp->incoming_buffer->length);
}
+ int target_length = static_cast<int>(tcp->target_length);
+ int extra_wanted =
+ target_length - static_cast<int>(tcp->incoming_buffer->length);
+ grpc_slice_buffer_add_indexed(
+ tcp->incoming_buffer,
+ tcp->memory_owner.MakeSlice(grpc_core::MemoryRequest(
+ tcp->min_read_chunk_size,
+ grpc_core::Clamp(extra_wanted, tcp->min_read_chunk_size,
+ tcp->max_read_chunk_size))));
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "TCP:%p do_read", tcp);
@@ -887,10 +857,11 @@ static void tcp_continue_read(grpc_tcp* tcp) {
tcp_do_read(tcp);
}
-static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error* error) {
+static void tcp_handle_read(void* arg /* grpc_tcp */, grpc_error_handle error) {
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp, grpc_error_string(error));
+ gpr_log(GPR_INFO, "TCP:%p got_read: %s", tcp,
+ grpc_error_std_string(error).c_str());
}
if (GPR_UNLIKELY(error != GRPC_ERROR_NONE)) {
@@ -958,7 +929,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
int additional_flags = 0);
/** The callback function to be invoked when we get an error on the socket. */
-static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error);
+static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error_handle error);
static TcpZerocopySendRecord* tcp_get_send_zerocopy_record(
grpc_tcp* tcp, grpc_slice_buffer* buf);
@@ -1162,9 +1133,9 @@ static bool process_errors(grpc_tcp* tcp) {
struct cmsghdr align;
} aligned_buf;
msg.msg_control = aligned_buf.rbuf;
- msg.msg_controllen = sizeof(aligned_buf.rbuf);
int r, saved_errno;
while (true) {
+ msg.msg_controllen = sizeof(aligned_buf.rbuf);
do {
r = recvmsg(tcp->fd, &msg, MSG_ERRQUEUE);
saved_errno = errno;
@@ -1213,10 +1184,12 @@ static bool process_errors(grpc_tcp* tcp) {
}
}
-static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
+static void tcp_handle_error(void* arg /* grpc_tcp */,
+ grpc_error_handle error) {
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- gpr_log(GPR_INFO, "TCP:%p got_error: %s", tcp, grpc_error_string(error));
+ gpr_log(GPR_INFO, "TCP:%p got_error: %s", tcp,
+ grpc_error_std_string(error).c_str());
}
if (error != GRPC_ERROR_NONE ||
@@ -1257,7 +1230,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* /*tcp*/, struct msghdr* /*msg*/,
}
static void tcp_handle_error(void* /*arg*/ /* grpc_tcp */,
- grpc_error* /*error*/) {
+ grpc_error_handle /*error*/) {
gpr_log(GPR_ERROR, "Error handling is not supported for this platform");
GPR_ASSERT(0);
}
@@ -1276,10 +1249,10 @@ void tcp_shutdown_buffer_list(grpc_tcp* tcp) {
}
}
-#if defined(IOV_MAX) && IOV_MAX < 1000
+#if defined(IOV_MAX) && IOV_MAX < 260
#define MAX_WRITE_IOVEC IOV_MAX
#else
-#define MAX_WRITE_IOVEC 1000
+#define MAX_WRITE_IOVEC 260
#endif
msg_iovlen_type TcpZerocopySendRecord::PopulateIovs(size_t* unwind_slice_idx,
size_t* unwind_byte_idx,
@@ -1323,14 +1296,18 @@ void TcpZerocopySendRecord::UpdateOffsetForBytesSent(size_t sending_length,
// returns true if done, false if pending; if returning true, *error is set
static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
- grpc_error** error) {
- struct msghdr msg;
- struct iovec iov[MAX_WRITE_IOVEC];
+ grpc_error_handle* error) {
msg_iovlen_type iov_size;
ssize_t sent_length = 0;
size_t sending_length;
size_t unwind_slice_idx;
size_t unwind_byte_idx;
+ bool tried_sending_message;
+ msghdr msg;
+ // iov consumes a large space. Keep it as the last item on the stack to
+ // improve locality. After all, we expect only the first elements of it being
+ // populated in most cases.
+ iovec iov[MAX_WRITE_IOVEC];
while (true) {
sending_length = 0;
iov_size = record->PopulateIovs(&unwind_slice_idx, &unwind_byte_idx,
@@ -1340,7 +1317,7 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
msg.msg_iov = iov;
msg.msg_iovlen = iov_size;
msg.msg_flags = 0;
- bool tried_sending_message = false;
+ tried_sending_message = false;
// Before calling sendmsg (with or without timestamps): we
// take a single ref on the zerocopy send record.
tcp->tcp_zerocopy_send_ctx.NoteSend(record);
@@ -1399,7 +1376,7 @@ static void UnrefMaybePutZerocopySendRecord(grpc_tcp* tcp,
}
static bool tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
- grpc_error** error) {
+ grpc_error_handle* error) {
bool done = do_tcp_flush_zerocopy(tcp, record, error);
if (done) {
// Either we encountered an error, or we successfully sent all the bytes.
@@ -1409,7 +1386,7 @@ static bool tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
return done;
}
-static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
+static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) {
struct msghdr msg;
struct iovec iov[MAX_WRITE_IOVEC];
msg_iovlen_type iov_size;
@@ -1516,7 +1493,8 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
}
}
-static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) {
+static void tcp_handle_write(void* arg /* grpc_tcp */,
+ grpc_error_handle error) {
grpc_tcp* tcp = static_cast<grpc_tcp*>(arg);
grpc_closure* cb;
@@ -1549,8 +1527,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */, grpc_error* error) {
tcp->write_cb = nullptr;
tcp->current_zerocopy_send = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "write: %s", str);
+ gpr_log(GPR_INFO, "write: %s", grpc_error_std_string(error).c_str());
}
// No need to take a ref on error since tcp_flush provides a ref.
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
@@ -1562,7 +1539,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
grpc_closure* cb, void* arg) {
GPR_TIMER_SCOPE("tcp_write", 0);
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
TcpZerocopySendRecord* zerocopy_send_record = nullptr;
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
@@ -1618,8 +1595,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
notify_on_write(tcp);
} else {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
- const char* str = grpc_error_string(error);
- gpr_log(GPR_INFO, "write: %s", str);
+ gpr_log(GPR_INFO, "write: %s", grpc_error_std_string(error).c_str());
}
grpc_core::Closure::Run(DEBUG_LOCATION, cb, error);
}
@@ -1639,7 +1615,6 @@ static void tcp_add_to_pollset_set(grpc_endpoint* ep,
static void tcp_delete_from_pollset_set(grpc_endpoint* ep,
grpc_pollset_set* pollset_set) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- ZerocopyDisableAndWaitForRemaining(tcp);
grpc_pollset_set_del_fd(pollset_set, tcp->em_fd);
}
@@ -1658,11 +1633,6 @@ static int tcp_get_fd(grpc_endpoint* ep) {
return tcp->fd;
}
-static grpc_resource_user* tcp_get_resource_user(grpc_endpoint* ep) {
- grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
- return tcp->resource_user;
-}
-
static bool tcp_can_track_err(grpc_endpoint* ep) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
if (!grpc_event_engine_can_track_errors()) {
@@ -1683,7 +1653,6 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
tcp_delete_from_pollset_set,
tcp_shutdown,
tcp_destroy,
- tcp_get_resource_user,
tcp_get_peer,
tcp_get_local_address,
tcp_get_fd,
@@ -1693,7 +1662,7 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
const grpc_channel_args* channel_args,
- const char* peer_string) {
+ y_absl::string_view peer_string) {
static constexpr bool kZerocpTxEnabledDefault = false;
int tcp_read_chunk_size = GRPC_TCP_DEFAULT_READ_SLICE_SIZE;
int tcp_max_read_chunk_size = 4 * 1024 * 1024;
@@ -1703,7 +1672,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
grpc_core::TcpZerocopySendCtx::kDefaultSendBytesThreshold;
int tcp_tx_zerocopy_max_simult_sends =
grpc_core::TcpZerocopySendCtx::kDefaultMaxSends;
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(nullptr);
if (channel_args != nullptr) {
for (size_t i = 0; i < channel_args->num_args; i++) {
if (0 ==
@@ -1721,12 +1689,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
grpc_integer_options options = {tcp_read_chunk_size, 1, MAX_CHUNK_SIZE};
tcp_max_read_chunk_size =
grpc_channel_arg_get_integer(&channel_args->args[i], options);
- } else if (0 ==
- strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota =
- grpc_resource_quota_ref_internal(static_cast<grpc_resource_quota*>(
- channel_args->args[i].value.pointer.p));
} else if (0 == strcmp(channel_args->args[i].key,
GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED)) {
tcp_tx_zerocopy_enabled = grpc_channel_arg_get_bool(
@@ -1751,14 +1713,18 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
if (tcp_min_read_chunk_size > tcp_max_read_chunk_size) {
tcp_min_read_chunk_size = tcp_max_read_chunk_size;
}
- tcp_read_chunk_size = GPR_CLAMP(tcp_read_chunk_size, tcp_min_read_chunk_size,
- tcp_max_read_chunk_size);
+ tcp_read_chunk_size = grpc_core::Clamp(
+ tcp_read_chunk_size, tcp_min_read_chunk_size, tcp_max_read_chunk_size);
grpc_tcp* tcp = new grpc_tcp(tcp_tx_zerocopy_max_simult_sends,
tcp_tx_zerocopy_send_bytes_thresh);
tcp->base.vtable = &vtable;
- tcp->peer_string = peer_string;
+ tcp->peer_string = TString(peer_string);
tcp->fd = grpc_fd_wrapped_fd(em_fd);
+ tcp->memory_owner = grpc_core::ResourceQuotaFromChannelArgs(channel_args)
+ ->memory_quota()
+ ->CreateMemoryOwner(peer_string);
+ tcp->self_reservation = tcp->memory_owner.MakeReservation(sizeof(grpc_tcp));
grpc_resolved_address resolved_local_addr;
memset(&resolved_local_addr, 0, sizeof(resolved_local_addr));
resolved_local_addr.len = sizeof(resolved_local_addr.addr);
@@ -1803,10 +1769,6 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
tcp->em_fd = em_fd;
grpc_slice_buffer_init(&tcp->last_read_buffer);
- tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_user_slice_allocator_init(
- &tcp->slice_allocator, tcp->resource_user, tcp_read_allocation_done, tcp);
- grpc_resource_quota_unref_internal(resource_quota);
gpr_mu_init(&tcp->tb_mu);
tcp->tb_head = nullptr;
GRPC_CLOSURE_INIT(&tcp->read_done_closure, tcp_handle_read, tcp,
@@ -1871,4 +1833,11 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
TCP_UNREF(tcp, "destroy");
}
+void grpc_tcp_posix_init() { g_backup_poller_mu = new grpc_core::Mutex; }
+
+void grpc_tcp_posix_shutdown() {
+ delete g_backup_poller_mu;
+ g_backup_poller_mu = nullptr;
+}
+
#endif /* GRPC_POSIX_SOCKET_TCP */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.h
index eff825cb925..9932688b9ab 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_posix.h
@@ -31,30 +31,35 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/buffer_list.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/ev_posix.h"
+#include "src/core/lib/iomgr/port.h"
extern grpc_core::TraceFlag grpc_tcp_trace;
-/* Create a tcp endpoint given a file desciptor and a read slice size.
- Takes ownership of fd. */
+/// Create a tcp endpoint given a file desciptor and a read slice size.
+/// Takes ownership of \a fd. Takes ownership of the \a slice_allocator.
grpc_endpoint* grpc_tcp_create(grpc_fd* fd, const grpc_channel_args* args,
- const char* peer_string);
+ y_absl::string_view peer_string);
-/* Return the tcp endpoint's fd, or -1 if this is not available. Does not
- release the fd.
- Requires: ep must be a tcp endpoint.
- */
+/// Return the tcp endpoint's fd, or -1 if this is not available. Does not
+/// release the fd. Requires: \a ep must be a tcp endpoint.
int grpc_tcp_fd(grpc_endpoint* ep);
-/* Destroy the tcp endpoint without closing its fd. *fd will be set and done
- * will be called when the endpoint is destroyed.
- * Requires: ep must be a tcp endpoint and fd must not be NULL. */
+/// Destroy the tcp endpoint without closing its fd. *fd will be set and done
+/// will be called when the endpoint is destroyed. Requires: \a ep must be a tcp
+/// endpoint and fd must not be NULL.
void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
grpc_closure* done);
+#ifdef GRPC_POSIX_SOCKET_TCP
+
+void grpc_tcp_posix_init();
+
+void grpc_tcp_posix_shutdown();
+
+#endif /* GRPC_POSIX_SOCKET_TCP */
+
#endif /* GRPC_CORE_LIB_IOMGR_TCP_POSIX_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
index 046fd4979bd..8d6fefbbb20 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.cc
@@ -22,9 +22,9 @@
grpc_tcp_server_vtable* grpc_tcp_server_impl;
-grpc_error* grpc_tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
+grpc_error_handle grpc_tcp_server_create(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server) {
return grpc_tcp_server_impl->create(shutdown_complete, args, server);
}
@@ -34,9 +34,9 @@ void grpc_tcp_server_start(grpc_tcp_server* server,
grpc_tcp_server_impl->start(server, pollsets, on_accept_cb, cb_arg);
}
-grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* out_port) {
+grpc_error_handle grpc_tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port) {
return grpc_tcp_server_impl->add_port(s, addr, out_port);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
index 6ba3513da5b..9c88428021f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server.h
@@ -21,11 +21,11 @@
#include <grpc/support/port_platform.h>
+#include <vector>
+
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
-#include <vector>
-
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
@@ -63,14 +63,15 @@ class TcpServerFdHandler {
} // namespace grpc_core
typedef struct grpc_tcp_server_vtable {
- grpc_error* (*create)(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server);
+ grpc_error_handle (*create)(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server);
void (*start)(grpc_tcp_server* server,
const std::vector<grpc_pollset*>* pollsets,
grpc_tcp_server_cb on_accept_cb, void* cb_arg);
- grpc_error* (*add_port)(grpc_tcp_server* s, const grpc_resolved_address* addr,
- int* out_port);
+ grpc_error_handle (*add_port)(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port);
grpc_core::TcpServerFdHandler* (*create_fd_handler)(grpc_tcp_server* s);
unsigned (*port_fd_count)(grpc_tcp_server* s, unsigned port_index);
int (*port_fd)(grpc_tcp_server* s, unsigned port_index, unsigned fd_index);
@@ -83,10 +84,11 @@ typedef struct grpc_tcp_server_vtable {
/* Create a server, initially not bound to any ports. The caller owns one ref.
If shutdown_complete is not NULL, it will be used by
- grpc_tcp_server_unref() when the ref count reaches zero. */
-grpc_error* grpc_tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server);
+ grpc_tcp_server_unref() when the ref count reaches zero.
+ Takes ownership of the slice_allocator_factory. */
+grpc_error_handle grpc_tcp_server_create(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server);
/* Start listening to bound ports */
void grpc_tcp_server_start(grpc_tcp_server* server,
@@ -102,9 +104,9 @@ void grpc_tcp_server_start(grpc_tcp_server* server,
but not dualstack sockets. */
/* TODO(ctiller): deprecate this, and make grpc_tcp_server_add_ports to handle
all of the multiple socket port matching logic in one place */
-grpc_error* grpc_tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* out_port);
+grpc_error_handle grpc_tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port);
/* Create and return a TcpServerFdHandler so that it can be used by upper layer
to hand over an externally connected fd to the grpc server. */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
index 3effdf8926d..9568d8590e3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_custom.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <assert.h>
#include <string.h>
@@ -28,12 +26,14 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/tcp_custom.h"
#include "src/core/lib/iomgr/tcp_server.h"
@@ -76,35 +76,14 @@ struct grpc_tcp_server {
bool shutdown;
bool so_reuseport;
-
- grpc_resource_quota* resource_quota;
};
-static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
- grpc_tcp_server* s =
- static_cast<grpc_tcp_server*>(gpr_malloc(sizeof(grpc_tcp_server)));
- // Let the implementation decide if so_reuseport can be enabled or not.
- s->so_reuseport = true;
- s->resource_quota = grpc_resource_quota_create(nullptr);
- for (size_t i = 0; i < (args == nullptr ? 0 : args->num_args); i++) {
- if (!grpc_channel_args_find_bool(args, GRPC_ARG_ALLOW_REUSEPORT, true)) {
- s->so_reuseport = false;
- }
- if (0 == strcmp(GRPC_ARG_RESOURCE_QUOTA, args->args[i].key)) {
- if (args->args[i].type == GRPC_ARG_POINTER) {
- grpc_resource_quota_unref_internal(s->resource_quota);
- s->resource_quota = grpc_resource_quota_ref_internal(
- static_cast<grpc_resource_quota*>(args->args[i].value.pointer.p));
- } else {
- grpc_resource_quota_unref_internal(s->resource_quota);
- gpr_free(s);
- return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- GRPC_ARG_RESOURCE_QUOTA " must be a pointer to a buffer pool");
- }
- }
- }
+static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server) {
+ grpc_tcp_server* s = new grpc_tcp_server();
+ s->so_reuseport =
+ grpc_channel_args_find_bool(args, GRPC_ARG_ALLOW_REUSEPORT, true);
gpr_ref_init(&s->refs, 1);
s->on_accept_cb = nullptr;
s->on_accept_cb_arg = nullptr;
@@ -144,7 +123,6 @@ static void finish_shutdown(grpc_tcp_server* s) {
sp->next = nullptr;
gpr_free(sp);
}
- grpc_resource_quota_unref_internal(s->resource_quota);
gpr_free(s);
}
@@ -218,7 +196,7 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
grpc_endpoint* ep = nullptr;
grpc_resolved_address peer_name;
TString peer_name_string;
- grpc_error* err;
+ grpc_error_handle err;
memset(&peer_name, 0, sizeof(grpc_resolved_address));
peer_name.len = GRPC_MAX_SOCKADDR_SIZE;
@@ -235,8 +213,7 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
gpr_log(GPR_INFO, "SERVER_CONNECT: %p accepted connection: %s", sp->server,
peer_name_string.c_str());
}
- ep = custom_tcp_endpoint_create(socket, sp->server->resource_quota,
- peer_name_string.c_str());
+ ep = custom_tcp_endpoint_create(socket, peer_name_string.c_str());
acceptor->from_server = sp->server;
acceptor->port_index = sp->port_index;
acceptor->fd_index = 0;
@@ -246,17 +223,18 @@ static void finish_accept(grpc_tcp_listener* sp, grpc_custom_socket* socket) {
static void custom_accept_callback(grpc_custom_socket* socket,
grpc_custom_socket* client,
- grpc_error* error);
+ grpc_error_handle error);
static void custom_accept_callback(grpc_custom_socket* socket,
grpc_custom_socket* client,
- grpc_error* error) {
+ grpc_error_handle error) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_tcp_listener* sp = socket->listener;
if (error != GRPC_ERROR_NONE) {
if (!sp->closed) {
- gpr_log(GPR_ERROR, "Accept failed: %s", grpc_error_string(error));
+ gpr_log(GPR_ERROR, "Accept failed: %s",
+ grpc_error_std_string(error).c_str());
}
gpr_free(client);
GRPC_ERROR_UNREF(error);
@@ -275,14 +253,14 @@ static void custom_accept_callback(grpc_custom_socket* socket,
}
}
-static grpc_error* add_socket_to_server(grpc_tcp_server* s,
- grpc_custom_socket* socket,
- const grpc_resolved_address* addr,
- unsigned port_index,
- grpc_tcp_listener** listener) {
+static grpc_error_handle add_socket_to_server(grpc_tcp_server* s,
+ grpc_custom_socket* socket,
+ const grpc_resolved_address* addr,
+ unsigned port_index,
+ grpc_tcp_listener** listener) {
grpc_tcp_listener* sp = nullptr;
int port = -1;
- grpc_error* error;
+ grpc_error_handle error;
grpc_resolved_address sockname_temp;
// NOTE(lidiz) The last argument is "flags" which is unused by other
@@ -316,7 +294,7 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s,
GPR_ASSERT(port >= 0);
GPR_ASSERT(!s->on_accept_cb && "must add ports before starting server");
- sp = static_cast<grpc_tcp_listener*>(gpr_zalloc(sizeof(grpc_tcp_listener)));
+ sp = grpc_core::Zalloc<grpc_tcp_listener>();
sp->next = nullptr;
if (s->head == nullptr) {
s->head = sp;
@@ -335,9 +313,9 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s,
return GRPC_ERROR_NONE;
}
-static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* port) {
+static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* port) {
// This function is mostly copied from tcp_server_windows.c
grpc_tcp_listener* sp = nullptr;
grpc_custom_socket* socket;
@@ -346,7 +324,7 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
grpc_resolved_address* allocated_addr = nullptr;
grpc_resolved_address sockname_temp;
unsigned port_index = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
int family;
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
@@ -361,10 +339,9 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
for (sp = s->head; sp; sp = sp->next) {
socket = sp->socket;
sockname_temp.len = GRPC_MAX_SOCKADDR_SIZE;
- if (nullptr == grpc_custom_socket_vtable->getsockname(
- socket,
- reinterpret_cast<grpc_sockaddr*>(&sockname_temp.addr),
- reinterpret_cast<int*>(&sockname_temp.len))) {
+ if (grpc_custom_socket_vtable->getsockname(
+ socket, reinterpret_cast<grpc_sockaddr*>(&sockname_temp.addr),
+ reinterpret_cast<int*>(&sockname_temp.len)) == GRPC_ERROR_NONE) {
*port = grpc_sockaddr_get_port(&sockname_temp);
if (*port > 0) {
allocated_addr = static_cast<grpc_resolved_address*>(
@@ -392,7 +369,7 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "SERVER %p add_port %s error=%s", s,
grpc_sockaddr_to_string(addr, false).c_str(),
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
family = grpc_sockaddr_get_family(addr);
@@ -410,8 +387,9 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
gpr_free(allocated_addr);
if (error != GRPC_ERROR_NONE) {
- grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to add port to server", &error, 1);
+ grpc_error_handle error_out =
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to add port to server", &error, 1);
GRPC_ERROR_UNREF(error);
error = error_out;
*port = -1;
@@ -477,7 +455,3 @@ grpc_tcp_server_vtable custom_tcp_server_vtable = {
tcp_server_port_fd_count, tcp_server_port_fd,
tcp_server_ref, tcp_server_shutdown_starting_add,
tcp_server_unref, tcp_server_shutdown_listeners};
-
-#ifdef GRPC_UV_TEST
-grpc_tcp_server_vtable* default_tcp_server_vtable = &custom_tcp_server_vtable;
-#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
index 5a3c3cf5a37..81b048c04f0 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_posix.cc
@@ -48,24 +48,24 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
+#include "src/core/lib/resource_quota/api.h"
-static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
- grpc_tcp_server* s =
- static_cast<grpc_tcp_server*>(gpr_zalloc(sizeof(grpc_tcp_server)));
+static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server) {
+ grpc_tcp_server* s = new grpc_tcp_server;
s->so_reuseport = grpc_is_socket_reuse_port_supported();
s->expand_wildcard_addrs = false;
for (size_t i = 0; i < (args == nullptr ? 0 : args->num_args); i++) {
@@ -103,6 +103,8 @@ static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
s->nports = 0;
s->channel_args = grpc_channel_args_copy(args);
s->fd_handler = nullptr;
+ s->memory_quota =
+ grpc_core::ResourceQuotaFromChannelArgs(args)->memory_quota();
gpr_atm_no_barrier_store(&s->next_pollset_to_assign, 0);
*server = s;
return GRPC_ERROR_NONE;
@@ -116,9 +118,7 @@ static void finish_shutdown(grpc_tcp_server* s) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
GRPC_ERROR_NONE);
}
-
gpr_mu_destroy(&s->mu);
-
while (s->head) {
grpc_tcp_listener* sp = s->head;
s->head = sp->next;
@@ -126,11 +126,10 @@ static void finish_shutdown(grpc_tcp_server* s) {
}
grpc_channel_args_destroy(s->channel_args);
delete s->fd_handler;
-
- gpr_free(s);
+ delete s;
}
-static void destroyed_port(void* server, grpc_error* /*error*/) {
+static void destroyed_port(void* server, grpc_error_handle /*error*/) {
grpc_tcp_server* s = static_cast<grpc_tcp_server*>(server);
gpr_mu_lock(&s->mu);
s->destroyed_ports++;
@@ -170,10 +169,8 @@ static void deactivated_all_ports(grpc_tcp_server* s) {
static void tcp_server_destroy(grpc_tcp_server* s) {
gpr_mu_lock(&s->mu);
-
GPR_ASSERT(!s->shutdown);
s->shutdown = true;
-
/* shutdown all fd's */
if (s->active_ports) {
grpc_tcp_listener* sp;
@@ -189,7 +186,7 @@ static void tcp_server_destroy(grpc_tcp_server* s) {
}
/* event manager callback when reads are ready */
-static void on_read(void* arg, grpc_error* err) {
+static void on_read(void* arg, grpc_error_handle err) {
grpc_tcp_listener* sp = static_cast<grpc_tcp_listener*>(arg);
grpc_pollset* read_notifier_pollset;
if (err != GRPC_ERROR_NONE) {
@@ -227,6 +224,12 @@ static void on_read(void* arg, grpc_error* err) {
}
}
+ if (sp->server->memory_quota->IsMemoryPressureHigh()) {
+ gpr_log(GPR_INFO, "Drop incoming connection: high memory pressure");
+ close(fd);
+ continue;
+ }
+
/* For UNIX sockets, the accept call might not fill up the member sun_path
* of sockaddr_un, so explicitly call getsockname to get it. */
if (grpc_is_unix_socket(&addr)) {
@@ -240,7 +243,13 @@ static void on_read(void* arg, grpc_error* err) {
}
}
- grpc_set_socket_no_sigpipe_if_possible(fd);
+ (void)grpc_set_socket_no_sigpipe_if_possible(fd);
+
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_SERVER_CONNECTION_USAGE,
+ sp->server->channel_args);
+ if (err != GRPC_ERROR_NONE) {
+ goto error;
+ }
TString addr_str = grpc_sockaddr_to_uri(&addr);
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
@@ -265,10 +274,9 @@ static void on_read(void* arg, grpc_error* err) {
acceptor->port_index = sp->port_index;
acceptor->fd_index = sp->fd_index;
acceptor->external_connection = false;
-
sp->server->on_accept_cb(
sp->server->on_accept_cb_arg,
- grpc_tcp_create(fdobj, sp->server->channel_args, addr_str.c_str()),
+ grpc_tcp_create(fdobj, sp->server->channel_args, addr_str),
read_notifier_pollset, acceptor);
}
@@ -285,18 +293,18 @@ error:
}
/* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */
-static grpc_error* add_wildcard_addrs_to_server(grpc_tcp_server* s,
- unsigned port_index,
- int requested_port,
- int* out_port) {
+static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s,
+ unsigned port_index,
+ int requested_port,
+ int* out_port) {
grpc_resolved_address wild4;
grpc_resolved_address wild6;
unsigned fd_index = 0;
grpc_dualstack_mode dsmode;
grpc_tcp_listener* sp = nullptr;
grpc_tcp_listener* sp2 = nullptr;
- grpc_error* v6_err = GRPC_ERROR_NONE;
- grpc_error* v4_err = GRPC_ERROR_NONE;
+ grpc_error_handle v6_err = GRPC_ERROR_NONE;
+ grpc_error_handle v4_err = GRPC_ERROR_NONE;
*out_port = -1;
if (grpc_tcp_server_have_ifaddrs() && s->expand_wildcard_addrs) {
@@ -329,19 +337,19 @@ static grpc_error* add_wildcard_addrs_to_server(grpc_tcp_server* s,
gpr_log(GPR_INFO,
"Failed to add :: listener, "
"the environment may not support IPv6: %s",
- grpc_error_string(v6_err));
+ grpc_error_std_string(v6_err).c_str());
GRPC_ERROR_UNREF(v6_err);
}
if (v4_err != GRPC_ERROR_NONE) {
gpr_log(GPR_INFO,
"Failed to add 0.0.0.0 listener, "
"the environment may not support IPv4: %s",
- grpc_error_string(v4_err));
+ grpc_error_std_string(v4_err).c_str());
GRPC_ERROR_UNREF(v4_err);
}
return GRPC_ERROR_NONE;
} else {
- grpc_error* root_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Failed to add any wildcard listeners");
GPR_ASSERT(v6_err != GRPC_ERROR_NONE && v4_err != GRPC_ERROR_NONE);
root_err = grpc_error_add_child(root_err, v6_err);
@@ -350,10 +358,11 @@ static grpc_error* add_wildcard_addrs_to_server(grpc_tcp_server* s,
}
}
-static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
+static grpc_error_handle clone_port(grpc_tcp_listener* listener,
+ unsigned count) {
grpc_tcp_listener* sp = nullptr;
TString addr_str;
- grpc_error* err;
+ grpc_error_handle err;
for (grpc_tcp_listener* l = listener->next; l && l->is_sibling; l = l->next) {
l->fd_index += count;
@@ -399,16 +408,17 @@ static grpc_error* clone_port(grpc_tcp_listener* listener, unsigned count) {
return GRPC_ERROR_NONE;
}
-static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* out_port) {
+static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* out_port) {
+ GPR_ASSERT(addr->len <= GRPC_MAX_SOCKADDR_SIZE);
grpc_tcp_listener* sp;
grpc_resolved_address sockname_temp;
grpc_resolved_address addr6_v4mapped;
int requested_port = grpc_sockaddr_get_port(addr);
unsigned port_index = 0;
grpc_dualstack_mode dsmode;
- grpc_error* err;
+ grpc_error_handle err;
*out_port = -1;
if (s->tail != nullptr) {
port_index = s->tail->port_index + 1;
@@ -588,7 +598,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
close(fd);
return;
}
- grpc_set_socket_no_sigpipe_if_possible(fd);
+ (void)grpc_set_socket_no_sigpipe_if_possible(fd);
TString addr_str = grpc_sockaddr_to_uri(&addr);
if (grpc_tcp_trace.enabled()) {
gpr_log(GPR_INFO, "SERVER_CONNECT: incoming external connection: %s",
@@ -610,7 +620,7 @@ class ExternalConnectionHandler : public grpc_core::TcpServerFdHandler {
acceptor->listener_fd = listener_fd;
acceptor->pending_data = buf;
s_->on_accept_cb(s_->on_accept_cb_arg,
- grpc_tcp_create(fdobj, s_->channel_args, addr_str.c_str()),
+ grpc_tcp_create(fdobj, s_->channel_args, addr_str),
read_notifier_pollset, acceptor);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
index 6b8a5f9f207..79527c24613 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix.h
@@ -25,6 +25,7 @@
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/socket_utils_posix.h"
#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
/* one listening port */
typedef struct grpc_tcp_listener {
@@ -52,72 +53,76 @@ typedef struct grpc_tcp_listener {
struct grpc_tcp_server {
gpr_refcount refs;
/* Called whenever accept() succeeds on a server port. */
- grpc_tcp_server_cb on_accept_cb;
- void* on_accept_cb_arg;
+ grpc_tcp_server_cb on_accept_cb = nullptr;
+ void* on_accept_cb_arg = nullptr;
gpr_mu mu;
/* active port count: how many ports are actually still listening */
- size_t active_ports;
+ size_t active_ports = 0;
/* destroyed port count: how many ports are completely destroyed */
- size_t destroyed_ports;
+ size_t destroyed_ports = 0;
/* is this server shutting down? */
- bool shutdown;
+ bool shutdown = false;
/* have listeners been shutdown? */
- bool shutdown_listeners;
+ bool shutdown_listeners = false;
/* use SO_REUSEPORT */
- bool so_reuseport;
+ bool so_reuseport = false;
/* expand wildcard addresses to a list of all local addresses */
- bool expand_wildcard_addrs;
+ bool expand_wildcard_addrs = false;
/* linked list of server ports */
- grpc_tcp_listener* head;
- grpc_tcp_listener* tail;
- unsigned nports;
+ grpc_tcp_listener* head = nullptr;
+ grpc_tcp_listener* tail = nullptr;
+ unsigned nports = 0;
/* List of closures passed to shutdown_starting_add(). */
- grpc_closure_list shutdown_starting;
+ grpc_closure_list shutdown_starting{nullptr, nullptr};
/* shutdown callback */
- grpc_closure* shutdown_complete;
+ grpc_closure* shutdown_complete = nullptr;
/* all pollsets interested in new connections. The object pointed at is not
* owned by this struct */
- const std::vector<grpc_pollset*>* pollsets;
+ const std::vector<grpc_pollset*>* pollsets = nullptr;
/* next pollset to assign a channel to */
- gpr_atm next_pollset_to_assign;
+ gpr_atm next_pollset_to_assign = 0;
/* channel args for this server */
- grpc_channel_args* channel_args;
+ grpc_channel_args* channel_args = nullptr;
/* a handler for external connections, owned */
- grpc_core::TcpServerFdHandler* fd_handler;
+ grpc_core::TcpServerFdHandler* fd_handler = nullptr;
+
+ /* used to create slice allocators for endpoints, owned */
+ grpc_core::MemoryQuotaRefPtr memory_quota;
};
/* If successful, add a listener to \a s for \a addr, set \a dsmode for the
socket, and return the \a listener. */
-grpc_error* grpc_tcp_server_add_addr(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- unsigned port_index, unsigned fd_index,
- grpc_dualstack_mode* dsmode,
- grpc_tcp_listener** listener);
+grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ unsigned port_index,
+ unsigned fd_index,
+ grpc_dualstack_mode* dsmode,
+ grpc_tcp_listener** listener);
/* Get all addresses assigned to network interfaces on the machine and create a
listener for each. requested_port is the port to use for every listener, or 0
to select one random port that will be used for every listener. Set *out_port
to the port selected. Return GRPC_ERROR_NONE only if all listeners were
added. */
-grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
- unsigned port_index,
- int requested_port,
- int* out_port);
+grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
+ unsigned port_index,
+ int requested_port,
+ int* out_port);
/* Prepare a recently-created socket for listening. */
-grpc_error* grpc_tcp_server_prepare_socket(grpc_tcp_server*, int fd,
- const grpc_resolved_address* addr,
- bool so_reuseport, int* port);
+grpc_error_handle grpc_tcp_server_prepare_socket(
+ grpc_tcp_server*, int fd, const grpc_resolved_address* addr,
+ bool so_reuseport, int* port);
/* Ruturn true if the platform supports ifaddrs */
bool grpc_tcp_server_have_ifaddrs(void);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
index 46bc18e5a09..a85f4ce39d6 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_POSIX_SOCKET_TCP_SERVER_UTILS_COMMON
-#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-
#include <errno.h>
#include <limits.h>
#include <stdio.h>
@@ -37,9 +35,10 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#define MIN_SAFE_ACCEPT_QUEUE_SIZE 100
@@ -80,14 +79,15 @@ static int get_max_accept_queue_size(void) {
return s_max_accept_queue_size;
}
-static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
- const grpc_resolved_address* addr,
- unsigned port_index, unsigned fd_index,
- grpc_tcp_listener** listener) {
+static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, int fd,
+ const grpc_resolved_address* addr,
+ unsigned port_index,
+ unsigned fd_index,
+ grpc_tcp_listener** listener) {
grpc_tcp_listener* sp = nullptr;
int port = -1;
- grpc_error* err =
+ grpc_error_handle err =
grpc_tcp_server_prepare_socket(s, fd, addr, s->so_reuseport, &port);
if (err == GRPC_ERROR_NONE) {
GPR_ASSERT(port > 0);
@@ -123,14 +123,15 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, int fd,
/* If successful, add a listener to s for addr, set *dsmode for the socket, and
return the *listener. */
-grpc_error* grpc_tcp_server_add_addr(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- unsigned port_index, unsigned fd_index,
- grpc_dualstack_mode* dsmode,
- grpc_tcp_listener** listener) {
+grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ unsigned port_index,
+ unsigned fd_index,
+ grpc_dualstack_mode* dsmode,
+ grpc_tcp_listener** listener) {
grpc_resolved_address addr4_copy;
int fd;
- grpc_error* err =
+ grpc_error_handle err =
grpc_create_dualstack_socket(addr, SOCK_STREAM, 0, dsmode, &fd);
if (err != GRPC_ERROR_NONE) {
return err;
@@ -143,11 +144,11 @@ grpc_error* grpc_tcp_server_add_addr(grpc_tcp_server* s,
}
/* Prepare a recently-created socket for listening. */
-grpc_error* grpc_tcp_server_prepare_socket(grpc_tcp_server* s, int fd,
- const grpc_resolved_address* addr,
- bool so_reuseport, int* port) {
+grpc_error_handle grpc_tcp_server_prepare_socket(
+ grpc_tcp_server* s, int fd, const grpc_resolved_address* addr,
+ bool so_reuseport, int* port) {
grpc_resolved_address sockname_temp;
- grpc_error* err = GRPC_ERROR_NONE;
+ grpc_error_handle err = GRPC_ERROR_NONE;
GPR_ASSERT(fd >= 0);
@@ -180,7 +181,8 @@ grpc_error* grpc_tcp_server_prepare_socket(grpc_tcp_server* s, int fd,
err = grpc_set_socket_no_sigpipe_if_possible(fd);
if (err != GRPC_ERROR_NONE) goto error;
- err = grpc_apply_socket_mutator_in_args(fd, s->channel_args);
+ err = grpc_apply_socket_mutator_in_args(fd, GRPC_FD_SERVER_LISTENER_USAGE,
+ s->channel_args);
if (err != GRPC_ERROR_NONE) goto error;
if (bind(fd, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)),
@@ -210,7 +212,7 @@ error:
if (fd >= 0) {
close(fd);
}
- grpc_error* ret =
+ grpc_error_handle ret =
grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Unable to configure socket", &err, 1),
GRPC_ERROR_INT_FD, fd);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
index 1c7cd5cc10b..57f2c57c060 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_HAVE_IFADDRS
-#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-
#include <errno.h>
#include <ifaddrs.h>
#include <stddef.h>
@@ -36,9 +34,10 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
/* Return the listener in s with address addr or NULL. */
static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s,
@@ -58,12 +57,12 @@ static grpc_tcp_listener* find_listener_with_addr(grpc_tcp_server* s,
}
/* Bind to "::" to get a port number not used by any address. */
-static grpc_error* get_unused_port(int* port) {
+static grpc_error_handle get_unused_port(int* port) {
grpc_resolved_address wild;
grpc_sockaddr_make_wildcard6(0, &wild);
grpc_dualstack_mode dsmode;
int fd;
- grpc_error* err =
+ grpc_error_handle err =
grpc_create_dualstack_socket(&wild, SOCK_STREAM, 0, &dsmode, &fd);
if (err != GRPC_ERROR_NONE) {
return err;
@@ -89,15 +88,15 @@ static grpc_error* get_unused_port(int* port) {
: GRPC_ERROR_NONE;
}
-grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
- unsigned port_index,
- int requested_port,
- int* out_port) {
+grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
+ unsigned port_index,
+ int requested_port,
+ int* out_port) {
struct ifaddrs* ifa = nullptr;
struct ifaddrs* ifa_it;
unsigned fd_index = 0;
grpc_tcp_listener* sp = nullptr;
- grpc_error* err = GRPC_ERROR_NONE;
+ grpc_error_handle err = GRPC_ERROR_NONE;
if (requested_port == 0) {
/* Note: There could be a race where some local addrs can listen on the
selected port and some can't. The sane way to handle this would be to
@@ -146,8 +145,8 @@ grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
}
if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
&new_sp)) != GRPC_ERROR_NONE) {
- grpc_error* root_err = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Failed to add listener: ", addr_str).c_str());
+ grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Failed to add listener: ", addr_str));
err = grpc_error_add_child(root_err, err);
break;
} else {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
index 86ee14f2856..beaf489efa4 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc
@@ -24,10 +24,10 @@
#include "src/core/lib/iomgr/tcp_server_utils_posix.h"
-grpc_error* grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
- unsigned port_index,
- int requested_port,
- int* out_port) {
+grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* /*s*/,
+ unsigned /*port_index*/,
+ int /*requested_port*/,
+ int* /*out_port*/) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("no ifaddrs available");
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
index 13c17260dc2..018ac493e4c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_server_windows.cc
@@ -22,8 +22,6 @@
#ifdef GRPC_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <inttypes.h>
#include <io.h>
@@ -38,11 +36,12 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/pollset_windows.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_server.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -101,9 +100,9 @@ struct grpc_tcp_server {
/* Public function. Allocates the proper data structures to hold a
grpc_tcp_server. */
-static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
- const grpc_channel_args* args,
- grpc_tcp_server** server) {
+static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
+ const grpc_channel_args* args,
+ grpc_tcp_server** server) {
grpc_tcp_server* s = (grpc_tcp_server*)gpr_malloc(sizeof(grpc_tcp_server));
s->channel_args = grpc_channel_args_copy(args);
gpr_ref_init(&s->refs, 1);
@@ -120,7 +119,7 @@ static grpc_error* tcp_server_create(grpc_closure* shutdown_complete,
return GRPC_ERROR_NONE;
}
-static void destroy_server(void* arg, grpc_error* error) {
+static void destroy_server(void* arg, grpc_error_handle error) {
grpc_tcp_server* s = (grpc_tcp_server*)arg;
/* Now that the accepts have been aborted, we can destroy the sockets.
@@ -166,7 +165,6 @@ static void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
static void tcp_server_destroy(grpc_tcp_server* s) {
grpc_tcp_listener* sp;
gpr_mu_lock(&s->mu);
-
/* First, shutdown all fd's. This will queue abortion calls for all
of the pending accepts due to the normal operation mechanism. */
if (s->active_ports == 0) {
@@ -191,11 +189,11 @@ static void tcp_server_unref(grpc_tcp_server* s) {
}
/* Prepare (bind) a recently-created socket for listening. */
-static grpc_error* prepare_socket(SOCKET sock,
- const grpc_resolved_address* addr,
- int* port) {
+static grpc_error_handle prepare_socket(SOCKET sock,
+ const grpc_resolved_address* addr,
+ int* port) {
grpc_resolved_address sockname_temp;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
int sockname_temp_len;
error = grpc_tcp_prepare_socket(sock);
@@ -228,11 +226,10 @@ static grpc_error* prepare_socket(SOCKET sock,
failure:
GPR_ASSERT(error != GRPC_ERROR_NONE);
grpc_error_set_int(
- grpc_error_set_str(
- GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to prepare server socket", &error, 1),
- GRPC_ERROR_STR_TARGET_ADDRESS,
- grpc_slice_from_cpp_string(grpc_sockaddr_to_uri(addr))),
+ grpc_error_set_str(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to prepare server socket", &error, 1),
+ GRPC_ERROR_STR_TARGET_ADDRESS,
+ grpc_sockaddr_to_uri(addr)),
GRPC_ERROR_INT_FD, (intptr_t)sock);
GRPC_ERROR_UNREF(error);
if (sock != INVALID_SOCKET) closesocket(sock);
@@ -249,12 +246,12 @@ static void decrement_active_ports_and_notify_locked(grpc_tcp_listener* sp) {
/* In order to do an async accept, we need to create a socket first which
will be the one assigned to the new incoming connection. */
-static grpc_error* start_accept_locked(grpc_tcp_listener* port) {
+static grpc_error_handle start_accept_locked(grpc_tcp_listener* port) {
SOCKET sock = INVALID_SOCKET;
BOOL success;
DWORD addrlen = sizeof(grpc_sockaddr_in6) + 16;
DWORD bytes_received = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (port->shutting_down) {
return GRPC_ERROR_NONE;
@@ -299,7 +296,7 @@ failure:
}
/* Event manager callback when reads are ready. */
-static void on_accept(void* arg, grpc_error* error) {
+static void on_accept(void* arg, grpc_error_handle error) {
grpc_tcp_listener* sp = (grpc_tcp_listener*)arg;
SOCKET sock = sp->new_socket;
grpc_winsocket_callback_info* info = &sp->socket->read_info;
@@ -318,13 +315,12 @@ static void on_accept(void* arg, grpc_error* error) {
this is necessary in the read/write case, it's useless for the accept
case. We only need to adjust the pending callback count */
if (error != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(error);
- gpr_log(GPR_INFO, "Skipping on_accept due to error: %s", msg);
+ gpr_log(GPR_INFO, "Skipping on_accept due to error: %s",
+ grpc_error_std_string(error).c_str());
gpr_mu_unlock(&sp->server->mu);
return;
}
-
/* The IOCP notified us of a completed operation. Let's grab the results,
and act accordingly. */
transfered_bytes = 0;
@@ -359,7 +355,7 @@ static void on_accept(void* arg, grpc_error* error) {
}
TString fd_name = y_absl::StrCat("tcp_server:", peer_name_string);
ep = grpc_tcp_create(grpc_winsocket_create(sock, fd_name.c_str()),
- sp->server->channel_args, peer_name_string.c_str());
+ sp->server->channel_args, peer_name_string);
} else {
closesocket(sock);
}
@@ -388,17 +384,17 @@ static void on_accept(void* arg, grpc_error* error) {
gpr_mu_unlock(&sp->server->mu);
}
-static grpc_error* add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
- const grpc_resolved_address* addr,
- unsigned port_index,
- grpc_tcp_listener** listener) {
+static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
+ const grpc_resolved_address* addr,
+ unsigned port_index,
+ grpc_tcp_listener** listener) {
grpc_tcp_listener* sp = NULL;
int port = -1;
int status;
GUID guid = WSAID_ACCEPTEX;
DWORD ioctl_num_bytes;
LPFN_ACCEPTEX AcceptEx;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
/* We need to grab the AcceptEx pointer for that port, as it may be
interface-dependent. We'll cache it to avoid doing that again. */
@@ -446,9 +442,9 @@ static grpc_error* add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
return GRPC_ERROR_NONE;
}
-static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
- const grpc_resolved_address* addr,
- int* port) {
+static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
+ const grpc_resolved_address* addr,
+ int* port) {
grpc_tcp_listener* sp = NULL;
SOCKET sock;
grpc_resolved_address addr6_v4mapped;
@@ -456,7 +452,7 @@ static grpc_error* tcp_server_add_port(grpc_tcp_server* s,
grpc_resolved_address* allocated_addr = NULL;
grpc_resolved_address sockname_temp;
unsigned port_index = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (s->tail != NULL) {
port_index = s->tail->port_index + 1;
@@ -508,8 +504,9 @@ done:
gpr_free(allocated_addr);
if (error != GRPC_ERROR_NONE) {
- grpc_error* error_out = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
- "Failed to add port to server", &error, 1);
+ grpc_error_handle error_out =
+ GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
+ "Failed to add port to server", &error, 1);
GRPC_ERROR_UNREF(error);
error = error_out;
*port = -1;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
deleted file mode 100644
index 1515aaac494..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_uv.cc
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-#include <limits.h>
-#include <string.h>
-
-#include <grpc/slice_buffer.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/resolve_address_custom.h"
-#include "src/core/lib/iomgr/resource_quota.h"
-#include "src/core/lib/iomgr/tcp_custom.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_string_helpers.h"
-
-#error #include <uv.h>
-
-#define IGNORE_CONST(addr) ((grpc_sockaddr*)(uintptr_t)(addr))
-
-typedef struct uv_socket_t {
- uv_connect_t connect_req;
- uv_write_t write_req;
- uv_shutdown_t shutdown_req;
- uv_tcp_t* handle;
- uv_buf_t* write_buffers;
-
- char* read_buf;
- size_t read_len;
-
- int pending_connections;
- grpc_custom_socket* accept_socket;
- grpc_error* accept_error;
-
- grpc_custom_connect_callback connect_cb;
- grpc_custom_write_callback write_cb;
- grpc_custom_read_callback read_cb;
- grpc_custom_accept_callback accept_cb;
- grpc_custom_close_callback close_cb;
-
-} uv_socket_t;
-
-static grpc_error* tcp_error_create(const char* desc, int status) {
- if (status == 0) {
- return GRPC_ERROR_NONE;
- }
- grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc);
- /* All tcp errors are marked with UNAVAILABLE so that application may
- * choose to retry. */
- error = grpc_error_set_int(error, GRPC_ERROR_INT_GRPC_STATUS,
- GRPC_STATUS_UNAVAILABLE);
- return grpc_error_set_str(error, GRPC_ERROR_STR_OS_ERROR,
- grpc_slice_from_static_string(uv_strerror(status)));
-}
-
-static void uv_socket_destroy(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- gpr_free(uv_socket->handle);
- gpr_free(uv_socket);
-}
-
-static void alloc_uv_buf(uv_handle_t* handle, size_t suggested_size,
- uv_buf_t* buf) {
- uv_socket_t* uv_socket =
- (uv_socket_t*)((grpc_custom_socket*)handle->data)->impl;
- (void)suggested_size;
- buf->base = uv_socket->read_buf;
- buf->len = uv_socket->read_len;
-}
-
-static void uv_read_callback(uv_stream_t* stream, ssize_t nread,
- const uv_buf_t* buf) {
- grpc_error* error = GRPC_ERROR_NONE;
- if (nread == 0) {
- // Nothing happened. Wait for the next callback
- return;
- }
- // TODO(murgatroid99): figure out what the return value here means
- uv_read_stop(stream);
- if (nread == UV_EOF) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("EOF");
- } else if (nread < 0) {
- error = tcp_error_create("TCP Read failed", nread);
- }
- grpc_custom_socket* socket = (grpc_custom_socket*)stream->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->read_cb(socket, (size_t)nread, error);
-}
-
-static void uv_close_callback(uv_handle_t* handle) {
- grpc_custom_socket* socket = (grpc_custom_socket*)handle->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (uv_socket->accept_socket) {
- uv_socket->accept_cb(socket, uv_socket->accept_socket,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("socket closed"));
- }
- uv_socket->close_cb(socket);
-}
-
-static void uv_socket_read(grpc_custom_socket* socket, char* buffer,
- size_t length, grpc_custom_read_callback read_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status;
- grpc_error* error;
- uv_socket->read_cb = read_cb;
- uv_socket->read_buf = buffer;
- uv_socket->read_len = length;
- // TODO(murgatroid99): figure out what the return value here means
- status =
- uv_read_start((uv_stream_t*)uv_socket->handle, (uv_alloc_cb)alloc_uv_buf,
- (uv_read_cb)uv_read_callback);
- if (status != 0) {
- error = tcp_error_create("TCP Read failed at start", status);
- uv_socket->read_cb(socket, 0, error);
- }
-}
-
-static void uv_write_callback(uv_write_t* req, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)req->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- gpr_free(uv_socket->write_buffers);
- uv_socket->write_cb(socket, tcp_error_create("TCP Write failed", status));
-}
-
-void uv_socket_write(grpc_custom_socket* socket,
- grpc_slice_buffer* write_slices,
- grpc_custom_write_callback write_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->write_cb = write_cb;
- uv_buf_t* uv_buffers;
- uv_write_t* write_req;
-
- uv_buffers = (uv_buf_t*)gpr_malloc(sizeof(uv_buf_t) * write_slices->count);
- for (size_t i = 0; i < write_slices->count; i++) {
- uv_buffers[i].base = (char*)GRPC_SLICE_START_PTR(write_slices->slices[i]);
- uv_buffers[i].len = GRPC_SLICE_LENGTH(write_slices->slices[i]);
- }
-
- uv_socket->write_buffers = uv_buffers;
- write_req = &uv_socket->write_req;
- write_req->data = socket;
- // TODO(murgatroid99): figure out what the return value here means
- uv_write(write_req, (uv_stream_t*)uv_socket->handle, uv_buffers,
- write_slices->count, uv_write_callback);
-}
-
-static void shutdown_callback(uv_shutdown_t* req, int status) {}
-
-static void uv_socket_shutdown(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_shutdown_t* req = &uv_socket->shutdown_req;
- uv_shutdown(req, (uv_stream_t*)uv_socket->handle, shutdown_callback);
-}
-
-static void uv_socket_close(grpc_custom_socket* socket,
- grpc_custom_close_callback close_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->close_cb = close_cb;
- uv_close((uv_handle_t*)uv_socket->handle, uv_close_callback);
-}
-
-static grpc_error* uv_socket_init_helper(uv_socket_t* uv_socket, int domain) {
- uv_tcp_t* tcp = (uv_tcp_t*)gpr_malloc(sizeof(uv_tcp_t));
- uv_socket->handle = tcp;
- int status = uv_tcp_init_ex(uv_default_loop(), tcp, (unsigned int)domain);
- if (status != 0) {
- return tcp_error_create("Failed to initialize UV tcp handle", status);
- }
-#if defined(GPR_LINUX) && defined(SO_REUSEPORT)
- if (domain == AF_INET || domain == AF_INET6) {
- int enable = 1;
- int fd;
- uv_fileno((uv_handle_t*)tcp, &fd);
- // TODO Handle error here.
- setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(enable));
- }
-#endif
- uv_socket->write_buffers = nullptr;
- uv_socket->read_len = 0;
- uv_tcp_nodelay(uv_socket->handle, 1);
- // Node uses a garbage collector to call destructors, so we don't
- // want to hold the uv loop open with active gRPC objects.
- uv_unref((uv_handle_t*)uv_socket->handle);
- uv_socket->pending_connections = 0;
- uv_socket->accept_socket = nullptr;
- uv_socket->accept_error = GRPC_ERROR_NONE;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* uv_socket_init(grpc_custom_socket* socket, int domain) {
- uv_socket_t* uv_socket = (uv_socket_t*)gpr_malloc(sizeof(uv_socket_t));
- grpc_error* error = uv_socket_init_helper(uv_socket, domain);
- if (error != GRPC_ERROR_NONE) {
- return error;
- }
- uv_socket->handle->data = socket;
- socket->impl = uv_socket;
- return GRPC_ERROR_NONE;
-}
-
-static grpc_error* uv_socket_getpeername(grpc_custom_socket* socket,
- const grpc_sockaddr* addr,
- int* addr_len) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int err = uv_tcp_getpeername(uv_socket->handle,
- (struct sockaddr*)IGNORE_CONST(addr), addr_len);
- return tcp_error_create("getpeername failed", err);
-}
-
-static grpc_error* uv_socket_getsockname(grpc_custom_socket* socket,
- const grpc_sockaddr* addr,
- int* addr_len) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int err = uv_tcp_getsockname(uv_socket->handle,
- (struct sockaddr*)IGNORE_CONST(addr), addr_len);
- return tcp_error_create("getsockname failed", err);
-}
-
-static void accept_new_connection(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (uv_socket->pending_connections == 0 || !uv_socket->accept_socket) {
- return;
- }
- grpc_custom_socket* new_socket = uv_socket->accept_socket;
- grpc_error* error = uv_socket->accept_error;
- uv_socket->accept_socket = nullptr;
- uv_socket->accept_error = GRPC_ERROR_NONE;
- uv_socket->pending_connections -= 1;
- if (uv_socket->accept_error != GRPC_ERROR_NONE) {
- uv_stream_t phony_handle;
- uv_accept((uv_stream_t*)uv_socket->handle, &phony_handle);
- uv_socket->accept_cb(socket, new_socket, error);
- } else {
- uv_socket_t* uv_new_socket = (uv_socket_t*)gpr_malloc(sizeof(uv_socket_t));
- uv_socket_init_helper(uv_new_socket, AF_UNSPEC);
- // UV documentation says this is guaranteed to succeed
- GPR_ASSERT(uv_accept((uv_stream_t*)uv_socket->handle,
- (uv_stream_t*)uv_new_socket->handle) == 0);
- new_socket->impl = uv_new_socket;
- uv_new_socket->handle->data = new_socket;
- uv_socket->accept_cb(socket, new_socket, error);
- }
-}
-
-static void uv_on_connect(uv_stream_t* server, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)server->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- if (status < 0) {
- switch (status) {
- case UV_EINTR:
- case UV_EAGAIN:
- return;
- default:
- uv_socket->accept_error = tcp_error_create("accept failed", status);
- }
- }
- uv_socket->pending_connections += 1;
- accept_new_connection(socket);
-}
-
-void uv_socket_accept(grpc_custom_socket* socket,
- grpc_custom_socket* new_socket,
- grpc_custom_accept_callback accept_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->accept_cb = accept_cb;
- GPR_ASSERT(uv_socket->accept_socket == nullptr);
- uv_socket->accept_socket = new_socket;
- accept_new_connection(socket);
-}
-
-static grpc_error* uv_socket_bind(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, size_t len,
- int flags) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status =
- uv_tcp_bind((uv_tcp_t*)uv_socket->handle, (struct sockaddr*)addr, 0);
- return tcp_error_create("Failed to bind to port", status);
-}
-
-static grpc_error* uv_socket_listen(grpc_custom_socket* socket) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- int status =
- uv_listen((uv_stream_t*)uv_socket->handle, SOMAXCONN, uv_on_connect);
- return tcp_error_create("Failed to listen to port", status);
-}
-
-static void uv_tc_on_connect(uv_connect_t* req, int status) {
- grpc_custom_socket* socket = (grpc_custom_socket*)req->data;
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- grpc_error* error;
- if (status == UV_ECANCELED) {
- // This should only happen if the handle is already closed
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Timeout occurred");
- } else {
- error = tcp_error_create("Failed to connect to remote host", status);
- }
- uv_socket->connect_cb(socket, error);
-}
-
-static void uv_socket_connect(grpc_custom_socket* socket,
- const grpc_sockaddr* addr, size_t len,
- grpc_custom_connect_callback connect_cb) {
- uv_socket_t* uv_socket = (uv_socket_t*)socket->impl;
- uv_socket->connect_cb = connect_cb;
- uv_socket->connect_req.data = socket;
- int status = uv_tcp_connect(&uv_socket->connect_req, uv_socket->handle,
- (struct sockaddr*)addr, uv_tc_on_connect);
- if (status != 0) {
- // The callback will not be called
- uv_socket->connect_cb(socket, tcp_error_create("connect failed", status));
- }
-}
-
-static grpc_resolved_addresses* handle_addrinfo_result(
- struct addrinfo* result) {
- struct addrinfo* resp;
- size_t i;
- grpc_resolved_addresses* addresses =
- (grpc_resolved_addresses*)gpr_malloc(sizeof(grpc_resolved_addresses));
- addresses->naddrs = 0;
- for (resp = result; resp != nullptr; resp = resp->ai_next) {
- addresses->naddrs++;
- }
- addresses->addrs = (grpc_resolved_address*)gpr_malloc(
- sizeof(grpc_resolved_address) * addresses->naddrs);
- for (resp = result, i = 0; resp != nullptr; resp = resp->ai_next, i++) {
- memcpy(&addresses->addrs[i].addr, resp->ai_addr, resp->ai_addrlen);
- addresses->addrs[i].len = resp->ai_addrlen;
- }
- // addrinfo objects are allocated by libuv (e.g. in uv_getaddrinfo)
- // and not by gpr_malloc
- uv_freeaddrinfo(result);
- return addresses;
-}
-
-static void uv_resolve_callback(uv_getaddrinfo_t* req, int status,
- struct addrinfo* res) {
- grpc_custom_resolver* r = (grpc_custom_resolver*)req->data;
- gpr_free(req);
- grpc_resolved_addresses* result = nullptr;
- if (status == 0) {
- result = handle_addrinfo_result(res);
- }
- grpc_custom_resolve_callback(r, result,
- tcp_error_create("getaddrinfo failed", status));
-}
-
-static grpc_error* uv_resolve(const char* host, const char* port,
- grpc_resolved_addresses** result) {
- int status;
- uv_getaddrinfo_t req;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = AF_UNSPEC; /* ipv4 or ipv6 */
- hints.ai_socktype = SOCK_STREAM; /* stream socket */
- hints.ai_flags = AI_PASSIVE; /* for wildcard IP address */
- status = uv_getaddrinfo(uv_default_loop(), &req, NULL, host, port, &hints);
- if (status != 0) {
- *result = nullptr;
- } else {
- *result = handle_addrinfo_result(req.addrinfo);
- }
- return tcp_error_create("getaddrinfo failed", status);
-}
-
-static void uv_resolve_async(grpc_custom_resolver* r, const char* host,
- const char* port) {
- int status;
- uv_getaddrinfo_t* req =
- (uv_getaddrinfo_t*)gpr_malloc(sizeof(uv_getaddrinfo_t));
- req->data = r;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(struct addrinfo));
- hints.ai_family = GRPC_AF_UNSPEC; /* ipv4 or ipv6 */
- hints.ai_socktype = GRPC_SOCK_STREAM; /* stream socket */
- hints.ai_flags = GRPC_AI_PASSIVE; /* for wildcard IP address */
- status = uv_getaddrinfo(uv_default_loop(), req, uv_resolve_callback, host,
- port, &hints);
- if (status != 0) {
- gpr_free(req);
- grpc_error* error = tcp_error_create("getaddrinfo failed", status);
- grpc_custom_resolve_callback(r, NULL, error);
- }
-}
-
-grpc_custom_resolver_vtable uv_resolver_vtable = {uv_resolve, uv_resolve_async};
-
-grpc_socket_vtable grpc_uv_socket_vtable = {
- uv_socket_init, uv_socket_connect, uv_socket_destroy,
- uv_socket_shutdown, uv_socket_close, uv_socket_write,
- uv_socket_read, uv_socket_getpeername, uv_socket_getsockname,
- uv_socket_bind, uv_socket_listen, uv_socket_accept};
-
-#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
index 3d410a2d3fc..06fa7a97608 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.cc
@@ -24,18 +24,17 @@
#include <limits.h>
-#include "src/core/lib/iomgr/sockaddr_windows.h"
-
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/log_windows.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/iocp_windows.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include "src/core/lib/iomgr/socket_windows.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/tcp_windows.h"
@@ -53,7 +52,7 @@
extern grpc_core::TraceFlag grpc_tcp_trace;
-grpc_error* grpc_tcp_set_non_block(SOCKET sock) {
+grpc_error_handle grpc_tcp_set_non_block(SOCKET sock) {
int status;
uint32_t param = 1;
DWORD ret;
@@ -64,7 +63,7 @@ grpc_error* grpc_tcp_set_non_block(SOCKET sock) {
: GRPC_WSA_ERROR(WSAGetLastError(), "WSAIoctl(GRPC_FIONBIO)");
}
-static grpc_error* set_dualstack(SOCKET sock) {
+static grpc_error_handle set_dualstack(SOCKET sock) {
int status;
unsigned long param = 0;
status = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&param,
@@ -74,7 +73,7 @@ static grpc_error* set_dualstack(SOCKET sock) {
: GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)");
}
-static grpc_error* enable_socket_low_latency(SOCKET sock) {
+static grpc_error_handle enable_socket_low_latency(SOCKET sock) {
int status;
BOOL param = TRUE;
status = ::setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
@@ -86,8 +85,8 @@ static grpc_error* enable_socket_low_latency(SOCKET sock) {
: GRPC_WSA_ERROR(status, "setsockopt(TCP_NODELAY)");
}
-grpc_error* grpc_tcp_prepare_socket(SOCKET sock) {
- grpc_error* err;
+grpc_error_handle grpc_tcp_prepare_socket(SOCKET sock) {
+ grpc_error_handle err;
err = grpc_tcp_set_non_block(sock);
if (err != GRPC_ERROR_NONE) return err;
err = set_dualstack(sock);
@@ -117,13 +116,11 @@ typedef struct grpc_tcp {
grpc_slice_buffer* write_slices;
grpc_slice_buffer* read_slices;
- grpc_resource_user* resource_user;
-
/* The IO Completion Port runs from another thread. We need some mechanism
to protect ourselves when requesting a shutdown. */
gpr_mu mu;
int shutting_down;
- grpc_error* shutdown_error;
+ grpc_error_handle shutdown_error;
TString peer_string;
TString local_address;
@@ -133,7 +130,6 @@ static void tcp_free(grpc_tcp* tcp) {
grpc_winsocket_destroy(tcp->socket);
gpr_mu_destroy(&tcp->mu);
grpc_slice_buffer_destroy_internal(&tcp->last_read_buffer);
- grpc_resource_user_unref(tcp->resource_user);
if (tcp->shutting_down) GRPC_ERROR_UNREF(tcp->shutdown_error);
delete tcp;
}
@@ -177,7 +173,7 @@ static void tcp_ref(grpc_tcp* tcp) { gpr_ref(&tcp->refcount); }
#endif
/* Asynchronous callback from the IOCP, or the background thread. */
-static void on_read(void* tcpp, grpc_error* error) {
+static void on_read(void* tcpp, grpc_error_handle error) {
grpc_tcp* tcp = (grpc_tcp*)tcpp;
grpc_closure* cb = tcp->read_cb;
grpc_winsocket* socket = tcp->socket;
@@ -187,7 +183,7 @@ static void on_read(void* tcpp, grpc_error* error) {
gpr_log(GPR_INFO, "TCP:%p on_read", tcp);
}
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
if (error == GRPC_ERROR_NONE) {
if (info->wsa_error != 0 && !tcp->shutting_down) {
@@ -313,7 +309,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
}
/* Asynchronous callback from the IOCP, or the background thread. */
-static void on_write(void* tcpp, grpc_error* error) {
+static void on_write(void* tcpp, grpc_error_handle error) {
grpc_tcp* tcp = (grpc_tcp*)tcpp;
grpc_winsocket* handle = tcp->socket;
grpc_winsocket_callback_info* info = &handle->write_info;
@@ -323,7 +319,7 @@ static void on_write(void* tcpp, grpc_error* error) {
gpr_log(GPR_INFO, "TCP:%p on_write", tcp);
}
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
gpr_mu_lock(&tcp->mu);
cb = tcp->write_cb;
@@ -399,9 +395,9 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
connection that has its send queue filled up. But if we don't, then we can
avoid doing an async write operation at all. */
if (info->wsa_error != WSAEWOULDBLOCK) {
- grpc_error* error = status == 0
- ? GRPC_ERROR_NONE
- : GRPC_WSA_ERROR(info->wsa_error, "WSASend");
+ grpc_error_handle error = status == 0
+ ? GRPC_ERROR_NONE
+ : GRPC_WSA_ERROR(info->wsa_error, "WSASend");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
if (allocated) gpr_free(allocated);
return;
@@ -454,7 +450,7 @@ static void win_delete_from_pollset_set(grpc_endpoint* ep,
we're not going to protect against these. However the IO Completion Port
callback will happen from another thread, so we need to protect against
concurrent access of the data structure in that regard. */
-static void win_shutdown(grpc_endpoint* ep, grpc_error* why) {
+static void win_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
grpc_tcp* tcp = (grpc_tcp*)ep;
gpr_mu_lock(&tcp->mu);
/* At that point, what may happen is that we're already inside the IOCP
@@ -467,7 +463,6 @@ static void win_shutdown(grpc_endpoint* ep, grpc_error* why) {
}
grpc_winsocket_shutdown(tcp->socket);
gpr_mu_unlock(&tcp->mu);
- grpc_resource_user_shutdown(tcp->resource_user);
}
static void win_destroy(grpc_endpoint* ep) {
@@ -486,11 +481,6 @@ static y_absl::string_view win_get_local_address(grpc_endpoint* ep) {
return tcp->local_address;
}
-static grpc_resource_user* win_get_resource_user(grpc_endpoint* ep) {
- grpc_tcp* tcp = (grpc_tcp*)ep;
- return tcp->resource_user;
-}
-
static int win_get_fd(grpc_endpoint* ep) { return -1; }
static bool win_can_track_err(grpc_endpoint* ep) { return false; }
@@ -502,7 +492,6 @@ static grpc_endpoint_vtable vtable = {win_read,
win_delete_from_pollset_set,
win_shutdown,
win_destroy,
- win_get_resource_user,
win_get_peer,
win_get_local_address,
win_get_fd,
@@ -510,17 +499,7 @@ static grpc_endpoint_vtable vtable = {win_read,
grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
grpc_channel_args* channel_args,
- const char* peer_string) {
- grpc_resource_quota* resource_quota = grpc_resource_quota_create(NULL);
- if (channel_args != NULL) {
- for (size_t i = 0; i < channel_args->num_args; i++) {
- if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_RESOURCE_QUOTA)) {
- grpc_resource_quota_unref_internal(resource_quota);
- resource_quota = grpc_resource_quota_ref_internal(
- (grpc_resource_quota*)channel_args->args[i].value.pointer.p);
- }
- }
- }
+ y_absl::string_view peer_string) {
grpc_tcp* tcp = new grpc_tcp;
memset(tcp, 0, sizeof(grpc_tcp));
tcp->base.vtable = &vtable;
@@ -538,11 +517,8 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
} else {
tcp->local_address = grpc_sockaddr_to_uri(&resolved_local_addr);
}
- tcp->peer_string = peer_string;
+ tcp->peer_string = TString(peer_string);
grpc_slice_buffer_init(&tcp->last_read_buffer);
- tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
- grpc_resource_quota_unref_internal(resource_quota);
-
return &tcp->base;
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.h b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.h
index 04ef8102b65..9c4de7c5359 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/tcp_windows.h
@@ -42,11 +42,11 @@
*/
grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
grpc_channel_args* channel_args,
- const char* peer_string);
+ y_absl::string_view peer_string);
-grpc_error* grpc_tcp_prepare_socket(SOCKET sock);
+grpc_error_handle grpc_tcp_prepare_socket(SOCKET sock);
-grpc_error* grpc_tcp_set_non_block(SOCKET sock);
+grpc_error_handle grpc_tcp_set_non_block(SOCKET sock);
#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer.cc
index e647cdefa04..6506d302abc 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/timer.h"
+
#include "src/core/lib/iomgr/timer_manager.h"
grpc_timer_vtable* grpc_timer_impl;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer.h b/contrib/libs/grpc/src/core/lib/iomgr/timer.h
index 11da1496523..492d2a5e76e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer.h
@@ -21,11 +21,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
+#include <grpc/event_engine/event_engine.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/iomgr/port.h"
typedef struct grpc_timer {
grpc_millis deadline;
@@ -40,7 +41,10 @@ typedef struct grpc_timer {
#endif
// Optional field used by custom timers
- void* custom_timer;
+ union {
+ void* custom_timer;
+ grpc_event_engine::experimental::EventEngine::TaskHandle ee_task_handle;
+ };
} grpc_timer;
typedef enum {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.cc
index 867359a28db..90629665fea 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.cc
@@ -18,19 +18,20 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
+#include "src/core/lib/iomgr/timer_custom.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/iomgr_custom.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_custom.h"
static grpc_custom_timer_vtable* custom_timer_impl;
-void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* /*error*/) {
+void grpc_custom_timer_callback(grpc_custom_timer* t,
+ grpc_error_handle /*error*/) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.h b/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.h
index bfea8bafa69..83c3e8ddab9 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_custom.h
@@ -38,6 +38,6 @@ typedef struct grpc_custom_timer_vtable {
void grpc_custom_timer_init(grpc_custom_timer_vtable* impl);
-void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* error);
+void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error_handle error);
#endif /* GRPC_CORE_LIB_IOMGR_TIMER_CUSTOM_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
index 3c29d5bbe2c..b1bba57f53f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.cc
@@ -18,16 +18,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include <inttypes.h>
#include <util/generic/string.h>
#include "y_absl/strings/str_cat.h"
-#include "src/core/lib/iomgr/timer.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
@@ -38,14 +34,16 @@
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/time_averaged_stats.h"
+#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/timer_heap.h"
#define INVALID_HEAP_INDEX 0xffffffffu
#define ADD_DEADLINE_SCALE 0.33
#define MIN_QUEUE_WINDOW_DURATION 0.01
-#define MAX_QUEUE_WINDOW_DURATION 1
+#define MAX_QUEUE_WINDOW_DURATION 1.0
grpc_core::TraceFlag grpc_timer_trace(false, "timer");
grpc_core::TraceFlag grpc_timer_check_trace(false, "timer_check");
@@ -107,7 +105,7 @@ static void destroy_timer_ht() {
}
static bool is_in_ht(grpc_timer* t) {
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
gpr_mu_lock(&g_hash_mu[i]);
grpc_timer* p = g_timer_ht[i];
@@ -121,7 +119,7 @@ static bool is_in_ht(grpc_timer* t) {
static void add_to_ht(grpc_timer* t) {
GPR_ASSERT(!t->hash_table_next);
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
gpr_mu_lock(&g_hash_mu[i]);
grpc_timer* p = g_timer_ht[i];
@@ -146,7 +144,7 @@ static void add_to_ht(grpc_timer* t) {
}
static void remove_from_ht(grpc_timer* t) {
- size_t i = GPR_HASH_POINTER(t, NUM_HASH_BUCKETS);
+ size_t i = grpc_core::HashPointer(t, NUM_HASH_BUCKETS);
bool removed = false;
gpr_mu_lock(&g_hash_mu[i]);
@@ -212,19 +210,11 @@ static void validate_non_pending_timer(grpc_timer* t) {
#endif
-#if GPR_ARCH_64
-/* NOTE: TODO(sreek) - Currently the thread local storage support in grpc is
- for intptr_t which means on 32-bit machines it is not wide enough to hold
- grpc_millis which is 64-bit. Adding thread local support for 64 bit values
- is a lot of work for very little gain. So we are currently restricting this
- optimization to only 64 bit machines */
-
/* Thread local variable that stores the deadline of the next timer the thread
* has last-seen. This is an optimization to prevent the thread from checking
* shared_mutables.min_timer (which requires acquiring shared_mutables.mu lock,
* an expensive operation) */
-GPR_TLS_DECL(g_last_seen_min_timer);
-#endif
+static GPR_THREAD_LOCAL(grpc_millis) g_last_seen_min_timer;
struct shared_mutables {
/* The deadline of the next timer due across all timer shards */
@@ -247,7 +237,7 @@ static grpc_millis saturating_add(grpc_millis a, grpc_millis b) {
static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
grpc_millis* next,
- grpc_error* error);
+ grpc_error_handle error);
static grpc_millis compute_min_deadline(timer_shard* shard) {
return grpc_timer_heap_is_empty(&shard->heap)
@@ -258,7 +248,7 @@ static grpc_millis compute_min_deadline(timer_shard* shard) {
static void timer_list_init() {
uint32_t i;
- g_num_shards = GPR_CLAMP(2 * gpr_cpu_num_cores(), 1, 32);
+ g_num_shards = grpc_core::Clamp(2 * gpr_cpu_num_cores(), 1u, 32u);
g_shards =
static_cast<timer_shard*>(gpr_zalloc(g_num_shards * sizeof(*g_shards)));
g_shard_queue = static_cast<timer_shard**>(
@@ -269,10 +259,7 @@ static void timer_list_init() {
gpr_mu_init(&g_shared_mutables.mu);
g_shared_mutables.min_timer = grpc_core::ExecCtx::Get()->Now();
-#if GPR_ARCH_64
- gpr_tls_init(&g_last_seen_min_timer);
- gpr_tls_set(&g_last_seen_min_timer, 0);
-#endif
+ g_last_seen_min_timer = 0;
for (i = 0; i < g_num_shards; i++) {
timer_shard* shard = &g_shards[i];
@@ -301,11 +288,6 @@ static void timer_list_shutdown() {
grpc_timer_heap_destroy(&shard->heap);
}
gpr_mu_destroy(&g_shared_mutables.mu);
-
-#if GPR_ARCH_64
- gpr_tls_destroy(&g_last_seen_min_timer);
-#endif
-
gpr_free(g_shards);
gpr_free(g_shard_queue);
g_shared_mutables.initialized = false;
@@ -355,7 +337,7 @@ void grpc_timer_init_unset(grpc_timer* timer) { timer->pending = false; }
static void timer_init(grpc_timer* timer, grpc_millis deadline,
grpc_closure* closure) {
int is_first_timer = 0;
- timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, g_num_shards)];
+ timer_shard* shard = &g_shards[grpc_core::HashPointer(timer, g_num_shards)];
timer->closure = closure;
timer->deadline = deadline;
@@ -452,10 +434,8 @@ static void timer_init(grpc_timer* timer, grpc_millis deadline,
}
static void timer_consume_kick(void) {
-#if GPR_ARCH_64
/* Force re-evaluation of last seen min */
- gpr_tls_set(&g_last_seen_min_timer, 0);
-#endif
+ g_last_seen_min_timer = 0;
}
static void timer_cancel(grpc_timer* timer) {
@@ -464,7 +444,7 @@ static void timer_cancel(grpc_timer* timer) {
return;
}
- timer_shard* shard = &g_shards[GPR_HASH_POINTER(timer, g_num_shards)];
+ timer_shard* shard = &g_shards[grpc_core::HashPointer(timer, g_num_shards)];
gpr_mu_lock(&shard->mu);
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_trace)) {
gpr_log(GPR_INFO, "TIMER %p: CANCEL pending=%s", timer,
@@ -499,13 +479,13 @@ static bool refill_heap(timer_shard* shard, grpc_millis now) {
grpc_time_averaged_stats_update_average(&shard->stats) *
ADD_DEADLINE_SCALE;
double deadline_delta =
- GPR_CLAMP(computed_deadline_delta, MIN_QUEUE_WINDOW_DURATION,
- MAX_QUEUE_WINDOW_DURATION);
+ grpc_core::Clamp(computed_deadline_delta, MIN_QUEUE_WINDOW_DURATION,
+ MAX_QUEUE_WINDOW_DURATION);
grpc_timer *timer, *next;
/* Compute the new cap and put all timers under it into the queue: */
shard->queue_deadline_cap =
- saturating_add(GPR_MAX(now, shard->queue_deadline_cap),
+ saturating_add(std::max(now, shard->queue_deadline_cap),
static_cast<grpc_millis>(deadline_delta * 1000.0));
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
@@ -561,7 +541,8 @@ static grpc_timer* pop_one(timer_shard* shard, grpc_millis now) {
/* REQUIRES: shard->mu unlocked */
static size_t pop_timers(timer_shard* shard, grpc_millis now,
- grpc_millis* new_min_deadline, grpc_error* error) {
+ grpc_millis* new_min_deadline,
+ grpc_error_handle error) {
size_t n = 0;
grpc_timer* timer;
gpr_mu_lock(&shard->mu);
@@ -580,9 +561,8 @@ static size_t pop_timers(timer_shard* shard, grpc_millis now,
return n;
}
-static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
- grpc_millis* next,
- grpc_error* error) {
+static grpc_timer_check_result run_some_expired_timers(
+ grpc_millis now, grpc_millis* next, grpc_error_handle error) {
grpc_timer_check_result result = GRPC_TIMERS_NOT_CHECKED;
#if GPR_ARCH_64
@@ -592,7 +572,6 @@ static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
// safe since we know that both are pointer types and 64-bit wide
grpc_millis min_timer = static_cast<grpc_millis>(
gpr_atm_no_barrier_load((gpr_atm*)(&g_shared_mutables.min_timer)));
- gpr_tls_set(&g_last_seen_min_timer, min_timer);
#else
// On 32-bit systems, gpr_atm_no_barrier_load does not work on 64-bit types
// (like grpc_millis). So all reads and writes to g_shared_mutables.min_timer
@@ -601,8 +580,10 @@ static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
grpc_millis min_timer = g_shared_mutables.min_timer;
gpr_mu_unlock(&g_shared_mutables.mu);
#endif
+ g_last_seen_min_timer = min_timer;
+
if (now < min_timer) {
- if (next != nullptr) *next = GPR_MIN(*next, min_timer);
+ if (next != nullptr) *next = std::min(*next, min_timer);
return GRPC_TIMERS_CHECKED_AND_EMPTY;
}
@@ -647,7 +628,7 @@ static grpc_timer_check_result run_some_expired_timers(grpc_millis now,
}
if (next) {
- *next = GPR_MIN(*next, g_shard_queue[0]->min_deadline);
+ *next = std::min(*next, g_shard_queue[0]->min_deadline);
}
#if GPR_ARCH_64
@@ -676,24 +657,13 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
// prelude
grpc_millis now = grpc_core::ExecCtx::Get()->Now();
-#if GPR_ARCH_64
/* fetch from a thread-local first: this avoids contention on a globally
mutable cacheline in the common case */
- grpc_millis min_timer = gpr_tls_get(&g_last_seen_min_timer);
-#else
- // On 32-bit systems, we currently do not have thread local support for 64-bit
- // types. In this case, directly read from g_shared_mutables.min_timer.
- // Also, note that on 32-bit systems, gpr_atm_no_barrier_store does not work
- // on 64-bit types (like grpc_millis). So all reads and writes to
- // g_shared_mutables.min_timer are done under g_shared_mutables.mu
- gpr_mu_lock(&g_shared_mutables.mu);
- grpc_millis min_timer = g_shared_mutables.min_timer;
- gpr_mu_unlock(&g_shared_mutables.mu);
-#endif
+ grpc_millis min_timer = g_last_seen_min_timer;
if (now < min_timer) {
if (next != nullptr) {
- *next = GPR_MIN(*next, min_timer);
+ *next = std::min(*next, min_timer);
}
if (GRPC_TRACE_FLAG_ENABLED(grpc_timer_check_trace)) {
gpr_log(GPR_INFO, "TIMER CHECK SKIP: now=%" PRId64 " min_timer=%" PRId64,
@@ -702,7 +672,7 @@ static grpc_timer_check_result timer_check(grpc_millis* next) {
return GRPC_TIMERS_CHECKED_AND_EMPTY;
}
- grpc_error* shutdown_error =
+ grpc_error_handle shutdown_error =
now != GRPC_MILLIS_INF_FUTURE
? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING("Shutting down timer system");
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h
index 97a45133553..2ac002b6f37 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_generic.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/time.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
struct grpc_timer {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc
index 2c6a599149b..604bfe1b31c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_heap.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/port.h"
-
#include "src/core/lib/iomgr/timer_heap.h"
#include <string.h>
@@ -27,6 +25,7 @@
#include <grpc/support/alloc.h>
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/port.h"
/* Adjusts a heap so as to move a hole at position i closer to the root,
until a suitable position is found for element t. Then, copies t into that
@@ -98,7 +97,7 @@ void grpc_timer_heap_destroy(grpc_timer_heap* heap) { gpr_free(heap->timers); }
bool grpc_timer_heap_add(grpc_timer_heap* heap, grpc_timer* timer) {
if (heap->timer_count == heap->timer_capacity) {
heap->timer_capacity =
- GPR_MAX(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
+ std::max(heap->timer_capacity + 1, heap->timer_capacity * 3 / 2);
heap->timers = static_cast<grpc_timer**>(
gpr_realloc(heap->timers, heap->timer_capacity * sizeof(grpc_timer*)));
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc
index bf467cb5c44..ddfb1e08f91 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/timer_manager.cc
@@ -250,7 +250,7 @@ static void timer_main_loop() {
gpr_log(GPR_INFO, "timers not checked: expect another thread to");
}
next = GRPC_MILLIS_INF_FUTURE;
- // fallthrough
+ Y_ABSL_FALLTHROUGH_INTENDED;
case GRPC_TIMERS_CHECKED_AND_EMPTY:
if (!wait_until(next)) {
return;
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/timer_uv.cc b/contrib/libs/grpc/src/core/lib/iomgr/timer_uv.cc
deleted file mode 100644
index 8b10edffa01..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/timer_uv.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_UV
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
-#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/iomgr/iomgr_custom.h"
-#include "src/core/lib/iomgr/timer.h"
-#include "src/core/lib/iomgr/timer_custom.h"
-
-#error #include <uv.h>
-
-static void timer_close_callback(uv_handle_t* handle) { gpr_free(handle); }
-
-static void stop_uv_timer(uv_timer_t* handle) {
- uv_timer_stop(handle);
- uv_unref((uv_handle_t*)handle);
- uv_close((uv_handle_t*)handle, timer_close_callback);
-}
-
-void run_expired_timer(uv_timer_t* handle) {
- grpc_custom_timer* timer_wrapper = (grpc_custom_timer*)handle->data;
- grpc_custom_timer_callback(timer_wrapper, GRPC_ERROR_NONE);
-}
-
-static void timer_start(grpc_custom_timer* t) {
- uv_timer_t* uv_timer;
- uv_timer = (uv_timer_t*)gpr_malloc(sizeof(uv_timer_t));
- uv_timer_init(uv_default_loop(), uv_timer);
- uv_timer->data = t;
- t->timer = (void*)uv_timer;
- uv_timer_start(uv_timer, run_expired_timer, t->timeout_ms, 0);
- // Node uses a garbage collector to call destructors, so we don't
- // want to hold the uv loop open with active gRPC objects.
- uv_unref((uv_handle_t*)uv_timer);
-}
-
-static void timer_stop(grpc_custom_timer* t) {
- stop_uv_timer((uv_timer_t*)t->timer);
-}
-
-grpc_custom_timer_vtable uv_timer_vtable = {timer_start, timer_stop};
-
-#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
deleted file mode 100644
index 68aa62150d3..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.cc
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* FIXME: "posix" files shouldn't be depending on _GNU_SOURCE */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#ifndef SO_RXQ_OVFL
-#define SO_RXQ_OVFL 40
-#endif
-
-#include <grpc/support/port_platform.h>
-
-#include "src/core/lib/iomgr/port.h"
-
-#ifdef GRPC_POSIX_SOCKET_UDP_SERVER
-
-#include "src/core/lib/iomgr/udp_server.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_cat.h"
-
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/memory.h"
-#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/executor.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-#include "src/core/lib/iomgr/socket_factory_posix.h"
-#include "src/core/lib/iomgr/socket_utils_posix.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
-/* A listener which implements basic features of Listening on a port for
- * I/O events*/
-class GrpcUdpListener {
- public:
- GrpcUdpListener(grpc_udp_server* server, int fd,
- const grpc_resolved_address* addr);
- ~GrpcUdpListener();
-
- /* Called when grpc server starts to listening on the grpc_fd. */
- void StartListening(const std::vector<grpc_pollset*>* pollsets,
- GrpcUdpHandlerFactory* handler_factory);
-
- /* Called when data is available to read from the socket.
- * Return true if there is more data to read from fd. */
- void OnRead(grpc_error* error, void* do_read_arg);
-
- /* Called when the socket is writeable. The given closure should be scheduled
- * when the socket becomes blocked next time. */
- void OnCanWrite(grpc_error* error, void* do_write_arg);
-
- /* Called when the grpc_fd is about to be orphaned (and the FD closed). */
- void OnFdAboutToOrphan();
-
- /* Called to orphan fd of this listener.*/
- void OrphanFd();
-
- /* Called when this listener is going to be destroyed. */
- void OnDestroy();
-
- int fd() const { return fd_; }
-
- protected:
- grpc_fd* emfd() const { return emfd_; }
-
- gpr_mu* mutex() { return &mutex_; }
-
- private:
- /* event manager callback when reads are ready */
- static void on_read(void* arg, grpc_error* error);
- static void on_write(void* arg, grpc_error* error);
-
- static void do_read(void* arg, grpc_error* error);
- static void do_write(void* arg, grpc_error* error);
- // Wrapper of grpc_fd_notify_on_write() with a grpc_closure callback
- // interface.
- static void fd_notify_on_write_wrapper(void* arg, grpc_error* error);
-
- static void shutdown_fd(void* args, grpc_error* error);
-
- int fd_;
- grpc_fd* emfd_;
- grpc_udp_server* server_;
- grpc_resolved_address addr_;
- grpc_closure read_closure_;
- grpc_closure write_closure_;
- // To be called when corresponding QuicGrpcServer closes all active
- // connections.
- grpc_closure orphan_fd_closure_;
- grpc_closure destroyed_closure_;
- // To be scheduled on another thread to actually read/write.
- grpc_closure do_read_closure_;
- grpc_closure do_write_closure_;
- grpc_closure notify_on_write_closure_;
- // True if orphan_cb is trigered.
- bool orphan_notified_;
- // True if grpc_fd_notify_on_write() is called after on_write() call.
- bool notify_on_write_armed_;
- // True if fd has been shutdown.
- bool already_shutdown_;
- // Object actually handles I/O events. Assigned in StartListening().
- GrpcUdpHandler* udp_handler_ = nullptr;
- // To be notified on destruction.
- GrpcUdpHandlerFactory* handler_factory_ = nullptr;
- // Required to access above fields.
- gpr_mu mutex_;
-};
-
-GrpcUdpListener::GrpcUdpListener(grpc_udp_server* server, int fd,
- const grpc_resolved_address* addr)
- : fd_(fd),
- server_(server),
- orphan_notified_(false),
- already_shutdown_(false) {
- TString addr_str = grpc_sockaddr_to_string(addr, true);
- TString name = y_absl::StrCat("udp-server-listener:", addr_str);
- emfd_ = grpc_fd_create(fd, name.c_str(), true);
- memcpy(&addr_, addr, sizeof(grpc_resolved_address));
- GPR_ASSERT(emfd_);
- gpr_mu_init(&mutex_);
-}
-
-GrpcUdpListener::~GrpcUdpListener() { gpr_mu_destroy(&mutex_); }
-
-/* the overall server */
-struct grpc_udp_server {
- gpr_mu mu;
-
- /* factory to use for creating and binding sockets, or NULL */
- grpc_socket_factory* socket_factory;
-
- /* active port count: how many ports are actually still listening */
- size_t active_ports;
- /* destroyed port count: how many ports are completely destroyed */
- size_t destroyed_ports;
-
- /* is this server shutting down? (boolean) */
- int shutdown;
-
- /* An array of listeners */
- y_absl::InlinedVector<GrpcUdpListener, 16> listeners;
-
- /* factory for use to create udp listeners */
- GrpcUdpHandlerFactory* handler_factory;
-
- /* shutdown callback */
- grpc_closure* shutdown_complete;
-
- /* all pollsets interested in new connections. The object pointed at is not
- * owned by this struct. */
- const std::vector<grpc_pollset*>* pollsets;
- /* opaque object to pass to callbacks */
- void* user_data;
-
- /* latch has_so_reuseport during server creation */
- bool so_reuseport;
-};
-
-static grpc_socket_factory* get_socket_factory(const grpc_channel_args* args) {
- if (args) {
- const grpc_arg* arg = grpc_channel_args_find(args, GRPC_ARG_SOCKET_FACTORY);
- if (arg) {
- GPR_ASSERT(arg->type == GRPC_ARG_POINTER);
- return static_cast<grpc_socket_factory*>(arg->value.pointer.p);
- }
- }
- return nullptr;
-}
-
-grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args) {
- grpc_udp_server* s = new grpc_udp_server();
- gpr_mu_init(&s->mu);
- s->socket_factory = get_socket_factory(args);
- if (s->socket_factory) {
- grpc_socket_factory_ref(s->socket_factory);
- }
- s->active_ports = 0;
- s->destroyed_ports = 0;
- s->shutdown = 0;
- s->so_reuseport = grpc_is_socket_reuse_port_supported();
- return s;
-}
-
-// static
-void GrpcUdpListener::shutdown_fd(void* args, grpc_error* error) {
- if (args == nullptr) {
- // No-op if shutdown args are null.
- return;
- }
- auto sp = static_cast<GrpcUdpListener*>(args);
- gpr_mu_lock(sp->mutex());
- gpr_log(GPR_DEBUG, "shutdown fd %d", sp->fd_);
- grpc_fd_shutdown(sp->emfd_, GRPC_ERROR_REF(error));
- sp->already_shutdown_ = true;
- if (!sp->notify_on_write_armed_) {
- // Re-arm write notification to notify listener with error. This is
- // necessary to decrement active_ports.
- sp->notify_on_write_armed_ = true;
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-static void finish_shutdown(grpc_udp_server* s) {
- if (s->shutdown_complete != nullptr) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
- GRPC_ERROR_NONE);
- }
-
- gpr_mu_destroy(&s->mu);
-
- gpr_log(GPR_DEBUG, "Destroy all listeners.");
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- s->listeners[i].OnDestroy();
- }
-
- if (s->socket_factory) {
- grpc_socket_factory_unref(s->socket_factory);
- }
-
- delete s;
-}
-
-static void destroyed_port(void* server, grpc_error* /*error*/) {
- grpc_udp_server* s = static_cast<grpc_udp_server*>(server);
- gpr_mu_lock(&s->mu);
- s->destroyed_ports++;
- if (s->destroyed_ports == s->listeners.size()) {
- gpr_mu_unlock(&s->mu);
- finish_shutdown(s);
- } else {
- gpr_mu_unlock(&s->mu);
- }
-}
-
-/* called when all listening endpoints have been shutdown, so no further
- events will be received on them - at this point it's safe to destroy
- things */
-static void deactivated_all_ports(grpc_udp_server* s) {
- /* delete ALL the things */
- gpr_mu_lock(&s->mu);
-
- GPR_ASSERT(s->shutdown);
-
- if (s->listeners.empty()) {
- gpr_mu_unlock(&s->mu);
- finish_shutdown(s);
- return;
- }
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- s->listeners[i].OrphanFd();
- }
- gpr_mu_unlock(&s->mu);
-}
-
-void GrpcUdpListener::OrphanFd() {
- gpr_log(GPR_DEBUG, "Orphan fd %d, emfd %p", fd_, emfd_);
- grpc_unlink_if_unix_domain_socket(&addr_);
-
- GRPC_CLOSURE_INIT(&destroyed_closure_, destroyed_port, server_,
- grpc_schedule_on_exec_ctx);
- /* Because at this point, all listening sockets have been shutdown already, no
- * need to call OnFdAboutToOrphan() to notify the handler again. */
- grpc_fd_orphan(emfd_, &destroyed_closure_, nullptr, "udp_listener_shutdown");
-}
-
-void grpc_udp_server_destroy(grpc_udp_server* s, grpc_closure* on_done) {
- gpr_mu_lock(&s->mu);
-
- GPR_ASSERT(!s->shutdown);
- s->shutdown = 1;
-
- s->shutdown_complete = on_done;
-
- gpr_log(GPR_DEBUG, "start to destroy udp_server");
- /* shutdown all fd's */
- if (s->active_ports) {
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- GrpcUdpListener* sp = &s->listeners[i];
- sp->OnFdAboutToOrphan();
- }
- gpr_mu_unlock(&s->mu);
- } else {
- gpr_mu_unlock(&s->mu);
- deactivated_all_ports(s);
- }
-}
-
-void GrpcUdpListener::OnFdAboutToOrphan() {
- gpr_mu_lock(&mutex_);
- grpc_unlink_if_unix_domain_socket(&addr_);
-
- GRPC_CLOSURE_INIT(&destroyed_closure_, destroyed_port, server_,
- grpc_schedule_on_exec_ctx);
- if (!orphan_notified_ && udp_handler_ != nullptr) {
- /* Signals udp_handler that the FD is about to be closed and
- * should no longer be used. */
- GRPC_CLOSURE_INIT(&orphan_fd_closure_, shutdown_fd, this,
- grpc_schedule_on_exec_ctx);
- gpr_log(GPR_DEBUG, "fd %d about to be orphaned", fd_);
- udp_handler_->OnFdAboutToOrphan(&orphan_fd_closure_, server_->user_data);
- orphan_notified_ = true;
- }
- gpr_mu_unlock(&mutex_);
-}
-
-static int bind_socket(grpc_socket_factory* socket_factory, int sockfd,
- const grpc_resolved_address* addr) {
- return (socket_factory != nullptr)
- ? grpc_socket_factory_bind(socket_factory, sockfd, addr)
- : bind(sockfd,
- reinterpret_cast<grpc_sockaddr*>(
- const_cast<char*>(addr->addr)),
- addr->len);
-}
-
-/* Prepare a recently-created socket for listening. */
-static int prepare_socket(grpc_socket_factory* socket_factory, int fd,
- const grpc_resolved_address* addr, int rcv_buf_size,
- int snd_buf_size, bool so_reuseport) {
- grpc_resolved_address sockname_temp;
- grpc_sockaddr* addr_ptr =
- reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr));
-
- if (fd < 0) {
- goto error;
- }
-
- if (grpc_set_socket_nonblocking(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set nonblocking %d: %s", fd, strerror(errno));
- goto error;
- }
- if (grpc_set_socket_cloexec(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set cloexec %d: %s", fd, strerror(errno));
- goto error;
- }
-
- if (grpc_set_socket_ip_pktinfo_if_possible(fd) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set ip_pktinfo.");
- goto error;
- } else if (addr_ptr->sa_family == AF_INET6) {
- if (grpc_set_socket_ipv6_recvpktinfo_if_possible(fd) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Unable to set ipv6_recvpktinfo.");
- goto error;
- }
- }
-
- if (grpc_set_socket_sndbuf(fd, snd_buf_size) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set send buffer size to %d bytes",
- snd_buf_size);
- goto error;
- }
-
- if (grpc_set_socket_rcvbuf(fd, rcv_buf_size) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set receive buffer size to %d bytes",
- rcv_buf_size);
- goto error;
- }
-
- {
- int get_overflow = 1;
- if (0 != setsockopt(fd, SOL_SOCKET, SO_RXQ_OVFL, &get_overflow,
- sizeof(get_overflow))) {
- gpr_log(GPR_INFO, "Failed to set socket overflow support");
- }
- }
-
- if (so_reuseport && !grpc_is_unix_socket(addr) &&
- grpc_set_socket_reuse_port(fd, 1) != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Failed to set SO_REUSEPORT for fd %d", fd);
- goto error;
- }
-
- if (bind_socket(socket_factory, fd, addr) < 0) {
- TString addr_str = grpc_sockaddr_to_string(addr, false);
- gpr_log(GPR_ERROR, "bind addr=%s: %s", addr_str.c_str(), strerror(errno));
- goto error;
- }
-
- sockname_temp.len = static_cast<socklen_t>(sizeof(struct sockaddr_storage));
-
- if (getsockname(fd, reinterpret_cast<grpc_sockaddr*>(sockname_temp.addr),
- &sockname_temp.len) < 0) {
- gpr_log(GPR_ERROR, "Unable to get the address socket %d is bound to: %s",
- fd, strerror(errno));
- goto error;
- }
-
- return grpc_sockaddr_get_port(&sockname_temp);
-
-error:
- if (fd >= 0) {
- close(fd);
- }
- return -1;
-}
-
-// static
-void GrpcUdpListener::do_read(void* arg, grpc_error* error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- /* TODO: the reason we hold server->mu here is merely to prevent fd
- * shutdown while we are reading. However, it blocks do_write(). Switch to
- * read lock if available. */
- gpr_mu_lock(sp->mutex());
- /* Tell the registered callback that data is available to read. */
- if (!sp->already_shutdown_ && sp->udp_handler_->Read()) {
- /* There maybe more packets to read. Schedule read_more_cb_ closure to run
- * after finishing this event loop. */
- grpc_core::Executor::Run(&sp->do_read_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
- } else {
- /* Finish reading all the packets, re-arm the notification event so we can
- * get another chance to read. Or fd already shutdown, re-arm to get a
- * notification with shutdown error. */
- grpc_fd_notify_on_read(sp->emfd_, &sp->read_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::on_read(void* arg, grpc_error* error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- sp->OnRead(error, arg);
-}
-
-void GrpcUdpListener::OnRead(grpc_error* error, void* do_read_arg) {
- if (error != GRPC_ERROR_NONE) {
- gpr_mu_lock(&server_->mu);
- if (0 == --server_->active_ports && server_->shutdown) {
- gpr_mu_unlock(&server_->mu);
- deactivated_all_ports(server_);
- } else {
- gpr_mu_unlock(&server_->mu);
- }
- return;
- }
-
- /* Read once. If there is more data to read, off load the work to another
- * thread to finish. */
- if (udp_handler_->Read()) {
- /* There maybe more packets to read. Schedule read_more_cb_ closure to run
- * after finishing this event loop. */
- GRPC_CLOSURE_INIT(&do_read_closure_, do_read, do_read_arg, nullptr);
- grpc_core::Executor::Run(&do_read_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
- } else {
- /* Finish reading all the packets, re-arm the notification event so we can
- * get another chance to read. Or fd already shutdown, re-arm to get a
- * notification with shutdown error. */
- grpc_fd_notify_on_read(emfd_, &read_closure_);
- }
-}
-
-// static
-// Wrapper of grpc_fd_notify_on_write() with a grpc_closure callback interface.
-void GrpcUdpListener::fd_notify_on_write_wrapper(void* arg,
- grpc_error* /*error*/) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- gpr_mu_lock(sp->mutex());
- if (!sp->notify_on_write_armed_) {
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- sp->notify_on_write_armed_ = true;
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::do_write(void* arg, grpc_error* error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- gpr_mu_lock(sp->mutex());
- if (sp->already_shutdown_) {
- // If fd has been shutdown, don't write any more and re-arm notification.
- grpc_fd_notify_on_write(sp->emfd_, &sp->write_closure_);
- } else {
- sp->notify_on_write_armed_ = false;
- /* Tell the registered callback that the socket is writeable. */
- GPR_ASSERT(error == GRPC_ERROR_NONE);
- GRPC_CLOSURE_INIT(&sp->notify_on_write_closure_, fd_notify_on_write_wrapper,
- arg, grpc_schedule_on_exec_ctx);
- sp->udp_handler_->OnCanWrite(sp->server_->user_data,
- &sp->notify_on_write_closure_);
- }
- gpr_mu_unlock(sp->mutex());
-}
-
-// static
-void GrpcUdpListener::on_write(void* arg, grpc_error* error) {
- GrpcUdpListener* sp = static_cast<GrpcUdpListener*>(arg);
- sp->OnCanWrite(error, arg);
-}
-
-void GrpcUdpListener::OnCanWrite(grpc_error* error, void* do_write_arg) {
- if (error != GRPC_ERROR_NONE) {
- gpr_mu_lock(&server_->mu);
- if (0 == --server_->active_ports && server_->shutdown) {
- gpr_mu_unlock(&server_->mu);
- deactivated_all_ports(server_);
- } else {
- gpr_mu_unlock(&server_->mu);
- }
- return;
- }
-
- /* Schedule actual write in another thread. */
- GRPC_CLOSURE_INIT(&do_write_closure_, do_write, do_write_arg, nullptr);
-
- grpc_core::Executor::Run(&do_write_closure_, GRPC_ERROR_NONE,
- grpc_core::ExecutorType::DEFAULT,
- grpc_core::ExecutorJobType::LONG);
-}
-
-static int add_socket_to_server(grpc_udp_server* s, int fd,
- const grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size) {
- gpr_log(GPR_DEBUG, "add socket %d to server", fd);
-
- int port = prepare_socket(s->socket_factory, fd, addr, rcv_buf_size,
- snd_buf_size, s->so_reuseport);
- if (port >= 0) {
- gpr_mu_lock(&s->mu);
- s->listeners.emplace_back(s, fd, addr);
- gpr_log(GPR_DEBUG,
- "add socket %d to server for port %d, %zu listener(s) in total", fd,
- port, s->listeners.size());
- gpr_mu_unlock(&s->mu);
- }
- return port;
-}
-
-int grpc_udp_server_add_port(grpc_udp_server* s, grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size,
- GrpcUdpHandlerFactory* handler_factory,
- size_t num_listeners) {
- if (num_listeners > 1 && !s->so_reuseport) {
- gpr_log(GPR_ERROR,
- "Try to have multiple listeners on same port, but SO_REUSEPORT is "
- "not supported. Only create 1 listener.");
- }
- TString addr_str = grpc_sockaddr_to_string(addr, true);
- gpr_log(GPR_DEBUG, "add address: %s to server", addr_str.c_str());
-
- int allocated_port1 = -1;
- int allocated_port2 = -1;
- int fd;
- grpc_dualstack_mode dsmode;
- grpc_resolved_address addr6_v4mapped;
- grpc_resolved_address wild4;
- grpc_resolved_address wild6;
- grpc_resolved_address addr4_copy;
- grpc_resolved_address* allocated_addr = nullptr;
- grpc_resolved_address sockname_temp;
- int port = 0;
-
- /* Check if this is a wildcard port, and if so, try to keep the port the same
- as some previously created listener. */
- if (grpc_sockaddr_get_port(addr) == 0) {
- /* Loop through existing listeners to find the port in use. */
- for (size_t i = 0; i < s->listeners.size(); ++i) {
- sockname_temp.len =
- static_cast<socklen_t>(sizeof(struct sockaddr_storage));
- if (0 == getsockname(s->listeners[i].fd(),
- reinterpret_cast<grpc_sockaddr*>(sockname_temp.addr),
- &sockname_temp.len)) {
- port = grpc_sockaddr_get_port(&sockname_temp);
- if (port > 0) {
- /* Found such a port, update |addr| to reflects this port. */
- allocated_addr = static_cast<grpc_resolved_address*>(
- gpr_malloc(sizeof(grpc_resolved_address)));
- memcpy(allocated_addr, addr, sizeof(grpc_resolved_address));
- grpc_sockaddr_set_port(allocated_addr, port);
- addr = allocated_addr;
- break;
- }
- }
- }
- }
-
- if (grpc_sockaddr_to_v4mapped(addr, &addr6_v4mapped)) {
- addr = &addr6_v4mapped;
- }
-
- s->handler_factory = handler_factory;
- for (size_t i = 0; i < num_listeners; ++i) {
- /* Treat :: or 0.0.0.0 as a family-agnostic wildcard. */
- if (grpc_sockaddr_is_wildcard(addr, &port)) {
- grpc_sockaddr_make_wildcards(port, &wild4, &wild6);
-
- /* Try listening on IPv6 first. */
- addr = &wild6;
- // TODO(rjshade): Test and propagate the returned grpc_error*:
- GRPC_ERROR_UNREF(grpc_create_dualstack_socket_using_factory(
- s->socket_factory, addr, SOCK_DGRAM, IPPROTO_UDP, &dsmode, &fd));
- allocated_port1 =
- add_socket_to_server(s, fd, addr, rcv_buf_size, snd_buf_size);
- if (fd >= 0 && dsmode == GRPC_DSMODE_DUALSTACK) {
- if (port == 0) {
- /* This is the first time to bind to |addr|. If its port is still
- * wildcard port, update |addr| with the ephermeral port returned by
- * kernel. Thus |addr| can have a specific port in following
- * iterations. */
- grpc_sockaddr_set_port(addr, allocated_port1);
- port = allocated_port1;
- } else if (allocated_port1 >= 0) {
- /* The following successfully created socket should have same port as
- * the first one. */
- GPR_ASSERT(port == allocated_port1);
- }
- /* A dualstack socket is created, no need to create corresponding IPV4
- * socket. */
- continue;
- }
-
- /* If we didn't get a dualstack socket, also listen on 0.0.0.0. */
- if (port == 0 && allocated_port1 > 0) {
- /* |port| hasn't been assigned to an emphemeral port yet, |wild4| must
- * have a wildcard port. Update it with the emphemeral port created
- * during binding.*/
- grpc_sockaddr_set_port(&wild4, allocated_port1);
- port = allocated_port1;
- }
- /* |wild4| should have been updated with an emphemeral port by now. Use
- * this IPV4 address to create a IPV4 socket. */
- addr = &wild4;
- }
-
- // TODO(rjshade): Test and propagate the returned grpc_error*:
- GRPC_ERROR_UNREF(grpc_create_dualstack_socket_using_factory(
- s->socket_factory, addr, SOCK_DGRAM, IPPROTO_UDP, &dsmode, &fd));
- if (fd < 0) {
- gpr_log(GPR_ERROR, "Unable to create socket: %s", strerror(errno));
- }
- if (dsmode == GRPC_DSMODE_IPV4 &&
- grpc_sockaddr_is_v4mapped(addr, &addr4_copy)) {
- addr = &addr4_copy;
- }
- allocated_port2 =
- add_socket_to_server(s, fd, addr, rcv_buf_size, snd_buf_size);
- if (port == 0) {
- /* Update |addr| with the ephermeral port returned by kernel. So |addr|
- * can have a specific port in following iterations. */
- grpc_sockaddr_set_port(addr, allocated_port2);
- port = allocated_port2;
- } else if (allocated_port2 >= 0) {
- GPR_ASSERT(port == allocated_port2);
- }
- }
-
- gpr_free(allocated_addr);
- return port;
-}
-
-int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index) {
- if (port_index >= s->listeners.size()) {
- return -1;
- }
-
- return s->listeners[port_index].fd();
-}
-
-void grpc_udp_server_start(grpc_udp_server* udp_server,
- const std::vector<grpc_pollset*>* pollsets,
- void* user_data) {
- gpr_log(GPR_DEBUG, "grpc_udp_server_start");
- gpr_mu_lock(&udp_server->mu);
- GPR_ASSERT(udp_server->active_ports == 0);
- udp_server->pollsets = pollsets;
- udp_server->user_data = user_data;
-
- for (auto& listener : udp_server->listeners) {
- listener.StartListening(pollsets, udp_server->handler_factory);
- }
-
- gpr_mu_unlock(&udp_server->mu);
-}
-
-void GrpcUdpListener::StartListening(const std::vector<grpc_pollset*>* pollsets,
- GrpcUdpHandlerFactory* handler_factory) {
- gpr_mu_lock(&mutex_);
- handler_factory_ = handler_factory;
- udp_handler_ = handler_factory->CreateUdpHandler(emfd_, server_->user_data);
- for (grpc_pollset* pollset : *pollsets) {
- grpc_pollset_add_fd(pollset, emfd_);
- }
- GRPC_CLOSURE_INIT(&read_closure_, on_read, this, grpc_schedule_on_exec_ctx);
- grpc_fd_notify_on_read(emfd_, &read_closure_);
-
- GRPC_CLOSURE_INIT(&write_closure_, on_write, this, grpc_schedule_on_exec_ctx);
- notify_on_write_armed_ = true;
- grpc_fd_notify_on_write(emfd_, &write_closure_);
-
- /* Registered for both read and write callbacks: increment active_ports
- * twice to account for this, and delay free-ing of memory until both
- * on_read and on_write have fired. */
- server_->active_ports += 2;
- gpr_mu_unlock(&mutex_);
-}
-
-void GrpcUdpListener::OnDestroy() {
- if (udp_handler_ != nullptr) {
- handler_factory_->DestroyUdpHandler(udp_handler_);
- }
-}
-
-#endif
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h b/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h
deleted file mode 100644
index ba7acbbe59f..00000000000
--- a/contrib/libs/grpc/src/core/lib/iomgr/udp_server.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_CORE_LIB_IOMGR_UDP_SERVER_H
-#define GRPC_CORE_LIB_IOMGR_UDP_SERVER_H
-
-#include <grpc/support/port_platform.h>
-
-#include <vector>
-
-#include "src/core/lib/iomgr/endpoint.h"
-#include "src/core/lib/iomgr/ev_posix.h"
-#include "src/core/lib/iomgr/resolve_address.h"
-
-/* Forward decl of struct grpc_server */
-/* This is not typedef'ed to avoid a typedef-redefinition error */
-struct grpc_server;
-
-/* Forward decl of grpc_udp_server */
-typedef struct grpc_udp_server grpc_udp_server;
-
-/* An interface associated with a socket. udp server delivers I/O event on that
- * socket to the subclass of this interface which is created through
- * GrpcUdpHandlerFactory.
- * Its implementation should do the real IO work, e.g. read packet and write. */
-class GrpcUdpHandler {
- public:
- GrpcUdpHandler(grpc_fd* /* emfd */, void* /* user_data */) {}
- virtual ~GrpcUdpHandler() {}
-
- // Interfaces to be implemented by subclasses to do the actual setup/tear down
- // or I/O.
-
- // Called when data is available to read from the socket. Returns true if
- // there is more data to read after this call.
- virtual bool Read() = 0;
- // Called when socket becomes write unblocked. The given closure should be
- // scheduled when the socket becomes blocked next time.
- virtual void OnCanWrite(void* user_data,
- grpc_closure* notify_on_write_closure) = 0;
- // Called before the gRPC FD is orphaned. Notify udp server to continue
- // orphaning fd by scheduling the given closure, afterwards the associated fd
- // will be closed.
- virtual void OnFdAboutToOrphan(grpc_closure* orphan_fd_closure,
- void* user_data) = 0;
-};
-
-class GrpcUdpHandlerFactory {
- public:
- virtual ~GrpcUdpHandlerFactory() {}
- /* Called when start to listen on a socket.
- * Return an instance of the implementation of GrpcUdpHandler interface which
- * will process I/O events for this socket from now on. */
- virtual GrpcUdpHandler* CreateUdpHandler(grpc_fd* emfd, void* user_data) = 0;
- virtual void DestroyUdpHandler(GrpcUdpHandler* handler) = 0;
-};
-
-/* Create a server, initially not bound to any ports */
-grpc_udp_server* grpc_udp_server_create(const grpc_channel_args* args);
-
-/* Start listening to bound ports. user_data is passed to callbacks. */
-void grpc_udp_server_start(grpc_udp_server* udp_server,
- const std::vector<grpc_pollset*>* pollsets,
- void* user_data);
-
-int grpc_udp_server_get_fd(grpc_udp_server* s, unsigned port_index);
-
-/* Add a port to the server, returning port number on success, or negative
- on failure.
-
- Create |num_listeners| sockets for given address to listen on using
- SO_REUSEPORT if supported.
-
- The :: and 0.0.0.0 wildcard addresses are treated identically, accepting
- both IPv4 and IPv6 connections, but :: is the preferred style. This usually
- creates |num_listeners| sockets, but possibly 2 * |num_listeners| on systems
- which support IPv6, but not dualstack sockets. */
-
-/* TODO(ctiller): deprecate this, and make grpc_udp_server_add_ports to handle
- all of the multiple socket port matching logic in one place */
-int grpc_udp_server_add_port(grpc_udp_server* s, grpc_resolved_address* addr,
- int rcv_buf_size, int snd_buf_size,
- GrpcUdpHandlerFactory* handler_factory,
- size_t num_listeners);
-
-void grpc_udp_server_destroy(grpc_udp_server* server, grpc_closure* on_done);
-
-#endif /* GRPC_CORE_LIB_IOMGR_UDP_SERVER_H */
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
index 2488e980009..8a20a8d687c 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.cc
@@ -21,8 +21,6 @@
#ifdef GRPC_HAVE_UNIX_SOCKET
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -30,20 +28,20 @@
#include "y_absl/strings/str_cat.h"
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/unix_sockets_posix.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/unix_sockets_posix.h"
void grpc_create_socketpair_if_unix(int sv[2]) {
GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
}
-grpc_error* grpc_resolve_unix_domain_address(
- const char* name, grpc_resolved_addresses** addresses) {
+grpc_error_handle grpc_resolve_unix_domain_address(
+ y_absl::string_view name, grpc_resolved_addresses** addresses) {
*addresses = static_cast<grpc_resolved_addresses*>(
gpr_malloc(sizeof(grpc_resolved_addresses)));
(*addresses)->naddrs = 1;
@@ -52,7 +50,7 @@ grpc_error* grpc_resolve_unix_domain_address(
return grpc_core::UnixSockaddrPopulate(name, (*addresses)->addrs);
}
-grpc_error* grpc_resolve_unix_abstract_domain_address(
+grpc_error_handle grpc_resolve_unix_abstract_domain_address(
const y_absl::string_view name, grpc_resolved_addresses** addresses) {
*addresses = static_cast<grpc_resolved_addresses*>(
gpr_malloc(sizeof(grpc_resolved_addresses)));
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
index 72d4840b1d2..dff9e50afb3 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix.h
@@ -23,20 +23,19 @@
#include <util/generic/string.h>
-#include "src/core/lib/iomgr/port.h"
+#include "y_absl/strings/string_view.h"
#include <grpc/support/string_util.h>
+#include "src/core/lib/iomgr/port.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "y_absl/strings/string_view.h"
-
void grpc_create_socketpair_if_unix(int sv[2]);
-grpc_error* grpc_resolve_unix_domain_address(
- const char* name, grpc_resolved_addresses** addresses);
+grpc_error_handle grpc_resolve_unix_domain_address(
+ y_absl::string_view name, grpc_resolved_addresses** addresses);
-grpc_error* grpc_resolve_unix_abstract_domain_address(
+grpc_error_handle grpc_resolve_unix_abstract_domain_address(
y_absl::string_view name, grpc_resolved_addresses** addresses);
int grpc_is_unix_socket(const grpc_resolved_address* resolved_addr);
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
index 530bdc79d4a..a388976049f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.cc
@@ -26,33 +26,36 @@
#include <grpc/support/log.h>
-void grpc_create_socketpair_if_unix(int sv[2]) {
+void grpc_create_socketpair_if_unix(int /* sv */[2]) {
// TODO: Either implement this for the non-Unix socket case or make
// sure that it is never called in any such case. Until then, leave an
// assertion to notify if this gets called inadvertently
GPR_ASSERT(0);
}
-grpc_error* grpc_resolve_unix_domain_address(
- const char* name, grpc_resolved_addresses** addresses) {
+grpc_error_handle grpc_resolve_unix_domain_address(
+ y_absl::string_view /* name */, grpc_resolved_addresses** addresses) {
*addresses = NULL;
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Unix domain sockets are not supported on Windows");
}
-grpc_error* grpc_resolve_unix_abstract_domain_address(
+grpc_error_handle grpc_resolve_unix_abstract_domain_address(
y_absl::string_view, grpc_resolved_addresses** addresses) {
*addresses = NULL;
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Unix domain sockets are not supported on Windows");
}
-int grpc_is_unix_socket(const grpc_resolved_address* addr) { return false; }
+int grpc_is_unix_socket(const grpc_resolved_address* /* addr */) {
+ return false;
+}
-void grpc_unlink_if_unix_domain_socket(const grpc_resolved_address* addr) {}
+void grpc_unlink_if_unix_domain_socket(
+ const grpc_resolved_address* /* addr */) {}
TString grpc_sockaddr_to_uri_unix_if_possible(
- const grpc_resolved_address* addr) {
+ const grpc_resolved_address* /* addr */) {
return "";
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc
index d68c9ada1f2..3951fe6f570 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.cc
@@ -31,7 +31,7 @@
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
#include "src/core/lib/profiling/timers.h"
-static grpc_error* eventfd_create(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle eventfd_create(grpc_wakeup_fd* fd_info) {
fd_info->read_fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
fd_info->write_fd = -1;
if (fd_info->read_fd < 0) {
@@ -40,7 +40,7 @@ static grpc_error* eventfd_create(grpc_wakeup_fd* fd_info) {
return GRPC_ERROR_NONE;
}
-static grpc_error* eventfd_consume(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle eventfd_consume(grpc_wakeup_fd* fd_info) {
eventfd_t value;
int err;
do {
@@ -52,7 +52,7 @@ static grpc_error* eventfd_consume(grpc_wakeup_fd* fd_info) {
return GRPC_ERROR_NONE;
}
-static grpc_error* eventfd_wakeup(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle eventfd_wakeup(grpc_wakeup_fd* fd_info) {
GPR_TIMER_SCOPE("eventfd_wakeup", 0);
int err;
do {
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
index b1565751ce3..aff61eaa615 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.cc
@@ -28,6 +28,7 @@
#ifdef GRPC_POSIX_NO_SPECIAL_WAKEUP_FD
#include <stddef.h>
+
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
static int check_availability_invalid(void) { return 0; }
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
index 797cd44cd1a..e25a9448803 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_pipe.cc
@@ -22,9 +22,6 @@
#ifdef GRPC_POSIX_WAKEUP_FD
-#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
-#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-
#include <errno.h>
#include <string.h>
#include <unistd.h>
@@ -32,15 +29,17 @@
#include <grpc/support/log.h>
#include "src/core/lib/iomgr/socket_utils_posix.h"
+#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
+#include "src/core/lib/iomgr/wakeup_fd_posix.h"
-static grpc_error* pipe_init(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle pipe_init(grpc_wakeup_fd* fd_info) {
int pipefd[2];
int r = pipe(pipefd);
if (0 != r) {
gpr_log(GPR_ERROR, "pipe creation failed (%d): %s", errno, strerror(errno));
return GRPC_OS_ERROR(errno, "pipe");
}
- grpc_error* err;
+ grpc_error_handle err;
err = grpc_set_socket_nonblocking(pipefd[0], 1);
if (err != GRPC_ERROR_NONE) return err;
err = grpc_set_socket_nonblocking(pipefd[1], 1);
@@ -50,7 +49,7 @@ static grpc_error* pipe_init(grpc_wakeup_fd* fd_info) {
return GRPC_ERROR_NONE;
}
-static grpc_error* pipe_consume(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle pipe_consume(grpc_wakeup_fd* fd_info) {
char buf[128];
ssize_t r;
@@ -69,7 +68,7 @@ static grpc_error* pipe_consume(grpc_wakeup_fd* fd_info) {
}
}
-static grpc_error* pipe_wakeup(grpc_wakeup_fd* fd_info) {
+static grpc_error_handle pipe_wakeup(grpc_wakeup_fd* fd_info) {
char c = 0;
while (write(fd_info->write_fd, &c, 1) != 1 && errno == EINTR) {
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
index 3b66d6f34de..89bd51baa95 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.cc
@@ -23,6 +23,7 @@
#ifdef GRPC_POSIX_WAKEUP_FD
#include <stddef.h>
+
#include "src/core/lib/iomgr/wakeup_fd_pipe.h"
#include "src/core/lib/iomgr/wakeup_fd_posix.h"
@@ -50,15 +51,15 @@ void grpc_wakeup_fd_global_destroy(void) { wakeup_fd_vtable = nullptr; }
int grpc_has_wakeup_fd(void) { return has_real_wakeup_fd; }
-grpc_error* grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info) {
+grpc_error_handle grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info) {
return wakeup_fd_vtable->init(fd_info);
}
-grpc_error* grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info) {
+grpc_error_handle grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info) {
return wakeup_fd_vtable->consume(fd_info);
}
-grpc_error* grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) {
+grpc_error_handle grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) {
return wakeup_fd_vtable->wakeup(fd_info);
}
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.h b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.h
index 670c319593b..1079ce6899e 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/wakeup_fd_posix.h
@@ -65,9 +65,9 @@ void grpc_enable_cv_wakeup_fds(int enable);
typedef struct grpc_wakeup_fd grpc_wakeup_fd;
typedef struct grpc_wakeup_fd_vtable {
- grpc_error* (*init)(grpc_wakeup_fd* fd_info);
- grpc_error* (*consume)(grpc_wakeup_fd* fd_info);
- grpc_error* (*wakeup)(grpc_wakeup_fd* fd_info);
+ grpc_error_handle (*init)(grpc_wakeup_fd* fd_info);
+ grpc_error_handle (*consume)(grpc_wakeup_fd* fd_info);
+ grpc_error_handle (*wakeup)(grpc_wakeup_fd* fd_info);
void (*destroy)(grpc_wakeup_fd* fd_info);
/* Must be called before calling any other functions */
int (*check_availability)(void);
@@ -83,10 +83,12 @@ extern int grpc_allow_pipe_wakeup_fd;
#define GRPC_WAKEUP_FD_GET_READ_FD(fd_info) ((fd_info)->read_fd)
-grpc_error* grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info) GRPC_MUST_USE_RESULT;
-grpc_error* grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info)
+grpc_error_handle grpc_wakeup_fd_init(grpc_wakeup_fd* fd_info)
+ GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_wakeup_fd_consume_wakeup(grpc_wakeup_fd* fd_info)
+ GRPC_MUST_USE_RESULT;
+grpc_error_handle grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info)
GRPC_MUST_USE_RESULT;
-grpc_error* grpc_wakeup_fd_wakeup(grpc_wakeup_fd* fd_info) GRPC_MUST_USE_RESULT;
void grpc_wakeup_fd_destroy(grpc_wakeup_fd* fd_info);
/* Defined in some specialized implementation's .c file, or by
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
index db573e3b6f3..3af315ccb1f 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
+++ b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.cc
@@ -24,54 +24,79 @@ namespace grpc_core {
DebugOnlyTraceFlag grpc_work_serializer_trace(false, "work_serializer");
-struct CallbackWrapper {
- CallbackWrapper(std::function<void()> cb, const grpc_core::DebugLocation& loc)
- : callback(std::move(cb)), location(loc) {}
-
- MultiProducerSingleConsumerQueue::Node mpscq_node;
- const std::function<void()> callback;
- const DebugLocation location;
-};
-
class WorkSerializer::WorkSerializerImpl : public Orphanable {
public:
- void Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location);
-
+ void Run(std::function<void()> callback, const DebugLocation& location);
+ void Schedule(std::function<void()> callback, const DebugLocation& location);
+ void DrainQueue();
void Orphan() override;
private:
- void DrainQueue();
+ struct CallbackWrapper {
+ CallbackWrapper(std::function<void()> cb, const DebugLocation& loc)
+ : callback(std::move(cb)), location(loc) {}
+
+ MultiProducerSingleConsumerQueue::Node mpscq_node;
+ const std::function<void()> callback;
+ const DebugLocation location;
+ };
+
+ // Callers of DrainQueueOwned should make sure to grab the lock on the
+ // workserializer with
+ //
+ // prev_ref_pair =
+ // refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
+ //
+ // and only invoke DrainQueueOwned() if there was previously no owner. Note
+ // that the queue size is also incremented as part of the fetch_add to allow
+ // the callers to add a callback to the queue if another thread already holds
+ // the lock to the work serializer.
+ void DrainQueueOwned();
+
+ // First 16 bits indicate ownership of the WorkSerializer, next 48 bits are
+ // queue size (i.e., refs).
+ static uint64_t MakeRefPair(uint16_t owners, uint64_t size) {
+ GPR_ASSERT(size >> 48 == 0);
+ return (static_cast<uint64_t>(owners) << 48) + static_cast<int64_t>(size);
+ }
+ static uint32_t GetOwners(uint64_t ref_pair) {
+ return static_cast<uint32_t>(ref_pair >> 48);
+ }
+ static uint32_t GetSize(uint64_t ref_pair) {
+ return static_cast<uint32_t>(ref_pair & 0xffffffffffffu);
+ }
// An initial size of 1 keeps track of whether the work serializer has been
// orphaned.
- Atomic<size_t> size_{1};
+ std::atomic<uint64_t> refs_{MakeRefPair(0, 1)};
MultiProducerSingleConsumerQueue queue_;
};
-void WorkSerializer::WorkSerializerImpl::Run(
- std::function<void()> callback, const grpc_core::DebugLocation& location) {
+void WorkSerializer::WorkSerializerImpl::Run(std::function<void()> callback,
+ const DebugLocation& location) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, "WorkSerializer::Run() %p Scheduling callback [%s:%d]",
this, location.file(), location.line());
}
- const size_t prev_size = size_.FetchAdd(1);
+ // Increment queue size for the new callback and owner count to attempt to
+ // take ownership of the WorkSerializer.
+ const uint64_t prev_ref_pair =
+ refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
// The work serializer should not have been orphaned.
- GPR_DEBUG_ASSERT(prev_size > 0);
- if (prev_size == 1) {
- // There is no other closure executing right now on this work serializer.
- // Execute this closure immediately.
+ GPR_DEBUG_ASSERT(GetSize(prev_ref_pair) > 0);
+ if (GetOwners(prev_ref_pair) == 0) {
+ // We took ownership of the WorkSerializer. Invoke callback and drain queue.
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Executing immediately");
}
callback();
- // Loan this thread to the work serializer thread and drain the queue.
- DrainQueue();
+ DrainQueueOwned();
} else {
+ // Another thread is holding the WorkSerializer, so decrement the ownership
+ // count we just added and queue the callback.
+ refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel);
CallbackWrapper* cb_wrapper =
new CallbackWrapper(std::move(callback), location);
- // There already are closures executing on this work serializer. Simply add
- // this closure to the queue.
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Scheduling on queue : item %p", cb_wrapper);
}
@@ -79,12 +104,27 @@ void WorkSerializer::WorkSerializerImpl::Run(
}
}
+void WorkSerializer::WorkSerializerImpl::Schedule(
+ std::function<void()> callback, const DebugLocation& location) {
+ CallbackWrapper* cb_wrapper =
+ new CallbackWrapper(std::move(callback), location);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO,
+ "WorkSerializer::Schedule() %p Scheduling callback %p [%s:%d]",
+ this, cb_wrapper, location.file(), location.line());
+ }
+ refs_.fetch_add(MakeRefPair(0, 1), std::memory_order_acq_rel);
+ queue_.Push(&cb_wrapper->mpscq_node);
+}
+
void WorkSerializer::WorkSerializerImpl::Orphan() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, "WorkSerializer::Orphan() %p", this);
}
- size_t prev_size = size_.FetchSub(1);
- if (prev_size == 1) {
+ uint64_t prev_ref_pair =
+ refs_.fetch_sub(MakeRefPair(0, 1), std::memory_order_acq_rel);
+ if (GetSize(prev_ref_pair) == 1) {
+ GPR_DEBUG_ASSERT(GetOwners(prev_ref_pair) == 0);
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Destroying");
}
@@ -93,30 +133,52 @@ void WorkSerializer::WorkSerializerImpl::Orphan() {
}
// The thread that calls this loans itself to the work serializer so as to
-// execute all the scheduled callback. This is called from within
-// WorkSerializer::Run() after executing a callback immediately, and hence size_
-// is at least 1.
+// execute all the scheduled callbacks.
void WorkSerializer::WorkSerializerImpl::DrainQueue() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this);
+ }
+ // Attempt to take ownership of the WorkSerializer. Also increment the queue
+ // size as required by `DrainQueueOwned()`.
+ const uint64_t prev_ref_pair =
+ refs_.fetch_add(MakeRefPair(1, 1), std::memory_order_acq_rel);
+ if (GetOwners(prev_ref_pair) == 0) {
+ // We took ownership of the WorkSerializer. Drain the queue.
+ DrainQueueOwned();
+ } else {
+ // Another thread is holding the WorkSerializer, so decrement the ownership
+ // count we just added and queue a no-op callback.
+ refs_.fetch_sub(MakeRefPair(1, 0), std::memory_order_acq_rel);
+ CallbackWrapper* cb_wrapper = new CallbackWrapper([]() {}, DEBUG_LOCATION);
+ queue_.Push(&cb_wrapper->mpscq_node);
+ }
+}
+
+void WorkSerializer::WorkSerializerImpl::DrainQueueOwned() {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
+ gpr_log(GPR_INFO, "WorkSerializer::DrainQueueOwned() %p", this);
+ }
while (true) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, "WorkSerializer::DrainQueue() %p", this);
- }
- size_t prev_size = size_.FetchSub(1);
- GPR_DEBUG_ASSERT(prev_size >= 1);
- // It is possible that while draining the queue, one of the callbacks ended
+ auto prev_ref_pair = refs_.fetch_sub(MakeRefPair(0, 1));
+ // It is possible that while draining the queue, the last callback ended
// up orphaning the work serializer. In that case, delete the object.
- if (prev_size == 1) {
+ if (GetSize(prev_ref_pair) == 1) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Queue Drained. Destroying");
}
delete this;
return;
}
- if (prev_size == 2) {
- if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
- gpr_log(GPR_INFO, " Queue Drained");
+ if (GetSize(prev_ref_pair) == 2) {
+ // Queue drained. Give up ownership but only if queue remains empty. Note
+ // that we are using relaxed memory order semantics for the load on
+ // failure since we don't care about that value.
+ uint64_t expected = MakeRefPair(1, 1);
+ if (refs_.compare_exchange_strong(expected, MakeRefPair(0, 1),
+ std::memory_order_acq_rel,
+ std::memory_order_relaxed)) {
+ return;
}
- return;
}
// There is at least one callback on the queue. Pop the callback from the
// queue and execute it.
@@ -124,8 +186,8 @@ void WorkSerializer::WorkSerializerImpl::DrainQueue() {
bool empty_unused;
while ((cb_wrapper = reinterpret_cast<CallbackWrapper*>(
queue_.PopAndCheckEnd(&empty_unused))) == nullptr) {
- // This can happen either due to a race condition within the mpscq
- // implementation or because of a race with Run()
+ // This can happen due to a race condition within the mpscq
+ // implementation or because of a race with Run()/Schedule().
if (GRPC_TRACE_FLAG_ENABLED(grpc_work_serializer_trace)) {
gpr_log(GPR_INFO, " Queue returned nullptr, trying again");
}
@@ -140,7 +202,9 @@ void WorkSerializer::WorkSerializerImpl::DrainQueue() {
}
}
+//
// WorkSerializer
+//
WorkSerializer::WorkSerializer()
: impl_(MakeOrphanable<WorkSerializerImpl>()) {}
@@ -148,8 +212,15 @@ WorkSerializer::WorkSerializer()
WorkSerializer::~WorkSerializer() {}
void WorkSerializer::Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location) {
+ const DebugLocation& location) {
impl_->Run(std::move(callback), location);
}
+void WorkSerializer::Schedule(std::function<void()> callback,
+ const DebugLocation& location) {
+ impl_->Schedule(std::move(callback), location);
+}
+
+void WorkSerializer::DrainQueue() { impl_->DrainQueue(); }
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
index 53c80701a11..b742a23cb42 100644
--- a/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
+++ b/contrib/libs/grpc/src/core/lib/iomgr/work_serializer.h
@@ -18,10 +18,12 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <functional>
+#include "y_absl/synchronization/mutex.h"
+
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/gprpp/orphanable.h"
@@ -43,16 +45,42 @@ namespace grpc_core {
// other callbacks from other threads might also be executed before Run()
// returns. Since an arbitrary set of callbacks might be executed when Run() is
// called, generally no locks should be held while calling Run().
-class WorkSerializer {
+// If a thread wants to preclude the possibility of the callback being invoked
+// inline in Run() (for example, if a mutex lock is held and executing callbacks
+// inline would cause a deadlock), it should use Schedule() instead and then
+// invoke DrainQueue() when it is safe to invoke the callback.
+class Y_ABSL_LOCKABLE WorkSerializer {
public:
WorkSerializer();
~WorkSerializer();
- // TODO(yashkt): Replace grpc_core::DebugLocation with y_absl::SourceLocation
+ // Runs a given callback on the work serializer. If there is no other thread
+ // currently executing the WorkSerializer, the callback is run immediately. In
+ // this case, the current thread is also borrowed for draining the queue for
+ // any callbacks that get added in the meantime.
+ //
+ // If you want to use clang thread annotation to make sure that callback is
+ // called by WorkSerializer only, you need to add the annotation to both the
+ // lambda function given to Run and the actual callback function like;
+ //
+ // void run_callback() {
+ // work_serializer.Run(
+ // []() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer) {
+ // callback();
+ // }, DEBUG_LOCATION);
+ // }
+ // void callback() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(work_serializer) { ... }
+ //
+ // TODO(yashkt): Replace DebugLocation with y_absl::SourceLocation
// once we can start using it directly.
- void Run(std::function<void()> callback,
- const grpc_core::DebugLocation& location);
+ void Run(std::function<void()> callback, const DebugLocation& location);
+
+ // Schedule \a callback to be run later when the queue of callbacks is
+ // drained.
+ void Schedule(std::function<void()> callback, const DebugLocation& location);
+ // Drains the queue of callbacks.
+ void DrainQueue();
private:
class WorkSerializerImpl;
diff --git a/contrib/libs/grpc/src/core/lib/json/json.h b/contrib/libs/grpc/src/core/lib/json/json.h
index 2c3ec447e79..a922f478cb2 100644
--- a/contrib/libs/grpc/src/core/lib/json/json.h
+++ b/contrib/libs/grpc/src/core/lib/json/json.h
@@ -57,7 +57,7 @@ class Json {
using Array = std::vector<Json>;
// Parses JSON string from json_str. On error, sets *error.
- static Json Parse(y_absl::string_view json_str, grpc_error** error);
+ static Json Parse(y_absl::string_view json_str, grpc_error_handle* error);
Json() = default;
diff --git a/contrib/libs/grpc/src/core/lib/json/json_reader.cc b/contrib/libs/grpc/src/core/lib/json/json_reader.cc
index 78153c7cd5e..f7bfcc7e411 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_reader.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_reader.cc
@@ -38,7 +38,7 @@ namespace {
class JsonReader {
public:
- static grpc_error* Parse(y_absl::string_view input, Json* output);
+ static grpc_error_handle Parse(y_absl::string_view input, Json* output);
private:
enum class Status {
@@ -95,8 +95,8 @@ class JsonReader {
size_t CurrentIndex() const { return input_ - original_input_ - 1; }
- void StringAddChar(uint32_t c);
- void StringAddUtf32(uint32_t c);
+ GRPC_MUST_USE_RESULT bool StringAddChar(uint32_t c);
+ GRPC_MUST_USE_RESULT bool StringAddUtf32(uint32_t c);
Json* CreateAndLinkValue();
bool StartContainer(Json::Type type);
@@ -117,8 +117,9 @@ class JsonReader {
bool container_just_begun_ = false;
uint16_t unicode_char_ = 0;
uint16_t unicode_high_surrogate_ = 0;
- std::vector<grpc_error*> errors_;
+ std::vector<grpc_error_handle> errors_;
bool truncated_errors_ = false;
+ uint8_t utf8_bytes_remaining_ = 0;
Json root_value_;
std::vector<Json*> stack_;
@@ -127,34 +128,55 @@ class JsonReader {
TString string_;
};
-void JsonReader::StringAddChar(uint32_t c) {
+bool JsonReader::StringAddChar(uint32_t c) {
+ switch (utf8_bytes_remaining_) {
+ case 0:
+ if ((c & 0x80) == 0) {
+ utf8_bytes_remaining_ = 0;
+ } else if ((c & 0xe0) == 0xc0) {
+ utf8_bytes_remaining_ = 1;
+ } else if ((c & 0xf0) == 0xe0) {
+ utf8_bytes_remaining_ = 2;
+ } else if ((c & 0xf8) == 0xf0) {
+ utf8_bytes_remaining_ = 3;
+ } else {
+ return false;
+ }
+ break;
+ case 1:
+ case 2:
+ case 3:
+ if ((c & 0xc0) != 0x80) return false;
+ --utf8_bytes_remaining_;
+ break;
+ default:
+ abort();
+ }
string_.push_back(static_cast<uint8_t>(c));
+ return true;
}
-void JsonReader::StringAddUtf32(uint32_t c) {
+bool JsonReader::StringAddUtf32(uint32_t c) {
if (c <= 0x7f) {
- StringAddChar(c);
+ return StringAddChar(c);
} else if (c <= 0x7ff) {
uint32_t b1 = 0xc0 | ((c >> 6) & 0x1f);
uint32_t b2 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
+ return StringAddChar(b1) && StringAddChar(b2);
} else if (c <= 0xffff) {
uint32_t b1 = 0xe0 | ((c >> 12) & 0x0f);
uint32_t b2 = 0x80 | ((c >> 6) & 0x3f);
uint32_t b3 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
- StringAddChar(b3);
+ return StringAddChar(b1) && StringAddChar(b2) && StringAddChar(b3);
} else if (c <= 0x1fffff) {
uint32_t b1 = 0xf0 | ((c >> 18) & 0x07);
uint32_t b2 = 0x80 | ((c >> 12) & 0x3f);
uint32_t b3 = 0x80 | ((c >> 6) & 0x3f);
uint32_t b4 = 0x80 | (c & 0x3f);
- StringAddChar(b1);
- StringAddChar(b2);
- StringAddChar(b3);
- StringAddChar(b4);
+ return StringAddChar(b1) && StringAddChar(b2) && StringAddChar(b3) &&
+ StringAddChar(b4);
+ } else {
+ return false;
}
}
@@ -180,10 +202,9 @@ Json* JsonReader::CreateAndLinkValue() {
if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
truncated_errors_ = true;
} else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("duplicate key \"%s\" at index %" PRIuPTR, key_,
- CurrentIndex())
- .c_str()));
+ CurrentIndex())));
}
}
value = &(*parent->mutable_object())[std::move(key_)];
@@ -201,10 +222,9 @@ bool JsonReader::StartContainer(Json::Type type) {
if (errors_.size() == GRPC_JSON_MAX_ERRORS) {
truncated_errors_ = true;
} else {
- errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("exceeded max stack depth (%d) at index %" PRIuPTR,
- GRPC_JSON_MAX_DEPTH, CurrentIndex())
- .c_str()));
+ GRPC_JSON_MAX_DEPTH, CurrentIndex())));
}
return false;
}
@@ -277,12 +297,22 @@ JsonReader::Status JsonReader::Run() {
switch (c) {
/* Let's process the error case first. */
case GRPC_JSON_READ_CHAR_EOF:
+ switch (state_) {
+ case State::GRPC_JSON_STATE_VALUE_NUMBER:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
+ case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
+ if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
+ state_ = State::GRPC_JSON_STATE_VALUE_END;
+ break;
+
+ default:
+ break;
+ }
if (IsComplete()) {
return Status::GRPC_JSON_DONE;
- } else {
- return Status::GRPC_JSON_PARSE_ERROR;
}
- break;
+ return Status::GRPC_JSON_PARSE_ERROR;
/* Processing whitespaces. */
case ' ':
@@ -303,7 +333,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
@@ -329,7 +359,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
@@ -341,14 +371,12 @@ JsonReader::Status JsonReader::Run() {
} else if (c == '}' &&
stack_.back()->type() != Json::Type::OBJECT) {
return Status::GRPC_JSON_PARSE_ERROR;
- return Status::GRPC_JSON_PARSE_ERROR;
} else if (c == ']' && stack_.back()->type() != Json::Type::ARRAY) {
return Status::GRPC_JSON_PARSE_ERROR;
}
if (!SetNumber()) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_END;
- /* The missing break here is intentional. */
- /* fallthrough */
+ Y_ABSL_FALLTHROUGH_INTENDED;
case State::GRPC_JSON_STATE_VALUE_END:
case State::GRPC_JSON_STATE_OBJECT_KEY_BEGIN:
@@ -416,7 +444,7 @@ JsonReader::Status JsonReader::Run() {
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddChar('\\');
+ if (!StringAddChar('\\')) return Status::GRPC_JSON_PARSE_ERROR;
if (escaped_string_was_key_) {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
} else {
@@ -443,10 +471,15 @@ JsonReader::Status JsonReader::Run() {
}
if (c == '"') {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_END;
+ // Once the key is parsed, there should no un-matched utf8
+ // encoded bytes.
+ if (utf8_bytes_remaining_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
SetKey();
} else {
if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -456,10 +489,15 @@ JsonReader::Status JsonReader::Run() {
}
if (c == '"') {
state_ = State::GRPC_JSON_STATE_VALUE_END;
+ // Once the value is parsed, there should no un-matched utf8
+ // encoded bytes.
+ if (utf8_bytes_remaining_ != 0) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
SetString();
} else {
if (c < 32) return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
}
break;
@@ -487,7 +525,7 @@ JsonReader::Status JsonReader::Run() {
break;
case '0':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO;
break;
@@ -501,7 +539,7 @@ JsonReader::Status JsonReader::Run() {
case '8':
case '9':
case '-':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER;
break;
@@ -536,22 +574,22 @@ JsonReader::Status JsonReader::Run() {
switch (c) {
case '"':
case '/':
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'b':
- StringAddChar('\b');
+ if (!StringAddChar('\b')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'f':
- StringAddChar('\f');
+ if (!StringAddChar('\f')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'n':
- StringAddChar('\n');
+ if (!StringAddChar('\n')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'r':
- StringAddChar('\r');
+ if (!StringAddChar('\r')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 't':
- StringAddChar('\t');
+ if (!StringAddChar('\t')) return Status::GRPC_JSON_PARSE_ERROR;
break;
case 'u':
state_ = State::GRPC_JSON_STATE_STRING_ESCAPE_U1;
@@ -608,14 +646,18 @@ JsonReader::Status JsonReader::Run() {
utf32 += static_cast<uint32_t>(
(unicode_high_surrogate_ - 0xd800) * 0x400);
utf32 += static_cast<uint32_t>(unicode_char_ - 0xdc00);
- StringAddUtf32(utf32);
+ if (!StringAddUtf32(utf32)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
unicode_high_surrogate_ = 0;
} else {
/* anything else */
if (unicode_high_surrogate_ != 0) {
return Status::GRPC_JSON_PARSE_ERROR;
}
- StringAddUtf32(unicode_char_);
+ if (!StringAddUtf32(unicode_char_)) {
+ return Status::GRPC_JSON_PARSE_ERROR;
+ }
}
if (escaped_string_was_key_) {
state_ = State::GRPC_JSON_STATE_OBJECT_KEY_STRING;
@@ -629,7 +671,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -655,7 +697,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_WITH_DECIMAL:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -679,12 +721,12 @@ JsonReader::Status JsonReader::Run() {
case State::GRPC_JSON_STATE_VALUE_NUMBER_ZERO:
if (c != '.') return Status::GRPC_JSON_PARSE_ERROR;
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
state_ = State::GRPC_JSON_STATE_VALUE_NUMBER_DOT;
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_DOT:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -704,7 +746,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_E:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -726,7 +768,7 @@ JsonReader::Status JsonReader::Run() {
break;
case State::GRPC_JSON_STATE_VALUE_NUMBER_EPM:
- StringAddChar(c);
+ if (!StringAddChar(c)) return Status::GRPC_JSON_PARSE_ERROR;
switch (c) {
case '0':
case '1':
@@ -821,7 +863,7 @@ JsonReader::Status JsonReader::Run() {
GPR_UNREACHABLE_CODE(return Status::GRPC_JSON_INTERNAL_ERROR);
}
-grpc_error* JsonReader::Parse(y_absl::string_view input, Json* output) {
+grpc_error_handle JsonReader::Parse(y_absl::string_view input, Json* output) {
JsonReader reader(input);
Status status = reader.Run();
if (reader.truncated_errors_) {
@@ -830,14 +872,11 @@ grpc_error* JsonReader::Parse(y_absl::string_view input, Json* output) {
"errors and try again to see additional errors"));
}
if (status == Status::GRPC_JSON_INTERNAL_ERROR) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("internal error in JSON parser at index ",
- reader.CurrentIndex())
- .c_str()));
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "internal error in JSON parser at index ", reader.CurrentIndex())));
} else if (status == Status::GRPC_JSON_PARSE_ERROR) {
- reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("JSON parse error at index ", reader.CurrentIndex())
- .c_str()));
+ reader.errors_.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("JSON parse error at index ", reader.CurrentIndex())));
}
if (!reader.errors_.empty()) {
return GRPC_ERROR_CREATE_FROM_VECTOR("JSON parsing failed",
@@ -849,7 +888,7 @@ grpc_error* JsonReader::Parse(y_absl::string_view input, Json* output) {
} // namespace
-Json Json::Parse(y_absl::string_view json_str, grpc_error** error) {
+Json Json::Parse(y_absl::string_view json_str, grpc_error_handle* error) {
Json value;
*error = JsonReader::Parse(json_str, &value);
return value;
diff --git a/contrib/libs/grpc/src/core/lib/json/json_util.cc b/contrib/libs/grpc/src/core/lib/json/json_util.cc
index 1c90aeb5b47..7c30e080c10 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_util.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_util.cc
@@ -30,7 +30,7 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
if (field.type() != Json::Type::STRING) return false;
size_t len = field.string_value().size();
if (field.string_value()[len - 1] != 's') return false;
- grpc_core::UniquePtr<char> buf(gpr_strdup(field.string_value().c_str()));
+ UniquePtr<char> buf(gpr_strdup(field.string_value().c_str()));
*(buf.get() + len - 1) = '\0'; // Remove trailing 's'.
char* decimal_point = strchr(buf.get(), '.');
int nanos = 0;
@@ -55,4 +55,72 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration) {
return true;
}
+bool ExtractJsonBool(const Json& json, y_absl::string_view field_name,
+ bool* output, std::vector<grpc_error_handle>* error_list) {
+ switch (json.type()) {
+ case Json::Type::JSON_TRUE:
+ *output = true;
+ return true;
+ case Json::Type::JSON_FALSE:
+ *output = false;
+ return true;
+ default:
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be BOOLEAN")));
+ return false;
+ }
+}
+
+bool ExtractJsonArray(const Json& json, y_absl::string_view field_name,
+ const Json::Array** output,
+ std::vector<grpc_error_handle>* error_list) {
+ if (json.type() != Json::Type::ARRAY) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be ARRAY")));
+ return false;
+ }
+ *output = &json.array_value();
+ return true;
+}
+
+bool ExtractJsonObject(const Json& json, y_absl::string_view field_name,
+ const Json::Object** output,
+ std::vector<grpc_error_handle>* error_list) {
+ if (json.type() != Json::Type::OBJECT) {
+ *output = nullptr;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be OBJECT")));
+ return false;
+ }
+ *output = &json.object_value();
+ return true;
+}
+
+bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
+ y_absl::string_view field_name,
+ grpc_millis* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required) {
+ // TODO(roth): Once we can use C++14 heterogenous lookups, stop
+ // creating a TString here.
+ auto it = object.find(TString(field_name));
+ if (it == object.end()) {
+ if (required) {
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:does not exist.")));
+ }
+ return false;
+ }
+ if (!ParseDurationFromJson(it->second, output)) {
+ *output = GRPC_MILLIS_INF_PAST;
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name,
+ " error:type should be STRING of the form given by "
+ "google.proto.Duration.")));
+ return false;
+ }
+ return true;
+}
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/json/json_util.h b/contrib/libs/grpc/src/core/lib/json/json_util.h
index a91ac510d8a..51db954d95a 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_util.h
+++ b/contrib/libs/grpc/src/core/lib/json/json_util.h
@@ -40,131 +40,101 @@ bool ParseDurationFromJson(const Json& field, grpc_millis* duration);
// Return true on success, false otherwise. If an error is encountered during
// parsing, a descriptive error is appended to \a error_list.
//
-template <typename NumericType, typename ErrorVectorType>
-inline bool ExtractJsonNumber(const Json& json, const TString& field_name,
- NumericType* output,
- ErrorVectorType* error_list) {
+template <typename NumericType>
+bool ExtractJsonNumber(const Json& json, y_absl::string_view field_name,
+ NumericType* output,
+ std::vector<grpc_error_handle>* error_list) {
static_assert(std::is_integral<NumericType>::value, "Integral required");
if (json.type() != Json::Type::NUMBER) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be NUMBER")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be NUMBER")));
return false;
}
if (!y_absl::SimpleAtoi(json.string_value(), output)) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:failed to parse.").c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:failed to parse.")));
return false;
}
return true;
}
-template <typename ErrorVectorType>
-inline bool ExtractJsonBool(const Json& json, const TString& field_name,
- bool* output, ErrorVectorType* error_list) {
- switch (json.type()) {
- case Json::Type::JSON_TRUE:
- *output = true;
- return true;
- case Json::Type::JSON_FALSE:
- *output = false;
- return true;
- default:
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be BOOLEAN")
- .c_str()));
- return false;
- }
-}
+bool ExtractJsonBool(const Json& json, y_absl::string_view field_name,
+ bool* output, std::vector<grpc_error_handle>* error_list);
-template <typename ErrorVectorType>
-inline bool ExtractJsonString(const Json& json, const TString& field_name,
- TString* output,
- ErrorVectorType* error_list) {
+// OutputType can be TString or y_absl::string_view.
+template <typename OutputType>
+bool ExtractJsonString(const Json& json, y_absl::string_view field_name,
+ OutputType* output,
+ std::vector<grpc_error_handle>* error_list) {
if (json.type() != Json::Type::STRING) {
*output = "";
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be STRING")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:type should be STRING")));
return false;
}
*output = json.string_value();
return true;
}
-template <typename ErrorVectorType>
-inline bool ExtractJsonArray(const Json& json, const TString& field_name,
- const Json::Array** output,
- ErrorVectorType* error_list) {
- if (json.type() != Json::Type::ARRAY) {
- *output = nullptr;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be ARRAY")
- .c_str()));
- return false;
- }
- *output = &json.array_value();
- return true;
-}
+bool ExtractJsonArray(const Json& json, y_absl::string_view field_name,
+ const Json::Array** output,
+ std::vector<grpc_error_handle>* error_list);
-template <typename ErrorVectorType>
-inline bool ExtractJsonObject(const Json& json, const TString& field_name,
- const Json::Object** output,
- ErrorVectorType* error_list) {
- if (json.type() != Json::Type::OBJECT) {
- *output = nullptr;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:type should be OBJECT")
- .c_str()));
- return false;
- }
- *output = &json.object_value();
- return true;
-}
+bool ExtractJsonObject(const Json& json, y_absl::string_view field_name,
+ const Json::Object** output,
+ std::vector<grpc_error_handle>* error_list);
-template <typename NumericType, typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const TString& field_name,
- NumericType* output, ErrorVectorType* error_list) {
+// Wrappers for automatically choosing one of the above functions based
+// on output parameter type.
+template <typename NumericType>
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
+ NumericType* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonNumber(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const TString& field_name,
- bool* output, ErrorVectorType* error_list) {
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
+ bool* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonBool(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const TString& field_name,
- TString* output, ErrorVectorType* error_list) {
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
+ TString* output,
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonString(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const TString& field_name,
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
+ y_absl::string_view* output,
+ std::vector<grpc_error_handle>* error_list) {
+ return ExtractJsonString(json, field_name, output, error_list);
+}
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
const Json::Array** output,
- ErrorVectorType* error_list) {
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonArray(json, field_name, output, error_list);
}
-
-template <typename ErrorVectorType>
-inline bool ExtractJsonType(const Json& json, const TString& field_name,
+inline bool ExtractJsonType(const Json& json, y_absl::string_view field_name,
const Json::Object** output,
- ErrorVectorType* error_list) {
+ std::vector<grpc_error_handle>* error_list) {
return ExtractJsonObject(json, field_name, output, error_list);
}
-template <typename T, typename ErrorVectorType>
-inline bool ParseJsonObjectField(const Json::Object& object,
- const TString& field_name, T* output,
- ErrorVectorType* error_list,
- bool required = true) {
- auto it = object.find(field_name);
+// Extracts a field from a JSON object, automatically selecting the type
+// of parsing based on the output parameter type.
+// If the field is not present, returns false, and if required is true,
+// adds an error to error_list.
+// Upon any other error, adds an error to error_list and returns false.
+template <typename T>
+bool ParseJsonObjectField(const Json::Object& object,
+ y_absl::string_view field_name, T* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required = true) {
+ // TODO(roth): Once we can use C++14 heterogenous lookups, stop
+ // creating a TString here.
+ auto it = object.find(TString(field_name));
if (it == object.end()) {
if (required) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:does not exist.")
- .c_str()));
+ error_list->push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("field:", field_name, " error:does not exist.")));
}
return false;
}
@@ -172,32 +142,12 @@ inline bool ParseJsonObjectField(const Json::Object& object,
return ExtractJsonType(child_object_json, field_name, output, error_list);
}
-template <typename ErrorVectorType>
-inline bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
- const TString& field_name,
- grpc_millis* output,
- ErrorVectorType* error_list,
- bool required = true) {
- auto it = object.find(field_name);
- if (it == object.end()) {
- if (required) {
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name, " error:does not exist.")
- .c_str()));
- }
- return false;
- }
- if (!ParseDurationFromJson(it->second, output)) {
- *output = GRPC_MILLIS_INF_PAST;
- error_list->push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("field:", field_name,
- " error:type should be STRING of the form given by "
- "google.proto.Duration.")
- .c_str()));
- return false;
- }
- return true;
-}
+// Alternative to ParseJsonObjectField() for duration-value fields.
+bool ParseJsonObjectFieldAsDuration(const Json::Object& object,
+ y_absl::string_view field_name,
+ grpc_millis* output,
+ std::vector<grpc_error_handle>* error_list,
+ bool required = true);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/json/json_writer.cc b/contrib/libs/grpc/src/core/lib/json/json_writer.cc
index 05c95865558..6cca05237ce 100644
--- a/contrib/libs/grpc/src/core/lib/json/json_writer.cc
+++ b/contrib/libs/grpc/src/core/lib/json/json_writer.cc
@@ -23,9 +23,6 @@
#include "y_absl/strings/string_view.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-
#include "src/core/lib/json/json.h"
namespace grpc_core {
diff --git a/contrib/libs/grpc/src/core/lib/matchers/matchers.cc b/contrib/libs/grpc/src/core/lib/matchers/matchers.cc
index cdffcbd74c3..4fad1a96f79 100644
--- a/contrib/libs/grpc/src/core/lib/matchers/matchers.cc
+++ b/contrib/libs/grpc/src/core/lib/matchers/matchers.cc
@@ -31,15 +31,13 @@ namespace grpc_core {
y_absl::StatusOr<StringMatcher> StringMatcher::Create(Type type,
y_absl::string_view matcher,
bool case_sensitive) {
- if (type == Type::SAFE_REGEX) {
- RE2::Options options;
- options.set_case_sensitive(case_sensitive);
- auto regex_matcher = y_absl::make_unique<RE2>(TString(matcher), options);
+ if (type == Type::kSafeRegex) {
+ auto regex_matcher = y_absl::make_unique<RE2>(TString(matcher));
if (!regex_matcher->ok()) {
return y_absl::InvalidArgumentError(
"Invalid regex string specified in matcher.");
}
- return StringMatcher(std::move(regex_matcher), case_sensitive);
+ return StringMatcher(std::move(regex_matcher));
} else {
return StringMatcher(type, matcher, case_sensitive);
}
@@ -49,19 +47,13 @@ StringMatcher::StringMatcher(Type type, y_absl::string_view matcher,
bool case_sensitive)
: type_(type), string_matcher_(matcher), case_sensitive_(case_sensitive) {}
-StringMatcher::StringMatcher(std::unique_ptr<RE2> regex_matcher,
- bool case_sensitive)
- : type_(Type::SAFE_REGEX),
- regex_matcher_(std::move(regex_matcher)),
- case_sensitive_(case_sensitive) {}
+StringMatcher::StringMatcher(std::unique_ptr<RE2> regex_matcher)
+ : type_(Type::kSafeRegex), regex_matcher_(std::move(regex_matcher)) {}
StringMatcher::StringMatcher(const StringMatcher& other)
: type_(other.type_), case_sensitive_(other.case_sensitive_) {
- if (type_ == Type::SAFE_REGEX) {
- RE2::Options options;
- options.set_case_sensitive(other.case_sensitive_);
- regex_matcher_ =
- y_absl::make_unique<RE2>(other.regex_matcher_->pattern(), options);
+ if (type_ == Type::kSafeRegex) {
+ regex_matcher_ = y_absl::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}
@@ -69,11 +61,8 @@ StringMatcher::StringMatcher(const StringMatcher& other)
StringMatcher& StringMatcher::operator=(const StringMatcher& other) {
type_ = other.type_;
- if (type_ == Type::SAFE_REGEX) {
- RE2::Options options;
- options.set_case_sensitive(other.case_sensitive_);
- regex_matcher_ =
- y_absl::make_unique<RE2>(other.regex_matcher_->pattern(), options);
+ if (type_ == Type::kSafeRegex) {
+ regex_matcher_ = y_absl::make_unique<RE2>(other.regex_matcher_->pattern());
} else {
string_matcher_ = other.string_matcher_;
}
@@ -83,7 +72,7 @@ StringMatcher& StringMatcher::operator=(const StringMatcher& other) {
StringMatcher::StringMatcher(StringMatcher&& other) noexcept
: type_(other.type_), case_sensitive_(other.case_sensitive_) {
- if (type_ == Type::SAFE_REGEX) {
+ if (type_ == Type::kSafeRegex) {
regex_matcher_ = std::move(other.regex_matcher_);
} else {
string_matcher_ = std::move(other.string_matcher_);
@@ -92,7 +81,7 @@ StringMatcher::StringMatcher(StringMatcher&& other) noexcept
StringMatcher& StringMatcher::operator=(StringMatcher&& other) noexcept {
type_ = other.type_;
- if (type_ == Type::SAFE_REGEX) {
+ if (type_ == Type::kSafeRegex) {
regex_matcher_ = std::move(other.regex_matcher_);
} else {
string_matcher_ = std::move(other.string_matcher_);
@@ -105,7 +94,7 @@ bool StringMatcher::operator==(const StringMatcher& other) const {
if (type_ != other.type_ || case_sensitive_ != other.case_sensitive_) {
return false;
}
- if (type_ == Type::SAFE_REGEX) {
+ if (type_ == Type::kSafeRegex) {
return regex_matcher_->pattern() == other.regex_matcher_->pattern();
} else {
return string_matcher_ == other.string_matcher_;
@@ -114,22 +103,22 @@ bool StringMatcher::operator==(const StringMatcher& other) const {
bool StringMatcher::Match(y_absl::string_view value) const {
switch (type_) {
- case Type::EXACT:
+ case Type::kExact:
return case_sensitive_ ? value == string_matcher_
: y_absl::EqualsIgnoreCase(value, string_matcher_);
- case StringMatcher::Type::PREFIX:
+ case StringMatcher::Type::kPrefix:
return case_sensitive_
? y_absl::StartsWith(value, string_matcher_)
: y_absl::StartsWithIgnoreCase(value, string_matcher_);
- case StringMatcher::Type::SUFFIX:
+ case StringMatcher::Type::kSuffix:
return case_sensitive_ ? y_absl::EndsWith(value, string_matcher_)
: y_absl::EndsWithIgnoreCase(value, string_matcher_);
- case StringMatcher::Type::CONTAINS:
+ case StringMatcher::Type::kContains:
return case_sensitive_
? y_absl::StrContains(value, string_matcher_)
: y_absl::StrContains(y_absl::AsciiStrToLower(value),
y_absl::AsciiStrToLower(string_matcher_));
- case StringMatcher::Type::SAFE_REGEX:
+ case StringMatcher::Type::kSafeRegex:
return RE2::FullMatch(TString(value), *regex_matcher_);
default:
return false;
@@ -138,22 +127,21 @@ bool StringMatcher::Match(y_absl::string_view value) const {
TString StringMatcher::ToString() const {
switch (type_) {
- case Type::EXACT:
+ case Type::kExact:
return y_absl::StrFormat("StringMatcher{exact=%s%s}", string_matcher_,
case_sensitive_ ? "" : ", case_sensitive=false");
- case Type::PREFIX:
+ case Type::kPrefix:
return y_absl::StrFormat("StringMatcher{prefix=%s%s}", string_matcher_,
case_sensitive_ ? "" : ", case_sensitive=false");
- case Type::SUFFIX:
+ case Type::kSuffix:
return y_absl::StrFormat("StringMatcher{suffix=%s%s}", string_matcher_,
case_sensitive_ ? "" : ", case_sensitive=false");
- case Type::CONTAINS:
+ case Type::kContains:
return y_absl::StrFormat("StringMatcher{contains=%s%s}", string_matcher_,
case_sensitive_ ? "" : ", case_sensitive=false");
- case Type::SAFE_REGEX:
- return y_absl::StrFormat("StringMatcher{safe_regex=%s%s}",
- regex_matcher_->pattern(),
- case_sensitive_ ? "" : ", case_sensitive=false");
+ case Type::kSafeRegex:
+ return y_absl::StrFormat("StringMatcher{safe_regex=%s}",
+ regex_matcher_->pattern());
default:
return "";
}
@@ -177,7 +165,7 @@ y_absl::StatusOr<HeaderMatcher> HeaderMatcher::Create(
}
return HeaderMatcher(name, type, std::move(string_matcher.value()),
invert_match);
- } else if (type == Type::RANGE) {
+ } else if (type == Type::kRange) {
if (range_start > range_end) {
return y_absl::InvalidArgumentError(
"Invalid range specifier specified: end cannot be smaller than "
@@ -199,7 +187,7 @@ HeaderMatcher::HeaderMatcher(y_absl::string_view name, Type type,
HeaderMatcher::HeaderMatcher(y_absl::string_view name, int64_t range_start,
int64_t range_end, bool invert_match)
: name_(name),
- type_(Type::RANGE),
+ type_(Type::kRange),
range_start_(range_start),
range_end_(range_end),
invert_match_(invert_match) {}
@@ -207,7 +195,7 @@ HeaderMatcher::HeaderMatcher(y_absl::string_view name, int64_t range_start,
HeaderMatcher::HeaderMatcher(y_absl::string_view name, bool present_match,
bool invert_match)
: name_(name),
- type_(Type::PRESENT),
+ type_(Type::kPresent),
present_match_(present_match),
invert_match_(invert_match) {}
@@ -216,11 +204,11 @@ HeaderMatcher::HeaderMatcher(const HeaderMatcher& other)
type_(other.type_),
invert_match_(other.invert_match_) {
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
range_start_ = other.range_start_;
range_end_ = other.range_end_;
break;
- case Type::PRESENT:
+ case Type::kPresent:
present_match_ = other.present_match_;
break;
default:
@@ -233,11 +221,11 @@ HeaderMatcher& HeaderMatcher::operator=(const HeaderMatcher& other) {
type_ = other.type_;
invert_match_ = other.invert_match_;
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
range_start_ = other.range_start_;
range_end_ = other.range_end_;
break;
- case Type::PRESENT:
+ case Type::kPresent:
present_match_ = other.present_match_;
break;
default:
@@ -251,11 +239,11 @@ HeaderMatcher::HeaderMatcher(HeaderMatcher&& other) noexcept
type_(other.type_),
invert_match_(other.invert_match_) {
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
range_start_ = other.range_start_;
range_end_ = other.range_end_;
break;
- case Type::PRESENT:
+ case Type::kPresent:
present_match_ = other.present_match_;
break;
default:
@@ -268,11 +256,11 @@ HeaderMatcher& HeaderMatcher::operator=(HeaderMatcher&& other) noexcept {
type_ = other.type_;
invert_match_ = other.invert_match_;
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
range_start_ = other.range_start_;
range_end_ = other.range_end_;
break;
- case Type::PRESENT:
+ case Type::kPresent:
present_match_ = other.present_match_;
break;
default:
@@ -286,10 +274,10 @@ bool HeaderMatcher::operator==(const HeaderMatcher& other) const {
if (type_ != other.type_) return false;
if (invert_match_ != other.invert_match_) return false;
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
return range_start_ == other.range_start_ &&
range_end_ == other.range_end_;
- case Type::PRESENT:
+ case Type::kPresent:
return present_match_ == other.present_match_;
default:
return matcher_ == other.matcher_;
@@ -299,12 +287,12 @@ bool HeaderMatcher::operator==(const HeaderMatcher& other) const {
bool HeaderMatcher::Match(
const y_absl::optional<y_absl::string_view>& value) const {
bool match;
- if (type_ == Type::PRESENT) {
+ if (type_ == Type::kPresent) {
match = value.has_value() == present_match_;
} else if (!value.has_value()) {
// All other types fail to match if field is not present.
match = false;
- } else if (type_ == Type::RANGE) {
+ } else if (type_ == Type::kRange) {
int64_t int_value;
match = y_absl::SimpleAtoi(value.value(), &int_value) &&
int_value >= range_start_ && int_value < range_end_;
@@ -316,19 +304,19 @@ bool HeaderMatcher::Match(
TString HeaderMatcher::ToString() const {
switch (type_) {
- case Type::RANGE:
+ case Type::kRange:
return y_absl::StrFormat("HeaderMatcher{%s %srange=[%d, %d]}", name_,
invert_match_ ? "not " : "", range_start_,
range_end_);
- case Type::PRESENT:
+ case Type::kPresent:
return y_absl::StrFormat("HeaderMatcher{%s %spresent=%s}", name_,
invert_match_ ? "not " : "",
present_match_ ? "true" : "false");
- case Type::EXACT:
- case Type::PREFIX:
- case Type::SUFFIX:
- case Type::SAFE_REGEX:
- case Type::CONTAINS:
+ case Type::kExact:
+ case Type::kPrefix:
+ case Type::kSuffix:
+ case Type::kSafeRegex:
+ case Type::kContains:
return y_absl::StrFormat("HeaderMatcher{%s %s%s}", name_,
invert_match_ ? "not " : "", matcher_.ToString());
default:
diff --git a/contrib/libs/grpc/src/core/lib/matchers/matchers.h b/contrib/libs/grpc/src/core/lib/matchers/matchers.h
index d87113ce868..a9994ef8933 100644
--- a/contrib/libs/grpc/src/core/lib/matchers/matchers.h
+++ b/contrib/libs/grpc/src/core/lib/matchers/matchers.h
@@ -23,7 +23,6 @@
#include "y_absl/status/statusor.h"
#include "y_absl/strings/string_view.h"
#include "y_absl/types/optional.h"
-
#include "re2/re2.h"
namespace grpc_core {
@@ -31,14 +30,15 @@ namespace grpc_core {
class StringMatcher {
public:
enum class Type {
- EXACT, // value stored in string_matcher_ field
- PREFIX, // value stored in string_matcher_ field
- SUFFIX, // value stored in string_matcher_ field
- SAFE_REGEX, // pattern stored in regex_matcher_ field
- CONTAINS, // value stored in string_matcher_ field
+ kExact, // value stored in string_matcher_ field
+ kPrefix, // value stored in string_matcher_ field
+ kSuffix, // value stored in string_matcher_ field
+ kSafeRegex, // pattern stored in regex_matcher_ field
+ kContains, // value stored in string_matcher_ field
};
// Creates StringMatcher instance. Returns error status on failure.
+ // Note: case_sensitive is ignored for type kSafeRegex.
static y_absl::StatusOr<StringMatcher> Create(Type type,
y_absl::string_view matcher,
bool case_sensitive = true);
@@ -56,19 +56,19 @@ class StringMatcher {
Type type() const { return type_; }
- // Valid for EXACT, PREFIX, SUFFIX and CONTAINS
+ // Valid for kExact, kPrefix, kSuffix and kContains.
const TString& string_matcher() const { return string_matcher_; }
- // Valid for SAFE_REGEX
+ // Valid for kSafeRegex.
RE2* regex_matcher() const { return regex_matcher_.get(); }
bool case_sensitive() const { return case_sensitive_; }
private:
StringMatcher(Type type, y_absl::string_view matcher, bool case_sensitive);
- StringMatcher(std::unique_ptr<RE2> regex_matcher, bool case_sensitive);
+ explicit StringMatcher(std::unique_ptr<RE2> regex_matcher);
- Type type_ = Type::EXACT;
+ Type type_ = Type::kExact;
TString string_matcher_;
std::unique_ptr<RE2> regex_matcher_;
bool case_sensitive_ = true;
@@ -77,32 +77,32 @@ class StringMatcher {
class HeaderMatcher {
public:
enum class Type {
- EXACT, // value stored in StringMatcher field
- PREFIX, // value stored in StringMatcher field
- SUFFIX, // value stored in StringMatcher field
- SAFE_REGEX, // value stored in StringMatcher field
- CONTAINS, // value stored in StringMatcher field
- RANGE, // uses range_start and range_end fields
- PRESENT, // uses present_match field
+ kExact, // value stored in StringMatcher field
+ kPrefix, // value stored in StringMatcher field
+ kSuffix, // value stored in StringMatcher field
+ kSafeRegex, // value stored in StringMatcher field
+ kContains, // value stored in StringMatcher field
+ kRange, // uses range_start and range_end fields
+ kPresent, // uses present_match field
};
// Make sure that the first five HeaderMatcher::Type enum values match up to
// the corresponding StringMatcher::Type enum values, so that it's safe to
// convert by casting when delegating to StringMatcher.
- static_assert(static_cast<StringMatcher::Type>(Type::EXACT) ==
- StringMatcher::Type::EXACT,
+ static_assert(static_cast<StringMatcher::Type>(Type::kExact) ==
+ StringMatcher::Type::kExact,
"");
- static_assert(static_cast<StringMatcher::Type>(Type::PREFIX) ==
- StringMatcher::Type::PREFIX,
+ static_assert(static_cast<StringMatcher::Type>(Type::kPrefix) ==
+ StringMatcher::Type::kPrefix,
"");
- static_assert(static_cast<StringMatcher::Type>(Type::SUFFIX) ==
- StringMatcher::Type::SUFFIX,
+ static_assert(static_cast<StringMatcher::Type>(Type::kSuffix) ==
+ StringMatcher::Type::kSuffix,
"");
- static_assert(static_cast<StringMatcher::Type>(Type::SAFE_REGEX) ==
- StringMatcher::Type::SAFE_REGEX,
+ static_assert(static_cast<StringMatcher::Type>(Type::kSafeRegex) ==
+ StringMatcher::Type::kSafeRegex,
"");
- static_assert(static_cast<StringMatcher::Type>(Type::CONTAINS) ==
- StringMatcher::Type::CONTAINS,
+ static_assert(static_cast<StringMatcher::Type>(Type::kContains) ==
+ StringMatcher::Type::kContains,
"");
// Creates HeaderMatcher instance. Returns error status on failure.
@@ -124,12 +124,12 @@ class HeaderMatcher {
Type type() const { return type_; }
- // Valid for EXACT, PREFIX, SUFFIX and CONTAINS
+ // Valid for kExact, kPrefix, kSuffix and kContains.
const TString& string_matcher() const {
return matcher_.string_matcher();
}
- // Valid for SAFE_REGEX
+ // Valid for kSafeRegex.
RE2* regex_matcher() const { return matcher_.regex_matcher(); }
bool Match(const y_absl::optional<y_absl::string_view>& value) const;
@@ -147,7 +147,7 @@ class HeaderMatcher {
HeaderMatcher(y_absl::string_view name, bool present_match, bool invert_match);
TString name_;
- Type type_ = Type::EXACT;
+ Type type_ = Type::kExact;
StringMatcher matcher_;
int64_t range_start_;
int64_t range_end_;
diff --git a/contrib/libs/grpc/src/core/lib/profiling/basic_timers.cc b/contrib/libs/grpc/src/core/lib/profiling/basic_timers.cc
index 2056940f3a6..f98624bf38a 100644
--- a/contrib/libs/grpc/src/core/lib/profiling/basic_timers.cc
+++ b/contrib/libs/grpc/src/core/lib/profiling/basic_timers.cc
@@ -22,15 +22,17 @@
#ifdef GRPC_BASIC_PROFILER
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
#include <inttypes.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
+#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/profiling/timers.h"
@@ -61,7 +63,7 @@ typedef struct gpr_timer_log_list {
gpr_timer_log* tail;
} gpr_timer_log_list;
-static __thread gpr_timer_log* g_thread_log;
+static GPR_THREAD_LOCAL(gpr_timer_log*) g_thread_log;
static gpr_once g_once_init = GPR_ONCE_INIT;
static FILE* output_file;
static const char* output_filename_or_null = NULL;
@@ -71,7 +73,7 @@ static gpr_timer_log_list g_in_progress_logs;
static gpr_timer_log_list g_done_logs;
static int g_shutdown;
static pthread_t g_writing_thread;
-static __thread int g_thread_id;
+static GPR_THREAD_LOCAL(int) g_thread_id;
static int g_next_thread_id;
static int g_writing_enabled = 1;
diff --git a/contrib/libs/grpc/src/core/lib/profiling/stap_timers.cc b/contrib/libs/grpc/src/core/lib/profiling/stap_timers.cc
index 77c8ca3277a..0e72efc256a 100644
--- a/contrib/libs/grpc/src/core/lib/profiling/stap_timers.cc
+++ b/contrib/libs/grpc/src/core/lib/profiling/stap_timers.cc
@@ -20,9 +20,9 @@
#ifdef GRPC_STAP_PROFILER
-#include "src/core/lib/profiling/timers.h"
-
#include <sys/sdt.h>
+
+#include "src/core/lib/profiling/timers.h"
/* Generated from src/core/profiling/stap_probes.d */
#error #include "src/core/lib/profiling/stap_probes.h"
diff --git a/contrib/libs/grpc/src/core/lib/promise/activity.cc b/contrib/libs/grpc/src/core/lib/promise/activity.cc
new file mode 100644
index 00000000000..9268a6ae0a0
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/activity.cc
@@ -0,0 +1,115 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/promise/activity.h"
+
+#include "y_absl/base/attributes.h"
+
+#include "src/core/lib/gprpp/atomic_utils.h"
+
+namespace grpc_core {
+
+///////////////////////////////////////////////////////////////////////////////
+// GLOBALS
+
+GPR_THREAD_LOCAL(Activity*) Activity::g_current_activity_{nullptr};
+Waker::Unwakeable Waker::unwakeable_;
+
+///////////////////////////////////////////////////////////////////////////////
+// HELPER TYPES
+
+// Weak handle to an Activity.
+// Handle can persist while Activity goes away.
+class Activity::Handle final : public Wakeable {
+ public:
+ explicit Handle(Activity* activity) : activity_(activity) {}
+
+ // Ref the Handle (not the activity).
+ void Ref() { refs_.fetch_add(1, std::memory_order_relaxed); }
+
+ // Activity is going away... drop its reference and sever the connection back.
+ void DropActivity() Y_ABSL_LOCKS_EXCLUDED(mu_) {
+ mu_.Lock();
+ GPR_ASSERT(activity_ != nullptr);
+ activity_ = nullptr;
+ mu_.Unlock();
+ Unref();
+ }
+
+ // Activity needs to wake up (if it still exists!) - wake it up, and drop the
+ // ref that was kept for this handle.
+ void Wakeup() override Y_ABSL_LOCKS_EXCLUDED(mu_) {
+ mu_.Lock();
+ // Note that activity refcount can drop to zero, but we could win the lock
+ // against DropActivity, so we need to only increase activities refcount if
+ // it is non-zero.
+ if (activity_ && activity_->RefIfNonzero()) {
+ Activity* activity = activity_;
+ mu_.Unlock();
+ // Activity still exists and we have a reference: wake it up, which will
+ // drop the ref.
+ activity->Wakeup();
+ } else {
+ // Could not get the activity - it's either gone or going. No need to wake
+ // it up!
+ mu_.Unlock();
+ }
+ // Drop the ref to the handle (we have one ref = one wakeup semantics).
+ Unref();
+ }
+
+ void Drop() override { Unref(); }
+
+ private:
+ // Unref the Handle (not the activity).
+ void Unref() {
+ if (1 == refs_.fetch_sub(1, std::memory_order_acq_rel)) {
+ delete this;
+ }
+ }
+
+ // Two initial refs: one for the waiter that caused instantiation, one for the
+ // activity.
+ std::atomic<size_t> refs_{2};
+ Mutex mu_ Y_ABSL_ACQUIRED_AFTER(activity_->mu_);
+ Activity* activity_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// ACTIVITY IMPLEMENTATION
+
+bool Activity::RefIfNonzero() { return IncrementIfNonzero(&refs_); }
+
+Activity::Handle* Activity::RefHandle() {
+ if (handle_ == nullptr) {
+ // No handle created yet - construct it and return it.
+ handle_ = new Handle(this);
+ return handle_;
+ } else {
+ // Already had to create a handle, ref & return it.
+ handle_->Ref();
+ return handle_;
+ }
+}
+
+void Activity::DropHandle() {
+ handle_->DropActivity();
+ handle_ = nullptr;
+}
+
+Waker Activity::MakeNonOwningWaker() { return Waker(RefHandle()); }
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/promise/activity.h b/contrib/libs/grpc/src/core/lib/promise/activity.h
new file mode 100644
index 00000000000..ede38bd7af0
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/activity.h
@@ -0,0 +1,499 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_ACTIVITY_H
+#define GRPC_CORE_LIB_PROMISE_ACTIVITY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <algorithm>
+#include <atomic>
+#include <functional>
+#include <memory>
+#include <utility>
+
+#include "y_absl/base/thread_annotations.h"
+#include "y_absl/status/status.h"
+#include "y_absl/types/optional.h"
+#include "y_absl/types/variant.h"
+#include "y_absl/utility/utility.h"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gpr/tls.h"
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/promise/context.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// A Wakeable object is used by queues to wake activities.
+class Wakeable {
+ public:
+ // Wake up the underlying activity.
+ // After calling, this Wakeable cannot be used again.
+ virtual void Wakeup() = 0;
+ // Drop this wakeable without waking up the underlying activity.
+ virtual void Drop() = 0;
+
+ protected:
+ inline ~Wakeable() {}
+};
+
+// An owning reference to a Wakeable.
+// This type is non-copyable but movable.
+class Waker {
+ public:
+ explicit Waker(Wakeable* wakeable) : wakeable_(wakeable) {}
+ Waker() : wakeable_(&unwakeable_) {}
+ ~Waker() { wakeable_->Drop(); }
+ Waker(const Waker&) = delete;
+ Waker& operator=(const Waker&) = delete;
+ Waker(Waker&& other) noexcept : wakeable_(other.wakeable_) {
+ other.wakeable_ = &unwakeable_;
+ }
+ Waker& operator=(Waker&& other) noexcept {
+ std::swap(wakeable_, other.wakeable_);
+ return *this;
+ }
+
+ // Wake the underlying activity.
+ void Wakeup() {
+ wakeable_->Wakeup();
+ wakeable_ = &unwakeable_;
+ }
+
+ template <typename H>
+ friend H AbslHashValue(H h, const Waker& w) {
+ return H::combine(std::move(h), w.wakeable_);
+ }
+
+ bool operator==(const Waker& other) const noexcept {
+ return wakeable_ == other.wakeable_;
+ }
+
+ private:
+ class Unwakeable final : public Wakeable {
+ public:
+ void Wakeup() final {}
+ void Drop() final {}
+ };
+
+ Wakeable* wakeable_;
+ static Unwakeable unwakeable_;
+};
+
+// An Activity tracks execution of a single promise.
+// It executes the promise under a mutex.
+// When the promise stalls, it registers the containing activity to be woken up
+// later.
+// The activity takes a callback, which will be called exactly once with the
+// result of execution.
+// Activity execution may be cancelled by simply deleting the activity. In such
+// a case, if execution had not already finished, the done callback would be
+// called with y_absl::CancelledError().
+class Activity : private Wakeable {
+ public:
+ // Cancel execution of the underlying promise.
+ virtual void Cancel() Y_ABSL_LOCKS_EXCLUDED(mu_) = 0;
+
+ // Destroy the Activity - used for the type alias ActivityPtr.
+ struct Deleter {
+ void operator()(Activity* activity) {
+ activity->Cancel();
+ activity->Unref();
+ }
+ };
+
+ // Fetch the size of the implementation of this activity.
+ virtual size_t Size() = 0;
+
+ // Force wakeup from the outside.
+ // This should be rarely needed, and usages should be accompanied with a note
+ // on why it's not possible to wakeup with a Waker object.
+ // Nevertheless, it's sometimes useful for integrations with Activity to force
+ // an Activity to repoll.
+ void ForceWakeup() { MakeOwningWaker().Wakeup(); }
+
+ // Wakeup the current threads activity - will force a subsequent poll after
+ // the one that's running.
+ static void WakeupCurrent() {
+ current()->SetActionDuringRun(ActionDuringRun::kWakeup);
+ }
+
+ // Return the current activity.
+ // Additionally:
+ // - assert that there is a current activity (and catch bugs if there's not)
+ // - indicate to thread safety analysis that the current activity is indeed
+ // locked
+ // - back up that assertation with a runtime check in debug builds (it's
+ // prohibitively expensive in non-debug builds)
+ static Activity* current() Y_ABSL_ASSERT_EXCLUSIVE_LOCK(current()->mu_) {
+#ifndef NDEBUG
+ GPR_ASSERT(g_current_activity_);
+ if (g_current_activity_ != nullptr) {
+ g_current_activity_->mu_.AssertHeld();
+ }
+#endif
+ return g_current_activity_;
+ }
+
+ // Produce an activity-owning Waker. The produced waker will keep the activity
+ // alive until it's awoken or dropped.
+ Waker MakeOwningWaker() {
+ Ref();
+ return Waker(this);
+ }
+
+ // Produce a non-owning Waker. The waker will own a small heap allocated weak
+ // pointer to this activity. This is more suitable for wakeups that may not be
+ // delivered until long after the activity should be destroyed.
+ Waker MakeNonOwningWaker() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ protected:
+ // Action received during a run, in priority order.
+ // If more than one action is received during a run, we use max() to resolve
+ // which one to report (so Cancel overrides Wakeup).
+ enum class ActionDuringRun : uint8_t {
+ kNone, // No action occured during run.
+ kWakeup, // A wakeup occured during run.
+ kCancel, // Cancel was called during run.
+ };
+
+ inline virtual ~Activity() {
+ if (handle_) {
+ DropHandle();
+ }
+ }
+
+ // All promise execution occurs under this mutex.
+ Mutex mu_;
+
+ // Check if this activity is the current activity executing on the current
+ // thread.
+ bool is_current() const { return this == g_current_activity_; }
+ // Check if there is an activity executing on the current thread.
+ static bool have_current() { return g_current_activity_ != nullptr; }
+ // Check if we got an internal wakeup since the last time this function was
+ // called.
+ ActionDuringRun GotActionDuringRun() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ return y_absl::exchange(action_during_run_, ActionDuringRun::kNone);
+ }
+
+ // Set the current activity at construction, clean it up at destruction.
+ class ScopedActivity {
+ public:
+ explicit ScopedActivity(Activity* activity) {
+ GPR_ASSERT(g_current_activity_ == nullptr);
+ g_current_activity_ = activity;
+ }
+ ~ScopedActivity() { g_current_activity_ = nullptr; }
+ ScopedActivity(const ScopedActivity&) = delete;
+ ScopedActivity& operator=(const ScopedActivity&) = delete;
+ };
+
+ // Implementors of Wakeable::Wakeup should call this after the wakeup has
+ // completed.
+ void WakeupComplete() { Unref(); }
+
+ // Mark the current activity as being cancelled (so we can actually cancel it
+ // after polling).
+ void CancelCurrent() {
+ current()->SetActionDuringRun(ActionDuringRun::kCancel);
+ }
+
+ private:
+ class Handle;
+
+ void Ref() { refs_.fetch_add(1, std::memory_order_relaxed); }
+ void Unref() {
+ if (1 == refs_.fetch_sub(1, std::memory_order_acq_rel)) {
+ delete this;
+ }
+ }
+
+ // Return a Handle instance with a ref so that it can be stored waiting for
+ // some wakeup.
+ Handle* RefHandle() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ // If our refcount is non-zero, ref and return true.
+ // Otherwise, return false.
+ bool RefIfNonzero();
+ // Drop the (proved existing) wait handle.
+ void DropHandle() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+ // Set the action that occured during this run.
+ // We use max to combine actions so that cancellation overrides wakeups.
+ void SetActionDuringRun(ActionDuringRun action)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ action_during_run_ = std::max(action_during_run_, action);
+ }
+
+ // Current refcount.
+ std::atomic<uint32_t> refs_{1};
+ // If wakeup is called during Promise polling, we set this to Wakeup and
+ // repoll. If cancel is called during Promise polling, we set this to Cancel
+ // and cancel at the end of polling.
+ ActionDuringRun action_during_run_ Y_ABSL_GUARDED_BY(mu_) =
+ ActionDuringRun::kNone;
+ // Handle for long waits. Allows a very small weak pointer type object to
+ // queue for wakeups while Activity may be deleted earlier.
+ Handle* handle_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ // Set during RunLoop to the Activity that's executing.
+ // Being set implies that mu_ is held.
+ static GPR_THREAD_LOCAL(Activity*) g_current_activity_;
+};
+
+// Owned pointer to one Activity.
+using ActivityPtr = std::unique_ptr<Activity, Activity::Deleter>;
+
+namespace promise_detail {
+
+template <typename Context>
+class ContextHolder {
+ public:
+ explicit ContextHolder(Context value) : value_(std::move(value)) {}
+ Context* GetContext() { return &value_; }
+
+ private:
+ Context value_;
+};
+
+template <typename Context>
+class ContextHolder<Context*> {
+ public:
+ explicit ContextHolder(Context* value) : value_(value) {}
+ Context* GetContext() { return value_; }
+
+ private:
+ Context* value_;
+};
+
+template <typename... Contexts>
+class EnterContexts : public promise_detail::Context<Contexts>... {
+ public:
+ explicit EnterContexts(Contexts*... contexts)
+ : promise_detail::Context<Contexts>(contexts)... {}
+};
+
+// Implementation details for an Activity of an arbitrary type of promise.
+// There should exist a static function:
+// struct WakeupScheduler {
+// template <typename ActivityType>
+// void ScheduleWakeup(ActivityType* activity);
+// };
+// This function should arrange that activity->RunScheduledWakeup() be invoked
+// at the earliest opportunity.
+// It can assume that activity will remain live until RunScheduledWakeup() is
+// invoked, and that a given activity will not be concurrently scheduled again
+// until its RunScheduledWakeup() has been invoked.
+template <class F, class WakeupScheduler, class OnDone, typename... Contexts>
+class PromiseActivity final
+ : public Activity,
+ private promise_detail::ContextHolder<Contexts>... {
+ public:
+ using Factory = PromiseFactory<void, F>;
+ PromiseActivity(F promise_factory, WakeupScheduler wakeup_scheduler,
+ OnDone on_done, Contexts... contexts)
+ : Activity(),
+ ContextHolder<Contexts>(std::move(contexts))...,
+ wakeup_scheduler_(std::move(wakeup_scheduler)),
+ on_done_(std::move(on_done)) {
+ // Lock, construct an initial promise from the factory, and step it.
+ // This may hit a waiter, which could expose our this pointer to other
+ // threads, meaning we do need to hold this mutex even though we're still
+ // constructing.
+ mu_.Lock();
+ auto status = Start(Factory(std::move(promise_factory)));
+ mu_.Unlock();
+ // We may complete immediately.
+ if (status.has_value()) {
+ on_done_(std::move(*status));
+ }
+ }
+
+ ~PromiseActivity() override {
+ // We shouldn't destruct without calling Cancel() first, and that must get
+ // us to be done_, so we assume that and have no logic to destruct the
+ // promise here.
+ GPR_ASSERT(done_);
+ }
+
+ size_t Size() override { return sizeof(*this); }
+
+ void Cancel() final {
+ if (Activity::is_current()) {
+ CancelCurrent();
+ return;
+ }
+ bool was_done;
+ {
+ MutexLock lock(&mu_);
+ // Check if we were done, and flag done.
+ was_done = done_;
+ if (!done_) MarkDone();
+ }
+ // If we were not done, then call the on_done callback.
+ if (!was_done) {
+ on_done_(y_absl::CancelledError());
+ }
+ }
+
+ void RunScheduledWakeup() {
+ GPR_ASSERT(wakeup_scheduled_.exchange(false, std::memory_order_acq_rel));
+ Step();
+ WakeupComplete();
+ }
+
+ private:
+ // Wakeup this activity. Arrange to poll the activity again at a convenient
+ // time: this could be inline if it's deemed safe, or it could be by passing
+ // the activity to an external threadpool to run. If the activity is already
+ // running on this thread, a note is taken of such and the activity is
+ // repolled if it doesn't complete.
+ void Wakeup() final {
+ // If there is an active activity, but hey it's us, flag that and we'll loop
+ // in RunLoop (that's calling from above here!).
+ if (Activity::is_current()) {
+ WakeupCurrent();
+ WakeupComplete();
+ return;
+ }
+ if (!wakeup_scheduled_.exchange(true, std::memory_order_acq_rel)) {
+ // Can't safely run, so ask to run later.
+ wakeup_scheduler_.ScheduleWakeup(this);
+ } else {
+ // Already a wakeup scheduled for later, drop ref.
+ WakeupComplete();
+ }
+ }
+
+ // Drop a wakeup
+ void Drop() final { this->WakeupComplete(); }
+
+ // Notification that we're no longer executing - it's ok to destruct the
+ // promise.
+ void MarkDone() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ GPR_ASSERT(!done_);
+ done_ = true;
+ Destruct(&promise_holder_.promise);
+ }
+
+ // In response to Wakeup, run the Promise state machine again until it
+ // settles. Then check for completion, and if we have completed, call on_done.
+ void Step() Y_ABSL_LOCKS_EXCLUDED(mu_) {
+ // Poll the promise until things settle out under a lock.
+ mu_.Lock();
+ if (done_) {
+ // We might get some spurious wakeups after finishing.
+ mu_.Unlock();
+ return;
+ }
+ auto status = RunStep();
+ mu_.Unlock();
+ if (status.has_value()) {
+ on_done_(std::move(*status));
+ }
+ }
+
+ // The main body of a step: set the current activity, and any contexts, and
+ // then run the main polling loop. Contained in a function by itself in order
+ // to keep the scoping rules a little easier in Step().
+ y_absl::optional<y_absl::Status> RunStep() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ ScopedActivity scoped_activity(this);
+ EnterContexts<Contexts...> contexts(
+ static_cast<ContextHolder<Contexts>*>(this)->GetContext()...);
+ return StepLoop();
+ }
+
+ // Similarly to RunStep, but additionally construct the promise from a promise
+ // factory before entering the main loop. Called once from the constructor.
+ y_absl::optional<y_absl::Status> Start(Factory promise_factory)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ ScopedActivity scoped_activity(this);
+ EnterContexts<Contexts...> contexts(
+ static_cast<ContextHolder<Contexts>*>(this)->GetContext()...);
+ Construct(&promise_holder_.promise, promise_factory.Once());
+ return StepLoop();
+ }
+
+ // Until there are no wakeups from within and the promise is incomplete: poll
+ // the promise.
+ y_absl::optional<y_absl::Status> StepLoop() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ GPR_ASSERT(is_current());
+ while (true) {
+ // Run the promise.
+ GPR_ASSERT(!done_);
+ auto r = promise_holder_.promise();
+ if (auto* status = y_absl::get_if<kPollReadyIdx>(&r)) {
+ // If complete, destroy the promise, flag done, and exit this loop.
+ MarkDone();
+ return IntoStatus(status);
+ }
+ // Continue looping til no wakeups occur.
+ switch (GotActionDuringRun()) {
+ case ActionDuringRun::kNone:
+ return {};
+ case ActionDuringRun::kWakeup:
+ break;
+ case ActionDuringRun::kCancel:
+ MarkDone();
+ return y_absl::CancelledError();
+ }
+ }
+ }
+
+ using Promise = typename Factory::Promise;
+ // Scheduler for wakeups
+ GPR_NO_UNIQUE_ADDRESS WakeupScheduler wakeup_scheduler_;
+ // Callback on completion of the promise.
+ GPR_NO_UNIQUE_ADDRESS OnDone on_done_;
+ // Has execution completed?
+ GPR_NO_UNIQUE_ADDRESS bool done_ Y_ABSL_GUARDED_BY(mu_) = false;
+ // Is there a wakeup scheduled?
+ GPR_NO_UNIQUE_ADDRESS std::atomic<bool> wakeup_scheduled_{false};
+ // We wrap the promise in a union to allow control over the construction
+ // simultaneously with annotating mutex requirements and noting that the
+ // promise contained may not use any memory.
+ union PromiseHolder {
+ PromiseHolder() {}
+ ~PromiseHolder() {}
+ GPR_NO_UNIQUE_ADDRESS Promise promise;
+ };
+ GPR_NO_UNIQUE_ADDRESS PromiseHolder promise_holder_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+} // namespace promise_detail
+
+// Given a functor that returns a promise (a promise factory), a callback for
+// completion, and a callback scheduler, construct an activity.
+template <typename Factory, typename WakeupScheduler, typename OnDone,
+ typename... Contexts>
+ActivityPtr MakeActivity(Factory promise_factory,
+ WakeupScheduler wakeup_scheduler, OnDone on_done,
+ Contexts... contexts) {
+ return ActivityPtr(
+ new promise_detail::PromiseActivity<Factory, WakeupScheduler, OnDone,
+ Contexts...>(
+ std::move(promise_factory), std::move(wakeup_scheduler),
+ std::move(on_done), std::move(contexts)...));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_ACTIVITY_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/arena_promise.h b/contrib/libs/grpc/src/core/lib/promise/arena_promise.h
new file mode 100644
index 00000000000..ef0fff11e31
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/arena_promise.h
@@ -0,0 +1,184 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H
+#define GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/gprpp/arena.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace arena_promise_detail {
+
+// Type erased promise stored in the arena.
+template <typename T>
+class ImplInterface {
+ public:
+ // Poll the promise, once.
+ virtual Poll<T> PollOnce() = 0;
+ // Destroy the underlying callable object if there is one.
+ // Since we don't delete (the arena owns the memory) but we may need to call a
+ // destructor, we expose this for when the ArenaPromise object is destroyed.
+ virtual void Destroy() = 0;
+
+ protected:
+ ~ImplInterface() = default;
+};
+
+// Implementation of ImplInterface for an empty object.
+// Used when an empty ArenaPromise is created, or when the ArenaPromise is moved
+// from. Since in either case these objects should not be polled, we simply
+// crash if it is.
+template <typename T>
+class NullImpl final : public ImplInterface<T> {
+ public:
+ Poll<T> PollOnce() override {
+ abort();
+ GPR_UNREACHABLE_CODE(return Pending{});
+ }
+ void Destroy() override {}
+
+ static ImplInterface<T>* Get() {
+ static NullImpl<T> instance;
+ return &instance;
+ }
+
+ private:
+ ~NullImpl() = default;
+};
+
+// Implementation of ImplInterface for a callable object.
+template <typename T, typename Callable>
+class CallableImpl final : public ImplInterface<T> {
+ public:
+ explicit CallableImpl(Callable&& callable) : callable_(std::move(callable)) {}
+ // Forward polls to the callable object.
+ Poll<T> PollOnce() override { return callable_(); }
+ // Destroy destructs the callable object.
+ void Destroy() override { this->~CallableImpl(); }
+
+ private:
+ // Should only be called by Destroy().
+ ~CallableImpl() = default;
+
+ Callable callable_;
+};
+
+// If a callable object is empty we can substitute any instance of that callable
+// for the one we call (for how could we tell the difference)?
+// Since this corresponds to a lambda with no fields, and we expect these to be
+// reasonably common, we can elide the arena allocation entirely and simply poll
+// a global shared instance.
+// (this comes up often when the promise only accesses context data from the
+// containing activity).
+template <typename T, typename Callable>
+class SharedImpl final : public ImplInterface<T>, private Callable {
+ public:
+ // Call the callable, or at least an exact duplicate of it - if you have no
+ // members, all your instances look the same.
+ Poll<T> PollOnce() override { return Callable::operator()(); }
+ // Nothing to destroy.
+ void Destroy() override {}
+ // Return a pointer to the shared instance - these are singletons, and are
+ // needed just to get the vtable in place.
+ static SharedImpl* Get(Callable&& callable) {
+ static_assert(sizeof(SharedImpl) == sizeof(void*),
+ "SharedImpl should be pointer sized");
+ static SharedImpl impl(std::forward<Callable>(callable));
+ return &impl;
+ }
+
+ private:
+ explicit SharedImpl(Callable&& callable)
+ : Callable(std::forward<Callable>(callable)) {}
+ ~SharedImpl() = default;
+};
+
+// Redirector type: given a callable type, expose a Make() function that creates
+// the appropriate underlying implementation.
+template <typename T, typename Callable, typename Ignored = void>
+struct ChooseImplForCallable;
+
+template <typename T, typename Callable>
+struct ChooseImplForCallable<
+ T, Callable, y_absl::enable_if_t<!std::is_empty<Callable>::value>> {
+ static ImplInterface<T>* Make(Arena* arena, Callable&& callable) {
+ return arena->template New<CallableImpl<T, Callable>>(
+ std::forward<Callable>(callable));
+ }
+};
+
+template <typename T, typename Callable>
+struct ChooseImplForCallable<
+ T, Callable, y_absl::enable_if_t<std::is_empty<Callable>::value>> {
+ static ImplInterface<T>* Make(Arena*, Callable&& callable) {
+ return SharedImpl<T, Callable>::Get(std::forward<Callable>(callable));
+ }
+};
+
+// Wrap ChooseImplForCallable with a friend approachable syntax.
+template <typename T, typename Callable>
+ImplInterface<T>* MakeImplForCallable(Arena* arena, Callable&& callable) {
+ return ChooseImplForCallable<T, Callable>::Make(
+ arena, std::forward<Callable>(callable));
+}
+
+} // namespace arena_promise_detail
+
+// A promise for which the state memory is allocated from an arena.
+template <typename T>
+class ArenaPromise {
+ public:
+ // Construct an empty, uncallable, invalid ArenaPromise.
+ ArenaPromise() = default;
+
+ // Construct an ArenaPromise that will call the given callable when polled.
+ template <typename Callable>
+ ArenaPromise(Arena* arena, Callable&& callable)
+ : impl_(arena_promise_detail::MakeImplForCallable<T>(
+ arena, std::forward<Callable>(callable))) {}
+
+ // ArenaPromise is not copyable.
+ ArenaPromise(const ArenaPromise&) = delete;
+ ArenaPromise& operator=(const ArenaPromise&) = delete;
+ // ArenaPromise is movable.
+ ArenaPromise(ArenaPromise&& other) noexcept : impl_(other.impl_) {
+ other.impl_ = arena_promise_detail::NullImpl<T>::Get();
+ }
+ ArenaPromise& operator=(ArenaPromise&& other) noexcept {
+ impl_ = other.impl_;
+ other.impl_ = arena_promise_detail::NullImpl<T>::Get();
+ return *this;
+ }
+
+ // Destruction => call Destroy on the underlying impl object.
+ ~ArenaPromise() { impl_->Destroy(); }
+
+ // Expose the promise interface: a call operator that returns Poll<T>.
+ Poll<T> operator()() { return impl_->PollOnce(); }
+
+ private:
+ // Underlying impl object.
+ arena_promise_detail::ImplInterface<T>* impl_ =
+ arena_promise_detail::NullImpl<T>::Get();
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_PROMISE_ARENA_PROMISE_H */
diff --git a/contrib/libs/grpc/src/core/lib/promise/context.h b/contrib/libs/grpc/src/core/lib/promise/context.h
new file mode 100644
index 00000000000..dfee3d28a6b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/context.h
@@ -0,0 +1,86 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_CONTEXT_H
+#define GRPC_CORE_LIB_PROMISE_CONTEXT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "src/core/lib/gpr/tls.h"
+
+namespace grpc_core {
+
+// To avoid accidentally creating context types, we require an explicit
+// specialization of this template per context type. The specialization need
+// not contain any members, only exist.
+// The reason for avoiding this is that context types each use a thread local.
+template <typename T>
+struct ContextType;
+
+namespace promise_detail {
+
+template <typename T>
+class Context : public ContextType<T> {
+ public:
+ explicit Context(T* p) : old_(current_) { current_ = p; }
+ ~Context() { current_ = old_; }
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
+
+ static T* get() { return current_; }
+
+ private:
+ T* const old_;
+ static GPR_THREAD_LOCAL(T*) current_;
+};
+
+template <typename T>
+GPR_THREAD_LOCAL(T*)
+Context<T>::current_;
+
+template <typename T, typename F>
+class WithContext {
+ public:
+ WithContext(F f, T* context) : context_(context), f_(std::move(f)) {}
+
+ decltype(std::declval<F>()()) operator()() {
+ Context<T> ctx(context_);
+ return f_();
+ }
+
+ private:
+ T* context_;
+ F f_;
+};
+
+} // namespace promise_detail
+
+// Retrieve the current value of a context.
+template <typename T>
+T* GetContext() {
+ return promise_detail::Context<T>::get();
+}
+
+// Given a promise and a context, return a promise that has that context set.
+template <typename T, typename F>
+promise_detail::WithContext<T, F> WithContext(F f, T* context) {
+ return promise_detail::WithContext<T, F>(f, context);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_CONTEXT_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h b/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h
new file mode 100644
index 00000000000..799109faf08
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/basic_join.h
@@ -0,0 +1,199 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include <assert.h>
+#include <stddef.h>
+
+#include <array>
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/types/variant.h"
+#include "y_absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/bitset.h"
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+namespace promise_detail {
+
+// This union can either be a functor, or the result of the functor (after
+// mapping via a trait). Allows us to remember the result of one joined functor
+// until the rest are ready.
+template <typename Traits, typename F>
+union Fused {
+ explicit Fused(F&& f) : f(std::forward<F>(f)) {}
+ explicit Fused(PromiseLike<F>&& f) : f(std::forward<PromiseLike<F>>(f)) {}
+ ~Fused() {}
+ // Wrap the functor in a PromiseLike to handle immediately returning functors
+ // and the like.
+ using Promise = PromiseLike<F>;
+ GPR_NO_UNIQUE_ADDRESS Promise f;
+ // Compute the result type: We take the result of the promise, and pass it via
+ // our traits, so that, for example, TryJoin and take a StatusOr<T> and just
+ // store a T.
+ using Result = typename Traits::template ResultType<typename Promise::Result>;
+ GPR_NO_UNIQUE_ADDRESS Result result;
+};
+
+// A join gets composed of joints... these are just wrappers around a Fused for
+// their data, with some machinery as methods to get the system working.
+template <typename Traits, size_t kRemaining, typename... Fs>
+struct Joint : public Joint<Traits, kRemaining - 1, Fs...> {
+ // The index into Fs for this Joint
+ static constexpr size_t kIdx = sizeof...(Fs) - kRemaining;
+ // The next join (the one we derive from)
+ using NextJoint = Joint<Traits, kRemaining - 1, Fs...>;
+ // From Fs, extract the functor for this joint.
+ using F = typename std::tuple_element<kIdx, std::tuple<Fs...>>::type;
+ // Generate the Fused type for this functor.
+ using Fsd = Fused<Traits, F>;
+ GPR_NO_UNIQUE_ADDRESS Fsd fused;
+ // Figure out what kind of bitmask will be used by the outer join.
+ using Bits = BitSet<sizeof...(Fs)>;
+ // Initialize from a tuple of pointers to Fs
+ explicit Joint(std::tuple<Fs*...> fs)
+ : NextJoint(fs), fused(std::move(*std::get<kIdx>(fs))) {}
+ // Copy: assume that the Fuse is still in the promise state (since it's not
+ // legal to copy after the first poll!)
+ Joint(const Joint& j) : NextJoint(j), fused(j.fused.f) {}
+ // Move: assume that the Fuse is still in the promise state (since it's not
+ // legal to move after the first poll!)
+ Joint(Joint&& j) noexcept
+ : NextJoint(std::forward<NextJoint>(j)), fused(std::move(j.fused.f)) {}
+ // Destruct: check bits to see if we're in promise or result state, and call
+ // the appropriate destructor. Recursively, call up through the join.
+ void DestructAll(const Bits& bits) {
+ if (!bits.is_set(kIdx)) {
+ Destruct(&fused.f);
+ } else {
+ Destruct(&fused.result);
+ }
+ NextJoint::DestructAll(bits);
+ }
+ // Poll all joints up, and then call finally.
+ template <typename F>
+ auto Run(Bits* bits, F finally) -> decltype(finally()) {
+ // If we're still in the promise state...
+ if (!bits->is_set(kIdx)) {
+ // Poll the promise
+ auto r = fused.f();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ // If it's done, then ask the trait to unwrap it and store that result
+ // in the Fused, and continue the iteration. Note that OnResult could
+ // instead choose to return a value instead of recursing through the
+ // iteration, in that case we continue returning the same result up.
+ // Here is where TryJoin can escape out.
+ return Traits::OnResult(
+ std::move(*p), [this, bits, &finally](typename Fsd::Result result) {
+ bits->set(kIdx);
+ Destruct(&fused.f);
+ Construct(&fused.result, std::move(result));
+ return NextJoint::Run(bits, std::move(finally));
+ });
+ }
+ }
+ // That joint is still pending... we'll still poll the result of the joints.
+ return NextJoint::Run(bits, std::move(finally));
+ }
+};
+
+// Terminating joint... for each of the recursions, do the thing we're supposed
+// to do at the end.
+template <typename Traits, typename... Fs>
+struct Joint<Traits, 0, Fs...> {
+ explicit Joint(std::tuple<Fs*...>) {}
+ Joint(const Joint&) {}
+ Joint(Joint&&) noexcept {}
+ template <typename T>
+ void DestructAll(const T&) {}
+ template <typename F>
+ auto Run(BitSet<sizeof...(Fs)>*, F finally) -> decltype(finally()) {
+ return finally();
+ }
+};
+
+template <typename Traits, typename... Fs>
+class BasicJoin {
+ private:
+ // How many things are we joining?
+ static constexpr size_t N = sizeof...(Fs);
+ // Bitset: if a bit is 0, that joint is still in promise state. If it's 1,
+ // then the joint has a result.
+ GPR_NO_UNIQUE_ADDRESS BitSet<N> state_;
+ // The actual joints, wrapped in an anonymous union to give us control of
+ // construction/destruction.
+ union {
+ GPR_NO_UNIQUE_ADDRESS Joint<Traits, sizeof...(Fs), Fs...> joints_;
+ };
+
+ // Access joint index I
+ template <size_t I>
+ Joint<Traits, sizeof...(Fs) - I, Fs...>* GetJoint() {
+ return static_cast<Joint<Traits, sizeof...(Fs) - I, Fs...>*>(&joints_);
+ }
+
+ // The tuple of results of all our promises
+ using Tuple = std::tuple<typename Fused<Traits, Fs>::Result...>;
+
+ // Collect up all the results and construct a tuple.
+ template <size_t... I>
+ Tuple Finish(y_absl::index_sequence<I...>) {
+ return Tuple(std::move(GetJoint<I>()->fused.result)...);
+ }
+
+ public:
+ explicit BasicJoin(Fs&&... fs) : joints_(std::tuple<Fs*...>(&fs...)) {}
+ BasicJoin& operator=(const BasicJoin&) = delete;
+ // Copy a join - only available before polling.
+ BasicJoin(const BasicJoin& other) {
+ assert(other.state_.none());
+ Construct(&joints_, other.joints_);
+ }
+ // Move a join - only available before polling.
+ BasicJoin(BasicJoin&& other) noexcept {
+ assert(other.state_.none());
+ Construct(&joints_, std::move(other.joints_));
+ }
+ ~BasicJoin() { joints_.DestructAll(state_); }
+ using Result = decltype(Traits::Wrap(std::declval<Tuple>()));
+ // Poll the join
+ Poll<Result> operator()() {
+ // Poll the joints...
+ return joints_.Run(&state_, [this]() -> Poll<Result> {
+ // If all of them are completed, collect the results, and then ask our
+ // traits to wrap them - allowing for example TryJoin to turn tuple<A,B,C>
+ // into StatusOr<tuple<A,B,C>>.
+ if (state_.all()) {
+ return Traits::Wrap(Finish(y_absl::make_index_sequence<N>()));
+ } else {
+ return Pending();
+ }
+ });
+ }
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_JOIN_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/basic_seq.h b/contrib/libs/grpc/src/core/lib/promise/detail/basic_seq.h
new file mode 100644
index 00000000000..bd26693555e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/basic_seq.h
@@ -0,0 +1,407 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <array>
+#include <cassert>
+#include <new>
+#include <tuple>
+#include <utility>
+
+#include "y_absl/meta/type_traits.h"
+#include "y_absl/types/variant.h"
+#include "y_absl/utility/utility.h"
+
+#include "src/core/lib/gprpp/construct_destruct.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/switch.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+namespace promise_detail {
+template <typename F>
+class PromiseLike;
+
+// Helper for SeqState to evaluate some common types to all partial
+// specializations.
+template <template <typename> class Traits, typename FPromise, typename FNext>
+struct SeqStateTypes {
+ // Our current promise.
+ using Promise = FPromise;
+ // The result of our current promise.
+ using PromiseResult = typename Promise::Result;
+ // Traits around the result of our promise.
+ using PromiseResultTraits = Traits<PromiseResult>;
+ // Wrap the factory callable in our factory wrapper to deal with common edge
+ // cases. We use the 'unwrapped type' from the traits, so for instance, TrySeq
+ // can pass back a T from a StatusOr<T>.
+ using Next = promise_detail::PromiseFactory<
+ typename PromiseResultTraits::UnwrappedType, FNext>;
+};
+
+// One state in a sequence.
+// A state contains the current promise, and the promise factory to turn the
+// result of the current promise into the next state's promise. We play a shell
+// game such that the prior state and our current promise are kept in a union,
+// and the next promise factory is kept alongside in the state struct.
+// Recursively this guarantees that the next functions get initialized once, and
+// destroyed once, and don't need to be moved around in between, which avoids a
+// potential O(n**2) loop of next factory moves had we used a variant of states
+// here. The very first state does not have a prior state, and so that state has
+// a partial specialization below. The final state does not have a next state;
+// that state is inlined in BasicSeq since that was simpler to type.
+template <template <typename> class Traits, char I, typename... Fs>
+struct SeqState {
+ // The state evaluated before this state.
+ using PriorState = SeqState<Traits, I - 1, Fs...>;
+ // Initialization from callables.
+ explicit SeqState(std::tuple<Fs*...> fs)
+ : next_factory(std::move(*std::get<I + 1>(fs))) {
+ new (&prior) PriorState(fs);
+ }
+ // Move constructor - assumes we're in the initial state (move prior) as it's
+ // illegal to move a promise after polling it.
+ SeqState(SeqState&& other) noexcept
+ : next_factory(std::move(other.next_factory)) {
+ new (&prior) PriorState(std::move(other.prior));
+ }
+ // Copy constructor - assumes we're in the initial state (move prior) as it's
+ // illegal to move a promise after polling it.
+ SeqState(const SeqState& other) : next_factory(other.next_factory) {
+ new (&prior) PriorState(std::move(other.prior));
+ }
+ // Empty destructor - we instead destruct the innards in BasicSeq manually
+ // depending on state.
+ ~SeqState() {}
+ // Evaluate the current promise, next promise factory types for this state.
+ // The current promise is the next promise from the prior state.
+ // The next factory callable is from the callables passed in:
+ // Fs[0] is the initial promise, Fs[1] is the state 0 next factory, Fs[2] is
+ // the state 1 next factory, etc...
+ using Types = SeqStateTypes<
+ Traits, typename PriorState::Types::Next::Promise,
+ typename std::tuple_element<I + 1, std::tuple<Fs...>>::type>;
+ // Storage for either the current promise or the prior state.
+ union {
+ // If we're in the prior state.
+ GPR_NO_UNIQUE_ADDRESS PriorState prior;
+ // The callables representing our promise.
+ GPR_NO_UNIQUE_ADDRESS typename Types::Promise current_promise;
+ };
+ // Storage for the next promise factory.
+ GPR_NO_UNIQUE_ADDRESS typename Types::Next next_factory;
+};
+
+// Partial specialization of SeqState above for the first state - it has no
+// prior state, so we take the first callable from the template arg list and use
+// it as a promise.
+template <template <typename> class Traits, typename... Fs>
+struct SeqState<Traits, 0, Fs...> {
+ // Initialization from callables.
+ explicit SeqState(std::tuple<Fs*...> args)
+ : current_promise(std::move(*std::get<0>(args))),
+ next_factory(std::move(*std::get<1>(args))) {}
+ // Move constructor - it's assumed we're in this state (see above).
+ SeqState(SeqState&& other) noexcept
+ : current_promise(std::move(other.current_promise)),
+ next_factory(std::move(other.next_factory)) {}
+ // Copy constructor - it's assumed we're in this state (see above).
+ SeqState(const SeqState& other)
+ : current_promise(other.current_promise),
+ next_factory(other.next_factory) {}
+ // Empty destructor - we instead destruct the innards in BasicSeq manually
+ // depending on state.
+ ~SeqState() {}
+ // Evaluate the current promise, next promise factory types for this state.
+ // Our callable is the first element of Fs, wrapped in PromiseLike to handle
+ // some common edge cases. The next factory is the second element.
+ using Types = SeqStateTypes<
+ Traits,
+ PromiseLike<typename std::tuple_element<0, std::tuple<Fs...>>::type>,
+ typename std::tuple_element<1, std::tuple<Fs...>>::type>;
+ GPR_NO_UNIQUE_ADDRESS typename Types::Promise current_promise;
+ GPR_NO_UNIQUE_ADDRESS typename Types::Next next_factory;
+};
+
+// Helper to get a specific state index.
+// Calls the prior state, unless it's this state, in which case it returns
+// that.
+template <char I, template <typename> class Traits, char J, typename... Fs>
+struct GetSeqStateInner {
+ static SeqState<Traits, I, Fs...>* f(SeqState<Traits, J, Fs...>* p) {
+ return GetSeqStateInner<I, Traits, J - 1, Fs...>::f(&p->prior);
+ }
+};
+
+template <char I, template <typename> class Traits, typename... Fs>
+struct GetSeqStateInner<I, Traits, I, Fs...> {
+ static SeqState<Traits, I, Fs...>* f(SeqState<Traits, I, Fs...>* p) {
+ return p;
+ }
+};
+
+template <char I, template <typename> class Traits, char J, typename... Fs>
+y_absl::enable_if_t<I <= J, SeqState<Traits, I, Fs...>*> GetSeqState(
+ SeqState<Traits, J, Fs...>* p) {
+ return GetSeqStateInner<I, Traits, J, Fs...>::f(p);
+}
+
+template <template <typename> class Traits, char I, typename... Fs, typename T>
+auto CallNext(SeqState<Traits, I, Fs...>* state, T&& arg) -> decltype(
+ SeqState<Traits, I, Fs...>::Types::PromiseResultTraits::CallFactory(
+ &state->next_factory, std::forward<T>(arg))) {
+ return SeqState<Traits, I, Fs...>::Types::PromiseResultTraits::CallFactory(
+ &state->next_factory, std::forward<T>(arg));
+}
+
+// A sequence under stome traits for some set of callables Fs.
+// Fs[0] should be a promise-like object that yields a value.
+// Fs[1..] should be promise-factory-like objects that take the value from the
+// previous step and yield a promise. Note that most of the machinery in
+// PromiseFactory exists to make it possible for those promise-factory-like
+// objects to be anything that's convenient. Traits defines how we move from one
+// step to the next. Traits sets up the wrapping and escape handling for the
+// sequence. Promises return wrapped values that the trait can inspect and
+// unwrap before passing them to the next element of the sequence. The trait can
+// also interpret a wrapped value as an escape value, which terminates
+// evaluation of the sequence immediately yielding a result. Traits for type T
+// have the members:
+// * type UnwrappedType - the type after removing wrapping from T (i.e. for
+// TrySeq, T=StatusOr<U> yields UnwrappedType=U).
+// * type WrappedType - the type after adding wrapping if it doesn't already
+// exist (i.e. for TrySeq if T is not Status/StatusOr/void, then
+// WrappedType=StatusOr<T>; if T is Status then WrappedType=Status (it's
+// already wrapped!))
+// * template <typename Next> void CallFactory(Next* next_factory, T&& value) -
+// call promise factory next_factory with the result of unwrapping value, and
+// return the resulting promise.
+// * template <typename Result, typename RunNext> Poll<Result>
+// CheckResultAndRunNext(T prior, RunNext run_next) - examine the value of
+// prior, and decide to escape or continue. If escaping, return the final
+// sequence value of type Poll<Result>. If continuing, return the value of
+// run_next(std::move(prior)).
+template <template <typename> class Traits, typename... Fs>
+class BasicSeq {
+ private:
+ // Number of states in the sequence - we'll refer to this some!
+ static constexpr char N = sizeof...(Fs);
+
+ // Current state.
+ static_assert(N < 128, "Long sequence... please revisit BasicSeq");
+ char state_ = 0;
+ // The penultimate state contains all the preceding states too.
+ using PenultimateState = SeqState<Traits, N - 2, Fs...>;
+ // The final state is simply the final promise, which is the next promise from
+ // the penultimate state.
+ using FinalPromise = typename PenultimateState::Types::Next::Promise;
+ union {
+ GPR_NO_UNIQUE_ADDRESS PenultimateState penultimate_state_;
+ GPR_NO_UNIQUE_ADDRESS FinalPromise final_promise_;
+ };
+ using FinalPromiseResult = typename FinalPromise::Result;
+ using Result = typename Traits<FinalPromiseResult>::WrappedType;
+
+ // Get a state by index.
+ template <char I>
+ y_absl::enable_if_t < I<N - 2, SeqState<Traits, I, Fs...>*> state() {
+ return GetSeqState<I>(&penultimate_state_);
+ }
+
+ template <char I>
+ y_absl::enable_if_t<I == N - 2, PenultimateState*> state() {
+ return &penultimate_state_;
+ }
+
+ // Get the next state's promise.
+ template <char I>
+ auto next_promise() -> y_absl::enable_if_t<
+ I != N - 2,
+ decltype(&GetSeqState<I + 1>(static_cast<PenultimateState*>(nullptr))
+ ->current_promise)> {
+ return &GetSeqState<I + 1>(&penultimate_state_)->current_promise;
+ }
+
+ template <char I>
+ y_absl::enable_if_t<I == N - 2, FinalPromise*> next_promise() {
+ return &final_promise_;
+ }
+
+ // Callable to advance the state to the next one after I given the result from
+ // state I.
+ template <char I>
+ struct RunNext {
+ BasicSeq* s;
+ template <typename T>
+ Poll<Result> operator()(T&& value) {
+ auto* prior = s->state<I>();
+ using StateType = y_absl::remove_reference_t<decltype(*prior)>;
+ // Destroy the promise that just completed.
+ Destruct(&prior->current_promise);
+ // Construct the next promise by calling the next promise factory.
+ // We need to ask the traits to do this to deal with value
+ // wrapping/unwrapping.
+ auto n = StateType::Types::PromiseResultTraits::CallFactory(
+ &prior->next_factory, std::forward<T>(value));
+ // Now we also no longer need the factory, so we can destroy that.
+ Destruct(&prior->next_factory);
+ // Constructing the promise for the new state will use the memory
+ // previously occupied by the promise & next factory of the old state.
+ Construct(s->next_promise<I>(), std::move(n));
+ // Store the state counter.
+ s->state_ = I + 1;
+ // Recursively poll the new current state.
+ return s->RunState<I + 1>();
+ }
+ };
+
+ // Poll the current state, advance it if necessary.
+ template <char I>
+ y_absl::enable_if_t<I != N - 1, Poll<Result>> RunState() {
+ // Get a pointer to the state object.
+ auto* s = state<I>();
+ // Poll the current promise in this state.
+ auto r = s->current_promise();
+ // If we are still pending, say so by returning.
+ if (y_absl::holds_alternative<Pending>(r)) {
+ return Pending();
+ }
+ // Current promise is ready, as the traits to do the next thing.
+ // That may be returning - eg if TrySeq sees an error.
+ // Or it may be by calling the callable we hand down - RunNext - which
+ // will advance the state and call the next promise.
+ return Traits<
+ typename y_absl::remove_reference_t<decltype(*s)>::Types::PromiseResult>::
+ template CheckResultAndRunNext<Result>(
+ std::move(y_absl::get<kPollReadyIdx>(std::move(r))),
+ RunNext<I>{this});
+ }
+
+ // Specialization of RunState to run the final state.
+ template <char I>
+ y_absl::enable_if_t<I == N - 1, Poll<Result>> RunState() {
+ // Poll the final promise.
+ auto r = final_promise_();
+ // If we are still pending, say so by returning.
+ if (y_absl::holds_alternative<Pending>(r)) {
+ return Pending();
+ }
+ // We are complete, return the (wrapped) result.
+ return Result(std::move(y_absl::get<kPollReadyIdx>(std::move(r))));
+ }
+
+ // For state numbered I, destruct the current promise and the next promise
+ // factory, and recursively destruct the next promise factories for future
+ // states (since they also still exist).
+ template <char I>
+ y_absl::enable_if_t<I != N - 1, void>
+ DestructCurrentPromiseAndSubsequentFactories() {
+ Destruct(&GetSeqState<I>(&penultimate_state_)->current_promise);
+ DestructSubsequentFactories<I>();
+ }
+
+ template <char I>
+ y_absl::enable_if_t<I == N - 1, void>
+ DestructCurrentPromiseAndSubsequentFactories() {
+ Destruct(&final_promise_);
+ }
+
+ // For state I, destruct the next promise factory, and recursively the next
+ // promise factories after.
+ template <char I>
+ y_absl::enable_if_t<I != N - 1, void> DestructSubsequentFactories() {
+ Destruct(&GetSeqState<I>(&penultimate_state_)->next_factory);
+ DestructSubsequentFactories<I + 1>();
+ }
+
+ template <char I>
+ y_absl::enable_if_t<I == N - 1, void> DestructSubsequentFactories() {}
+
+ // Placate older compilers by wrapping RunState in a struct so that their
+ // parameter unpacking can work.
+ template <char I>
+ struct RunStateStruct {
+ BasicSeq* s;
+ Poll<Result> operator()() { return s->RunState<I>(); }
+ };
+
+ // Similarly placate those compilers for
+ // DestructCurrentPromiseAndSubsequentFactories
+ template <char I>
+ struct DestructCurrentPromiseAndSubsequentFactoriesStruct {
+ BasicSeq* s;
+ void operator()() {
+ return s->DestructCurrentPromiseAndSubsequentFactories<I>();
+ }
+ };
+
+ // Run the current state (and possibly later states if that one finishes).
+ // Single argument is a type that encodes the integer sequence 0, 1, 2, ...,
+ // N-1 as a type, but which uses no memory. This is used to expand out
+ // RunState instances using a template unpack to pass to Switch, which encodes
+ // a switch statement over the various cases. This ultimately gives us a
+ // Duff's device like mechanic for evaluating sequences.
+ template <char... I>
+ Poll<Result> Run(y_absl::integer_sequence<char, I...>) {
+ return Switch<Poll<Result>>(state_, RunStateStruct<I>{this}...);
+ }
+
+ // Run the appropriate destructors for a given state.
+ // Single argument is a type that encodes the integer sequence 0, 1, 2, ...,
+ // N-1 as a type, but which uses no memory. This is used to expand out
+ // DestructCurrentPromiseAndSubsequentFactories instances to pass to Switch,
+ // which can choose the correct instance at runtime to destroy everything.
+ template <char... I>
+ void RunDestruct(y_absl::integer_sequence<char, I...>) {
+ Switch<void>(
+ state_, DestructCurrentPromiseAndSubsequentFactoriesStruct<I>{this}...);
+ }
+
+ public:
+ // Construct a sequence given the callables that will control it.
+ explicit BasicSeq(Fs... fs) : penultimate_state_(std::make_tuple(&fs...)) {}
+ // No assignment... we don't need it (but if we ever find a good case, then
+ // it's ok to implement).
+ BasicSeq& operator=(const BasicSeq&) = delete;
+ // Copy construction - only for state 0.
+ // It's illegal to copy a Promise after polling it - if we are in state>0 we
+ // *must* have been polled.
+ BasicSeq(const BasicSeq& other) {
+ assert(other.state_ == 0);
+ new (&penultimate_state_) PenultimateState(other.penultimate_state_);
+ }
+ // Move construction - only for state 0.
+ // It's illegal to copy a Promise after polling it - if we are in state>0 we
+ // *must* have been polled.
+ BasicSeq(BasicSeq&& other) noexcept {
+ assert(other.state_ == 0);
+ new (&penultimate_state_)
+ PenultimateState(std::move(other.penultimate_state_));
+ }
+ // Destruct based on current state.
+ ~BasicSeq() { RunDestruct(y_absl::make_integer_sequence<char, N>()); }
+
+ // Poll the sequence once.
+ Poll<Result> operator()() {
+ return Run(y_absl::make_integer_sequence<char, N>());
+ }
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_BASIC_SEQ_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/promise_factory.h b/contrib/libs/grpc/src/core/lib/promise/detail/promise_factory.h
new file mode 100644
index 00000000000..60ced6d3724
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/promise_factory.h
@@ -0,0 +1,189 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_FACTORY_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_FACTORY_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+// PromiseFactory is an adaptor class.
+//
+// Where a Promise is a thing that's polled periodically, a PromiseFactory
+// creates a Promise. Within this Promise/Activity framework, PromiseFactory's
+// then provide the edges for computation -- invoked at state transition
+// boundaries to provide the new steady state.
+//
+// A PromiseFactory formally is f(A) -> Promise<T> for some types A & T.
+// This get a bit awkward and inapproprate to write however, and so the type
+// contained herein can adapt various kinds of callable into the correct form.
+// Of course a callable of a single argument returning a Promise will see an
+// identity translation. One taking no arguments and returning a Promise
+// similarly.
+//
+// A Promise passed to a PromiseFactory will yield a PromiseFactory that
+// returns just that Promise.
+//
+// Generalizing slightly, a callable taking a single argument A and returning a
+// Poll<T> will yield a PromiseFactory that captures it's argument A and
+// returns a Poll<T>.
+//
+// Since various consumers of PromiseFactory run either repeatedly through an
+// overarching Promises lifetime, or just once, and we can optimize just once
+// by moving the contents of the PromiseFactory, two factory methods are
+// provided: Once, that can be called just once, and Repeated, that can (wait
+// for it) be called Repeatedly.
+
+namespace grpc_core {
+namespace promise_detail {
+
+// Helper trait: given a T, and T x, is calling x() legal?
+template <typename T, typename Ignored = void>
+struct IsVoidCallable {
+ static constexpr bool value = false;
+};
+template <typename F>
+struct IsVoidCallable<F, y_absl::void_t<decltype(std::declval<F>()())>> {
+ static constexpr bool value = true;
+};
+
+// Given F(A,B,C,...), what's the return type?
+template <typename T, typename Ignored = void>
+struct ResultOfT;
+
+template <typename F, typename... Args>
+struct ResultOfT<F(Args...),
+ y_absl::void_t<decltype(std::declval<RemoveCVRef<F>>()(
+ std::declval<Args>()...))>> {
+ using T = decltype(std::declval<RemoveCVRef<F>>()(std::declval<Args>()...));
+};
+
+template <typename T>
+using ResultOf = typename ResultOfT<T>::T;
+
+// Captures the promise functor and the argument passed.
+// Provides the interface of a promise.
+template <typename F, typename Arg>
+class Curried {
+ public:
+ Curried(F&& f, Arg&& arg)
+ : f_(std::forward<F>(f)), arg_(std::forward<Arg>(arg)) {}
+ Curried(const F& f, Arg&& arg) : f_(f), arg_(std::forward<Arg>(arg)) {}
+ using Result = decltype(std::declval<F>()(std::declval<Arg>()));
+ Result operator()() { return f_(arg_); }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+ GPR_NO_UNIQUE_ADDRESS Arg arg_;
+};
+
+// Promote a callable(A) -> T | Poll<T> to a PromiseFactory(A) -> Promise<T> by
+// capturing A.
+template <typename A, typename F>
+y_absl::enable_if_t<!IsVoidCallable<ResultOf<F(A)>>::value,
+ PromiseLike<Curried<RemoveCVRef<F>, A>>>
+PromiseFactoryImpl(F&& f, A&& arg) {
+ return Curried<RemoveCVRef<F>, A>(std::forward<F>(f), std::forward<A>(arg));
+}
+
+// Promote a callable() -> T|Poll<T> to a PromiseFactory(A) -> Promise<T>
+// by dropping the argument passed to the factory.
+template <typename A, typename F>
+y_absl::enable_if_t<!IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<RemoveCVRef<F>>>
+PromiseFactoryImpl(F f, A&&) {
+ return PromiseLike<F>(std::move(f));
+}
+
+// Promote a callable() -> T|Poll<T> to a PromiseFactory() -> Promise<T>
+template <typename F>
+y_absl::enable_if_t<!IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<RemoveCVRef<F>>>
+PromiseFactoryImpl(F f) {
+ return PromiseLike<F>(std::move(f));
+}
+
+// Given a callable(A) -> Promise<T>, name it a PromiseFactory and use it.
+template <typename A, typename F>
+y_absl::enable_if_t<IsVoidCallable<ResultOf<F(A)>>::value,
+ PromiseLike<decltype(std::declval<F>()(std::declval<A>()))>>
+PromiseFactoryImpl(F&& f, A&& arg) {
+ return f(std::forward<A>(arg));
+}
+
+// Given a callable() -> Promise<T>, promote it to a
+// PromiseFactory(A) -> Promise<T> by dropping the first argument.
+template <typename A, typename F>
+y_absl::enable_if_t<IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<decltype(std::declval<F>()())>>
+PromiseFactoryImpl(F&& f, A&&) {
+ return f();
+}
+
+// Given a callable() -> Promise<T>, name it a PromiseFactory and use it.
+template <typename F>
+y_absl::enable_if_t<IsVoidCallable<ResultOf<F()>>::value,
+ PromiseLike<decltype(std::declval<F>()())>>
+PromiseFactoryImpl(F&& f) {
+ return f();
+};
+
+template <typename A, typename F>
+class PromiseFactory {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ using Arg = A;
+ using Promise =
+ decltype(PromiseFactoryImpl(std::move(f_), std::declval<A>()));
+
+ explicit PromiseFactory(F f) : f_(std::move(f)) {}
+
+ Promise Once(Arg&& a) {
+ return PromiseFactoryImpl(std::move(f_), std::forward<Arg>(a));
+ }
+
+ Promise Repeated(Arg&& a) const {
+ return PromiseFactoryImpl(f_, std::forward<Arg>(a));
+ }
+};
+
+template <typename F>
+class PromiseFactory<void, F> {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ using Arg = void;
+ using Promise = decltype(PromiseFactoryImpl(std::move(f_)));
+
+ explicit PromiseFactory(F f) : f_(std::move(f)) {}
+
+ Promise Once() { return PromiseFactoryImpl(std::move(f_)); }
+
+ Promise Repeated() const { return PromiseFactoryImpl(f_); }
+};
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_FACTORY_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/promise_like.h b/contrib/libs/grpc/src/core/lib/promise/detail/promise_like.h
new file mode 100644
index 00000000000..1b93efac355
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/promise_like.h
@@ -0,0 +1,85 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_LIKE_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_LIKE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "y_absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/poll.h"
+
+// A Promise is a callable object that returns Poll<T> for some T.
+// Often when we're writing code that uses promises, we end up wanting to also
+// deal with code that completes instantaneously - that is, it returns some T
+// where T is not Poll.
+// PromiseLike wraps any callable that takes no parameters and implements the
+// Promise interface. For things that already return Poll, this wrapping does
+// nothing. For things that do not return Poll, we wrap the return type in Poll.
+// This allows us to write things like:
+// Seq(
+// [] { return 42; },
+// ...)
+// in preference to things like:
+// Seq(
+// [] { return Poll<int>(42); },
+// ...)
+// or:
+// Seq(
+// [] -> Poll<int> { return 42; },
+// ...)
+// leading to slightly more concise code and eliminating some rules that in
+// practice people find hard to deal with.
+
+namespace grpc_core {
+namespace promise_detail {
+
+template <typename T>
+struct PollWrapper {
+ static Poll<T> Wrap(T&& x) { return Poll<T>(std::forward<T>(x)); }
+};
+
+template <typename T>
+struct PollWrapper<Poll<T>> {
+ static Poll<T> Wrap(Poll<T>&& x) { return std::forward<Poll<T>>(x); }
+};
+
+template <typename T>
+auto WrapInPoll(T&& x) -> decltype(PollWrapper<T>::Wrap(std::forward<T>(x))) {
+ return PollWrapper<T>::Wrap(std::forward<T>(x));
+}
+
+template <typename F>
+class PromiseLike {
+ private:
+ GPR_NO_UNIQUE_ADDRESS F f_;
+
+ public:
+ // NOLINTNEXTLINE - internal detail that drastically simplifies calling code.
+ PromiseLike(F&& f) : f_(std::forward<F>(f)) {}
+ auto operator()() -> decltype(WrapInPoll(f_())) { return WrapInPoll(f_()); }
+ using Result = typename PollTraits<decltype(WrapInPoll(f_()))>::Type;
+};
+
+// T -> T, const T& -> T
+template <typename T>
+using RemoveCVRef = y_absl::remove_cv_t<y_absl::remove_reference_t<T>>;
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_PROMISE_LIKE_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/status.h b/contrib/libs/grpc/src/core/lib/promise/detail/status.h
new file mode 100644
index 00000000000..4e20ea326a6
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/status.h
@@ -0,0 +1,44 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_STATUS_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_STATUS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "y_absl/status/status.h"
+#include "y_absl/status/statusor.h"
+
+// Helpers for dealing with y_absl::Status/StatusOr generically
+
+namespace grpc_core {
+namespace promise_detail {
+
+// Convert with a move the input status to an y_absl::Status.
+template <typename T>
+y_absl::Status IntoStatus(y_absl::StatusOr<T>* status) {
+ return std::move(status->status());
+}
+
+// Convert with a move the input status to an y_absl::Status.
+inline y_absl::Status IntoStatus(y_absl::Status* status) {
+ return std::move(*status);
+}
+
+} // namespace promise_detail
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_STATUS_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/detail/switch.h b/contrib/libs/grpc/src/core/lib/promise/detail/switch.h
new file mode 100644
index 00000000000..84b119119b0
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/detail/switch.h
@@ -0,0 +1,1455 @@
+/*
+ * Copyright 2021 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Automatically generated by tools/codegen/core/gen_switch.py
+ */
+
+#ifndef GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
+#define GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdlib.h>
+
+namespace grpc_core {
+
+template <typename R, typename F0>
+R Switch(char idx, F0 f0) {
+ switch (idx) {
+ case 0:
+ return f0();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1>
+R Switch(char idx, F0 f0, F1 f1) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2>
+R Switch(char idx, F0 f0, F1 f1, F2 f2) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22,
+ F23 f23) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29, typename F30>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29, F30 f30) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ case 30:
+ return f30();
+ }
+ abort();
+}
+
+template <typename R, typename F0, typename F1, typename F2, typename F3,
+ typename F4, typename F5, typename F6, typename F7, typename F8,
+ typename F9, typename F10, typename F11, typename F12, typename F13,
+ typename F14, typename F15, typename F16, typename F17, typename F18,
+ typename F19, typename F20, typename F21, typename F22, typename F23,
+ typename F24, typename F25, typename F26, typename F27, typename F28,
+ typename F29, typename F30, typename F31>
+R Switch(char idx, F0 f0, F1 f1, F2 f2, F3 f3, F4 f4, F5 f5, F6 f6, F7 f7,
+ F8 f8, F9 f9, F10 f10, F11 f11, F12 f12, F13 f13, F14 f14, F15 f15,
+ F16 f16, F17 f17, F18 f18, F19 f19, F20 f20, F21 f21, F22 f22, F23 f23,
+ F24 f24, F25 f25, F26 f26, F27 f27, F28 f28, F29 f29, F30 f30,
+ F31 f31) {
+ switch (idx) {
+ case 0:
+ return f0();
+ case 1:
+ return f1();
+ case 2:
+ return f2();
+ case 3:
+ return f3();
+ case 4:
+ return f4();
+ case 5:
+ return f5();
+ case 6:
+ return f6();
+ case 7:
+ return f7();
+ case 8:
+ return f8();
+ case 9:
+ return f9();
+ case 10:
+ return f10();
+ case 11:
+ return f11();
+ case 12:
+ return f12();
+ case 13:
+ return f13();
+ case 14:
+ return f14();
+ case 15:
+ return f15();
+ case 16:
+ return f16();
+ case 17:
+ return f17();
+ case 18:
+ return f18();
+ case 19:
+ return f19();
+ case 20:
+ return f20();
+ case 21:
+ return f21();
+ case 22:
+ return f22();
+ case 23:
+ return f23();
+ case 24:
+ return f24();
+ case 25:
+ return f25();
+ case 26:
+ return f26();
+ case 27:
+ return f27();
+ case 28:
+ return f28();
+ case 29:
+ return f29();
+ case 30:
+ return f30();
+ case 31:
+ return f31();
+ }
+ abort();
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_DETAIL_SWITCH_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h b/contrib/libs/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h
new file mode 100644
index 00000000000..168cbcc4ceb
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/exec_ctx_wakeup_scheduler.h
@@ -0,0 +1,48 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
+#define GRPC_CORE_LIB_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/debug_location.h"
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+namespace grpc_core {
+
+// A callback scheduler for activities that works by scheduling callbacks on the
+// exec ctx.
+class ExecCtxWakeupScheduler {
+ public:
+ template <typename ActivityType>
+ void ScheduleWakeup(ActivityType* activity) {
+ GRPC_CLOSURE_INIT(
+ &closure_,
+ [](void* arg, grpc_error_handle) {
+ static_cast<ActivityType*>(arg)->RunScheduledWakeup();
+ },
+ activity, grpc_schedule_on_exec_ctx);
+ ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
+ }
+
+ private:
+ grpc_closure closure_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_EXEC_CTX_WAKEUP_SCHEDULER_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/for_each.h b/contrib/libs/grpc/src/core/lib/promise/for_each.h
new file mode 100644
index 00000000000..b09f5e8493e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/for_each.h
@@ -0,0 +1,140 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_FOR_EACH_H
+#define GRPC_CORE_LIB_PROMISE_FOR_EACH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/status/status.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace for_each_detail {
+
+// Helper function: at the end of each iteration of a for-each loop, this is
+// called. If the iteration failed, return failure. If the iteration succeeded,
+// then call the next iteration.
+template <typename Reader, typename CallPoll>
+Poll<y_absl::Status> FinishIteration(y_absl::Status* r, Reader* reader,
+ CallPoll call_poll) {
+ if (r->ok()) {
+ auto next = reader->Next();
+ return call_poll(next);
+ }
+ return std::move(*r);
+}
+
+// Done creates statuses for the end of the iteration. It's templated on the
+// type of the result of the ForEach loop, so that we can introduce new types
+// easily.
+template <typename T>
+struct Done;
+
+template <>
+struct Done<y_absl::Status> {
+ static y_absl::Status Make() { return y_absl::OkStatus(); }
+};
+
+template <typename Reader, typename Action>
+class ForEach {
+ private:
+ using ReaderNext = decltype(std::declval<Reader>().Next());
+ using ReaderResult = typename PollTraits<decltype(
+ std::declval<ReaderNext>()())>::Type::value_type;
+ using ActionFactory = promise_detail::PromiseFactory<ReaderResult, Action>;
+ using ActionPromise = typename ActionFactory::Promise;
+
+ public:
+ using Result =
+ typename PollTraits<decltype(std::declval<ActionPromise>()())>::Type;
+ ForEach(Reader reader, Action action)
+ : reader_(std::move(reader)),
+ action_factory_(std::move(action)),
+ state_(reader_.Next()) {}
+
+ ForEach(const ForEach&) = delete;
+ ForEach& operator=(const ForEach&) = delete;
+ // noexcept causes compiler errors on older gcc's
+ // NOLINTNEXTLINE(performance-noexcept-move-constructor)
+ ForEach(ForEach&&) = default;
+ // noexcept causes compiler errors on older gcc's
+ // NOLINTNEXTLINE(performance-noexcept-move-constructor)
+ ForEach& operator=(ForEach&&) = default;
+
+ Poll<Result> operator()() {
+ return y_absl::visit(CallPoll<false>{this}, state_);
+ }
+
+ private:
+ Reader reader_;
+ ActionFactory action_factory_;
+ y_absl::variant<ReaderNext, ActionPromise> state_;
+
+ // Call the inner poll function, and if it's finished, start the next
+ // iteration. If kSetState==true, also set the current state in self->state_.
+ // We omit that on the first iteration because it's common to poll once and
+ // not change state, which saves us some work.
+ template <bool kSetState>
+ struct CallPoll {
+ ForEach* const self;
+
+ Poll<Result> operator()(ReaderNext& reader_next) {
+ auto r = reader_next();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ if (p->has_value()) {
+ auto action = self->action_factory_.Repeated(std::move(**p));
+ return CallPoll<true>{self}(action);
+ } else {
+ return Done<Result>::Make();
+ }
+ }
+ if (kSetState) {
+ self->state_.template emplace<ReaderNext>(std::move(reader_next));
+ }
+ return Pending();
+ }
+
+ Poll<Result> operator()(ActionPromise& promise) {
+ auto r = promise();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ return FinishIteration(p, &self->reader_, CallPoll<true>{self});
+ }
+ if (kSetState) {
+ self->state_.template emplace<ActionPromise>(std::move(promise));
+ }
+ return Pending();
+ }
+ };
+};
+
+} // namespace for_each_detail
+
+/// For each item acquired by calling Reader::Next, run the promise Action.
+template <typename Reader, typename Action>
+for_each_detail::ForEach<Reader, Action> ForEach(Reader reader, Action action) {
+ return for_each_detail::ForEach<Reader, Action>(std::move(reader),
+ std::move(action));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_FOR_EACH_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/if.h b/contrib/libs/grpc/src/core/lib/promise/if.h
new file mode 100644
index 00000000000..475f1c60e91
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/if.h
@@ -0,0 +1,134 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_IF_H
+#define GRPC_CORE_LIB_PROMISE_IF_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+
+#include "y_absl/status/statusor.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename CallPoll, typename T, typename F>
+typename CallPoll::PollResult ChooseIf(CallPoll call_poll, bool result,
+ T* if_true, F* if_false) {
+ if (result) {
+ auto promise = if_true->Once();
+ return call_poll(promise);
+ } else {
+ auto promise = if_false->Once();
+ return call_poll(promise);
+ }
+}
+
+template <typename CallPoll, typename T, typename F>
+typename CallPoll::PollResult ChooseIf(CallPoll call_poll,
+ y_absl::StatusOr<bool> result, T* if_true,
+ F* if_false) {
+ if (!result.ok()) {
+ return typename CallPoll::PollResult(result.status());
+ } else if (*result) {
+ auto promise = if_true->Once();
+ return call_poll(promise);
+ } else {
+ auto promise = if_false->Once();
+ return call_poll(promise);
+ }
+}
+
+template <typename C, typename T, typename F>
+class If {
+ private:
+ using TrueFactory = promise_detail::PromiseFactory<void, T>;
+ using FalseFactory = promise_detail::PromiseFactory<void, F>;
+ using ConditionPromise = PromiseLike<C>;
+ using TruePromise = typename TrueFactory::Promise;
+ using FalsePromise = typename FalseFactory::Promise;
+ using Result =
+ typename PollTraits<decltype(std::declval<TruePromise>()())>::Type;
+
+ public:
+ If(C condition, T if_true, F if_false)
+ : state_(Evaluating{ConditionPromise(std::move(condition)),
+ TrueFactory(std::move(if_true)),
+ FalseFactory(std::move(if_false))}) {}
+
+ Poll<Result> operator()() {
+ return y_absl::visit(CallPoll<false>{this}, state_);
+ }
+
+ private:
+ struct Evaluating {
+ ConditionPromise condition;
+ TrueFactory if_true;
+ FalseFactory if_false;
+ };
+ using State = y_absl::variant<Evaluating, TruePromise, FalsePromise>;
+ State state_;
+
+ template <bool kSetState>
+ struct CallPoll {
+ using PollResult = Poll<Result>;
+
+ If* const self;
+
+ PollResult operator()(Evaluating& evaluating) const {
+ static_assert(
+ !kSetState,
+ "shouldn't need to set state coming through the initial branch");
+ auto r = evaluating.condition();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ return ChooseIf(CallPoll<true>{self}, std::move(*p),
+ &evaluating.if_true, &evaluating.if_false);
+ }
+ return Pending();
+ }
+
+ template <class Promise>
+ PollResult operator()(Promise& promise) const {
+ auto r = promise();
+ if (kSetState && y_absl::holds_alternative<Pending>(r)) {
+ self->state_.template emplace<Promise>(std::move(promise));
+ }
+ return r;
+ }
+ };
+};
+
+} // namespace promise_detail
+
+// If promise combinator.
+// Takes 3 promise factories, and evaluates the first.
+// If it returns failure, returns failure for the entire combinator.
+// If it returns true, evaluates the second promise.
+// If it returns false, evaluates the third promise.
+template <typename C, typename T, typename F>
+promise_detail::If<C, T, F> If(C condition, T if_true, F if_false) {
+ return promise_detail::If<C, T, F>(std::move(condition), std::move(if_true),
+ std::move(if_false));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_IF_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h b/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h
new file mode 100644
index 00000000000..889323bf3ec
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/intra_activity_waiter.h
@@ -0,0 +1,49 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H
+#define GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Helper type to track wakeups between objects in the same activity.
+// Can be fairly fast as no ref counting or locking needs to occur.
+class IntraActivityWaiter {
+ public:
+ // Register for wakeup, return Pending(). If state is not ready to proceed,
+ // Promises should bottom out here.
+ Pending pending() {
+ waiting_ = true;
+ return Pending();
+ }
+ // Wake the activity
+ void Wake() {
+ if (waiting_) {
+ waiting_ = false;
+ Activity::WakeupCurrent();
+ }
+ }
+
+ private:
+ bool waiting_ = false;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_INTRA_ACTIVITY_WAITER_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/join.h b/contrib/libs/grpc/src/core/lib/promise/join.h
new file mode 100644
index 00000000000..35331874ee4
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/join.h
@@ -0,0 +1,55 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/meta/type_traits.h"
+
+#include "src/core/lib/promise/detail/basic_join.h"
+
+namespace grpc_core {
+namespace promise_detail {
+
+struct JoinTraits {
+ template <typename T>
+ using ResultType = y_absl::remove_reference_t<T>;
+ template <typename T, typename F>
+ static auto OnResult(T result, F kontinue)
+ -> decltype(kontinue(std::move(result))) {
+ return kontinue(std::move(result));
+ }
+ template <typename T>
+ static T Wrap(T x) {
+ return x;
+ }
+};
+
+template <typename... Promises>
+using Join = BasicJoin<JoinTraits, Promises...>;
+
+} // namespace promise_detail
+
+/// Combinator to run all promises to completion, and return a tuple
+/// of their results.
+template <typename... Promise>
+promise_detail::Join<Promise...> Join(Promise... promises) {
+ return promise_detail::Join<Promise...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_JOIN_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/latch.h b/contrib/libs/grpc/src/core/lib/promise/latch.h
new file mode 100644
index 00000000000..b97b186b40e
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/latch.h
@@ -0,0 +1,104 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_LATCH_H
+#define GRPC_CORE_LIB_PROMISE_LATCH_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/intra_activity_waiter.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Latch provides a single set waitable object.
+// Initially the Latch is unset.
+// It can be waited upon by the Wait method, which produces a Promise that
+// resolves when the Latch is Set to a value of type T.
+template <typename T>
+class Latch {
+ public:
+ // This is the type of the promise returned by Wait.
+ class WaitPromise {
+ public:
+ Poll<T*> operator()() const {
+ if (latch_->has_value_) {
+ return &latch_->value_;
+ } else {
+ return latch_->waiter_.pending();
+ }
+ }
+
+ private:
+ friend class Latch;
+ explicit WaitPromise(Latch* latch) : latch_(latch) {}
+ Latch* latch_;
+ };
+
+ Latch() = default;
+ Latch(const Latch&) = delete;
+ Latch& operator=(const Latch&) = delete;
+ Latch(Latch&& other) noexcept
+ : value_(std::move(other.value_)), has_value_(other.has_value_) {
+#ifndef NDEBUG
+ GPR_DEBUG_ASSERT(!other.has_had_waiters_);
+#endif
+ }
+ Latch& operator=(Latch&& other) noexcept {
+#ifndef NDEBUG
+ GPR_DEBUG_ASSERT(!other.has_had_waiters_);
+#endif
+ value_ = std::move(other.value_);
+ has_value_ = other.has_value_;
+ return *this;
+ }
+
+ // Produce a promise to wait for a value from this latch.
+ WaitPromise Wait() {
+#ifndef NDEBUG
+ has_had_waiters_ = true;
+#endif
+ return WaitPromise(this);
+ }
+
+ // Set the value of the latch. Can only be called once.
+ void Set(T value) {
+ GPR_DEBUG_ASSERT(!has_value_);
+ value_ = std::move(value);
+ has_value_ = true;
+ waiter_.Wake();
+ }
+
+ private:
+ // The value stored (if has_value_ is true), otherwise some random value, we
+ // don't care.
+ // Why not y_absl::optional<>? Writing things this way lets us compress
+ // has_value_ with waiter_ and leads to some significant memory savings for
+ // some scenarios.
+ GPR_NO_UNIQUE_ADDRESS T value_;
+ // True if we have a value set, false otherwise.
+ bool has_value_ = false;
+#ifndef NDEBUG
+ // Has this latch ever had waiters.
+ bool has_had_waiters_ = false;
+#endif
+ IntraActivityWaiter waiter_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_LATCH_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/loop.h b/contrib/libs/grpc/src/core/lib/promise/loop.h
new file mode 100644
index 00000000000..f3e06a19a09
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/loop.h
@@ -0,0 +1,108 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_LOOP_H
+#define GRPC_CORE_LIB_PROMISE_LOOP_H
+
+#include <grpc/support/port_platform.h>
+
+#include <new>
+#include <type_traits>
+
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Special type - signals to loop to take another iteration, instead of
+// finishing
+struct Continue {};
+
+// Result of polling a loop promise - either Continue looping, or return a value
+// T
+template <typename T>
+using LoopCtl = y_absl::variant<Continue, T>;
+
+namespace promise_detail {
+
+template <typename T>
+struct LoopTraits;
+
+template <typename T>
+struct LoopTraits<LoopCtl<T>> {
+ using Result = T;
+};
+
+template <typename F>
+class Loop {
+ private:
+ using Factory = promise_detail::PromiseFactory<void, F>;
+ using Promise = decltype(std::declval<Factory>().Repeated());
+ using PromiseResult = typename Promise::Result;
+
+ public:
+ using Result = typename LoopTraits<PromiseResult>::Result;
+
+ explicit Loop(F f) : factory_(std::move(f)), promise_(factory_.Repeated()) {}
+ ~Loop() { promise_.~Promise(); }
+
+ Loop(Loop&& loop) noexcept
+ : factory_(std::move(loop.factory_)),
+ promise_(std::move(loop.promise_)) {}
+
+ Loop(const Loop& loop) = delete;
+ Loop& operator=(const Loop& loop) = delete;
+
+ Poll<Result> operator()() {
+ while (true) {
+ // Poll the inner promise.
+ auto promise_result = promise_();
+ // If it returns a value:
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&promise_result)) {
+ // - then if it's Continue, destroy the promise and recreate a new one
+ // from our factory.
+ if (y_absl::holds_alternative<Continue>(*p)) {
+ promise_.~Promise();
+ new (&promise_) Promise(factory_.Repeated());
+ continue;
+ }
+ // - otherwise there's our result... return it out.
+ return y_absl::get<Result>(*p);
+ } else {
+ // Otherwise the inner promise was pending, so we are pending.
+ return Pending();
+ }
+ }
+ }
+
+ private:
+ GPR_NO_UNIQUE_ADDRESS Factory factory_;
+ GPR_NO_UNIQUE_ADDRESS union { GPR_NO_UNIQUE_ADDRESS Promise promise_; };
+};
+
+} // namespace promise_detail
+
+// Looping combinator.
+// Expects F returns LoopCtl<T> - if it's Continue, then run the loop again -
+// otherwise yield the returned value as the result of the loop.
+template <typename F>
+promise_detail::Loop<F> Loop(F f) {
+ return promise_detail::Loop<F>(std::move(f));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_LOOP_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/map.h b/contrib/libs/grpc/src/core/lib/promise/map.h
new file mode 100644
index 00000000000..065cc73a690
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/map.h
@@ -0,0 +1,88 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_MAP_H
+#define GRPC_CORE_LIB_PROMISE_MAP_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include <tuple>
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Implementation of mapping combinator - use this via the free function below!
+// Promise is the type of promise to poll on, Fn is a function that takes the
+// result of Promise and maps it to some new type.
+template <typename Promise, typename Fn>
+class Map {
+ public:
+ Map(Promise promise, Fn fn)
+ : promise_(std::move(promise)), fn_(std::move(fn)) {}
+
+ using PromiseResult = typename PromiseLike<Promise>::Result;
+ using Result =
+ RemoveCVRef<decltype(std::declval<Fn>()(std::declval<PromiseResult>()))>;
+
+ Poll<Result> operator()() {
+ Poll<PromiseResult> r = promise_();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ return fn_(std::move(*p));
+ }
+ return Pending();
+ }
+
+ private:
+ PromiseLike<Promise> promise_;
+ Fn fn_;
+};
+
+} // namespace promise_detail
+
+// Mapping combinator.
+// Takes a promise, and a synchronous function to mutate its result, and
+// returns a promise.
+template <typename Promise, typename Fn>
+promise_detail::Map<Promise, Fn> Map(Promise promise, Fn fn) {
+ return promise_detail::Map<Promise, Fn>(std::move(promise), std::move(fn));
+}
+
+// Callable that takes a tuple and returns one element
+template <size_t kElem>
+struct JustElem {
+ template <typename... A>
+ auto operator()(std::tuple<A...>&& t) const
+ -> decltype(std::get<kElem>(std::forward<std::tuple<A...>>(t))) {
+ return std::get<kElem>(std::forward<std::tuple<A...>>(t));
+ }
+ template <typename... A>
+ auto operator()(const std::tuple<A...>& t) const
+ -> decltype(std::get<kElem>(t)) {
+ return std::get<kElem>(t);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_MAP_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/observable.h b/contrib/libs/grpc/src/core/lib/promise/observable.h
new file mode 100644
index 00000000000..d99dedb745f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/observable.h
@@ -0,0 +1,295 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_OBSERVABLE_H
+#define GRPC_CORE_LIB_PROMISE_OBSERVABLE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdint.h>
+
+#include <limits>
+#include <memory>
+#include <type_traits>
+
+#include "y_absl/base/thread_annotations.h"
+#include "y_absl/synchronization/mutex.h"
+#include "y_absl/types/optional.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+#include "src/core/lib/promise/wait_set.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+using ObservableVersion = uint64_t;
+static constexpr ObservableVersion kTombstoneVersion =
+ std::numeric_limits<ObservableVersion>::max();
+
+} // namespace promise_detail
+
+class WatchCommitter {
+ public:
+ void Commit() { version_seen_ = promise_detail::kTombstoneVersion; }
+
+ protected:
+ promise_detail::ObservableVersion version_seen_ = 0;
+};
+
+namespace promise_detail {
+
+// Shared state between Observable and Observer.
+template <typename T>
+class ObservableState {
+ public:
+ explicit ObservableState(y_absl::optional<T> value)
+ : value_(std::move(value)) {}
+
+ // Publish that we're closed.
+ void Close() {
+ mu_.Lock();
+ version_ = kTombstoneVersion;
+ value_.reset();
+ auto wakeup = waiters_.TakeWakeupSet();
+ mu_.Unlock();
+ wakeup.Wakeup();
+ }
+
+ // Synchronously publish a new value, and wake any waiters.
+ void Push(T value) {
+ mu_.Lock();
+ version_++;
+ value_ = std::move(value);
+ auto wakeup = waiters_.TakeWakeupSet();
+ mu_.Unlock();
+ wakeup.Wakeup();
+ }
+
+ Poll<y_absl::optional<T>> PollGet(ObservableVersion* version_seen) {
+ y_absl::MutexLock lock(&mu_);
+ if (!Started()) return Pending();
+ *version_seen = version_;
+ return value_;
+ }
+
+ Poll<y_absl::optional<T>> PollNext(ObservableVersion* version_seen) {
+ y_absl::MutexLock lock(&mu_);
+ if (!NextValueReady(version_seen)) return Pending();
+ return value_;
+ }
+
+ Poll<y_absl::optional<T>> PollWatch(ObservableVersion* version_seen) {
+ if (*version_seen == kTombstoneVersion) return Pending();
+
+ y_absl::MutexLock lock(&mu_);
+ if (!NextValueReady(version_seen)) return Pending();
+ // Watch needs to be woken up if the value changes even if it's ready now.
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return value_;
+ }
+
+ private:
+ // Returns true if an initial value is set.
+ // If one is not set, add ourselves as pending to waiters_, and return false.
+ bool Started() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ if (!value_.has_value()) {
+ if (version_ != kTombstoneVersion) {
+ // We allow initial no-value, which does not indicate closure.
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return false;
+ }
+ }
+ return true;
+ }
+
+ // If no value is ready, add ourselves as pending to waiters_ and return
+ // false.
+ // If the next value is ready, update the last version seen and return true.
+ bool NextValueReady(ObservableVersion* version_seen)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) {
+ if (!Started()) return false;
+ if (version_ == *version_seen) {
+ waiters_.AddPending(Activity::current()->MakeNonOwningWaker());
+ return false;
+ }
+ *version_seen = version_;
+ return true;
+ }
+
+ y_absl::Mutex mu_;
+ WaitSet waiters_ Y_ABSL_GUARDED_BY(mu_);
+ ObservableVersion version_ Y_ABSL_GUARDED_BY(mu_) = 1;
+ y_absl::optional<T> value_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// Promise implementation for Observer::Get.
+template <typename T>
+class ObservableGet {
+ public:
+ ObservableGet(ObservableVersion* version_seen, ObservableState<T>* state)
+ : version_seen_(version_seen), state_(state) {}
+
+ Poll<y_absl::optional<T>> operator()() {
+ return state_->PollGet(version_seen_);
+ }
+
+ private:
+ ObservableVersion* version_seen_;
+ ObservableState<T>* state_;
+};
+
+// Promise implementation for Observer::Next.
+template <typename T>
+class ObservableNext {
+ public:
+ ObservableNext(ObservableVersion* version_seen, ObservableState<T>* state)
+ : version_seen_(version_seen), state_(state) {}
+
+ Poll<y_absl::optional<T>> operator()() {
+ return state_->PollNext(version_seen_);
+ }
+
+ private:
+ ObservableVersion* version_seen_;
+ ObservableState<T>* state_;
+};
+
+template <typename T, typename F>
+class ObservableWatch final : private WatchCommitter {
+ private:
+ using Promise = PromiseLike<decltype(
+ std::declval<F>()(std::declval<T>(), std::declval<WatchCommitter*>()))>;
+ using Result = typename Promise::Result;
+
+ public:
+ explicit ObservableWatch(F factory, std::shared_ptr<ObservableState<T>> state)
+ : state_(std::move(state)), factory_(std::move(factory)) {}
+ ObservableWatch(const ObservableWatch&) = delete;
+ ObservableWatch& operator=(const ObservableWatch&) = delete;
+ ObservableWatch(ObservableWatch&& other) noexcept
+ : state_(std::move(other.state_)),
+ promise_(std::move(other.promise_)),
+ factory_(std::move(other.factory_)) {}
+ ObservableWatch& operator=(ObservableWatch&&) noexcept = default;
+
+ Poll<Result> operator()() {
+ auto r = state_->PollWatch(&version_seen_);
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ if (p->has_value()) {
+ promise_ = Promise(factory_(std::move(**p), this));
+ } else {
+ promise_ = {};
+ }
+ }
+ if (promise_.has_value()) {
+ return (*promise_)();
+ } else {
+ return Pending();
+ }
+ }
+
+ private:
+ std::shared_ptr<ObservableState<T>> state_;
+ y_absl::optional<Promise> promise_;
+ F factory_;
+};
+
+} // namespace promise_detail
+
+template <typename T>
+class Observable;
+
+// Observer watches an Observable for updates.
+// It can see either the latest value or wait for a new value, but is not
+// guaranteed to see every value pushed to the Observable.
+template <typename T>
+class Observer {
+ public:
+ Observer(const Observer&) = delete;
+ Observer& operator=(const Observer&) = delete;
+ Observer(Observer&& other) noexcept
+ : version_seen_(other.version_seen_), state_(std::move(other.state_)) {}
+ Observer& operator=(Observer&& other) noexcept {
+ version_seen_ = other.version_seen_;
+ state_ = std::move(other.state_);
+ return *this;
+ }
+
+ // Return a promise that will produce an optional<T>.
+ // If the Observable is still present, this will be a value T, but if the
+ // Observable has been closed, this will be nullopt. Borrows data from the
+ // Observer, so this value must stay valid until the promise is resolved. Only
+ // one Next, Get call is allowed to be outstanding at a time.
+ promise_detail::ObservableGet<T> Get() {
+ return promise_detail::ObservableGet<T>{&version_seen_, &*state_};
+ }
+
+ // Return a promise that will produce the next unseen value as an optional<T>.
+ // If the Observable is still present, this will be a value T, but if the
+ // Observable has been closed, this will be nullopt. Borrows data from the
+ // Observer, so this value must stay valid until the promise is resolved. Only
+ // one Next, Get call is allowed to be outstanding at a time.
+ promise_detail::ObservableNext<T> Next() {
+ return promise_detail::ObservableNext<T>{&version_seen_, &*state_};
+ }
+
+ private:
+ using State = promise_detail::ObservableState<T>;
+ friend class Observable<T>;
+ explicit Observer(std::shared_ptr<State> state) : state_(state) {}
+ promise_detail::ObservableVersion version_seen_ = 0;
+ std::shared_ptr<State> state_;
+};
+
+// Observable models a single writer multiple reader broadcast channel.
+// Readers can observe the latest value, or await a new latest value, but they
+// are not guaranteed to observe every value.
+template <typename T>
+class Observable {
+ public:
+ Observable() : state_(std::make_shared<State>(y_absl::nullopt)) {}
+ explicit Observable(T value)
+ : state_(std::make_shared<State>(std::move(value))) {}
+ ~Observable() { state_->Close(); }
+ Observable(const Observable&) = delete;
+ Observable& operator=(const Observable&) = delete;
+
+ // Push a new value into the observable.
+ void Push(T value) { state_->Push(std::move(value)); }
+
+ // Create a new Observer - which can pull the current state from this
+ // Observable.
+ Observer<T> MakeObserver() { return Observer<T>(state_); }
+
+ // Create a new Watch - a promise that pushes state into the passed in promise
+ // factory. The promise factory takes two parameters - the current value and a
+ // commit token. If the commit token is used (the Commit function on it is
+ // called), then no further Watch updates are provided.
+ template <typename F>
+ promise_detail::ObservableWatch<T, F> Watch(F f) {
+ return promise_detail::ObservableWatch<T, F>(std::move(f), state_);
+ }
+
+ private:
+ using State = promise_detail::ObservableState<T>;
+ std::shared_ptr<State> state_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_OBSERVABLE_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/pipe.h b/contrib/libs/grpc/src/core/lib/promise/pipe.h
new file mode 100644
index 00000000000..2600ef49e5b
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/pipe.h
@@ -0,0 +1,599 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_PIPE_H
+#define GRPC_CORE_LIB_PROMISE_PIPE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include <new>
+#include <type_traits>
+#include <utility>
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/status/status.h"
+#include "y_absl/status/statusor.h"
+#include "y_absl/types/optional.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/detail/promise_factory.h"
+#include "src/core/lib/promise/intra_activity_waiter.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+template <typename T>
+struct Pipe;
+template <typename T>
+class PipeSender;
+template <typename T>
+class PipeReceiver;
+
+namespace pipe_detail {
+
+template <typename T>
+class Push;
+template <typename T>
+class Next;
+
+template <class T>
+class Promise {
+ public:
+ virtual Poll<bool> Step(T* output) = 0;
+ virtual void Stop() = 0;
+
+ protected:
+ inline virtual ~Promise() = default;
+};
+
+struct alignas(alignof(void*)) Scratch {
+ uint8_t scratch[32];
+};
+
+template <typename T>
+class FilterInterface {
+ public:
+ FilterInterface() = default;
+ FilterInterface(const FilterInterface&) = delete;
+ FilterInterface& operator=(const FilterInterface&) = delete;
+ virtual Promise<T>* Step(T* p, Scratch* scratch_space) = 0;
+ virtual void UpdateReceiver(PipeReceiver<T>* receiver) = 0;
+
+ protected:
+ inline virtual ~FilterInterface() {}
+ static void SetReceiverIndex(PipeReceiver<T>* receiver, int idx,
+ FilterInterface* p);
+ char AllocIndex(PipeReceiver<T>* receiver);
+};
+
+template <typename T, typename F>
+class Filter;
+
+} // namespace pipe_detail
+
+// Send end of a Pipe.
+template <typename T>
+class PipeSender {
+ public:
+ PipeSender(const PipeSender&) = delete;
+ PipeSender& operator=(const PipeSender&) = delete;
+
+ PipeSender(PipeSender&& other) noexcept
+ : receiver_(other.receiver_), push_(other.push_) {
+ if (receiver_ != nullptr) {
+ receiver_->sender_ = this;
+ other.receiver_ = nullptr;
+ }
+ if (push_ != nullptr) {
+ push_->sender_ = this;
+ other.push_ = nullptr;
+ }
+ }
+ PipeSender& operator=(PipeSender&& other) noexcept {
+ if (receiver_ != nullptr) {
+ receiver_->sender_ = nullptr;
+ }
+ if (push_ != nullptr) {
+ push_->sender_ = nullptr;
+ }
+ receiver_ = other.receiver_;
+ if (receiver_ != nullptr) {
+ receiver_->sender_ = this;
+ other.receiver_ = nullptr;
+ }
+ if (push_ != nullptr) {
+ push_->sender_ = this;
+ other.push_ = nullptr;
+ }
+ return *this;
+ }
+
+ ~PipeSender() {
+ if (receiver_ != nullptr) {
+ receiver_->MarkClosed();
+ }
+ if (push_ != nullptr) {
+ push_->sender_ = nullptr;
+ }
+ }
+
+ // Send a single message along the pipe.
+ // Returns a promise that will resolve to a bool - true if the message was
+ // sent, false if it could never be sent. Blocks the promise until the
+ // receiver is either closed or able to receive another message.
+ pipe_detail::Push<T> Push(T value);
+
+ // Attach a promise factory based filter to this pipe.
+ // The overall promise returned from this will be active until the pipe is
+ // closed. If this promise is cancelled before the pipe is closed, the pipe
+ // will close. The filter will be run _after_ any other registered filters.
+ template <typename F>
+ pipe_detail::Filter<T, F> Filter(F f);
+
+ private:
+ friend struct Pipe<T>;
+ friend class PipeReceiver<T>;
+ friend class pipe_detail::Next<T>;
+ friend class pipe_detail::Push<T>;
+ explicit PipeSender(PipeReceiver<T>* receiver) : receiver_(receiver) {}
+ PipeReceiver<T>* receiver_;
+ pipe_detail::Push<T>* push_ = nullptr;
+};
+
+// Receive end of a Pipe.
+template <typename T>
+class PipeReceiver {
+ public:
+ PipeReceiver(const PipeReceiver&) = delete;
+ PipeReceiver& operator=(const PipeReceiver&) = delete;
+
+ PipeReceiver(PipeReceiver&& other) noexcept
+ : sender_(other.sender_),
+ next_(other.next_),
+ filters_(std::move(other.filters_)),
+ pending_(std::move(other.pending_)),
+ waiting_to_send_(std::move(other.waiting_to_send_)),
+ waiting_to_receive_(other.waiting_to_receive_) {
+ if (sender_ != nullptr) {
+ sender_->receiver_ = this;
+ other.sender_ = nullptr;
+ }
+ if (next_ != nullptr) {
+ next_->receiver_ = this;
+ other.next_ = nullptr;
+ }
+ for (auto filter : filters_) {
+ filter->UpdateReceiver(this);
+ }
+ }
+ PipeReceiver& operator=(PipeReceiver&& other) noexcept {
+ if (sender_ != nullptr) {
+ sender_->receiver_ = nullptr;
+ }
+ if (next_ != nullptr) {
+ next_->receiver_ = nullptr;
+ }
+ sender_ = other.sender_;
+ next_ = other.next_;
+ filters_ = std::move(other.filters_);
+ for (auto filter : filters_) {
+ filter->UpdateReceiver(this);
+ }
+ pending_ = std::move(other.pending_);
+ waiting_to_send_ = std::move(other.waiting_to_send_);
+ waiting_to_receive_ = std::move(other.waiting_to_receive_);
+ if (sender_ != nullptr) {
+ sender_->receiver_ = this;
+ other.sender_ = nullptr;
+ }
+ if (next_ != nullptr) {
+ next_->receiver_ = this;
+ other.next_ = nullptr;
+ }
+ return *this;
+ }
+ ~PipeReceiver() {
+ MarkClosed();
+ if (next_ != nullptr) {
+ next_->receiver_ = nullptr;
+ }
+ }
+
+ // Receive a single message from the pipe.
+ // Returns a promise that will resolve to an optional<T> - with a value if a
+ // message was received, or no value if the other end of the pipe was closed.
+ // Blocks the promise until the receiver is either closed or a message is
+ // available.
+ pipe_detail::Next<T> Next();
+
+ // Attach a promise factory based filter to this pipe.
+ // The overall promise returned from this will be active until the pipe is
+ // closed. If this promise is cancelled before the pipe is closed, the pipe
+ // will close. The filter will be run _after_ any other registered filters.
+ template <typename F>
+ pipe_detail::Filter<T, F> Filter(F f);
+
+ private:
+ friend struct Pipe<T>;
+ friend class PipeSender<T>;
+ friend class pipe_detail::Next<T>;
+ friend class pipe_detail::Push<T>;
+ friend class pipe_detail::FilterInterface<T>;
+ explicit PipeReceiver(PipeSender<T>* sender) : sender_(sender) {}
+ PipeSender<T>* sender_;
+ pipe_detail::Next<T>* next_ = nullptr;
+ y_absl::InlinedVector<pipe_detail::FilterInterface<T>*, 12> filters_;
+ y_absl::optional<T> pending_;
+ IntraActivityWaiter waiting_to_send_;
+ IntraActivityWaiter waiting_to_receive_;
+
+ void MarkClosed() {
+ if (sender_ == nullptr) {
+ return;
+ }
+
+ sender_->receiver_ = nullptr;
+
+ waiting_to_receive_.Wake();
+ waiting_to_send_.Wake();
+ sender_ = nullptr;
+
+ for (auto* filter : filters_) {
+ if (filter != nullptr) {
+ filter->UpdateReceiver(nullptr);
+ }
+ }
+ }
+};
+
+namespace pipe_detail {
+
+// Implementation of PipeSender::Push promise.
+template <typename T>
+class Push {
+ public:
+ Push(const Push&) = delete;
+ Push& operator=(const Push&) = delete;
+ Push(Push&& other) noexcept
+ : sender_(other.sender_), push_(std::move(other.push_)) {
+ if (sender_ != nullptr) {
+ sender_->push_ = this;
+ other.sender_ = nullptr;
+ }
+ }
+ Push& operator=(Push&& other) noexcept {
+ if (sender_ != nullptr) {
+ sender_->push_ = nullptr;
+ }
+ sender_ = other.sender_;
+ push_ = std::move(other.push_);
+ if (sender_ != nullptr) {
+ sender_->push_ = this;
+ other.sender_ = nullptr;
+ }
+ return *this;
+ }
+
+ ~Push() {
+ if (sender_ != nullptr) {
+ assert(sender_->push_ == this);
+ sender_->push_ = nullptr;
+ }
+ }
+
+ Poll<bool> operator()() {
+ auto* receiver = sender_->receiver_;
+ if (receiver == nullptr) {
+ return false;
+ }
+ if (receiver->pending_.has_value()) {
+ return receiver->waiting_to_send_.pending();
+ }
+ receiver->pending_ = std::move(push_);
+ receiver->waiting_to_receive_.Wake();
+ sender_->push_ = nullptr;
+ sender_ = nullptr;
+ return true;
+ }
+
+ private:
+ friend class PipeSender<T>;
+ Push(PipeSender<T>* sender, T push)
+ : sender_(sender), push_(std::move(push)) {
+ assert(sender_->push_ == nullptr);
+ sender_->push_ = this;
+ }
+ PipeSender<T>* sender_;
+ T push_;
+};
+
+// Implementation of PipeReceiver::Next promise.
+template <typename T>
+class Next {
+ public:
+ Next(const Next&) = delete;
+ Next& operator=(const Next&) = delete;
+ Next(Next&& other) noexcept
+ : receiver_(other.receiver_),
+ next_filter_(other.next_filter_),
+ current_promise_(nullptr) {
+ assert(other.current_promise_ == nullptr);
+ if (receiver_ != nullptr) {
+ receiver_->next_ = this;
+ other.receiver_ = nullptr;
+ }
+ }
+ Next& operator=(Next&& other) noexcept {
+ assert(current_promise_ == nullptr);
+ assert(other.current_promise_ == nullptr);
+ if (receiver_ != nullptr) {
+ receiver_->next_ = nullptr;
+ }
+ receiver_ = other.receiver_;
+ next_filter_ = other.next_filter_;
+ if (receiver_ != nullptr) {
+ receiver_->next_ = this;
+ other.receiver_ = nullptr;
+ }
+ return *this;
+ }
+
+ ~Next() {
+ if (receiver_ != nullptr) {
+ assert(receiver_->next_ == this);
+ receiver_->next_ = nullptr;
+ }
+ if (current_promise_ != nullptr) {
+ current_promise_->Stop();
+ }
+ }
+
+ Poll<y_absl::optional<T>> operator()() {
+ if (receiver_->pending_.has_value()) {
+ auto* pending = &*receiver_->pending_;
+ if (current_promise_ != nullptr) {
+ auto r = current_promise_->Step(pending);
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ current_promise_->Stop();
+ current_promise_ = nullptr;
+ if (!*p) {
+ receiver_->MarkClosed();
+ return y_absl::optional<T>();
+ }
+ } else {
+ return Pending();
+ }
+ }
+ while (true) {
+ if (next_filter_ >= receiver_->filters_.size()) {
+ auto result = y_absl::optional<T>(std::move(*pending));
+ receiver_->pending_.reset();
+ receiver_->waiting_to_send_.Wake();
+ receiver_->next_ = nullptr;
+ receiver_ = nullptr;
+ return result;
+ }
+ auto* filter = receiver_->filters_[next_filter_];
+ current_promise_ = filter ? filter->Step(pending, &scratch_) : nullptr;
+ next_filter_++;
+ if (current_promise_ ==
+ reinterpret_cast<Promise<T>*>(uintptr_t(false))) {
+ current_promise_ = nullptr;
+ receiver_->MarkClosed();
+ return y_absl::optional<T>();
+ } else if (current_promise_ ==
+ reinterpret_cast<Promise<T>*>(uintptr_t(true))) {
+ current_promise_ = nullptr;
+ } else {
+ return Pending();
+ }
+ }
+ }
+ if (receiver_->sender_ == nullptr) {
+ return y_absl::optional<T>();
+ }
+ return receiver_->waiting_to_receive_.pending();
+ }
+
+ private:
+ friend class PipeReceiver<T>;
+ explicit Next(PipeReceiver<T>* receiver) : receiver_(receiver) {
+ assert(receiver_->next_ == nullptr);
+ receiver_->next_ = this;
+ }
+ PipeReceiver<T>* receiver_;
+ size_t next_filter_ = 0;
+ Promise<T>* current_promise_ = nullptr;
+ Scratch scratch_;
+};
+
+template <typename T, typename F>
+class Filter final : private FilterInterface<T> {
+ public:
+ Filter(PipeReceiver<T>* receiver, F f)
+ : active_{receiver, promise_detail::PromiseFactory<T, F>(std::move(f))},
+ index_(this->AllocIndex(receiver)){};
+ explicit Filter(y_absl::Status already_finished)
+ : done_(std::move(already_finished)) {}
+ ~Filter() {
+ if (index_ != kTombstoneIndex) {
+ this->SetReceiverIndex(active_.receiver, index_, nullptr);
+ active_.~Active();
+ } else {
+ done_.~Status();
+ }
+ }
+ Filter(Filter&& other) noexcept : index_(other.index_) {
+ if (index_ != kTombstoneIndex) {
+ new (&active_) Active(std::move(other.active_));
+ other.active_.~Active();
+ new (&other.done_) y_absl::Status(y_absl::OkStatus());
+ other.index_ = kTombstoneIndex;
+ this->SetReceiverIndex(active_.receiver, index_, this);
+ } else {
+ new (&done_) y_absl::Status(std::move(other.done_));
+ }
+ }
+
+ Filter(const Filter&) = delete;
+ Filter& operator=(const Filter&) = delete;
+
+ Poll<y_absl::Status> operator()() {
+ if (index_ == kTombstoneIndex) {
+ return std::move(done_);
+ }
+ return Pending();
+ }
+
+ private:
+ static constexpr char kTombstoneIndex = -1;
+ struct Active {
+ GPR_NO_UNIQUE_ADDRESS PipeReceiver<T>* receiver;
+ GPR_NO_UNIQUE_ADDRESS promise_detail::PromiseFactory<T, F> factory;
+ };
+ union {
+ GPR_NO_UNIQUE_ADDRESS Active active_;
+ GPR_NO_UNIQUE_ADDRESS y_absl::Status done_;
+ };
+ GPR_NO_UNIQUE_ADDRESS char index_;
+
+ class PromiseImpl final : public ::grpc_core::pipe_detail::Promise<T> {
+ using PF = typename promise_detail::PromiseFactory<T, F>::Promise;
+
+ public:
+ PromiseImpl(PF f, Filter* filter) : f_(std::move(f)), filter_(filter) {}
+
+ Poll<bool> Step(T* output) final {
+ auto r = f_();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ if (p->ok()) {
+ *output = std::move(**p);
+ return true;
+ } else {
+ filter_->SetReceiverIndex(filter_->active_.receiver, filter_->index_,
+ nullptr);
+ filter_->active_.~Active();
+ filter_->index_ = kTombstoneIndex;
+ new (&filter_->done_) y_absl::Status(std::move(p->status()));
+ Activity::WakeupCurrent();
+ return false;
+ }
+ } else {
+ return Pending();
+ }
+ }
+
+ void Stop() final { this->~PromiseImpl(); }
+
+ private:
+ PF f_;
+ Filter* filter_;
+ };
+
+ Promise<T>* Step(T* p, Scratch* scratch) final {
+ if (index_ != kTombstoneIndex) {
+ PromiseImpl promise(active_.factory.Repeated(std::move(*p)), this);
+ auto r = promise.Step(p);
+ if (auto* result = y_absl::get_if<kPollReadyIdx>(&r)) {
+ return reinterpret_cast<Promise<T>*>(uintptr_t(*result));
+ }
+ static_assert(sizeof(promise) <= sizeof(Scratch),
+ "scratch size too small");
+ static_assert(alignof(decltype(promise)) <= alignof(Scratch),
+ "bad alignment");
+ return new (scratch) decltype(promise)(std::move(promise));
+ } else {
+ return nullptr;
+ }
+ }
+
+ void UpdateReceiver(PipeReceiver<T>* receiver) final {
+ if (index_ != kTombstoneIndex) {
+ if (receiver == nullptr) {
+ active_.~Active();
+ index_ = kTombstoneIndex;
+ new (&done_) y_absl::Status(y_absl::OkStatus());
+ } else {
+ active_.receiver = receiver;
+ }
+ Activity::WakeupCurrent();
+ }
+ }
+};
+
+template <typename T>
+void FilterInterface<T>::SetReceiverIndex(PipeReceiver<T>* receiver, int idx,
+ FilterInterface* p) {
+ receiver->filters_[idx] = p;
+}
+
+template <typename T>
+char FilterInterface<T>::AllocIndex(PipeReceiver<T>* receiver) {
+ auto r = receiver->filters_.size();
+ receiver->filters_.push_back(this);
+ return r;
+}
+
+} // namespace pipe_detail
+
+template <typename T>
+pipe_detail::Push<T> PipeSender<T>::Push(T value) {
+ return pipe_detail::Push<T>(this, std::move(value));
+}
+
+template <typename T>
+pipe_detail::Next<T> PipeReceiver<T>::Next() {
+ return pipe_detail::Next<T>(this);
+}
+
+template <typename T>
+template <typename F>
+pipe_detail::Filter<T, F> PipeSender<T>::Filter(F f) {
+ if (receiver_) {
+ return pipe_detail::Filter<T, F>(receiver_, std::move(f));
+ } else {
+ return pipe_detail::Filter<T, F>(y_absl::OkStatus());
+ }
+}
+
+template <typename T>
+template <typename F>
+pipe_detail::Filter<T, F> PipeReceiver<T>::Filter(F f) {
+ return pipe_detail::Filter<T, F>(this, std::move(f));
+}
+
+// A Pipe is an intra-Activity communications channel that transmits T's from
+// one end to the other.
+// It is only safe to use a Pipe within the context of a single Activity.
+// No synchronization is performed internally.
+template <typename T>
+struct Pipe {
+ Pipe() : sender(&receiver), receiver(&sender) {}
+ Pipe(const Pipe&) = delete;
+ Pipe& operator=(const Pipe&) = delete;
+ Pipe(Pipe&&) noexcept = default;
+ Pipe& operator=(Pipe&&) noexcept = default;
+
+ PipeSender<T> sender;
+ PipeReceiver<T> receiver;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_PIPE_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/poll.h b/contrib/libs/grpc/src/core/lib/promise/poll.h
new file mode 100644
index 00000000000..7151410059d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/poll.h
@@ -0,0 +1,60 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_POLL_H
+#define GRPC_CORE_LIB_PROMISE_POLL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stddef.h>
+
+#include "y_absl/types/variant.h"
+
+namespace grpc_core {
+
+// A type that signals a Promise is still pending and not yet completed.
+// Allows writing 'return Pending{}' and with automatic conversions gets
+// upgraded to a Poll<> object.
+struct Pending {
+ constexpr bool operator==(Pending) const { return true; }
+};
+
+// The result of polling a Promise once.
+//
+// Can be either pending - the Promise has not yet completed, or ready -
+// indicating that the Promise has completed AND should not be polled again.
+template <typename T>
+using Poll = y_absl::variant<Pending, T>;
+
+// Variant of Poll that serves as a ready value
+static constexpr size_t kPollReadyIdx = 1;
+
+// PollTraits tells us whether a type is Poll<> or some other type, and is
+// leveraged in the PromiseLike/PromiseFactory machinery to select the
+// appropriate implementation of those concepts based upon the return type of a
+// lambda, for example (via enable_if).
+template <typename T>
+struct PollTraits {
+ static constexpr bool is_poll() { return false; }
+};
+
+template <typename T>
+struct PollTraits<Poll<T>> {
+ using Type = T;
+ static constexpr bool is_poll() { return true; }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_POLL_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/promise.h b/contrib/libs/grpc/src/core/lib/promise/promise.h
new file mode 100644
index 00000000000..aba0150e91c
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/promise.h
@@ -0,0 +1,90 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_PROMISE_H
+#define GRPC_CORE_LIB_PROMISE_PROMISE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <functional>
+#include <type_traits>
+
+#include "y_absl/types/optional.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/promise_like.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// A Promise is any functor that takes no arguments and returns Poll<T>.
+// Most of the time we just pass around the functor, but occasionally
+// it pays to have a type erased variant, which we define here.
+template <typename T>
+using Promise = std::function<Poll<T>()>;
+
+// Helper to execute a promise immediately and return either the result or
+// nothing.
+template <typename Promise>
+auto NowOrNever(Promise promise)
+ -> y_absl::optional<typename promise_detail::PromiseLike<Promise>::Result> {
+ auto r = promise_detail::PromiseLike<Promise>(std::move(promise))();
+ if (auto* p = y_absl::get_if<kPollReadyIdx>(&r)) {
+ return std::move(*p);
+ }
+ return {};
+}
+
+// A promise that never completes.
+template <typename T>
+struct Never {
+ Poll<T> operator()() { return Pending(); }
+};
+
+namespace promise_detail {
+// A promise that immediately completes.
+template <typename T>
+class Immediate {
+ public:
+ explicit Immediate(T value) : value_(std::move(value)) {}
+
+ Poll<T> operator()() { return std::move(value_); }
+
+ private:
+ T value_;
+};
+
+} // namespace promise_detail
+
+// Return \a value immediately
+template <typename T>
+promise_detail::Immediate<T> Immediate(T value) {
+ return promise_detail::Immediate<T>(std::move(value));
+}
+
+// Typecheck that a promise returns the expected return type.
+// usage: auto promise = WithResult<int>([]() { return 3; });
+// NOTE: there are tests in promise_test.cc that are commented out because they
+// should fail to compile. When modifying this code these should be uncommented
+// and their miscompilation verified.
+template <typename T, typename F>
+auto WithResult(F f) ->
+ typename std::enable_if<std::is_same<decltype(f()), Poll<T>>::value,
+ F>::type {
+ return f;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_PROMISE_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/race.h b/contrib/libs/grpc/src/core/lib/promise/race.h
new file mode 100644
index 00000000000..5b3a4f4a4bd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/race.h
@@ -0,0 +1,84 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_RACE_H
+#define GRPC_CORE_LIB_PROMISE_RACE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <type_traits>
+
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Implementation type for Race combinator.
+template <typename... Promises>
+class Race;
+
+template <typename Promise, typename... Promises>
+class Race<Promise, Promises...> {
+ public:
+ using Result = decltype(std::declval<Promise>()());
+
+ explicit Race(Promise promise, Promises... promises)
+ : promise_(std::move(promise)), next_(std::move(promises)...) {}
+
+ Result operator()() {
+ // Check our own promise.
+ auto r = promise_();
+ if (y_absl::holds_alternative<Pending>(r)) {
+ // Check the rest of them.
+ return next_();
+ }
+ // Return the first ready result.
+ return std::move(y_absl::get<kPollReadyIdx>(std::move(r)));
+ }
+
+ private:
+ // The Promise checked by this instance.
+ Promise promise_;
+ // We recursively expand to check the rest of the instances.
+ Race<Promises...> next_;
+};
+
+template <typename Promise>
+class Race<Promise> {
+ public:
+ using Result = decltype(std::declval<Promise>()());
+ explicit Race(Promise promise) : promise_(std::move(promise)) {}
+ Result operator()() { return promise_(); }
+
+ private:
+ Promise promise_;
+};
+
+} // namespace promise_detail
+
+/// Run all the promises, return the first result that's available.
+/// If two results are simultaneously available, bias towards the first result
+/// listed.
+template <typename... Promises>
+promise_detail::Race<Promises...> Race(Promises... promises) {
+ return promise_detail::Race<Promises...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_RACE_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/seq.h b/contrib/libs/grpc/src/core/lib/promise/seq.h
new file mode 100644
index 00000000000..635374da828
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/seq.h
@@ -0,0 +1,71 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/basic_seq.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename T>
+struct SeqTraits {
+ using UnwrappedType = T;
+ using WrappedType = T;
+ template <typename Next>
+ static auto CallFactory(Next* next, T&& value)
+ -> decltype(next->Once(std::forward<T>(value))) {
+ return next->Once(std::forward<T>(value));
+ }
+
+ template <typename Result, typename PriorResult, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(PriorResult prior,
+ RunNext run_next) {
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename... Fs>
+using Seq = BasicSeq<SeqTraits, Fs...>;
+
+} // namespace promise_detail
+
+// Sequencing combinator.
+// Run the first promise.
+// Pass its result to the second, and run the returned promise.
+// Pass its result to the third, and run the returned promise.
+// etc
+// Return the final value.
+template <typename... Functors>
+promise_detail::Seq<Functors...> Seq(Functors... functors) {
+ return promise_detail::Seq<Functors...>(std::move(functors)...);
+}
+
+template <typename F>
+F Seq(F functor) {
+ return functor;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_SEQ_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/try_join.h b/contrib/libs/grpc/src/core/lib/promise/try_join.h
new file mode 100644
index 00000000000..7070e49060f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/try_join.h
@@ -0,0 +1,83 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_TRY_JOIN_H
+#define GRPC_CORE_LIB_PROMISE_TRY_JOIN_H
+
+#include <grpc/support/port_platform.h>
+
+#include <type_traits>
+
+#include "y_absl/meta/type_traits.h"
+#include "y_absl/status/status.h"
+#include "y_absl/status/statusor.h"
+
+#include "src/core/lib/promise/detail/basic_join.h"
+#include "src/core/lib/promise/detail/status.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+// Extract the T from a StatusOr<T>
+template <typename T>
+T IntoResult(y_absl::StatusOr<T>* status) {
+ return std::move(**status);
+}
+
+// TryJoin returns a StatusOr<tuple<A,B,C>> for f()->Poll<StatusOr<A>>,
+// g()->Poll<StatusOr<B>>, h()->Poll<StatusOr<C>>. If one of those should be a
+// Status instead, we need a placeholder type to return, and this is it.
+struct Empty {};
+inline Empty IntoResult(y_absl::Status*) { return Empty{}; }
+
+// Traits object to pass to BasicJoin
+struct TryJoinTraits {
+ template <typename T>
+ using ResultType =
+ decltype(IntoResult(std::declval<y_absl::remove_reference_t<T>*>()));
+ template <typename T, typename F>
+ static auto OnResult(T result, F kontinue)
+ -> decltype(kontinue(IntoResult(&result))) {
+ using Result =
+ typename PollTraits<decltype(kontinue(IntoResult(&result)))>::Type;
+ if (!result.ok()) {
+ return Result(IntoStatus(&result));
+ }
+ return kontinue(IntoResult(&result));
+ }
+ template <typename T>
+ static y_absl::StatusOr<T> Wrap(T x) {
+ return y_absl::StatusOr<T>(std::move(x));
+ }
+};
+
+// Implementation of TryJoin combinator.
+template <typename... Promises>
+using TryJoin = BasicJoin<TryJoinTraits, Promises...>;
+
+} // namespace promise_detail
+
+// Run all promises.
+// If any fail, cancel the rest and return the failure.
+// If all succeed, return Ok(tuple-of-results).
+template <typename... Promises>
+promise_detail::TryJoin<Promises...> TryJoin(Promises... promises) {
+ return promise_detail::TryJoin<Promises...>(std::move(promises)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_TRY_JOIN_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/try_seq.h b/contrib/libs/grpc/src/core/lib/promise/try_seq.h
new file mode 100644
index 00000000000..432a5b46ec5
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/try_seq.h
@@ -0,0 +1,106 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_TRY_SEQ_H
+#define GRPC_CORE_LIB_PROMISE_TRY_SEQ_H
+
+#include <grpc/support/port_platform.h>
+
+#include <tuple>
+#include <utility>
+
+#include "y_absl/status/status.h"
+#include "y_absl/status/statusor.h"
+#include "y_absl/types/variant.h"
+
+#include "src/core/lib/promise/detail/basic_seq.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+namespace promise_detail {
+
+template <typename T>
+struct TrySeqTraits {
+ using UnwrappedType = T;
+ using WrappedType = y_absl::StatusOr<T>;
+ template <typename Next>
+ static auto CallFactory(Next* next, T&& value)
+ -> decltype(next->Once(std::forward<T>(value))) {
+ return next->Once(std::forward<T>(value));
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(T prior, RunNext run_next) {
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename T>
+struct TrySeqTraits<y_absl::StatusOr<T>> {
+ using UnwrappedType = T;
+ using WrappedType = y_absl::StatusOr<T>;
+ template <typename Next>
+ static auto CallFactory(Next* next, y_absl::StatusOr<T>&& status)
+ -> decltype(next->Once(std::move(*status))) {
+ return next->Once(std::move(*status));
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(y_absl::StatusOr<T> prior,
+ RunNext run_next) {
+ if (!prior.ok()) return Result(prior.status());
+ return run_next(std::move(prior));
+ }
+};
+template <>
+struct TrySeqTraits<y_absl::Status> {
+ using UnwrappedType = void;
+ using WrappedType = y_absl::Status;
+ template <typename Next>
+ static auto CallFactory(Next* next, y_absl::Status&&)
+ -> decltype(next->Once()) {
+ return next->Once();
+ }
+ template <typename Result, typename RunNext>
+ static Poll<Result> CheckResultAndRunNext(y_absl::Status prior,
+ RunNext run_next) {
+ if (!prior.ok()) return Result(prior);
+ return run_next(std::move(prior));
+ }
+};
+
+template <typename... Fs>
+using TrySeq = BasicSeq<TrySeqTraits, Fs...>;
+
+} // namespace promise_detail
+
+// Try a sequence of operations.
+// * Run the first functor as a promise.
+// * Feed its success result into the second functor to create a promise,
+// then run that.
+// * ...
+// * Feed the second-final success result into the final functor to create a
+// promise, then run that, with the overall success result being that
+// promises success result.
+// If any step fails, fail everything.
+// Functors can return StatusOr<> to signal that a value is fed forward, or
+// Status to indicate only success/failure. In the case of returning Status,
+// the construction functors take no arguments.
+template <typename... Functors>
+promise_detail::TrySeq<Functors...> TrySeq(Functors... functors) {
+ return promise_detail::TrySeq<Functors...>(std::move(functors)...);
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_TRY_SEQ_H
diff --git a/contrib/libs/grpc/src/core/lib/promise/wait_set.h b/contrib/libs/grpc/src/core/lib/promise/wait_set.h
new file mode 100644
index 00000000000..5d0b3714bfd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/promise/wait_set.h
@@ -0,0 +1,76 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_PROMISE_WAIT_SET_H
+#define GRPC_CORE_LIB_PROMISE_WAIT_SET_H
+
+#include <grpc/support/port_platform.h>
+
+#include <utility>
+
+#include "y_absl/container/flat_hash_set.h"
+
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+// Helper type that can be used to enqueue many Activities waiting for some
+// external state.
+// Typically the external state should be guarded by mu_, and a call to
+// WakeAllAndUnlock should be made when the state changes.
+// Promises should bottom out polling inside pending(), which will register for
+// wakeup and return Pending().
+// Queues handles to Activities, and not Activities themselves, meaning that if
+// an Activity is destroyed prior to wakeup we end up holding only a small
+// amount of memory (around 16 bytes + malloc overhead) until the next wakeup
+// occurs.
+class WaitSet final {
+ using WakerSet = y_absl::flat_hash_set<Waker>;
+
+ public:
+ // Register for wakeup, return Pending(). If state is not ready to proceed,
+ // Promises should bottom out here.
+ Pending AddPending(Waker waker) {
+ pending_.emplace(std::move(waker));
+ return Pending();
+ }
+
+ class WakeupSet {
+ public:
+ void Wakeup() {
+ while (!wakeup_.empty()) {
+ wakeup_.extract(wakeup_.begin()).value().Wakeup();
+ }
+ }
+
+ private:
+ friend class WaitSet;
+ explicit WakeupSet(WakerSet&& wakeup)
+ : wakeup_(std::forward<WakerSet>(wakeup)) {}
+ WakerSet wakeup_;
+ };
+
+ GRPC_MUST_USE_RESULT WakeupSet TakeWakeupSet() {
+ return WakeupSet(std::move(pending_));
+ }
+
+ private:
+ // Handles to activities that need to be awoken.
+ WakerSet pending_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_PROMISE_WAIT_SET_H
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/api.cc b/contrib/libs/grpc/src/core/lib/resource_quota/api.cc
new file mode 100644
index 00000000000..d8939da17db
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/api.cc
@@ -0,0 +1,108 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/resource_quota/api.h"
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/iomgr/exec_ctx.h"
+
+namespace grpc_core {
+
+ResourceQuotaRefPtr ResourceQuotaFromChannelArgs(
+ const grpc_channel_args* args) {
+ return grpc_channel_args_find_pointer<ResourceQuota>(args,
+ GRPC_ARG_RESOURCE_QUOTA)
+ ->Ref();
+}
+
+namespace {
+grpc_arg MakeArg(ResourceQuota* quota) {
+ return grpc_channel_arg_pointer_create(
+ const_cast<char*>(GRPC_ARG_RESOURCE_QUOTA), quota,
+ grpc_resource_quota_arg_vtable());
+}
+
+const grpc_channel_args* EnsureResourceQuotaInChannelArgs(
+ const grpc_channel_args* args) {
+ const grpc_arg* existing =
+ grpc_channel_args_find(args, GRPC_ARG_RESOURCE_QUOTA);
+ if (existing != nullptr && existing->type == GRPC_ARG_POINTER &&
+ existing->value.pointer.p != nullptr) {
+ return grpc_channel_args_copy(args);
+ }
+ // If there's no existing quota, add it to the default one - shared between
+ // all channel args declared thusly. This prevents us from accidentally not
+ // sharing subchannels due to their channel args not specifying a quota.
+ const char* remove[] = {GRPC_ARG_RESOURCE_QUOTA};
+ auto new_arg = MakeArg(ResourceQuota::Default().get());
+ return grpc_channel_args_copy_and_add_and_remove(args, remove, 1, &new_arg,
+ 1);
+}
+} // namespace
+
+void RegisterResourceQuota(CoreConfiguration::Builder* builder) {
+ builder->channel_args_preconditioning()->RegisterStage(
+ EnsureResourceQuotaInChannelArgs);
+}
+
+} // namespace grpc_core
+
+extern "C" const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable() {
+ static const grpc_arg_pointer_vtable vtable = {
+ // copy
+ [](void* p) -> void* {
+ return static_cast<grpc_core::ResourceQuota*>(p)->Ref().release();
+ },
+ // destroy
+ [](void* p) { static_cast<grpc_core::ResourceQuota*>(p)->Unref(); },
+ // compare
+ [](void* p, void* q) { return grpc_core::QsortCompare(p, q); }};
+ return &vtable;
+}
+
+extern "C" grpc_resource_quota* grpc_resource_quota_create(const char* name) {
+ static std::atomic<uintptr_t> anonymous_counter{0};
+ TString quota_name =
+ name == nullptr
+ ? y_absl::StrCat("anonymous-quota-", anonymous_counter.fetch_add(1))
+ : name;
+ return (new grpc_core::ResourceQuota(std::move(quota_name)))->c_ptr();
+}
+
+extern "C" void grpc_resource_quota_ref(grpc_resource_quota* resource_quota) {
+ grpc_core::ResourceQuota::FromC(resource_quota)->Ref().release();
+}
+
+extern "C" void grpc_resource_quota_unref(grpc_resource_quota* resource_quota) {
+ grpc_core::ResourceQuota::FromC(resource_quota)->Unref();
+}
+
+extern "C" void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
+ size_t new_size) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_core::ResourceQuota::FromC(resource_quota)
+ ->memory_quota()
+ ->SetSize(new_size);
+}
+
+extern "C" void grpc_resource_quota_set_max_threads(
+ grpc_resource_quota* resource_quota, int new_max_threads) {
+ grpc_core::ResourceQuota::FromC(resource_quota)
+ ->thread_quota()
+ ->SetMax(new_max_threads);
+}
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/api.h b/contrib/libs/grpc/src/core/lib/resource_quota/api.h
new file mode 100644
index 00000000000..c531813038f
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/api.h
@@ -0,0 +1,41 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_API_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_API_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/resource_quota/resource_quota.h"
+
+typedef struct grpc_resource_quota grpc_resource_quota;
+
+namespace grpc_core {
+
+// TODO(ctiller): This is a hack. We need to do real accounting instead of
+// hard coding.
+constexpr size_t kResourceQuotaCallSize = 15 * 1024;
+constexpr size_t kResourceQuotaChannelSize = 50 * 1024;
+
+// Retrieve the resource quota from the channel args.
+// UB if not set.
+ResourceQuotaRefPtr ResourceQuotaFromChannelArgs(const grpc_channel_args* args);
+
+void RegisterResourceQuota(CoreConfiguration::Builder* builder);
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_API_H
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.cc b/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.cc
new file mode 100644
index 00000000000..97da848d415
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.cc
@@ -0,0 +1,478 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/resource_quota/memory_quota.h"
+
+#include <atomic>
+
+#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/mpscq.h"
+#include "src/core/lib/promise/exec_ctx_wakeup_scheduler.h"
+#include "src/core/lib/promise/loop.h"
+#include "src/core/lib/promise/map.h"
+#include "src/core/lib/promise/race.h"
+#include "src/core/lib/promise/seq.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/trace.h"
+
+namespace grpc_core {
+
+// Maximum number of bytes an allocator will request from a quota in one step.
+// Larger allocations than this will require multiple allocation requests.
+static constexpr size_t kMaxReplenishBytes = 1024 * 1024;
+
+// Minimum number of bytes an allocator will request from a quota in one step.
+static constexpr size_t kMinReplenishBytes = 4096;
+
+//
+// Reclaimer
+//
+
+ReclamationSweep::~ReclamationSweep() {
+ if (memory_quota_ != nullptr) {
+ memory_quota_->FinishReclamation(sweep_token_, std::move(waker_));
+ }
+}
+
+//
+// ReclaimerQueue
+//
+
+struct ReclaimerQueue::QueuedNode
+ : public MultiProducerSingleConsumerQueue::Node {
+ explicit QueuedNode(RefCountedPtr<Handle> reclaimer_handle)
+ : reclaimer_handle(std::move(reclaimer_handle)) {}
+ RefCountedPtr<Handle> reclaimer_handle;
+};
+
+struct ReclaimerQueue::State {
+ Mutex reader_mu;
+ MultiProducerSingleConsumerQueue queue; // reader_mu must be held to pop
+ Waker waker Y_ABSL_GUARDED_BY(reader_mu);
+
+ ~State() {
+ bool empty = false;
+ do {
+ delete static_cast<QueuedNode*>(queue.PopAndCheckEnd(&empty));
+ } while (!empty);
+ }
+};
+
+void ReclaimerQueue::Handle::Orphan() {
+ if (auto* sweep = sweep_.exchange(nullptr, std::memory_order_acq_rel)) {
+ sweep->RunAndDelete(y_absl::nullopt);
+ }
+ Unref();
+}
+
+void ReclaimerQueue::Handle::Run(ReclamationSweep reclamation_sweep) {
+ if (auto* sweep = sweep_.exchange(nullptr, std::memory_order_acq_rel)) {
+ sweep->RunAndDelete(std::move(reclamation_sweep));
+ }
+}
+
+bool ReclaimerQueue::Handle::Requeue(ReclaimerQueue* new_queue) {
+ if (sweep_.load(std::memory_order_relaxed)) {
+ new_queue->Enqueue(Ref());
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void ReclaimerQueue::Handle::Sweep::MarkCancelled() {
+ // When we cancel a reclaimer we rotate the elements of the queue once -
+ // taking one non-cancelled node from the start, and placing it on the end.
+ // This ensures that we don't suffer from head of line blocking whereby a
+ // non-cancelled reclaimer at the head of the queue, in the absence of memory
+ // pressure, prevents the remainder of the queue from being cleaned up.
+ MutexLock lock(&state_->reader_mu);
+ while (true) {
+ bool empty = false;
+ std::unique_ptr<QueuedNode> node(
+ static_cast<QueuedNode*>(state_->queue.PopAndCheckEnd(&empty)));
+ if (node == nullptr) break;
+ if (node->reclaimer_handle->sweep_.load(std::memory_order_relaxed) !=
+ nullptr) {
+ state_->queue.Push(node.release());
+ break;
+ }
+ }
+}
+
+ReclaimerQueue::ReclaimerQueue() : state_(std::make_shared<State>()) {}
+
+ReclaimerQueue::~ReclaimerQueue() = default;
+
+void ReclaimerQueue::Enqueue(RefCountedPtr<Handle> handle) {
+ if (state_->queue.Push(new QueuedNode(std::move(handle)))) {
+ MutexLock lock(&state_->reader_mu);
+ state_->waker.Wakeup();
+ }
+}
+
+Poll<RefCountedPtr<ReclaimerQueue::Handle>> ReclaimerQueue::PollNext() {
+ MutexLock lock(&state_->reader_mu);
+ bool empty = false;
+ // Try to pull from the queue.
+ std::unique_ptr<QueuedNode> node(
+ static_cast<QueuedNode*>(state_->queue.PopAndCheckEnd(&empty)));
+ // If we get something, great.
+ if (node != nullptr) return std::move(node->reclaimer_handle);
+ if (!empty) {
+ // If we don't, but the queue is probably not empty, schedule an immediate
+ // repoll.
+ Activity::WakeupCurrent();
+ } else {
+ // Otherwise, schedule a wakeup for whenever something is pushed.
+ state_->waker = Activity::current()->MakeNonOwningWaker();
+ }
+ return Pending{};
+}
+
+//
+// GrpcMemoryAllocatorImpl
+//
+
+GrpcMemoryAllocatorImpl::GrpcMemoryAllocatorImpl(
+ std::shared_ptr<BasicMemoryQuota> memory_quota, TString name)
+ : memory_quota_(memory_quota), name_(std::move(name)) {
+ memory_quota_->Take(taken_bytes_);
+}
+
+GrpcMemoryAllocatorImpl::~GrpcMemoryAllocatorImpl() {
+ GPR_ASSERT(free_bytes_.load(std::memory_order_acquire) +
+ sizeof(GrpcMemoryAllocatorImpl) ==
+ taken_bytes_);
+ memory_quota_->Return(taken_bytes_);
+}
+
+void GrpcMemoryAllocatorImpl::Shutdown() {
+ std::shared_ptr<BasicMemoryQuota> memory_quota;
+ OrphanablePtr<ReclaimerQueue::Handle>
+ reclamation_handles[kNumReclamationPasses];
+ {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ shutdown_ = true;
+ memory_quota = memory_quota_;
+ for (size_t i = 0; i < kNumReclamationPasses; i++) {
+ reclamation_handles[i] = y_absl::exchange(reclamation_handles_[i], nullptr);
+ }
+ }
+}
+
+size_t GrpcMemoryAllocatorImpl::Reserve(MemoryRequest request) {
+ // Validate request - performed here so we don't bloat the generated code with
+ // inlined asserts.
+ GPR_ASSERT(request.min() <= request.max());
+ GPR_ASSERT(request.max() <= MemoryRequest::max_allowed_size());
+ while (true) {
+ // Attempt to reserve memory from our pool.
+ auto reservation = TryReserve(request);
+ if (reservation.has_value()) return *reservation;
+ // If that failed, grab more from the quota and retry.
+ Replenish();
+ }
+}
+
+y_absl::optional<size_t> GrpcMemoryAllocatorImpl::TryReserve(
+ MemoryRequest request) {
+ // How much memory should we request? (see the scaling below)
+ size_t scaled_size_over_min = request.max() - request.min();
+ // Scale the request down according to memory pressure if we have that
+ // flexibility.
+ if (scaled_size_over_min != 0) {
+ double pressure;
+ size_t max_recommended_allocation_size;
+ {
+ MutexLock lock(&memory_quota_mu_);
+ const auto pressure_and_max_recommended_allocation_size =
+ memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize();
+ pressure = pressure_and_max_recommended_allocation_size.first;
+ max_recommended_allocation_size =
+ pressure_and_max_recommended_allocation_size.second;
+ }
+ // Reduce allocation size proportional to the pressure > 80% usage.
+ if (pressure > 0.8) {
+ scaled_size_over_min =
+ std::min(scaled_size_over_min,
+ static_cast<size_t>((request.max() - request.min()) *
+ (1.0 - pressure) / 0.2));
+ }
+ if (max_recommended_allocation_size < request.min()) {
+ scaled_size_over_min = 0;
+ } else if (request.min() + scaled_size_over_min >
+ max_recommended_allocation_size) {
+ scaled_size_over_min = max_recommended_allocation_size - request.min();
+ }
+ }
+
+ // How much do we want to reserve?
+ const size_t reserve = request.min() + scaled_size_over_min;
+ // See how many bytes are available.
+ size_t available = free_bytes_.load(std::memory_order_acquire);
+ while (true) {
+ // Does the current free pool satisfy the request?
+ if (available < reserve) {
+ return {};
+ }
+ // Try to reserve the requested amount.
+ // If the amount of free memory changed through this loop, then available
+ // will be set to the new value and we'll repeat.
+ if (free_bytes_.compare_exchange_weak(available, available - reserve,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
+ return reserve;
+ }
+ }
+}
+
+void GrpcMemoryAllocatorImpl::Replenish() {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ // Attempt a fairly low rate exponential growth request size, bounded between
+ // some reasonable limits declared at top of file.
+ auto amount = Clamp(taken_bytes_ / 3, kMinReplenishBytes, kMaxReplenishBytes);
+ // Take the requested amount from the quota.
+ memory_quota_->Take(amount);
+ // Record that we've taken it.
+ taken_bytes_ += amount;
+ // Add the taken amount to the free pool.
+ free_bytes_.fetch_add(amount, std::memory_order_acq_rel);
+ // See if we can add ourselves as a reclaimer.
+ MaybeRegisterReclaimerLocked();
+}
+
+void GrpcMemoryAllocatorImpl::MaybeRegisterReclaimer() {
+ MutexLock lock(&memory_quota_mu_);
+ MaybeRegisterReclaimerLocked();
+}
+
+void GrpcMemoryAllocatorImpl::MaybeRegisterReclaimerLocked() {
+ // If the reclaimer is already registered, then there's nothing to do.
+ if (registered_reclaimer_) return;
+ if (shutdown_) return;
+ // Grab references to the things we'll need
+ auto self = shared_from_this();
+ std::weak_ptr<EventEngineMemoryAllocatorImpl> self_weak{self};
+ registered_reclaimer_ = true;
+ InsertReclaimer(0, [self_weak](y_absl::optional<ReclamationSweep> sweep) {
+ if (!sweep.has_value()) return;
+ auto self = self_weak.lock();
+ if (self == nullptr) return;
+ auto* p = static_cast<GrpcMemoryAllocatorImpl*>(self.get());
+ MutexLock lock(&p->memory_quota_mu_);
+ p->registered_reclaimer_ = false;
+ // Figure out how many bytes we can return to the quota.
+ size_t return_bytes = p->free_bytes_.exchange(0, std::memory_order_acq_rel);
+ if (return_bytes == 0) return;
+ // Subtract that from our outstanding balance.
+ p->taken_bytes_ -= return_bytes;
+ // And return them to the quota.
+ p->memory_quota_->Return(return_bytes);
+ });
+}
+
+void GrpcMemoryAllocatorImpl::Rebind(
+ std::shared_ptr<BasicMemoryQuota> memory_quota) {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ if (memory_quota_ == memory_quota) return;
+ // Return memory to the original memory quota.
+ memory_quota_->Return(taken_bytes_);
+ // Reassign any queued reclaimers
+ for (size_t i = 0; i < kNumReclamationPasses; i++) {
+ if (reclamation_handles_[i] != nullptr) {
+ reclamation_handles_[i]->Requeue(memory_quota->reclaimer_queue(i));
+ }
+ }
+ // Switch to the new memory quota, leaving the old one in memory_quota so that
+ // when we unref it, we are outside of lock.
+ memory_quota_.swap(memory_quota);
+ // Drop our freed memory down to zero, to avoid needing to ask the new
+ // quota for memory we're not currently using.
+ taken_bytes_ -= free_bytes_.exchange(0, std::memory_order_acq_rel);
+ // And let the new quota know how much we're already using.
+ memory_quota_->Take(taken_bytes_);
+}
+
+//
+// MemoryOwner
+//
+
+void MemoryOwner::Rebind(MemoryQuota* quota) {
+ impl()->Rebind(quota->memory_quota_);
+}
+
+//
+// BasicMemoryQuota
+//
+
+class BasicMemoryQuota::WaitForSweepPromise {
+ public:
+ WaitForSweepPromise(std::shared_ptr<BasicMemoryQuota> memory_quota,
+ uint64_t token)
+ : memory_quota_(std::move(memory_quota)), token_(token) {}
+
+ struct Empty {};
+ Poll<Empty> operator()() {
+ if (memory_quota_->reclamation_counter_.load(std::memory_order_relaxed) !=
+ token_) {
+ return Empty{};
+ } else {
+ return Pending{};
+ }
+ }
+
+ private:
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+ uint64_t token_;
+};
+
+void BasicMemoryQuota::Start() {
+ auto self = shared_from_this();
+
+ // Reclamation loop:
+ // basically, wait until we are in overcommit (free_bytes_ < 0), and then:
+ // while (free_bytes_ < 0) reclaim_memory()
+ // ... and repeat
+ auto reclamation_loop = Loop(Seq(
+ [self]() -> Poll<int> {
+ // If there's free memory we no longer need to reclaim memory!
+ if (self->free_bytes_.load(std::memory_order_acquire) > 0) {
+ return Pending{};
+ }
+ return 0;
+ },
+ [self]() {
+ // Race biases to the first thing that completes... so this will
+ // choose the highest priority/least destructive thing to do that's
+ // available.
+ auto annotate = [](const char* name) {
+ return [name](RefCountedPtr<ReclaimerQueue::Handle> f) {
+ return std::make_tuple(name, std::move(f));
+ };
+ };
+ return Race(Map(self->reclaimers_[0].Next(), annotate("compact")),
+ Map(self->reclaimers_[1].Next(), annotate("benign")),
+ Map(self->reclaimers_[2].Next(), annotate("idle")),
+ Map(self->reclaimers_[3].Next(), annotate("destructive")));
+ },
+ [self](
+ std::tuple<const char*, RefCountedPtr<ReclaimerQueue::Handle>> arg) {
+ auto reclaimer = std::move(std::get<1>(arg));
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO, "RQ: %s perform %s reclamation",
+ self->name_.c_str(), std::get<0>(arg));
+ }
+ // One of the reclaimer queues gave us a way to get back memory.
+ // Call the reclaimer with a token that contains enough to wake us
+ // up again.
+ const uint64_t token =
+ self->reclamation_counter_.fetch_add(1, std::memory_order_relaxed) +
+ 1;
+ reclaimer->Run(ReclamationSweep(
+ self, token, Activity::current()->MakeNonOwningWaker()));
+ // Return a promise that will wait for our barrier. This will be
+ // awoken by the token above being destroyed. So, once that token is
+ // destroyed, we'll be able to proceed.
+ return WaitForSweepPromise(self, token);
+ },
+ []() -> LoopCtl<y_absl::Status> {
+ // Continue the loop!
+ return Continue{};
+ }));
+
+ reclaimer_activity_ =
+ MakeActivity(std::move(reclamation_loop), ExecCtxWakeupScheduler(),
+ [](y_absl::Status status) {
+ GPR_ASSERT(status.code() == y_absl::StatusCode::kCancelled);
+ });
+}
+
+void BasicMemoryQuota::Stop() { reclaimer_activity_.reset(); }
+
+void BasicMemoryQuota::SetSize(size_t new_size) {
+ size_t old_size = quota_size_.exchange(new_size, std::memory_order_relaxed);
+ if (old_size < new_size) {
+ // We're growing the quota.
+ Return(new_size - old_size);
+ } else {
+ // We're shrinking the quota.
+ Take(old_size - new_size);
+ }
+}
+
+void BasicMemoryQuota::Take(size_t amount) {
+ // If there's a request for nothing, then do nothing!
+ if (amount == 0) return;
+ GPR_DEBUG_ASSERT(amount <= std::numeric_limits<intptr_t>::max());
+ // Grab memory from the quota.
+ auto prior = free_bytes_.fetch_sub(amount, std::memory_order_acq_rel);
+ // If we push into overcommit, awake the reclaimer.
+ if (prior >= 0 && prior < static_cast<intptr_t>(amount)) {
+ if (reclaimer_activity_ != nullptr) reclaimer_activity_->ForceWakeup();
+ }
+}
+
+void BasicMemoryQuota::FinishReclamation(uint64_t token, Waker waker) {
+ uint64_t current = reclamation_counter_.load(std::memory_order_relaxed);
+ if (current != token) return;
+ if (reclamation_counter_.compare_exchange_strong(current, current + 1,
+ std::memory_order_relaxed,
+ std::memory_order_relaxed)) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_resource_quota_trace)) {
+ gpr_log(GPR_INFO, "RQ: %s reclamation complete", name_.c_str());
+ }
+ waker.Wakeup();
+ }
+}
+
+void BasicMemoryQuota::Return(size_t amount) {
+ free_bytes_.fetch_add(amount, std::memory_order_relaxed);
+}
+
+std::pair<double, size_t>
+BasicMemoryQuota::InstantaneousPressureAndMaxRecommendedAllocationSize() const {
+ double free = free_bytes_.load();
+ if (free < 0) free = 0;
+ size_t quota_size = quota_size_.load();
+ double size = quota_size;
+ if (size < 1) return std::make_pair(1.0, 1);
+ double pressure = (size - free) / size;
+ if (pressure < 0.0) pressure = 0.0;
+ if (pressure > 1.0) pressure = 1.0;
+ return std::make_pair(pressure, quota_size / 16);
+}
+
+//
+// MemoryQuota
+//
+
+MemoryAllocator MemoryQuota::CreateMemoryAllocator(y_absl::string_view name) {
+ auto impl = std::make_shared<GrpcMemoryAllocatorImpl>(
+ memory_quota_, y_absl::StrCat(memory_quota_->name(), "/allocator/", name));
+ return MemoryAllocator(std::move(impl));
+}
+
+MemoryOwner MemoryQuota::CreateMemoryOwner(y_absl::string_view name) {
+ auto impl = std::make_shared<GrpcMemoryAllocatorImpl>(
+ memory_quota_, y_absl::StrCat(memory_quota_->name(), "/owner/", name));
+ return MemoryOwner(std::move(impl));
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.h b/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.h
new file mode 100644
index 00000000000..6bb497f68fd
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/memory_quota.h
@@ -0,0 +1,457 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <algorithm>
+#include <atomic>
+#include <cstddef>
+#include <limits>
+#include <memory>
+#include <queue>
+#include <vector>
+
+#include <grpc/event_engine/memory_allocator.h>
+#include <grpc/slice.h>
+
+#include "src/core/lib/gprpp/orphanable.h"
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/promise/activity.h"
+#include "src/core/lib/promise/poll.h"
+
+namespace grpc_core {
+
+class BasicMemoryQuota;
+class MemoryQuota;
+
+using grpc_event_engine::experimental::MemoryRequest;
+
+// Pull in impl under a different name to keep the gRPC/EventEngine separation
+// clear.
+using EventEngineMemoryAllocatorImpl =
+ grpc_event_engine::experimental::internal::MemoryAllocatorImpl;
+using grpc_event_engine::experimental::MemoryAllocator;
+template <typename T>
+using Vector = grpc_event_engine::experimental::Vector<T>;
+
+// Reclamation passes.
+// When memory is tight, we start trying to claim some back from memory
+// reclaimers. We do this in multiple passes: if there is a less destructive
+// operation available, we do that, otherwise we do something more destructive.
+enum class ReclamationPass {
+ // Non-empty reclamation ought to take index 0, but to simplify API we don't
+ // expose that publicly (it's an internal detail), and hence index zero is
+ // here unnamed.
+
+ // Benign reclamation is intended for reclamation steps that are not
+ // observable outside of gRPC (besides maybe causing an increase in CPU
+ // usage).
+ // Examples of such reclamation would be resizing buffers to fit the current
+ // load needs, rather than whatever was the peak usage requirement.
+ kBenign = 1,
+ // Idle reclamation is intended for reclamation steps that are observable
+ // outside of gRPC, but do not cause application work to be lost.
+ // Examples of such reclamation would be dropping channels that are not being
+ // used.
+ kIdle = 2,
+ // Destructive reclamation is our last resort, and is these reclamations are
+ // allowed to drop work - such as cancelling in flight requests.
+ kDestructive = 3,
+};
+static constexpr size_t kNumReclamationPasses = 4;
+
+// For each reclamation function run we construct a ReclamationSweep.
+// When this object is finally destroyed (it may be moved several times first),
+// then that reclamation is complete and we may continue the reclamation loop.
+class ReclamationSweep {
+ public:
+ ReclamationSweep() = default;
+ ReclamationSweep(std::shared_ptr<BasicMemoryQuota> memory_quota,
+ uint64_t sweep_token, Waker waker)
+ : memory_quota_(std::move(memory_quota)),
+ sweep_token_(sweep_token),
+ waker_(std::move(waker)) {}
+ ~ReclamationSweep();
+
+ ReclamationSweep(const ReclamationSweep&) = delete;
+ ReclamationSweep& operator=(const ReclamationSweep&) = delete;
+ ReclamationSweep(ReclamationSweep&&) = default;
+ ReclamationSweep& operator=(ReclamationSweep&&) = default;
+
+ // Has enough work been done that we would not be called upon again
+ // immediately to do reclamation work if we stopped and requeued. Reclaimers
+ // with a variable amount of work to do can use this to ascertain when they
+ // can stop more efficiently than going through the reclaimer queue once per
+ // work item.
+ bool IsSufficient() const;
+
+ // Explicit finish for users that wish to write it.
+ // Just destroying the object is enough, but sometimes the additional
+ // explicitness is warranted.
+ void Finish() {
+ [](ReclamationSweep) {}(std::move(*this));
+ }
+
+ private:
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+ uint64_t sweep_token_;
+ Waker waker_;
+};
+
+class ReclaimerQueue {
+ private:
+ struct QueuedNode;
+ struct State;
+
+ public:
+ class Handle : public InternallyRefCounted<Handle> {
+ public:
+ Handle() = default;
+ template <typename F>
+ explicit Handle(F reclaimer, std::shared_ptr<State> state)
+ : sweep_(new SweepFn<F>(std::move(reclaimer), std::move(state))) {}
+ ~Handle() override {
+ GPR_DEBUG_ASSERT(sweep_.load(std::memory_order_relaxed) == nullptr);
+ }
+
+ Handle(const Handle&) = delete;
+ Handle& operator=(const Handle&) = delete;
+
+ void Orphan() final;
+ void Run(ReclamationSweep reclamation_sweep);
+ bool Requeue(ReclaimerQueue* new_queue);
+
+ private:
+ friend class ReclaimerQueue;
+ using InternallyRefCounted<Handle>::Ref;
+
+ class Sweep {
+ public:
+ virtual void RunAndDelete(y_absl::optional<ReclamationSweep> sweep) = 0;
+
+ protected:
+ explicit Sweep(std::shared_ptr<State> state) : state_(std::move(state)) {}
+ ~Sweep() = default;
+ void MarkCancelled();
+
+ private:
+ std::shared_ptr<State> state_;
+ };
+
+ template <typename F>
+ class SweepFn final : public Sweep {
+ public:
+ explicit SweepFn(F&& f, std::shared_ptr<State> state)
+ : Sweep(std::move(state)), f_(std::move(f)) {}
+ void RunAndDelete(y_absl::optional<ReclamationSweep> sweep) override {
+ if (!sweep.has_value()) MarkCancelled();
+ f_(std::move(sweep));
+ delete this;
+ }
+
+ private:
+ F f_;
+ };
+
+ std::atomic<Sweep*> sweep_{nullptr};
+ };
+
+ ReclaimerQueue();
+ ~ReclaimerQueue();
+
+ ReclaimerQueue(const ReclaimerQueue&) = delete;
+ ReclaimerQueue& operator=(const ReclaimerQueue&) = delete;
+
+ // Insert a new element at the back of the queue.
+ // If there is already an element from allocator at *index, then it is
+ // replaced with the new reclaimer and *index is unchanged. If there is not,
+ // then *index is set to the index of the newly queued entry.
+ // Associates the reclamation function with an allocator, and keeps that
+ // allocator alive, so that we can use the pointer as an ABA guard.
+ template <typename F>
+ GRPC_MUST_USE_RESULT OrphanablePtr<Handle> Insert(F reclaimer) {
+ auto p = MakeOrphanable<Handle>(std::move(reclaimer), state_);
+ Enqueue(p->Ref());
+ return p;
+ }
+
+ // Poll to see if an entry is available: returns Pending if not, or the
+ // removed reclamation function if so.
+ Poll<RefCountedPtr<Handle>> PollNext();
+
+ // This callable is the promise backing Next - it resolves when there is an
+ // entry available. This really just redirects to calling PollNext().
+ class NextPromise {
+ public:
+ explicit NextPromise(ReclaimerQueue* queue) : queue_(queue) {}
+ Poll<RefCountedPtr<Handle>> operator()() { return queue_->PollNext(); }
+
+ private:
+ // Borrowed ReclaimerQueue backing this promise.
+ ReclaimerQueue* queue_;
+ };
+ GRPC_MUST_USE_RESULT NextPromise Next() { return NextPromise(this); }
+
+ private:
+ void Enqueue(RefCountedPtr<Handle> handle);
+
+ std::shared_ptr<State> state_;
+};
+
+class BasicMemoryQuota final
+ : public std::enable_shared_from_this<BasicMemoryQuota> {
+ public:
+ explicit BasicMemoryQuota(TString name) : name_(std::move(name)) {}
+
+ // Start the reclamation activity.
+ void Start();
+ // Stop the reclamation activity.
+ // Until reclamation is stopped, it's possible that circular references to the
+ // BasicMemoryQuota remain. i.e. to guarantee deletion, a singular owning
+ // object should call BasicMemoryQuota::Stop().
+ void Stop();
+
+ // Resize the quota to new_size.
+ void SetSize(size_t new_size);
+ // Forcefully take some memory from the quota, potentially entering
+ // overcommit.
+ void Take(size_t amount);
+ // Finish reclamation pass.
+ void FinishReclamation(uint64_t token, Waker waker);
+ // Return some memory to the quota.
+ void Return(size_t amount);
+ // Instantaneous memory pressure approximation.
+ std::pair<double, size_t>
+ InstantaneousPressureAndMaxRecommendedAllocationSize() const;
+ // Get a reclamation queue
+ ReclaimerQueue* reclaimer_queue(size_t i) { return &reclaimers_[i]; }
+
+ // The name of this quota
+ y_absl::string_view name() const { return name_; }
+
+ private:
+ friend class ReclamationSweep;
+ class WaitForSweepPromise;
+
+ static constexpr intptr_t kInitialSize = std::numeric_limits<intptr_t>::max();
+
+ // The amount of memory that's free in this quota.
+ // We use intptr_t as a reasonable proxy for ssize_t that's portable.
+ // We allow arbitrary overcommit and so this must allow negative values.
+ std::atomic<intptr_t> free_bytes_{kInitialSize};
+ // The total number of bytes in this quota.
+ std::atomic<size_t> quota_size_{kInitialSize};
+
+ // Reclaimer queues.
+ ReclaimerQueue reclaimers_[kNumReclamationPasses];
+ // The reclaimer activity consumes reclaimers whenever we are in overcommit to
+ // try and get back under memory limits.
+ ActivityPtr reclaimer_activity_;
+ // Each time we do a reclamation sweep, we increment this counter and give it
+ // to the sweep in question. In this way, should we choose to cancel a sweep
+ // we can do so and not get confused when the sweep reports back that it's
+ // completed.
+ // We also increment this counter on completion of a sweep, as an indicator
+ // that the wait has ended.
+ std::atomic<uint64_t> reclamation_counter_{0};
+ // The name of this quota - used for debugging/tracing/etc..
+ TString name_;
+};
+
+// MemoryAllocatorImpl grants the owner the ability to allocate memory from an
+// underlying resource quota.
+class GrpcMemoryAllocatorImpl final : public EventEngineMemoryAllocatorImpl {
+ public:
+ explicit GrpcMemoryAllocatorImpl(
+ std::shared_ptr<BasicMemoryQuota> memory_quota, TString name);
+ ~GrpcMemoryAllocatorImpl() override;
+
+ // Rebind - Swaps the underlying quota for this allocator, taking care to
+ // make sure memory allocated is moved to allocations against the new quota.
+ void Rebind(std::shared_ptr<BasicMemoryQuota> memory_quota)
+ Y_ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+
+ // Reserve bytes from the quota.
+ // If we enter overcommit, reclamation will begin concurrently.
+ // Returns the number of bytes reserved.
+ size_t Reserve(MemoryRequest request) override;
+
+ // Release some bytes that were previously reserved.
+ void Release(size_t n) override {
+ // Add the released memory to our free bytes counter... if this increases
+ // from 0 to non-zero, then we have more to do, otherwise, we're actually
+ // done.
+ if (free_bytes_.fetch_add(n, std::memory_order_release) != 0) return;
+ MaybeRegisterReclaimer();
+ }
+
+ // Post a reclamation function.
+ template <typename F>
+ void PostReclaimer(ReclamationPass pass, F fn) {
+ MutexLock lock(&memory_quota_mu_);
+ GPR_ASSERT(!shutdown_);
+ InsertReclaimer(static_cast<size_t>(pass), std::move(fn));
+ }
+
+ // Shutdown the allocator.
+ void Shutdown() override;
+
+ // Read the instantaneous memory pressure
+ double InstantaneousPressure() const {
+ MutexLock lock(&memory_quota_mu_);
+ return memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize()
+ .first;
+ }
+
+ // Name of this allocator
+ y_absl::string_view name() const { return name_; }
+
+ private:
+ // Primitive reservation function.
+ y_absl::optional<size_t> TryReserve(MemoryRequest request) GRPC_MUST_USE_RESULT;
+ // Replenish bytes from the quota, without blocking, possibly entering
+ // overcommit.
+ void Replenish() Y_ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+ // If we have not already, register a reclamation function against the quota
+ // to sweep any free memory back to that quota.
+ void MaybeRegisterReclaimer() Y_ABSL_LOCKS_EXCLUDED(memory_quota_mu_);
+ void MaybeRegisterReclaimerLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(memory_quota_mu_);
+ template <typename F>
+ void InsertReclaimer(size_t pass, F fn)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(memory_quota_mu_) {
+ reclamation_handles_[pass] =
+ memory_quota_->reclaimer_queue(pass)->Insert(std::move(fn));
+ }
+
+ // Amount of memory this allocator has cached for its own use: to avoid quota
+ // contention, each MemoryAllocator can keep some memory in addition to what
+ // it is immediately using, and the quota can pull it back under memory
+ // pressure.
+ std::atomic<size_t> free_bytes_{0};
+ // Mutex guarding the backing resource quota.
+ mutable Mutex memory_quota_mu_;
+ // Backing resource quota.
+ std::shared_ptr<BasicMemoryQuota> memory_quota_
+ Y_ABSL_GUARDED_BY(memory_quota_mu_);
+ // Amount of memory taken from the quota by this allocator.
+ size_t taken_bytes_ Y_ABSL_GUARDED_BY(memory_quota_mu_) =
+ sizeof(GrpcMemoryAllocatorImpl);
+ bool shutdown_ Y_ABSL_GUARDED_BY(memory_quota_mu_) = false;
+ bool registered_reclaimer_ Y_ABSL_GUARDED_BY(memory_quota_mu_) = false;
+ // Indices into the various reclaimer queues, used so that we can cancel
+ // reclamation should we shutdown or get rebound.
+ OrphanablePtr<ReclaimerQueue::Handle>
+ reclamation_handles_[kNumReclamationPasses] Y_ABSL_GUARDED_BY(
+ memory_quota_mu_);
+ // Name of this allocator.
+ TString name_;
+};
+
+// MemoryOwner is an enhanced MemoryAllocator that can also reclaim memory, and
+// be rebound to a different memory quota.
+// Different modules should not share a MemoryOwner between themselves, instead
+// each module that requires a MemoryOwner should create one from a resource
+// quota. This is because the MemoryOwner reclaimers are tied to the
+// MemoryOwner's lifetime, and are not queryable, so passing a MemoryOwner to a
+// new owning module means that module cannot reason about which reclaimers are
+// active, nor what they might do.
+class MemoryOwner final : public MemoryAllocator {
+ public:
+ MemoryOwner() = default;
+
+ explicit MemoryOwner(std::shared_ptr<GrpcMemoryAllocatorImpl> allocator)
+ : MemoryAllocator(std::move(allocator)) {}
+
+ // Post a reclaimer for some reclamation pass.
+ template <typename F>
+ void PostReclaimer(ReclamationPass pass, F fn) {
+ impl()->PostReclaimer(pass, std::move(fn));
+ }
+
+ // Rebind to a different quota.
+ void Rebind(MemoryQuota* quota);
+
+ // Instantaneous memory pressure in the underlying quota.
+ double InstantaneousPressure() const {
+ return impl()->InstantaneousPressure();
+ }
+
+ template <typename T, typename... Args>
+ OrphanablePtr<T> MakeOrphanable(Args&&... args) {
+ return OrphanablePtr<T>(New<T>(std::forward<Args>(args)...));
+ }
+
+ // Name of this object
+ y_absl::string_view name() const { return impl()->name(); }
+
+ // Is this object valid (ie has not been moved out of or reset)
+ bool is_valid() const { return impl() != nullptr; }
+
+ private:
+ const GrpcMemoryAllocatorImpl* impl() const {
+ return static_cast<const GrpcMemoryAllocatorImpl*>(get_internal_impl_ptr());
+ }
+
+ GrpcMemoryAllocatorImpl* impl() {
+ return static_cast<GrpcMemoryAllocatorImpl*>(get_internal_impl_ptr());
+ }
+};
+
+// MemoryQuota tracks the amount of memory available as part of a ResourceQuota.
+class MemoryQuota final
+ : public grpc_event_engine::experimental::MemoryAllocatorFactory {
+ public:
+ explicit MemoryQuota(TString name)
+ : memory_quota_(std::make_shared<BasicMemoryQuota>(std::move(name))) {
+ memory_quota_->Start();
+ }
+ ~MemoryQuota() override {
+ if (memory_quota_ != nullptr) memory_quota_->Stop();
+ }
+
+ MemoryQuota(const MemoryQuota&) = delete;
+ MemoryQuota& operator=(const MemoryQuota&) = delete;
+ MemoryQuota(MemoryQuota&&) = default;
+ MemoryQuota& operator=(MemoryQuota&&) = default;
+
+ MemoryAllocator CreateMemoryAllocator(y_absl::string_view name) override;
+ MemoryOwner CreateMemoryOwner(y_absl::string_view name);
+
+ // Resize the quota to new_size.
+ void SetSize(size_t new_size) { memory_quota_->SetSize(new_size); }
+
+ // Return true if the instantaneous memory pressure is high.
+ bool IsMemoryPressureHigh() const {
+ static constexpr double kMemoryPressureHighThreshold = 0.9;
+ return memory_quota_->InstantaneousPressureAndMaxRecommendedAllocationSize()
+ .first > kMemoryPressureHighThreshold;
+ }
+
+ private:
+ friend class MemoryOwner;
+ std::shared_ptr<BasicMemoryQuota> memory_quota_;
+};
+
+using MemoryQuotaRefPtr = std::shared_ptr<MemoryQuota>;
+inline MemoryQuotaRefPtr MakeMemoryQuota(TString name) {
+ return std::make_shared<MemoryQuota>(std::move(name));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_MEMORY_QUOTA_H
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.cc b/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.cc
new file mode 100644
index 00000000000..16510ee68f4
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.cc
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/resource_quota/resource_quota.h"
+
+namespace grpc_core {
+
+ResourceQuota::ResourceQuota(TString name)
+ : memory_quota_(MakeMemoryQuota(std::move(name))),
+ thread_quota_(MakeRefCounted<ThreadQuota>()) {}
+
+ResourceQuota::~ResourceQuota() = default;
+
+ResourceQuotaRefPtr ResourceQuota::Default() {
+ static auto default_resource_quota =
+ MakeResourceQuota("default_resource_quota").release();
+ return default_resource_quota->Ref();
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.h b/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.h
new file mode 100644
index 00000000000..a9c21d8bcef
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/resource_quota.h
@@ -0,0 +1,58 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/impl/codegen/grpc_types.h>
+
+#include "src/core/lib/gprpp/cpp_impl_of.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
+#include "src/core/lib/resource_quota/thread_quota.h"
+
+namespace grpc_core {
+
+class ResourceQuota;
+using ResourceQuotaRefPtr = RefCountedPtr<ResourceQuota>;
+
+class ResourceQuota : public RefCounted<ResourceQuota>,
+ public CppImplOf<ResourceQuota, grpc_resource_quota> {
+ public:
+ explicit ResourceQuota(TString name);
+ ~ResourceQuota() override;
+
+ ResourceQuota(const ResourceQuota&) = delete;
+ ResourceQuota& operator=(const ResourceQuota&) = delete;
+
+ MemoryQuotaRefPtr memory_quota() { return memory_quota_; }
+
+ const RefCountedPtr<ThreadQuota>& thread_quota() { return thread_quota_; }
+
+ // The default global resource quota
+ static ResourceQuotaRefPtr Default();
+
+ private:
+ MemoryQuotaRefPtr memory_quota_;
+ RefCountedPtr<ThreadQuota> thread_quota_;
+};
+
+inline ResourceQuotaRefPtr MakeResourceQuota(TString name) {
+ return MakeRefCounted<ResourceQuota>(std::move(name));
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_RESOURCE_QUOTA_H
diff --git a/contrib/libs/grpc/src/core/lib/transport/authority_override.h b/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.cc
index 27d999c5f26..c935be0d7f2 100644
--- a/contrib/libs/grpc/src/core/lib/transport/authority_override.h
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.cc
@@ -1,5 +1,4 @@
-//
-// Copyright 2020 gRPC authors.
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,26 +11,33 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-//
-
-#ifndef GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
-#define GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H
#include <grpc/support/port_platform.h>
-#include "y_absl/strings/string_view.h"
-
-#include <grpc/grpc.h>
+#include "src/core/lib/resource_quota/thread_quota.h"
namespace grpc_core {
-/// Returns a channel argument containing \a authority.
-grpc_arg CreateAuthorityOverrideChannelArg(const char* authority);
+ThreadQuota::ThreadQuota() = default;
-/// Returns the authority override from \a args or the empty string. The return
-/// value is a string_view into the `args` data structure.
-y_absl::string_view FindAuthorityOverrideInArgs(const grpc_channel_args* args);
+ThreadQuota::~ThreadQuota() = default;
-} // namespace grpc_core
+void ThreadQuota::SetMax(size_t new_max) {
+ MutexLock lock(&mu_);
+ max_ = new_max;
+}
+
+bool ThreadQuota::Reserve(size_t num_threads) {
+ MutexLock lock(&mu_);
+ if (allocated_ + num_threads > max_) return false;
+ allocated_ += num_threads;
+ return true;
+}
-#endif /* GRPC_CORE_LIB_TRANSPORT_AUTHORITY_OVERRIDE_H */
+void ThreadQuota::Release(size_t num_threads) {
+ MutexLock lock(&mu_);
+ GPR_ASSERT(num_threads <= allocated_);
+ allocated_ -= num_threads;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.h b/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.h
new file mode 100644
index 00000000000..3d5edcc55c3
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/thread_quota.h
@@ -0,0 +1,57 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_THREAD_QUOTA_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_THREAD_QUOTA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstddef>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc_core {
+
+// Tracks the amount of threads in a resource quota.
+class ThreadQuota : public RefCounted<ThreadQuota> {
+ public:
+ ThreadQuota();
+ ~ThreadQuota() override;
+
+ ThreadQuota(const ThreadQuota&) = delete;
+ ThreadQuota& operator=(const ThreadQuota&) = delete;
+
+ // Set the maximum number of threads that can be used by this quota.
+ // If there are more, new reservations will fail until the quota is available.
+ void SetMax(size_t new_max);
+
+ // Try to allocate some number of threads.
+ // Returns true if the allocation succeeded, false otherwise.
+ bool Reserve(size_t num_threads);
+
+ // Release some number of threads.
+ void Release(size_t num_threads);
+
+ private:
+ Mutex mu_;
+ size_t allocated_ Y_ABSL_GUARDED_BY(mu_) = 0;
+ size_t max_ Y_ABSL_GUARDED_BY(mu_) = std::numeric_limits<size_t>::max();
+};
+
+using ThreadQuotaPtr = RefCountedPtr<ThreadQuota>;
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_THREAD_QUOTA_H
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/trace.cc b/contrib/libs/grpc/src/core/lib/resource_quota/trace.cc
new file mode 100644
index 00000000000..51e6cb01657
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/trace.cc
@@ -0,0 +1,19 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/resource_quota/trace.h"
+
+grpc_core::TraceFlag grpc_resource_quota_trace(false, "resource_quota");
diff --git a/contrib/libs/grpc/src/core/lib/resource_quota/trace.h b/contrib/libs/grpc/src/core/lib/resource_quota/trace.h
new file mode 100644
index 00000000000..8964746fea2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/resource_quota/trace.h
@@ -0,0 +1,24 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_RESOURCE_QUOTA_TRACE_H
+#define GRPC_CORE_LIB_RESOURCE_QUOTA_TRACE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/debug/trace.h"
+
+extern grpc_core::TraceFlag grpc_resource_quota_trace;
+
+#endif // GRPC_CORE_LIB_RESOURCE_QUOTA_TRACE_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
index 24cded28a36..83d0bf15d49 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_engine.h
@@ -1,5 +1,4 @@
-
-// Copyright 2020 gRPC authors.
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -18,67 +17,28 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
-#include <map>
-#include <memory>
#include <util/generic/string.h>
-#include <vector>
-
-#include "y_absl/container/flat_hash_set.h"
-#include "envoy/config/rbac/v3/rbac.upb.h"
-#include "google/api/expr/v1alpha1/syntax.upb.h"
-#include "upb/upb.hpp"
+#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/authorization/evaluate_args.h"
-#include "src/core/lib/security/authorization/mock_cel/activation.h"
namespace grpc_core {
-// AuthorizationEngine makes an AuthorizationDecision to ALLOW or DENY the
-// current action based on the condition fields in provided RBAC policies.
-// The engine may be constructed with one or two policies. If two polcies,
-// the first policy is deny-if-matched and the second is allow-if-matched.
-// The engine returns UNDECIDED decision if it fails to find a match in any
-// policy. This engine ignores the principal and permission fields in RBAC
-// policies. It is the caller's responsibility to provide RBAC policies that
-// are compatible with this engine.
-//
-// Example:
-// AuthorizationEngine*
-// auth_engine = AuthorizationEngine::CreateAuthorizationEngine(rbac_policies);
-// auth_engine->Evaluate(evaluate_args); // returns authorization decision.
-class AuthorizationEngine {
+// Interface for gRPC Authorization Engine.
+class AuthorizationEngine : public RefCounted<AuthorizationEngine> {
public:
- // rbac_policies must be a vector containing either a single policy of any
- // kind, or one deny policy and one allow policy, in that order.
- static std::unique_ptr<AuthorizationEngine> CreateAuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
-
- // Users should use the CreateAuthorizationEngine factory function
- // instead of calling the AuthorizationEngine constructor directly.
- explicit AuthorizationEngine(
- const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
- // TODO(mywang@google.com): add an Evaluate member function.
-
- private:
- enum Action {
- kAllow,
- kDeny,
+ struct Decision {
+ enum class Type {
+ kAllow,
+ kDeny,
+ };
+ Type type;
+ TString matching_policy_name;
};
- std::unique_ptr<mock_cel::Activation> CreateActivation(
- const EvaluateArgs& args);
-
- std::map<const TString, const google_api_expr_v1alpha1_Expr*>
- deny_if_matched_;
- std::map<const TString, const google_api_expr_v1alpha1_Expr*>
- allow_if_matched_;
- upb::Arena arena_;
- y_absl::flat_hash_set<TString> envoy_attributes_;
- y_absl::flat_hash_set<TString> header_keys_;
- std::unique_ptr<mock_cel::CelMap> headers_;
+ virtual Decision Evaluate(const EvaluateArgs& args) const = 0;
};
} // namespace grpc_core
-#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H */
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_ENGINE_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider.h b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider.h
new file mode 100644
index 00000000000..7db900676bb
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider.h
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/gprpp/dual_ref_counted.h"
+#include "src/core/lib/security/authorization/authorization_engine.h"
+
+struct grpc_authorization_policy_provider
+ : public grpc_core::DualRefCounted<grpc_authorization_policy_provider> {
+ public:
+ struct AuthorizationEngines {
+ grpc_core::RefCountedPtr<grpc_core::AuthorizationEngine> allow_engine;
+ grpc_core::RefCountedPtr<grpc_core::AuthorizationEngine> deny_engine;
+ };
+ virtual AuthorizationEngines engines() = 0;
+};
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc
new file mode 100644
index 00000000000..1f1ccc984bb
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_null_vtable.cc
@@ -0,0 +1,24 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/grpc.h>
+
+// Wrapper API declared in grpc.h
+
+// Required only for insecure build targets.
+const grpc_arg_pointer_vtable* grpc_authorization_policy_provider_arg_vtable() {
+ return nullptr;
+}
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
new file mode 100644
index 00000000000..f8a4426ea41
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/authorization_policy_provider_vtable.cc
@@ -0,0 +1,46 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/grpc.h>
+
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+
+namespace {
+
+void* ProviderArgCopy(void* p) {
+ grpc_authorization_policy_provider* provider =
+ static_cast<grpc_authorization_policy_provider*>(p);
+ provider->Ref().release();
+ return provider;
+}
+
+void ProviderArgDestroy(void* p) {
+ grpc_authorization_policy_provider* provider =
+ static_cast<grpc_authorization_policy_provider*>(p);
+ provider->Unref();
+}
+
+int ProviderArgCmp(void* p, void* q) { return grpc_core::QsortCompare(p, q); }
+
+} // namespace
+
+// Wrapper API declared in grpc.h
+
+const grpc_arg_pointer_vtable* grpc_authorization_policy_provider_arg_vtable() {
+ static const grpc_arg_pointer_vtable vtable = {
+ ProviderArgCopy, ProviderArgDestroy, ProviderArgCmp};
+ return &vtable;
+}
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h
new file mode 100644
index 00000000000..53d27369b10
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/cel_authorization_engine.h
@@ -0,0 +1,85 @@
+
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <map>
+#include <memory>
+#include <util/generic/string.h>
+#include <vector>
+
+#include "y_absl/container/flat_hash_set.h"
+#include "envoy/config/rbac/v3/rbac.upb.h"
+#include "google/api/expr/v1alpha1/syntax.upb.h"
+#include "upb/upb.hpp"
+
+#include <grpc/support/log.h>
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/security/authorization/mock_cel/activation.h"
+
+namespace grpc_core {
+
+// CelAuthorizationEngine makes an AuthorizationDecision to ALLOW or DENY the
+// current action based on the condition fields in provided RBAC policies.
+// The engine may be constructed with one or two policies. If two polcies,
+// the first policy is deny-if-matched and the second is allow-if-matched.
+// The engine returns UNDECIDED decision if it fails to find a match in any
+// policy. This engine ignores the principal and permission fields in RBAC
+// policies. It is the caller's responsibility to provide RBAC policies that
+// are compatible with this engine.
+//
+// Example:
+// CelAuthorizationEngine* engine =
+// CelAuthorizationEngine::CreateCelAuthorizationEngine(rbac_policies);
+// engine->Evaluate(evaluate_args); // returns authorization decision.
+class CelAuthorizationEngine {
+ public:
+ // rbac_policies must be a vector containing either a single policy of any
+ // kind, or one deny policy and one allow policy, in that order.
+ static std::unique_ptr<CelAuthorizationEngine> CreateCelAuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
+
+ // Users should use the CreateCelAuthorizationEngine factory function
+ // instead of calling the CelAuthorizationEngine constructor directly.
+ explicit CelAuthorizationEngine(
+ const std::vector<envoy_config_rbac_v3_RBAC*>& rbac_policies);
+ // TODO(mywang@google.com): add an Evaluate member function.
+
+ private:
+ enum Action {
+ kAllow,
+ kDeny,
+ };
+
+ std::unique_ptr<mock_cel::Activation> CreateActivation(
+ const EvaluateArgs& args);
+
+ std::map<const TString, const google_api_expr_v1alpha1_Expr*>
+ deny_if_matched_;
+ std::map<const TString, const google_api_expr_v1alpha1_Expr*>
+ allow_if_matched_;
+ upb::Arena arena_;
+ y_absl::flat_hash_set<TString> envoy_attributes_;
+ y_absl::flat_hash_set<TString> header_keys_;
+ std::unique_ptr<mock_cel::CelMap> headers_;
+};
+
+} // namespace grpc_core
+
+#endif /* GRPC_CORE_LIB_SECURITY_AUTHORIZATION_CEL_AUTHORIZATION_ENGINE_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
new file mode 100644
index 00000000000..84a6bc2d910
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.cc
@@ -0,0 +1,207 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+
+#include "y_absl/strings/numbers.h"
+
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
+#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/security/credentials/tls/tls_utils.h"
+#include "src/core/lib/slice/slice_utils.h"
+
+namespace grpc_core {
+
+namespace {
+
+EvaluateArgs::PerChannelArgs::Address ParseEndpointUri(
+ y_absl::string_view uri_text) {
+ EvaluateArgs::PerChannelArgs::Address address;
+ y_absl::StatusOr<URI> uri = URI::Parse(uri_text);
+ if (!uri.ok()) {
+ gpr_log(GPR_DEBUG, "Failed to parse uri.");
+ return address;
+ }
+ y_absl::string_view host_view;
+ y_absl::string_view port_view;
+ if (!SplitHostPort(uri->path(), &host_view, &port_view)) {
+ gpr_log(GPR_DEBUG, "Failed to split %s into host and port.",
+ uri->path().c_str());
+ return address;
+ }
+ if (!y_absl::SimpleAtoi(port_view, &address.port)) {
+ gpr_log(GPR_DEBUG, "Port %s is out of range or null.",
+ TString(port_view).c_str());
+ }
+ address.address_str = TString(host_view);
+ grpc_error_handle error = grpc_string_to_sockaddr(
+ &address.address, address.address_str.c_str(), address.port);
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_DEBUG, "Address %s is not IPv4/IPv6. Error: %s",
+ address.address_str.c_str(), grpc_error_std_string(error).c_str());
+ }
+ GRPC_ERROR_UNREF(error);
+ return address;
+}
+
+} // namespace
+
+EvaluateArgs::PerChannelArgs::PerChannelArgs(grpc_auth_context* auth_context,
+ grpc_endpoint* endpoint) {
+ if (auth_context != nullptr) {
+ transport_security_type = GetAuthPropertyValue(
+ auth_context, GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME);
+ spiffe_id =
+ GetAuthPropertyValue(auth_context, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME);
+ uri_sans = GetAuthPropertyArray(auth_context, GRPC_PEER_URI_PROPERTY_NAME);
+ dns_sans = GetAuthPropertyArray(auth_context, GRPC_PEER_DNS_PROPERTY_NAME);
+ common_name =
+ GetAuthPropertyValue(auth_context, GRPC_X509_CN_PROPERTY_NAME);
+ subject =
+ GetAuthPropertyValue(auth_context, GRPC_X509_SUBJECT_PROPERTY_NAME);
+ }
+ if (endpoint != nullptr) {
+ local_address = ParseEndpointUri(grpc_endpoint_get_local_address(endpoint));
+ peer_address = ParseEndpointUri(grpc_endpoint_get_peer(endpoint));
+ }
+}
+
+y_absl::string_view EvaluateArgs::GetPath() const {
+ y_absl::string_view path;
+ if (metadata_ != nullptr &&
+ metadata_->legacy_index()->named.path != nullptr) {
+ grpc_linked_mdelem* elem = metadata_->legacy_index()->named.path;
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ path = StringViewFromSlice(val);
+ }
+ return path;
+}
+
+y_absl::string_view EvaluateArgs::GetHost() const {
+ y_absl::string_view host;
+ if (metadata_ != nullptr) {
+ if (auto* host_md = metadata_->get_pointer(HostMetadata())) {
+ host = host_md->as_string_view();
+ }
+ }
+ return host;
+}
+
+y_absl::string_view EvaluateArgs::GetMethod() const {
+ y_absl::string_view method;
+ if (metadata_ != nullptr &&
+ metadata_->legacy_index()->named.method != nullptr) {
+ grpc_linked_mdelem* elem = metadata_->legacy_index()->named.method;
+ const grpc_slice& val = GRPC_MDVALUE(elem->md);
+ method = StringViewFromSlice(val);
+ }
+ return method;
+}
+
+y_absl::optional<y_absl::string_view> EvaluateArgs::GetHeaderValue(
+ y_absl::string_view key, TString* concatenated_value) const {
+ if (metadata_ == nullptr) {
+ return y_absl::nullopt;
+ }
+ return metadata_->GetValue(key, concatenated_value);
+}
+
+grpc_resolved_address EvaluateArgs::GetLocalAddress() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->local_address.address;
+}
+
+y_absl::string_view EvaluateArgs::GetLocalAddressString() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->local_address.address_str;
+}
+
+int EvaluateArgs::GetLocalPort() const {
+ if (channel_args_ == nullptr) {
+ return 0;
+ }
+ return channel_args_->local_address.port;
+}
+
+grpc_resolved_address EvaluateArgs::GetPeerAddress() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->peer_address.address;
+}
+
+y_absl::string_view EvaluateArgs::GetPeerAddressString() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->peer_address.address_str;
+}
+
+int EvaluateArgs::GetPeerPort() const {
+ if (channel_args_ == nullptr) {
+ return 0;
+ }
+ return channel_args_->peer_address.port;
+}
+
+y_absl::string_view EvaluateArgs::GetTransportSecurityType() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->transport_security_type;
+}
+
+y_absl::string_view EvaluateArgs::GetSpiffeId() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->spiffe_id;
+}
+
+std::vector<y_absl::string_view> EvaluateArgs::GetUriSans() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->uri_sans;
+}
+
+std::vector<y_absl::string_view> EvaluateArgs::GetDnsSans() const {
+ if (channel_args_ == nullptr) {
+ return {};
+ }
+ return channel_args_->dns_sans;
+}
+
+y_absl::string_view EvaluateArgs::GetCommonName() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->common_name;
+}
+
+y_absl::string_view EvaluateArgs::GetSubject() const {
+ if (channel_args_ == nullptr) {
+ return "";
+ }
+ return channel_args_->subject;
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
index 1a2590c72b9..c9f588e93f9 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/evaluate_args.h
@@ -1,6 +1,4 @@
-//
-//
-// Copyright 2020 gRPC authors.
+// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,8 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-//
-//
#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_EVALUATE_ARGS_H
@@ -26,6 +22,7 @@
#include "y_absl/types/optional.h"
#include "src/core/lib/iomgr/endpoint.h"
+#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -33,14 +30,35 @@ namespace grpc_core {
class EvaluateArgs {
public:
- EvaluateArgs(grpc_metadata_batch* metadata, grpc_auth_context* auth_context,
- grpc_endpoint* endpoint)
- : metadata_(metadata), auth_context_(auth_context), endpoint_(endpoint) {}
+ // Caller is responsible for ensuring auth_context outlives PerChannelArgs
+ // struct.
+ struct PerChannelArgs {
+ struct Address {
+ // The address in sockaddr form.
+ grpc_resolved_address address;
+ // The same address with only the host part.
+ TString address_str;
+ int port = 0;
+ };
+
+ PerChannelArgs(grpc_auth_context* auth_context, grpc_endpoint* endpoint);
+
+ y_absl::string_view transport_security_type;
+ y_absl::string_view spiffe_id;
+ std::vector<y_absl::string_view> uri_sans;
+ std::vector<y_absl::string_view> dns_sans;
+ y_absl::string_view common_name;
+ y_absl::string_view subject;
+ Address local_address;
+ Address peer_address;
+ };
+
+ EvaluateArgs(grpc_metadata_batch* metadata, PerChannelArgs* channel_args)
+ : metadata_(metadata), channel_args_(channel_args) {}
y_absl::string_view GetPath() const;
y_absl::string_view GetHost() const;
y_absl::string_view GetMethod() const;
- std::multimap<y_absl::string_view, y_absl::string_view> GetHeaders() const;
// Returns metadata value(s) for the specified key.
// If the key is not present in the batch, returns y_absl::nullopt.
// If the key is present exactly once in the batch, returns a string_view of
@@ -50,19 +68,23 @@ class EvaluateArgs {
// string_view of that string.
y_absl::optional<y_absl::string_view> GetHeaderValue(
y_absl::string_view key, TString* concatenated_value) const;
- y_absl::string_view GetLocalAddress() const;
+
+ grpc_resolved_address GetLocalAddress() const;
+ y_absl::string_view GetLocalAddressString() const;
int GetLocalPort() const;
- y_absl::string_view GetPeerAddress() const;
+ grpc_resolved_address GetPeerAddress() const;
+ y_absl::string_view GetPeerAddressString() const;
int GetPeerPort() const;
+ y_absl::string_view GetTransportSecurityType() const;
y_absl::string_view GetSpiffeId() const;
- y_absl::string_view GetCertServerName() const;
-
- // TODO(unknown): Add a getter function for source.principal
+ std::vector<y_absl::string_view> GetUriSans() const;
+ std::vector<y_absl::string_view> GetDnsSans() const;
+ y_absl::string_view GetCommonName() const;
+ y_absl::string_view GetSubject() const;
private:
grpc_metadata_batch* metadata_;
- grpc_auth_context* auth_context_;
- grpc_endpoint* endpoint_;
+ PerChannelArgs* channel_args_;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h
new file mode 100644
index 00000000000..0e958afcdb6
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_engine.h
@@ -0,0 +1,60 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/authorization/authorization_engine.h"
+#include "src/core/lib/security/authorization/matchers.h"
+#include "src/core/lib/security/authorization/rbac_policy.h"
+
+namespace grpc_core {
+
+// GrpcAuthorizationEngine can be either an Allow engine or Deny engine. This
+// engine makes authorization decisions to Allow or Deny incoming RPC request
+// based on permission and principal configs in the provided RBAC policy and the
+// engine type. This engine ignores condition field in RBAC config. It is the
+// caller's responsibility to provide RBAC policies that are compatible with
+// this engine.
+class GrpcAuthorizationEngine : public AuthorizationEngine {
+ public:
+ // Builds GrpcAuthorizationEngine without any policies.
+ explicit GrpcAuthorizationEngine(Rbac::Action action) : action_(action) {}
+ // Builds GrpcAuthorizationEngine with allow/deny RBAC policy.
+ explicit GrpcAuthorizationEngine(Rbac policy);
+
+ Rbac::Action action() { return action_; }
+
+ // Required only for testing purpose.
+ size_t num_policies() { return policies_.size(); }
+
+ // Evaluates incoming request against RBAC policy and makes a decision to
+ // whether allow/deny this request.
+ Decision Evaluate(const EvaluateArgs& args) const override;
+
+ private:
+ struct Policy {
+ TString name;
+ std::unique_ptr<AuthorizationMatcher> matcher;
+ };
+
+ Rbac::Action action_;
+ std::vector<Policy> policies_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_ENGINE_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h
new file mode 100644
index 00000000000..bd521d66d67
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/grpc_authorization_policy_provider.h
@@ -0,0 +1,103 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "y_absl/status/statusor.h"
+
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+#include "src/core/lib/security/authorization/rbac_translator.h"
+
+namespace grpc_core {
+
+// Provider class will get SDK Authorization policy from string during
+// initialization. This policy will be translated to Envoy RBAC policies and
+// used to initialize allow and deny AuthorizationEngine objects. This provider
+// will return the same authorization engines everytime.
+class StaticDataAuthorizationPolicyProvider
+ : public grpc_authorization_policy_provider {
+ public:
+ static y_absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+ Create(y_absl::string_view authz_policy);
+
+ // Use factory method "Create" to create an instance of
+ // StaticDataAuthorizationPolicyProvider.
+ explicit StaticDataAuthorizationPolicyProvider(RbacPolicies policies);
+
+ AuthorizationEngines engines() override {
+ return {allow_engine_, deny_engine_};
+ }
+
+ void Orphan() override {}
+
+ private:
+ RefCountedPtr<AuthorizationEngine> allow_engine_;
+ RefCountedPtr<AuthorizationEngine> deny_engine_;
+};
+
+// Provider class will get SDK Authorization policy from provided file path.
+// This policy will be translated to Envoy RBAC policies and used to initialize
+// allow and deny AuthorizationEngine objects. This provider will periodically
+// load file contents in specified path, and upon modification update the engine
+// instances with new policy configuration. During reload if the file contents
+// are invalid or there are I/O errors, we will skip that particular update and
+// log error status. The authorization decisions will be made using the latest
+// valid policy.
+class FileWatcherAuthorizationPolicyProvider
+ : public grpc_authorization_policy_provider {
+ public:
+ static y_absl::StatusOr<RefCountedPtr<grpc_authorization_policy_provider>>
+ Create(y_absl::string_view authz_policy_path,
+ unsigned int refresh_interval_sec);
+
+ // Use factory method "Create" to create an instance of
+ // FileWatcherAuthorizationPolicyProvider.
+ FileWatcherAuthorizationPolicyProvider(y_absl::string_view authz_policy_path,
+ unsigned int refresh_interval_sec,
+ y_absl::Status* status);
+
+ void Orphan() override;
+
+ AuthorizationEngines engines() override {
+ MutexLock lock(&mu_);
+ return {allow_engine_, deny_engine_};
+ }
+
+ private:
+ // Force an update from the file system regardless of the interval.
+ y_absl::Status ForceUpdate();
+
+ TString authz_policy_path_;
+ TString file_contents_;
+ unsigned int refresh_interval_sec_;
+
+ std::unique_ptr<Thread> refresh_thread_;
+ gpr_event shutdown_event_;
+
+ Mutex mu_;
+ // Engines created using authz_policy_.
+ RefCountedPtr<AuthorizationEngine> allow_engine_ Y_ABSL_GUARDED_BY(mu_);
+ RefCountedPtr<AuthorizationEngine> deny_engine_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_GRPC_AUTHORIZATION_POLICY_PROVIDER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h b/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h
new file mode 100644
index 00000000000..95ebd515837
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/matchers.h
@@ -0,0 +1,197 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H
+
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+#include "src/core/lib/matchers/matchers.h"
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/security/authorization/rbac_policy.h"
+
+namespace grpc_core {
+
+// Describes the rules for matching permission or principal.
+class AuthorizationMatcher {
+ public:
+ virtual ~AuthorizationMatcher() = default;
+
+ // Returns whether or not the permission/principal matches the rules of the
+ // matcher.
+ virtual bool Matches(const EvaluateArgs& args) const = 0;
+
+ // Creates an instance of a matcher based off the rules defined in Permission
+ // config.
+ static std::unique_ptr<AuthorizationMatcher> Create(
+ Rbac::Permission permission);
+
+ // Creates an instance of a matcher based off the rules defined in Principal
+ // config.
+ static std::unique_ptr<AuthorizationMatcher> Create(
+ Rbac::Principal principal);
+};
+
+class AlwaysAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit AlwaysAuthorizationMatcher() = default;
+
+ bool Matches(const EvaluateArgs&) const override { return true; }
+};
+
+class AndAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit AndAuthorizationMatcher(
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers)
+ : matchers_(std::move(matchers)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_;
+};
+
+class OrAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit OrAuthorizationMatcher(
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers)
+ : matchers_(std::move(matchers)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ std::vector<std::unique_ptr<AuthorizationMatcher>> matchers_;
+};
+
+// Negates matching the provided permission/principal.
+class NotAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit NotAuthorizationMatcher(
+ std::unique_ptr<AuthorizationMatcher> matcher)
+ : matcher_(std::move(matcher)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ std::unique_ptr<AuthorizationMatcher> matcher_;
+};
+
+// TODO(ashithasantosh): Add matcher implementation for metadata field.
+
+// Perform a match against HTTP headers.
+class HeaderAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit HeaderAuthorizationMatcher(HeaderMatcher matcher)
+ : matcher_(std::move(matcher)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ const HeaderMatcher matcher_;
+};
+
+// Perform a match against IP Cidr Range.
+class IpAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ enum class Type {
+ kDestIp,
+ kSourceIp,
+ kDirectRemoteIp,
+ kRemoteIp,
+ };
+
+ IpAuthorizationMatcher(Type type, Rbac::CidrRange range);
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ const Type type_;
+ // Subnet masked address.
+ grpc_resolved_address subnet_address_;
+ const uint32_t prefix_len_;
+};
+
+// Perform a match against port number of the destination (local) address.
+class PortAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit PortAuthorizationMatcher(int port) : port_(port) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ const int port_;
+};
+
+// Matches the principal name as described in the peer certificate. Uses URI SAN
+// or DNS SAN in that order, otherwise uses subject field.
+class AuthenticatedAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit AuthenticatedAuthorizationMatcher(StringMatcher auth)
+ : matcher_(std::move(auth)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ const StringMatcher matcher_;
+};
+
+// Perform a match against the request server from the client's connection
+// request. This is typically TLS SNI. Currently unsupported.
+class ReqServerNameAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit ReqServerNameAuthorizationMatcher(
+ StringMatcher requested_server_name)
+ : matcher_(std::move(requested_server_name)) {}
+
+ bool Matches(const EvaluateArgs&) const override;
+
+ private:
+ const StringMatcher matcher_;
+};
+
+// Perform a match against the path header of HTTP request.
+class PathAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit PathAuthorizationMatcher(StringMatcher path)
+ : matcher_(std::move(path)) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ const StringMatcher matcher_;
+};
+
+// Performs a match for policy field in RBAC, which is a collection of
+// permission and principal matchers. Policy matches iff, we find a match in one
+// of its permissions and a match in one of its principals.
+class PolicyAuthorizationMatcher : public AuthorizationMatcher {
+ public:
+ explicit PolicyAuthorizationMatcher(Rbac::Policy policy)
+ : permissions_(
+ AuthorizationMatcher::Create(std::move(policy.permissions))),
+ principals_(
+ AuthorizationMatcher::Create(std::move(policy.principals))) {}
+
+ bool Matches(const EvaluateArgs& args) const override;
+
+ private:
+ std::unique_ptr<AuthorizationMatcher> permissions_;
+ std::unique_ptr<AuthorizationMatcher> principals_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MATCHERS_H
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
index f1ee0b7adb7..2b4c3666e7c 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/cel_expression.h
@@ -21,8 +21,8 @@
#include <vector>
#include "y_absl/status/statusor.h"
-
#include "google/api/expr/v1alpha1/syntax.upb.h"
+
#include "src/core/lib/security/authorization/mock_cel/activation.h"
#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
index 0e01204b800..e6d4aea7431 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/mock_cel/evaluator_core.h
@@ -22,8 +22,8 @@
#include <vector>
#include "y_absl/status/statusor.h"
-
#include "google/api/expr/v1alpha1/syntax.upb.h"
+
#include "src/core/lib/security/authorization/mock_cel/activation.h"
#include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h
index 486cf74604c..eb691b0ec99 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_policy.h
@@ -27,8 +27,8 @@ namespace grpc_core {
// https://github.com/envoyproxy/envoy/blob/release/v1.17/api/envoy/config/rbac/v3/rbac.proto]
struct Rbac {
enum class Action {
- ALLOW,
- DENY,
+ kAllow,
+ kDeny,
};
struct CidrRange {
@@ -47,33 +47,33 @@ struct Rbac {
// TODO(ashithasantosh): Add metadata field to Permission and Principal.
struct Permission {
enum class RuleType {
- AND,
- OR,
- ANY,
- HEADER,
- PATH,
- DEST_IP,
- DEST_PORT,
- REQ_SERVER_NAME,
+ kAnd,
+ kOr,
+ kNot,
+ kAny,
+ kHeader,
+ kPath,
+ kDestIp,
+ kDestPort,
+ kReqServerName,
};
Permission() = default;
- // For AND/OR RuleType.
+ // For kAnd/kOr RuleType.
Permission(Permission::RuleType type,
- std::vector<std::unique_ptr<Permission>> permissions,
- bool not_rule = false);
- // For ANY RuleType.
- explicit Permission(Permission::RuleType type, bool not_rule = false);
- // For HEADER RuleType.
- Permission(Permission::RuleType type, HeaderMatcher header_matcher,
- bool not_rule = false);
- // For PATH/REQ_SERVER_NAME RuleType.
- Permission(Permission::RuleType type, StringMatcher string_matcher,
- bool not_rule = false);
- // For DEST_IP RuleType.
- Permission(Permission::RuleType type, CidrRange ip, bool not_rule = false);
- // For DEST_PORT RuleType.
- Permission(Permission::RuleType type, int port, bool not_rule = false);
+ std::vector<std::unique_ptr<Permission>> permissions);
+ // For kNot RuleType.
+ Permission(Permission::RuleType type, Permission permission);
+ // For kAny RuleType.
+ explicit Permission(Permission::RuleType type);
+ // For kHeader RuleType.
+ Permission(Permission::RuleType type, HeaderMatcher header_matcher);
+ // For kPath/kReqServerName RuleType.
+ Permission(Permission::RuleType type, StringMatcher string_matcher);
+ // For kDestIp RuleType.
+ Permission(Permission::RuleType type, CidrRange ip);
+ // For kDestPort RuleType.
+ Permission(Permission::RuleType type, int port);
Permission(Permission&& other) noexcept;
Permission& operator=(Permission&& other) noexcept;
@@ -85,39 +85,39 @@ struct Rbac {
StringMatcher string_matcher;
CidrRange ip;
int port;
- // For type AND/OR.
+ // For type kAnd/kOr/kNot. For kNot type, the vector will have only one
+ // element.
std::vector<std::unique_ptr<Permission>> permissions;
- bool not_rule = false;
};
struct Principal {
enum class RuleType {
- AND,
- OR,
- ANY,
- PRINCIPAL_NAME,
- SOURCE_IP,
- DIRECT_REMOTE_IP,
- REMOTE_IP,
- HEADER,
- PATH,
+ kAnd,
+ kOr,
+ kNot,
+ kAny,
+ kPrincipalName,
+ kSourceIp,
+ kDirectRemoteIp,
+ kRemoteIp,
+ kHeader,
+ kPath,
};
Principal() = default;
- // For AND/OR RuleType.
+ // For kAnd/kOr RuleType.
Principal(Principal::RuleType type,
- std::vector<std::unique_ptr<Principal>> principals,
- bool not_rule = false);
- // For ANY RuleType.
- explicit Principal(Principal::RuleType type, bool not_rule = false);
- // For PRINCIPAL_NAME/PATH RuleType.
- Principal(Principal::RuleType type, StringMatcher string_matcher,
- bool not_rule = false);
- // For SOURCE_IP/DIRECT_REMOTE_IP/REMOTE_IP RuleType.
- Principal(Principal::RuleType type, CidrRange ip, bool not_rule = false);
- // For HEADER RuleType.
- Principal(Principal::RuleType type, HeaderMatcher header_matcher,
- bool not_rule = false);
+ std::vector<std::unique_ptr<Principal>> principals);
+ // For kNot RuleType.
+ Principal(Principal::RuleType type, Principal principal);
+ // For kAny RuleType.
+ explicit Principal(Principal::RuleType type);
+ // For kPrincipalName/kPath RuleType.
+ Principal(Principal::RuleType type, StringMatcher string_matcher);
+ // For kSourceIp/kDirectRemoteIp/kRemoteIp RuleType.
+ Principal(Principal::RuleType type, CidrRange ip);
+ // For kHeader RuleType.
+ Principal(Principal::RuleType type, HeaderMatcher header_matcher);
Principal(Principal&& other) noexcept;
Principal& operator=(Principal&& other) noexcept;
@@ -128,9 +128,9 @@ struct Rbac {
HeaderMatcher header_matcher;
StringMatcher string_matcher;
CidrRange ip;
- // For type AND/OR.
+ // For type kAnd/kOr/kNot. For kNot type, the vector will have only one
+ // element.
std::vector<std::unique_ptr<Principal>> principals;
- bool not_rule = false;
};
struct Policy {
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h
index 7e436df4e49..ab687859ab9 100644
--- a/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/rbac_translator.h
@@ -18,6 +18,7 @@
#include <grpc/support/port_platform.h>
#include "y_absl/status/statusor.h"
+
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/authorization/rbac_policy.h"
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.cc b/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.cc
new file mode 100644
index 00000000000..b8d4f1fa9f1
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.cc
@@ -0,0 +1,173 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/authorization/sdk_server_authz_filter.h"
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "src/core/lib/transport/transport.h"
+
+namespace grpc_core {
+
+TraceFlag grpc_sdk_authz_trace(false, "sdk_authz");
+
+SdkServerAuthzFilter::SdkServerAuthzFilter(
+ RefCountedPtr<grpc_auth_context> auth_context, grpc_endpoint* endpoint,
+ RefCountedPtr<grpc_authorization_policy_provider> provider)
+ : auth_context_(std::move(auth_context)),
+ per_channel_evaluate_args_(auth_context_.get(), endpoint),
+ provider_(std::move(provider)) {}
+
+grpc_error_handle SdkServerAuthzFilter::Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
+ GPR_ASSERT(!args->is_last);
+ grpc_auth_context* auth_context =
+ grpc_find_auth_context_in_args(args->channel_args);
+ grpc_authorization_policy_provider* provider =
+ grpc_channel_args_find_pointer<grpc_authorization_policy_provider>(
+ args->channel_args, GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER);
+ if (provider == nullptr) {
+ return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Failed to get authorization provider.");
+ }
+ // grpc_endpoint isn't needed because the current SDK authorization policy
+ // does not support any rules that requires looking for source or destination
+ // addresses.
+ new (elem->channel_data) SdkServerAuthzFilter(
+ auth_context != nullptr ? auth_context->Ref() : nullptr,
+ /*endpoint=*/nullptr, provider->Ref());
+ return GRPC_ERROR_NONE;
+}
+
+void SdkServerAuthzFilter::Destroy(grpc_channel_element* elem) {
+ auto* chand = static_cast<SdkServerAuthzFilter*>(elem->channel_data);
+ chand->~SdkServerAuthzFilter();
+}
+
+SdkServerAuthzFilter::CallData::CallData(grpc_call_element* elem) {
+ GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
+ elem, grpc_schedule_on_exec_ctx);
+}
+
+void SdkServerAuthzFilter::CallData::StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch) {
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ if (batch->recv_initial_metadata) {
+ // Inject our callback.
+ calld->recv_initial_metadata_batch_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata;
+ calld->original_recv_initial_metadata_ready_ =
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
+ batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
+ &calld->recv_initial_metadata_ready_;
+ }
+ grpc_call_next_op(elem, batch);
+}
+
+grpc_error_handle SdkServerAuthzFilter::CallData::Init(
+ grpc_call_element* elem, const grpc_call_element_args*) {
+ new (elem->call_data) CallData(elem);
+ return GRPC_ERROR_NONE;
+}
+
+void SdkServerAuthzFilter::CallData::Destroy(
+ grpc_call_element* elem, const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/) {
+ CallData* calld = static_cast<CallData*>(elem->call_data);
+ calld->~CallData();
+}
+
+bool SdkServerAuthzFilter::CallData::IsAuthorized(SdkServerAuthzFilter* chand) {
+ EvaluateArgs args(recv_initial_metadata_batch_,
+ &chand->per_channel_evaluate_args_);
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_sdk_authz_trace)) {
+ gpr_log(
+ GPR_DEBUG,
+ "checking request: url_path=%s, transport_security_type=%s, "
+ "uri_sans=[%s], dns_sans=[%s], subject=%s, local_address=%s:%d, "
+ "peer_address=%s:%d",
+ TString(args.GetPath()).c_str(),
+ TString(args.GetTransportSecurityType()).c_str(),
+ y_absl::StrJoin(args.GetUriSans(), ",").c_str(),
+ y_absl::StrJoin(args.GetDnsSans(), ",").c_str(),
+ TString(args.GetSubject()).c_str(),
+ TString(args.GetLocalAddressString()).c_str(), args.GetLocalPort(),
+ TString(args.GetPeerAddressString()).c_str(), args.GetPeerPort());
+ }
+ grpc_authorization_policy_provider::AuthorizationEngines engines =
+ chand->provider_->engines();
+ if (engines.deny_engine != nullptr) {
+ AuthorizationEngine::Decision decision =
+ engines.deny_engine->Evaluate(args);
+ if (decision.type == AuthorizationEngine::Decision::Type::kDeny) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_sdk_authz_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: request denied by policy %s.",
+ chand, this, decision.matching_policy_name.c_str());
+ }
+ return false;
+ }
+ }
+ if (engines.allow_engine != nullptr) {
+ AuthorizationEngine::Decision decision =
+ engines.allow_engine->Evaluate(args);
+ if (decision.type == AuthorizationEngine::Decision::Type::kAllow) {
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_sdk_authz_trace)) {
+ gpr_log(GPR_INFO, "chand=%p calld=%p: request allowed by policy %s.",
+ chand, this, decision.matching_policy_name.c_str());
+ }
+ return true;
+ }
+ }
+ if (GRPC_TRACE_FLAG_ENABLED(grpc_sdk_authz_trace)) {
+ gpr_log(GPR_INFO,
+ "chand=%p calld=%p: request denied, no matching policy found.",
+ chand, this);
+ }
+ return false;
+}
+
+void SdkServerAuthzFilter::CallData::RecvInitialMetadataReady(
+ void* arg, grpc_error_handle error) {
+ grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
+ auto* chand = static_cast<SdkServerAuthzFilter*>(elem->channel_data);
+ auto* calld = static_cast<CallData*>(elem->call_data);
+ if (error == GRPC_ERROR_NONE) {
+ if (!calld->IsAuthorized(chand)) {
+ error = grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Unauthorized RPC request rejected."),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ GRPC_STATUS_PERMISSION_DENIED);
+ }
+ } else {
+ (void)GRPC_ERROR_REF(error);
+ }
+ Closure::Run(DEBUG_LOCATION, calld->original_recv_initial_metadata_ready_,
+ error);
+}
+
+const grpc_channel_filter SdkServerAuthzFilter::kFilterVtable = {
+ SdkServerAuthzFilter::CallData::StartTransportStreamOpBatch,
+ grpc_channel_next_op,
+ sizeof(SdkServerAuthzFilter::CallData),
+ SdkServerAuthzFilter::CallData::Init,
+ grpc_call_stack_ignore_set_pollset_or_pollset_set,
+ SdkServerAuthzFilter::CallData::Destroy,
+ sizeof(SdkServerAuthzFilter),
+ SdkServerAuthzFilter::Init,
+ SdkServerAuthzFilter::Destroy,
+ grpc_channel_next_get_info,
+ "sdk-server-authz"};
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.h b/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.h
new file mode 100644
index 00000000000..f11716cc513
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/authorization/sdk_server_authz_filter.h
@@ -0,0 +1,67 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_SDK_SERVER_AUTHZ_FILTER_H
+#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_SDK_SERVER_AUTHZ_FILTER_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/security/authorization/authorization_policy_provider.h"
+
+namespace grpc_core {
+
+class SdkServerAuthzFilter {
+ public:
+ static const grpc_channel_filter kFilterVtable;
+
+ private:
+ class CallData {
+ public:
+ static void StartTransportStreamOpBatch(
+ grpc_call_element* elem, grpc_transport_stream_op_batch* batch);
+ static grpc_error_handle Init(grpc_call_element* elem,
+ const grpc_call_element_args*);
+ static void Destroy(grpc_call_element* elem,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* /*ignored*/);
+
+ private:
+ explicit CallData(grpc_call_element* elem);
+
+ bool IsAuthorized(SdkServerAuthzFilter* chand);
+
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+
+ grpc_metadata_batch* recv_initial_metadata_batch_;
+ grpc_closure* original_recv_initial_metadata_ready_;
+ grpc_closure recv_initial_metadata_ready_;
+ };
+
+ SdkServerAuthzFilter(
+ RefCountedPtr<grpc_auth_context> auth_context, grpc_endpoint* endpoint,
+ RefCountedPtr<grpc_authorization_policy_provider> provider);
+
+ static grpc_error_handle Init(grpc_channel_element* elem,
+ grpc_channel_element_args* args);
+ static void Destroy(grpc_channel_element* elem);
+
+ RefCountedPtr<grpc_auth_context> auth_context_;
+ EvaluateArgs::PerChannelArgs per_channel_evaluate_args_;
+ RefCountedPtr<grpc_authorization_policy_provider> provider_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_SDK_SERVER_AUTHZ_FILTER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/context/security_context.cc b/contrib/libs/grpc/src/core/lib/security/context/security_context.cc
index d760d82f226..257f5c25cb0 100644
--- a/contrib/libs/grpc/src/core/lib/security/context/security_context.cc
+++ b/contrib/libs/grpc/src/core/lib/security/context/security_context.cc
@@ -18,22 +18,23 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/context/security_context.h"
+
#include <string.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
grpc_core::DebugOnlyTraceFlag grpc_trace_auth_context_refcount(
false, "auth_context_refcount");
@@ -222,7 +223,7 @@ grpc_auth_property_iterator grpc_auth_context_peer_identity(
void grpc_auth_context::ensure_capacity() {
if (properties_.count == properties_.capacity) {
properties_.capacity =
- GPR_MAX(properties_.capacity + 8, properties_.capacity * 2);
+ std::max(properties_.capacity + 8, properties_.capacity * 2);
properties_.array = static_cast<grpc_auth_property*>(gpr_realloc(
properties_.array, properties_.capacity * sizeof(grpc_auth_property)));
}
@@ -288,7 +289,9 @@ static void* auth_context_pointer_arg_copy(void* p) {
: ctx->Ref(DEBUG_LOCATION, "auth_context_pointer_arg").release();
}
-static int auth_context_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+static int auth_context_pointer_cmp(void* a, void* b) {
+ return grpc_core::QsortCompare(a, b);
+}
static const grpc_arg_pointer_vtable auth_context_pointer_vtable = {
auth_context_pointer_arg_copy, auth_context_pointer_arg_destroy,
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
index 8454fd7558c..0c6f5561f5c 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_linux.cc
@@ -20,12 +20,12 @@
#ifdef GPR_LINUX
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/sync.h>
-#include <string.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
#define GRPC_ALTS_EXPECT_NAME_GOOGLE "Google"
#define GRPC_ALTS_EXPECT_NAME_GCE "Google Compute Engine"
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
index b71f66a536a..cb4010253c1 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_no_op.cc
@@ -20,10 +20,10 @@
#if !defined(GPR_LINUX) && !defined(GPR_WINDOWS)
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
-
#include <grpc/support/log.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+
bool grpc_alts_is_running_on_gcp() {
gpr_log(GPR_INFO,
"ALTS: Platforms other than Linux and Windows are not supported");
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
index 59432cff361..5d2bdc14dea 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc
@@ -20,8 +20,6 @@
#ifdef GPR_WINDOWS
-#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
-
#include <shellapi.h>
#include <stdio.h>
#include <tchar.h>
@@ -31,6 +29,8 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+
namespace grpc_core {
namespace internal {
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
index a6c82d47741..dbdaeb6bdb2 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.cc
@@ -26,17 +26,18 @@
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_join.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/polling_entity.h"
-#include "src/core/lib/surface/api_trace.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/iomgr/polling_entity.h"
+#include "src/core/lib/surface/api_trace.h"
+
/* -- Composite call credentials. -- */
-static void composite_call_metadata_cb(void* arg, grpc_error* error);
+static void composite_call_metadata_cb(void* arg, grpc_error_handle error);
namespace {
struct grpc_composite_call_credentials_metadata_context {
@@ -64,7 +65,7 @@ struct grpc_composite_call_credentials_metadata_context {
};
} // namespace
-static void composite_call_metadata_cb(void* arg, grpc_error* error) {
+static void composite_call_metadata_cb(void* arg, grpc_error_handle error) {
grpc_composite_call_credentials_metadata_context* ctx =
static_cast<grpc_composite_call_credentials_metadata_context*>(arg);
if (error == GRPC_ERROR_NONE) {
@@ -91,7 +92,7 @@ static void composite_call_metadata_cb(void* arg, grpc_error* error) {
bool grpc_composite_call_credentials::get_request_metadata(
grpc_polling_entity* pollent, grpc_auth_metadata_context auth_md_context,
grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error** error) {
+ grpc_error_handle* error) {
grpc_composite_call_credentials_metadata_context* ctx;
ctx = new grpc_composite_call_credentials_metadata_context(
this, pollent, auth_md_context, md_array, on_request_metadata);
@@ -112,7 +113,7 @@ bool grpc_composite_call_credentials::get_request_metadata(
}
void grpc_composite_call_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+ grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
for (size_t i = 0; i < inner_.size(); ++i) {
inner_[i]->cancel_get_request_metadata(md_array, GRPC_ERROR_REF(error));
}
@@ -146,7 +147,7 @@ void grpc_composite_call_credentials::push_to_inner(
auto composite_creds =
static_cast<grpc_composite_call_credentials*>(creds.get());
for (size_t i = 0; i < composite_creds->inner().size(); ++i) {
- inner_.push_back(std::move(composite_creds->inner_[i]));
+ inner_.push_back(composite_creds->inner_[i]);
}
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
index 5bebb9bd5ae..4c3b840bf7f 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/composite/composite_credentials.h
@@ -83,10 +83,10 @@ class grpc_composite_call_credentials : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
grpc_security_level min_security_level() const override {
return min_security_level_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.cc
index d2f4c9c6bb5..01e409cfffe 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.cc
@@ -23,6 +23,12 @@
#include <stdio.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+#include <grpc/support/sync.h>
+#include <grpc/support/time.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/http/httpcli.h"
@@ -31,12 +37,6 @@
#include "src/core/lib/json/json.h"
#include "src/core/lib/surface/api_trace.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-#include <grpc/support/sync.h>
-#include <grpc/support/time.h>
-
/* -- Common. -- */
void grpc_channel_credentials_release(grpc_channel_credentials* creds) {
@@ -59,7 +59,9 @@ static void* credentials_pointer_arg_copy(void* p) {
return static_cast<grpc_channel_credentials*>(p)->Ref().release();
}
-static int credentials_pointer_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
+static int credentials_pointer_cmp(void* a, void* b) {
+ return grpc_core::QsortCompare(a, b);
+}
static const grpc_arg_pointer_vtable credentials_pointer_vtable = {
credentials_pointer_arg_copy, credentials_pointer_arg_destroy,
@@ -127,7 +129,7 @@ static void* server_credentials_pointer_arg_copy(void* p) {
}
static int server_credentials_pointer_cmp(void* a, void* b) {
- return GPR_ICMP(a, b);
+ return grpc_core::QsortCompare(a, b);
}
static const grpc_arg_pointer_vtable cred_ptr_vtable = {
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
index f0e5055a589..6d761703a86 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/credentials.h
@@ -28,13 +28,13 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/security_connector/security_connector.h"
+#include "src/core/lib/transport/metadata_batch.h"
struct grpc_http_response;
@@ -93,7 +93,7 @@ void grpc_override_well_known_credentials_path_getter(
/* --- grpc_channel_credentials. --- */
-#define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.channel_credentials"
+#define GRPC_ARG_CHANNEL_CREDENTIALS "grpc.internal.channel_credentials"
// This type is forward declared as a C struct and we cannot define it as a
// class. Otherwise, compiler will complain about type mismatch due to
@@ -137,6 +137,11 @@ struct grpc_channel_credentials
const char* type_;
};
+// TODO(roth): Once we eliminate insecure builds, find a better way to
+// plumb credentials so that it doesn't need to flow through channel
+// args. For example, we'll want to expose it to LB policies by adding
+// methods on the helper API.
+
/* Util to encapsulate the channel credentials in a channel arg. */
grpc_arg grpc_channel_credentials_to_arg(grpc_channel_credentials* credentials);
@@ -187,13 +192,13 @@ struct grpc_call_credentials
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) = 0;
+ grpc_error_handle* error) = 0;
// Cancels a pending asynchronous operation started by
// grpc_call_credentials_get_request_metadata() with the corresponding
// value of \a md_array.
virtual void cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error* error) = 0;
+ grpc_credentials_mdelem_array* md_array, grpc_error_handle error) = 0;
virtual grpc_security_level min_security_level() const {
return min_security_level_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/credentials_metadata.cc b/contrib/libs/grpc/src/core/lib/security/credentials/credentials_metadata.cc
index 703de4aaafd..9d0284d3ebb 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/credentials_metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/credentials_metadata.cc
@@ -18,12 +18,11 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/credentials.h"
+#include <string.h>
#include <grpc/support/alloc.h>
-#include <string.h>
-
+#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/slice/slice_internal.h"
static void mdelem_list_ensure_capacity(grpc_credentials_mdelem_array* list,
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
index 5aef6606956..e2b901b40b6 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.cc
@@ -30,6 +30,7 @@ namespace {
const char* kExpectedEnvironmentId = "aws1";
const char* kRegionEnvVar = "AWS_REGION";
+const char* kDefaultRegionEnvVar = "AWS_DEFAULT_REGION";
const char* kAccessKeyIdEnvVar = "AWS_ACCESS_KEY_ID";
const char* kSecretAccessKeyEnvVar = "AWS_SECRET_ACCESS_KEY";
const char* kSessionTokenEnvVar = "AWS_SESSION_TOKEN";
@@ -57,7 +58,7 @@ TString UrlEncode(const y_absl::string_view& s) {
RefCountedPtr<AwsExternalAccountCredentials>
AwsExternalAccountCredentials::Create(Options options,
std::vector<TString> scopes,
- grpc_error** error) {
+ grpc_error_handle* error) {
auto creds = MakeRefCounted<AwsExternalAccountCredentials>(
std::move(options), std::move(scopes), error);
if (*error == GRPC_ERROR_NONE) {
@@ -68,7 +69,7 @@ AwsExternalAccountCredentials::Create(Options options,
}
AwsExternalAccountCredentials::AwsExternalAccountCredentials(
- Options options, std::vector<TString> scopes, grpc_error** error)
+ Options options, std::vector<TString> scopes, grpc_error_handle* error)
: ExternalAccountCredentials(options, std::move(scopes)) {
audience_ = options.audience;
auto it = options.credential_source.object_value().find("environment_id");
@@ -121,7 +122,7 @@ AwsExternalAccountCredentials::AwsExternalAccountCredentials(
void AwsExternalAccountCredentials::RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& /*options*/,
- std::function<void(TString, grpc_error*)> cb) {
+ std::function<void(TString, grpc_error_handle)> cb) {
if (ctx == nullptr) {
FinishRetrieveSubjectToken(
"",
@@ -140,6 +141,9 @@ void AwsExternalAccountCredentials::RetrieveSubjectToken(
void AwsExternalAccountCredentials::RetrieveRegion() {
UniquePtr<char> region_from_env(gpr_getenv(kRegionEnvVar));
+ if (region_from_env == nullptr) {
+ region_from_env = UniquePtr<char>(gpr_getenv(kDefaultRegionEnvVar));
+ }
if (region_from_env != nullptr) {
region_ = TString(region_from_env.get());
if (url_.empty()) {
@@ -151,10 +155,9 @@ void AwsExternalAccountCredentials::RetrieveRegion() {
}
y_absl::StatusOr<URI> uri = URI::Parse(region_url_);
if (!uri.ok()) {
- FinishRetrieveSubjectToken("", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Invalid region url. %s",
- uri.status().ToString())
- .c_str()));
+ FinishRetrieveSubjectToken(
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Invalid region url. %s", uri.status().ToString())));
return;
}
grpc_httpcli_request request;
@@ -163,26 +166,24 @@ void AwsExternalAccountCredentials::RetrieveRegion() {
request.http.path = gpr_strdup(uri->path().c_str());
request.handshaker =
uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveRegion, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, ctx_->deadline,
+ &ctx_->closure, &ctx_->response);
grpc_http_request_destroy(&request.http);
}
void AwsExternalAccountCredentials::OnRetrieveRegion(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
AwsExternalAccountCredentials* self =
static_cast<AwsExternalAccountCredentials*>(arg);
self->OnRetrieveRegionInternal(GRPC_ERROR_REF(error));
}
void AwsExternalAccountCredentials::OnRetrieveRegionInternal(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishRetrieveSubjectToken("", error);
return;
@@ -202,9 +203,8 @@ void AwsExternalAccountCredentials::RetrieveRoleName() {
y_absl::StatusOr<URI> uri = URI::Parse(url_);
if (!uri.ok()) {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Invalid url: %s.", uri.status().ToString())
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrFormat("Invalid url: %s.", uri.status().ToString())));
return;
}
grpc_httpcli_request request;
@@ -213,26 +213,25 @@ void AwsExternalAccountCredentials::RetrieveRoleName() {
request.http.path = gpr_strdup(uri->path().c_str());
request.handshaker =
uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveRoleName, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ // TODO(ctiller): use the caller's resource quota.
+ grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, ctx_->deadline,
+ &ctx_->closure, &ctx_->response);
grpc_http_request_destroy(&request.http);
}
-void AwsExternalAccountCredentials::OnRetrieveRoleName(void* arg,
- grpc_error* error) {
+void AwsExternalAccountCredentials::OnRetrieveRoleName(
+ void* arg, grpc_error_handle error) {
AwsExternalAccountCredentials* self =
static_cast<AwsExternalAccountCredentials*>(arg);
self->OnRetrieveRoleNameInternal(GRPC_ERROR_REF(error));
}
void AwsExternalAccountCredentials::OnRetrieveRoleNameInternal(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishRetrieveSubjectToken("", error);
return;
@@ -264,10 +263,8 @@ void AwsExternalAccountCredentials::RetrieveSigningKeys() {
y_absl::StatusOr<URI> uri = URI::Parse(url_with_role_name);
if (!uri.ok()) {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Invalid url with role name: %s.",
- uri.status().ToString())
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Invalid url with role name: %s.", uri.status().ToString())));
return;
}
grpc_httpcli_request request;
@@ -276,26 +273,25 @@ void AwsExternalAccountCredentials::RetrieveSigningKeys() {
request.http.path = gpr_strdup(uri->path().c_str());
request.handshaker =
uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveSigningKeys, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ // TODO(ctiller): use the caller's resource quota.
+ grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, ctx_->deadline,
+ &ctx_->closure, &ctx_->response);
grpc_http_request_destroy(&request.http);
}
-void AwsExternalAccountCredentials::OnRetrieveSigningKeys(void* arg,
- grpc_error* error) {
+void AwsExternalAccountCredentials::OnRetrieveSigningKeys(
+ void* arg, grpc_error_handle error) {
AwsExternalAccountCredentials* self =
static_cast<AwsExternalAccountCredentials*>(arg);
self->OnRetrieveSigningKeysInternal(GRPC_ERROR_REF(error));
}
void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishRetrieveSubjectToken("", error);
return;
@@ -316,10 +312,8 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
access_key_id_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid AccessKeyId in %s.",
- response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid AccessKeyId in %s.", response_body)));
return;
}
it = json.object_value().find("SecretAccessKey");
@@ -328,10 +322,8 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
secret_access_key_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "", GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid SecretAccessKey in %s.",
- response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid SecretAccessKey in %s.", response_body)));
return;
}
it = json.object_value().find("Token");
@@ -340,17 +332,15 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
token_ = it->second.string_value();
} else {
FinishRetrieveSubjectToken(
- "",
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid Token in %s.", response_body)
- .c_str()));
+ "", GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid Token in %s.", response_body)));
return;
}
BuildSubjectToken();
}
void AwsExternalAccountCredentials::BuildSubjectToken() {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (signer_ == nullptr) {
cred_verification_url_ = y_absl::StrReplaceAll(
regional_cred_verification_url_, {{"{region}", region_}});
@@ -396,7 +386,7 @@ void AwsExternalAccountCredentials::BuildSubjectToken() {
}
void AwsExternalAccountCredentials::FinishRetrieveSubjectToken(
- TString subject_token, grpc_error* error) {
+ TString subject_token, grpc_error_handle error) {
// Reset context
ctx_ = nullptr;
// Move object state into local variables.
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
index c1efb7eb18c..40c5562b027 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_external_account_credentials.h
@@ -19,40 +19,41 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/external/external_account_credentials.h"
-
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
+#include "src/core/lib/security/credentials/external/external_account_credentials.h"
namespace grpc_core {
class AwsExternalAccountCredentials final : public ExternalAccountCredentials {
public:
static RefCountedPtr<AwsExternalAccountCredentials> Create(
- Options options, std::vector<TString> scopes, grpc_error** error);
+ Options options, std::vector<TString> scopes,
+ grpc_error_handle* error);
AwsExternalAccountCredentials(Options options,
std::vector<TString> scopes,
- grpc_error** error);
+ grpc_error_handle* error);
private:
void RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& options,
- std::function<void(TString, grpc_error*)> cb) override;
+ std::function<void(TString, grpc_error_handle)> cb) override;
void RetrieveRegion();
- static void OnRetrieveRegion(void* arg, grpc_error* error);
- void OnRetrieveRegionInternal(grpc_error* error);
+ static void OnRetrieveRegion(void* arg, grpc_error_handle error);
+ void OnRetrieveRegionInternal(grpc_error_handle error);
void RetrieveRoleName();
- static void OnRetrieveRoleName(void* arg, grpc_error* error);
- void OnRetrieveRoleNameInternal(grpc_error* error);
+ static void OnRetrieveRoleName(void* arg, grpc_error_handle error);
+ void OnRetrieveRoleNameInternal(grpc_error_handle error);
void RetrieveSigningKeys();
- static void OnRetrieveSigningKeys(void* arg, grpc_error* error);
- void OnRetrieveSigningKeysInternal(grpc_error* error);
+ static void OnRetrieveSigningKeys(void* arg, grpc_error_handle error);
+ void OnRetrieveSigningKeysInternal(grpc_error_handle error);
void BuildSubjectToken();
- void FinishRetrieveSubjectToken(TString subject_token, grpc_error* error);
+ void FinishRetrieveSubjectToken(TString subject_token,
+ grpc_error_handle error);
TString audience_;
@@ -72,7 +73,7 @@ class AwsExternalAccountCredentials final : public ExternalAccountCredentials {
TString cred_verification_url_;
HTTPRequestContext* ctx_ = nullptr;
- std::function<void(TString, grpc_error*)> cb_ = nullptr;
+ std::function<void(TString, grpc_error_handle)> cb_ = nullptr;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
index 38bf3014d52..d2b6701e6f8 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.cc
@@ -17,6 +17,9 @@
#include "src/core/lib/security/credentials/external/aws_request_signer.h"
+#include <openssl/hmac.h>
+#include <openssl/sha.h>
+
#include "y_absl/strings/ascii.h"
#include "y_absl/strings/escaping.h"
#include "y_absl/strings/str_format.h"
@@ -25,9 +28,6 @@
#include "y_absl/time/clock.h"
#include "y_absl/time/time.h"
-#include <openssl/hmac.h>
-#include <openssl/sha.h>
-
namespace grpc_core {
namespace {
@@ -66,7 +66,8 @@ AwsRequestSigner::AwsRequestSigner(
TString access_key_id, TString secret_access_key, TString token,
TString method, TString url, TString region,
TString request_payload,
- std::map<TString, TString> additional_headers, grpc_error** error)
+ std::map<TString, TString> additional_headers,
+ grpc_error_handle* error)
: access_key_id_(std::move(access_key_id)),
secret_access_key_(std::move(secret_access_key)),
token_(std::move(token)),
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.h b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.h
index 3d8d81439a9..678b8737aaa 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/aws_request_signer.h
@@ -45,7 +45,7 @@ class AwsRequestSigner {
TString token, TString method, TString url,
TString region, TString request_payload,
std::map<TString, TString> additional_headers,
- grpc_error** error);
+ grpc_error_handle* error);
// This method triggers the signing process then returns the headers of the
// signed request as a map. In case there is an error, the input `error`
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
index 435c18552de..ddf3079ad15 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.cc
@@ -17,19 +17,20 @@
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
+#include "y_absl/strings/match.h"
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_join.h"
#include "y_absl/strings/str_split.h"
+#include "y_absl/strings/strip.h"
#include "y_absl/time/clock.h"
#include "y_absl/time/time.h"
#include "src/core/lib/http/parser.h"
-#include "src/core/lib/security/util/json_util.h"
-#include "src/core/lib/slice/b64.h"
-
#include "src/core/lib/security/credentials/external/aws_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/file_external_account_credentials.h"
#include "src/core/lib/security/credentials/external/url_external_account_credentials.h"
+#include "src/core/lib/security/util/json_util.h"
+#include "src/core/lib/slice/b64.h"
#define EXTERNAL_ACCOUNT_CREDENTIALS_GRANT_TYPE \
"urn:ietf:params:oauth:grant-type:token-exchange"
@@ -60,10 +61,28 @@ TString UrlEncode(const y_absl::string_view& s) {
return result;
}
+// Expression to match:
+// //iam.googleapis.com/locations/[^/]+/workforcePools/[^/]+/providers/.+
+bool MatchWorkforcePoolAudience(y_absl::string_view audience) {
+ // Match "//iam.googleapis.com/locations/"
+ if (!y_absl::ConsumePrefix(&audience, "//iam.googleapis.com")) return false;
+ if (!y_absl::ConsumePrefix(&audience, "/locations/")) return false;
+ // Match "[^/]+/workforcePools/"
+ std::pair<y_absl::string_view, y_absl::string_view> workforce_pools_split_result =
+ y_absl::StrSplit(audience, y_absl::MaxSplits("/workforcePools/", 1));
+ if (y_absl::StrContains(workforce_pools_split_result.first, '/')) return false;
+ // Match "[^/]+/providers/.+"
+ std::pair<y_absl::string_view, y_absl::string_view> providers_split_result =
+ y_absl::StrSplit(workforce_pools_split_result.second,
+ y_absl::MaxSplits("/providers/", 1));
+ return !y_absl::StrContains(providers_split_result.first, '/');
+}
+
} // namespace
RefCountedPtr<ExternalAccountCredentials> ExternalAccountCredentials::Create(
- const Json& json, std::vector<TString> scopes, grpc_error** error) {
+ const Json& json, std::vector<TString> scopes,
+ grpc_error_handle* error) {
GPR_ASSERT(*error == GRPC_ERROR_NONE);
Options options;
options.type = GRPC_AUTH_JSON_TYPE_INVALID;
@@ -151,6 +170,17 @@ RefCountedPtr<ExternalAccountCredentials> ExternalAccountCredentials::Create(
if (it != json.object_value().end()) {
options.client_secret = it->second.string_value();
}
+ it = json.object_value().find("workforce_pool_user_project");
+ if (it != json.object_value().end()) {
+ if (MatchWorkforcePoolAudience(options.audience)) {
+ options.workforce_pool_user_project = it->second.string_value();
+ } else {
+ *error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "workforce_pool_user_project should not be set for non-workforce "
+ "pool credentials");
+ return nullptr;
+ }
+ }
RefCountedPtr<ExternalAccountCredentials> creds;
if (options.credential_source.object_value().find("environment_id") !=
options.credential_source.object_value().end()) {
@@ -213,14 +243,14 @@ void ExternalAccountCredentials::fetch_oauth2(
ctx_ = new HTTPRequestContext(httpcli_context, pollent, deadline);
metadata_req_ = metadata_req;
response_cb_ = response_cb;
- auto cb = [this](TString token, grpc_error* error) {
+ auto cb = [this](TString token, grpc_error_handle error) {
OnRetrieveSubjectTokenInternal(token, error);
};
RetrieveSubjectToken(ctx_, options_, cb);
}
void ExternalAccountCredentials::OnRetrieveSubjectTokenInternal(
- y_absl::string_view subject_token, grpc_error* error) {
+ y_absl::string_view subject_token, grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishTokenFetch(error);
} else {
@@ -232,10 +262,9 @@ void ExternalAccountCredentials::ExchangeToken(
y_absl::string_view subject_token) {
y_absl::StatusOr<URI> uri = URI::Parse(options_.token_url);
if (!uri.ok()) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Invalid token url: %s. Error: %s", options_.token_url,
- uri.status().ToString())
- .c_str()));
+ uri.status().ToString())));
return;
}
grpc_httpcli_request request;
@@ -268,45 +297,51 @@ void ExternalAccountCredentials::ExchangeToken(
request.handshaker =
uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
std::vector<TString> body_parts;
- body_parts.push_back(y_absl::StrFormat("%s=%s", "audience",
- UrlEncode(options_.audience).c_str()));
+ body_parts.push_back(
+ y_absl::StrFormat("audience=%s", UrlEncode(options_.audience).c_str()));
body_parts.push_back(y_absl::StrFormat(
- "%s=%s", "grant_type",
+ "grant_type=%s",
UrlEncode(EXTERNAL_ACCOUNT_CREDENTIALS_GRANT_TYPE).c_str()));
body_parts.push_back(y_absl::StrFormat(
- "%s=%s", "requested_token_type",
+ "requested_token_type=%s",
UrlEncode(EXTERNAL_ACCOUNT_CREDENTIALS_REQUESTED_TOKEN_TYPE).c_str()));
+ body_parts.push_back(y_absl::StrFormat(
+ "subject_token_type=%s", UrlEncode(options_.subject_token_type).c_str()));
body_parts.push_back(
- y_absl::StrFormat("%s=%s", "subject_token_type",
- UrlEncode(options_.subject_token_type).c_str()));
- body_parts.push_back(y_absl::StrFormat("%s=%s", "subject_token",
- UrlEncode(subject_token).c_str()));
+ y_absl::StrFormat("subject_token=%s", UrlEncode(subject_token).c_str()));
TString scope = GOOGLE_CLOUD_PLATFORM_DEFAULT_SCOPE;
if (options_.service_account_impersonation_url.empty()) {
scope = y_absl::StrJoin(scopes_, " ");
}
- body_parts.push_back(
- y_absl::StrFormat("%s=%s", "scope", UrlEncode(scope).c_str()));
+ body_parts.push_back(y_absl::StrFormat("scope=%s", UrlEncode(scope).c_str()));
+ Json::Object addtional_options_json_object;
+ if (options_.client_id.empty() && options_.client_secret.empty()) {
+ addtional_options_json_object["userProject"] =
+ options_.workforce_pool_user_project;
+ }
+ Json addtional_options_json(std::move(addtional_options_json_object));
+ body_parts.push_back(y_absl::StrFormat(
+ "options=%s", UrlEncode(addtional_options_json.Dump()).c_str()));
TString body = y_absl::StrJoin(body_parts, "&");
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnExchangeToken, this, nullptr);
- grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, body.c_str(), body.size(), ctx_->deadline,
- &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, body.c_str(),
+ body.size(), ctx_->deadline, &ctx_->closure,
+ &ctx_->response);
grpc_http_request_destroy(&request.http);
}
-void ExternalAccountCredentials::OnExchangeToken(void* arg, grpc_error* error) {
+void ExternalAccountCredentials::OnExchangeToken(void* arg,
+ grpc_error_handle error) {
ExternalAccountCredentials* self =
static_cast<ExternalAccountCredentials*>(arg);
self->OnExchangeTokenInternal(GRPC_ERROR_REF(error));
}
-void ExternalAccountCredentials::OnExchangeTokenInternal(grpc_error* error) {
+void ExternalAccountCredentials::OnExchangeTokenInternal(
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishTokenFetch(error);
} else {
@@ -330,7 +365,7 @@ void ExternalAccountCredentials::OnExchangeTokenInternal(grpc_error* error) {
}
void ExternalAccountCredentials::ImpersenateServiceAccount() {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
y_absl::string_view response_body(ctx_->response.body,
ctx_->response.body_length);
Json json = Json::Parse(response_body, &error);
@@ -343,20 +378,17 @@ void ExternalAccountCredentials::ImpersenateServiceAccount() {
auto it = json.object_value().find("access_token");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid access_token in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid access_token in %s.", response_body)));
return;
}
TString access_token = it->second.string_value();
y_absl::StatusOr<URI> uri =
URI::Parse(options_.service_account_impersonation_url);
if (!uri.ok()) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat(
- "Invalid service account impersonation url: %s. Error: %s",
- options_.service_account_impersonation_url, uri.status().ToString())
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Invalid service account impersonation url: %s. Error: %s",
+ options_.service_account_impersonation_url, uri.status().ToString())));
return;
}
grpc_httpcli_request request;
@@ -375,28 +407,27 @@ void ExternalAccountCredentials::ImpersenateServiceAccount() {
request.handshaker =
uri->scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
TString scope = y_absl::StrJoin(scopes_, " ");
- TString body = y_absl::StrFormat("%s=%s", "scope", scope);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
+ TString body = y_absl::StrFormat("scope=%s", scope);
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnImpersenateServiceAccount, this, nullptr);
- grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, body.c_str(), body.size(), ctx_->deadline,
- &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ // TODO(ctiller): Use the callers resource quota.
+ grpc_httpcli_post(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, body.c_str(),
+ body.size(), ctx_->deadline, &ctx_->closure,
+ &ctx_->response);
grpc_http_request_destroy(&request.http);
}
void ExternalAccountCredentials::OnImpersenateServiceAccount(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
ExternalAccountCredentials* self =
static_cast<ExternalAccountCredentials*>(arg);
self->OnImpersenateServiceAccountInternal(GRPC_ERROR_REF(error));
}
void ExternalAccountCredentials::OnImpersenateServiceAccountInternal(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishTokenFetch(error);
return;
@@ -413,18 +444,16 @@ void ExternalAccountCredentials::OnImpersenateServiceAccountInternal(
auto it = json.object_value().find("accessToken");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid accessToken in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid accessToken in %s.", response_body)));
return;
}
TString access_token = it->second.string_value();
it = json.object_value().find("expireTime");
if (it == json.object_value().end() ||
it->second.type() != Json::Type::STRING) {
- FinishTokenFetch(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Missing or invalid expireTime in %s.", response_body)
- .c_str()));
+ FinishTokenFetch(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Missing or invalid expireTime in %s.", response_body)));
return;
}
TString expire_time = it->second.string_value();
@@ -452,7 +481,7 @@ void ExternalAccountCredentials::OnImpersenateServiceAccountInternal(
FinishTokenFetch(GRPC_ERROR_NONE);
}
-void ExternalAccountCredentials::FinishTokenFetch(grpc_error* error) {
+void ExternalAccountCredentials::FinishTokenFetch(grpc_error_handle error) {
GRPC_LOG_IF_ERROR("Fetch external account credentials access token",
GRPC_ERROR_REF(error));
// Move object state into local variables.
@@ -473,12 +502,12 @@ void ExternalAccountCredentials::FinishTokenFetch(grpc_error* error) {
grpc_call_credentials* grpc_external_account_credentials_create(
const char* json_string, const char* scopes_string) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::Json json = grpc_core::Json::Parse(json_string, &error);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"External account credentials creation failed. Error: %s.",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return nullptr;
}
@@ -489,7 +518,7 @@ grpc_call_credentials* grpc_external_account_credentials_create(
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"External account credentials creation failed. Error: %s.",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
return nullptr;
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
index 8a739ddf8df..37945bf4527 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/external_account_credentials.h
@@ -46,10 +46,12 @@ class ExternalAccountCredentials
TString quota_project_id;
TString client_id;
TString client_secret;
+ TString workforce_pool_user_project;
};
static RefCountedPtr<ExternalAccountCredentials> Create(
- const Json& json, std::vector<TString> scopes, grpc_error** error);
+ const Json& json, std::vector<TString> scopes,
+ grpc_error_handle* error);
ExternalAccountCredentials(Options options, std::vector<TString> scopes);
~ExternalAccountCredentials() override;
@@ -84,7 +86,7 @@ class ExternalAccountCredentials
// back.
virtual void RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& options,
- std::function<void(TString, grpc_error*)> cb) = 0;
+ std::function<void(TString, grpc_error_handle)> cb) = 0;
private:
// This method implements the common token fetch logic and it will be called
@@ -95,17 +97,17 @@ class ExternalAccountCredentials
grpc_millis deadline) override;
void OnRetrieveSubjectTokenInternal(y_absl::string_view subject_token,
- grpc_error* error);
+ grpc_error_handle error);
void ExchangeToken(y_absl::string_view subject_token);
- static void OnExchangeToken(void* arg, grpc_error* error);
- void OnExchangeTokenInternal(grpc_error* error);
+ static void OnExchangeToken(void* arg, grpc_error_handle error);
+ void OnExchangeTokenInternal(grpc_error_handle error);
void ImpersenateServiceAccount();
- static void OnImpersenateServiceAccount(void* arg, grpc_error* error);
- void OnImpersenateServiceAccountInternal(grpc_error* error);
+ static void OnImpersenateServiceAccount(void* arg, grpc_error_handle error);
+ void OnImpersenateServiceAccountInternal(grpc_error_handle error);
- void FinishTokenFetch(grpc_error* error);
+ void FinishTokenFetch(grpc_error_handle error);
Options options_;
std::vector<TString> scopes_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
index b42e78b0cf5..9ea8149f3b5 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.cc
@@ -28,7 +28,7 @@ namespace grpc_core {
RefCountedPtr<FileExternalAccountCredentials>
FileExternalAccountCredentials::Create(Options options,
std::vector<TString> scopes,
- grpc_error** error) {
+ grpc_error_handle* error) {
auto creds = MakeRefCounted<FileExternalAccountCredentials>(
std::move(options), std::move(scopes), error);
if (*error == GRPC_ERROR_NONE) {
@@ -39,7 +39,7 @@ FileExternalAccountCredentials::Create(Options options,
}
FileExternalAccountCredentials::FileExternalAccountCredentials(
- Options options, std::vector<TString> scopes, grpc_error** error)
+ Options options, std::vector<TString> scopes, grpc_error_handle* error)
: ExternalAccountCredentials(options, std::move(scopes)) {
auto it = options.credential_source.object_value().find("file");
if (it == options.credential_source.object_value().end()) {
@@ -92,7 +92,7 @@ FileExternalAccountCredentials::FileExternalAccountCredentials(
void FileExternalAccountCredentials::RetrieveSubjectToken(
HTTPRequestContext* /*ctx*/, const Options& /*options*/,
- std::function<void(TString, grpc_error*)> cb) {
+ std::function<void(TString, grpc_error_handle)> cb) {
struct SliceWrapper {
~SliceWrapper() { grpc_slice_unref_internal(slice); }
grpc_slice slice = grpc_empty_slice();
@@ -100,7 +100,8 @@ void FileExternalAccountCredentials::RetrieveSubjectToken(
SliceWrapper content_slice;
// To retrieve the subject token, we read the file every time we make a
// request because it may have changed since the last request.
- grpc_error* error = grpc_load_file(file_.c_str(), 0, &content_slice.slice);
+ grpc_error_handle error =
+ grpc_load_file(file_.c_str(), 0, &content_slice.slice);
if (error != GRPC_ERROR_NONE) {
cb("", error);
return;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.h
index 5f5d62e3673..cd0772bae90 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/file_external_account_credentials.h
@@ -26,16 +26,17 @@ namespace grpc_core {
class FileExternalAccountCredentials final : public ExternalAccountCredentials {
public:
static RefCountedPtr<FileExternalAccountCredentials> Create(
- Options options, std::vector<TString> scopes, grpc_error** error);
+ Options options, std::vector<TString> scopes,
+ grpc_error_handle* error);
FileExternalAccountCredentials(Options options,
std::vector<TString> scopes,
- grpc_error** error);
+ grpc_error_handle* error);
private:
void RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& options,
- std::function<void(TString, grpc_error*)> cb) override;
+ std::function<void(TString, grpc_error_handle)> cb) override;
// Fields of credential source
TString file_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
index 506a4e26196..259484a4a55 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.cc
@@ -26,7 +26,7 @@ namespace grpc_core {
RefCountedPtr<UrlExternalAccountCredentials>
UrlExternalAccountCredentials::Create(Options options,
std::vector<TString> scopes,
- grpc_error** error) {
+ grpc_error_handle* error) {
auto creds = MakeRefCounted<UrlExternalAccountCredentials>(
std::move(options), std::move(scopes), error);
if (*error == GRPC_ERROR_NONE) {
@@ -37,7 +37,7 @@ UrlExternalAccountCredentials::Create(Options options,
}
UrlExternalAccountCredentials::UrlExternalAccountCredentials(
- Options options, std::vector<TString> scopes, grpc_error** error)
+ Options options, std::vector<TString> scopes, grpc_error_handle* error)
: ExternalAccountCredentials(options, std::move(scopes)) {
auto it = options.credential_source.object_value().find("url");
if (it == options.credential_source.object_value().end()) {
@@ -51,10 +51,9 @@ UrlExternalAccountCredentials::UrlExternalAccountCredentials(
}
y_absl::StatusOr<URI> tmp_url = URI::Parse(it->second.string_value());
if (!tmp_url.ok()) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Invalid credential source url. Error: %s",
- tmp_url.status().ToString())
- .c_str());
+ tmp_url.status().ToString()));
return;
}
url_ = *tmp_url;
@@ -113,7 +112,7 @@ UrlExternalAccountCredentials::UrlExternalAccountCredentials(
void UrlExternalAccountCredentials::RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& /*options*/,
- std::function<void(TString, grpc_error*)> cb) {
+ std::function<void(TString, grpc_error_handle)> cb) {
if (ctx == nullptr) {
FinishRetrieveSubjectToken(
"",
@@ -140,26 +139,24 @@ void UrlExternalAccountCredentials::RetrieveSubjectToken(
request.http.hdrs = headers;
request.handshaker =
url_.scheme() == "https" ? &grpc_httpcli_ssl : &grpc_httpcli_plaintext;
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("external_account_credentials");
grpc_http_response_destroy(&ctx_->response);
ctx_->response = {};
GRPC_CLOSURE_INIT(&ctx_->closure, OnRetrieveSubjectToken, this, nullptr);
- grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent, resource_quota,
- &request, ctx_->deadline, &ctx_->closure, &ctx_->response);
- grpc_resource_quota_unref_internal(resource_quota);
+ grpc_httpcli_get(ctx_->httpcli_context, ctx_->pollent,
+ ResourceQuota::Default(), &request, ctx_->deadline,
+ &ctx_->closure, &ctx_->response);
grpc_http_request_destroy(&request.http);
}
-void UrlExternalAccountCredentials::OnRetrieveSubjectToken(void* arg,
- grpc_error* error) {
+void UrlExternalAccountCredentials::OnRetrieveSubjectToken(
+ void* arg, grpc_error_handle error) {
UrlExternalAccountCredentials* self =
static_cast<UrlExternalAccountCredentials*>(arg);
self->OnRetrieveSubjectTokenInternal(GRPC_ERROR_REF(error));
}
void UrlExternalAccountCredentials::OnRetrieveSubjectTokenInternal(
- grpc_error* error) {
+ grpc_error_handle error) {
if (error != GRPC_ERROR_NONE) {
FinishRetrieveSubjectToken("", error);
return;
@@ -167,7 +164,7 @@ void UrlExternalAccountCredentials::OnRetrieveSubjectTokenInternal(
y_absl::string_view response_body(ctx_->response.body,
ctx_->response.body_length);
if (format_type_ == "json") {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json response_json = Json::Parse(response_body, &error);
if (error != GRPC_ERROR_NONE ||
response_json.type() != Json::Type::OBJECT) {
@@ -196,7 +193,7 @@ void UrlExternalAccountCredentials::OnRetrieveSubjectTokenInternal(
}
void UrlExternalAccountCredentials::FinishRetrieveSubjectToken(
- TString subject_token, grpc_error* error) {
+ TString subject_token, grpc_error_handle error) {
// Reset context
ctx_ = nullptr;
// Move object state into local variables.
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
index 9a539406cc0..99404a272b5 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/external/url_external_account_credentials.h
@@ -26,21 +26,23 @@ namespace grpc_core {
class UrlExternalAccountCredentials final : public ExternalAccountCredentials {
public:
static RefCountedPtr<UrlExternalAccountCredentials> Create(
- Options options, std::vector<TString> scopes, grpc_error** error);
+ Options options, std::vector<TString> scopes,
+ grpc_error_handle* error);
UrlExternalAccountCredentials(Options options,
std::vector<TString> scopes,
- grpc_error** error);
+ grpc_error_handle* error);
private:
void RetrieveSubjectToken(
HTTPRequestContext* ctx, const Options& options,
- std::function<void(TString, grpc_error*)> cb) override;
+ std::function<void(TString, grpc_error_handle)> cb) override;
- static void OnRetrieveSubjectToken(void* arg, grpc_error* error);
- void OnRetrieveSubjectTokenInternal(grpc_error* error);
+ static void OnRetrieveSubjectToken(void* arg, grpc_error_handle error);
+ void OnRetrieveSubjectTokenInternal(grpc_error_handle error);
- void FinishRetrieveSubjectToken(TString subject_token, grpc_error* error);
+ void FinishRetrieveSubjectToken(TString subject_token,
+ grpc_error_handle error);
// Fields of credential source
URI url_;
@@ -50,7 +52,7 @@ class UrlExternalAccountCredentials final : public ExternalAccountCredentials {
TString format_subject_token_field_name_;
HTTPRequestContext* ctx_ = nullptr;
- std::function<void(TString, grpc_error*)> cb_ = nullptr;
+ std::function<void(TString, grpc_error_handle)> cb_ = nullptr;
};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
index c439282ffb1..57a897f0689 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.cc
@@ -92,7 +92,7 @@ const char* grpc_fake_transport_get_expected_targets(
bool grpc_md_only_test_credentials::get_request_metadata(
grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error** /*error*/) {
+ grpc_error_handle* /*error*/) {
grpc_credentials_mdelem_array_add(md_array, md_);
if (is_async_) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_request_metadata,
@@ -103,7 +103,7 @@ bool grpc_md_only_test_credentials::get_request_metadata(
}
void grpc_md_only_test_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error* error) {
+ grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
index 27f3a284515..806d339249f 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/fake/fake_credentials.h
@@ -72,10 +72,10 @@ class grpc_md_only_test_credentials : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
TString debug_string() override { return "MD only Test Credentials"; };
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
index e8b9bbdadc7..b06a39bbe98 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/credentials_generic.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
-
#include <util/generic/string.h>
#include "y_absl/strings/str_cat.h"
@@ -28,6 +26,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
TString grpc_get_well_known_google_credentials_file_path_impl(void) {
char* base = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_PATH_ENV_VAR);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 204197cf273..c5201fe07c7 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -18,10 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/credentials/credentials.h"
+#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include <string.h>
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/strip.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -31,6 +34,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/host_port.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/http/parser.h"
@@ -38,8 +42,8 @@
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/security/credentials/alts/alts_credentials.h"
#include "src/core/lib/security/credentials/alts/check_gcp_environment.h"
+#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/external/external_account_credentials.h"
-#include "src/core/lib/security/credentials/google_default/google_default_credentials.h"
#include "src/core/lib/security/credentials/jwt/jwt_credentials.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -91,7 +95,7 @@ grpc_google_default_channel_credentials::create_security_connector(
const char* xds_cluster =
grpc_channel_args_find_string(args, GRPC_ARG_XDS_CLUSTER_NAME);
const bool is_xds_non_cfe_cluster =
- xds_cluster != nullptr && strcmp(xds_cluster, "google_cfe") != 0;
+ xds_cluster != nullptr && !y_absl::StartsWith(xds_cluster, "google_cfe_");
const bool use_alts = is_grpclb_load_balancer ||
is_backend_from_grpclb_load_balancer ||
is_xds_non_cfe_cluster;
@@ -134,8 +138,8 @@ grpc_channel_args* grpc_google_default_channel_credentials::update_arguments(
return updated;
}
-static void on_metadata_server_detection_http_response(void* user_data,
- grpc_error* error) {
+static void on_metadata_server_detection_http_response(
+ void* user_data, grpc_error_handle error) {
metadata_server_detector* detector =
static_cast<metadata_server_detector*>(user_data);
if (error == GRPC_ERROR_NONE && detector->response.status == 200 &&
@@ -161,7 +165,7 @@ static void on_metadata_server_detection_http_response(void* user_data,
gpr_mu_unlock(g_polling_mu);
}
-static void destroy_pollset(void* p, grpc_error* /*e*/) {
+static void destroy_pollset(void* p, grpc_error_handle /*e*/) {
grpc_pollset_destroy(static_cast<grpc_pollset*>(p));
}
@@ -183,15 +187,12 @@ static int is_metadata_server_reachable() {
request.host = const_cast<char*>(GRPC_COMPUTE_ENGINE_DETECTION_HOST);
request.http.path = const_cast<char*>("/");
grpc_httpcli_context_init(&context);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("google_default_credentials");
grpc_httpcli_get(
- &context, &detector.pollent, resource_quota, &request,
- grpc_core::ExecCtx::Get()->Now() + max_detection_delay,
+ &context, &detector.pollent, grpc_core::ResourceQuota::Default(),
+ &request, grpc_core::ExecCtx::Get()->Now() + max_detection_delay,
GRPC_CLOSURE_CREATE(on_metadata_server_detection_http_response, &detector,
grpc_schedule_on_exec_ctx),
&detector.response);
- grpc_resource_quota_unref_internal(resource_quota);
grpc_core::ExecCtx::Get()->Flush();
/* Block until we get the response. This is not ideal but this should only be
called once for the lifetime of the process by the default credentials. */
@@ -220,15 +221,61 @@ static int is_metadata_server_reachable() {
return detector.success;
}
+namespace {
+
+bool ValidateUrlField(const Json& json, const TString& field) {
+ auto it = json.object_value().find(field);
+ if (it == json.object_value().end()) {
+ return true;
+ }
+ if (it->second.type() != Json::Type::STRING ||
+ it->second.string_value().empty()) {
+ return false;
+ }
+ y_absl::StatusOr<grpc_core::URI> url =
+ grpc_core::URI::Parse(it->second.string_value());
+ if (!url.ok()) return false;
+ if (!y_absl::EqualsIgnoreCase(url->scheme(), "https")) {
+ return false;
+ }
+ y_absl::string_view host;
+ y_absl::string_view port;
+ grpc_core::SplitHostPort(url->authority(), &host, &port);
+ if (y_absl::ConsumeSuffix(&host, ".googleapis.com")) {
+ if (host == "sts" || host == "iamcredentials") {
+ return true;
+ } else if (y_absl::StartsWith(host, "sts.") ||
+ y_absl::StartsWith(host, "iamcredentials.")) {
+ return true;
+ } else if (y_absl::EndsWith(host, ".sts") ||
+ y_absl::EndsWith(host, ".iamcredentials")) {
+ return true;
+ } else if (y_absl::EndsWith(host, "-sts") ||
+ y_absl::EndsWith(host, "-iamcredentials")) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool ValidateExteralAccountCredentials(const Json& json) {
+ return json.type() == Json::Type::OBJECT &&
+ ValidateUrlField(json, "token_url") &&
+ ValidateUrlField(json, "service_account_impersonation_url") &&
+ ValidateUrlField(json, "token_info_url");
+}
+
+} // namespace
+
/* Takes ownership of creds_path if not NULL. */
-static grpc_error* create_default_creds_from_path(
+static grpc_error_handle create_default_creds_from_path(
const TString& creds_path,
grpc_core::RefCountedPtr<grpc_call_credentials>* creds) {
grpc_auth_json_key key;
grpc_auth_refresh_token token;
grpc_core::RefCountedPtr<grpc_call_credentials> result;
grpc_slice creds_data = grpc_empty_slice();
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json;
if (creds_path.empty()) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("creds_path unset");
@@ -241,7 +288,7 @@ static grpc_error* create_default_creds_from_path(
if (json.type() != Json::Type::OBJECT) {
error = grpc_error_set_str(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to parse JSON"),
- GRPC_ERROR_STR_RAW_BYTES, grpc_slice_ref_internal(creds_data));
+ GRPC_ERROR_STR_RAW_BYTES, grpc_core::StringViewFromSlice(creds_data));
goto end;
}
@@ -273,6 +320,11 @@ static grpc_error* create_default_creds_from_path(
}
/* Finally try an external account credentials.*/
+ if (!ValidateExteralAccountCredentials(json)) {
+ error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Invalid external account credentials format.");
+ goto end;
+ }
result = grpc_core::ExternalAccountCredentials::Create(json, {}, &error);
end:
@@ -304,9 +356,9 @@ static bool metadata_server_available() {
}
static grpc_core::RefCountedPtr<grpc_call_credentials> make_default_call_creds(
- grpc_error** error) {
+ grpc_error_handle* error) {
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds;
- grpc_error* err;
+ grpc_error_handle err;
/* First, try the environment variable. */
char* path_from_env = gpr_getenv(GRPC_GOOGLE_CREDENTIALS_ENV_VAR);
@@ -344,7 +396,7 @@ grpc_channel_credentials* grpc_google_default_credentials_create(
grpc_call_credentials* call_credentials) {
grpc_channel_credentials* result = nullptr;
grpc_core::RefCountedPtr<grpc_call_credentials> call_creds(call_credentials);
- grpc_error* error = nullptr;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_google_default_credentials_create(%p)", 1,
@@ -373,7 +425,7 @@ grpc_channel_credentials* grpc_google_default_credentials_create(
GPR_ASSERT(result != nullptr);
} else {
gpr_log(GPR_ERROR, "Could not create google default credentials: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
}
GRPC_ERROR_UNREF(error);
return result;
@@ -387,9 +439,9 @@ void set_gce_tenancy_checker_for_testing(grpc_gce_tenancy_checker checker) {
}
void grpc_flush_cached_google_default_credentials(void) {
- grpc_core::ExecCtx exec_ctx;
+ ExecCtx exec_ctx;
gpr_once_init(&g_once, init_default_credentials);
- grpc_core::MutexLock lock(g_state_mu);
+ MutexLock lock(g_state_mu);
g_metadata_server_available = 0;
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
index a03e4970b8e..96a9db8bae6 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.cc
@@ -20,12 +20,13 @@
#include "src/core/lib/security/credentials/iam/iam_credentials.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "y_absl/strings/str_format.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/surface/api_trace.h"
@@ -36,13 +37,13 @@ grpc_google_iam_credentials::~grpc_google_iam_credentials() {
bool grpc_google_iam_credentials::get_request_metadata(
grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error** /*error*/) {
+ grpc_closure* /*on_request_metadata*/, grpc_error_handle* /*error*/) {
grpc_credentials_mdelem_array_append(md_array, &md_array_);
return true;
}
void grpc_google_iam_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error* error) {
+ grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
index 76b6acfa281..8d766f424fd 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/iam/iam_credentials.h
@@ -35,10 +35,10 @@ class grpc_google_iam_credentials : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
TString debug_string() override { return debug_string_; }
private:
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
index 0d94ad94538..01e804d0ac4 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.cc
@@ -18,7 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
#include <string.h>
@@ -30,6 +29,7 @@
#include <grpc/support/time.h>
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/slice/b64.h"
@@ -72,7 +72,7 @@ grpc_auth_json_key grpc_auth_json_key_create_from_json(const Json& json) {
BIO* bio = nullptr;
const char* prop_value;
int success = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
memset(&result, 0, sizeof(grpc_auth_json_key));
result.type = GRPC_AUTH_JSON_TYPE_INVALID;
@@ -124,7 +124,7 @@ end:
grpc_auth_json_key grpc_auth_json_key_create_from_string(
const char* json_string) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json = Json::Parse(json_string, &error);
GRPC_LOG_IF_ERROR("JSON key parsing", error);
return grpc_auth_json_key_create_from_json(json);
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
index b9a41c6b2b6..163cc3d76a4 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/json_token.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice.h>
#include <openssl/rsa.h>
+#include <grpc/slice.h>
+
#include "src/core/lib/json/json.h"
/* --- Constants. --- */
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
index d5555c3aa16..2633dc84723 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.cc
@@ -27,25 +27,24 @@
#include "y_absl/strings/str_cat.h"
-#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/surface/api_trace.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/transport/error_utils.h"
+#include "src/core/lib/uri/uri_parser.h"
+
using grpc_core::Json;
void grpc_service_account_jwt_access_credentials::reset_cache() {
GRPC_MDELEM_UNREF(cached_.jwt_md);
cached_.jwt_md = GRPC_MDNULL;
- if (cached_.service_url != nullptr) {
- gpr_free(cached_.service_url);
- cached_.service_url = nullptr;
- }
+ cached_.service_url.clear();
cached_.jwt_expiration = gpr_inf_past(GPR_CLOCK_REALTIME);
}
@@ -59,16 +58,23 @@ grpc_service_account_jwt_access_credentials::
bool grpc_service_account_jwt_access_credentials::get_request_metadata(
grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error** error) {
+ grpc_closure* /*on_request_metadata*/, grpc_error_handle* error) {
gpr_timespec refresh_threshold = gpr_time_from_seconds(
GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS, GPR_TIMESPAN);
+ // Remove service name from service_url to follow the audience format
+ // dictated in https://google.aip.dev/auth/4111.
+ y_absl::StatusOr<TString> uri =
+ grpc_core::RemoveServiceNameFromJwtUri(context.service_url);
+ if (!uri.ok()) {
+ *error = absl_status_to_grpc_error(uri.status());
+ return true;
+ }
/* See if we can return a cached jwt. */
grpc_mdelem jwt_md = GRPC_MDNULL;
{
gpr_mu_lock(&cache_mu_);
- if (cached_.service_url != nullptr &&
- strcmp(cached_.service_url, context.service_url) == 0 &&
+ if (!cached_.service_url.empty() && cached_.service_url == *uri &&
!GRPC_MDISNULL(cached_.jwt_md) &&
(gpr_time_cmp(
gpr_time_sub(cached_.jwt_expiration, gpr_now(GPR_CLOCK_REALTIME)),
@@ -83,14 +89,13 @@ bool grpc_service_account_jwt_access_credentials::get_request_metadata(
/* Generate a new jwt. */
gpr_mu_lock(&cache_mu_);
reset_cache();
- jwt = grpc_jwt_encode_and_sign(&key_, context.service_url, jwt_lifetime_,
- nullptr);
+ jwt = grpc_jwt_encode_and_sign(&key_, uri->c_str(), jwt_lifetime_, nullptr);
if (jwt != nullptr) {
TString md_value = y_absl::StrCat("Bearer ", jwt);
gpr_free(jwt);
cached_.jwt_expiration =
gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), jwt_lifetime_);
- cached_.service_url = gpr_strdup(context.service_url);
+ cached_.service_url = std::move(*uri);
cached_.jwt_md = grpc_mdelem_from_slices(
grpc_slice_from_static_string(GRPC_AUTHORIZATION_METADATA_KEY),
grpc_slice_from_cpp_string(std::move(md_value)));
@@ -109,7 +114,7 @@ bool grpc_service_account_jwt_access_credentials::get_request_metadata(
}
void grpc_service_account_jwt_access_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error* error) {
+ grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
@@ -141,7 +146,7 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
}
static char* redact_private_key(const char* json_key) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json = Json::Parse(json_key, &error);
if (error != GRPC_ERROR_NONE || json.type() != Json::Type::OBJECT) {
GRPC_ERROR_UNREF(error);
@@ -173,3 +178,15 @@ grpc_call_credentials* grpc_service_account_jwt_access_credentials_create(
grpc_auth_json_key_create_from_string(json_key), token_lifetime)
.release();
}
+
+namespace grpc_core {
+
+y_absl::StatusOr<TString> RemoveServiceNameFromJwtUri(y_absl::string_view uri) {
+ auto parsed = URI::Parse(uri);
+ if (!parsed.ok()) {
+ return parsed.status();
+ }
+ return y_absl::StrFormat("%s://%s/", parsed->scheme(), parsed->authority());
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
index 2faadfa0f85..aff57aeee90 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_credentials.h
@@ -23,10 +23,11 @@
#include <util/generic/string.h>
-#include <grpc/support/time.h>
-
#include "y_absl/strings/str_format.h"
#include "y_absl/time/time.h"
+
+#include <grpc/support/time.h>
+
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/jwt/json_token.h"
@@ -41,10 +42,10 @@ class grpc_service_account_jwt_access_credentials
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
const gpr_timespec& jwt_lifetime() const { return jwt_lifetime_; }
const grpc_auth_json_key& key() const { return key_; }
@@ -64,7 +65,7 @@ class grpc_service_account_jwt_access_credentials
gpr_mu cache_mu_;
struct {
grpc_mdelem jwt_md = GRPC_MDNULL;
- char* service_url = nullptr;
+ TString service_url;
gpr_timespec jwt_expiration;
} cached_;
@@ -78,4 +79,11 @@ grpc_core::RefCountedPtr<grpc_call_credentials>
grpc_service_account_jwt_access_credentials_create_from_auth_json_key(
grpc_auth_json_key key, gpr_timespec token_lifetime);
+namespace grpc_core {
+
+// Exposed for testing purposes only.
+y_absl::StatusOr<TString> RemoveServiceNameFromJwtUri(y_absl::string_view uri);
+
+} // namespace grpc_core
+
#endif /* GRPC_CORE_LIB_SECURITY_CREDENTIALS_JWT_JWT_CREDENTIALS_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
index 4c1342331c8..2f96acf0ed1 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc
@@ -87,10 +87,11 @@ static Json parse_json_part_from_jwt(const char* str, size_t len) {
return Json(); // JSON null
}
y_absl::string_view string = grpc_core::StringViewFromSlice(slice);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json = Json::Parse(string, &error);
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "JSON parse error: %s", grpc_error_string(error));
+ gpr_log(GPR_ERROR, "JSON parse error: %s",
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
json = Json(); // JSON null
}
@@ -133,7 +134,7 @@ static void jose_header_destroy(jose_header* h) {
static jose_header* jose_header_from_json(Json json) {
const char* alg_value;
Json::Object::const_iterator it;
- jose_header* h = static_cast<jose_header*>(gpr_zalloc(sizeof(jose_header)));
+ jose_header* h = grpc_core::Zalloc<jose_header>();
if (json.type() != Json::Type::OBJECT) {
gpr_log(GPR_ERROR, "JSON value is not an object");
goto error;
@@ -237,8 +238,7 @@ gpr_timespec grpc_jwt_claims_not_before(const grpc_jwt_claims* claims) {
}
grpc_jwt_claims* grpc_jwt_claims_from_json(Json json) {
- grpc_jwt_claims* claims =
- static_cast<grpc_jwt_claims*>(gpr_zalloc(sizeof(grpc_jwt_claims)));
+ grpc_jwt_claims* claims = grpc_core::Zalloc<grpc_jwt_claims>();
claims->json.Init(std::move(json));
claims->iat = gpr_inf_past(GPR_CLOCK_REALTIME);
claims->nbf = gpr_inf_past(GPR_CLOCK_REALTIME);
@@ -355,8 +355,7 @@ static verifier_cb_ctx* verifier_cb_ctx_create(
grpc_jwt_verification_done_cb cb) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
- verifier_cb_ctx* ctx =
- static_cast<verifier_cb_ctx*>(gpr_zalloc(sizeof(verifier_cb_ctx)));
+ verifier_cb_ctx* ctx = new verifier_cb_ctx();
ctx->verifier = verifier;
ctx->pollent = grpc_polling_entity_create_from_pollset(pollset);
ctx->header = header;
@@ -366,7 +365,6 @@ static verifier_cb_ctx* verifier_cb_ctx_create(
ctx->signed_data = grpc_slice_from_copied_buffer(signed_jwt, signed_jwt_len);
ctx->user_data = user_data;
ctx->user_cb = cb;
-
return ctx;
}
@@ -380,7 +378,7 @@ void verifier_cb_ctx_destroy(verifier_cb_ctx* ctx) {
grpc_http_response_destroy(&ctx->responses[i]);
}
/* TODO: see what to do with claims... */
- gpr_free(ctx);
+ delete ctx;
}
/* --- grpc_jwt_verifier object. --- */
@@ -412,7 +410,7 @@ static Json json_from_http(const grpc_httpcli_response* response) {
response->status);
return Json(); // JSON null
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json = Json::Parse(
y_absl::string_view(response->body, response->body_length), &error);
if (error != GRPC_ERROR_NONE) {
@@ -627,7 +625,7 @@ end:
return result;
}
-static void on_keys_retrieved(void* user_data, grpc_error* /*error*/) {
+static void on_keys_retrieved(void* user_data, grpc_error_handle /*error*/) {
verifier_cb_ctx* ctx = static_cast<verifier_cb_ctx*>(user_data);
Json json = json_from_http(&ctx->responses[HTTP_RESPONSE_KEYS]);
EVP_PKEY* verification_key = nullptr;
@@ -666,13 +664,13 @@ end:
verifier_cb_ctx_destroy(ctx);
}
-static void on_openid_config_retrieved(void* user_data, grpc_error* /*error*/) {
+static void on_openid_config_retrieved(void* user_data,
+ grpc_error_handle /*error*/) {
verifier_cb_ctx* ctx = static_cast<verifier_cb_ctx*>(user_data);
const grpc_http_response* response = &ctx->responses[HTTP_RESPONSE_OPENID];
Json json = json_from_http(response);
grpc_httpcli_request req;
const char* jwks_uri;
- grpc_resource_quota* resource_quota = nullptr;
const Json* cur;
/* TODO(jboeuf): Cache the jwks_uri in order to avoid this hop next time. */
@@ -701,13 +699,12 @@ static void on_openid_config_retrieved(void* user_data, grpc_error* /*error*/) {
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- resource_quota = grpc_resource_quota_create("jwt_verifier");
grpc_httpcli_get(
- &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
+ &ctx->verifier->http_ctx, &ctx->pollent,
+ grpc_core::ResourceQuota::Default(), &req,
grpc_core::ExecCtx::Get()->Now() + grpc_jwt_verifier_max_delay,
GRPC_CLOSURE_CREATE(on_keys_retrieved, ctx, grpc_schedule_on_exec_ctx),
&ctx->responses[HTTP_RESPONSE_KEYS]);
- grpc_resource_quota_unref_internal(resource_quota);
gpr_free(req.host);
return;
@@ -767,7 +764,6 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) {
char* path_prefix = nullptr;
const char* iss;
grpc_httpcli_request req;
- grpc_resource_quota* resource_quota = nullptr;
memset(&req, 0, sizeof(grpc_httpcli_request));
req.handshaker = &grpc_httpcli_ssl;
http_response_index rsp_idx;
@@ -827,12 +823,11 @@ static void retrieve_key_and_verify(verifier_cb_ctx* ctx) {
/* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- resource_quota = grpc_resource_quota_create("jwt_verifier");
grpc_httpcli_get(
- &ctx->verifier->http_ctx, &ctx->pollent, resource_quota, &req,
+ &ctx->verifier->http_ctx, &ctx->pollent,
+ grpc_core::ResourceQuota::Default(), &req,
grpc_core::ExecCtx::Get()->Now() + grpc_jwt_verifier_max_delay, http_cb,
&ctx->responses[rsp_idx]);
- grpc_resource_quota_unref_internal(resource_quota);
gpr_free(req.host);
gpr_free(req.http.path);
return;
@@ -890,8 +885,7 @@ error:
grpc_jwt_verifier* grpc_jwt_verifier_create(
const grpc_jwt_verifier_email_domain_key_url_mapping* mappings,
size_t num_mappings) {
- grpc_jwt_verifier* v =
- static_cast<grpc_jwt_verifier*>(gpr_zalloc(sizeof(grpc_jwt_verifier)));
+ grpc_jwt_verifier* v = grpc_core::Zalloc<grpc_jwt_verifier>();
grpc_httpcli_context_init(&v->http_ctx);
/* We know at least of one mapping. */
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
index 66ddbf2206b..2d1d3606af6 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.h
@@ -21,12 +21,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/pollset.h"
-#include "src/core/lib/json/json.h"
-
#include <grpc/slice.h>
#include <grpc/support/time.h>
+#include "src/core/lib/iomgr/pollset.h"
+#include "src/core/lib/json/json.h"
+
/* --- Constants. --- */
#define GRPC_OPENID_CONFIG_URL_SUFFIX "/.well-known/openid-configuration"
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
index 0e5dda1579c..4338f5a081c 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc
@@ -18,7 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h"
#include <string.h>
@@ -39,6 +38,7 @@
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/json/json.h"
#include "src/core/lib/security/util/json_util.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
@@ -61,7 +61,7 @@ grpc_auth_refresh_token grpc_auth_refresh_token_create_from_json(
grpc_auth_refresh_token result;
const char* prop_value;
int success = 0;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
memset(&result, 0, sizeof(grpc_auth_refresh_token));
result.type = GRPC_AUTH_JSON_TYPE_INVALID;
@@ -94,10 +94,11 @@ end:
grpc_auth_refresh_token grpc_auth_refresh_token_create_from_string(
const char* json_string) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Json json = Json::Parse(json_string, &error);
if (error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "JSON parsing failed: %s", grpc_error_string(error));
+ gpr_log(GPR_ERROR, "JSON parsing failed: %s",
+ grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
}
return grpc_auth_refresh_token_create_from_json(json);
@@ -164,11 +165,11 @@ grpc_oauth2_token_fetcher_credentials_parse_server_response(
const char* token_type = nullptr;
const char* expires_in = nullptr;
Json::Object::const_iterator it;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
json = Json::Parse(null_terminated_body, &error);
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Could not parse JSON from %s: %s",
- null_terminated_body, grpc_error_string(error));
+ null_terminated_body, grpc_error_std_string(error).c_str());
GRPC_ERROR_UNREF(error);
status = GRPC_CREDENTIALS_ERROR;
goto end;
@@ -221,7 +222,7 @@ end:
}
static void on_oauth2_token_fetcher_http_response(void* user_data,
- grpc_error* error) {
+ grpc_error_handle error) {
GRPC_LOG_IF_ERROR("oauth_fetch", GRPC_ERROR_REF(error));
grpc_credentials_metadata_request* r =
static_cast<grpc_credentials_metadata_request*>(user_data);
@@ -231,7 +232,7 @@ static void on_oauth2_token_fetcher_http_response(void* user_data,
}
void grpc_oauth2_token_fetcher_credentials::on_http_response(
- grpc_credentials_metadata_request* r, grpc_error* error) {
+ grpc_credentials_metadata_request* r, grpc_error_handle error) {
grpc_mdelem access_token_md = GRPC_MDNULL;
grpc_millis token_lifetime = 0;
grpc_credentials_status status =
@@ -253,7 +254,7 @@ void grpc_oauth2_token_fetcher_credentials::on_http_response(
gpr_mu_unlock(&mu_);
// Invoke callbacks for all pending requests.
while (pending_request != nullptr) {
- grpc_error* new_error = GRPC_ERROR_NONE;
+ grpc_error_handle new_error = GRPC_ERROR_NONE;
if (status == GRPC_CREDENTIALS_OK) {
grpc_credentials_mdelem_array_add(pending_request->md_array,
access_token_md);
@@ -277,7 +278,7 @@ void grpc_oauth2_token_fetcher_credentials::on_http_response(
bool grpc_oauth2_token_fetcher_credentials::get_request_metadata(
grpc_polling_entity* pollent, grpc_auth_metadata_context /*context*/,
grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error** /*error*/) {
+ grpc_error_handle* /*error*/) {
// Check if we can use the cached token.
grpc_millis refresh_threshold =
GRPC_SECURE_TOKEN_REFRESH_THRESHOLD_SECS * GPR_MS_PER_SEC;
@@ -325,7 +326,7 @@ bool grpc_oauth2_token_fetcher_credentials::get_request_metadata(
}
void grpc_oauth2_token_fetcher_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+ grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
gpr_mu_lock(&mu_);
grpc_oauth2_pending_get_request_metadata* prev = nullptr;
grpc_oauth2_pending_get_request_metadata* pending_request = pending_requests_;
@@ -391,16 +392,14 @@ class grpc_compute_engine_token_fetcher_credentials
const_cast<char*>(GRPC_COMPUTE_ENGINE_METADATA_TOKEN_PATH);
request.http.hdr_count = 1;
request.http.hdrs = &header;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("oauth2_credentials");
- grpc_httpcli_get(http_context, pollent, resource_quota, &request, deadline,
+ grpc_httpcli_get(http_context, pollent, grpc_core::ResourceQuota::Default(),
+ &request, deadline,
GRPC_CLOSURE_INIT(&http_get_cb_closure_, response_cb,
metadata_req, grpc_schedule_on_exec_ctx),
&metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
}
TString debug_string() override {
@@ -451,17 +450,15 @@ void grpc_google_refresh_token_credentials::fetch_oauth2(
request.http.hdr_count = 1;
request.http.hdrs = &header;
request.handshaker = &grpc_httpcli_ssl;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("oauth2_credentials_refresh");
- grpc_httpcli_post(httpcli_context, pollent, resource_quota, &request,
- body.c_str(), body.size(), deadline,
+ grpc_httpcli_post(httpcli_context, pollent,
+ grpc_core::ResourceQuota::Default(), &request, body.c_str(),
+ body.size(), deadline,
GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb,
metadata_req, grpc_schedule_on_exec_ctx),
&metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
}
grpc_google_refresh_token_credentials::grpc_google_refresh_token_credentials(
@@ -525,8 +522,8 @@ void MaybeAddToBody(const char* field_name, const char* field,
body->push_back(y_absl::StrFormat("&%s=%s", field_name, field));
}
-grpc_error* LoadTokenFile(const char* path, gpr_slice* token) {
- grpc_error* err = grpc_load_file(path, 1, token);
+grpc_error_handle LoadTokenFile(const char* path, gpr_slice* token) {
+ grpc_error_handle err = grpc_load_file(path, 1, token);
if (err != GRPC_ERROR_NONE) return err;
if (GRPC_SLICE_LENGTH(*token) == 0) {
gpr_log(GPR_ERROR, "Token file %s is empty", path);
@@ -565,7 +562,7 @@ class StsTokenFetcherCredentials
grpc_millis deadline) override {
char* body = nullptr;
size_t body_length = 0;
- grpc_error* err = FillBody(&body, &body_length);
+ grpc_error_handle err = FillBody(&body, &body_length);
if (err != GRPC_ERROR_NONE) {
response_cb(metadata_req, err);
GRPC_ERROR_UNREF(err);
@@ -583,27 +580,24 @@ class StsTokenFetcherCredentials
request.handshaker = (sts_url_.scheme() == "https")
? &grpc_httpcli_ssl
: &grpc_httpcli_plaintext;
- /* TODO(ctiller): Carry the resource_quota in ctx and share it with the host
+ /* TODO(ctiller): Carry the memory quota in ctx and share it with the host
channel. This would allow us to cancel an authentication query when under
extreme memory pressure. */
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("oauth2_credentials_refresh");
grpc_httpcli_post(
- http_context, pollent, resource_quota, &request, body, body_length,
- deadline,
+ http_context, pollent, ResourceQuota::Default(), &request, body,
+ body_length, deadline,
GRPC_CLOSURE_INIT(&http_post_cb_closure_, response_cb, metadata_req,
grpc_schedule_on_exec_ctx),
&metadata_req->response);
- grpc_resource_quota_unref_internal(resource_quota);
gpr_free(body);
}
- grpc_error* FillBody(char** body, size_t* body_length) {
+ grpc_error_handle FillBody(char** body, size_t* body_length) {
*body = nullptr;
std::vector<TString> body_parts;
grpc_slice subject_token = grpc_empty_slice();
grpc_slice actor_token = grpc_empty_slice();
- grpc_error* err = GRPC_ERROR_NONE;
+ grpc_error_handle err = GRPC_ERROR_NONE;
auto cleanup = [&body, &body_length, &body_parts, &subject_token,
&actor_token, &err]() {
@@ -642,30 +636,29 @@ class StsTokenFetcherCredentials
URI sts_url_;
grpc_closure http_post_cb_closure_;
- grpc_core::UniquePtr<char> resource_;
- grpc_core::UniquePtr<char> audience_;
- grpc_core::UniquePtr<char> scope_;
- grpc_core::UniquePtr<char> requested_token_type_;
- grpc_core::UniquePtr<char> subject_token_path_;
- grpc_core::UniquePtr<char> subject_token_type_;
- grpc_core::UniquePtr<char> actor_token_path_;
- grpc_core::UniquePtr<char> actor_token_type_;
+ UniquePtr<char> resource_;
+ UniquePtr<char> audience_;
+ UniquePtr<char> scope_;
+ UniquePtr<char> requested_token_type_;
+ UniquePtr<char> subject_token_path_;
+ UniquePtr<char> subject_token_type_;
+ UniquePtr<char> actor_token_path_;
+ UniquePtr<char> actor_token_type_;
};
} // namespace
y_absl::StatusOr<URI> ValidateStsCredentialsOptions(
const grpc_sts_credentials_options* options) {
- y_absl::InlinedVector<grpc_error*, 3> error_list;
+ y_absl::InlinedVector<grpc_error_handle, 3> error_list;
y_absl::StatusOr<URI> sts_url =
URI::Parse(options->token_exchange_service_uri == nullptr
? ""
: options->token_exchange_service_uri);
if (!sts_url.ok()) {
- error_list.push_back(GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error_list.push_back(GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrFormat("Invalid or missing STS endpoint URL. Error: %s",
- sts_url.status().ToString())
- .c_str()));
+ sts_url.status().ToString())));
} else if (sts_url->scheme() != "https" && sts_url->scheme() != "http") {
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Invalid URI scheme, must be https to http."));
@@ -685,7 +678,8 @@ y_absl::StatusOr<URI> ValidateStsCredentialsOptions(
}
auto grpc_error_vec = GRPC_ERROR_CREATE_FROM_VECTOR(
"Invalid STS Credentials Options", &error_list);
- auto retval = y_absl::InvalidArgumentError(grpc_error_string(grpc_error_vec));
+ auto retval =
+ y_absl::InvalidArgumentError(grpc_error_std_string(grpc_error_vec));
GRPC_ERROR_UNREF(grpc_error_vec);
return retval;
}
@@ -718,13 +712,13 @@ grpc_access_token_credentials::~grpc_access_token_credentials() {
bool grpc_access_token_credentials::get_request_metadata(
grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context /*context*/,
grpc_credentials_mdelem_array* md_array,
- grpc_closure* /*on_request_metadata*/, grpc_error** /*error*/) {
+ grpc_closure* /*on_request_metadata*/, grpc_error_handle* /*error*/) {
grpc_credentials_mdelem_array_add(md_array, access_token_md_);
return true;
}
void grpc_access_token_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* /*md_array*/, grpc_error* error) {
+ grpc_credentials_mdelem_array* /*md_array*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
index 517291567fe..c01aa057d49 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/oauth2/oauth2_credentials.h
@@ -24,6 +24,7 @@
#include <util/generic/string.h>
#include <grpc/grpc_security.h>
+
#include "src/core/lib/json/json.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/uri/uri_parser.h"
@@ -78,13 +79,13 @@ class grpc_oauth2_token_fetcher_credentials : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
void on_http_response(grpc_credentials_metadata_request* r,
- grpc_error* error);
+ grpc_error_handle error);
TString debug_string() override;
protected:
@@ -138,10 +139,10 @@ class grpc_access_token_credentials final : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
TString debug_string() override;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
index 5d2e53178c3..56fc42394c7 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.cc
@@ -29,6 +29,7 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/api_trace.h"
@@ -82,15 +83,13 @@ void grpc_plugin_credentials::pending_request_complete(pending_request* r) {
Unref();
}
-static grpc_error* process_plugin_result(
+static grpc_error_handle process_plugin_result(
grpc_plugin_credentials::pending_request* r, const grpc_metadata* md,
size_t num_md, grpc_status_code status, const char* error_details) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (status != GRPC_STATUS_OK) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Getting metadata from plugin failed with error: ",
- error_details)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Getting metadata from plugin failed with error: ", error_details));
} else {
bool seen_illegal_header = false;
for (size_t i = 0; i < num_md; ++i) {
@@ -142,7 +141,7 @@ static void plugin_md_request_metadata_ready(void* request,
r->creds->pending_request_complete(r);
// If it has not been cancelled, process it.
if (!r->cancelled) {
- grpc_error* error =
+ grpc_error_handle error =
process_plugin_result(r, md, num_md, status, error_details);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_request_metadata, error);
} else if (GRPC_TRACE_FLAG_ENABLED(grpc_plugin_credentials_trace)) {
@@ -157,12 +156,11 @@ static void plugin_md_request_metadata_ready(void* request,
bool grpc_plugin_credentials::get_request_metadata(
grpc_polling_entity* /*pollent*/, grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array, grpc_closure* on_request_metadata,
- grpc_error** error) {
+ grpc_error_handle* error) {
bool retval = true; // Synchronous return.
if (plugin_.get_metadata != nullptr) {
// Create pending_request object.
- pending_request* request =
- static_cast<pending_request*>(gpr_zalloc(sizeof(*request)));
+ pending_request* request = grpc_core::Zalloc<pending_request>();
request->creds = this;
request->md_array = md_array;
request->on_request_metadata = on_request_metadata;
@@ -231,7 +229,7 @@ bool grpc_plugin_credentials::get_request_metadata(
}
void grpc_plugin_credentials::cancel_get_request_metadata(
- grpc_credentials_mdelem_array* md_array, grpc_error* error) {
+ grpc_credentials_mdelem_array* md_array, grpc_error_handle error) {
gpr_mu_lock(&mu_);
for (pending_request* pending_request = pending_requests_;
pending_request != nullptr; pending_request = pending_request->next) {
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
index 78bca05fb90..b56a94d6013 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/plugin/plugin_credentials.h
@@ -47,10 +47,10 @@ struct grpc_plugin_credentials final : public grpc_call_credentials {
grpc_auth_metadata_context context,
grpc_credentials_mdelem_array* md_array,
grpc_closure* on_request_metadata,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_get_request_metadata(grpc_credentials_mdelem_array* md_array,
- grpc_error* error) override;
+ grpc_error_handle error) override;
// Checks if the request has been cancelled.
// If not, removes it from the pending list, so that it cannot be
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
index 469eb0cfcfd..093f1ad0bf5 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.cc
@@ -22,14 +22,14 @@
#include <string.h>
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/surface/api_trace.h"
-#include "src/core/tsi/ssl_transport_security.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "src/core/tsi/ssl_transport_security.h"
+
//
// SSL Channel Credentials.
//
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
index 0491eea7002..647d619ada7 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/ssl/ssl_credentials.h
@@ -21,7 +21,6 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/security/credentials/credentials.h"
-
#include "src/core/lib/security/security_connector/ssl/ssl_security_connector.h"
class grpc_ssl_credentials : public grpc_channel_credentials {
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
index 9c1bbb49206..6aadf9b7369 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc
@@ -18,11 +18,12 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+#include <stdlib.h>
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-#include <stdlib.h>
-#include <string.h>
void grpc_tls_certificate_distributor::SetKeyMaterials(
const TString& cert_name, y_absl::optional<TString> pem_root_certs,
@@ -100,8 +101,9 @@ bool grpc_tls_certificate_distributor::HasKeyCertPairs(
};
void grpc_tls_certificate_distributor::SetErrorForCert(
- const TString& cert_name, y_absl::optional<grpc_error*> root_cert_error,
- y_absl::optional<grpc_error*> identity_cert_error) {
+ const TString& cert_name,
+ y_absl::optional<grpc_error_handle> root_cert_error,
+ y_absl::optional<grpc_error_handle> identity_cert_error) {
GPR_ASSERT(root_cert_error.has_value() || identity_cert_error.has_value());
grpc_core::MutexLock lock(&mu_);
CertificateInfo& cert_info = certificate_info_map_[cert_name];
@@ -112,7 +114,7 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
GPR_ASSERT(watcher_it != watchers_.end());
// identity_cert_error_to_report is the error of the identity cert this
// watcher is watching, if there is any.
- grpc_error* identity_cert_error_to_report = GRPC_ERROR_NONE;
+ grpc_error_handle identity_cert_error_to_report = GRPC_ERROR_NONE;
if (identity_cert_error.has_value() &&
watcher_it->second.identity_cert_name == cert_name) {
identity_cert_error_to_report = *identity_cert_error;
@@ -133,7 +135,7 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
GPR_ASSERT(watcher_it != watchers_.end());
// root_cert_error_to_report is the error of the root cert this watcher is
// watching, if there is any.
- grpc_error* root_cert_error_to_report = GRPC_ERROR_NONE;
+ grpc_error_handle root_cert_error_to_report = GRPC_ERROR_NONE;
if (root_cert_error.has_value() &&
watcher_it->second.root_cert_name == cert_name) {
// In this case, We've already sent the error updates at the time when
@@ -151,7 +153,7 @@ void grpc_tls_certificate_distributor::SetErrorForCert(
}
};
-void grpc_tls_certificate_distributor::SetError(grpc_error* error) {
+void grpc_tls_certificate_distributor::SetError(grpc_error_handle error) {
GPR_ASSERT(error != GRPC_ERROR_NONE);
grpc_core::MutexLock lock(&mu_);
for (const auto& watcher : watchers_) {
@@ -194,8 +196,8 @@ void grpc_tls_certificate_distributor::WatchTlsCertificates(
identity_cert_name};
y_absl::optional<y_absl::string_view> updated_root_certs;
y_absl::optional<grpc_core::PemKeyCertPairList> updated_identity_pairs;
- grpc_error* root_error = GRPC_ERROR_NONE;
- grpc_error* identity_error = GRPC_ERROR_NONE;
+ grpc_error_handle root_error = GRPC_ERROR_NONE;
+ grpc_error_handle identity_error = GRPC_ERROR_NONE;
if (root_cert_name.has_value()) {
CertificateInfo& cert_info = certificate_info_map_[*root_cert_name];
start_watching_root_cert = cert_info.root_cert_watchers.empty();
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
index 957a452513f..86275e44f5c 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h
@@ -19,12 +19,13 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
-
#include <utility>
#include "y_absl/container/inlined_vector.h"
#include "y_absl/types/optional.h"
+
+#include <grpc/grpc_security.h>
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
@@ -68,8 +69,8 @@ struct grpc_tls_certificate_distributor
// certificates.
// @param identity_cert_error the error occurred while reloading identity
// certificates.
- virtual void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) = 0;
+ virtual void OnError(grpc_error_handle root_cert_error,
+ grpc_error_handle identity_cert_error) = 0;
};
// Sets the key materials based on their certificate name.
@@ -95,14 +96,14 @@ struct grpc_tls_certificate_distributor
// @param identity_cert_error The error that the caller encounters when
// reloading identity certs.
void SetErrorForCert(const TString& cert_name,
- y_absl::optional<grpc_error*> root_cert_error,
- y_absl::optional<grpc_error*> identity_cert_error);
+ y_absl::optional<grpc_error_handle> root_cert_error,
+ y_absl::optional<grpc_error_handle> identity_cert_error);
// Propagates the error that the caller (e.g. Producer) encounters to all
// watchers.
//
// @param error The error that the caller encounters.
- void SetError(grpc_error* error);
+ void SetError(grpc_error_handle error);
// Sets the TLS certificate watch status callback function. The
// grpc_tls_certificate_distributor will invoke this callback when a new
@@ -125,7 +126,7 @@ struct grpc_tls_certificate_distributor
// are being watched.
void SetWatchStatusCallback(
std::function<void(TString, bool, bool)> callback) {
- grpc_core::MutexLock lock(&mu_);
+ grpc_core::MutexLock lock(&callback_mu_);
watch_status_callback_ = std::move(callback);
};
@@ -169,9 +170,9 @@ struct grpc_tls_certificate_distributor
// The contents of the identity key-certificate pairs.
grpc_core::PemKeyCertPairList pem_key_cert_pairs;
// The root cert reloading error propagated by the caller.
- grpc_error* root_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle root_cert_error = GRPC_ERROR_NONE;
// The identity cert reloading error propagated by the caller.
- grpc_error* identity_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle identity_cert_error = GRPC_ERROR_NONE;
// The set of watchers watching root certificates.
// This is mainly used for quickly looking up the affected watchers while
// performing a credential reloading.
@@ -185,11 +186,11 @@ struct grpc_tls_certificate_distributor
GRPC_ERROR_UNREF(root_cert_error);
GRPC_ERROR_UNREF(identity_cert_error);
}
- void SetRootError(grpc_error* error) {
+ void SetRootError(grpc_error_handle error) {
GRPC_ERROR_UNREF(root_cert_error);
root_cert_error = error;
}
- void SetIdentityError(grpc_error* error) {
+ void SetIdentityError(grpc_error_handle error) {
GRPC_ERROR_UNREF(identity_cert_error);
identity_cert_error = error;
}
@@ -201,13 +202,16 @@ struct grpc_tls_certificate_distributor
// functions.
grpc_core::Mutex callback_mu_;
// Stores information about each watcher.
- std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_;
+ std::map<TlsCertificatesWatcherInterface*, WatcherInfo> watchers_
+ Y_ABSL_GUARDED_BY(mu_);
// The callback to notify the caller, e.g. the Producer, that the watch status
// is changed.
- std::function<void(TString, bool, bool)> watch_status_callback_;
+ std::function<void(TString, bool, bool)> watch_status_callback_
+ Y_ABSL_GUARDED_BY(callback_mu_);
// Stores the names of each certificate, and their corresponding credential
// contents as well as some additional watcher information.
- std::map<TString, CertificateInfo> certificate_info_map_;
+ std::map<TString, CertificateInfo> certificate_info_map_
+ Y_ABSL_GUARDED_BY(mu_);
};
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_DISTRIBUTOR_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
index e3935e1ac43..aedc21aebce 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc
@@ -18,6 +18,8 @@
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include <openssl/ssl.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -29,17 +31,16 @@
namespace grpc_core {
StaticDataCertificateProvider::StaticDataCertificateProvider(
- TString root_certificate,
- grpc_core::PemKeyCertPairList pem_key_cert_pairs)
+ TString root_certificate, PemKeyCertPairList pem_key_cert_pairs)
: distributor_(MakeRefCounted<grpc_tls_certificate_distributor>()),
root_certificate_(std::move(root_certificate)),
pem_key_cert_pairs_(std::move(pem_key_cert_pairs)) {
distributor_->SetWatchStatusCallback([this](TString cert_name,
bool root_being_watched,
bool identity_being_watched) {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
y_absl::optional<TString> root_certificate;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
StaticDataCertificateProvider::WatcherInfo& info = watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched &&
!root_certificate_.empty()) {
@@ -60,8 +61,8 @@ StaticDataCertificateProvider::StaticDataCertificateProvider(
distributor_->SetKeyMaterials(cert_name, std::move(root_certificate),
std::move(pem_key_cert_pairs));
}
- grpc_error* root_cert_error = GRPC_ERROR_NONE;
- grpc_error* identity_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle root_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle identity_cert_error = GRPC_ERROR_NONE;
if (root_being_watched && !root_has_update) {
root_cert_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Unable to get latest root certificates.");
@@ -121,15 +122,15 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
provider->ForceUpdate();
}
};
- refresh_thread_ = grpc_core::Thread(
- "FileWatcherCertificateProvider_refreshing_thread", thread_lambda, this);
+ refresh_thread_ = Thread("FileWatcherCertificateProvider_refreshing_thread",
+ thread_lambda, this);
refresh_thread_.Start();
distributor_->SetWatchStatusCallback([this](TString cert_name,
bool root_being_watched,
bool identity_being_watched) {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
y_absl::optional<TString> root_certificate;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
FileWatcherCertificateProvider::WatcherInfo& info =
watcher_info_[cert_name];
if (!info.root_being_watched && root_being_watched &&
@@ -150,8 +151,8 @@ FileWatcherCertificateProvider::FileWatcherCertificateProvider(
distributor_->SetKeyMaterials(cert_name, root_certificate,
pem_key_cert_pairs);
}
- grpc_error* root_cert_error = GRPC_ERROR_NONE;
- grpc_error* identity_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle root_cert_error = GRPC_ERROR_NONE;
+ grpc_error_handle identity_cert_error = GRPC_ERROR_NONE;
if (root_being_watched && !root_certificate.has_value()) {
root_cert_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Unable to get latest root certificates.");
@@ -178,7 +179,7 @@ FileWatcherCertificateProvider::~FileWatcherCertificateProvider() {
void FileWatcherCertificateProvider::ForceUpdate() {
y_absl::optional<TString> root_certificate;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pairs;
if (!root_cert_path_.empty()) {
root_certificate = ReadRootCertificatesFromFile(root_cert_path_);
}
@@ -186,7 +187,7 @@ void FileWatcherCertificateProvider::ForceUpdate() {
pem_key_cert_pairs = ReadIdentityKeyCertPairFromFiles(
private_key_path_, identity_certificate_path_);
}
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
const bool root_cert_changed =
(!root_certificate.has_value() && !root_certificate_.empty()) ||
(root_certificate.has_value() && root_certificate_ != *root_certificate);
@@ -210,15 +211,16 @@ void FileWatcherCertificateProvider::ForceUpdate() {
}
if (root_cert_changed || identity_cert_changed) {
ExecCtx exec_ctx;
- grpc_error* root_cert_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ grpc_error_handle root_cert_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Unable to get latest root certificates.");
- grpc_error* identity_cert_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Unable to get latest identity certificates.");
+ grpc_error_handle identity_cert_error =
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Unable to get latest identity certificates.");
for (const auto& p : watcher_info_) {
const TString& cert_name = p.first;
const WatcherInfo& info = p.second;
y_absl::optional<TString> root_to_report;
- y_absl::optional<grpc_core::PemKeyCertPairList> identity_to_report;
+ y_absl::optional<PemKeyCertPairList> identity_to_report;
// Set key materials to the distributor if their contents changed.
if (info.root_being_watched && !root_certificate_.empty() &&
root_cert_changed) {
@@ -256,11 +258,12 @@ FileWatcherCertificateProvider::ReadRootCertificatesFromFile(
const TString& root_cert_full_path) {
// Read the root file.
grpc_slice root_slice = grpc_empty_slice();
- grpc_error* root_error =
+ grpc_error_handle root_error =
grpc_load_file(root_cert_full_path.c_str(), 0, &root_slice);
if (root_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Reading file %s failed: %s",
- root_cert_full_path.c_str(), grpc_error_string(root_error));
+ root_cert_full_path.c_str(),
+ grpc_error_std_string(root_error).c_str());
GRPC_ERROR_UNREF(root_error);
return y_absl::nullopt;
}
@@ -275,7 +278,7 @@ namespace {
// it logs the error and returns 0.
time_t GetModificationTime(const char* filename) {
time_t ts = 0;
- y_absl::Status status = grpc_core::GetFileModificationTime(filename, &ts);
+ y_absl::Status status = GetFileModificationTime(filename, &ts);
return ts;
}
@@ -314,19 +317,21 @@ FileWatcherCertificateProvider::ReadIdentityKeyCertPairFromFiles(
}
// Read the identity files.
SliceWrapper key_slice, cert_slice;
- grpc_error* key_error =
+ grpc_error_handle key_error =
grpc_load_file(private_key_path.c_str(), 0, &key_slice.slice);
if (key_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Reading file %s failed: %s. Start retrying...",
- private_key_path.c_str(), grpc_error_string(key_error));
+ private_key_path.c_str(),
+ grpc_error_std_string(key_error).c_str());
GRPC_ERROR_UNREF(key_error);
continue;
}
- grpc_error* cert_error =
+ grpc_error_handle cert_error =
grpc_load_file(identity_certificate_path.c_str(), 0, &cert_slice.slice);
if (cert_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "Reading file %s failed: %s. Start retrying...",
- identity_certificate_path.c_str(), grpc_error_string(cert_error));
+ identity_certificate_path.c_str(),
+ grpc_error_std_string(cert_error).c_str());
GRPC_ERROR_UNREF(cert_error);
continue;
}
@@ -360,6 +365,54 @@ FileWatcherCertificateProvider::ReadIdentityKeyCertPairFromFiles(
return y_absl::nullopt;
}
+y_absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
+ y_absl::string_view private_key, y_absl::string_view cert_chain) {
+ if (private_key.empty()) {
+ return y_absl::InvalidArgumentError("Private key string is empty.");
+ }
+ if (cert_chain.empty()) {
+ return y_absl::InvalidArgumentError("Certificate string is empty.");
+ }
+ BIO* cert_bio = BIO_new_mem_buf(cert_chain.data(), cert_chain.size());
+ if (cert_bio == nullptr) {
+ return y_absl::InvalidArgumentError(
+ "Conversion from certificate string to BIO failed.");
+ }
+ // Reads the first cert from the cert_chain which is expected to be the leaf
+ // cert
+ X509* x509 = PEM_read_bio_X509(cert_bio, nullptr, nullptr, nullptr);
+ BIO_free(cert_bio);
+ if (x509 == nullptr) {
+ return y_absl::InvalidArgumentError(
+ "Conversion from PEM string to X509 failed.");
+ }
+ EVP_PKEY* public_evp_pkey = X509_get_pubkey(x509);
+ X509_free(x509);
+ if (public_evp_pkey == nullptr) {
+ return y_absl::InvalidArgumentError(
+ "Extraction of public key from x.509 certificate failed.");
+ }
+ BIO* private_key_bio =
+ BIO_new_mem_buf(private_key.data(), private_key.size());
+ if (private_key_bio == nullptr) {
+ EVP_PKEY_free(public_evp_pkey);
+ return y_absl::InvalidArgumentError(
+ "Conversion from private key string to BIO failed.");
+ }
+ EVP_PKEY* private_evp_pkey =
+ PEM_read_bio_PrivateKey(private_key_bio, nullptr, nullptr, nullptr);
+ BIO_free(private_key_bio);
+ if (private_evp_pkey == nullptr) {
+ EVP_PKEY_free(public_evp_pkey);
+ return y_absl::InvalidArgumentError(
+ "Conversion from PEM string to EVP_PKEY failed.");
+ }
+ bool result = EVP_PKEY_cmp(private_evp_pkey, public_evp_pkey) == 1;
+ EVP_PKEY_free(private_evp_pkey);
+ EVP_PKEY_free(public_evp_pkey);
+ return result;
+}
+
} // namespace grpc_core
/** -- Wrapper APIs declared in grpc_security.h -- **/
@@ -367,6 +420,7 @@ FileWatcherCertificateProvider::ReadIdentityKeyCertPairFromFiles(
grpc_tls_certificate_provider* grpc_tls_certificate_provider_static_data_create(
const char* root_certificate, grpc_tls_identity_pairs* pem_key_cert_pairs) {
GPR_ASSERT(root_certificate != nullptr || pem_key_cert_pairs != nullptr);
+ grpc_core::ExecCtx exec_ctx;
grpc_core::PemKeyCertPairList identity_pairs_core;
if (pem_key_cert_pairs != nullptr) {
identity_pairs_core = std::move(pem_key_cert_pairs->pem_key_cert_pairs);
@@ -384,6 +438,7 @@ grpc_tls_certificate_provider*
grpc_tls_certificate_provider_file_watcher_create(
const char* private_key_path, const char* identity_certificate_path,
const char* root_cert_path, unsigned int refresh_interval_sec) {
+ grpc_core::ExecCtx exec_ctx;
return new grpc_core::FileWatcherCertificateProvider(
private_key_path == nullptr ? "" : private_key_path,
identity_certificate_path == nullptr ? "" : identity_certificate_path,
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
index c51e35f6308..2defc931779 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h
@@ -19,10 +19,12 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
#include <string.h>
#include "y_absl/container/inlined_vector.h"
+#include "y_absl/status/statusor.h"
+
+#include <grpc/grpc_security.h>
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
@@ -57,9 +59,8 @@ namespace grpc_core {
class StaticDataCertificateProvider final
: public grpc_tls_certificate_provider {
public:
- StaticDataCertificateProvider(
- TString root_certificate,
- grpc_core::PemKeyCertPairList pem_key_cert_pairs);
+ StaticDataCertificateProvider(TString root_certificate,
+ PemKeyCertPairList pem_key_cert_pairs);
~StaticDataCertificateProvider() override;
@@ -74,9 +75,9 @@ class StaticDataCertificateProvider final
};
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
TString root_certificate_;
- grpc_core::PemKeyCertPairList pem_key_cert_pairs_;
+ PemKeyCertPairList pem_key_cert_pairs_;
// Guards members below.
- grpc_core::Mutex mu_;
+ Mutex mu_;
// Stores each cert_name we get from the distributor callback and its watcher
// information.
std::map<TString, WatcherInfo> watcher_info_;
@@ -107,7 +108,8 @@ class FileWatcherCertificateProvider final
// Read the root certificates from files and update the distributor.
y_absl::optional<TString> ReadRootCertificatesFromFile(
const TString& root_cert_full_path);
- // Read the root certificates from files and update the distributor.
+ // Read the private key and the certificate chain from files and update the
+ // distributor.
y_absl::optional<PemKeyCertPairList> ReadIdentityKeyCertPairFromFiles(
const TString& private_key_path,
const TString& identity_certificate_path);
@@ -119,20 +121,26 @@ class FileWatcherCertificateProvider final
unsigned int refresh_interval_sec_ = 0;
RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
- grpc_core::Thread refresh_thread_;
+ Thread refresh_thread_;
gpr_event shutdown_event_;
// Guards members below.
- grpc_core::Mutex mu_;
+ Mutex mu_;
// The most-recent credential data. It will be empty if the most recent read
// attempt failed.
- TString root_certificate_;
- grpc_core::PemKeyCertPairList pem_key_cert_pairs_;
+ TString root_certificate_ Y_ABSL_GUARDED_BY(mu_);
+ PemKeyCertPairList pem_key_cert_pairs_ Y_ABSL_GUARDED_BY(mu_);
// Stores each cert_name we get from the distributor callback and its watcher
// information.
- std::map<TString, WatcherInfo> watcher_info_;
+ std::map<TString, WatcherInfo> watcher_info_ Y_ABSL_GUARDED_BY(mu_);
};
+// Checks if the private key matches the certificate's public key.
+// Returns a not-OK status on failure, or a bool indicating
+// whether the key/cert pair matches.
+y_absl::StatusOr<bool> PrivateKeyAndCertificateMatch(
+ y_absl::string_view private_key, y_absl::string_view cert_chain);
+
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_PROVIDER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc
new file mode 100644
index 00000000000..70def18c7f8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc
@@ -0,0 +1,201 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
+
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/gprpp/stat.h"
+#include "src/core/lib/security/credentials/tls/tls_utils.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/surface/api_trace.h"
+
+namespace grpc_core {
+
+bool ExternalCertificateVerifier::Verify(
+ grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)> callback, y_absl::Status* sync_status) {
+ {
+ MutexLock lock(&mu_);
+ request_map_.emplace(request, std::move(callback));
+ }
+ // Invoke the caller-specified verification logic embedded in
+ // external_verifier_.
+ grpc_status_code status_code = GRPC_STATUS_OK;
+ char* error_details = nullptr;
+ bool is_done = external_verifier_->verify(external_verifier_->user_data,
+ request, &OnVerifyDone, this,
+ &status_code, &error_details);
+ if (is_done) {
+ if (status_code != GRPC_STATUS_OK) {
+ *sync_status = y_absl::Status(static_cast<y_absl::StatusCode>(status_code),
+ error_details);
+ }
+ MutexLock lock(&mu_);
+ request_map_.erase(request);
+ }
+ gpr_free(error_details);
+ return is_done;
+}
+
+void ExternalCertificateVerifier::OnVerifyDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details) {
+ ExecCtx exec_ctx;
+ auto* self = static_cast<ExternalCertificateVerifier*>(callback_arg);
+ std::function<void(y_absl::Status)> callback;
+ {
+ MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = std::move(it->second);
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ y_absl::Status return_status = y_absl::OkStatus();
+ if (status != GRPC_STATUS_OK) {
+ return_status =
+ y_absl::Status(static_cast<y_absl::StatusCode>(status), error_details);
+ }
+ callback(return_status);
+ }
+}
+
+bool HostNameCertificateVerifier::Verify(
+ grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)>, y_absl::Status* sync_status) {
+ GPR_ASSERT(request != nullptr);
+ // Extract the target name, and remove its port.
+ const char* target_name = request->target_name;
+ if (target_name == nullptr) {
+ *sync_status = y_absl::Status(y_absl::StatusCode::kUnauthenticated,
+ "Target name is not specified.");
+ return true; // synchronous check
+ }
+ y_absl::string_view target_host;
+ y_absl::string_view ignored_port;
+ SplitHostPort(target_name, &target_host, &ignored_port);
+ if (target_host.empty()) {
+ *sync_status = y_absl::Status(y_absl::StatusCode::kUnauthenticated,
+ "Failed to split hostname and port.");
+ return true; // synchronous check
+ }
+ // IPv6 zone-id should not be included in comparisons.
+ const size_t zone_id = target_host.find('%');
+ if (zone_id != y_absl::string_view::npos) {
+ target_host.remove_suffix(target_host.size() - zone_id);
+ }
+ // Perform the hostname check.
+ // First check the DNS field. We allow prefix or suffix wildcard matching.
+ char** dns_names = request->peer_info.san_names.dns_names;
+ size_t dns_names_size = request->peer_info.san_names.dns_names_size;
+ if (dns_names != nullptr && dns_names_size > 0) {
+ for (size_t i = 0; i < dns_names_size; ++i) {
+ const char* dns_name = dns_names[i];
+ // We are using the target name sent from the client as a matcher to match
+ // against identity name on the peer cert.
+ if (VerifySubjectAlternativeName(dns_name, TString(target_host))) {
+ return true; // synchronous check
+ }
+ }
+ }
+ // Then check the IP address. We only allow exact matching.
+ char** ip_names = request->peer_info.san_names.ip_names;
+ size_t ip_names_size = request->peer_info.san_names.ip_names_size;
+ if (ip_names != nullptr && ip_names_size > 0) {
+ for (size_t i = 0; i < ip_names_size; ++i) {
+ const char* ip_name = ip_names[i];
+ if (target_host == ip_name) {
+ return true; // synchronous check
+ }
+ }
+ }
+ // If there's no SAN, try the CN.
+ if (dns_names_size == 0) {
+ const char* common_name = request->peer_info.common_name;
+ // We are using the target name sent from the client as a matcher to match
+ // against identity name on the peer cert.
+ if (VerifySubjectAlternativeName(common_name, TString(target_host))) {
+ return true; // synchronous check
+ }
+ }
+ *sync_status = y_absl::Status(y_absl::StatusCode::kUnauthenticated,
+ "Hostname Verification Check failed.");
+ return true; // synchronous check
+}
+
+} // namespace grpc_core
+
+//
+// Wrapper APIs declared in grpc_security.h
+//
+
+int grpc_tls_certificate_verifier_verify(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details) {
+ grpc_core::ExecCtx exec_ctx;
+ std::function<void(y_absl::Status)> async_cb =
+ [callback, request, callback_arg](y_absl::Status async_status) {
+ callback(request, callback_arg,
+ static_cast<grpc_status_code>(async_status.code()),
+ TString(async_status.message()).c_str());
+ };
+ y_absl::Status sync_status_cpp;
+ bool is_done = verifier->Verify(request, async_cb, &sync_status_cpp);
+ if (is_done) {
+ if (!sync_status_cpp.ok()) {
+ *sync_status = static_cast<grpc_status_code>(sync_status_cpp.code());
+ *sync_error_details =
+ gpr_strdup(TString(sync_status_cpp.message()).c_str());
+ }
+ }
+ return is_done;
+}
+
+void grpc_tls_certificate_verifier_cancel(
+ grpc_tls_certificate_verifier* verifier,
+ grpc_tls_custom_verification_check_request* request) {
+ grpc_core::ExecCtx exec_ctx;
+ verifier->Cancel(request);
+}
+
+grpc_tls_certificate_verifier* grpc_tls_certificate_verifier_external_create(
+ grpc_tls_certificate_verifier_external* external_verifier) {
+ grpc_core::ExecCtx exec_ctx;
+ return new grpc_core::ExternalCertificateVerifier(external_verifier);
+}
+
+grpc_tls_certificate_verifier*
+grpc_tls_certificate_verifier_host_name_create() {
+ grpc_core::ExecCtx exec_ctx;
+ return new grpc_core::HostNameCertificateVerifier();
+}
+
+void grpc_tls_certificate_verifier_release(
+ grpc_tls_certificate_verifier* verifier) {
+ GRPC_API_TRACE("grpc_tls_certificate_verifier_release(verifier=%p)", 1,
+ (verifier));
+ grpc_core::ExecCtx exec_ctx;
+ if (verifier != nullptr) verifier->Unref();
+}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h
new file mode 100644
index 00000000000..6014d5c9c53
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h
@@ -0,0 +1,106 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_VERIFIER_H
+#define GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_VERIFIER_H
+
+#include <grpc/support/port_platform.h>
+
+#include <string.h>
+
+#include "y_absl/status/status.h"
+
+#include <grpc/grpc_security.h>
+
+#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/gprpp/thd.h"
+#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
+#include "src/core/lib/security/security_connector/ssl_utils.h"
+
+// An abstraction of the verifier that all verifier subclasses should extend.
+struct grpc_tls_certificate_verifier
+ : public grpc_core::RefCounted<grpc_tls_certificate_verifier> {
+ public:
+ grpc_tls_certificate_verifier() = default;
+
+ ~grpc_tls_certificate_verifier() override = default;
+ // Verifies the specific request. It can be processed in sync or async mode.
+ // If the caller want it to be processed asynchronously, return false
+ // immediately, and at the end of the async operation, invoke the callback
+ // with the verification results stored in y_absl::Status. Otherwise, populate
+ // the verification results in |sync_status| and return true. The caller is
+ // expected to populate verification results by setting request.
+ virtual bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)> callback,
+ y_absl::Status* sync_status) = 0;
+ // Operations that will be performed when a request is cancelled.
+ // This is only needed when in async mode.
+ virtual void Cancel(grpc_tls_custom_verification_check_request* request) = 0;
+};
+
+namespace grpc_core {
+
+// A verifier that will transform grpc_tls_certificate_verifier_external to a
+// verifier that extends grpc_tls_certificate_verifier.
+class ExternalCertificateVerifier : public grpc_tls_certificate_verifier {
+ public:
+ explicit ExternalCertificateVerifier(
+ grpc_tls_certificate_verifier_external* external_verifier)
+ : external_verifier_(external_verifier) {}
+
+ ~ExternalCertificateVerifier() override {
+ if (external_verifier_->destruct != nullptr) {
+ external_verifier_->destruct(external_verifier_->user_data);
+ }
+ }
+
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)> callback,
+ y_absl::Status* sync_status) override;
+
+ void Cancel(grpc_tls_custom_verification_check_request* request) override {
+ external_verifier_->cancel(external_verifier_->user_data, request);
+ }
+
+ private:
+ grpc_tls_certificate_verifier_external* external_verifier_;
+
+ static void OnVerifyDone(grpc_tls_custom_verification_check_request* request,
+ void* callback_arg, grpc_status_code status,
+ const char* error_details);
+ // Guards members below.
+ Mutex mu_;
+ // stores each check request and its corresponding callback function.
+ std::map<grpc_tls_custom_verification_check_request*,
+ std::function<void(y_absl::Status)>>
+ request_map_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+// An internal verifier that will perform hostname verification check.
+class HostNameCertificateVerifier : public grpc_tls_certificate_verifier {
+ public:
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)> callback,
+ y_absl::Status* sync_status) override;
+ void Cancel(grpc_tls_custom_verification_check_request*) override {}
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_GRPC_TLS_CERTIFICATE_VERIFIER_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
index cf2b4c60df9..8042cf26686 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
@@ -29,64 +29,10 @@
#include "src/core/lib/surface/api_trace.h"
-/** -- gRPC TLS server authorization check API implementation. -- **/
-grpc_tls_server_authorization_check_config::
- grpc_tls_server_authorization_check_config(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data))
- : config_user_data_(const_cast<void*>(config_user_data)),
- schedule_(schedule),
- cancel_(cancel),
- destruct_(destruct) {}
-
-grpc_tls_server_authorization_check_config::
- ~grpc_tls_server_authorization_check_config() {
- if (destruct_ != nullptr) {
- destruct_(config_user_data_);
- }
-}
-
-int grpc_tls_server_authorization_check_config::Schedule(
- grpc_tls_server_authorization_check_arg* arg) const {
- if (schedule_ == nullptr) {
- gpr_log(GPR_ERROR, "schedule API is nullptr");
- if (arg != nullptr) {
- arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
- "schedule API in server authorization check config is nullptr");
- }
- return 1;
- }
- if (arg != nullptr && context_ != nullptr) {
- arg->config = const_cast<grpc_tls_server_authorization_check_config*>(this);
- }
- return schedule_(config_user_data_, arg);
-}
-
-void grpc_tls_server_authorization_check_config::Cancel(
- grpc_tls_server_authorization_check_arg* arg) const {
- if (cancel_ == nullptr) {
- gpr_log(GPR_ERROR, "cancel API is nullptr.");
- if (arg != nullptr) {
- arg->status = GRPC_STATUS_NOT_FOUND;
- arg->error_details->set_error_details(
- "schedule API in server authorization check config is nullptr");
- }
- return;
- }
- if (arg != nullptr) {
- arg->config = const_cast<grpc_tls_server_authorization_check_config*>(this);
- }
- cancel_(config_user_data_, arg);
-}
-
/** -- Wrapper APIs declared in grpc_security.h -- **/
grpc_tls_credentials_options* grpc_tls_credentials_options_create() {
+ grpc_core::ExecCtx exec_ctx;
return new grpc_tls_credentials_options();
}
@@ -97,11 +43,10 @@ void grpc_tls_credentials_options_set_cert_request_type(
options->set_cert_request_type(type);
}
-void grpc_tls_credentials_options_set_server_verification_option(
- grpc_tls_credentials_options* options,
- grpc_tls_server_verification_option server_verification_option) {
+void grpc_tls_credentials_options_set_verify_server_cert(
+ grpc_tls_credentials_options* options, int verify_server_cert) {
GPR_ASSERT(options != nullptr);
- options->set_server_verification_option(server_verification_option);
+ options->set_verify_server_cert(verify_server_cert);
}
void grpc_tls_credentials_options_set_certificate_provider(
@@ -109,6 +54,7 @@ void grpc_tls_credentials_options_set_certificate_provider(
grpc_tls_certificate_provider* provider) {
GPR_ASSERT(options != nullptr);
GPR_ASSERT(provider != nullptr);
+ grpc_core::ExecCtx exec_ctx;
options->set_certificate_provider(
provider->Ref(DEBUG_LOCATION, "set_certificate_provider"));
}
@@ -137,37 +83,16 @@ void grpc_tls_credentials_options_set_identity_cert_name(
options->set_identity_cert_name(identity_cert_name);
}
-void grpc_tls_credentials_options_set_server_authorization_check_config(
+void grpc_tls_credentials_options_set_certificate_verifier(
grpc_tls_credentials_options* options,
- grpc_tls_server_authorization_check_config* config) {
+ grpc_tls_certificate_verifier* verifier) {
GPR_ASSERT(options != nullptr);
- GPR_ASSERT(config != nullptr);
- options->set_server_authorization_check_config(config->Ref());
-}
-
-grpc_tls_server_authorization_check_config*
-grpc_tls_server_authorization_check_config_create(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data)) {
- if (schedule == nullptr) {
- gpr_log(GPR_ERROR,
- "Schedule API is nullptr in creating TLS server authorization "
- "check config.");
- return nullptr;
- }
- return new grpc_tls_server_authorization_check_config(
- config_user_data, schedule, cancel, destruct);
+ GPR_ASSERT(verifier != nullptr);
+ options->set_certificate_verifier(verifier->Ref());
}
-void grpc_tls_server_authorization_check_config_release(
- grpc_tls_server_authorization_check_config* config) {
- GRPC_API_TRACE(
- "grpc_tls_server_authorization_check_config_release(config=%p)", 1,
- (config));
- grpc_core::ExecCtx exec_ctx;
- if (config != nullptr) config->Unref();
+void grpc_tls_credentials_options_set_check_call_host(
+ grpc_tls_credentials_options* options, int check_call_host) {
+ GPR_ASSERT(options != nullptr);
+ options->set_check_call_host(check_call_host);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
index f669a6f5906..63b7bcef5b0 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h
@@ -21,80 +21,16 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security.h>
-
#include "y_absl/container/inlined_vector.h"
+#include <grpc/grpc_security.h>
+
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
-struct grpc_tls_error_details
- : public grpc_core::RefCounted<grpc_tls_error_details> {
- public:
- grpc_tls_error_details() : error_details_("") {}
- void set_error_details(const char* err_details) {
- error_details_ = err_details;
- }
- const TString& error_details() { return error_details_; }
-
- private:
- TString error_details_;
-};
-
-/** TLS server authorization check config. **/
-struct grpc_tls_server_authorization_check_config
- : public grpc_core::RefCounted<grpc_tls_server_authorization_check_config> {
- public:
- grpc_tls_server_authorization_check_config(
- const void* config_user_data,
- int (*schedule)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*cancel)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg),
- void (*destruct)(void* config_user_data));
- ~grpc_tls_server_authorization_check_config() override;
-
- void* context() const { return context_; }
-
- void set_context(void* context) { context_ = context; }
-
- int Schedule(grpc_tls_server_authorization_check_arg* arg) const;
-
- void Cancel(grpc_tls_server_authorization_check_arg* arg) const;
-
- private:
- /** This is a pointer to the wrapped language implementation of
- * grpc_tls_server_authorization_check_config. It is necessary to implement
- * the C schedule and cancel functions, given the schedule or cancel function
- * in a wrapped language. **/
- void* context_ = nullptr;
- /** config-specific, read-only user data that works for all channels created
- with a Credential using the config. */
- void* config_user_data_;
-
- /** callback function for invoking server authorization check. The
- implementation of this method has to be non-blocking, but can be performed
- synchronously or asynchronously.
- If processing occurs synchronously, it populates \a arg->result, \a
- arg->status, and \a arg->error_details, and returns zero.
- If processing occurs asynchronously, it returns a non-zero value.
- Application then invokes \a arg->cb when processing is completed. Note that
- \a arg->cb cannot be invoked before \a schedule() returns.
- */
- int (*schedule_)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg);
-
- /** callback function for canceling a server authorization check request. */
- void (*cancel_)(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg);
-
- /** callback function for cleaning up any data associated with server
- authorization check config. */
- void (*destruct_)(void* config_user_data);
-};
-
// Contains configurable options specified by callers to configure their certain
// security features supported in TLS.
// TODO(ZhenLian): consider making this not ref-counted.
@@ -107,15 +43,14 @@ struct grpc_tls_credentials_options
grpc_ssl_client_certificate_request_type cert_request_type() const {
return cert_request_type_;
}
- grpc_tls_server_verification_option server_verification_option() const {
- return server_verification_option_;
- }
+ bool verify_server_cert() const { return verify_server_cert_; }
grpc_tls_version min_tls_version() const { return min_tls_version_; }
grpc_tls_version max_tls_version() const { return max_tls_version_; }
- grpc_tls_server_authorization_check_config*
- server_authorization_check_config() const {
- return server_authorization_check_config_.get();
+ // Returns the verifier set in the options.
+ grpc_tls_certificate_verifier* certificate_verifier() {
+ return verifier_.get();
}
+ bool check_call_host() const { return check_call_host_; }
// Returns the distributor from provider_ if it is set, nullptr otherwise.
grpc_tls_certificate_distributor* certificate_distributor() {
if (provider_ != nullptr) return provider_->distributor().get();
@@ -131,9 +66,8 @@ struct grpc_tls_credentials_options
const grpc_ssl_client_certificate_request_type type) {
cert_request_type_ = type;
}
- void set_server_verification_option(
- const grpc_tls_server_verification_option server_verification_option) {
- server_verification_option_ = server_verification_option;
+ void set_verify_server_cert(bool verify_server_cert) {
+ verify_server_cert_ = verify_server_cert;
}
void set_min_tls_version(grpc_tls_version min_tls_version) {
min_tls_version_ = min_tls_version;
@@ -141,10 +75,14 @@ struct grpc_tls_credentials_options
void set_max_tls_version(grpc_tls_version max_tls_version) {
max_tls_version_ = max_tls_version;
}
- void set_server_authorization_check_config(
- grpc_core::RefCountedPtr<grpc_tls_server_authorization_check_config>
- config) {
- server_authorization_check_config_ = std::move(config);
+ // Sets the verifier in the options.
+ void set_certificate_verifier(
+ grpc_core::RefCountedPtr<grpc_tls_certificate_verifier> verifier) {
+ verifier_ = std::move(verifier);
+ }
+ // Sets the verifier in the options.
+ void set_check_call_host(bool check_call_host) {
+ check_call_host_ = check_call_host;
}
// Sets the provider in the options.
void set_certificate_provider(
@@ -177,12 +115,11 @@ struct grpc_tls_credentials_options
private:
grpc_ssl_client_certificate_request_type cert_request_type_ =
GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE;
- grpc_tls_server_verification_option server_verification_option_ =
- GRPC_TLS_SERVER_VERIFICATION;
+ bool verify_server_cert_ = true;
grpc_tls_version min_tls_version_ = grpc_tls_version::TLS1_2;
grpc_tls_version max_tls_version_ = grpc_tls_version::TLS1_3;
- grpc_core::RefCountedPtr<grpc_tls_server_authorization_check_config>
- server_authorization_check_config_;
+ grpc_core::RefCountedPtr<grpc_tls_certificate_verifier> verifier_;
+ bool check_call_host_ = true;
grpc_core::RefCountedPtr<grpc_tls_certificate_provider> provider_;
bool watch_root_cert_ = false;
TString root_cert_name_;
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
index f5b05d8a012..60e60d521c7 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_credentials.cc
@@ -28,29 +28,40 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h"
#include "src/core/lib/security/security_connector/tls/tls_security_connector.h"
#define GRPC_CREDENTIALS_TYPE_TLS "Tls"
namespace {
-bool CredentialOptionSanityCheck(const grpc_tls_credentials_options* options,
+bool CredentialOptionSanityCheck(grpc_tls_credentials_options* options,
bool is_client) {
if (options == nullptr) {
gpr_log(GPR_ERROR, "TLS credentials options is nullptr.");
return false;
}
- // TODO(ZhenLian): remove this when it is also supported on server side.
- if (!is_client && options->server_authorization_check_config() != nullptr) {
- gpr_log(GPR_INFO,
- "Server's credentials options should not contain server "
- "authorization check config.");
+ // In the following conditions, there won't be any issues, but it might
+ // indicate callers are doing something wrong with the API.
+ if (is_client && options->cert_request_type() !=
+ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE) {
+ gpr_log(GPR_ERROR,
+ "Client's credentials options should not set cert_request_type.");
}
- if (options->server_verification_option() != GRPC_TLS_SERVER_VERIFICATION &&
- options->server_authorization_check_config() == nullptr) {
+ if (!is_client && !options->verify_server_cert()) {
gpr_log(GPR_ERROR,
- "Should provider custom verifications if bypassing default ones.");
- return false;
+ "Server's credentials options should not set verify_server_cert.");
+ }
+ // In the following conditions, there could be severe security issues.
+ if (is_client && options->certificate_verifier() == nullptr) {
+ // If no verifier is specified on the client side, use the hostname verifier
+ // as default. Users who want to bypass all the verifier check should
+ // implement an external verifier instead.
+ gpr_log(GPR_INFO,
+ "No verifier specified on the client side. Using default hostname "
+ "verifier");
+ options->set_certificate_verifier(
+ grpc_core::MakeRefCounted<grpc_core::HostNameCertificateVerifier>());
}
return true;
}
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
index 9c266acb410..f8ecba3bd4d 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.cc
@@ -88,4 +88,36 @@ bool VerifySubjectAlternativeName(y_absl::string_view subject_alternative_name,
TString::npos;
}
+y_absl::string_view GetAuthPropertyValue(grpc_auth_context* context,
+ const char* property_name) {
+ grpc_auth_property_iterator it =
+ grpc_auth_context_find_properties_by_name(context, property_name);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ if (prop == nullptr) {
+ gpr_log(GPR_DEBUG, "No value found for %s property.", property_name);
+ return "";
+ }
+ if (grpc_auth_property_iterator_next(&it) != nullptr) {
+ gpr_log(GPR_DEBUG, "Multiple values found for %s property.", property_name);
+ return "";
+ }
+ return y_absl::string_view(prop->value, prop->value_length);
+}
+
+std::vector<y_absl::string_view> GetAuthPropertyArray(grpc_auth_context* context,
+ const char* property_name) {
+ std::vector<y_absl::string_view> values;
+ grpc_auth_property_iterator it =
+ grpc_auth_context_find_properties_by_name(context, property_name);
+ const grpc_auth_property* prop = grpc_auth_property_iterator_next(&it);
+ while (prop != nullptr) {
+ values.emplace_back(prop->value, prop->value_length);
+ prop = grpc_auth_property_iterator_next(&it);
+ }
+ if (values.empty()) {
+ gpr_log(GPR_DEBUG, "No value found for %s property.", property_name);
+ }
+ return values;
+}
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.h b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.h
index 08299dc7bb9..c7c71550e31 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.h
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/tls/tls_utils.h
@@ -26,6 +26,8 @@
#include "y_absl/strings/string_view.h"
+#include "src/core/lib/security/context/security_context.h"
+
namespace grpc_core {
// Matches \a subject_alternative_name with \a matcher. Returns true if there
@@ -33,6 +35,17 @@ namespace grpc_core {
bool VerifySubjectAlternativeName(y_absl::string_view subject_alternative_name,
const TString& matcher);
+// Returns value for the specified property_name from auth context. Here the
+// property is expected to have a single value. Returns empty if multiple values
+// are found.
+y_absl::string_view GetAuthPropertyValue(grpc_auth_context* context,
+ const char* property_name);
+
+// Returns values for the specified property_name from auth context. Here the
+// property can have any number of values.
+std::vector<y_absl::string_view> GetAuthPropertyArray(grpc_auth_context* context,
+ const char* property_name);
+
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_CREDENTIALS_TLS_TLS_UTILS_H
diff --git a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
index 0a415906256..4df24ccac52 100644
--- a/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
+++ b/contrib/libs/grpc/src/core/lib/security/credentials/xds/xds_credentials.cc
@@ -40,13 +40,13 @@ bool XdsVerifySubjectAlternativeNames(
if (matchers.empty()) return true;
for (size_t i = 0; i < subject_alternative_names_size; ++i) {
for (const auto& matcher : matchers) {
- if (matcher.type() == StringMatcher::Type::EXACT) {
- // For EXACT match, use DNS rules for verifying SANs
+ if (matcher.type() == StringMatcher::Type::kExact) {
+ // For Exact match, use DNS rules for verifying SANs
// TODO(zhenlian): Right now, the SSL layer does not save the type of
// the SAN, so we are doing a DNS style verification for all SANs when
// the type is EXACT. When we expose the SAN type, change this to only
// do this verification when the SAN type is DNS and match type is
- // EXACT. For all other cases, we should use matcher.Match().
+ // kExact. For all other cases, we should use matcher.Match().
if (VerifySubjectAlternativeName(subject_alternative_names[i],
matcher.string_matcher())) {
return true;
@@ -61,41 +61,39 @@ bool XdsVerifySubjectAlternativeNames(
return false;
}
-class ServerAuthCheck {
+class XdsCertificateVerifier : public grpc_tls_certificate_verifier {
public:
- ServerAuthCheck(
+ XdsCertificateVerifier(
RefCountedPtr<XdsCertificateProvider> xds_certificate_provider,
TString cluster_name)
: xds_certificate_provider_(std::move(xds_certificate_provider)),
cluster_name_(std::move(cluster_name)) {}
- static int Schedule(void* config_user_data,
- grpc_tls_server_authorization_check_arg* arg) {
- return static_cast<ServerAuthCheck*>(config_user_data)->ScheduleImpl(arg);
- }
-
- static void Destroy(void* config_user_data) {
- delete static_cast<ServerAuthCheck*>(config_user_data);
- }
-
- private:
- int ScheduleImpl(grpc_tls_server_authorization_check_arg* arg) {
- if (XdsVerifySubjectAlternativeNames(
- arg->subject_alternative_names, arg->subject_alternative_names_size,
+ bool Verify(grpc_tls_custom_verification_check_request* request,
+ std::function<void(y_absl::Status)>,
+ y_absl::Status* sync_status) override {
+ GPR_ASSERT(request != nullptr);
+ if (!XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.uri_names,
+ request->peer_info.san_names.uri_names_size,
+ xds_certificate_provider_->GetSanMatchers(cluster_name_)) &&
+ !XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.ip_names,
+ request->peer_info.san_names.ip_names_size,
+ xds_certificate_provider_->GetSanMatchers(cluster_name_)) &&
+ !XdsVerifySubjectAlternativeNames(
+ request->peer_info.san_names.dns_names,
+ request->peer_info.san_names.dns_names_size,
xds_certificate_provider_->GetSanMatchers(cluster_name_))) {
- arg->success = 1;
- arg->status = GRPC_STATUS_OK;
- } else {
- arg->success = 0;
- arg->status = GRPC_STATUS_UNAUTHENTICATED;
- if (arg->error_details) {
- arg->error_details->set_error_details(
- "SANs from certificate did not match SANs from xDS control plane");
- }
+ *sync_status = y_absl::Status(
+ y_absl::StatusCode::kUnauthenticated,
+ "SANs from certificate did not match SANs from xDS control plane");
}
- return 0; /* synchronous check */
+ return true; /* synchronous check */
}
+ void Cancel(grpc_tls_custom_verification_check_request*) override {}
+ private:
RefCountedPtr<XdsCertificateProvider> xds_certificate_provider_;
TString cluster_name_;
};
@@ -161,14 +159,11 @@ XdsCredentials::create_security_connector(
tls_credentials_options->set_watch_identity_pair(true);
tls_credentials_options->set_identity_cert_name(cluster_name);
}
- tls_credentials_options->set_server_verification_option(
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION);
- auto* server_auth_check = new ServerAuthCheck(xds_certificate_provider,
- std::move(cluster_name));
- tls_credentials_options->set_server_authorization_check_config(
- MakeRefCounted<grpc_tls_server_authorization_check_config>(
- server_auth_check, ServerAuthCheck::Schedule, nullptr,
- ServerAuthCheck::Destroy));
+ tls_credentials_options->set_verify_server_cert(true);
+ tls_credentials_options->set_certificate_verifier(
+ MakeRefCounted<XdsCertificateVerifier>(xds_certificate_provider,
+ std::move(cluster_name)));
+ tls_credentials_options->set_check_call_host(false);
// TODO(yashkt): Creating a new TlsCreds object each time we create a
// security connector means that the security connector's cmp() method
// returns unequal for each instance, which means that every time an LB
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
index 92a95252e82..fdca289a399 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.cc
@@ -54,7 +54,7 @@ void alts_check_peer(tsi_peer peer,
*auth_context =
grpc_core::internal::grpc_alts_auth_context_from_tsi_peer(&peer);
tsi_peer_destruct(&peer);
- grpc_error* error =
+ grpc_error_handle error =
*auth_context != nullptr
? GRPC_ERROR_NONE
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -103,6 +103,11 @@ class grpc_alts_channel_security_connector final
alts_check_peer(peer, auth_context, on_peer_checked);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other_sc) const override {
auto* other =
reinterpret_cast<const grpc_alts_channel_security_connector*>(other_sc);
@@ -114,7 +119,7 @@ class grpc_alts_channel_security_connector final
bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
- grpc_error** error) override {
+ grpc_error_handle* error) override {
if (host.empty() || host != target_name_) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"ALTS call host does not match target name");
@@ -123,7 +128,7 @@ class grpc_alts_channel_security_connector final
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error* error) override {
+ grpc_error_handle error) override {
GRPC_ERROR_UNREF(error);
}
@@ -168,6 +173,11 @@ class grpc_alts_server_security_connector final
alts_check_peer(peer, auth_context, on_peer_checked);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other) const override {
return server_security_connector_cmp(
static_cast<const grpc_server_security_connector*>(other));
@@ -177,8 +187,8 @@ class grpc_alts_server_security_connector final
namespace grpc_core {
namespace internal {
-grpc_core::RefCountedPtr<grpc_auth_context>
-grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
+RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
+ const tsi_peer* peer) {
if (peer == nullptr) {
gpr_log(GPR_ERROR,
"Invalid arguments to grpc_alts_auth_context_from_tsi_peer()");
@@ -233,7 +243,7 @@ grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer) {
return nullptr;
}
/* Create auth context. */
- auto ctx = grpc_core::MakeRefCounted<grpc_auth_context>(nullptr);
+ auto ctx = MakeRefCounted<grpc_auth_context>(nullptr);
grpc_auth_context_add_cstring_property(
ctx.get(), GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME,
GRPC_ALTS_TRANSPORT_SECURITY_TYPE);
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
index 10c3fe93646..a857196edc5 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/alts/alts_security_connector.h
@@ -66,8 +66,8 @@ namespace grpc_core {
namespace internal {
/* Exposed only for testing. */
-grpc_core::RefCountedPtr<grpc_auth_context>
-grpc_alts_auth_context_from_tsi_peer(const tsi_peer* peer);
+RefCountedPtr<grpc_auth_context> grpc_alts_auth_context_from_tsi_peer(
+ const tsi_peer* peer);
} // namespace internal
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
index 34d0590ba86..21d828ec1f6 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/fake/fake_security_connector.cc
@@ -79,6 +79,11 @@ class grpc_fake_channel_security_connector final
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other_sc) const override {
auto* other =
reinterpret_cast<const grpc_fake_channel_security_connector*>(other_sc);
@@ -87,12 +92,12 @@ class grpc_fake_channel_security_connector final
c = strcmp(target_, other->target_);
if (c != 0) return c;
if (expected_targets_ == nullptr || other->expected_targets_ == nullptr) {
- c = GPR_ICMP(expected_targets_, other->expected_targets_);
+ c = grpc_core::QsortCompare(expected_targets_, other->expected_targets_);
} else {
c = strcmp(expected_targets_, other->expected_targets_);
}
if (c != 0) return c;
- return GPR_ICMP(is_lb_channel_, other->is_lb_channel_);
+ return grpc_core::QsortCompare(is_lb_channel_, other->is_lb_channel_);
}
void add_handshakers(const grpc_channel_args* args,
@@ -105,7 +110,7 @@ class grpc_fake_channel_security_connector final
bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
- grpc_error** /*error*/) override {
+ grpc_error_handle* /*error*/) override {
y_absl::string_view authority_hostname;
y_absl::string_view authority_ignored_port;
y_absl::string_view target_hostname;
@@ -135,7 +140,7 @@ class grpc_fake_channel_security_connector final
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error* error) override {
+ grpc_error_handle error) override {
GRPC_ERROR_UNREF(error);
}
@@ -209,12 +214,11 @@ class grpc_fake_channel_security_connector final
char* target_name_override_;
};
-static void fake_check_peer(
- grpc_security_connector* /*sc*/, tsi_peer peer,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
- grpc_closure* on_peer_checked) {
+void fake_check_peer(grpc_security_connector* /*sc*/, tsi_peer peer,
+ grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ grpc_closure* on_peer_checked) {
const char* prop_name;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
*auth_context = nullptr;
if (peer.property_count != 2) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -224,10 +228,9 @@ static void fake_check_peer(
prop_name = peer.properties[0].name;
if (prop_name == nullptr ||
strcmp(prop_name, TSI_CERTIFICATE_TYPE_PEER_PROPERTY) != 0) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
+ prop_name == nullptr ? "<EMPTY>" : prop_name));
goto end;
}
if (strncmp(peer.properties[0].value.data, TSI_FAKE_CERTIFICATE_TYPE,
@@ -239,10 +242,9 @@ static void fake_check_peer(
prop_name = peer.properties[1].name;
if (prop_name == nullptr ||
strcmp(prop_name, TSI_SECURITY_LEVEL_PEER_PROPERTY) != 0) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
y_absl::StrCat("Unexpected property in fake peer: ",
- prop_name == nullptr ? "<EMPTY>" : prop_name)
- .c_str());
+ prop_name == nullptr ? "<EMPTY>" : prop_name));
goto end;
}
if (strncmp(peer.properties[1].value.data, TSI_FAKE_SECURITY_LEVEL,
@@ -287,6 +289,11 @@ class grpc_fake_server_security_connector
fake_check_peer(this, peer, auth_context, on_peer_checked);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /*interested_parties*/,
grpc_core::HandshakeManager* handshake_mgr) override {
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
index ba2435aa955..770a6cf4c25 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.cc
@@ -52,13 +52,13 @@ RefCountedPtr<grpc_auth_context> TestOnlyMakeInsecureAuthContext() {
// provide an insecure channel.
bool InsecureChannelSecurityConnector::check_call_host(
y_absl::string_view /*host*/, grpc_auth_context* /*auth_context*/,
- grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
+ grpc_closure* /*on_call_host_checked*/, grpc_error_handle* error) {
*error = GRPC_ERROR_NONE;
return true;
}
void InsecureChannelSecurityConnector::cancel_check_call_host(
- grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
+ grpc_closure* /*on_call_host_checked*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
@@ -95,7 +95,7 @@ int InsecureChannelSecurityConnector::cmp(
// created with the security level of TSI_SECURITY_NONE.
void InsecureServerSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) {
+ HandshakeManager* handshake_manager) {
tsi_handshaker* handshaker = nullptr;
// Re-use local_tsi_handshaker_create as a minimalist handshaker.
GPR_ASSERT(tsi_local_handshaker_create(false /* is_client */, &handshaker) ==
@@ -105,7 +105,7 @@ void InsecureServerSecurityConnector::add_handshakers(
void InsecureServerSecurityConnector::check_peer(
tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) {
*auth_context = MakeAuthContext();
tsi_peer_destruct(&peer);
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
index 8e083ae8714..86aecf06de8 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/insecure/insecure_security_connector.h
@@ -39,45 +39,55 @@ class InsecureChannelSecurityConnector
: public grpc_channel_security_connector {
public:
InsecureChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds)
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds)
: grpc_channel_security_connector(/* url_scheme */ nullptr,
std::move(channel_creds),
std::move(request_metadata_creds)) {}
bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
grpc_closure* on_call_host_checked,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error* error) override;
+ grpc_error_handle error) override;
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) override;
+ HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other_sc) const override;
};
class InsecureServerSecurityConnector : public grpc_server_security_connector {
public:
explicit InsecureServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds)
+ RefCountedPtr<grpc_server_credentials> server_creds)
: grpc_server_security_connector(nullptr /* url_scheme */,
std::move(server_creds)) {}
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* /* interested_parties */,
- grpc_core::HandshakeManager* handshake_manager) override;
+ HandshakeManager* handshake_manager) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other) const override;
};
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
index f04d0ed225b..f448d3fcac6 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_fallback.cc
@@ -19,6 +19,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/lib/security/security_connector/load_system_roots.h"
#if !defined(GPR_LINUX) && !defined(GPR_ANDROID)
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
index c0b6d5d727d..200aeb5ee6b 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/load_system_roots_linux.cc
@@ -18,12 +18,11 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice_buffer.h>
#include "src/core/lib/security/security_connector/load_system_roots_linux.h"
-#if defined(GPR_LINUX) || defined(GPR_ANDROID)
+#include <grpc/slice_buffer.h>
-#include "src/core/lib/security/security_connector/load_system_roots.h"
+#if defined(GPR_LINUX) || defined(GPR_ANDROID)
#include <dirent.h>
#include <fcntl.h>
@@ -44,6 +43,7 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/global_config.h"
#include "src/core/lib/iomgr/load_file.h"
+#include "src/core/lib/security/security_connector/load_system_roots.h"
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_system_ssl_roots_dir, "",
"Custom directory to SSL Roots");
@@ -63,7 +63,7 @@ grpc_slice GetSystemRootCerts() {
grpc_slice valid_bundle_slice = grpc_empty_slice();
size_t num_cert_files_ = GPR_ARRAY_SIZE(kLinuxCertFiles);
for (size_t i = 0; i < num_cert_files_; i++) {
- grpc_error* error =
+ grpc_error_handle error =
grpc_load_file(kLinuxCertFiles[i], 1, &valid_bundle_slice);
if (error == GRPC_ERROR_NONE) {
return valid_bundle_slice;
@@ -145,8 +145,7 @@ grpc_slice CreateRootCertsBundle(const char* certs_directory) {
grpc_slice LoadSystemRootCerts() {
grpc_slice result = grpc_empty_slice();
// Prioritize user-specified custom directory if flag is set.
- grpc_core::UniquePtr<char> custom_dir =
- GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
+ UniquePtr<char> custom_dir = GPR_GLOBAL_CONFIG_GET(grpc_system_ssl_roots_dir);
if (strlen(custom_dir.get()) > 0) {
result = CreateRootCertsBundle(custom_dir.get());
}
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
index 65983adbeb7..f0d01f7d43c 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/local/local_security_connector.cc
@@ -29,19 +29,22 @@
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/client_channel.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/unix_sockets_posix.h"
#include "src/core/lib/security/credentials/local/local_credentials.h"
#include "src/core/lib/security/transport/security_handshaker.h"
+#include "src/core/lib/uri/uri_parser.h"
#include "src/core/tsi/local_transport_security.h"
#define GRPC_UDS_URI_PATTERN "unix:"
+#define GRPC_ABSTRACT_UDS_URI_PATTERN "unix-abstract:"
#define GRPC_LOCAL_TRANSPORT_SECURITY_TYPE "local"
namespace {
@@ -70,13 +73,14 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked,
grpc_local_connect_type type) {
- int fd = grpc_endpoint_get_fd(ep);
grpc_resolved_address resolved_addr;
- memset(&resolved_addr, 0, sizeof(resolved_addr));
- resolved_addr.len = GRPC_MAX_SOCKADDR_SIZE;
bool is_endpoint_local = false;
- if (getsockname(fd, reinterpret_cast<grpc_sockaddr*>(resolved_addr.addr),
- &resolved_addr.len) == 0) {
+ y_absl::string_view local_addr = grpc_endpoint_get_local_address(ep);
+ y_absl::StatusOr<grpc_core::URI> uri = grpc_core::URI::Parse(local_addr);
+ if (!uri.ok() || !grpc_parse_uri(*uri, &resolved_addr)) {
+ gpr_log(GPR_ERROR, "Could not parse endpoint address: %s",
+ TString(local_addr.data(), local_addr.size()).c_str());
+ } else {
grpc_resolved_address addr_normalized;
grpc_resolved_address* addr =
grpc_sockaddr_is_v4mapped(&resolved_addr, &addr_normalized)
@@ -103,7 +107,7 @@ void local_check_peer(tsi_peer peer, grpc_endpoint* ep,
}
}
}
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error;
if (!is_endpoint_local) {
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Endpoint is neither UDS or TCP loopback address.");
@@ -181,10 +185,15 @@ class grpc_local_channel_security_connector final
creds->connect_type());
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
bool check_call_host(y_absl::string_view host,
grpc_auth_context* /*auth_context*/,
grpc_closure* /*on_call_host_checked*/,
- grpc_error** error) override {
+ grpc_error_handle* error) override {
if (host.empty() || host != target_name_) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"local call host does not match target name");
@@ -193,7 +202,7 @@ class grpc_local_channel_security_connector final
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error* error) override {
+ grpc_error_handle error) override {
GRPC_ERROR_UNREF(error);
}
@@ -230,6 +239,11 @@ class grpc_local_server_security_connector final
creds->connect_type());
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other) const override {
return server_security_connector_cmp(
static_cast<const grpc_server_security_connector*>(other));
@@ -257,7 +271,9 @@ grpc_local_channel_security_connector_create(
const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg);
if (creds->connect_type() == UDS &&
strncmp(GRPC_UDS_URI_PATTERN, server_uri_str,
- strlen(GRPC_UDS_URI_PATTERN)) != 0) {
+ strlen(GRPC_UDS_URI_PATTERN)) != 0 &&
+ strncmp(GRPC_ABSTRACT_UDS_URI_PATTERN, server_uri_str,
+ strlen(GRPC_ABSTRACT_UDS_URI_PATTERN)) != 0) {
gpr_log(GPR_ERROR,
"Invalid UDS target name to "
"grpc_local_channel_security_connector_create()");
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
index 822fe15c3f7..67ce84ac800 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.cc
@@ -60,7 +60,9 @@ grpc_channel_security_connector::~grpc_channel_security_connector() {}
int grpc_security_connector_cmp(const grpc_security_connector* sc,
const grpc_security_connector* other) {
- if (sc == nullptr || other == nullptr) return GPR_ICMP(sc, other);
+ if (sc == nullptr || other == nullptr) {
+ return grpc_core::QsortCompare(sc, other);
+ }
return sc->cmp(other);
}
@@ -70,9 +72,10 @@ int grpc_channel_security_connector::channel_security_connector_cmp(
static_cast<const grpc_channel_security_connector*>(other);
GPR_ASSERT(channel_creds() != nullptr);
GPR_ASSERT(other_sc->channel_creds() != nullptr);
- int c = GPR_ICMP(channel_creds(), other_sc->channel_creds());
+ int c = grpc_core::QsortCompare(channel_creds(), other_sc->channel_creds());
if (c != 0) return c;
- return GPR_ICMP(request_metadata_creds(), other_sc->request_metadata_creds());
+ return grpc_core::QsortCompare(request_metadata_creds(),
+ other_sc->request_metadata_creds());
}
int grpc_server_security_connector::server_security_connector_cmp(
@@ -81,15 +84,17 @@ int grpc_server_security_connector::server_security_connector_cmp(
static_cast<const grpc_server_security_connector*>(other);
GPR_ASSERT(server_creds() != nullptr);
GPR_ASSERT(other_sc->server_creds() != nullptr);
- return GPR_ICMP(server_creds(), other_sc->server_creds());
+ return grpc_core::QsortCompare(server_creds(), other_sc->server_creds());
}
static void connector_arg_destroy(void* p) {
+ if (p == nullptr) return;
static_cast<grpc_security_connector*>(p)->Unref(DEBUG_LOCATION,
"connector_arg_destroy");
}
static void* connector_arg_copy(void* p) {
+ if (p == nullptr) return nullptr;
return static_cast<grpc_security_connector*>(p)
->Ref(DEBUG_LOCATION, "connector_arg_copy")
.release();
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
index 6bca37a3968..6d5ba7fb755 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/security_connector.h
@@ -42,7 +42,7 @@ typedef enum { GRPC_SECURITY_OK = 0, GRPC_SECURITY_ERROR } grpc_security_status;
A security connector object represents away to configure the underlying
transport security mechanism and check the resulting trusted peer. */
-#define GRPC_ARG_SECURITY_CONNECTOR "grpc.security_connector"
+#define GRPC_ARG_SECURITY_CONNECTOR "grpc.internal.security_connector"
class grpc_security_connector
: public grpc_core::RefCounted<grpc_security_connector> {
@@ -55,13 +55,18 @@ class grpc_security_connector
url_scheme_(url_scheme) {}
~grpc_security_connector() override = default;
- /* Check the peer. Callee takes ownership of the peer object.
- When done, sets *auth_context and invokes on_peer_checked. */
+ // Checks the peer. Callee takes ownership of the peer object.
+ // When done, sets *auth_context and invokes on_peer_checked.
virtual void check_peer(
tsi_peer peer, grpc_endpoint* ep,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) = 0;
+ // Cancels the pending check_peer() request associated with on_peer_checked.
+ // If there is no such request pending, this is a no-op.
+ virtual void cancel_check_peer(grpc_closure* on_peer_checked,
+ grpc_error_handle error) = 0;
+
/* Compares two security connectors. */
virtual int cmp(const grpc_security_connector* other) const = 0;
@@ -103,12 +108,12 @@ class grpc_channel_security_connector : public grpc_security_connector {
virtual bool check_call_host(y_absl::string_view host,
grpc_auth_context* auth_context,
grpc_closure* on_call_host_checked,
- grpc_error** error) = 0;
+ grpc_error_handle* error) = 0;
/// Cancels a pending asynchronous call to
/// grpc_channel_security_connector_check_call_host() with
/// \a on_call_host_checked as its callback.
virtual void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error* error) = 0;
+ grpc_error_handle error) = 0;
/// Registers handshakers with \a handshake_mgr.
virtual void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
index 3237304f39d..900b3a1e026 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc
@@ -45,18 +45,17 @@
#include "src/core/tsi/transport_security.h"
namespace {
-grpc_error* ssl_check_peer(
+grpc_error_handle ssl_check_peer(
const char* peer_name, const tsi_peer* peer,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context) {
- grpc_error* error = grpc_ssl_check_alpn(peer);
+ grpc_error_handle error = grpc_ssl_check_alpn(peer);
if (error != GRPC_ERROR_NONE) {
return error;
}
/* Check the peer name if specified. */
if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate"));
}
*auth_context =
grpc_ssl_peer_to_auth_context(peer, GRPC_SSL_TRANSPORT_SECURITY_TYPE);
@@ -145,7 +144,7 @@ class grpc_ssl_channel_security_connector final
const char* target_name = overridden_target_name_.empty()
? target_name_.c_str()
: overridden_target_name_.c_str();
- grpc_error* error = ssl_check_peer(target_name, &peer, auth_context);
+ grpc_error_handle error = ssl_check_peer(target_name, &peer, auth_context);
if (error == GRPC_ERROR_NONE &&
verify_options_->verify_peer_callback != nullptr) {
const tsi_peer_property* p =
@@ -162,10 +161,8 @@ class grpc_ssl_channel_security_connector final
verify_options_->verify_peer_callback_userdata);
gpr_free(peer_pem);
if (callback_status) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrFormat("Verify peer callback returned a failure (%d)",
- callback_status)
- .c_str());
+ error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrFormat(
+ "Verify peer callback returned a failure (%d)", callback_status));
}
}
}
@@ -173,6 +170,11 @@ class grpc_ssl_channel_security_connector final
tsi_peer_destruct(&peer);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other_sc) const override {
auto* other =
reinterpret_cast<const grpc_ssl_channel_security_connector*>(other_sc);
@@ -185,14 +187,14 @@ class grpc_ssl_channel_security_connector final
bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
grpc_closure* /*on_call_host_checked*/,
- grpc_error** error) override {
+ grpc_error_handle* error) override {
return grpc_ssl_check_call_host(host, target_name_.c_str(),
overridden_target_name_.c_str(),
auth_context, error);
}
void cancel_check_call_host(grpc_closure* /*on_call_host_checked*/,
- grpc_error* error) override {
+ grpc_error_handle error) override {
GRPC_ERROR_UNREF(error);
}
@@ -288,11 +290,16 @@ class grpc_ssl_server_security_connector
void check_peer(tsi_peer peer, grpc_endpoint* /*ep*/,
grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override {
- grpc_error* error = ssl_check_peer(nullptr, &peer, auth_context);
+ grpc_error_handle error = ssl_check_peer(nullptr, &peer, auth_context);
tsi_peer_destruct(&peer);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
}
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
+
int cmp(const grpc_security_connector* other) const override {
return server_security_connector_cmp(
static_cast<const grpc_server_security_connector*>(other));
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
index 04c32bb2a8c..57342d94621 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl/ssl_security_connector.h
@@ -23,9 +23,8 @@
#include <grpc/grpc_security.h>
-#include "src/core/lib/security/security_connector/security_connector.h"
-
#include "src/core/lib/gprpp/ref_counted_ptr.h"
+#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/tsi/ssl_transport_security.h"
#include "src/core/tsi/transport_security_interface.h"
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
index c9258f8aa4e..4e2ded5caca 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.cc
@@ -154,7 +154,7 @@ tsi_tls_version grpc_get_tsi_tls_version(grpc_tls_version tls_version) {
}
}
-grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer) {
+grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer) {
#if TSI_OPENSSL_ALPN_SUPPORT
/* Check the ALPN if ALPN is supported. */
const tsi_peer_property* p =
@@ -171,13 +171,12 @@ grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer) {
return GRPC_ERROR_NONE;
}
-grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
- const tsi_peer* peer) {
+grpc_error_handle grpc_ssl_check_peer_name(y_absl::string_view peer_name,
+ const tsi_peer* peer) {
/* Check the peer name if specified. */
if (!peer_name.empty() && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
+ return GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate"));
}
return GRPC_ERROR_NONE;
}
@@ -186,7 +185,7 @@ bool grpc_ssl_check_call_host(y_absl::string_view host,
y_absl::string_view target_name,
y_absl::string_view overridden_target_name,
grpc_auth_context* auth_context,
- grpc_error** error) {
+ grpc_error_handle* error) {
grpc_security_status status = GRPC_SECURITY_ERROR;
tsi_peer peer = grpc_shallow_peer_from_ssl_auth_context(auth_context);
if (grpc_ssl_host_matches_name(&peer, host)) status = GRPC_SECURITY_OK;
@@ -199,6 +198,7 @@ bool grpc_ssl_check_call_host(y_absl::string_view host,
if (status != GRPC_SECURITY_OK) {
*error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"call host does not match SSL server name");
+ gpr_log(GPR_ERROR, "call host does not match SSL server name");
}
grpc_shallow_peer_destruct(&peer);
return true;
@@ -279,7 +279,11 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
for (i = 0; i < peer->property_count; i++) {
const tsi_peer_property* prop = &peer->properties[i];
if (prop->name == nullptr) continue;
- if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
+ if (strcmp(prop->name, TSI_X509_SUBJECT_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_X509_SUBJECT_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) ==
+ 0) {
/* If there is no subject alt name, have the CN as the identity. */
if (peer_identity_property_name == nullptr) {
peer_identity_property_name = GRPC_X509_CN_PROPERTY_NAME;
@@ -307,7 +311,12 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
grpc_auth_context_add_property(
ctx.get(), GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME,
prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_DNS_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_PEER_DNS_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
} else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_PEER_URI_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
uri_count++;
y_absl::string_view spiffe_id(prop->value.data, prop->value.length);
if (IsSpiffeId(spiffe_id)) {
@@ -315,6 +324,12 @@ grpc_core::RefCountedPtr<grpc_auth_context> grpc_ssl_peer_to_auth_context(
spiffe_length = prop->value.length;
has_spiffe_id = true;
}
+ } else if (strcmp(prop->name, TSI_X509_EMAIL_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_PEER_EMAIL_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
+ } else if (strcmp(prop->name, TSI_X509_IP_PEER_PROPERTY) == 0) {
+ grpc_auth_context_add_property(ctx.get(), GRPC_PEER_IP_PROPERTY_NAME,
+ prop->value.data, prop->value.length);
}
}
if (peer_identity_property_name != nullptr) {
@@ -364,6 +379,9 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
if (strcmp(prop->name, GRPC_X509_SAN_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(
&peer, prop, TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_X509_SUBJECT_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_SUBJECT_PEER_PROPERTY);
} else if (strcmp(prop->name, GRPC_X509_CN_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(
&peer, prop, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY);
@@ -378,9 +396,21 @@ tsi_peer grpc_shallow_peer_from_ssl_auth_context(
0) {
add_shallow_auth_property_to_peer(&peer, prop,
TSI_X509_PEM_CERT_CHAIN_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_DNS_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_DNS_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_URI_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_URI_PEER_PROPERTY);
} else if (strcmp(prop->name, GRPC_PEER_SPIFFE_ID_PROPERTY_NAME) == 0) {
add_shallow_auth_property_to_peer(&peer, prop,
TSI_X509_URI_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_EMAIL_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_EMAIL_PEER_PROPERTY);
+ } else if (strcmp(prop->name, GRPC_PEER_IP_PROPERTY_NAME) == 0) {
+ add_shallow_auth_property_to_peer(&peer, prop,
+ TSI_X509_IP_PEER_PROPERTY);
}
}
}
@@ -503,7 +533,7 @@ static void grpc_ssl_session_cache_arg_destroy(void* p) {
}
static int grpc_ssl_session_cache_arg_cmp(void* p, void* q) {
- return GPR_ICMP(p, q);
+ return grpc_core::QsortCompare(p, q);
}
grpc_arg grpc_ssl_session_cache_create_channel_arg(
@@ -542,7 +572,7 @@ grpc_slice DefaultSslRootStore::ComputePemRootCerts() {
const bool not_use_system_roots =
GPR_GLOBAL_CONFIG_GET(grpc_not_use_system_ssl_roots);
// First try to load the roots from the configuration.
- grpc_core::UniquePtr<char> default_root_certs_path =
+ UniquePtr<char> default_root_certs_path =
GPR_GLOBAL_CONFIG_GET(grpc_default_ssl_roots_file_path);
if (strlen(default_root_certs_path.get()) > 0) {
GRPC_LOG_IF_ERROR(
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
index 120217b6fc4..7e122d94d65 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/ssl_utils.h
@@ -44,11 +44,11 @@
#define GRPC_SSL_URL_SCHEME "https"
/* Check ALPN information returned from SSL handshakes. */
-grpc_error* grpc_ssl_check_alpn(const tsi_peer* peer);
+grpc_error_handle grpc_ssl_check_alpn(const tsi_peer* peer);
/* Check peer name information returned from SSL handshakes. */
-grpc_error* grpc_ssl_check_peer_name(y_absl::string_view peer_name,
- const tsi_peer* peer);
+grpc_error_handle grpc_ssl_check_peer_name(y_absl::string_view peer_name,
+ const tsi_peer* peer);
/* Compare targer_name information extracted from SSL security connectors. */
int grpc_ssl_cmp_target_name(y_absl::string_view target_name,
y_absl::string_view other_target_name,
@@ -59,7 +59,7 @@ bool grpc_ssl_check_call_host(y_absl::string_view host,
y_absl::string_view target_name,
y_absl::string_view overridden_target_name,
grpc_auth_context* auth_context,
- grpc_error** error);
+ grpc_error_handle* error);
/* Return HTTP2-compliant cipher suites that gRPC accepts by default. */
const char* grpc_get_ssl_cipher_suites(void);
@@ -181,7 +181,7 @@ class PemKeyCertPair {
TString cert_chain_;
};
-typedef y_absl::InlinedVector<grpc_core::PemKeyCertPair, 1> PemKeyCertPairList;
+typedef y_absl::InlinedVector<PemKeyCertPair, 1> PemKeyCertPairList;
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
index 0b3e1c3fda4..dfeafbae603 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.cc
@@ -23,10 +23,12 @@
#include <stdbool.h>
#include <string.h>
+#include "y_absl/functional/bind_front.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/string_view.h"
#include <grpc/grpc.h>
+#include <grpc/grpc_security_constants.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@@ -45,8 +47,157 @@ namespace grpc_core {
namespace {
+char* CopyCoreString(char* src, size_t length) {
+ char* target = static_cast<char*>(gpr_malloc(length + 1));
+ memcpy(target, src, length);
+ target[length] = '\0';
+ return target;
+}
+
+void PendingVerifierRequestInit(
+ const char* target_name, tsi_peer peer,
+ grpc_tls_custom_verification_check_request* request) {
+ GPR_ASSERT(request != nullptr);
+ // The verifier holds a ref to the security connector, so it's fine to
+ // directly point this to the name cached in the security connector.
+ request->target_name = target_name;
+ // TODO(ZhenLian): avoid the copy when the underlying core implementation used
+ // the null-terminating string.
+ bool has_common_name = false;
+ bool has_peer_cert = false;
+ bool has_peer_cert_full_chain = false;
+ std::vector<char*> uri_names;
+ std::vector<char*> dns_names;
+ std::vector<char*> email_names;
+ std::vector<char*> ip_names;
+ for (size_t i = 0; i < peer.property_count; ++i) {
+ const tsi_peer_property* prop = &peer.properties[i];
+ if (prop->name == nullptr) continue;
+ if (strcmp(prop->name, TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY) == 0) {
+ request->peer_info.common_name =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_common_name = true;
+ } else if (strcmp(prop->name, TSI_X509_PEM_CERT_PROPERTY) == 0) {
+ request->peer_info.peer_cert =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_peer_cert = true;
+ } else if (strcmp(prop->name, TSI_X509_PEM_CERT_CHAIN_PROPERTY) == 0) {
+ request->peer_info.peer_cert_full_chain =
+ CopyCoreString(prop->value.data, prop->value.length);
+ has_peer_cert_full_chain = true;
+ } else if (strcmp(prop->name, TSI_X509_URI_PEER_PROPERTY) == 0) {
+ char* uri = CopyCoreString(prop->value.data, prop->value.length);
+ uri_names.emplace_back(uri);
+ } else if (strcmp(prop->name, TSI_X509_DNS_PEER_PROPERTY) == 0) {
+ char* dns = CopyCoreString(prop->value.data, prop->value.length);
+ dns_names.emplace_back(dns);
+ } else if (strcmp(prop->name, TSI_X509_EMAIL_PEER_PROPERTY) == 0) {
+ char* email = CopyCoreString(prop->value.data, prop->value.length);
+ email_names.emplace_back(email);
+ } else if (strcmp(prop->name, TSI_X509_IP_PEER_PROPERTY) == 0) {
+ char* ip = CopyCoreString(prop->value.data, prop->value.length);
+ ip_names.emplace_back(ip);
+ }
+ }
+ if (!has_common_name) {
+ request->peer_info.common_name = nullptr;
+ }
+ if (!has_peer_cert) {
+ request->peer_info.peer_cert = nullptr;
+ }
+ if (!has_peer_cert_full_chain) {
+ request->peer_info.peer_cert_full_chain = nullptr;
+ }
+ request->peer_info.san_names.uri_names_size = uri_names.size();
+ if (!uri_names.empty()) {
+ request->peer_info.san_names.uri_names =
+ new char*[request->peer_info.san_names.uri_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.uri_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.uri_names[i] = uri_names[i];
+ }
+ } else {
+ request->peer_info.san_names.uri_names = nullptr;
+ }
+ request->peer_info.san_names.dns_names_size = dns_names.size();
+ if (!dns_names.empty()) {
+ request->peer_info.san_names.dns_names =
+ new char*[request->peer_info.san_names.dns_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.dns_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.dns_names[i] = dns_names[i];
+ }
+ } else {
+ request->peer_info.san_names.dns_names = nullptr;
+ }
+ request->peer_info.san_names.email_names_size = email_names.size();
+ if (!email_names.empty()) {
+ request->peer_info.san_names.email_names =
+ new char*[request->peer_info.san_names.email_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.email_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.email_names[i] = email_names[i];
+ }
+ } else {
+ request->peer_info.san_names.email_names = nullptr;
+ }
+ request->peer_info.san_names.ip_names_size = ip_names.size();
+ if (!ip_names.empty()) {
+ request->peer_info.san_names.ip_names =
+ new char*[request->peer_info.san_names.ip_names_size];
+ for (size_t i = 0; i < request->peer_info.san_names.ip_names_size; ++i) {
+ // We directly point the char* string stored in vector to the |request|.
+ // That string will be released when the |request| is destroyed.
+ request->peer_info.san_names.ip_names[i] = ip_names[i];
+ }
+ } else {
+ request->peer_info.san_names.ip_names = nullptr;
+ }
+}
+
+void PendingVerifierRequestDestroy(
+ grpc_tls_custom_verification_check_request* request) {
+ GPR_ASSERT(request != nullptr);
+ if (request->peer_info.common_name != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.common_name));
+ }
+ if (request->peer_info.san_names.uri_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.uri_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.uri_names[i]);
+ }
+ delete[] request->peer_info.san_names.uri_names;
+ }
+ if (request->peer_info.san_names.dns_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.dns_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.dns_names[i]);
+ }
+ delete[] request->peer_info.san_names.dns_names;
+ }
+ if (request->peer_info.san_names.email_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.email_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.email_names[i]);
+ }
+ delete[] request->peer_info.san_names.email_names;
+ }
+ if (request->peer_info.san_names.ip_names_size > 0) {
+ for (size_t i = 0; i < request->peer_info.san_names.ip_names_size; ++i) {
+ gpr_free(request->peer_info.san_names.ip_names[i]);
+ }
+ delete[] request->peer_info.san_names.ip_names;
+ }
+ if (request->peer_info.peer_cert != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.peer_cert));
+ }
+ if (request->peer_info.peer_cert_full_chain != nullptr) {
+ gpr_free(const_cast<char*>(request->peer_info.peer_cert_full_chain));
+ }
+}
+
tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair(
- const grpc_core::PemKeyCertPairList& cert_pair_list) {
+ const PemKeyCertPairList& cert_pair_list) {
tsi_ssl_pem_key_cert_pair* tsi_pairs = nullptr;
size_t num_key_cert_pairs = cert_pair_list.size();
if (num_key_cert_pairs > 0) {
@@ -68,11 +219,11 @@ tsi_ssl_pem_key_cert_pair* ConvertToTsiPemKeyCertPair(
} // namespace
// -------------------channel security connector-------------------
-grpc_core::RefCountedPtr<grpc_channel_security_connector>
+RefCountedPtr<grpc_channel_security_connector>
TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name, const char* overridden_target_name,
tsi_ssl_session_cache* ssl_session_cache) {
if (channel_creds == nullptr) {
@@ -93,18 +244,16 @@ TlsChannelSecurityConnector::CreateTlsChannelSecurityConnector(
"TlsChannelSecurityConnectorCreate()");
return nullptr;
}
- grpc_core::RefCountedPtr<TlsChannelSecurityConnector> c =
- grpc_core::MakeRefCounted<TlsChannelSecurityConnector>(
- std::move(channel_creds), std::move(options),
- std::move(request_metadata_creds), target_name,
- overridden_target_name, ssl_session_cache);
- return c;
+ return MakeRefCounted<TlsChannelSecurityConnector>(
+ std::move(channel_creds), std::move(options),
+ std::move(request_metadata_creds), target_name, overridden_target_name,
+ ssl_session_cache);
}
TlsChannelSecurityConnector::TlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name, const char* overridden_target_name,
tsi_ssl_session_cache* ssl_session_cache)
: grpc_channel_security_connector(GRPC_SSL_URL_SCHEME,
@@ -117,10 +266,9 @@ TlsChannelSecurityConnector::TlsChannelSecurityConnector(
if (ssl_session_cache_ != nullptr) {
tsi_ssl_session_cache_ref(ssl_session_cache_);
}
- check_arg_ = ServerAuthorizationCheckArgCreate(this);
y_absl::string_view host;
y_absl::string_view port;
- grpc_core::SplitHostPort(target_name, &host, &port);
+ SplitHostPort(target_name, &host, &port);
target_name_ = TString(host);
// Create a watcher.
auto watcher_ptr = y_absl::make_unique<TlsChannelCertificateWatcher>(this);
@@ -165,18 +313,15 @@ TlsChannelSecurityConnector::~TlsChannelSecurityConnector() {
if (client_handshaker_factory_ != nullptr) {
tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
}
- if (check_arg_ != nullptr) {
- ServerAuthorizationCheckArgDestroy(check_arg_);
- }
}
void TlsChannelSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
- grpc_core::HandshakeManager* handshake_mgr) {
- grpc_core::MutexLock lock(&mu_);
+ HandshakeManager* handshake_mgr) {
+ MutexLock lock(&mu_);
+ tsi_handshaker* tsi_hs = nullptr;
if (client_handshaker_factory_ != nullptr) {
// Instantiate TSI handshaker.
- tsi_handshaker* tsi_hs = nullptr;
tsi_result result = tsi_ssl_client_handshaker_factory_create_handshaker(
client_handshaker_factory_,
overridden_target_name_.empty() ? target_name_.c_str()
@@ -185,161 +330,100 @@ void TlsChannelSecurityConnector::add_handshakers(
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
- return;
}
- // Create handshakers.
- handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
- return;
}
- // TODO(ZhenLian): Implement the logic(delegation to
- // BlockOnInitialCredentialHandshaker) when certificates are not ready.
- gpr_log(GPR_ERROR, "%s not supported yet.",
- "Client BlockOnInitialCredentialHandshaker");
+ // If tsi_hs is null, this will add a failing handshaker.
+ handshake_mgr->Add(SecurityHandshakerCreate(tsi_hs, this, args));
}
void TlsChannelSecurityConnector::check_peer(
tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) {
const char* target_name = overridden_target_name_.empty()
? target_name_.c_str()
: overridden_target_name_.c_str();
- grpc_error* error = grpc_ssl_check_alpn(&peer);
+ grpc_error_handle error = grpc_ssl_check_alpn(&peer);
if (error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
tsi_peer_destruct(&peer);
return;
}
*auth_context =
grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
- if (options_->server_verification_option() == GRPC_TLS_SERVER_VERIFICATION) {
- /* Do the default host name check if specifying the target name. */
- error = internal::TlsCheckHostName(target_name, &peer);
- if (error != GRPC_ERROR_NONE) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
- return;
- }
+ GPR_ASSERT(options_->certificate_verifier() != nullptr);
+ auto* pending_request = new ChannelPendingVerifierRequest(
+ Ref(), on_peer_checked, peer, target_name);
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ pending_verifier_requests_.emplace(on_peer_checked, pending_request);
+ }
+ pending_request->Start();
+}
+
+void TlsChannelSecurityConnector::cancel_check_peer(
+ grpc_closure* on_peer_checked, grpc_error_handle error) {
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "TlsChannelSecurityConnector::cancel_check_peer error: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return;
}
- /* Do the custom server authorization check, if specified by the user. */
- const grpc_tls_server_authorization_check_config* config =
- options_->server_authorization_check_config();
- /* If server authorization config is not null, use it to perform
- * server authorization check. */
- if (config != nullptr) {
- const tsi_peer_property* p =
- tsi_peer_get_property_by_name(&peer, TSI_X509_PEM_CERT_PROPERTY);
- if (p == nullptr) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Cannot check peer: missing pem cert property.");
- } else {
- char* peer_pem = static_cast<char*>(gpr_zalloc(p->value.length + 1));
- memcpy(peer_pem, p->value.data, p->value.length);
- GPR_ASSERT(check_arg_ != nullptr);
- check_arg_->peer_cert = check_arg_->peer_cert == nullptr
- ? gpr_strdup(peer_pem)
- : check_arg_->peer_cert;
- check_arg_->target_name = check_arg_->target_name == nullptr
- ? gpr_strdup(target_name)
- : check_arg_->target_name;
- on_peer_checked_ = on_peer_checked;
- gpr_free(peer_pem);
- const tsi_peer_property* chain = tsi_peer_get_property_by_name(
- &peer, TSI_X509_PEM_CERT_CHAIN_PROPERTY);
- if (chain != nullptr) {
- char* peer_pem_chain =
- static_cast<char*>(gpr_zalloc(chain->value.length + 1));
- memcpy(peer_pem_chain, chain->value.data, chain->value.length);
- check_arg_->peer_cert_full_chain =
- check_arg_->peer_cert_full_chain == nullptr
- ? gpr_strdup(peer_pem_chain)
- : check_arg_->peer_cert_full_chain;
- gpr_free(peer_pem_chain);
- }
- // TODO(zhenlian) - This should be cleaned up as part of the custom
- // verification changes. Fill in the subject alternative names
- std::vector<char*> subject_alternative_names;
- for (size_t i = 0; i < peer.property_count; i++) {
- const tsi_peer_property* prop = &peer.properties[i];
- if (strcmp(prop->name,
- TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY) == 0) {
- char* san = new char[prop->value.length + 1];
- memcpy(san, prop->value.data, prop->value.length);
- san[prop->value.length] = '\0';
- subject_alternative_names.emplace_back(san);
- }
- }
- if (check_arg_->subject_alternative_names != nullptr) {
- for (size_t i = 0; i < check_arg_->subject_alternative_names_size;
- ++i) {
- delete[] check_arg_->subject_alternative_names[i];
- }
- delete[] check_arg_->subject_alternative_names;
- }
- check_arg_->subject_alternative_names_size =
- subject_alternative_names.size();
- if (subject_alternative_names.empty()) {
- check_arg_->subject_alternative_names = nullptr;
+ auto* verifier = options_->certificate_verifier();
+ if (verifier != nullptr) {
+ grpc_tls_custom_verification_check_request* pending_verifier_request =
+ nullptr;
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ auto it = pending_verifier_requests_.find(on_peer_checked);
+ if (it != pending_verifier_requests_.end()) {
+ pending_verifier_request = it->second->request();
} else {
- check_arg_->subject_alternative_names =
- new char*[check_arg_->subject_alternative_names_size];
- for (size_t i = 0; i < check_arg_->subject_alternative_names_size;
- ++i) {
- check_arg_->subject_alternative_names[i] =
- subject_alternative_names[i];
- }
- }
- int callback_status = config->Schedule(check_arg_);
- /* Server authorization check is handled asynchronously. */
- if (callback_status) {
- tsi_peer_destruct(&peer);
- return;
+ gpr_log(GPR_INFO,
+ "TlsChannelSecurityConnector::cancel_check_peer: no "
+ "corresponding pending request found");
}
- /* Server authorization check is handled synchronously. */
- error = ProcessServerAuthorizationCheckResult(check_arg_);
+ }
+ if (pending_verifier_request != nullptr) {
+ verifier->Cancel(pending_verifier_request);
}
}
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
- tsi_peer_destruct(&peer);
}
int TlsChannelSecurityConnector::cmp(
const grpc_security_connector* other_sc) const {
auto* other = reinterpret_cast<const TlsChannelSecurityConnector*>(other_sc);
int c = channel_security_connector_cmp(other);
- if (c != 0) {
- return c;
- }
- return grpc_ssl_cmp_target_name(
+ if (c != 0) return c;
+ c = grpc_ssl_cmp_target_name(
target_name_.c_str(), other->target_name_.c_str(),
overridden_target_name_.c_str(), other->overridden_target_name_.c_str());
+ if (c != 0) return c;
+ return 0;
}
bool TlsChannelSecurityConnector::check_call_host(
y_absl::string_view host, grpc_auth_context* auth_context,
- grpc_closure* /*on_call_host_checked*/, grpc_error** error) {
- if (options_->server_verification_option() ==
- GRPC_TLS_SKIP_HOSTNAME_VERIFICATION ||
- options_->server_verification_option() ==
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION) {
- return true;
+ grpc_closure* /*on_call_host_checked*/, grpc_error_handle* error) {
+ if (options_->check_call_host()) {
+ return grpc_ssl_check_call_host(host, target_name_.c_str(),
+ overridden_target_name_.c_str(),
+ auth_context, error);
}
- return grpc_ssl_check_call_host(host, target_name_.c_str(),
- overridden_target_name_.c_str(), auth_context,
- error);
+ return true;
}
void TlsChannelSecurityConnector::cancel_check_call_host(
- grpc_closure* /*on_call_host_checked*/, grpc_error* error) {
+ grpc_closure* /*on_call_host_checked*/, grpc_error_handle error) {
GRPC_ERROR_UNREF(error);
}
void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::
- OnCertificatesChanged(
- y_absl::optional<y_absl::string_view> root_certs,
- y_absl::optional<grpc_core::PemKeyCertPairList> key_cert_pairs) {
+ OnCertificatesChanged(y_absl::optional<y_absl::string_view> root_certs,
+ y_absl::optional<PemKeyCertPairList> key_cert_pairs) {
GPR_ASSERT(security_connector_ != nullptr);
- grpc_core::MutexLock lock(&security_connector_->mu_);
+ MutexLock lock(&security_connector_->mu_);
if (root_certs.has_value()) {
security_connector_->pem_root_certs_ = root_certs;
}
@@ -362,28 +446,76 @@ void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
void TlsChannelSecurityConnector::TlsChannelCertificateWatcher::OnError(
- grpc_error* root_cert_error, grpc_error* identity_cert_error) {
+ grpc_error_handle root_cert_error, grpc_error_handle identity_cert_error) {
if (root_cert_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"TlsChannelCertificateWatcher getting root_cert_error: %s",
- grpc_error_string(root_cert_error));
+ grpc_error_std_string(root_cert_error).c_str());
}
if (identity_cert_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"TlsChannelCertificateWatcher getting identity_cert_error: %s",
- grpc_error_string(identity_cert_error));
+ grpc_error_std_string(identity_cert_error).c_str());
}
GRPC_ERROR_UNREF(root_cert_error);
GRPC_ERROR_UNREF(identity_cert_error);
}
+TlsChannelSecurityConnector::ChannelPendingVerifierRequest::
+ ChannelPendingVerifierRequest(
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer, const char* target_name)
+ : security_connector_(std::move(security_connector)),
+ on_peer_checked_(on_peer_checked) {
+ PendingVerifierRequestInit(target_name, peer, &request_);
+ tsi_peer_destruct(&peer);
+}
+
+TlsChannelSecurityConnector::ChannelPendingVerifierRequest::
+ ~ChannelPendingVerifierRequest() {
+ PendingVerifierRequestDestroy(&request_);
+}
+
+void TlsChannelSecurityConnector::ChannelPendingVerifierRequest::Start() {
+ y_absl::Status sync_status;
+ grpc_tls_certificate_verifier* verifier =
+ security_connector_->options_->certificate_verifier();
+ bool is_done = verifier->Verify(
+ &request_,
+ y_absl::bind_front(&ChannelPendingVerifierRequest::OnVerifyDone, this,
+ true),
+ &sync_status);
+ if (is_done) {
+ OnVerifyDone(false, sync_status);
+ }
+}
+
+void TlsChannelSecurityConnector::ChannelPendingVerifierRequest::OnVerifyDone(
+ bool run_callback_inline, y_absl::Status status) {
+ {
+ MutexLock lock(&security_connector_->verifier_request_map_mu_);
+ security_connector_->pending_verifier_requests_.erase(on_peer_checked_);
+ }
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (!status.ok()) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Custom verification check failed with error: ",
+ status.ToString())
+ .c_str());
+ }
+ if (run_callback_inline) {
+ Closure::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ } else {
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ }
+ delete this;
+}
+
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
grpc_security_status
TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
- bool skip_server_certificate_verification =
- options_->server_verification_option() ==
- GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION;
+ bool skip_server_certificate_verification = !options_->verify_server_cert();
/* Free the client handshaker factory if exists. */
if (client_handshaker_factory_ != nullptr) {
tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory_);
@@ -414,87 +546,11 @@ TlsChannelSecurityConnector::UpdateHandshakerFactoryLocked() {
return status;
}
-void TlsChannelSecurityConnector::ServerAuthorizationCheckDone(
- grpc_tls_server_authorization_check_arg* arg) {
- GPR_ASSERT(arg != nullptr);
- grpc_core::ExecCtx exec_ctx;
- grpc_error* error = ProcessServerAuthorizationCheckResult(arg);
- TlsChannelSecurityConnector* connector =
- static_cast<TlsChannelSecurityConnector*>(arg->cb_user_data);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, connector->on_peer_checked_, error);
-}
-
-grpc_error* TlsChannelSecurityConnector::ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg) {
- grpc_error* error = GRPC_ERROR_NONE;
- /* Server authorization check is cancelled by caller. */
- if (arg->status == GRPC_STATUS_CANCELLED) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Server authorization check is cancelled by the caller "
- "with error: ",
- arg->error_details->error_details())
- .c_str());
- } else if (arg->status == GRPC_STATUS_OK) {
- /* Server authorization check completed successfully but returned check
- * failure. */
- if (!arg->success) {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Server authorization check failed with error: ",
- arg->error_details->error_details())
- .c_str());
- }
- /* Server authorization check did not complete correctly. */
- } else {
- error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat(
- "Server authorization check did not finish correctly with error: ",
- arg->error_details->error_details())
- .c_str());
- }
- return error;
-}
-
-grpc_tls_server_authorization_check_arg*
-TlsChannelSecurityConnector::ServerAuthorizationCheckArgCreate(
- void* user_data) {
- grpc_tls_server_authorization_check_arg* arg =
- new grpc_tls_server_authorization_check_arg();
- arg->target_name = nullptr;
- arg->peer_cert = nullptr;
- arg->peer_cert_full_chain = nullptr;
- arg->subject_alternative_names = nullptr;
- arg->subject_alternative_names_size = 0;
- arg->error_details = new grpc_tls_error_details();
- arg->cb = ServerAuthorizationCheckDone;
- arg->cb_user_data = user_data;
- arg->status = GRPC_STATUS_OK;
- return arg;
-}
-
-void TlsChannelSecurityConnector::ServerAuthorizationCheckArgDestroy(
- grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr) {
- return;
- }
- gpr_free(const_cast<char*>(arg->target_name));
- gpr_free(const_cast<char*>(arg->peer_cert));
- gpr_free(const_cast<char*>(arg->peer_cert_full_chain));
- for (size_t i = 0; i < arg->subject_alternative_names_size; ++i) {
- delete[] arg->subject_alternative_names[i];
- }
- delete[] arg->subject_alternative_names;
- delete arg->error_details;
- if (arg->destroy_context != nullptr) {
- arg->destroy_context(arg->context);
- }
- delete arg;
-}
-
// -------------------server security connector-------------------
-grpc_core::RefCountedPtr<grpc_server_security_connector>
+RefCountedPtr<grpc_server_security_connector>
TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options) {
+ RefCountedPtr<grpc_server_credentials> server_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options) {
if (server_creds == nullptr) {
gpr_log(GPR_ERROR,
"server_creds is nullptr in "
@@ -507,15 +563,13 @@ TlsServerSecurityConnector::CreateTlsServerSecurityConnector(
"TlsServerSecurityConnectorCreate()");
return nullptr;
}
- grpc_core::RefCountedPtr<TlsServerSecurityConnector> c =
- grpc_core::MakeRefCounted<TlsServerSecurityConnector>(
- std::move(server_creds), std::move(options));
- return c;
+ return MakeRefCounted<TlsServerSecurityConnector>(std::move(server_creds),
+ std::move(options));
}
TlsServerSecurityConnector::TlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options)
+ RefCountedPtr<grpc_server_credentials> server_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options)
: grpc_server_security_connector(GRPC_SSL_URL_SCHEME,
std::move(server_creds)),
options_(std::move(options)) {
@@ -551,51 +605,91 @@ TlsServerSecurityConnector::~TlsServerSecurityConnector() {
void TlsServerSecurityConnector::add_handshakers(
const grpc_channel_args* args, grpc_pollset_set* /*interested_parties*/,
- grpc_core::HandshakeManager* handshake_mgr) {
- grpc_core::MutexLock lock(&mu_);
+ HandshakeManager* handshake_mgr) {
+ MutexLock lock(&mu_);
+ tsi_handshaker* tsi_hs = nullptr;
if (server_handshaker_factory_ != nullptr) {
// Instantiate TSI handshaker.
- tsi_handshaker* tsi_hs = nullptr;
tsi_result result = tsi_ssl_server_handshaker_factory_create_handshaker(
server_handshaker_factory_, &tsi_hs);
if (result != TSI_OK) {
gpr_log(GPR_ERROR, "Handshaker creation failed with error %s.",
tsi_result_to_string(result));
- return;
}
- // Create handshakers.
- handshake_mgr->Add(grpc_core::SecurityHandshakerCreate(tsi_hs, this, args));
- return;
}
- // TODO(ZhenLian): Implement the logic(delegation to
- // BlockOnInitialCredentialHandshaker) when certificates are not ready.
- gpr_log(GPR_ERROR, "%s not supported yet.",
- "Server BlockOnInitialCredentialHandshaker");
+ // If tsi_hs is null, this will add a failing handshaker.
+ handshake_mgr->Add(SecurityHandshakerCreate(tsi_hs, this, args));
}
void TlsServerSecurityConnector::check_peer(
tsi_peer peer, grpc_endpoint* /*ep*/,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) {
- grpc_error* error = grpc_ssl_check_alpn(&peer);
+ grpc_error_handle error = grpc_ssl_check_alpn(&peer);
+ if (error != GRPC_ERROR_NONE) {
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ tsi_peer_destruct(&peer);
+ return;
+ }
*auth_context =
grpc_ssl_peer_to_auth_context(&peer, GRPC_TLS_TRANSPORT_SECURITY_TYPE);
- tsi_peer_destruct(&peer);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ if (options_->certificate_verifier() != nullptr) {
+ auto* pending_request =
+ new ServerPendingVerifierRequest(Ref(), on_peer_checked, peer);
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ pending_verifier_requests_.emplace(on_peer_checked, pending_request);
+ }
+ pending_request->Start();
+ } else {
+ tsi_peer_destruct(&peer);
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked, error);
+ }
+}
+
+void TlsServerSecurityConnector::cancel_check_peer(
+ grpc_closure* on_peer_checked, grpc_error_handle error) {
+ if (error != GRPC_ERROR_NONE) {
+ gpr_log(GPR_ERROR,
+ "TlsServerSecurityConnector::cancel_check_peer error: %s",
+ grpc_error_std_string(error).c_str());
+ GRPC_ERROR_UNREF(error);
+ return;
+ }
+ auto* verifier = options_->certificate_verifier();
+ if (verifier != nullptr) {
+ grpc_tls_custom_verification_check_request* pending_verifier_request =
+ nullptr;
+ {
+ MutexLock lock(&verifier_request_map_mu_);
+ auto it = pending_verifier_requests_.find(on_peer_checked);
+ if (it != pending_verifier_requests_.end()) {
+ pending_verifier_request = it->second->request();
+ } else {
+ gpr_log(GPR_INFO,
+ "TlsServerSecurityConnector::cancel_check_peer: no "
+ "corresponding pending request found");
+ }
+ }
+ if (pending_verifier_request != nullptr) {
+ verifier->Cancel(pending_verifier_request);
+ }
+ }
}
int TlsServerSecurityConnector::cmp(
- const grpc_security_connector* other) const {
- return server_security_connector_cmp(
- static_cast<const grpc_server_security_connector*>(other));
+ const grpc_security_connector* other_sc) const {
+ auto* other = reinterpret_cast<const TlsServerSecurityConnector*>(other_sc);
+ int c = server_security_connector_cmp(other);
+ if (c != 0) return c;
+ return 0;
}
void TlsServerSecurityConnector::TlsServerCertificateWatcher::
- OnCertificatesChanged(
- y_absl::optional<y_absl::string_view> root_certs,
- y_absl::optional<grpc_core::PemKeyCertPairList> key_cert_pairs) {
+ OnCertificatesChanged(y_absl::optional<y_absl::string_view> root_certs,
+ y_absl::optional<PemKeyCertPairList> key_cert_pairs) {
GPR_ASSERT(security_connector_ != nullptr);
- grpc_core::MutexLock lock(&security_connector_->mu_);
+ MutexLock lock(&security_connector_->mu_);
if (root_certs.has_value()) {
security_connector_->pem_root_certs_ = root_certs;
}
@@ -622,21 +716,70 @@ void TlsServerSecurityConnector::TlsServerCertificateWatcher::
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
void TlsServerSecurityConnector::TlsServerCertificateWatcher::OnError(
- grpc_error* root_cert_error, grpc_error* identity_cert_error) {
+ grpc_error_handle root_cert_error, grpc_error_handle identity_cert_error) {
if (root_cert_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"TlsServerCertificateWatcher getting root_cert_error: %s",
- grpc_error_string(root_cert_error));
+ grpc_error_std_string(root_cert_error).c_str());
}
if (identity_cert_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"TlsServerCertificateWatcher getting identity_cert_error: %s",
- grpc_error_string(identity_cert_error));
+ grpc_error_std_string(identity_cert_error).c_str());
}
GRPC_ERROR_UNREF(root_cert_error);
GRPC_ERROR_UNREF(identity_cert_error);
}
+TlsServerSecurityConnector::ServerPendingVerifierRequest::
+ ServerPendingVerifierRequest(
+ RefCountedPtr<TlsServerSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer)
+ : security_connector_(std::move(security_connector)),
+ on_peer_checked_(on_peer_checked) {
+ PendingVerifierRequestInit(nullptr, peer, &request_);
+ tsi_peer_destruct(&peer);
+}
+
+TlsServerSecurityConnector::ServerPendingVerifierRequest::
+ ~ServerPendingVerifierRequest() {
+ PendingVerifierRequestDestroy(&request_);
+}
+
+void TlsServerSecurityConnector::ServerPendingVerifierRequest::Start() {
+ y_absl::Status sync_status;
+ grpc_tls_certificate_verifier* verifier =
+ security_connector_->options_->certificate_verifier();
+ bool is_done = verifier->Verify(
+ &request_,
+ y_absl::bind_front(&ServerPendingVerifierRequest::OnVerifyDone, this, true),
+ &sync_status);
+ if (is_done) {
+ OnVerifyDone(false, sync_status);
+ }
+}
+
+void TlsServerSecurityConnector::ServerPendingVerifierRequest::OnVerifyDone(
+ bool run_callback_inline, y_absl::Status status) {
+ {
+ MutexLock lock(&security_connector_->verifier_request_map_mu_);
+ security_connector_->pending_verifier_requests_.erase(on_peer_checked_);
+ }
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ if (!status.ok()) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
+ y_absl::StrCat("Custom verification check failed with error: ",
+ status.ToString())
+ .c_str());
+ }
+ if (run_callback_inline) {
+ Closure::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ } else {
+ ExecCtx::Run(DEBUG_LOCATION, on_peer_checked_, error);
+ }
+ delete this;
+}
+
// TODO(ZhenLian): implement the logic to signal waiting handshakers once
// BlockOnInitialCredentialHandshaker is implemented.
grpc_security_status
@@ -670,18 +813,4 @@ TlsServerSecurityConnector::UpdateHandshakerFactoryLocked() {
return status;
}
-namespace internal {
-
-grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer) {
- /* Check the peer name if specified. */
- if (peer_name != nullptr && !grpc_ssl_host_matches_name(peer, peer_name)) {
- return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Peer name ", peer_name, " is not in peer certificate")
- .c_str());
- }
- return GRPC_ERROR_NONE;
-}
-
-} // namespace internal
-
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
index 32ee8bc9d5e..57337631ae1 100644
--- a/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
+++ b/contrib/libs/grpc/src/core/lib/security/security_connector/tls/tls_security_connector.h
@@ -21,13 +21,13 @@
#include <grpc/support/port_platform.h>
+#include "y_absl/status/status.h"
+
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-#define GRPC_TLS_TRANSPORT_SECURITY_TYPE "tls"
-
namespace grpc_core {
// Channel security connector using TLS as transport security protocol.
@@ -35,18 +35,18 @@ class TlsChannelSecurityConnector final
: public grpc_channel_security_connector {
public:
// static factory method to create a TLS channel security connector.
- static grpc_core::RefCountedPtr<grpc_channel_security_connector>
+ static RefCountedPtr<grpc_channel_security_connector>
CreateTlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name, const char* overridden_target_name,
tsi_ssl_session_cache* ssl_session_cache);
TlsChannelSecurityConnector(
- grpc_core::RefCountedPtr<grpc_channel_credentials> channel_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options,
- grpc_core::RefCountedPtr<grpc_call_credentials> request_metadata_creds,
+ RefCountedPtr<grpc_channel_credentials> channel_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options,
+ RefCountedPtr<grpc_call_credentials> request_metadata_creds,
const char* target_name, const char* overridden_target_name,
tsi_ssl_session_cache* ssl_session_cache);
@@ -54,33 +54,36 @@ class TlsChannelSecurityConnector final
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
- grpc_core::HandshakeManager* handshake_mgr) override;
+ HandshakeManager* handshake_mgr) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
+ void cancel_check_peer(grpc_closure* on_peer_checked,
+ grpc_error_handle error) override;
+
int cmp(const grpc_security_connector* other_sc) const override;
bool check_call_host(y_absl::string_view host, grpc_auth_context* auth_context,
grpc_closure* on_call_host_checked,
- grpc_error** error) override;
+ grpc_error_handle* error) override;
void cancel_check_call_host(grpc_closure* on_call_host_checked,
- grpc_error* error) override;
+ grpc_error_handle error) override;
tsi_ssl_client_handshaker_factory* ClientHandshakerFactoryForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
return client_handshaker_factory_;
};
y_absl::optional<y_absl::string_view> RootCertsForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
return pem_root_certs_;
}
- y_absl::optional<grpc_core::PemKeyCertPairList> KeyCertPairListForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ y_absl::optional<PemKeyCertPairList> KeyCertPairListForTesting() {
+ MutexLock lock(&mu_);
return pem_key_cert_pair_list_;
}
@@ -96,86 +99,100 @@ class TlsChannelSecurityConnector final
: security_connector_(security_connector) {}
void OnCertificatesChanged(
y_absl::optional<y_absl::string_view> root_certs,
- y_absl::optional<grpc_core::PemKeyCertPairList> key_cert_pairs) override;
- void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) override;
+ y_absl::optional<PemKeyCertPairList> key_cert_pairs) override;
+ void OnError(grpc_error_handle root_cert_error,
+ grpc_error_handle identity_cert_error) override;
private:
TlsChannelSecurityConnector* security_connector_ = nullptr;
};
- // Updates |client_handshaker_factory_| when the certificates that
- // |certificate_watcher_| is watching get updated.
- grpc_security_status UpdateHandshakerFactoryLocked();
+ // Use "new" to create a new instance, and no need to delete it later, since
+ // it will be self-destroyed in |OnVerifyDone|.
+ class ChannelPendingVerifierRequest {
+ public:
+ ChannelPendingVerifierRequest(
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer, const char* target_name);
- // gRPC-provided callback executed by application, which servers to bring the
- // control back to gRPC core.
- static void ServerAuthorizationCheckDone(
- grpc_tls_server_authorization_check_arg* arg);
+ ~ChannelPendingVerifierRequest();
- // A util function to process server authorization check result.
- static grpc_error* ProcessServerAuthorizationCheckResult(
- grpc_tls_server_authorization_check_arg* arg);
+ void Start();
- // A util function to create a server authorization check arg instance.
- static grpc_tls_server_authorization_check_arg*
- ServerAuthorizationCheckArgCreate(void* user_data);
+ grpc_tls_custom_verification_check_request* request() { return &request_; }
- // A util function to destroy a server authorization check arg instance.
- static void ServerAuthorizationCheckArgDestroy(
- grpc_tls_server_authorization_check_arg* arg);
+ private:
+ void OnVerifyDone(bool run_callback_inline, y_absl::Status status);
+ // The request will keep a reference of the security connector to make sure
+ // it won't be destroyed while the request is still ongoing.
+ RefCountedPtr<TlsChannelSecurityConnector> security_connector_;
+ grpc_tls_custom_verification_check_request request_;
+ grpc_closure* on_peer_checked_;
+ };
- grpc_core::Mutex mu_;
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
+ // Updates |client_handshaker_factory_| when the certificates that
+ // |certificate_watcher_| is watching get updated.
+ grpc_security_status UpdateHandshakerFactoryLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ Mutex mu_;
+ // We need a separate mutex for |pending_verifier_requests_|, otherwise there
+ // would be deadlock errors.
+ Mutex verifier_request_map_mu_;
+ RefCountedPtr<grpc_tls_credentials_options> options_;
grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
certificate_watcher_ = nullptr;
- grpc_closure* on_peer_checked_ = nullptr;
TString target_name_;
TString overridden_target_name_;
- tsi_ssl_client_handshaker_factory* client_handshaker_factory_ = nullptr;
- grpc_tls_server_authorization_check_arg* check_arg_ = nullptr;
- tsi_ssl_session_cache* ssl_session_cache_ = nullptr;
- y_absl::optional<y_absl::string_view> pem_root_certs_;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pair_list_;
+ tsi_ssl_client_handshaker_factory* client_handshaker_factory_
+ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ tsi_ssl_session_cache* ssl_session_cache_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ y_absl::optional<y_absl::string_view> pem_root_certs_ Y_ABSL_GUARDED_BY(mu_);
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pair_list_
+ Y_ABSL_GUARDED_BY(mu_);
+ std::map<grpc_closure* /*on_peer_checked*/, ChannelPendingVerifierRequest*>
+ pending_verifier_requests_ Y_ABSL_GUARDED_BY(verifier_request_map_mu_);
};
// Server security connector using TLS as transport security protocol.
class TlsServerSecurityConnector final : public grpc_server_security_connector {
public:
// static factory method to create a TLS server security connector.
- static grpc_core::RefCountedPtr<grpc_server_security_connector>
+ static RefCountedPtr<grpc_server_security_connector>
CreateTlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
+ RefCountedPtr<grpc_server_credentials> server_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options);
TlsServerSecurityConnector(
- grpc_core::RefCountedPtr<grpc_server_credentials> server_creds,
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options);
+ RefCountedPtr<grpc_server_credentials> server_creds,
+ RefCountedPtr<grpc_tls_credentials_options> options);
~TlsServerSecurityConnector() override;
void add_handshakers(const grpc_channel_args* args,
grpc_pollset_set* interested_parties,
- grpc_core::HandshakeManager* handshake_mgr) override;
+ HandshakeManager* handshake_mgr) override;
void check_peer(tsi_peer peer, grpc_endpoint* ep,
- grpc_core::RefCountedPtr<grpc_auth_context>* auth_context,
+ RefCountedPtr<grpc_auth_context>* auth_context,
grpc_closure* on_peer_checked) override;
+ void cancel_check_peer(grpc_closure* /*on_peer_checked*/,
+ grpc_error_handle error) override;
+
int cmp(const grpc_security_connector* other) const override;
tsi_ssl_server_handshaker_factory* ServerHandshakerFactoryForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
return server_handshaker_factory_;
};
const y_absl::optional<y_absl::string_view>& RootCertsForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ MutexLock lock(&mu_);
return pem_root_certs_;
}
- const y_absl::optional<grpc_core::PemKeyCertPairList>&
- KeyCertPairListForTesting() {
- grpc_core::MutexLock lock(&mu_);
+ const y_absl::optional<PemKeyCertPairList>& KeyCertPairListForTesting() {
+ MutexLock lock(&mu_);
return pem_key_cert_pair_list_;
}
@@ -191,36 +208,58 @@ class TlsServerSecurityConnector final : public grpc_server_security_connector {
: security_connector_(security_connector) {}
void OnCertificatesChanged(
y_absl::optional<y_absl::string_view> root_certs,
- y_absl::optional<grpc_core::PemKeyCertPairList> key_cert_pairs) override;
- void OnError(grpc_error* root_cert_error,
- grpc_error* identity_cert_error) override;
+ y_absl::optional<PemKeyCertPairList> key_cert_pairs) override;
+
+ void OnError(grpc_error_handle root_cert_error,
+ grpc_error_handle identity_cert_error) override;
private:
TlsServerSecurityConnector* security_connector_ = nullptr;
};
- // Updates |server_handshaker_factory_| when the certificates that
- // |certificate_watcher_| is watching get updated.
- grpc_security_status UpdateHandshakerFactoryLocked();
+ // Use "new" to create a new instance, and no need to delete it later, since
+ // it will be self-destroyed in |OnVerifyDone|.
+ class ServerPendingVerifierRequest {
+ public:
+ ServerPendingVerifierRequest(
+ RefCountedPtr<TlsServerSecurityConnector> security_connector,
+ grpc_closure* on_peer_checked, tsi_peer peer);
- grpc_core::Mutex mu_;
- grpc_core::RefCountedPtr<grpc_tls_credentials_options> options_;
- grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
- certificate_watcher_ = nullptr;
+ ~ServerPendingVerifierRequest();
- tsi_ssl_server_handshaker_factory* server_handshaker_factory_ = nullptr;
- y_absl::optional<y_absl::string_view> pem_root_certs_;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pair_list_;
-};
+ void Start();
-// ---- Functions below are exposed for testing only -----------------------
-namespace internal {
+ grpc_tls_custom_verification_check_request* request() { return &request_; }
-// TlsCheckHostName checks if |peer_name| matches the identity information
-// contained in |peer|. This is AKA hostname check.
-grpc_error* TlsCheckHostName(const char* peer_name, const tsi_peer* peer);
+ private:
+ void OnVerifyDone(bool run_callback_inline, y_absl::Status status);
+ // The request will keep a reference of the security connector to make sure
+ // it won't be destroyed while the request is still ongoing.
+ RefCountedPtr<TlsServerSecurityConnector> security_connector_;
+ grpc_tls_custom_verification_check_request request_;
+ grpc_closure* on_peer_checked_;
+ };
-} // namespace internal
+ // Updates |server_handshaker_factory_| when the certificates that
+ // |certificate_watcher_| is watching get updated.
+ grpc_security_status UpdateHandshakerFactoryLocked()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
+
+ Mutex mu_;
+ // We need a separate mutex for |pending_verifier_requests_|, otherwise there
+ // would be deadlock errors.
+ Mutex verifier_request_map_mu_;
+ RefCountedPtr<grpc_tls_credentials_options> options_;
+ grpc_tls_certificate_distributor::TlsCertificatesWatcherInterface*
+ certificate_watcher_ = nullptr;
+ tsi_ssl_server_handshaker_factory* server_handshaker_factory_
+ Y_ABSL_GUARDED_BY(mu_) = nullptr;
+ y_absl::optional<y_absl::string_view> pem_root_certs_ Y_ABSL_GUARDED_BY(mu_);
+ y_absl::optional<PemKeyCertPairList> pem_key_cert_pair_list_
+ Y_ABSL_GUARDED_BY(mu_);
+ std::map<grpc_closure* /*on_peer_checked*/, ServerPendingVerifierRequest*>
+ pending_verifier_requests_ Y_ABSL_GUARDED_BY(verifier_request_map_mu_);
+};
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/auth_filters.h b/contrib/libs/grpc/src/core/lib/security/transport/auth_filters.h
index ae31b1d578b..fc9e59cf5fe 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/auth_filters.h
+++ b/contrib/libs/grpc/src/core/lib/security/transport/auth_filters.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc_security.h>
+
#include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_client_auth_filter;
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc b/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
index b1a9d3f9386..e48f106f223 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/client_auth_filter.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/security/transport/auth_filters.h"
-
#include <string.h>
#include <util/generic/string.h>
@@ -37,6 +35,7 @@
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/security_connector/security_connector.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
+#include "src/core/lib/security/transport/auth_filters.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/surface/call.h"
@@ -146,7 +145,7 @@ void grpc_auth_metadata_context_reset(
}
}
-static void add_error(grpc_error** combined, grpc_error* error) {
+static void add_error(grpc_error_handle* combined, grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) return;
if (*combined == GRPC_ERROR_NONE) {
*combined = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
@@ -155,14 +154,14 @@ static void add_error(grpc_error** combined, grpc_error* error) {
*combined = grpc_error_add_child(*combined, error);
}
-static void on_credentials_metadata(void* arg, grpc_error* input_error) {
+static void on_credentials_metadata(void* arg, grpc_error_handle input_error) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
grpc_call_element* elem =
static_cast<grpc_call_element*>(batch->handler_private.extra_arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
grpc_auth_metadata_context_reset(&calld->auth_md_context);
- grpc_error* error = GRPC_ERROR_REF(input_error);
+ grpc_error_handle error = GRPC_ERROR_REF(input_error);
if (error == GRPC_ERROR_NONE) {
GPR_ASSERT(calld->md_array.size <= MAX_CREDENTIALS_METADATA_COUNT);
GPR_ASSERT(batch->send_initial_metadata);
@@ -225,13 +224,14 @@ void grpc_auth_metadata_context_build(
gpr_free(host_and_port);
}
-static void cancel_get_request_metadata(void* arg, grpc_error* error) {
+static void cancel_get_request_metadata(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
calld->creds->cancel_get_request_metadata(&calld->md_array,
GRPC_ERROR_REF(error));
}
+ GRPC_CALL_STACK_UNREF(calld->owning_call, "cancel_get_request_metadata");
}
static void send_security_metadata(grpc_call_element* elem,
@@ -311,7 +311,7 @@ static void send_security_metadata(grpc_call_element* elem,
GRPC_CALL_STACK_REF(calld->owning_call, "get_request_metadata");
GRPC_CLOSURE_INIT(&calld->async_result_closure, on_credentials_metadata,
batch, grpc_schedule_on_exec_ctx);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (calld->creds->get_request_metadata(
calld->pollent, calld->auth_md_context, &calld->md_array,
&calld->async_result_closure, &error)) {
@@ -320,13 +320,16 @@ static void send_security_metadata(grpc_call_element* elem,
GRPC_ERROR_UNREF(error);
} else {
// Async return; register cancellation closure with call combiner.
+ // TODO(yashykt): We would not need this ref if call combiners used
+ // Closure::Run() instead of ExecCtx::Run()
+ GRPC_CALL_STACK_REF(calld->owning_call, "cancel_get_request_metadata");
calld->call_combiner->SetNotifyOnCancel(GRPC_CLOSURE_INIT(
&calld->get_request_metadata_cancel_closure,
cancel_get_request_metadata, elem, grpc_schedule_on_exec_ctx));
}
}
-static void on_host_checked(void* arg, grpc_error* error) {
+static void on_host_checked(void* arg, grpc_error_handle error) {
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
grpc_call_element* elem =
@@ -335,20 +338,19 @@ static void on_host_checked(void* arg, grpc_error* error) {
if (error == GRPC_ERROR_NONE) {
send_security_metadata(elem, batch);
} else {
- TString error_msg = y_absl::StrCat(
- "Invalid host ", grpc_core::StringViewFromSlice(calld->host),
- " set in :authority metadata.");
grpc_transport_stream_op_batch_finish_with_failure(
batch,
grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(error_msg.c_str()),
+ GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Invalid host ", grpc_core::StringViewFromSlice(calld->host),
+ " set in :authority metadata.")),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAUTHENTICATED),
calld->call_combiner);
}
GRPC_CALL_STACK_UNREF(calld->owning_call, "check_call_host");
}
-static void cancel_check_call_host(void* arg, grpc_error* error) {
+static void cancel_check_call_host(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
@@ -356,6 +358,7 @@ static void cancel_check_call_host(void* arg, grpc_error* error) {
chand->security_connector->cancel_check_call_host(
&calld->async_result_closure, GRPC_ERROR_REF(error));
}
+ GRPC_CALL_STACK_UNREF(calld->owning_call, "cancel_check_call_host");
}
static void client_auth_start_transport_stream_op_batch(
@@ -369,19 +372,19 @@ static void client_auth_start_transport_stream_op_batch(
if (batch->send_initial_metadata) {
grpc_metadata_batch* metadata =
batch->payload->send_initial_metadata.send_initial_metadata;
- if (metadata->idx.named.path != nullptr) {
- calld->method =
- grpc_slice_ref_internal(GRPC_MDVALUE(metadata->idx.named.path->md));
+ if (metadata->legacy_index()->named.path != nullptr) {
+ calld->method = grpc_slice_ref_internal(
+ GRPC_MDVALUE(metadata->legacy_index()->named.path->md));
}
- if (metadata->idx.named.authority != nullptr) {
+ if (metadata->legacy_index()->named.authority != nullptr) {
calld->host = grpc_slice_ref_internal(
- GRPC_MDVALUE(metadata->idx.named.authority->md));
+ GRPC_MDVALUE(metadata->legacy_index()->named.authority->md));
batch->handler_private.extra_arg = elem;
GRPC_CALL_STACK_REF(calld->owning_call, "check_call_host");
GRPC_CLOSURE_INIT(&calld->async_result_closure, on_host_checked, batch,
grpc_schedule_on_exec_ctx);
y_absl::string_view call_host(grpc_core::StringViewFromSlice(calld->host));
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (chand->security_connector->check_call_host(
call_host, chand->auth_context.get(),
&calld->async_result_closure, &error)) {
@@ -390,6 +393,9 @@ static void client_auth_start_transport_stream_op_batch(
GRPC_ERROR_UNREF(error);
} else {
// Async return; register cancellation closure with call combiner.
+ // TODO(yashykt): We would not need this ref if call combiners used
+ // Closure::Run() instead of ExecCtx::Run()
+ GRPC_CALL_STACK_REF(calld->owning_call, "cancel_check_call_host");
calld->call_combiner->SetNotifyOnCancel(GRPC_CLOSURE_INIT(
&calld->check_call_host_cancel_closure, cancel_check_call_host,
elem, grpc_schedule_on_exec_ctx));
@@ -403,7 +409,7 @@ static void client_auth_start_transport_stream_op_batch(
}
/* Constructor for call_data */
-static grpc_error* client_auth_init_call_elem(
+static grpc_error_handle client_auth_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) call_data(elem, *args);
return GRPC_ERROR_NONE;
@@ -424,7 +430,7 @@ static void client_auth_destroy_call_elem(
}
/* Constructor for channel_data */
-static grpc_error* client_auth_init_channel_elem(
+static grpc_error_handle client_auth_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
/* The first and the last filters tend to be implemented differently to
handle the case that there's no 'next' filter to call on the up or down
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
index 69198e216ab..35b610dedb7 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.cc
@@ -16,26 +16,23 @@
*
*/
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
- using that endpoint. Because of various transitive includes in uv.h,
- including windows.h on Windows, uv.h must be included before other system
- headers. Therefore, sockaddr.h must always be included first */
#include <grpc/support/port_platform.h>
-#include <new>
+#include "src/core/lib/security/transport/secure_endpoint.h"
-#include "src/core/lib/iomgr/sockaddr.h"
+#include <new>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
+#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/security/transport/secure_endpoint.h"
#include "src/core/lib/security/transport/tsi_error.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
@@ -43,7 +40,7 @@
#define STAGING_BUFFER_SIZE 8192
-static void on_read(void* user_data, grpc_error* error);
+static void on_read(void* user_data, grpc_error_handle error);
namespace {
struct secure_endpoint {
@@ -154,7 +151,7 @@ static void flush_read_staging_buffer(secure_endpoint* ep, uint8_t** cur,
*end = GRPC_SLICE_END_PTR(ep->read_staging_buffer);
}
-static void call_read_cb(secure_endpoint* ep, grpc_error* error) {
+static void call_read_cb(secure_endpoint* ep, grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_secure_endpoint)) {
size_t i;
for (i = 0; i < ep->read_buffer->count; i++) {
@@ -169,7 +166,7 @@ static void call_read_cb(secure_endpoint* ep, grpc_error* error) {
SECURE_ENDPOINT_UNREF(ep, "read");
}
-static void on_read(void* user_data, grpc_error* error) {
+static void on_read(void* user_data, grpc_error_handle error) {
unsigned i;
uint8_t keep_looping = 0;
tsi_result result = TSI_OK;
@@ -373,7 +370,7 @@ static void endpoint_write(grpc_endpoint* secure_ep, grpc_slice_buffer* slices,
grpc_endpoint_write(ep->wrapped_ep, &ep->output_buffer, cb, arg);
}
-static void endpoint_shutdown(grpc_endpoint* secure_ep, grpc_error* why) {
+static void endpoint_shutdown(grpc_endpoint* secure_ep, grpc_error_handle why) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
grpc_endpoint_shutdown(ep->wrapped_ep, why);
}
@@ -416,12 +413,6 @@ static int endpoint_get_fd(grpc_endpoint* secure_ep) {
return grpc_endpoint_get_fd(ep->wrapped_ep);
}
-static grpc_resource_user* endpoint_get_resource_user(
- grpc_endpoint* secure_ep) {
- secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
- return grpc_endpoint_get_resource_user(ep->wrapped_ep);
-}
-
static bool endpoint_can_track_err(grpc_endpoint* secure_ep) {
secure_endpoint* ep = reinterpret_cast<secure_endpoint*>(secure_ep);
return grpc_endpoint_can_track_err(ep->wrapped_ep);
@@ -434,7 +425,6 @@ static const grpc_endpoint_vtable vtable = {endpoint_read,
endpoint_delete_from_pollset_set,
endpoint_shutdown,
endpoint_destroy,
- endpoint_get_resource_user,
endpoint_get_peer,
endpoint_get_local_address,
endpoint_get_fd,
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.h b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.h
index e7e33516789..b3b8e239327 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.h
+++ b/contrib/libs/grpc/src/core/lib/security/transport/secure_endpoint.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice.h>
+
#include "src/core/lib/iomgr/endpoint.h"
struct tsi_frame_protector;
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
index e6eee7c3e47..a3c846bbf12 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.cc
@@ -22,6 +22,7 @@
#include <stdbool.h>
#include <string.h>
+
#include <limits>
#include <grpc/slice_buffer.h>
@@ -31,7 +32,7 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/handshaker.h"
-#include "src/core/lib/channel/handshaker_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/transport/secure_endpoint.h"
@@ -51,35 +52,36 @@ class SecurityHandshaker : public Handshaker {
grpc_security_connector* connector,
const grpc_channel_args* args);
~SecurityHandshaker() override;
- void Shutdown(grpc_error* why) override;
+ void Shutdown(grpc_error_handle why) override;
void DoHandshake(grpc_tcp_server_acceptor* acceptor,
grpc_closure* on_handshake_done,
HandshakerArgs* args) override;
const char* name() const override { return "security"; }
private:
- grpc_error* DoHandshakerNextLocked(const unsigned char* bytes_received,
- size_t bytes_received_size);
+ grpc_error_handle DoHandshakerNextLocked(const unsigned char* bytes_received,
+ size_t bytes_received_size);
- grpc_error* OnHandshakeNextDoneLocked(
+ grpc_error_handle OnHandshakeNextDoneLocked(
tsi_result result, const unsigned char* bytes_to_send,
size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result);
- void HandshakeFailedLocked(grpc_error* error);
+ void HandshakeFailedLocked(grpc_error_handle error);
void CleanupArgsForFailureLocked();
- static void OnHandshakeDataReceivedFromPeerFn(void* arg, grpc_error* error);
- static void OnHandshakeDataSentToPeerFn(void* arg, grpc_error* error);
- static void OnHandshakeDataReceivedFromPeerFnScheduler(void* arg,
- grpc_error* error);
+ static void OnHandshakeDataReceivedFromPeerFn(void* arg,
+ grpc_error_handle error);
+ static void OnHandshakeDataSentToPeerFn(void* arg, grpc_error_handle error);
+ static void OnHandshakeDataReceivedFromPeerFnScheduler(
+ void* arg, grpc_error_handle error);
static void OnHandshakeDataSentToPeerFnScheduler(void* arg,
- grpc_error* error);
+ grpc_error_handle error);
static void OnHandshakeNextDoneGrpcWrapper(
tsi_result result, void* user_data, const unsigned char* bytes_to_send,
size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result);
- static void OnPeerCheckedFn(void* arg, grpc_error* error);
- void OnPeerCheckedInner(grpc_error* error);
+ static void OnPeerCheckedFn(void* arg, grpc_error_handle error);
+ void OnPeerCheckedInner(grpc_error_handle error);
size_t MoveReadBufferIntoHandshakeBuffer();
- grpc_error* CheckPeerLocked();
+ grpc_error_handle CheckPeerLocked();
// State set at creation time.
tsi_handshaker* handshaker_;
@@ -114,13 +116,10 @@ SecurityHandshaker::SecurityHandshaker(tsi_handshaker* handshaker,
connector_(connector->Ref(DEBUG_LOCATION, "handshake")),
handshake_buffer_size_(GRPC_INITIAL_HANDSHAKE_BUFFER_SIZE),
handshake_buffer_(
- static_cast<uint8_t*>(gpr_malloc(handshake_buffer_size_))) {
- const grpc_arg* arg =
- grpc_channel_args_find(args, GRPC_ARG_TSI_MAX_FRAME_SIZE);
- if (arg != nullptr && arg->type == GRPC_ARG_INTEGER) {
- max_frame_size_ = grpc_channel_arg_get_integer(
- arg, {0, 0, std::numeric_limits<int>::max()});
- }
+ static_cast<uint8_t*>(gpr_malloc(handshake_buffer_size_))),
+ max_frame_size_(grpc_channel_args_find_integer(
+ args, GRPC_ARG_TSI_MAX_FRAME_SIZE,
+ {0, 0, std::numeric_limits<int>::max()})) {
grpc_slice_buffer_init(&outgoing_);
GRPC_CLOSURE_INIT(&on_peer_checked_, &SecurityHandshaker::OnPeerCheckedFn,
this, grpc_schedule_on_exec_ctx);
@@ -173,15 +172,14 @@ void SecurityHandshaker::CleanupArgsForFailureLocked() {
// If the handshake failed or we're shutting down, clean up and invoke the
// callback with the error.
-void SecurityHandshaker::HandshakeFailedLocked(grpc_error* error) {
+void SecurityHandshaker::HandshakeFailedLocked(grpc_error_handle error) {
if (error == GRPC_ERROR_NONE) {
// If we were shut down after the handshake succeeded but before an
// endpoint callback was invoked, we need to generate our own error.
error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshaker shutdown");
}
- const char* msg = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "Security handshake failed: %s", msg);
-
+ gpr_log(GPR_DEBUG, "Security handshake failed: %s",
+ grpc_error_std_string(error).c_str());
if (!is_shutdown_) {
tsi_handshaker_shutdown(handshaker_);
// TODO(ctiller): It is currently necessary to shutdown endpoints
@@ -225,55 +223,89 @@ MakeChannelzSecurityFromAuthContext(grpc_auth_context* auth_context) {
} // namespace
-void SecurityHandshaker::OnPeerCheckedInner(grpc_error* error) {
+void SecurityHandshaker::OnPeerCheckedInner(grpc_error_handle error) {
MutexLock lock(&mu_);
if (error != GRPC_ERROR_NONE || is_shutdown_) {
HandshakeFailedLocked(error);
return;
}
- // Create zero-copy frame protector, if implemented.
- tsi_zero_copy_grpc_protector* zero_copy_protector = nullptr;
- tsi_result result = tsi_handshaker_result_create_zero_copy_grpc_protector(
- handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
- &zero_copy_protector);
- if (result != TSI_OK && result != TSI_UNIMPLEMENTED) {
- error = grpc_set_tsi_error_result(
+ // Get unused bytes.
+ const unsigned char* unused_bytes = nullptr;
+ size_t unused_bytes_size = 0;
+ tsi_result result = tsi_handshaker_result_get_unused_bytes(
+ handshaker_result_, &unused_bytes, &unused_bytes_size);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Zero-copy frame protector creation failed"),
- result);
- HandshakeFailedLocked(error);
+ "TSI handshaker result does not provide unused bytes"),
+ result));
+ return;
+ }
+ // Check whether we need to wrap the endpoint.
+ tsi_frame_protector_type frame_protector_type;
+ result = tsi_handshaker_result_get_frame_protector_type(
+ handshaker_result_, &frame_protector_type);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "TSI handshaker result does not implement "
+ "get_frame_protector_type"),
+ result));
return;
}
- // Create frame protector if zero-copy frame protector is NULL.
+ tsi_zero_copy_grpc_protector* zero_copy_protector = nullptr;
tsi_frame_protector* protector = nullptr;
- if (zero_copy_protector == nullptr) {
- result = tsi_handshaker_result_create_frame_protector(
- handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
- &protector);
- if (result != TSI_OK) {
- error = grpc_set_tsi_error_result(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Frame protector creation failed"),
- result);
- HandshakeFailedLocked(error);
- return;
- }
+ switch (frame_protector_type) {
+ case TSI_FRAME_PROTECTOR_ZERO_COPY:
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY:
+ // Create zero-copy frame protector.
+ result = tsi_handshaker_result_create_zero_copy_grpc_protector(
+ handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
+ &zero_copy_protector);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(grpc_set_tsi_error_result(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Zero-copy frame protector creation failed"),
+ result));
+ return;
+ }
+ break;
+ case TSI_FRAME_PROTECTOR_NORMAL:
+ // Create normal frame protector.
+ result = tsi_handshaker_result_create_frame_protector(
+ handshaker_result_, max_frame_size_ == 0 ? nullptr : &max_frame_size_,
+ &protector);
+ if (result != TSI_OK) {
+ HandshakeFailedLocked(
+ grpc_set_tsi_error_result(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Frame protector creation failed"),
+ result));
+ return;
+ }
+ break;
+ case TSI_FRAME_PROTECTOR_NONE:
+ break;
}
- // Get unused bytes.
- const unsigned char* unused_bytes = nullptr;
- size_t unused_bytes_size = 0;
- result = tsi_handshaker_result_get_unused_bytes(
- handshaker_result_, &unused_bytes, &unused_bytes_size);
- // Create secure endpoint.
- if (unused_bytes_size > 0) {
+ // If we have a frame protector, create a secure endpoint.
+ if (zero_copy_protector != nullptr || protector != nullptr) {
+ if (unused_bytes_size > 0) {
+ grpc_slice slice = grpc_slice_from_copied_buffer(
+ reinterpret_cast<const char*>(unused_bytes), unused_bytes_size);
+ args_->endpoint = grpc_secure_endpoint_create(
+ protector, zero_copy_protector, args_->endpoint, &slice, 1);
+ grpc_slice_unref_internal(slice);
+ } else {
+ args_->endpoint = grpc_secure_endpoint_create(
+ protector, zero_copy_protector, args_->endpoint, nullptr, 0);
+ }
+ } else if (unused_bytes_size > 0) {
+ // Not wrapping the endpoint, so just pass along unused bytes.
grpc_slice slice = grpc_slice_from_copied_buffer(
reinterpret_cast<const char*>(unused_bytes), unused_bytes_size);
- args_->endpoint = grpc_secure_endpoint_create(
- protector, zero_copy_protector, args_->endpoint, &slice, 1);
- grpc_slice_unref_internal(slice);
- } else {
- args_->endpoint = grpc_secure_endpoint_create(
- protector, zero_copy_protector, args_->endpoint, nullptr, 0);
+ grpc_slice_buffer_add(args_->read_buffer, slice);
}
+ // Done with handshaker result.
tsi_handshaker_result_destroy(handshaker_result_);
handshaker_result_ = nullptr;
// Add auth context to channel args.
@@ -292,12 +324,12 @@ void SecurityHandshaker::OnPeerCheckedInner(grpc_error* error) {
is_shutdown_ = true;
}
-void SecurityHandshaker::OnPeerCheckedFn(void* arg, grpc_error* error) {
+void SecurityHandshaker::OnPeerCheckedFn(void* arg, grpc_error_handle error) {
RefCountedPtr<SecurityHandshaker>(static_cast<SecurityHandshaker*>(arg))
->OnPeerCheckedInner(GRPC_ERROR_REF(error));
}
-grpc_error* SecurityHandshaker::CheckPeerLocked() {
+grpc_error_handle SecurityHandshaker::CheckPeerLocked() {
tsi_peer peer;
tsi_result result =
tsi_handshaker_result_extract_peer(handshaker_result_, &peer);
@@ -310,10 +342,10 @@ grpc_error* SecurityHandshaker::CheckPeerLocked() {
return GRPC_ERROR_NONE;
}
-grpc_error* SecurityHandshaker::OnHandshakeNextDoneLocked(
+grpc_error_handle SecurityHandshaker::OnHandshakeNextDoneLocked(
tsi_result result, const unsigned char* bytes_to_send,
size_t bytes_to_send_size, tsi_handshaker_result* handshaker_result) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
// Handshaker was shutdown.
if (is_shutdown_) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Handshaker shutdown");
@@ -374,7 +406,7 @@ void SecurityHandshaker::OnHandshakeNextDoneGrpcWrapper(
RefCountedPtr<SecurityHandshaker> h(
static_cast<SecurityHandshaker*>(user_data));
MutexLock lock(&h->mu_);
- grpc_error* error = h->OnHandshakeNextDoneLocked(
+ grpc_error_handle error = h->OnHandshakeNextDoneLocked(
result, bytes_to_send, bytes_to_send_size, handshaker_result);
if (error != GRPC_ERROR_NONE) {
h->HandshakeFailedLocked(error);
@@ -383,7 +415,7 @@ void SecurityHandshaker::OnHandshakeNextDoneGrpcWrapper(
}
}
-grpc_error* SecurityHandshaker::DoHandshakerNextLocked(
+grpc_error_handle SecurityHandshaker::DoHandshakerNextLocked(
const unsigned char* bytes_received, size_t bytes_received_size) {
// Invoke TSI handshaker.
const unsigned char* bytes_to_send = nullptr;
@@ -406,9 +438,9 @@ grpc_error* SecurityHandshaker::DoHandshakerNextLocked(
// This callback might be run inline while we are still holding on to the mutex,
// so schedule OnHandshakeDataReceivedFromPeerFn on ExecCtx to avoid a deadlock.
void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
+ ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_received_from_peer_,
&SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn,
@@ -416,8 +448,8 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFnScheduler(
GRPC_ERROR_REF(error));
}
-void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(void* arg,
- grpc_error* error) {
+void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(
+ void* arg, grpc_error_handle error) {
RefCountedPtr<SecurityHandshaker> h(static_cast<SecurityHandshaker*>(arg));
MutexLock lock(&h->mu_);
if (error != GRPC_ERROR_NONE || h->is_shutdown_) {
@@ -429,7 +461,6 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(void* arg,
size_t bytes_received_size = h->MoveReadBufferIntoHandshakeBuffer();
// Call TSI handshaker.
error = h->DoHandshakerNextLocked(h->handshake_buffer_, bytes_received_size);
-
if (error != GRPC_ERROR_NONE) {
h->HandshakeFailedLocked(error);
} else {
@@ -440,9 +471,9 @@ void SecurityHandshaker::OnHandshakeDataReceivedFromPeerFn(void* arg,
// This callback might be run inline while we are still holding on to the mutex,
// so schedule OnHandshakeDataSentToPeerFn on ExecCtx to avoid a deadlock.
void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler(
- void* arg, grpc_error* error) {
+ void* arg, grpc_error_handle error) {
SecurityHandshaker* h = static_cast<SecurityHandshaker*>(arg);
- grpc_core::ExecCtx::Run(
+ ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&h->on_handshake_data_sent_to_peer_,
&SecurityHandshaker::OnHandshakeDataSentToPeerFn, h,
@@ -451,7 +482,7 @@ void SecurityHandshaker::OnHandshakeDataSentToPeerFnScheduler(
}
void SecurityHandshaker::OnHandshakeDataSentToPeerFn(void* arg,
- grpc_error* error) {
+ grpc_error_handle error) {
RefCountedPtr<SecurityHandshaker> h(static_cast<SecurityHandshaker*>(arg));
MutexLock lock(&h->mu_);
if (error != GRPC_ERROR_NONE || h->is_shutdown_) {
@@ -482,10 +513,11 @@ void SecurityHandshaker::OnHandshakeDataSentToPeerFn(void* arg,
// public handshaker API
//
-void SecurityHandshaker::Shutdown(grpc_error* why) {
+void SecurityHandshaker::Shutdown(grpc_error_handle why) {
MutexLock lock(&mu_);
if (!is_shutdown_) {
is_shutdown_ = true;
+ connector_->cancel_check_peer(&on_peer_checked_, GRPC_ERROR_REF(why));
tsi_handshaker_shutdown(handshaker_);
grpc_endpoint_shutdown(args_->endpoint, GRPC_ERROR_REF(why));
CleanupArgsForFailureLocked();
@@ -501,7 +533,7 @@ void SecurityHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
args_ = args;
on_handshake_done_ = on_handshake_done;
size_t bytes_received_size = MoveReadBufferIntoHandshakeBuffer();
- grpc_error* error =
+ grpc_error_handle error =
DoHandshakerNextLocked(handshake_buffer_, bytes_received_size);
if (error != GRPC_ERROR_NONE) {
HandshakeFailedLocked(error);
@@ -517,13 +549,21 @@ void SecurityHandshaker::DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
class FailHandshaker : public Handshaker {
public:
const char* name() const override { return "security_fail"; }
- void Shutdown(grpc_error* why) override { GRPC_ERROR_UNREF(why); }
+ void Shutdown(grpc_error_handle why) override { GRPC_ERROR_UNREF(why); }
void DoHandshake(grpc_tcp_server_acceptor* /*acceptor*/,
grpc_closure* on_handshake_done,
- HandshakerArgs* /*args*/) override {
- ExecCtx::Run(DEBUG_LOCATION, on_handshake_done,
- GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "Failed to create security handshaker"));
+ HandshakerArgs* args) override {
+ grpc_error_handle error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
+ "Failed to create security handshaker");
+ grpc_endpoint_shutdown(args->endpoint, GRPC_ERROR_REF(error));
+ grpc_endpoint_destroy(args->endpoint);
+ args->endpoint = nullptr;
+ grpc_channel_args_destroy(args->args);
+ args->args = nullptr;
+ grpc_slice_buffer_destroy_internal(args->read_buffer);
+ gpr_free(args->read_buffer);
+ args->read_buffer = nullptr;
+ ExecCtx::Run(DEBUG_LOCATION, on_handshake_done, error);
}
private:
@@ -584,11 +624,11 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
}
}
-void SecurityRegisterHandshakerFactories() {
- HandshakerRegistry::RegisterHandshakerFactory(
+void SecurityRegisterHandshakerFactories(CoreConfiguration::Builder* builder) {
+ builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_CLIENT,
y_absl::make_unique<ClientSecurityHandshakerFactory>());
- HandshakerRegistry::RegisterHandshakerFactory(
+ builder->handshaker_registry()->RegisterHandshakerFactory(
false /* at_start */, HANDSHAKER_SERVER,
y_absl::make_unique<ServerSecurityHandshakerFactory>());
}
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.h b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.h
index a9e1fe83d45..8f4ab8b2eb4 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.h
+++ b/contrib/libs/grpc/src/core/lib/security/transport/security_handshaker.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include "src/core/lib/channel/handshaker.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/security/security_connector/security_connector.h"
namespace grpc_core {
@@ -32,7 +33,7 @@ RefCountedPtr<Handshaker> SecurityHandshakerCreate(
const grpc_channel_args* args);
/// Registers security handshaker factories.
-void SecurityRegisterHandshakerFactories();
+void SecurityRegisterHandshakerFactories(CoreConfiguration::Builder*);
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/server_auth_filter.cc b/contrib/libs/grpc/src/core/lib/security/transport/server_auth_filter.cc
index 925a70a24c7..feae3f7d13b 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/server_auth_filter.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/server_auth_filter.cc
@@ -28,8 +28,9 @@
#include "src/core/lib/security/transport/auth_filters.h"
#include "src/core/lib/slice/slice_internal.h"
-static void recv_initial_metadata_ready(void* arg, grpc_error* error);
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* error);
+static void recv_initial_metadata_ready(void* arg, grpc_error_handle error);
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle error);
namespace {
enum async_state {
@@ -79,10 +80,10 @@ struct call_data {
grpc_transport_stream_op_batch* recv_initial_metadata_batch;
grpc_closure* original_recv_initial_metadata_ready;
grpc_closure recv_initial_metadata_ready;
- grpc_error* recv_initial_metadata_error = GRPC_ERROR_NONE;
+ grpc_error_handle recv_initial_metadata_error = GRPC_ERROR_NONE;
grpc_closure recv_trailing_metadata_ready;
grpc_closure* original_recv_trailing_metadata_ready;
- grpc_error* recv_trailing_metadata_error;
+ grpc_error_handle recv_trailing_metadata_error;
bool seen_recv_trailing_metadata_ready = false;
grpc_metadata_array md;
const grpc_metadata* consumed_md;
@@ -95,23 +96,21 @@ struct call_data {
static grpc_metadata_array metadata_batch_to_md_array(
const grpc_metadata_batch* batch) {
- grpc_linked_mdelem* l;
grpc_metadata_array result;
grpc_metadata_array_init(&result);
- for (l = batch->list.head; l != nullptr; l = l->next) {
+ batch->ForEach([&](grpc_mdelem md) {
grpc_metadata* usr_md = nullptr;
- grpc_mdelem md = l->md;
grpc_slice key = GRPC_MDKEY(md);
grpc_slice value = GRPC_MDVALUE(md);
if (result.count == result.capacity) {
- result.capacity = GPR_MAX(result.capacity + 8, result.capacity * 2);
+ result.capacity = std::max(result.capacity + 8, result.capacity * 2);
result.metadata = static_cast<grpc_metadata*>(gpr_realloc(
result.metadata, result.capacity * sizeof(grpc_metadata)));
}
usr_md = &result.metadata[result.count++];
usr_md->key = grpc_slice_ref_internal(key);
usr_md->value = grpc_slice_ref_internal(value);
- }
+ });
return result;
}
@@ -135,7 +134,7 @@ static void on_md_processing_done_inner(grpc_call_element* elem,
size_t num_consumed_md,
const grpc_metadata* response_md,
size_t num_response_md,
- grpc_error* error) {
+ grpc_error_handle error) {
call_data* calld = static_cast<call_data*>(elem->call_data);
grpc_transport_stream_op_batch* batch = calld->recv_initial_metadata_batch;
/* TODO(jboeuf): Implement support for response_md. */
@@ -175,7 +174,7 @@ static void on_md_processing_done(
// If the call was not cancelled while we were in flight, process the result.
if (gpr_atm_full_cas(&calld->state, static_cast<gpr_atm>(STATE_INIT),
static_cast<gpr_atm>(STATE_DONE))) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (status != GRPC_STATUS_OK) {
if (error_details == nullptr) {
error_details = "Authentication metadata processing failed.";
@@ -196,7 +195,7 @@ static void on_md_processing_done(
GRPC_CALL_STACK_UNREF(calld->owning_call, "server_auth_metadata");
}
-static void cancel_call(void* arg, grpc_error* error) {
+static void cancel_call(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
call_data* calld = static_cast<call_data*>(elem->call_data);
// If the result was not already processed, invoke the callback now.
@@ -206,9 +205,10 @@ static void cancel_call(void* arg, grpc_error* error) {
on_md_processing_done_inner(elem, nullptr, 0, nullptr, 0,
GRPC_ERROR_REF(error));
}
+ GRPC_CALL_STACK_UNREF(calld->owning_call, "cancel_call");
}
-static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
+static void recv_initial_metadata_ready(void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
@@ -218,6 +218,9 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
chand->creds->auth_metadata_processor().process != nullptr) {
// We're calling out to the application, so we need to make sure
// to drop the call combiner early if we get cancelled.
+ // TODO(yashykt): We would not need this ref if call combiners used
+ // Closure::Run() instead of ExecCtx::Run()
+ GRPC_CALL_STACK_REF(calld->owning_call, "cancel_call");
GRPC_CLOSURE_INIT(&calld->cancel_closure, cancel_call, elem,
grpc_schedule_on_exec_ctx);
calld->call_combiner->SetNotifyOnCancel(&calld->cancel_closure);
@@ -242,7 +245,8 @@ static void recv_initial_metadata_ready(void* arg, grpc_error* error) {
grpc_core::Closure::Run(DEBUG_LOCATION, closure, GRPC_ERROR_REF(error));
}
-static void recv_trailing_metadata_ready(void* user_data, grpc_error* err) {
+static void recv_trailing_metadata_ready(void* user_data,
+ grpc_error_handle err) {
grpc_call_element* elem = static_cast<grpc_call_element*>(user_data);
call_data* calld = static_cast<call_data*>(elem->call_data);
if (calld->original_recv_initial_metadata_ready != nullptr) {
@@ -280,7 +284,7 @@ static void server_auth_start_transport_stream_op_batch(
}
/* Constructor for call_data */
-static grpc_error* server_auth_init_call_elem(
+static grpc_error_handle server_auth_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) call_data(elem, *args);
return GRPC_ERROR_NONE;
@@ -295,18 +299,11 @@ static void server_auth_destroy_call_elem(
}
/* Constructor for channel_data */
-static grpc_error* server_auth_init_channel_elem(
+static grpc_error_handle server_auth_init_channel_elem(
grpc_channel_element* elem, grpc_channel_element_args* args) {
GPR_ASSERT(!args->is_last);
grpc_auth_context* auth_context =
grpc_find_auth_context_in_args(args->channel_args);
- if (auth_context == nullptr) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
- "No authorization context found. This might be a TRANSIENT failure due "
- "to certificates not having been loaded yet.");
- gpr_log(GPR_DEBUG, "%s", grpc_error_string(error));
- return error;
- }
GPR_ASSERT(auth_context != nullptr);
grpc_server_credentials* creds =
grpc_find_server_credentials_in_args(args->channel_args);
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.cc b/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.cc
index f78bb8df38f..23b1081128c 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.cc
+++ b/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.cc
@@ -20,10 +20,9 @@
#include "src/core/lib/security/transport/tsi_error.h"
-grpc_error* grpc_set_tsi_error_result(grpc_error* error, tsi_result result) {
- return grpc_error_set_int(
- grpc_error_set_str(
- error, GRPC_ERROR_STR_TSI_ERROR,
- grpc_slice_from_static_string(tsi_result_to_string(result))),
- GRPC_ERROR_INT_TSI_CODE, result);
+grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error,
+ tsi_result result) {
+ return grpc_error_set_int(grpc_error_set_str(error, GRPC_ERROR_STR_TSI_ERROR,
+ tsi_result_to_string(result)),
+ GRPC_ERROR_INT_TSI_CODE, result);
}
diff --git a/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.h b/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.h
index 16e04f70f1e..26b8806dd21 100644
--- a/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.h
+++ b/contrib/libs/grpc/src/core/lib/security/transport/tsi_error.h
@@ -24,6 +24,7 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/tsi/transport_security_interface.h"
-grpc_error* grpc_set_tsi_error_result(grpc_error* error, tsi_result result);
+grpc_error_handle grpc_set_tsi_error_result(grpc_error_handle error,
+ tsi_result result);
#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_TSI_ERROR_H */
diff --git a/contrib/libs/grpc/src/core/lib/security/util/json_util.cc b/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
index 70ed064841a..564b5745de9 100644
--- a/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
+++ b/contrib/libs/grpc/src/core/lib/security/util/json_util.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/security/util/json_util.h"
+
#include <string.h>
#include "y_absl/strings/str_cat.h"
@@ -26,11 +28,10 @@
#include <grpc/support/string_util.h>
#include "src/core/lib/iomgr/error.h"
-#include "src/core/lib/security/util/json_util.h"
const char* grpc_json_get_string_property(const grpc_core::Json& json,
const char* prop_name,
- grpc_error** error) {
+ grpc_error_handle* error) {
if (json.type() != grpc_core::Json::Type::OBJECT) {
if (error != nullptr) {
*error =
@@ -41,18 +42,15 @@ const char* grpc_json_get_string_property(const grpc_core::Json& json,
auto it = json.object_value().find(prop_name);
if (it == json.object_value().end()) {
if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Property ", prop_name, " not found in JSON object.")
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(
+ y_absl::StrCat("Property ", prop_name, " not found in JSON object."));
}
return nullptr;
}
if (it->second.type() != grpc_core::Json::Type::STRING) {
if (error != nullptr) {
- *error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Property ", prop_name,
- " n JSON object is not a string.")
- .c_str());
+ *error = GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Property ", prop_name, " n JSON object is not a string."));
}
return nullptr;
}
@@ -62,7 +60,7 @@ const char* grpc_json_get_string_property(const grpc_core::Json& json,
bool grpc_copy_json_string_property(const grpc_core::Json& json,
const char* prop_name,
char** copied_value) {
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
const char* prop_value =
grpc_json_get_string_property(json, prop_name, &error);
GRPC_LOG_IF_ERROR("Could not copy JSON property", error);
diff --git a/contrib/libs/grpc/src/core/lib/security/util/json_util.h b/contrib/libs/grpc/src/core/lib/security/util/json_util.h
index cde9ca97ffd..d3c6ec31277 100644
--- a/contrib/libs/grpc/src/core/lib/security/util/json_util.h
+++ b/contrib/libs/grpc/src/core/lib/security/util/json_util.h
@@ -35,7 +35,7 @@
// Gets a child property from a json node.
const char* grpc_json_get_string_property(const grpc_core::Json& json,
const char* prop_name,
- grpc_error** error);
+ grpc_error_handle* error);
// Copies the value of the json child property specified by prop_name.
// Returns false if the property was not found.
diff --git a/contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc b/contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc
index 79a4805bc91..98e17bc5027 100644
--- a/contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/percent_encoding.cc
@@ -20,150 +20,137 @@
#include "src/core/lib/slice/percent_encoding.h"
+#include <cstdint>
+
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/slice/slice_internal.h"
-const uint8_t grpc_url_percent_encoding_unreserved_bytes[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0xfe, 0xff, 0xff,
- 0x87, 0xfe, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-const uint8_t grpc_compatible_percent_encoding_unreserved_bytes[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-static bool is_unreserved_character(uint8_t c,
- const uint8_t* unreserved_bytes) {
- return ((unreserved_bytes[c / 8] >> (c % 8)) & 1) != 0;
+#if __cplusplus > 201103l
+#define GRPC_PCTENCODE_CONSTEXPR_FN constexpr
+#define GRPC_PCTENCODE_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_PCTENCODE_CONSTEXPR_FN
+#define GRPC_PCTENCODE_CONSTEXPR_VALUE const
+#endif
+
+namespace grpc_core {
+
+namespace {
+class UrlTable : public BitSet<256> {
+ public:
+ GRPC_PCTENCODE_CONSTEXPR_FN UrlTable() {
+ for (int i = 'a'; i <= 'z'; i++) set(i);
+ for (int i = 'A'; i <= 'Z'; i++) set(i);
+ for (int i = '0'; i <= '9'; i++) set(i);
+ set('-');
+ set('_');
+ set('.');
+ set('~');
+ }
+};
+
+GRPC_PCTENCODE_CONSTEXPR_VALUE UrlTable g_url_table;
+
+class CompatibleTable : public BitSet<256> {
+ public:
+ GRPC_PCTENCODE_CONSTEXPR_FN CompatibleTable() {
+ for (int i = 32; i <= 126; i++) {
+ if (i == '%') continue;
+ set(i);
+ }
+ }
+};
+
+GRPC_PCTENCODE_CONSTEXPR_VALUE CompatibleTable g_compatible_table;
+
+// Map PercentEncodingType to a lookup table of legal symbols for that encoding.
+const BitSet<256>& LookupTableForPercentEncodingType(PercentEncodingType type) {
+ switch (type) {
+ case PercentEncodingType::URL:
+ return g_url_table;
+ case PercentEncodingType::Compatible:
+ return g_compatible_table;
+ }
+ // Crash if a bad PercentEncodingType was passed in.
+ GPR_UNREACHABLE_CODE(abort());
}
+} // namespace
-grpc_slice grpc_percent_encode_slice(const grpc_slice& slice,
- const uint8_t* unreserved_bytes) {
+Slice PercentEncodeSlice(Slice slice, PercentEncodingType type) {
static const uint8_t hex[] = "0123456789ABCDEF";
+ const BitSet<256>& lut = LookupTableForPercentEncodingType(type);
+
// first pass: count the number of bytes needed to output this string
size_t output_length = 0;
- const uint8_t* slice_start = GRPC_SLICE_START_PTR(slice);
- const uint8_t* slice_end = GRPC_SLICE_END_PTR(slice);
- const uint8_t* p;
bool any_reserved_bytes = false;
- for (p = slice_start; p < slice_end; p++) {
- bool unres = is_unreserved_character(*p, unreserved_bytes);
+ for (uint8_t c : slice) {
+ bool unres = lut.is_set(c);
output_length += unres ? 1 : 3;
any_reserved_bytes |= !unres;
}
// no unreserved bytes: return the string unmodified
if (!any_reserved_bytes) {
- return grpc_slice_ref_internal(slice);
+ return slice;
}
// second pass: actually encode
- grpc_slice out = GRPC_SLICE_MALLOC(output_length);
- uint8_t* q = GRPC_SLICE_START_PTR(out);
- for (p = slice_start; p < slice_end; p++) {
- if (is_unreserved_character(*p, unreserved_bytes)) {
- *q++ = *p;
+ auto out = MutableSlice::CreateUninitialized(output_length);
+ uint8_t* q = out.begin();
+ for (uint8_t c : slice) {
+ if (lut.is_set(c)) {
+ *q++ = c;
} else {
*q++ = '%';
- *q++ = hex[*p >> 4];
- *q++ = hex[*p & 15];
+ *q++ = hex[c >> 4];
+ *q++ = hex[c & 15];
}
}
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
- return out;
+ GPR_ASSERT(q == out.end());
+ return Slice(std::move(out));
}
-static bool valid_hex(const uint8_t* p, const uint8_t* end) {
+static bool ValidHex(const uint8_t* p, const uint8_t* end) {
if (p >= end) return false;
return (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') ||
(*p >= 'A' && *p <= 'F');
}
-static uint8_t dehex(uint8_t c) {
+static uint8_t DeHex(uint8_t c) {
if (c >= '0' && c <= '9') return static_cast<uint8_t>(c - '0');
if (c >= 'A' && c <= 'F') return static_cast<uint8_t>(c - 'A' + 10);
if (c >= 'a' && c <= 'f') return static_cast<uint8_t>(c - 'a' + 10);
GPR_UNREACHABLE_CODE(return 255);
}
-bool grpc_strict_percent_decode_slice(const grpc_slice& slice_in,
- const uint8_t* unreserved_bytes,
- grpc_slice* slice_out) {
- const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
- const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
- size_t out_length = 0;
+Slice PermissivePercentDecodeSlice(Slice slice_in) {
bool any_percent_encoded_stuff = false;
- while (p != in_end) {
- if (*p == '%') {
- if (!valid_hex(++p, in_end)) return false;
- if (!valid_hex(++p, in_end)) return false;
- p++;
- out_length++;
+ for (uint8_t c : slice_in) {
+ if (c == '%') {
any_percent_encoded_stuff = true;
- } else if (is_unreserved_character(*p, unreserved_bytes)) {
- p++;
- out_length++;
- } else {
- return false;
+ break;
}
}
- if (!any_percent_encoded_stuff) {
- *slice_out = grpc_slice_ref_internal(slice_in);
- return true;
- }
- p = GRPC_SLICE_START_PTR(slice_in);
- *slice_out = GRPC_SLICE_MALLOC(out_length);
- uint8_t* q = GRPC_SLICE_START_PTR(*slice_out);
- while (p != in_end) {
- if (*p == '%') {
- *q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
- p += 3;
- } else {
- *q++ = *p++;
- }
- }
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(*slice_out));
- return true;
-}
+ if (!any_percent_encoded_stuff) return slice_in;
-grpc_slice grpc_permissive_percent_decode_slice(const grpc_slice& slice_in) {
- const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
- const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
- size_t out_length = 0;
- bool any_percent_encoded_stuff = false;
- while (p != in_end) {
+ MutableSlice out = slice_in.TakeMutable();
+ uint8_t* q = out.begin();
+ const uint8_t* p = out.begin();
+ const uint8_t* end = out.end();
+ while (p != end) {
if (*p == '%') {
- if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
- p++;
- out_length++;
- } else {
- p += 3;
- out_length++;
- any_percent_encoded_stuff = true;
- }
- } else {
- p++;
- out_length++;
- }
- }
- if (!any_percent_encoded_stuff) {
- return grpc_slice_ref_internal(slice_in);
- }
- p = GRPC_SLICE_START_PTR(slice_in);
- grpc_slice out = GRPC_SLICE_MALLOC(out_length);
- uint8_t* q = GRPC_SLICE_START_PTR(out);
- while (p != in_end) {
- if (*p == '%') {
- if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
+ if (!ValidHex(p + 1, end) || !ValidHex(p + 2, end)) {
*q++ = *p++;
} else {
- *q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
+ *q++ = static_cast<uint8_t>(DeHex(p[1]) << 4) | (DeHex(p[2]));
p += 3;
}
} else {
*q++ = *p++;
}
}
- GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
- return out;
+ return Slice(out.TakeSubSlice(0, q - out.begin()));
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/slice/percent_encoding.h b/contrib/libs/grpc/src/core/lib/slice/percent_encoding.h
index 43b20f090f0..071bbecb0ec 100644
--- a/contrib/libs/grpc/src/core/lib/slice/percent_encoding.h
+++ b/contrib/libs/grpc/src/core/lib/slice/percent_encoding.h
@@ -30,36 +30,31 @@
#include <stdbool.h>
+#include "y_absl/types/optional.h"
+
#include <grpc/slice.h>
-/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
- grpc_percent_encode_slice, grpc_strict_percent_decode_slice).
- Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
- */
-extern const uint8_t grpc_url_percent_encoding_unreserved_bytes[256 / 8];
-/* URL percent encoding spec bitfield (usabel as 'unreserved_bytes' in
- grpc_percent_encode_slice, grpc_strict_percent_decode_slice).
- Flags ascii7 non-control characters excluding '%' as unreserved bytes for the
- percent encoding routines */
-extern const uint8_t grpc_compatible_percent_encoding_unreserved_bytes[256 / 8];
+#include "src/core/lib/slice/slice.h"
+
+namespace grpc_core {
+
+enum class PercentEncodingType {
+ // Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
+ URL,
+ // Flags ascii7 non-control characters excluding '%' as unreserved bytes for
+ // the percent encoding routines
+ Compatible
+};
+
+// Percent-encode a slice, returning the new slice (this cannot fail):
+// unreserved_bytes is a bitfield indicating which bytes are considered
+// unreserved and thus do not need percent encoding
+Slice PercentEncodeSlice(Slice slice, PercentEncodingType type);
+// Percent-decode a slice, permissively.
+// If a % triplet can not be decoded, pass it through verbatim.
+// This cannot fail.
+Slice PermissivePercentDecodeSlice(Slice slice_in);
-/* Percent-encode a slice, returning the new slice (this cannot fail):
- unreserved_bytes is a bitfield indicating which bytes are considered
- unreserved and thus do not need percent encoding */
-grpc_slice grpc_percent_encode_slice(const grpc_slice& slice,
- const uint8_t* unreserved_bytes);
-/* Percent-decode a slice, strictly.
- If the input is legal (contains no unreserved bytes, and legal % encodings),
- returns true and sets *slice_out to the decoded slice.
- If the input is not legal, returns false and leaves *slice_out untouched.
- unreserved_bytes is a bitfield indicating which bytes are considered
- unreserved and thus do not need percent encoding */
-bool grpc_strict_percent_decode_slice(const grpc_slice& slice_in,
- const uint8_t* unreserved_bytes,
- grpc_slice* slice_out);
-/* Percent-decode a slice, permissively.
- If a % triplet can not be decoded, pass it through verbatim.
- This cannot fail. */
-grpc_slice grpc_permissive_percent_decode_slice(const grpc_slice& slice_in);
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SLICE_PERCENT_ENCODING_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice.cc b/contrib/libs/grpc/src/core/lib/slice/slice.cc
index da1c43e8bea..f22a41af834 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/slice.cc
@@ -18,17 +18,15 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/slice/slice_internal.h"
+#include <string.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
-
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
-#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
char* grpc_slice_to_c_string(grpc_slice slice) {
char* out = static_cast<char*>(gpr_malloc(GRPC_SLICE_LENGTH(slice) + 1));
@@ -46,21 +44,6 @@ grpc_slice grpc_slice_copy(grpc_slice s) {
return out;
}
-/* Public API */
-grpc_slice grpc_slice_ref(grpc_slice slice) {
- return grpc_slice_ref_internal(slice);
-}
-
-/* Public API */
-void grpc_slice_unref(grpc_slice slice) {
- if (grpc_core::ExecCtx::Get() == nullptr) {
- grpc_core::ExecCtx exec_ctx;
- grpc_slice_unref_internal(slice);
- } else {
- grpc_slice_unref_internal(slice);
- }
-}
-
namespace grpc_core {
/* grpc_slice_from_static_string support structure - a refcount that does
@@ -86,7 +69,7 @@ class NewSliceRefcount {
private:
grpc_slice_refcount base_;
- RefCount refs_;
+ std::atomic<size_t> refs_{1};
void (*user_destroy_)(void*);
void* user_data_;
};
@@ -147,7 +130,7 @@ class NewWithLenSliceRefcount {
private:
grpc_slice_refcount base_;
- RefCount refs_;
+ std::atomic<size_t> refs_{1};
void* user_data_;
size_t user_length_;
void (*user_destroy_)(void*, size_t);
@@ -156,7 +139,7 @@ class NewWithLenSliceRefcount {
/** grpc_slice_from_moved_(string|buffer) ref count .*/
class MovedStringSliceRefCount {
public:
- explicit MovedStringSliceRefCount(grpc_core::UniquePtr<char>&& str)
+ explicit MovedStringSliceRefCount(UniquePtr<char>&& str)
: base_(grpc_slice_refcount::Type::REGULAR, &refs_, Destroy, this,
&base_),
str_(std::move(str)) {}
@@ -169,8 +152,8 @@ class MovedStringSliceRefCount {
}
grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
- grpc_core::UniquePtr<char> str_;
+ std::atomic<size_t> refs_{1};
+ UniquePtr<char> str_;
};
// grpc_slice_from_cpp_string() ref count.
@@ -189,7 +172,7 @@ class MovedCppStringSliceRefCount {
}
grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
+ std::atomic<size_t> refs_{1};
TString str_;
};
@@ -223,11 +206,21 @@ grpc_core::UnmanagedMemorySlice::UnmanagedMemorySlice(const char* source)
strlen(source)) {}
grpc_slice grpc_slice_from_copied_buffer(const char* source, size_t length) {
- return grpc_core::UnmanagedMemorySlice(source, length);
+ grpc_slice slice;
+ if (length <= sizeof(slice.data.inlined.bytes)) {
+ slice.refcount = nullptr;
+ slice.data.inlined.length = length;
+ } else {
+ // Create a ref-counted slice.
+ slice = grpc_core::UnmanagedMemorySlice(
+ length, grpc_core::UnmanagedMemorySlice::ForceHeapAllocation());
+ }
+ memcpy(GRPC_SLICE_START_PTR(slice), source, length);
+ return slice;
}
grpc_slice grpc_slice_from_copied_string(const char* source) {
- return grpc_core::UnmanagedMemorySlice(source, strlen(source));
+ return grpc_slice_from_copied_buffer(source, strlen(source));
}
grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p,
@@ -288,7 +281,7 @@ class MallocRefCount {
private:
grpc_slice_refcount base_;
- grpc_core::RefCount refs_;
+ std::atomic<size_t> refs_{1};
};
} // namespace
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice.h b/contrib/libs/grpc/src/core/lib/slice/slice.h
new file mode 100644
index 00000000000..83bb7254405
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice.h
@@ -0,0 +1,341 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SLICE_SLICE_H
+#define GRPC_CORE_LIB_SLICE_SLICE_H
+
+#include <grpc/support/port_platform.h>
+
+#include "y_absl/strings/string_view.h"
+
+#include <grpc/slice.h>
+
+#include "src/core/lib/slice/slice_internal.h"
+
+// Herein lies grpc_core::Slice and its team of thin wrappers around grpc_slice.
+// They aim to keep you safe by providing strong guarantees around lifetime and
+// mutability.
+//
+// The team:
+// Slice - provides a wrapper around an unknown type of slice.
+// Immutable (since we don't know who else might be referencing
+// it), and potentially ref counted.
+// StaticSlice - provides a wrapper around a static slice. Not refcounted,
+// fast to copy.
+// MutableSlice - provides a guarantee of unique ownership, meaning the
+// underlying data can be mutated safely.
+
+namespace grpc_core {
+
+// Forward declarations
+class Slice;
+class StaticSlice;
+class MutableSlice;
+
+namespace slice_detail {
+
+// Returns an empty slice.
+static constexpr grpc_slice EmptySlice() { return {nullptr, {}}; }
+
+// BaseSlice holds the grpc_slice object, but does not apply refcounting policy.
+// It does export immutable access into the slice, such that this can be shared
+// by all storage policies.
+class BaseSlice {
+ public:
+ BaseSlice(const BaseSlice&) = delete;
+ BaseSlice& operator=(const BaseSlice&) = delete;
+ BaseSlice(BaseSlice&& other) = delete;
+ BaseSlice& operator=(BaseSlice&& other) = delete;
+
+ // Iterator access to the underlying bytes
+ const uint8_t* begin() const { return GRPC_SLICE_START_PTR(c_slice()); }
+ const uint8_t* end() const { return GRPC_SLICE_END_PTR(c_slice()); }
+ const uint8_t* cbegin() const { return GRPC_SLICE_START_PTR(c_slice()); }
+ const uint8_t* cend() const { return GRPC_SLICE_END_PTR(c_slice()); }
+
+ // Retrieve a borrowed reference to the underlying grpc_slice.
+ const grpc_slice& c_slice() const { return slice_; }
+
+ // Retrieve the underlying grpc_slice, and replace the one in this object with
+ // EmptySlice().
+ grpc_slice TakeCSlice() {
+ grpc_slice out = slice_;
+ slice_ = EmptySlice();
+ return out;
+ }
+
+ // As other things... borrowed references.
+ y_absl::string_view as_string_view() const {
+ return y_absl::string_view(reinterpret_cast<const char*>(data()), size());
+ }
+
+ // Array access
+ uint8_t operator[](size_t i) const {
+ return GRPC_SLICE_START_PTR(c_slice())[i];
+ }
+
+ // Access underlying data
+ const uint8_t* data() const { return GRPC_SLICE_START_PTR(c_slice()); }
+
+ // Size of the slice
+ size_t size() const { return GRPC_SLICE_LENGTH(c_slice()); }
+ size_t length() const { return size(); }
+ bool empty() const { return size() == 0; }
+
+ // For inlined slices - are these two slices equal?
+ // For non-inlined slices - do these two slices refer to the same block of
+ // memory?
+ bool is_equivalent(const BaseSlice& other) const {
+ return grpc_slice_is_equivalent(slice_, other.slice_);
+ }
+
+ protected:
+ BaseSlice() : slice_(EmptySlice()) {}
+ explicit BaseSlice(const grpc_slice& slice) : slice_(slice) {}
+ ~BaseSlice() = default;
+
+ void Swap(BaseSlice* other) { std::swap(slice_, other->slice_); }
+ void SetCSlice(const grpc_slice& slice) { slice_ = slice; }
+
+ uint8_t* mutable_data() { return GRPC_SLICE_START_PTR(slice_); }
+
+ private:
+ grpc_slice slice_;
+};
+
+inline bool operator==(const BaseSlice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a.c_slice(), b.c_slice()) != 0;
+}
+
+inline bool operator!=(const BaseSlice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a.c_slice(), b.c_slice()) == 0;
+}
+
+inline bool operator==(const BaseSlice& a, y_absl::string_view b) {
+ return a.as_string_view() == b;
+}
+
+inline bool operator!=(const BaseSlice& a, y_absl::string_view b) {
+ return a.as_string_view() != b;
+}
+
+inline bool operator==(y_absl::string_view a, const BaseSlice& b) {
+ return a == b.as_string_view();
+}
+
+inline bool operator!=(y_absl::string_view a, const BaseSlice& b) {
+ return a != b.as_string_view();
+}
+
+inline bool operator==(const BaseSlice& a, const grpc_slice& b) {
+ return grpc_slice_eq(a.c_slice(), b) != 0;
+}
+
+inline bool operator!=(const BaseSlice& a, const grpc_slice& b) {
+ return grpc_slice_eq(a.c_slice(), b) == 0;
+}
+
+inline bool operator==(const grpc_slice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a, b.c_slice()) != 0;
+}
+
+inline bool operator!=(const grpc_slice& a, const BaseSlice& b) {
+ return grpc_slice_eq(a, b.c_slice()) == 0;
+}
+
+template <typename Out>
+struct CopyConstructors {
+ static Out FromCopiedString(const char* s) {
+ return Out(grpc_slice_from_copied_string(s));
+ }
+ static Out FromCopiedString(TString s) {
+ return Out(grpc_slice_from_cpp_string(std::move(s)));
+ }
+ static Out FromCopiedBuffer(const char* p, size_t len) {
+ return Out(UnmanagedMemorySlice(p, len));
+ }
+
+ template <typename Buffer>
+ static Out FromCopiedBuffer(const Buffer& buffer) {
+ return FromCopiedBuffer(reinterpret_cast<const char*>(buffer.data()),
+ buffer.size());
+ }
+};
+
+} // namespace slice_detail
+
+class StaticSlice : public slice_detail::BaseSlice {
+ public:
+ StaticSlice() = default;
+ explicit StaticSlice(const grpc_slice& slice)
+ : slice_detail::BaseSlice(slice) {
+ GPR_DEBUG_ASSERT(
+ slice.refcount->GetType() == grpc_slice_refcount::Type::STATIC ||
+ slice.refcount->GetType() == grpc_slice_refcount::Type::NOP);
+ }
+ explicit StaticSlice(const StaticMetadataSlice& slice)
+ : slice_detail::BaseSlice(slice) {}
+
+ static StaticSlice FromStaticString(const char* s) {
+ return StaticSlice(grpc_slice_from_static_string(s));
+ }
+
+ static StaticSlice FromStaticString(y_absl::string_view s) {
+ return StaticSlice(ExternallyManagedSlice(s.data(), s.size()));
+ }
+
+ StaticSlice(const StaticSlice& other)
+ : slice_detail::BaseSlice(other.c_slice()) {}
+ StaticSlice& operator=(const StaticSlice& other) {
+ SetCSlice(other.c_slice());
+ return *this;
+ }
+ StaticSlice(StaticSlice&& other) noexcept
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ StaticSlice& operator=(StaticSlice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+};
+
+class MutableSlice : public slice_detail::BaseSlice,
+ public slice_detail::CopyConstructors<MutableSlice> {
+ public:
+ MutableSlice() = default;
+ explicit MutableSlice(const grpc_slice& slice)
+ : slice_detail::BaseSlice(slice) {
+ GPR_DEBUG_ASSERT(slice.refcount == nullptr ||
+ slice.refcount->IsRegularUnique());
+ }
+ ~MutableSlice() { grpc_slice_unref_internal(c_slice()); }
+
+ MutableSlice(const MutableSlice&) = delete;
+ MutableSlice& operator=(const MutableSlice&) = delete;
+ MutableSlice(MutableSlice&& other) noexcept
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ MutableSlice& operator=(MutableSlice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+
+ static MutableSlice CreateUninitialized(size_t length) {
+ return MutableSlice(grpc_slice_malloc(length));
+ }
+
+ // Return a sub slice of this one. Leaves this slice in an indeterminate but
+ // valid state.
+ MutableSlice TakeSubSlice(size_t pos, size_t n) {
+ return MutableSlice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
+ }
+
+ // Iterator access to the underlying bytes
+ uint8_t* begin() { return mutable_data(); }
+ uint8_t* end() { return mutable_data() + size(); }
+
+ // Array access
+ uint8_t& operator[](size_t i) { return mutable_data()[i]; }
+};
+
+class Slice : public slice_detail::BaseSlice,
+ public slice_detail::CopyConstructors<Slice> {
+ public:
+ Slice() = default;
+ ~Slice() { grpc_slice_unref_internal(c_slice()); }
+ explicit Slice(const grpc_slice& slice) : slice_detail::BaseSlice(slice) {}
+ explicit Slice(slice_detail::BaseSlice&& other)
+ : slice_detail::BaseSlice(other.TakeCSlice()) {}
+
+ Slice(const Slice&) = delete;
+ Slice& operator=(const Slice&) = delete;
+ Slice(Slice&& other) noexcept : slice_detail::BaseSlice(other.TakeCSlice()) {}
+ Slice& operator=(Slice&& other) noexcept {
+ Swap(&other);
+ return *this;
+ }
+
+ // A slice might refer to some memory that we keep a refcount to (this is
+ // owned), or some memory that's inlined into the slice (also owned), or some
+ // other block of memory that we know will be available for the lifetime of
+ // some operation in the common case (not owned). In the *less common* case
+ // that we need to keep that slice text for longer than our API's guarantee us
+ // access, we need to take a copy and turn this into something that we do own.
+
+ // TakeOwned returns an owned slice regardless of current ownership, and
+ // leaves the current slice in a valid but externally unpredictable state - in
+ // doing so it can avoid adding a ref to the underlying slice.
+ Slice TakeOwned() {
+ if (c_slice().refcount == nullptr) {
+ return Slice(c_slice());
+ }
+ if (c_slice().refcount->GetType() == grpc_slice_refcount::Type::NOP) {
+ return Slice(grpc_slice_copy(c_slice()));
+ }
+ return Slice(TakeCSlice());
+ }
+
+ // AsOwned returns an owned slice but does not mutate the current slice,
+ // meaning that it may add a reference to the underlying slice.
+ Slice AsOwned() const {
+ if (c_slice().refcount == nullptr) {
+ return Slice(c_slice());
+ }
+ if (c_slice().refcount->GetType() == grpc_slice_refcount::Type::NOP) {
+ return Slice(grpc_slice_copy(c_slice()));
+ }
+ return Slice(grpc_slice_ref_internal(c_slice()));
+ }
+
+ // TakeMutable returns a MutableSlice, and leaves the current slice in an
+ // indeterminate but valid state.
+ // A mutable slice requires only one reference to the bytes of the slice -
+ // this can be achieved either with inlined storage or with a single
+ // reference.
+ // If the current slice is refcounted and there are more than one references
+ // to that slice, then the slice is copied in order to achieve a mutable
+ // version.
+ MutableSlice TakeMutable() {
+ if (c_slice().refcount == nullptr) {
+ return MutableSlice(c_slice());
+ }
+ if (c_slice().refcount->GetType() == grpc_slice_refcount::Type::REGULAR &&
+ c_slice().refcount->IsRegularUnique()) {
+ return MutableSlice(TakeCSlice());
+ }
+ return MutableSlice(grpc_slice_copy(c_slice()));
+ }
+
+ // Return a sub slice of this one. Leaves this slice in an indeterminate but
+ // valid state.
+ Slice TakeSubSlice(size_t pos, size_t n) {
+ return Slice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
+ }
+
+ Slice Ref() const { return Slice(grpc_slice_ref_internal(c_slice())); }
+
+ Slice Copy() const { return Slice(grpc_slice_copy(c_slice())); }
+
+ static Slice FromRefcountAndBytes(grpc_slice_refcount* r,
+ const uint8_t* begin, const uint8_t* end) {
+ grpc_slice out;
+ out.refcount = r;
+ r->Ref();
+ out.data.refcounted.bytes = const_cast<uint8_t*>(begin);
+ out.data.refcounted.length = end - begin;
+ return Slice(out);
+ }
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SLICE_SLICE_H
diff --git a/contrib/libs/grpc/test/core/util/trickle_endpoint.h b/contrib/libs/grpc/src/core/lib/slice/slice_api.cc
index cd07de905a7..28827d20872 100644
--- a/contrib/libs/grpc/test/core/util/trickle_endpoint.h
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_api.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2016 gRPC authors.
+ * Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,17 +16,24 @@
*
*/
-#ifndef TRICKLE_ENDPOINT_H
-#define TRICKLE_ENDPOINT_H
+#include <grpc/support/port_platform.h>
-#include "src/core/lib/iomgr/endpoint.h"
+#include <grpc/slice.h>
-grpc_endpoint* grpc_trickle_endpoint_create(grpc_endpoint* wrap,
- double bytes_per_second);
+#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice_internal.h"
-/* Allow up to \a bytes through the endpoint. Returns the new backlog. */
-size_t grpc_trickle_endpoint_trickle(grpc_endpoint* endpoint);
+/* Public API */
+grpc_slice grpc_slice_ref(grpc_slice slice) {
+ return grpc_slice_ref_internal(slice);
+}
-size_t grpc_trickle_get_backlog(grpc_endpoint* endpoint);
-
-#endif
+/* Public API */
+void grpc_slice_unref(grpc_slice slice) {
+ if (grpc_core::ExecCtx::Get() == nullptr) {
+ grpc_core::ExecCtx exec_ctx;
+ grpc_slice_unref_internal(slice);
+ } else {
+ grpc_slice_unref_internal(slice);
+ }
+}
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc b/contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc
index ba103d702bc..12cca86c554 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_buffer.cc
@@ -18,10 +18,9 @@
#include <grpc/support/port_platform.h>
-#include <grpc/slice_buffer.h>
-
#include <string.h>
+#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -85,6 +84,10 @@ void grpc_slice_buffer_destroy_internal(grpc_slice_buffer* sb) {
grpc_slice_buffer_reset_and_unref_internal(sb);
if (sb->base_slices != sb->inlined) {
gpr_free(sb->base_slices);
+ // As a precaution, set sb->base_slices to equal sb->inlined
+ // to prevent a double free attempt if grpc_slice_buffer_destroy_internal
+ // is invoked two times on the same slice buffer.
+ sb->base_slices = sb->slices = sb->inlined;
}
}
@@ -232,19 +235,19 @@ void grpc_slice_buffer_swap(grpc_slice_buffer* a, grpc_slice_buffer* b) {
memcpy(a->base_slices, b->inlined, b_count * sizeof(grpc_slice));
} else {
/* no inlining: easy swap */
- GPR_SWAP(grpc_slice*, a->base_slices, b->base_slices);
+ std::swap(a->base_slices, b->base_slices);
}
- /* Update the slices pointers (cannot do a GPR_SWAP on slices fields here).
+ /* Update the slices pointers (cannot do a std::swap on slices fields here).
* Also note that since the base_slices pointers are already swapped we need
* use 'b_offset' for 'a->base_slices' and vice versa */
a->slices = a->base_slices + b_offset;
b->slices = b->base_slices + a_offset;
/* base_slices and slices fields are correctly set. Swap all other fields */
- GPR_SWAP(size_t, a->count, b->count);
- GPR_SWAP(size_t, a->capacity, b->capacity);
- GPR_SWAP(size_t, a->length, b->length);
+ std::swap(a->count, b->count);
+ std::swap(a->capacity, b->capacity);
+ std::swap(a->length, b->length);
}
void grpc_slice_buffer_move_into(grpc_slice_buffer* src,
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_intern.cc b/contrib/libs/grpc/src/core/lib/slice/slice_intern.cc
index 04681304e7e..0bed91a9e2c 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_intern.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_intern.cc
@@ -18,9 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/lib/slice/slice_utils.h"
-
#include <inttypes.h>
#include <string.h>
@@ -31,7 +28,9 @@
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/iomgr_internal.h" /* for iomgr_abort_on_leaks() */
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/transport/static_metadata.h"
#define LOG2_SHARD_COUNT 5
@@ -137,12 +136,11 @@ grpc_slice grpc_slice_maybe_static_intern(grpc_slice slice,
for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
static_metadata_hash_ent ent =
static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
- grpc_slice_eq_static_interned(slice, static_slice_table[ent.idx])) {
+ grpc_slice_eq_static_interned(
+ slice, grpc_core::g_static_metadata_slice_table[ent.idx])) {
*returned_slice_is_different = true;
- return static_slice_table[ent.idx];
+ return grpc_core::g_static_metadata_slice_table[ent.idx];
}
}
@@ -168,11 +166,9 @@ static const grpc_core::StaticMetadataSlice* MatchStaticSlice(
for (uint32_t i = 0; i <= max_static_metadata_hash_probe; i++) {
static_metadata_hash_ent ent =
static_metadata_hash[(hash + i) % GPR_ARRAY_SIZE(static_metadata_hash)];
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
if (ent.hash == hash && ent.idx < GRPC_STATIC_MDSTR_COUNT &&
- static_slice_table[ent.idx] == args) {
- return &static_slice_table[ent.idx];
+ grpc_core::g_static_metadata_slice_table[ent.idx] == args) {
+ return &grpc_core::g_static_metadata_slice_table[ent.idx];
}
}
return nullptr;
@@ -239,7 +235,7 @@ static InternedSliceRefcount* MatchInternedSliceLocked(uint32_t hash,
/* search for an existing string */
for (s = shard->strs[idx]; s; s = s->bucket_next) {
if (s->hash == hash && grpc_core::InternedSlice(s) == args) {
- if (s->refcnt.RefIfNonZero()) {
+ if (grpc_core::IncrementIfNonzero(&s->refcnt)) {
return s;
}
}
@@ -324,11 +320,9 @@ void grpc_slice_intern_init(void) {
static_metadata_hash[i].idx = GRPC_STATIC_MDSTR_COUNT;
}
max_static_metadata_hash_probe = 0;
- const grpc_core::StaticMetadataSlice* static_slice_table =
- grpc_static_slice_table();
for (size_t i = 0; i < GRPC_STATIC_MDSTR_COUNT; i++) {
- grpc_static_metadata_hash_values[i] =
- grpc_slice_default_hash_internal(static_slice_table[i]);
+ grpc_static_metadata_hash_values[i] = grpc_slice_default_hash_internal(
+ grpc_core::g_static_metadata_slice_table[i]);
for (size_t j = 0; j < GPR_ARRAY_SIZE(static_metadata_hash); j++) {
size_t slot = (grpc_static_metadata_hash_values[i] + j) %
GPR_ARRAY_SIZE(static_metadata_hash);
@@ -344,7 +338,7 @@ void grpc_slice_intern_init(void) {
}
// Handle KV hash for all static mdelems.
for (size_t i = 0; i < GRPC_STATIC_MDELEM_COUNT; ++i) {
- grpc_static_mdelem_table()[i].HashInit();
+ grpc_core::g_static_mdelem_table[i].HashInit();
}
}
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_internal.h b/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
index 2449ea0f34a..d603d04efe0 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_internal.h
@@ -21,259 +21,17 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
+#include <string.h>
#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
-#include <string.h>
+#include <grpc/support/log.h>
#include "src/core/lib/gpr/murmur_hash.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
+#include "src/core/lib/slice/slice_refcount.h"
#include "src/core/lib/slice/slice_utils.h"
-#include "src/core/lib/transport/static_metadata.h"
-
-// Interned slices have specific fast-path operations for hashing. To inline
-// these operations, we need to forward declare them here.
-extern uint32_t grpc_static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT];
-
-// grpc_slice_refcount : A reference count for grpc_slice.
-//
-// Non-inlined grpc_slice objects are refcounted. Historically this was
-// implemented via grpc_slice_refcount, a C-style polymorphic class using a
-// manually managed vtable of operations. Subclasses would define their own
-// vtable; the 'virtual' methods (ref, unref, equals and hash) would simply call
-// the function pointers in the vtable as necessary.
-//
-// Unfortunately, this leads to some inefficiencies in the generated code that
-// can be improved upon. For example, equality checking for interned slices is a
-// simple equality check on the refcount pointer. With the vtable approach, this
-// would translate to roughly the following (high-level) instructions:
-//
-// grpc_slice_equals(slice1, slice2):
-// load vtable->eq -> eq_func
-// call eq_func(slice1, slice2)
-//
-// interned_slice_equals(slice1, slice2)
-// load slice1.ref -> r1
-// load slice2.ref -> r2
-// cmp r1, r2 -> retval
-// ret retval
-//
-// This leads to a function call for a function defined in another translation
-// unit, which imposes memory barriers, which reduces the compiler's ability to
-// optimize (in addition to the added overhead of call/ret). Additionally, it
-// may be harder to reason about branch prediction when we're jumping to
-// essentially arbitrarily provided function pointers.
-//
-// In addition, it is arguable that while virtualization was helpful for
-// Equals()/Hash() methods, that it was fundamentally unnecessary for
-// Ref()/Unref().
-//
-// Instead, grpc_slice_refcount provides the same functionality as the C-style
-// virtual class, but in a de-virtualized manner - Eq(), Hash(), Ref() and
-// Unref() are provided within this header file. Fastpaths for Eq()/Hash()
-// (interned and static metadata slices), as well as the Ref() operation, can
-// all be inlined without any memory barriers.
-//
-// It does this by:
-// 1. Using grpc_core::RefCount<> (header-only) for Ref/Unref. Two special cases
-// need support: No-op ref/unref (eg. static metadata slices) and stream
-// slice references (where all the slices share the streamref). This is in
-// addition to the normal case of '1 slice, 1 ref'.
-// To support these cases, we explicitly track a nullable pointer to the
-// underlying RefCount<>. No-op ref/unref is used by checking the pointer for
-// null, and doing nothing if it is. Both stream slice refs and 'normal'
-// slices use the same path for Ref/Unref (by targeting the non-null
-// pointer).
-//
-// 2. introducing the notion of grpc_slice_refcount::Type. This describes if a
-// slice ref is used by a static metadata slice, an interned slice, or other
-// slices. We switch on the slice ref type in order to provide fastpaths for
-// Equals() and Hash().
-//
-// In total, this saves us roughly 1-2% latency for unary calls, with smaller
-// calls benefitting. The effect is present, but not as useful, for larger calls
-// where the cost of sending the data dominates.
-// TODO(arjunroy): Investigate if this can be removed with strongly typed
-// grpc_slices.
-struct grpc_slice_refcount {
- public:
- enum class Type {
- STATIC, // Refcount for a static metadata slice.
- INTERNED, // Refcount for an interned slice.
- NOP, // No-Op
- REGULAR // Refcount for non-static-metadata, non-interned slices.
- };
- typedef void (*DestroyerFn)(void*);
-
- grpc_slice_refcount() = default;
-
- explicit grpc_slice_refcount(Type t) : ref_type_(t) {}
-
- explicit grpc_slice_refcount(grpc_slice_refcount* sub) : sub_refcount_(sub) {}
- // Regular constructor for grpc_slice_refcount.
- //
- // Parameters:
- // 1. grpc_slice_refcount::Type type
- // Whether we are the refcount for a static
- // metadata slice, an interned slice, or any other kind of slice.
- //
- // 2. RefCount* ref
- // The pointer to the actual underlying grpc_core::RefCount. Rather than
- // performing struct offset computations as in the original implementation to
- // get to the refcount, which requires a virtual method, we devirtualize by
- // using a nullable pointer to allow a single pair of Ref/Unref methods.
- //
- // 3. DestroyerFn destroyer_fn
- // Called when the refcount goes to 0, with destroyer_arg as parameter.
- //
- // 4. void* destroyer_arg
- // Argument for the virtualized destructor.
- //
- // 5. grpc_slice_refcount* sub
- // Argument used for interned slices.
- grpc_slice_refcount(grpc_slice_refcount::Type type, grpc_core::RefCount* ref,
- DestroyerFn destroyer_fn, void* destroyer_arg,
- grpc_slice_refcount* sub)
- : ref_(ref),
- ref_type_(type),
- sub_refcount_(sub),
- dest_fn_(destroyer_fn),
- destroy_fn_arg_(destroyer_arg) {}
- // Initializer for static refcounts.
- grpc_slice_refcount(grpc_slice_refcount* sub, Type type)
- : ref_type_(type), sub_refcount_(sub) {}
-
- Type GetType() const { return ref_type_; }
-
- int Eq(const grpc_slice& a, const grpc_slice& b);
-
- uint32_t Hash(const grpc_slice& slice);
- void Ref() {
- if (ref_ == nullptr) return;
- ref_->RefNonZero();
- }
- void Unref() {
- if (ref_ == nullptr) return;
- if (ref_->Unref()) {
- dest_fn_(destroy_fn_arg_);
- }
- }
-
- grpc_slice_refcount* sub_refcount() const { return sub_refcount_; }
-
- private:
- grpc_core::RefCount* ref_ = nullptr;
- const Type ref_type_ = Type::REGULAR;
- grpc_slice_refcount* sub_refcount_ = this;
- DestroyerFn dest_fn_ = nullptr;
- void* destroy_fn_arg_ = nullptr;
-};
-
-namespace grpc_core {
-
-struct StaticSliceRefcount {
- static grpc_slice_refcount kStaticSubRefcount;
-
- explicit StaticSliceRefcount(uint32_t index)
- : base(&kStaticSubRefcount, grpc_slice_refcount::Type::STATIC),
- index(index) {}
-
- grpc_slice_refcount base;
- const uint32_t index;
-};
-
-extern grpc_slice_refcount kNoopRefcount;
-
-struct InternedSliceRefcount {
- static void Destroy(void* arg) {
- auto* rc = static_cast<InternedSliceRefcount*>(arg);
- rc->~InternedSliceRefcount();
- gpr_free(rc);
- }
-
- InternedSliceRefcount(size_t length, uint32_t hash,
- InternedSliceRefcount* bucket_next)
- : base(grpc_slice_refcount::Type::INTERNED, &refcnt, Destroy, this, &sub),
- sub(grpc_slice_refcount::Type::REGULAR, &refcnt, Destroy, this, &sub),
- length(length),
- hash(hash),
- bucket_next(bucket_next) {}
-
- ~InternedSliceRefcount();
-
- grpc_slice_refcount base;
- grpc_slice_refcount sub;
- const size_t length;
- RefCount refcnt;
- const uint32_t hash;
- InternedSliceRefcount* bucket_next;
-};
-
-} // namespace grpc_core
-
-inline size_t grpc_refcounted_slice_length(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- return slice.data.refcounted.length;
-}
-
-inline const uint8_t* grpc_refcounted_slice_data(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- return slice.data.refcounted.bytes;
-}
-
-inline int grpc_slice_refcount::Eq(const grpc_slice& a, const grpc_slice& b) {
- GPR_DEBUG_ASSERT(a.refcount != nullptr);
- GPR_DEBUG_ASSERT(a.refcount == this);
- switch (ref_type_) {
- case Type::STATIC:
- GPR_DEBUG_ASSERT(
- (GRPC_STATIC_METADATA_INDEX(a) == GRPC_STATIC_METADATA_INDEX(b)) ==
- (a.refcount == b.refcount));
- case Type::INTERNED:
- return a.refcount == b.refcount;
- case Type::NOP:
- case Type::REGULAR:
- break;
- }
- if (grpc_refcounted_slice_length(a) != GRPC_SLICE_LENGTH(b)) return false;
- if (grpc_refcounted_slice_length(a) == 0) return true;
- return 0 == memcmp(grpc_refcounted_slice_data(a), GRPC_SLICE_START_PTR(b),
- grpc_refcounted_slice_length(a));
-}
-
-inline uint32_t grpc_slice_refcount::Hash(const grpc_slice& slice) {
- GPR_DEBUG_ASSERT(slice.refcount != nullptr);
- GPR_DEBUG_ASSERT(slice.refcount == this);
- switch (ref_type_) {
- case Type::STATIC:
- return ::grpc_static_metadata_hash_values[GRPC_STATIC_METADATA_INDEX(
- slice)];
- case Type::INTERNED:
- return reinterpret_cast<grpc_core::InternedSliceRefcount*>(slice.refcount)
- ->hash;
- case Type::NOP:
- case Type::REGULAR:
- break;
- }
- return gpr_murmur_hash3(grpc_refcounted_slice_data(slice),
- grpc_refcounted_slice_length(slice),
- grpc_core::g_hash_seed);
-}
-
-inline const grpc_slice& grpc_slice_ref_internal(const grpc_slice& slice) {
- if (slice.refcount) {
- slice.refcount->Ref();
- }
- return slice;
-}
-
-inline void grpc_slice_unref_internal(const grpc_slice& slice) {
- if (slice.refcount) {
- slice.refcount->Unref();
- }
-}
void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer* sb);
void grpc_slice_buffer_partial_unref_internal(grpc_slice_buffer* sb,
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_refcount.cc b/contrib/libs/grpc/src/core/lib/slice/slice_refcount.cc
new file mode 100644
index 00000000000..10de62b72e7
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_refcount.cc
@@ -0,0 +1,17 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/slice/slice_refcount.h"
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_refcount.h b/contrib/libs/grpc/src/core/lib/slice/slice_refcount.h
new file mode 100644
index 00000000000..28f38f66383
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_refcount.h
@@ -0,0 +1,125 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H
+#define GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <grpc/support/alloc.h>
+
+#include "src/core/lib/slice/slice_refcount_base.h"
+#include "src/core/lib/slice/static_slice.h"
+
+// Interned slices have specific fast-path operations for hashing. To inline
+// these operations, we need to forward declare them here.
+extern uint32_t grpc_static_metadata_hash_values[GRPC_STATIC_MDSTR_COUNT];
+
+namespace grpc_core {
+
+extern grpc_slice_refcount kNoopRefcount;
+
+// TODO(ctiller): when this is removed, remove the std::atomic* in
+// grpc_slice_refcount and just put it there directly.
+struct InternedSliceRefcount {
+ static void Destroy(void* arg) {
+ auto* rc = static_cast<InternedSliceRefcount*>(arg);
+ rc->~InternedSliceRefcount();
+ gpr_free(rc);
+ }
+
+ InternedSliceRefcount(size_t length, uint32_t hash,
+ InternedSliceRefcount* bucket_next)
+ : base(grpc_slice_refcount::Type::INTERNED, &refcnt, Destroy, this, &sub),
+ sub(grpc_slice_refcount::Type::REGULAR, &refcnt, Destroy, this, &sub),
+ length(length),
+ hash(hash),
+ bucket_next(bucket_next) {}
+
+ ~InternedSliceRefcount();
+
+ grpc_slice_refcount base;
+ grpc_slice_refcount sub;
+ const size_t length;
+ std::atomic<size_t> refcnt{1};
+ const uint32_t hash;
+ InternedSliceRefcount* bucket_next;
+};
+
+} // namespace grpc_core
+
+inline size_t grpc_refcounted_slice_length(const grpc_slice& slice) {
+ GPR_DEBUG_ASSERT(slice.refcount != nullptr);
+ return slice.data.refcounted.length;
+}
+
+inline const uint8_t* grpc_refcounted_slice_data(const grpc_slice& slice) {
+ GPR_DEBUG_ASSERT(slice.refcount != nullptr);
+ return slice.data.refcounted.bytes;
+}
+
+inline int grpc_slice_refcount::Eq(const grpc_slice& a, const grpc_slice& b) {
+ GPR_DEBUG_ASSERT(a.refcount != nullptr);
+ GPR_DEBUG_ASSERT(a.refcount == this);
+ switch (ref_type_) {
+ case Type::STATIC:
+ GPR_DEBUG_ASSERT(
+ (GRPC_STATIC_METADATA_INDEX(a) == GRPC_STATIC_METADATA_INDEX(b)) ==
+ (a.refcount == b.refcount));
+ Y_ABSL_FALLTHROUGH_INTENDED;
+ case Type::INTERNED:
+ return a.refcount == b.refcount;
+ case Type::NOP:
+ case Type::REGULAR:
+ break;
+ }
+ if (grpc_refcounted_slice_length(a) != GRPC_SLICE_LENGTH(b)) return false;
+ if (grpc_refcounted_slice_length(a) == 0) return true;
+ return 0 == memcmp(grpc_refcounted_slice_data(a), GRPC_SLICE_START_PTR(b),
+ grpc_refcounted_slice_length(a));
+}
+
+inline uint32_t grpc_slice_refcount::Hash(const grpc_slice& slice) {
+ GPR_DEBUG_ASSERT(slice.refcount != nullptr);
+ GPR_DEBUG_ASSERT(slice.refcount == this);
+ switch (ref_type_) {
+ case Type::STATIC:
+ return ::grpc_static_metadata_hash_values[GRPC_STATIC_METADATA_INDEX(
+ slice)];
+ case Type::INTERNED:
+ return reinterpret_cast<grpc_core::InternedSliceRefcount*>(slice.refcount)
+ ->hash;
+ case Type::NOP:
+ case Type::REGULAR:
+ break;
+ }
+ return gpr_murmur_hash3(grpc_refcounted_slice_data(slice),
+ grpc_refcounted_slice_length(slice),
+ grpc_core::g_hash_seed);
+}
+
+inline const grpc_slice& grpc_slice_ref_internal(const grpc_slice& slice) {
+ if (slice.refcount) {
+ slice.refcount->Ref();
+ }
+ return slice;
+}
+
+inline void grpc_slice_unref_internal(const grpc_slice& slice) {
+ if (slice.refcount) {
+ slice.refcount->Unref();
+ }
+}
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_refcount_base.h b/contrib/libs/grpc/src/core/lib/slice/slice_refcount_base.h
new file mode 100644
index 00000000000..9c1e34056b4
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_refcount_base.h
@@ -0,0 +1,181 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_BASE_H
+#define GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_BASE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <atomic>
+
+#include <grpc/slice.h>
+#include <grpc/support/log.h>
+
+// grpc_slice_refcount : A reference count for grpc_slice.
+//
+// Non-inlined grpc_slice objects are refcounted. Historically this was
+// implemented via grpc_slice_refcount, a C-style polymorphic class using a
+// manually managed vtable of operations. Subclasses would define their own
+// vtable; the 'virtual' methods (ref, unref, equals and hash) would simply call
+// the function pointers in the vtable as necessary.
+//
+// Unfortunately, this leads to some inefficiencies in the generated code that
+// can be improved upon. For example, equality checking for interned slices is a
+// simple equality check on the refcount pointer. With the vtable approach, this
+// would translate to roughly the following (high-level) instructions:
+//
+// grpc_slice_equals(slice1, slice2):
+// load vtable->eq -> eq_func
+// call eq_func(slice1, slice2)
+//
+// interned_slice_equals(slice1, slice2)
+// load slice1.ref -> r1
+// load slice2.ref -> r2
+// cmp r1, r2 -> retval
+// ret retval
+//
+// This leads to a function call for a function defined in another translation
+// unit, which imposes memory barriers, which reduces the compiler's ability to
+// optimize (in addition to the added overhead of call/ret). Additionally, it
+// may be harder to reason about branch prediction when we're jumping to
+// essentially arbitrarily provided function pointers.
+//
+// In addition, it is arguable that while virtualization was helpful for
+// Equals()/Hash() methods, that it was fundamentally unnecessary for
+// Ref()/Unref().
+//
+// Instead, grpc_slice_refcount provides the same functionality as the C-style
+// virtual class, but in a de-virtualized manner - Eq(), Hash(), Ref() and
+// Unref() are provided within this header file. Fastpaths for Eq()/Hash()
+// (interned and static metadata slices), as well as the Ref() operation, can
+// all be inlined without any memory barriers.
+//
+// It does this by:
+// 1. Using grpc_core::RefCount<> (header-only) for Ref/Unref. Two special cases
+// need support: No-op ref/unref (eg. static metadata slices) and stream
+// slice references (where all the slices share the streamref). This is in
+// addition to the normal case of '1 slice, 1 ref'.
+// To support these cases, we explicitly track a nullable pointer to the
+// underlying RefCount<>. No-op ref/unref is used by checking the pointer for
+// null, and doing nothing if it is. Both stream slice refs and 'normal'
+// slices use the same path for Ref/Unref (by targeting the non-null
+// pointer).
+//
+// 2. introducing the notion of grpc_slice_refcount::Type. This describes if a
+// slice ref is used by a static metadata slice, an interned slice, or other
+// slices. We switch on the slice ref type in order to provide fastpaths for
+// Equals() and Hash().
+//
+// In total, this saves us roughly 1-2% latency for unary calls, with smaller
+// calls benefitting. The effect is present, but not as useful, for larger calls
+// where the cost of sending the data dominates.
+// TODO(arjunroy): Investigate if this can be removed with strongly typed
+// grpc_slices.
+struct grpc_slice_refcount {
+ public:
+ enum class Type {
+ STATIC, // Refcount for a static metadata slice.
+ INTERNED, // Refcount for an interned slice.
+ NOP, // No-Op
+ REGULAR // Refcount for non-static-metadata, non-interned slices.
+ };
+ typedef void (*DestroyerFn)(void*);
+
+ grpc_slice_refcount() = default;
+
+ explicit grpc_slice_refcount(Type t) : ref_type_(t) {}
+
+ explicit grpc_slice_refcount(grpc_slice_refcount* sub) : sub_refcount_(sub) {}
+ // Regular constructor for grpc_slice_refcount.
+ //
+ // Parameters:
+ // 1. grpc_slice_refcount::Type type
+ // Whether we are the refcount for a static
+ // metadata slice, an interned slice, or any other kind of slice.
+ //
+ // 2. std::atomic<size_t>* ref
+ // The pointer to the actual underlying grpc_core::RefCount.
+ // TODO(ctiller): remove the pointer indirection and just put the refcount on
+ // this object once we remove interning.
+ //
+ // 3. DestroyerFn destroyer_fn
+ // Called when the refcount goes to 0, with destroyer_arg as parameter.
+ //
+ // 4. void* destroyer_arg
+ // Argument for the virtualized destructor.
+ //
+ // 5. grpc_slice_refcount* sub
+ // Argument used for interned slices.
+ grpc_slice_refcount(grpc_slice_refcount::Type type, std::atomic<size_t>* ref,
+ DestroyerFn destroyer_fn, void* destroyer_arg,
+ grpc_slice_refcount* sub)
+ : ref_(ref),
+ ref_type_(type),
+ sub_refcount_(sub),
+ dest_fn_(destroyer_fn),
+ destroy_fn_arg_(destroyer_arg) {}
+ // Initializer for static refcounts.
+ grpc_slice_refcount(grpc_slice_refcount* sub, Type type)
+ : ref_type_(type), sub_refcount_(sub) {}
+
+ Type GetType() const { return ref_type_; }
+
+ int Eq(const grpc_slice& a, const grpc_slice& b);
+
+ uint32_t Hash(const grpc_slice& slice);
+ void Ref() {
+ if (ref_ == nullptr) return;
+ ref_->fetch_add(1, std::memory_order_relaxed);
+ }
+ void Unref() {
+ if (ref_ == nullptr) return;
+ if (ref_->fetch_sub(1, std::memory_order_acq_rel) == 1) {
+ dest_fn_(destroy_fn_arg_);
+ }
+ }
+
+ // Only for type REGULAR, is this the only instance?
+ // For this to be useful the caller needs to ensure that if this is the only
+ // instance, no other instance could be created during this call.
+ bool IsRegularUnique() {
+ GPR_DEBUG_ASSERT(ref_type_ == Type::REGULAR);
+ return ref_->load(std::memory_order_relaxed) == 1;
+ }
+
+ grpc_slice_refcount* sub_refcount() const { return sub_refcount_; }
+
+ private:
+ std::atomic<size_t>* ref_ = nullptr;
+ const Type ref_type_ = Type::REGULAR;
+ grpc_slice_refcount* sub_refcount_ = this;
+ DestroyerFn dest_fn_ = nullptr;
+ void* destroy_fn_arg_ = nullptr;
+};
+
+namespace grpc_core {
+
+struct StaticSliceRefcount {
+ static grpc_slice_refcount kStaticSubRefcount;
+
+ explicit StaticSliceRefcount(uint32_t index)
+ : base(&kStaticSubRefcount, grpc_slice_refcount::Type::STATIC),
+ index(index) {}
+
+ grpc_slice_refcount base;
+ const uint32_t index;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SLICE_SLICE_REFCOUNT_BASE_H
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_split.cc b/contrib/libs/grpc/src/core/lib/slice/slice_split.cc
new file mode 100644
index 00000000000..d2a951cb54d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_split.cc
@@ -0,0 +1,100 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/slice/slice_split.h"
+
+#include <string.h>
+
+#include <grpc/support/log.h>
+
+/** Finds the initial (\a begin) and final (\a end) offsets of the next
+ * substring from \a str + \a read_offset until the next \a sep or the end of \a
+ * str.
+ *
+ * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
+static int slice_find_separator_offset(const grpc_slice str, const char* sep,
+ const size_t read_offset, size_t* begin,
+ size_t* end) {
+ size_t i;
+ const uint8_t* str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
+ const size_t str_len = GRPC_SLICE_LENGTH(str) - read_offset;
+ const size_t sep_len = strlen(sep);
+ if (str_len < sep_len) {
+ return 0;
+ }
+
+ for (i = 0; i <= str_len - sep_len; i++) {
+ if (memcmp(str_ptr + i, sep, sep_len) == 0) {
+ *begin = read_offset;
+ *end = read_offset + i;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static void skip_leading_trailing_spaces(const uint8_t* str_buffer,
+ size_t* begin, size_t* end) {
+ while (*begin < *end && str_buffer[*begin] == ' ') {
+ (*begin)++;
+ }
+ while (*begin < *end && str_buffer[*end - 1] == ' ') {
+ (*end)--;
+ }
+}
+
+static void grpc_slice_split_inner(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst, bool no_space) {
+ const size_t sep_len = strlen(sep);
+ size_t begin, end;
+ const uint8_t* str_buffer = GRPC_SLICE_START_PTR(str);
+ size_t sep_pos;
+
+ GPR_ASSERT(sep_len > 0);
+
+ if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
+ do {
+ sep_pos = end;
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ } while (slice_find_separator_offset(str, sep, sep_pos + sep_len, &begin,
+ &end) != 0);
+ begin = sep_pos + sep_len;
+ end = GRPC_SLICE_LENGTH(str);
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ } else { /* no sep found, add whole input */
+ begin = 0;
+ end = GRPC_SLICE_LENGTH(str);
+ if (no_space) {
+ skip_leading_trailing_spaces(str_buffer, &begin, &end);
+ }
+ grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
+ }
+}
+
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst) {
+ grpc_slice_split_inner(str, sep, dst, false);
+}
+
+void grpc_slice_split_without_space(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst) {
+ grpc_slice_split_inner(str, sep, dst, true);
+}
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_split.h b/contrib/libs/grpc/src/core/lib/slice/slice_split.h
new file mode 100644
index 00000000000..835b16a85d2
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_split.h
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_SLICE_SLICE_SPLIT_H
+#define GRPC_CORE_LIB_SLICE_SLICE_SPLIT_H
+
+#include <grpc/support/port_platform.h>
+
+#include <stdbool.h>
+#include <stddef.h>
+
+#include <grpc/slice.h>
+#include <grpc/slice_buffer.h>
+
+/** Split \a str by the separator \a sep. Results are stored in \a dst, which
+ * should be a properly initialized instance. */
+void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
+
+/** Split \a str by the separator \a sep and remove the leading and trailing
+ * spaces of each resulting token. Results are stored in \a dst, which should be
+ * a properly initialized instance. */
+void grpc_slice_split_without_space(grpc_slice str, const char* sep,
+ grpc_slice_buffer* dst);
+
+#endif /* GRPC_CORE_LIB_SLICE_SLICE_SPLIT_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc b/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc
index 7887e0305fb..35744d0aa01 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.cc
@@ -20,10 +20,6 @@
#include "src/core/lib/slice/slice_string_helpers.h"
-#include <string.h>
-
-#include <grpc/support/log.h>
-
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -41,85 +37,6 @@ grpc_slice grpc_dump_slice_to_slice(const grpc_slice& s, uint32_t flags) {
return grpc_slice_from_moved_buffer(std::move(ptr), len);
}
-/** Finds the initial (\a begin) and final (\a end) offsets of the next
- * substring from \a str + \a read_offset until the next \a sep or the end of \a
- * str.
- *
- * Returns 1 and updates \a begin and \a end. Returns 0 otherwise. */
-static int slice_find_separator_offset(const grpc_slice str, const char* sep,
- const size_t read_offset, size_t* begin,
- size_t* end) {
- size_t i;
- const uint8_t* str_ptr = GRPC_SLICE_START_PTR(str) + read_offset;
- const size_t str_len = GRPC_SLICE_LENGTH(str) - read_offset;
- const size_t sep_len = strlen(sep);
- if (str_len < sep_len) {
- return 0;
- }
-
- for (i = 0; i <= str_len - sep_len; i++) {
- if (memcmp(str_ptr + i, sep, sep_len) == 0) {
- *begin = read_offset;
- *end = read_offset + i;
- return 1;
- }
- }
- return 0;
-}
-
-static void skip_leading_trailing_spaces(const uint8_t* str_buffer,
- size_t* begin, size_t* end) {
- while (*begin < *end && str_buffer[*begin] == ' ') {
- (*begin)++;
- }
- while (*begin < *end && str_buffer[*end - 1] == ' ') {
- (*end)--;
- }
-}
-
-static void grpc_slice_split_inner(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst, bool no_space) {
- const size_t sep_len = strlen(sep);
- size_t begin, end;
- const uint8_t* str_buffer = GRPC_SLICE_START_PTR(str);
- size_t sep_pos;
-
- GPR_ASSERT(sep_len > 0);
-
- if (slice_find_separator_offset(str, sep, 0, &begin, &end) != 0) {
- do {
- sep_pos = end;
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- } while (slice_find_separator_offset(str, sep, sep_pos + sep_len, &begin,
- &end) != 0);
- begin = sep_pos + sep_len;
- end = GRPC_SLICE_LENGTH(str);
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- } else { /* no sep found, add whole input */
- begin = 0;
- end = GRPC_SLICE_LENGTH(str);
- if (no_space) {
- skip_leading_trailing_spaces(str_buffer, &begin, &end);
- }
- grpc_slice_buffer_add_indexed(dst, grpc_slice_sub(str, begin, end));
- }
-}
-
-void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst) {
- grpc_slice_split_inner(str, sep, dst, false);
-}
-
-void grpc_slice_split_without_space(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst) {
- grpc_slice_split_inner(str, sep, dst, true);
-}
-
bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result) {
return gpr_parse_bytes_to_uint32(
reinterpret_cast<const char*> GRPC_SLICE_START_PTR(str),
diff --git a/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.h b/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.h
index 6551a6df75d..df9cadd5a81 100644
--- a/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.h
+++ b/contrib/libs/grpc/src/core/lib/slice/slice_string_helpers.h
@@ -25,7 +25,6 @@
#include <stddef.h>
#include <grpc/slice.h>
-#include <grpc/slice_buffer.h>
#include "src/core/lib/gpr/string.h"
@@ -34,16 +33,6 @@ char* grpc_dump_slice(const grpc_slice& slice, uint32_t flags);
/* Calls gpr_dump on a slice and returns the result as a slice. */
grpc_slice grpc_dump_slice_to_slice(const grpc_slice& slice, uint32_t flags);
-/** Split \a str by the separator \a sep. Results are stored in \a dst, which
- * should be a properly initialized instance. */
-void grpc_slice_split(grpc_slice str, const char* sep, grpc_slice_buffer* dst);
-
-/** Split \a str by the separator \a sep and remove the leading and trailing
- * spaces of each resulting token. Results are stored in \a dst, which should be
- * a properly initialized instance. */
-void grpc_slice_split_without_space(grpc_slice str, const char* sep,
- grpc_slice_buffer* dst);
-
bool grpc_parse_slice_to_uint32(grpc_slice str, uint32_t* result);
#endif /* GRPC_CORE_LIB_SLICE_SLICE_STRING_HELPERS_H */
diff --git a/contrib/libs/grpc/src/core/lib/slice/static_slice.cc b/contrib/libs/grpc/src/core/lib/slice/static_slice.cc
new file mode 100644
index 00000000000..9f59753608a
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/static_slice.cc
@@ -0,0 +1,377 @@
+/*
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * WARNING: Auto-generated code.
+ *
+ * To make changes to this file, change
+ * tools/codegen/core/gen_static_metadata.py, and then re-run it.
+ *
+ * See metadata.h for an explanation of the interface here, and metadata.cc for
+ * an explanation of what's going on.
+ */
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/slice/static_slice.h"
+
+namespace grpc_core {
+const uint8_t g_static_metadata_bytes[] = {
+ 58, 112, 97, 116, 104, 58, 109, 101, 116, 104, 111, 100, 58, 115, 116,
+ 97, 116, 117, 115, 58, 97, 117, 116, 104, 111, 114, 105, 116, 121, 58,
+ 115, 99, 104, 101, 109, 101, 103, 114, 112, 99, 45, 115, 116, 97, 116,
+ 117, 115, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103,
+ 103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99,
+ 111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121,
+ 112, 101, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, 99, 111, 100,
+ 105, 110, 103, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, 111, 100,
+ 105, 110, 103, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110, 97,
+ 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113, 117,
+ 101, 115, 116, 103, 114, 112, 99, 45, 112, 114, 101, 118, 105, 111, 117,
+ 115, 45, 114, 112, 99, 45, 97, 116, 116, 101, 109, 112, 116, 115, 103,
+ 114, 112, 99, 45, 114, 101, 116, 114, 121, 45, 112, 117, 115, 104, 98,
+ 97, 99, 107, 45, 109, 115, 103, 114, 112, 99, 45, 116, 105, 109, 101,
+ 111, 117, 116, 49, 50, 51, 52, 47, 103, 114, 112, 99, 46, 108, 98,
+ 46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101,
+ 114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 47, 101,
+ 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111,
+ 97, 100, 95, 115, 116, 97, 116, 115, 46, 118, 50, 46, 76, 111, 97,
+ 100, 82, 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105,
+ 99, 101, 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116,
+ 97, 116, 115, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105,
+ 99, 101, 46, 108, 111, 97, 100, 95, 115, 116, 97, 116, 115, 46, 118,
+ 51, 46, 76, 111, 97, 100, 82, 101, 112, 111, 114, 116, 105, 110, 103,
+ 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 76,
+ 111, 97, 100, 83, 116, 97, 116, 115, 47, 103, 114, 112, 99, 46, 104,
+ 101, 97, 108, 116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104,
+ 47, 87, 97, 116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101,
+ 114, 118, 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121,
+ 46, 118, 50, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68,
+ 105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101,
+ 47, 83, 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116,
+ 101, 100, 82, 101, 115, 111, 117, 114, 99, 101, 115, 47, 101, 110, 118,
+ 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 100, 105, 115, 99,
+ 111, 118, 101, 114, 121, 46, 118, 51, 46, 65, 103, 103, 114, 101, 103,
+ 97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, 114, 121, 83, 101,
+ 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 65, 103, 103,
+ 114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, 117, 114, 99, 101,
+ 115, 100, 101, 102, 108, 97, 116, 101, 103, 122, 105, 112, 115, 116, 114,
+ 101, 97, 109, 47, 103, 122, 105, 112, 116, 101, 116, 114, 97, 105, 108,
+ 101, 114, 115, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100,
+ 101, 120, 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112,
+ 115, 50, 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48,
+ 48, 52, 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99,
+ 104, 97, 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102,
+ 108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103,
+ 117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103,
+ 101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45,
+ 99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111,
+ 114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117,
+ 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104,
+ 101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110,
+ 116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111,
+ 110, 116, 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99,
+ 111, 110, 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111,
+ 110, 116, 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99,
+ 111, 110, 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111,
+ 107, 105, 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101,
+ 99, 116, 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 104, 111,
+ 115, 116, 105, 102, 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, 111,
+ 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, 45,
+ 110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, 97,
+ 110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, 101,
+ 100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, 100,
+ 105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105,
+ 111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112,
+ 114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97,
+ 116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105,
+ 122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101,
+ 114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121,
+ 45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116,
+ 45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116,
+ 114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105,
+ 116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111,
+ 100, 105, 110, 103, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, 118,
+ 97, 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101,
+ 110, 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116,
+ 121, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114,
+ 112, 99, 103, 114, 112, 99, 80, 85, 84, 108, 98, 45, 99, 111, 115,
+ 116, 45, 98, 105, 110, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100,
+ 101, 102, 108, 97, 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44,
+ 103, 122, 105, 112, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105,
+ 112, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97,
+ 116, 101, 44, 103, 122, 105, 112};
+
+grpc_slice_refcount StaticSliceRefcount::kStaticSubRefcount;
+
+StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] =
+ {
+
+ StaticSliceRefcount(0), StaticSliceRefcount(1),
+ StaticSliceRefcount(2), StaticSliceRefcount(3),
+ StaticSliceRefcount(4), StaticSliceRefcount(5),
+ StaticSliceRefcount(6), StaticSliceRefcount(7),
+ StaticSliceRefcount(8), StaticSliceRefcount(9),
+ StaticSliceRefcount(10), StaticSliceRefcount(11),
+ StaticSliceRefcount(12), StaticSliceRefcount(13),
+ StaticSliceRefcount(14), StaticSliceRefcount(15),
+ StaticSliceRefcount(16), StaticSliceRefcount(17),
+ StaticSliceRefcount(18), StaticSliceRefcount(19),
+ StaticSliceRefcount(20), StaticSliceRefcount(21),
+ StaticSliceRefcount(22), StaticSliceRefcount(23),
+ StaticSliceRefcount(24), StaticSliceRefcount(25),
+ StaticSliceRefcount(26), StaticSliceRefcount(27),
+ StaticSliceRefcount(28), StaticSliceRefcount(29),
+ StaticSliceRefcount(30), StaticSliceRefcount(31),
+ StaticSliceRefcount(32), StaticSliceRefcount(33),
+ StaticSliceRefcount(34), StaticSliceRefcount(35),
+ StaticSliceRefcount(36), StaticSliceRefcount(37),
+ StaticSliceRefcount(38), StaticSliceRefcount(39),
+ StaticSliceRefcount(40), StaticSliceRefcount(41),
+ StaticSliceRefcount(42), StaticSliceRefcount(43),
+ StaticSliceRefcount(44), StaticSliceRefcount(45),
+ StaticSliceRefcount(46), StaticSliceRefcount(47),
+ StaticSliceRefcount(48), StaticSliceRefcount(49),
+ StaticSliceRefcount(50), StaticSliceRefcount(51),
+ StaticSliceRefcount(52), StaticSliceRefcount(53),
+ StaticSliceRefcount(54), StaticSliceRefcount(55),
+ StaticSliceRefcount(56), StaticSliceRefcount(57),
+ StaticSliceRefcount(58), StaticSliceRefcount(59),
+ StaticSliceRefcount(60), StaticSliceRefcount(61),
+ StaticSliceRefcount(62), StaticSliceRefcount(63),
+ StaticSliceRefcount(64), StaticSliceRefcount(65),
+ StaticSliceRefcount(66), StaticSliceRefcount(67),
+ StaticSliceRefcount(68), StaticSliceRefcount(69),
+ StaticSliceRefcount(70), StaticSliceRefcount(71),
+ StaticSliceRefcount(72), StaticSliceRefcount(73),
+ StaticSliceRefcount(74), StaticSliceRefcount(75),
+ StaticSliceRefcount(76), StaticSliceRefcount(77),
+ StaticSliceRefcount(78), StaticSliceRefcount(79),
+ StaticSliceRefcount(80), StaticSliceRefcount(81),
+ StaticSliceRefcount(82), StaticSliceRefcount(83),
+ StaticSliceRefcount(84), StaticSliceRefcount(85),
+ StaticSliceRefcount(86), StaticSliceRefcount(87),
+ StaticSliceRefcount(88), StaticSliceRefcount(89),
+ StaticSliceRefcount(90), StaticSliceRefcount(91),
+ StaticSliceRefcount(92), StaticSliceRefcount(93),
+ StaticSliceRefcount(94), StaticSliceRefcount(95),
+ StaticSliceRefcount(96), StaticSliceRefcount(97),
+ StaticSliceRefcount(98),
+};
+
+const StaticMetadataSlice
+ g_static_metadata_slice_table[GRPC_STATIC_MDSTR_COUNT] = {
+
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
+ g_static_metadata_bytes + 0),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
+ g_static_metadata_bytes + 5),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10,
+ g_static_metadata_bytes + 19),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
+ g_static_metadata_bytes + 29),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
+ g_static_metadata_bytes + 36),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
+ g_static_metadata_bytes + 47),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
+ g_static_metadata_bytes + 80),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
+ g_static_metadata_bytes + 92),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[11].base, 30,
+ g_static_metadata_bytes + 123),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[12].base, 26,
+ g_static_metadata_bytes + 153),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 22,
+ g_static_metadata_bytes + 179),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 12,
+ g_static_metadata_bytes + 201),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 1,
+ g_static_metadata_bytes + 213),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 1,
+ g_static_metadata_bytes + 214),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 1,
+ g_static_metadata_bytes + 215),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 1,
+ g_static_metadata_bytes + 216),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[20].base, 36,
+ g_static_metadata_bytes + 217),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[21].base, 65,
+ g_static_metadata_bytes + 253),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 65,
+ g_static_metadata_bytes + 318),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 28,
+ g_static_metadata_bytes + 383),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 80,
+ g_static_metadata_bytes + 411),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 80,
+ g_static_metadata_bytes + 491),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
+ g_static_metadata_bytes + 571),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
+ g_static_metadata_bytes + 578),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 11,
+ g_static_metadata_bytes + 582),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[29].base, 2,
+ g_static_metadata_bytes + 593),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[30].base, 8,
+ g_static_metadata_bytes + 595),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 3,
+ g_static_metadata_bytes + 603),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 4,
+ g_static_metadata_bytes + 606),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 1,
+ g_static_metadata_bytes + 610),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 11,
+ g_static_metadata_bytes + 611),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
+ g_static_metadata_bytes + 622),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 5,
+ g_static_metadata_bytes + 626),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 3,
+ g_static_metadata_bytes + 631),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 3,
+ g_static_metadata_bytes + 634),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 3,
+ g_static_metadata_bytes + 637),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 3,
+ g_static_metadata_bytes + 640),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 3,
+ g_static_metadata_bytes + 643),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 3,
+ g_static_metadata_bytes + 646),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 3,
+ g_static_metadata_bytes + 649),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 14,
+ g_static_metadata_bytes + 652),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 13,
+ g_static_metadata_bytes + 666),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 15,
+ g_static_metadata_bytes + 679),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 13,
+ g_static_metadata_bytes + 694),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 6,
+ g_static_metadata_bytes + 707),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 27,
+ g_static_metadata_bytes + 713),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
+ g_static_metadata_bytes + 740),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 5,
+ g_static_metadata_bytes + 743),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 13,
+ g_static_metadata_bytes + 748),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 13,
+ g_static_metadata_bytes + 761),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 19,
+ g_static_metadata_bytes + 774),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 16,
+ g_static_metadata_bytes + 793),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 14,
+ g_static_metadata_bytes + 809),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 16,
+ g_static_metadata_bytes + 823),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
+ g_static_metadata_bytes + 839),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 6,
+ g_static_metadata_bytes + 852),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 4,
+ g_static_metadata_bytes + 858),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 4,
+ g_static_metadata_bytes + 862),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 6,
+ g_static_metadata_bytes + 866),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 7,
+ g_static_metadata_bytes + 872),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 4,
+ g_static_metadata_bytes + 879),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 4,
+ g_static_metadata_bytes + 883),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 8,
+ g_static_metadata_bytes + 887),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 17,
+ g_static_metadata_bytes + 895),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 13,
+ g_static_metadata_bytes + 912),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 8,
+ g_static_metadata_bytes + 925),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 19,
+ g_static_metadata_bytes + 933),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
+ g_static_metadata_bytes + 952),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 4,
+ g_static_metadata_bytes + 965),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 8,
+ g_static_metadata_bytes + 969),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 12,
+ g_static_metadata_bytes + 977),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 18,
+ g_static_metadata_bytes + 989),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 19,
+ g_static_metadata_bytes + 1007),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 5,
+ g_static_metadata_bytes + 1026),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 7,
+ g_static_metadata_bytes + 1031),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 7,
+ g_static_metadata_bytes + 1038),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 11,
+ g_static_metadata_bytes + 1045),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 6,
+ g_static_metadata_bytes + 1056),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 10,
+ g_static_metadata_bytes + 1062),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 25,
+ g_static_metadata_bytes + 1072),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 17,
+ g_static_metadata_bytes + 1097),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 10,
+ g_static_metadata_bytes + 1114),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 4,
+ g_static_metadata_bytes + 1124),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 3,
+ g_static_metadata_bytes + 1128),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 16,
+ g_static_metadata_bytes + 1131),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 1,
+ g_static_metadata_bytes + 1147),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
+ g_static_metadata_bytes + 1148),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 16,
+ g_static_metadata_bytes + 1156),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 4,
+ g_static_metadata_bytes + 1172),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 3,
+ g_static_metadata_bytes + 1176),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 11,
+ g_static_metadata_bytes + 1179),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 16,
+ g_static_metadata_bytes + 1190),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
+ g_static_metadata_bytes + 1206),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 12,
+ g_static_metadata_bytes + 1219),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 21,
+ g_static_metadata_bytes + 1231),
+};
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/slice/static_slice.h b/contrib/libs/grpc/src/core/lib/slice/static_slice.h
new file mode 100644
index 00000000000..267b7aba96d
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/slice/static_slice.h
@@ -0,0 +1,300 @@
+/*
+ * Copyright 2015 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * WARNING: Auto-generated code.
+ *
+ * To make changes to this file, change
+ * tools/codegen/core/gen_static_metadata.py, and then re-run it.
+ *
+ * See metadata.h for an explanation of the interface here, and metadata.cc for
+ * an explanation of what's going on.
+ */
+
+#ifndef GRPC_CORE_LIB_SLICE_STATIC_SLICE_H
+#define GRPC_CORE_LIB_SLICE_STATIC_SLICE_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+#include <type_traits>
+
+#include "src/core/lib/slice/slice_refcount_base.h"
+#include "src/core/lib/slice/slice_utils.h"
+
+static_assert(
+ std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
+ "StaticMetadataSlice must be trivially destructible.");
+#define GRPC_STATIC_MDSTR_COUNT 99
+/* ":path" */
+#define GRPC_MDSTR_PATH (::grpc_core::g_static_metadata_slice_table[0])
+/* ":method" */
+#define GRPC_MDSTR_METHOD (::grpc_core::g_static_metadata_slice_table[1])
+/* ":status" */
+#define GRPC_MDSTR_STATUS (::grpc_core::g_static_metadata_slice_table[2])
+/* ":authority" */
+#define GRPC_MDSTR_AUTHORITY (::grpc_core::g_static_metadata_slice_table[3])
+/* ":scheme" */
+#define GRPC_MDSTR_SCHEME (::grpc_core::g_static_metadata_slice_table[4])
+/* "grpc-status" */
+#define GRPC_MDSTR_GRPC_STATUS (::grpc_core::g_static_metadata_slice_table[5])
+/* "grpc-encoding" */
+#define GRPC_MDSTR_GRPC_ENCODING (::grpc_core::g_static_metadata_slice_table[6])
+/* "grpc-accept-encoding" */
+#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING \
+ (::grpc_core::g_static_metadata_slice_table[7])
+/* "content-type" */
+#define GRPC_MDSTR_CONTENT_TYPE (::grpc_core::g_static_metadata_slice_table[8])
+/* "content-encoding" */
+#define GRPC_MDSTR_CONTENT_ENCODING \
+ (::grpc_core::g_static_metadata_slice_table[9])
+/* "accept-encoding" */
+#define GRPC_MDSTR_ACCEPT_ENCODING \
+ (::grpc_core::g_static_metadata_slice_table[10])
+/* "grpc-internal-encoding-request" */
+#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
+ (::grpc_core::g_static_metadata_slice_table[11])
+/* "grpc-previous-rpc-attempts" */
+#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS \
+ (::grpc_core::g_static_metadata_slice_table[12])
+/* "grpc-retry-pushback-ms" */
+#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS \
+ (::grpc_core::g_static_metadata_slice_table[13])
+/* "grpc-timeout" */
+#define GRPC_MDSTR_GRPC_TIMEOUT (::grpc_core::g_static_metadata_slice_table[14])
+/* "1" */
+#define GRPC_MDSTR_1 (::grpc_core::g_static_metadata_slice_table[15])
+/* "2" */
+#define GRPC_MDSTR_2 (::grpc_core::g_static_metadata_slice_table[16])
+/* "3" */
+#define GRPC_MDSTR_3 (::grpc_core::g_static_metadata_slice_table[17])
+/* "4" */
+#define GRPC_MDSTR_4 (::grpc_core::g_static_metadata_slice_table[18])
+/* "" */
+#define GRPC_MDSTR_EMPTY (::grpc_core::g_static_metadata_slice_table[19])
+/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
+#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
+ (::grpc_core::g_static_metadata_slice_table[20])
+/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
+ (::grpc_core::g_static_metadata_slice_table[21])
+/* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
+ (::grpc_core::g_static_metadata_slice_table[22])
+/* "/grpc.health.v1.Health/Watch" */
+#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
+ (::grpc_core::g_static_metadata_slice_table[23])
+/* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
+ */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
+ (::grpc_core::g_static_metadata_slice_table[24])
+/* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
+ */
+#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
+ (::grpc_core::g_static_metadata_slice_table[25])
+/* "deflate" */
+#define GRPC_MDSTR_DEFLATE (::grpc_core::g_static_metadata_slice_table[26])
+/* "gzip" */
+#define GRPC_MDSTR_GZIP (::grpc_core::g_static_metadata_slice_table[27])
+/* "stream/gzip" */
+#define GRPC_MDSTR_STREAM_SLASH_GZIP \
+ (::grpc_core::g_static_metadata_slice_table[28])
+/* "te" */
+#define GRPC_MDSTR_TE (::grpc_core::g_static_metadata_slice_table[29])
+/* "trailers" */
+#define GRPC_MDSTR_TRAILERS (::grpc_core::g_static_metadata_slice_table[30])
+/* "GET" */
+#define GRPC_MDSTR_GET (::grpc_core::g_static_metadata_slice_table[31])
+/* "POST" */
+#define GRPC_MDSTR_POST (::grpc_core::g_static_metadata_slice_table[32])
+/* "/" */
+#define GRPC_MDSTR_SLASH (::grpc_core::g_static_metadata_slice_table[33])
+/* "/index.html" */
+#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML \
+ (::grpc_core::g_static_metadata_slice_table[34])
+/* "http" */
+#define GRPC_MDSTR_HTTP (::grpc_core::g_static_metadata_slice_table[35])
+/* "https" */
+#define GRPC_MDSTR_HTTPS (::grpc_core::g_static_metadata_slice_table[36])
+/* "200" */
+#define GRPC_MDSTR_200 (::grpc_core::g_static_metadata_slice_table[37])
+/* "204" */
+#define GRPC_MDSTR_204 (::grpc_core::g_static_metadata_slice_table[38])
+/* "206" */
+#define GRPC_MDSTR_206 (::grpc_core::g_static_metadata_slice_table[39])
+/* "304" */
+#define GRPC_MDSTR_304 (::grpc_core::g_static_metadata_slice_table[40])
+/* "400" */
+#define GRPC_MDSTR_400 (::grpc_core::g_static_metadata_slice_table[41])
+/* "404" */
+#define GRPC_MDSTR_404 (::grpc_core::g_static_metadata_slice_table[42])
+/* "500" */
+#define GRPC_MDSTR_500 (::grpc_core::g_static_metadata_slice_table[43])
+/* "accept-charset" */
+#define GRPC_MDSTR_ACCEPT_CHARSET \
+ (::grpc_core::g_static_metadata_slice_table[44])
+/* "gzip, deflate" */
+#define GRPC_MDSTR_GZIP_COMMA_DEFLATE \
+ (::grpc_core::g_static_metadata_slice_table[45])
+/* "accept-language" */
+#define GRPC_MDSTR_ACCEPT_LANGUAGE \
+ (::grpc_core::g_static_metadata_slice_table[46])
+/* "accept-ranges" */
+#define GRPC_MDSTR_ACCEPT_RANGES \
+ (::grpc_core::g_static_metadata_slice_table[47])
+/* "accept" */
+#define GRPC_MDSTR_ACCEPT (::grpc_core::g_static_metadata_slice_table[48])
+/* "access-control-allow-origin" */
+#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN \
+ (::grpc_core::g_static_metadata_slice_table[49])
+/* "age" */
+#define GRPC_MDSTR_AGE (::grpc_core::g_static_metadata_slice_table[50])
+/* "allow" */
+#define GRPC_MDSTR_ALLOW (::grpc_core::g_static_metadata_slice_table[51])
+/* "authorization" */
+#define GRPC_MDSTR_AUTHORIZATION \
+ (::grpc_core::g_static_metadata_slice_table[52])
+/* "cache-control" */
+#define GRPC_MDSTR_CACHE_CONTROL \
+ (::grpc_core::g_static_metadata_slice_table[53])
+/* "content-disposition" */
+#define GRPC_MDSTR_CONTENT_DISPOSITION \
+ (::grpc_core::g_static_metadata_slice_table[54])
+/* "content-language" */
+#define GRPC_MDSTR_CONTENT_LANGUAGE \
+ (::grpc_core::g_static_metadata_slice_table[55])
+/* "content-length" */
+#define GRPC_MDSTR_CONTENT_LENGTH \
+ (::grpc_core::g_static_metadata_slice_table[56])
+/* "content-location" */
+#define GRPC_MDSTR_CONTENT_LOCATION \
+ (::grpc_core::g_static_metadata_slice_table[57])
+/* "content-range" */
+#define GRPC_MDSTR_CONTENT_RANGE \
+ (::grpc_core::g_static_metadata_slice_table[58])
+/* "cookie" */
+#define GRPC_MDSTR_COOKIE (::grpc_core::g_static_metadata_slice_table[59])
+/* "date" */
+#define GRPC_MDSTR_DATE (::grpc_core::g_static_metadata_slice_table[60])
+/* "etag" */
+#define GRPC_MDSTR_ETAG (::grpc_core::g_static_metadata_slice_table[61])
+/* "expect" */
+#define GRPC_MDSTR_EXPECT (::grpc_core::g_static_metadata_slice_table[62])
+/* "expires" */
+#define GRPC_MDSTR_EXPIRES (::grpc_core::g_static_metadata_slice_table[63])
+/* "from" */
+#define GRPC_MDSTR_FROM (::grpc_core::g_static_metadata_slice_table[64])
+/* "host" */
+#define GRPC_MDSTR_HOST (::grpc_core::g_static_metadata_slice_table[65])
+/* "if-match" */
+#define GRPC_MDSTR_IF_MATCH (::grpc_core::g_static_metadata_slice_table[66])
+/* "if-modified-since" */
+#define GRPC_MDSTR_IF_MODIFIED_SINCE \
+ (::grpc_core::g_static_metadata_slice_table[67])
+/* "if-none-match" */
+#define GRPC_MDSTR_IF_NONE_MATCH \
+ (::grpc_core::g_static_metadata_slice_table[68])
+/* "if-range" */
+#define GRPC_MDSTR_IF_RANGE (::grpc_core::g_static_metadata_slice_table[69])
+/* "if-unmodified-since" */
+#define GRPC_MDSTR_IF_UNMODIFIED_SINCE \
+ (::grpc_core::g_static_metadata_slice_table[70])
+/* "last-modified" */
+#define GRPC_MDSTR_LAST_MODIFIED \
+ (::grpc_core::g_static_metadata_slice_table[71])
+/* "link" */
+#define GRPC_MDSTR_LINK (::grpc_core::g_static_metadata_slice_table[72])
+/* "location" */
+#define GRPC_MDSTR_LOCATION (::grpc_core::g_static_metadata_slice_table[73])
+/* "max-forwards" */
+#define GRPC_MDSTR_MAX_FORWARDS (::grpc_core::g_static_metadata_slice_table[74])
+/* "proxy-authenticate" */
+#define GRPC_MDSTR_PROXY_AUTHENTICATE \
+ (::grpc_core::g_static_metadata_slice_table[75])
+/* "proxy-authorization" */
+#define GRPC_MDSTR_PROXY_AUTHORIZATION \
+ (::grpc_core::g_static_metadata_slice_table[76])
+/* "range" */
+#define GRPC_MDSTR_RANGE (::grpc_core::g_static_metadata_slice_table[77])
+/* "referer" */
+#define GRPC_MDSTR_REFERER (::grpc_core::g_static_metadata_slice_table[78])
+/* "refresh" */
+#define GRPC_MDSTR_REFRESH (::grpc_core::g_static_metadata_slice_table[79])
+/* "retry-after" */
+#define GRPC_MDSTR_RETRY_AFTER (::grpc_core::g_static_metadata_slice_table[80])
+/* "server" */
+#define GRPC_MDSTR_SERVER (::grpc_core::g_static_metadata_slice_table[81])
+/* "set-cookie" */
+#define GRPC_MDSTR_SET_COOKIE (::grpc_core::g_static_metadata_slice_table[82])
+/* "strict-transport-security" */
+#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY \
+ (::grpc_core::g_static_metadata_slice_table[83])
+/* "transfer-encoding" */
+#define GRPC_MDSTR_TRANSFER_ENCODING \
+ (::grpc_core::g_static_metadata_slice_table[84])
+/* "user-agent" */
+#define GRPC_MDSTR_USER_AGENT (::grpc_core::g_static_metadata_slice_table[85])
+/* "vary" */
+#define GRPC_MDSTR_VARY (::grpc_core::g_static_metadata_slice_table[86])
+/* "via" */
+#define GRPC_MDSTR_VIA (::grpc_core::g_static_metadata_slice_table[87])
+/* "www-authenticate" */
+#define GRPC_MDSTR_WWW_AUTHENTICATE \
+ (::grpc_core::g_static_metadata_slice_table[88])
+/* "0" */
+#define GRPC_MDSTR_0 (::grpc_core::g_static_metadata_slice_table[89])
+/* "identity" */
+#define GRPC_MDSTR_IDENTITY (::grpc_core::g_static_metadata_slice_table[90])
+/* "application/grpc" */
+#define GRPC_MDSTR_APPLICATION_SLASH_GRPC \
+ (::grpc_core::g_static_metadata_slice_table[91])
+/* "grpc" */
+#define GRPC_MDSTR_GRPC (::grpc_core::g_static_metadata_slice_table[92])
+/* "PUT" */
+#define GRPC_MDSTR_PUT (::grpc_core::g_static_metadata_slice_table[93])
+/* "lb-cost-bin" */
+#define GRPC_MDSTR_LB_COST_BIN (::grpc_core::g_static_metadata_slice_table[94])
+/* "identity,deflate" */
+#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE \
+ (::grpc_core::g_static_metadata_slice_table[95])
+/* "identity,gzip" */
+#define GRPC_MDSTR_IDENTITY_COMMA_GZIP \
+ (::grpc_core::g_static_metadata_slice_table[96])
+/* "deflate,gzip" */
+#define GRPC_MDSTR_DEFLATE_COMMA_GZIP \
+ (::grpc_core::g_static_metadata_slice_table[97])
+/* "identity,deflate,gzip" */
+#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
+ (::grpc_core::g_static_metadata_slice_table[98])
+
+namespace grpc_core {
+extern StaticSliceRefcount
+ g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT];
+extern const StaticMetadataSlice
+ g_static_metadata_slice_table[GRPC_STATIC_MDSTR_COUNT];
+extern const uint8_t g_static_metadata_bytes[];
+} // namespace grpc_core
+
+#define GRPC_IS_STATIC_METADATA_STRING(slice) \
+ ((slice).refcount != NULL && \
+ (slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC)
+
+#define GRPC_STATIC_METADATA_INDEX(static_slice) \
+ (reinterpret_cast<::grpc_core::StaticSliceRefcount*>( \
+ (static_slice).refcount) \
+ ->index)
+
+#endif /* GRPC_CORE_LIB_SLICE_STATIC_SLICE_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/api_trace.cc b/contrib/libs/grpc/src/core/lib/surface/api_trace.cc
index bab5a7910c0..c40b9e1beb2 100644
--- a/contrib/libs/grpc/src/core/lib/surface/api_trace.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/api_trace.cc
@@ -18,7 +18,8 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/debug/trace.h"
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/debug/trace.h"
+
grpc_core::TraceFlag grpc_api_trace(false, "api");
diff --git a/contrib/libs/grpc/src/core/lib/surface/api_trace.h b/contrib/libs/grpc/src/core/lib/surface/api_trace.h
index 51d1f522230..a7981d14bbc 100644
--- a/contrib/libs/grpc/src/core/lib/surface/api_trace.h
+++ b/contrib/libs/grpc/src/core/lib/surface/api_trace.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/debug/trace.h"
extern grpc_core::TraceFlag grpc_api_trace;
diff --git a/contrib/libs/grpc/src/core/lib/surface/builtins.cc b/contrib/libs/grpc/src/core/lib/surface/builtins.cc
new file mode 100644
index 00000000000..dbd9cd1f3fe
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/surface/builtins.cc
@@ -0,0 +1,49 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/surface/builtins.h"
+
+#include "src/core/lib/channel/connected_channel.h"
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/lame_client.h"
+#include "src/core/lib/surface/server.h"
+
+namespace grpc_core {
+
+void RegisterBuiltins(CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL,
+ GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ grpc_add_connected_filter);
+ builder->channel_init()->RegisterStage(
+ GRPC_CLIENT_LAME_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
+ [](grpc_channel_stack_builder* builder) {
+ return grpc_channel_stack_builder_append_filter(
+ builder, &grpc_lame_filter, nullptr, nullptr);
+ });
+ builder->channel_init()->RegisterStage(
+ GRPC_SERVER_CHANNEL, INT_MAX, [](grpc_channel_stack_builder* builder) {
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &Server::kServerTopFilter, nullptr, nullptr);
+ });
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/surface/builtins.h b/contrib/libs/grpc/src/core/lib/surface/builtins.h
new file mode 100644
index 00000000000..c177f02b018
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/surface/builtins.h
@@ -0,0 +1,26 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_SURFACE_BUILTINS_H
+#define GRPC_CORE_LIB_SURFACE_BUILTINS_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/config/core_configuration.h"
+
+namespace grpc_core {
+void RegisterBuiltins(CoreConfiguration::Builder* builder);
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_SURFACE_BUILTINS_H
diff --git a/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc b/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
index 3689c79455e..207aaef8f1f 100644
--- a/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/byte_buffer_reader.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/byte_buffer_reader.h>
#include <string.h>
#include <grpc/byte_buffer.h>
+#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
diff --git a/contrib/libs/grpc/src/core/lib/surface/call.cc b/contrib/libs/grpc/src/core/lib/surface/call.cc
index 037e3585574..a2293df77c6 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/call.cc
@@ -18,6 +18,8 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/surface/call.h"
+
#include <assert.h>
#include <limits.h>
#include <stdio.h>
@@ -48,10 +50,10 @@
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/slice/slice_split.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/slice/slice_utils.h"
#include "src/core/lib/surface/api_trace.h"
-#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/call_test_only.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
@@ -107,13 +109,13 @@ struct batch_control {
} completion_data;
grpc_closure start_batch;
grpc_closure finish_batch;
- grpc_core::Atomic<intptr_t> steps_to_complete;
- gpr_atm batch_error = reinterpret_cast<gpr_atm>(GRPC_ERROR_NONE);
+ std::atomic<intptr_t> steps_to_complete{0};
+ AtomicError batch_error;
void set_num_steps_to_complete(uintptr_t steps) {
- steps_to_complete.Store(steps, grpc_core::MemoryOrder::RELEASE);
+ steps_to_complete.store(steps, std::memory_order_release);
}
bool completed_batch_step() {
- return steps_to_complete.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1;
+ return steps_to_complete.fetch_sub(1, std::memory_order_acq_rel) == 1;
}
};
@@ -144,15 +146,14 @@ struct grpc_call {
cq(args.cq),
channel(args.channel),
is_client(args.server_transport_data == nullptr),
- stream_op_payload(context) {
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 2; j++) {
- metadata_batch[i][j].deadline = GRPC_MILLIS_INF_FUTURE;
- }
- }
- }
+ stream_op_payload(context) {}
~grpc_call() {
+ for (int i = 0; i < GRPC_CONTEXT_COUNT; ++i) {
+ if (context[i].destroy) {
+ context[i].destroy(context[i].value);
+ }
+ }
gpr_free(static_cast<void*>(const_cast<char*>(final_info.error_string)));
}
@@ -172,6 +173,8 @@ struct grpc_call {
bool destroy_called = false;
/** flag indicating that cancellation is inherited */
bool cancellation_is_inherited = false;
+ // Trailers-only response status
+ bool is_trailers_only = false;
/** which ops are in-flight */
bool sent_initial_metadata = false;
bool sending_message = false;
@@ -186,7 +189,10 @@ struct grpc_call {
grpc_transport_stream_op_batch_payload stream_op_payload;
/* first idx: is_receiving, second idx: is_trailing */
- grpc_metadata_batch metadata_batch[2][2] = {};
+ grpc_metadata_batch send_initial_metadata{arena};
+ grpc_metadata_batch send_trailing_metadata{arena};
+ grpc_metadata_batch recv_initial_metadata{arena};
+ grpc_metadata_batch recv_trailing_metadata{arena};
/* Buffered read metadata waiting to be returned to the application.
Element 0 is initial metadata, element 1 is trailing metadata. */
@@ -225,6 +231,7 @@ struct grpc_call {
grpc_core::ManualConstructor<grpc_core::SliceBufferByteStream> sending_stream;
grpc_core::OrphanablePtr<grpc_core::ByteStream> receiving_stream;
+ bool call_failed_before_recv_message = false;
grpc_byte_buffer** receiving_buffer = nullptr;
grpc_slice receiving_slice = grpc_empty_slice();
grpc_closure receiving_slice_ready;
@@ -250,7 +257,7 @@ struct grpc_call {
grpc_core::Server* core_server;
} server;
} final_op;
- gpr_atm status_error = 0;
+ AtomicError status_error;
/* recv_state can contain one of the following values:
RECV_NONE : : no initial metadata and messages received
@@ -292,14 +299,15 @@ static void execute_batch(grpc_call* call,
static void cancel_with_status(grpc_call* c, grpc_status_code status,
const char* description);
-static void cancel_with_error(grpc_call* c, grpc_error* error);
-static void destroy_call(void* call_stack, grpc_error* error);
-static void receiving_slice_ready(void* bctlp, grpc_error* error);
-static void set_final_status(grpc_call* call, grpc_error* error);
+static void cancel_with_error(grpc_call* c, grpc_error_handle error);
+static void destroy_call(void* call_stack, grpc_error_handle error);
+static void receiving_slice_ready(void* bctlp, grpc_error_handle error);
+static void set_final_status(grpc_call* call, grpc_error_handle error);
static void process_data_after_md(batch_control* bctl);
static void post_batch_completion(batch_control* bctl);
-static void add_init_error(grpc_error** composite, grpc_error* new_err) {
+static void add_init_error(grpc_error_handle* composite,
+ grpc_error_handle new_err) {
if (new_err == GRPC_ERROR_NONE) return;
if (*composite == GRPC_ERROR_NONE) {
*composite = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Call creation failed");
@@ -337,15 +345,15 @@ size_t grpc_call_get_initial_size_estimate() {
sizeof(grpc_linked_mdelem) * ESTIMATED_MDELEM_COUNT;
}
-grpc_error* grpc_call_create(const grpc_call_create_args* args,
- grpc_call** out_call) {
+grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
+ grpc_call** out_call) {
GPR_TIMER_SCOPE("grpc_call_create", 0);
GRPC_CHANNEL_INTERNAL_REF(args->channel, "call");
grpc_core::Arena* arena;
grpc_call* call;
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_channel_stack* channel_stack =
grpc_channel_get_channel_stack(args->channel);
size_t initial_size = grpc_channel_get_call_size_estimate(args->channel);
@@ -399,7 +407,7 @@ grpc_error* grpc_call_create(const grpc_call_create_args* args,
GPR_ASSERT(!args->parent->is_client);
if (args->propagation_mask & GRPC_PROPAGATE_DEADLINE) {
- send_deadline = GPR_MIN(send_deadline, args->parent->send_deadline);
+ send_deadline = std::min(send_deadline, args->parent->send_deadline);
}
/* for now GRPC_PROPAGATE_TRACING_CONTEXT *MUST* be passed with
* GRPC_PROPAGATE_STATS_CONTEXT */
@@ -526,7 +534,7 @@ void grpc_call_internal_unref(grpc_call* c REF_ARG) {
GRPC_CALL_STACK_UNREF(CALL_STACK_FROM_CALL(c), REF_REASON);
}
-static void release_call(void* call, grpc_error* /*error*/) {
+static void release_call(void* call, grpc_error_handle /*error*/) {
grpc_call* c = static_cast<grpc_call*>(call);
grpc_channel* channel = c->channel;
grpc_core::Arena* arena = c->arena;
@@ -535,38 +543,28 @@ static void release_call(void* call, grpc_error* /*error*/) {
GRPC_CHANNEL_INTERNAL_UNREF(channel, "call");
}
-static void destroy_call(void* call, grpc_error* /*error*/) {
+static void destroy_call(void* call, grpc_error_handle /*error*/) {
GPR_TIMER_SCOPE("destroy_call", 0);
- size_t i;
- int ii;
grpc_call* c = static_cast<grpc_call*>(call);
- for (i = 0; i < 2; i++) {
- grpc_metadata_batch_destroy(
- &c->metadata_batch[1 /* is_receiving */][i /* is_initial */]);
- }
+ c->recv_initial_metadata.Clear();
+ c->recv_trailing_metadata.Clear();
c->receiving_stream.reset();
parent_call* pc = get_parent_call(c);
if (pc != nullptr) {
pc->~parent_call();
}
- for (ii = 0; ii < c->send_extra_metadata_count; ii++) {
- GRPC_MDELEM_UNREF(c->send_extra_metadata[ii].md);
- }
- for (i = 0; i < GRPC_CONTEXT_COUNT; i++) {
- if (c->context[i].destroy) {
- c->context[i].destroy(c->context[i].value);
- }
+ for (int i = 0; i < c->send_extra_metadata_count; i++) {
+ GRPC_MDELEM_UNREF(c->send_extra_metadata[i].md);
}
if (c->cq) {
GRPC_CQ_INTERNAL_UNREF(c->cq, "bind");
}
- grpc_error* status_error =
- reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&c->status_error));
+ grpc_error_handle status_error = c->status_error.get();
grpc_error_get_status(status_error, c->send_deadline,
&c->final_info.final_status, nullptr, nullptr,
&(c->final_info.error_string));
- GRPC_ERROR_UNREF(status_error);
+ c->status_error.set(GRPC_ERROR_NONE);
c->final_info.stats.latency =
gpr_cycle_counter_sub(gpr_get_cycle_counter(), c->start_time);
grpc_call_stack_destroy(CALL_STACK_FROM_CALL(c), &c->final_info,
@@ -612,11 +610,8 @@ void grpc_call_unref(grpc_call* c) {
// Unset the call combiner cancellation closure. This has the
// effect of scheduling the previously set cancellation closure, if
// any, so that it can release any internal references it may be
- // holding to the call stack. Also flush the closures on exec_ctx so that
- // filters that schedule cancel notification closures on exec_ctx do not
- // need to take a ref of the call stack to guarantee closure liveness.
+ // holding to the call stack.
c->call_combiner.SetNotifyOnCancel(nullptr);
- grpc_core::ExecCtx::Get()->Flush();
}
GRPC_CALL_INTERNAL_UNREF(c, "destroy");
}
@@ -632,7 +627,8 @@ grpc_call_error grpc_call_cancel(grpc_call* call, void* reserved) {
// This is called via the call combiner to start sending a batch down
// the filter stack.
-static void execute_batch_in_call_combiner(void* arg, grpc_error* /*ignored*/) {
+static void execute_batch_in_call_combiner(void* arg,
+ grpc_error_handle /*ignored*/) {
GPR_TIMER_SCOPE("execute_batch_in_call_combiner", 0);
grpc_transport_stream_op_batch* batch =
static_cast<grpc_transport_stream_op_batch*>(arg);
@@ -693,7 +689,7 @@ struct cancel_state {
};
// The on_complete callback used when sending a cancel_stream batch down
// the filter stack. Yields the call combiner when the batch is done.
-static void done_termination(void* arg, grpc_error* /*error*/) {
+static void done_termination(void* arg, grpc_error_handle /*error*/) {
cancel_state* state = static_cast<cancel_state*>(arg);
GRPC_CALL_COMBINER_STOP(&state->call->call_combiner,
"on_complete for cancel_stream op");
@@ -701,7 +697,7 @@ static void done_termination(void* arg, grpc_error* /*error*/) {
gpr_free(state);
}
-static void cancel_with_error(grpc_call* c, grpc_error* error) {
+static void cancel_with_error(grpc_call* c, grpc_error_handle error) {
if (!gpr_atm_rel_cas(&c->cancelled_with_error, 0, 1)) {
GRPC_ERROR_UNREF(error);
return;
@@ -727,14 +723,13 @@ void grpc_call_cancel_internal(grpc_call* call) {
cancel_with_error(call, GRPC_ERROR_CANCELLED);
}
-static grpc_error* error_from_status(grpc_status_code status,
- const char* description) {
+static grpc_error_handle error_from_status(grpc_status_code status,
+ const char* description) {
// copying 'description' is needed to ensure the grpc_call_cancel_with_status
// guarantee that can be short-lived.
return grpc_error_set_int(
grpc_error_set_str(GRPC_ERROR_CREATE_FROM_COPIED_STRING(description),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_copied_string(description)),
+ GRPC_ERROR_STR_GRPC_MESSAGE, description),
GRPC_ERROR_INT_GRPC_STATUS, status);
}
@@ -743,19 +738,20 @@ static void cancel_with_status(grpc_call* c, grpc_status_code status,
cancel_with_error(c, error_from_status(status, description));
}
-static void set_final_status(grpc_call* call, grpc_error* error) {
+static void set_final_status(grpc_call* call, grpc_error_handle error) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_call_error_trace)) {
gpr_log(GPR_DEBUG, "set_final_status %s", call->is_client ? "CLI" : "SVR");
- gpr_log(GPR_DEBUG, "%s", grpc_error_string(error));
+ gpr_log(GPR_DEBUG, "%s", grpc_error_std_string(error).c_str());
}
if (call->is_client) {
+ TString status_details;
grpc_error_get_status(error, call->send_deadline,
- call->final_op.client.status,
- call->final_op.client.status_details, nullptr,
- call->final_op.client.error_string);
- // explicitly take a ref
- grpc_slice_ref_internal(*call->final_op.client.status_details);
- gpr_atm_rel_store(&call->status_error, reinterpret_cast<gpr_atm>(error));
+ call->final_op.client.status, &status_details,
+ nullptr, call->final_op.client.error_string);
+ *call->final_op.client.status_details =
+ grpc_slice_from_cpp_string(std::move(status_details));
+ call->status_error.set(error);
+ GRPC_ERROR_UNREF(error);
grpc_core::channelz::ChannelNode* channelz_channel =
grpc_channel_get_channelz_node(call->channel);
if (channelz_channel != nullptr) {
@@ -771,9 +767,7 @@ static void set_final_status(grpc_call* call, grpc_error* error) {
grpc_core::channelz::ServerNode* channelz_node =
call->final_op.server.core_server->channelz_node();
if (channelz_node != nullptr) {
- if (*call->final_op.server.cancelled ||
- reinterpret_cast<grpc_error*>(
- gpr_atm_acq_load(&call->status_error)) != GRPC_ERROR_NONE) {
+ if (*call->final_op.server.cancelled || !call->status_error.ok()) {
channelz_node->RecordCallFailed();
} else {
channelz_node->RecordCallSucceeded();
@@ -847,7 +841,7 @@ static void set_encodings_accepted_by_peer(grpc_call* /*call*/,
grpc_slice_split_without_space(accept_encoding_slice, ",",
&accept_encoding_parts);
- GPR_BITSET(encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
+ grpc_core::SetBit(encodings_accepted_by_peer, GRPC_COMPRESS_NONE);
for (i = 0; i < accept_encoding_parts.count; i++) {
int r;
grpc_slice accept_encoding_entry_slice = accept_encoding_parts.slices[i];
@@ -861,7 +855,7 @@ static void set_encodings_accepted_by_peer(grpc_call* /*call*/,
reinterpret_cast<grpc_stream_compression_algorithm*>(&algorithm));
}
if (r) {
- GPR_BITSET(encodings_accepted_by_peer, algorithm);
+ grpc_core::SetBit(encodings_accepted_by_peer, algorithm);
} else {
char* accept_encoding_entry_str =
grpc_slice_to_c_string(accept_encoding_entry_slice);
@@ -907,13 +901,12 @@ static grpc_metadata* get_md_elem(grpc_metadata* metadata,
static int prepare_application_metadata(grpc_call* call, int count,
grpc_metadata* metadata,
int is_trailing,
- int prepend_extra_metadata,
grpc_metadata* additional_metadata,
int additional_metadata_count) {
int total_count = count + additional_metadata_count;
int i;
- grpc_metadata_batch* batch =
- &call->metadata_batch[0 /* is_receiving */][is_trailing];
+ grpc_metadata_batch* batch = is_trailing ? &call->send_trailing_metadata
+ : &call->send_initial_metadata;
for (i = 0; i < total_count; i++) {
grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
grpc_linked_mdelem* l = linked_from_md(md);
@@ -940,27 +933,15 @@ static int prepare_application_metadata(grpc_call* call, int count,
}
return 0;
}
- if (prepend_extra_metadata) {
- if (call->send_extra_metadata_count == 0) {
- prepend_extra_metadata = 0;
- } else {
- for (i = 0; i < call->send_extra_metadata_count; i++) {
- GRPC_LOG_IF_ERROR("prepare_application_metadata",
- grpc_metadata_batch_link_tail(
- batch, &call->send_extra_metadata[i]));
- }
- }
- }
for (i = 0; i < total_count; i++) {
grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
grpc_linked_mdelem* l = linked_from_md(md);
- grpc_error* error = grpc_metadata_batch_link_tail(batch, l);
+ grpc_error_handle error = batch->LinkTail(l);
if (error != GRPC_ERROR_NONE) {
GRPC_MDELEM_UNREF(l->md);
}
GRPC_LOG_IF_ERROR("prepare_application_metadata", error);
}
- call->send_extra_metadata_count = 0;
return 1;
}
@@ -997,55 +978,82 @@ static grpc_stream_compression_algorithm decode_stream_compression(
return algorithm;
}
+namespace {
+class PublishToAppEncoder {
+ public:
+ explicit PublishToAppEncoder(grpc_metadata_array* dest) : dest_(dest) {}
+
+ void Encode(grpc_mdelem md) { Append(GRPC_MDKEY(md), GRPC_MDVALUE(md)); }
+
+ void Encode(grpc_core::GrpcTimeoutMetadata, grpc_millis) {}
+ void Encode(grpc_core::TeMetadata, grpc_core::TeMetadata::ValueType) {}
+
+ template <typename Which>
+ void Encode(Which, const grpc_core::Slice& value) {
+ const auto key = Which::key();
+ Append(grpc_core::ExternallyManagedSlice(key.data(), key.length()),
+ value.c_slice());
+ }
+
+ private:
+ void Append(grpc_slice key, grpc_slice value) {
+ auto* mdusr = &dest_->metadata[dest_->count++];
+ mdusr->key = key;
+ mdusr->value = value;
+ }
+
+ grpc_metadata_array* const dest_;
+};
+} // namespace
+
static void publish_app_metadata(grpc_call* call, grpc_metadata_batch* b,
int is_trailing) {
- if (b->list.count == 0) return;
+ if (b->count() == 0) return;
if (!call->is_client && is_trailing) return;
if (is_trailing && call->buffered_metadata[1] == nullptr) return;
GPR_TIMER_SCOPE("publish_app_metadata", 0);
grpc_metadata_array* dest;
- grpc_metadata* mdusr;
dest = call->buffered_metadata[is_trailing];
- if (dest->count + b->list.count > dest->capacity) {
+ if (dest->count + b->count() > dest->capacity) {
dest->capacity =
- GPR_MAX(dest->capacity + b->list.count, dest->capacity * 3 / 2);
+ std::max(dest->capacity + b->count(), dest->capacity * 3 / 2);
dest->metadata = static_cast<grpc_metadata*>(
gpr_realloc(dest->metadata, sizeof(grpc_metadata) * dest->capacity));
}
- for (grpc_linked_mdelem* l = b->list.head; l != nullptr; l = l->next) {
- mdusr = &dest->metadata[dest->count++];
- /* we pass back borrowed slices that are valid whilst the call is valid */
- mdusr->key = GRPC_MDKEY(l->md);
- mdusr->value = GRPC_MDVALUE(l->md);
- }
+ PublishToAppEncoder encoder(dest);
+ b->Encode(&encoder);
}
static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) {
- if (b->idx.named.content_encoding != nullptr) {
+ if (b->legacy_index()->named.content_encoding != nullptr) {
GPR_TIMER_SCOPE("incoming_stream_compression_algorithm", 0);
set_incoming_stream_compression_algorithm(
- call, decode_stream_compression(b->idx.named.content_encoding->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_CONTENT_ENCODING);
+ call, decode_stream_compression(
+ b->legacy_index()->named.content_encoding->md));
+ b->Remove(GRPC_BATCH_CONTENT_ENCODING);
}
- if (b->idx.named.grpc_encoding != nullptr) {
+ if (b->legacy_index()->named.grpc_encoding != nullptr) {
GPR_TIMER_SCOPE("incoming_message_compression_algorithm", 0);
set_incoming_message_compression_algorithm(
- call, decode_message_compression(b->idx.named.grpc_encoding->md));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ENCODING);
+ call,
+ decode_message_compression(b->legacy_index()->named.grpc_encoding->md));
+ b->Remove(GRPC_BATCH_GRPC_ENCODING);
}
uint32_t message_encodings_accepted_by_peer = 1u;
uint32_t stream_encodings_accepted_by_peer = 1u;
- if (b->idx.named.grpc_accept_encoding != nullptr) {
+ if (b->legacy_index()->named.grpc_accept_encoding != nullptr) {
GPR_TIMER_SCOPE("encodings_accepted_by_peer", 0);
- set_encodings_accepted_by_peer(call, b->idx.named.grpc_accept_encoding->md,
- &message_encodings_accepted_by_peer, false);
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_ACCEPT_ENCODING);
+ set_encodings_accepted_by_peer(
+ call, b->legacy_index()->named.grpc_accept_encoding->md,
+ &message_encodings_accepted_by_peer, false);
+ b->Remove(GRPC_BATCH_GRPC_ACCEPT_ENCODING);
}
- if (b->idx.named.accept_encoding != nullptr) {
+ if (b->legacy_index()->named.accept_encoding != nullptr) {
GPR_TIMER_SCOPE("stream_encodings_accepted_by_peer", 0);
- set_encodings_accepted_by_peer(call, b->idx.named.accept_encoding->md,
+ set_encodings_accepted_by_peer(call,
+ b->legacy_index()->named.accept_encoding->md,
&stream_encodings_accepted_by_peer, true);
- grpc_metadata_batch_remove(b, GRPC_BATCH_ACCEPT_ENCODING);
+ b->Remove(GRPC_BATCH_ACCEPT_ENCODING);
}
call->encodings_accepted_by_peer =
grpc_compression_bitset_from_message_stream_compression_bitset(
@@ -1055,33 +1063,31 @@ static void recv_initial_filter(grpc_call* call, grpc_metadata_batch* b) {
}
static void recv_trailing_filter(void* args, grpc_metadata_batch* b,
- grpc_error* batch_error) {
+ grpc_error_handle batch_error) {
grpc_call* call = static_cast<grpc_call*>(args);
if (batch_error != GRPC_ERROR_NONE) {
set_final_status(call, batch_error);
- } else if (b->idx.named.grpc_status != nullptr) {
- grpc_status_code status_code =
- grpc_get_status_code_from_metadata(b->idx.named.grpc_status->md);
- grpc_error* error = GRPC_ERROR_NONE;
+ } else if (b->legacy_index()->named.grpc_status != nullptr) {
+ grpc_status_code status_code = grpc_get_status_code_from_metadata(
+ b->legacy_index()->named.grpc_status->md);
+ grpc_error_handle error = GRPC_ERROR_NONE;
if (status_code != GRPC_STATUS_OK) {
char* peer = grpc_call_get_peer(call);
- error = grpc_error_set_int(
- GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("Error received from peer ", peer).c_str()),
- GRPC_ERROR_INT_GRPC_STATUS, static_cast<intptr_t>(status_code));
+ error = grpc_error_set_int(GRPC_ERROR_CREATE_FROM_CPP_STRING(y_absl::StrCat(
+ "Error received from peer ", peer)),
+ GRPC_ERROR_INT_GRPC_STATUS,
+ static_cast<intptr_t>(status_code));
gpr_free(peer);
}
- if (b->idx.named.grpc_message != nullptr) {
- error = grpc_error_set_str(
- error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.grpc_message->md)));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_MESSAGE);
- } else if (error != GRPC_ERROR_NONE) {
+ auto grpc_message = b->Take(grpc_core::GrpcMessageMetadata());
+ if (grpc_message.has_value()) {
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_empty_slice());
+ grpc_message->as_string_view());
+ } else if (error != GRPC_ERROR_NONE) {
+ error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, "");
}
set_final_status(call, GRPC_ERROR_REF(error));
- grpc_metadata_batch_remove(b, GRPC_BATCH_GRPC_STATUS);
+ b->Remove(GRPC_BATCH_GRPC_STATUS);
GRPC_ERROR_UNREF(error);
} else if (!call->is_client) {
set_final_status(call, GRPC_ERROR_NONE);
@@ -1155,6 +1161,7 @@ static batch_control* reuse_or_allocate_batch_control(grpc_call* call,
}
bctl->~batch_control();
bctl->op = {};
+ new (&bctl->batch_error) AtomicError();
} else {
bctl = call->arena->New<batch_control>();
*pslot = bctl;
@@ -1173,21 +1180,16 @@ static void finish_batch_completion(void* user_data,
}
static void reset_batch_errors(batch_control* bctl) {
- GRPC_ERROR_UNREF(
- reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&bctl->batch_error)));
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_NONE));
+ bctl->batch_error.set(GRPC_ERROR_NONE);
}
static void post_batch_completion(batch_control* bctl) {
grpc_call* next_child_call;
grpc_call* call = bctl->call;
- grpc_error* error = GRPC_ERROR_REF(
- reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&bctl->batch_error)));
+ grpc_error_handle error = GRPC_ERROR_REF(bctl->batch_error.get());
if (bctl->op.send_initial_metadata) {
- grpc_metadata_batch_destroy(
- &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]);
+ call->send_initial_metadata.Clear();
}
if (bctl->op.send_message) {
if (bctl->op.payload->send_message.stream_write_closed &&
@@ -1199,8 +1201,7 @@ static void post_batch_completion(batch_control* bctl) {
call->sending_message = false;
}
if (bctl->op.send_trailing_metadata) {
- grpc_metadata_batch_destroy(
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */]);
+ call->send_trailing_metadata.Clear();
}
if (bctl->op.recv_trailing_metadata) {
/* propagate cancellation to any interested children */
@@ -1256,7 +1257,7 @@ static void finish_batch_step(batch_control* bctl) {
}
static void continue_receiving_slices(batch_control* bctl) {
- grpc_error* error;
+ grpc_error_handle error;
grpc_call* call = bctl->call;
for (;;) {
size_t remaining = call->receiving_stream->length() -
@@ -1287,7 +1288,7 @@ static void continue_receiving_slices(batch_control* bctl) {
}
}
-static void receiving_slice_ready(void* bctlp, grpc_error* error) {
+static void receiving_slice_ready(void* bctlp, grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
bool release_error = false;
@@ -1347,15 +1348,13 @@ static void process_data_after_md(batch_control* bctl) {
}
}
-static void receiving_stream_ready(void* bctlp, grpc_error* error) {
+static void receiving_stream_ready(void* bctlp, grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
if (error != GRPC_ERROR_NONE) {
call->receiving_stream.reset();
- if (reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&bctl->batch_error)) ==
- GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+ if (bctl->batch_error.ok()) {
+ bctl->batch_error.set(error);
}
cancel_with_error(call, GRPC_ERROR_REF(error));
}
@@ -1373,7 +1372,7 @@ static void receiving_stream_ready(void* bctlp, grpc_error* error) {
// a recv_message op down the filter stack. Yields the call combiner
// before processing the received message.
static void receiving_stream_ready_in_call_combiner(void* bctlp,
- grpc_error* error) {
+ grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_message_ready");
@@ -1457,8 +1456,8 @@ static void validate_filtered_metadata(batch_control* bctl) {
}
/* GRPC_COMPRESS_NONE is always set. */
GPR_DEBUG_ASSERT(call->encodings_accepted_by_peer != 0);
- if (GPR_UNLIKELY(!GPR_BITGET(call->encodings_accepted_by_peer,
- compression_algorithm))) {
+ if (GPR_UNLIKELY(!grpc_core::GetBit(call->encodings_accepted_by_peer,
+ compression_algorithm))) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_compression_trace)) {
handle_compression_algorithm_not_accepted(call, compression_algorithm);
}
@@ -1466,29 +1465,29 @@ static void validate_filtered_metadata(batch_control* bctl) {
}
}
-static void receiving_initial_metadata_ready(void* bctlp, grpc_error* error) {
+static void receiving_initial_metadata_ready(void* bctlp,
+ grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_initial_metadata_ready");
if (error == GRPC_ERROR_NONE) {
- grpc_metadata_batch* md =
- &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
+ grpc_metadata_batch* md = &call->recv_initial_metadata;
recv_initial_filter(call, md);
/* TODO(ctiller): this could be moved into recv_initial_filter now */
GPR_TIMER_SCOPE("validate_filtered_metadata", 0);
validate_filtered_metadata(bctl);
- if (md->deadline != GRPC_MILLIS_INF_FUTURE && !call->is_client) {
- call->send_deadline = md->deadline;
+ y_absl::optional<grpc_millis> deadline =
+ md->get(grpc_core::GrpcTimeoutMetadata());
+ if (deadline.has_value() && !call->is_client) {
+ call->send_deadline = *deadline;
}
} else {
- if (reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&bctl->batch_error)) ==
- GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+ if (bctl->batch_error.ok()) {
+ bctl->batch_error.set(error);
}
cancel_with_error(call, GRPC_ERROR_REF(error));
}
@@ -1525,24 +1524,22 @@ static void receiving_initial_metadata_ready(void* bctlp, grpc_error* error) {
finish_batch_step(bctl);
}
-static void receiving_trailing_metadata_ready(void* bctlp, grpc_error* error) {
+static void receiving_trailing_metadata_ready(void* bctlp,
+ grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
GRPC_CALL_COMBINER_STOP(&call->call_combiner, "recv_trailing_metadata_ready");
- grpc_metadata_batch* md =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ grpc_metadata_batch* md = &call->recv_trailing_metadata;
recv_trailing_filter(call, md, GRPC_ERROR_REF(error));
finish_batch_step(bctl);
}
-static void finish_batch(void* bctlp, grpc_error* error) {
+static void finish_batch(void* bctlp, grpc_error_handle error) {
batch_control* bctl = static_cast<batch_control*>(bctlp);
grpc_call* call = bctl->call;
GRPC_CALL_COMBINER_STOP(&call->call_combiner, "on_complete");
- if (reinterpret_cast<grpc_error*>(gpr_atm_acq_load(&bctl->batch_error)) ==
- GRPC_ERROR_NONE) {
- gpr_atm_rel_store(&bctl->batch_error,
- reinterpret_cast<gpr_atm>(GRPC_ERROR_REF(error)));
+ if (bctl->batch_error.ok()) {
+ bctl->batch_error.set(error);
}
if (error != GRPC_ERROR_NONE) {
cancel_with_error(call, GRPC_ERROR_REF(error));
@@ -1567,6 +1564,14 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
grpc_call_error error = GRPC_CALL_OK;
grpc_transport_stream_op_batch* stream_op;
grpc_transport_stream_op_batch_payload* stream_op_payload;
+ uint32_t seen_ops = 0;
+
+ for (i = 0; i < nops; i++) {
+ if (seen_ops & (1u << ops[i].op)) {
+ return GRPC_CALL_ERROR_TOO_MANY_OPERATIONS;
+ }
+ seen_ops |= (1u << ops[i].op);
+ }
GRPC_CALL_LOG_BATCH(GPR_INFO, ops, nops);
@@ -1623,7 +1628,6 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
grpc_metadata& compression_md = call->compression_md;
compression_md.key = grpc_empty_slice();
compression_md.value = grpc_empty_slice();
- compression_md.flags = 0;
size_t additional_metadata_count = 0;
grpc_compression_level effective_compression_level =
GRPC_COMPRESS_LEVEL_NONE;
@@ -1659,19 +1663,30 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op->send_initial_metadata = true;
call->sent_initial_metadata = true;
+ if (call->is_client) {
+ // TODO(ctiller): this will turn into explicit Set() calls once we
+ // migrate :path, :authority.
+ for (int i = 0; i < call->send_extra_metadata_count; i++) {
+ GRPC_LOG_IF_ERROR("prepare_client_metadata",
+ call->send_initial_metadata.LinkTail(
+ &call->send_extra_metadata[i]));
+ }
+ call->send_extra_metadata_count = 0;
+ }
if (!prepare_application_metadata(
call, static_cast<int>(op->data.send_initial_metadata.count),
- op->data.send_initial_metadata.metadata, 0, call->is_client,
- &compression_md, static_cast<int>(additional_metadata_count))) {
+ op->data.send_initial_metadata.metadata, 0, &compression_md,
+ static_cast<int>(additional_metadata_count))) {
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
/* TODO(ctiller): just make these the same variable? */
- if (call->is_client) {
- call->metadata_batch[0][0].deadline = call->send_deadline;
+ if (call->is_client && call->send_deadline != GRPC_MILLIS_INF_FUTURE) {
+ call->send_initial_metadata.Set(grpc_core::GrpcTimeoutMetadata(),
+ call->send_deadline);
}
stream_op_payload->send_initial_metadata.send_initial_metadata =
- &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */];
+ &call->send_initial_metadata;
stream_op_payload->send_initial_metadata.send_initial_metadata_flags =
op->flags;
if (call->is_client) {
@@ -1728,7 +1743,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
stream_op->send_trailing_metadata = true;
call->sent_final_op = true;
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ &call->send_trailing_metadata;
has_send_ops = true;
break;
}
@@ -1753,11 +1768,18 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op->send_trailing_metadata = true;
call->sent_final_op = true;
- GPR_ASSERT(call->send_extra_metadata_count == 0);
- call->send_extra_metadata_count = 1;
- call->send_extra_metadata[0].md = grpc_get_reffed_status_elem(
- op->data.send_status_from_server.status);
- grpc_error* status_error =
+
+ if (!prepare_application_metadata(
+ call,
+ static_cast<int>(
+ op->data.send_status_from_server.trailing_metadata_count),
+ op->data.send_status_from_server.trailing_metadata, 1, nullptr,
+ 0)) {
+ error = GRPC_CALL_ERROR_INVALID_METADATA;
+ goto done_with_error;
+ }
+
+ grpc_error_handle status_error =
op->data.send_status_from_server.status == GRPC_STATUS_OK
? GRPC_ERROR_NONE
: grpc_error_set_int(
@@ -1767,38 +1789,28 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
static_cast<intptr_t>(
op->data.send_status_from_server.status));
if (op->data.send_status_from_server.status_details != nullptr) {
- call->send_extra_metadata[1].md = grpc_mdelem_from_slices(
- GRPC_MDSTR_GRPC_MESSAGE,
- grpc_slice_ref_internal(
- *op->data.send_status_from_server.status_details));
- call->send_extra_metadata_count++;
+ call->send_trailing_metadata.Set(
+ grpc_core::GrpcMessageMetadata(),
+ grpc_core::Slice(grpc_slice_copy(
+ *op->data.send_status_from_server.status_details)));
if (status_error != GRPC_ERROR_NONE) {
- char* msg = grpc_slice_to_c_string(
- GRPC_MDVALUE(call->send_extra_metadata[1].md));
- status_error =
- grpc_error_set_str(status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_copied_string(msg));
- gpr_free(msg);
+ status_error = grpc_error_set_str(
+ status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ grpc_core::StringViewFromSlice(
+ *op->data.send_status_from_server.status_details));
}
}
- gpr_atm_rel_store(&call->status_error,
- reinterpret_cast<gpr_atm>(status_error));
- if (!prepare_application_metadata(
- call,
- static_cast<int>(
- op->data.send_status_from_server.trailing_metadata_count),
- op->data.send_status_from_server.trailing_metadata, 1, 1,
- nullptr, 0)) {
- for (int n = 0; n < call->send_extra_metadata_count; n++) {
- GRPC_MDELEM_UNREF(call->send_extra_metadata[n].md);
- }
- call->send_extra_metadata_count = 0;
- error = GRPC_CALL_ERROR_INVALID_METADATA;
- goto done_with_error;
- }
+ call->status_error.set(status_error);
+ GRPC_ERROR_UNREF(status_error);
+
+ GRPC_LOG_IF_ERROR(
+ "set call status",
+ call->send_trailing_metadata.Append(grpc_get_reffed_status_elem(
+ op->data.send_status_from_server.status)));
+
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
- &call->metadata_batch[0 /* is_receiving */][1 /* is_trailing */];
+ &call->send_trailing_metadata;
stream_op_payload->send_trailing_metadata.sent =
&call->sent_server_trailing_metadata;
has_send_ops = true;
@@ -1822,10 +1834,13 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
grpc_schedule_on_exec_ctx);
stream_op->recv_initial_metadata = true;
stream_op_payload->recv_initial_metadata.recv_initial_metadata =
- &call->metadata_batch[1 /* is_receiving */][0 /* is_trailing */];
+ &call->recv_initial_metadata;
stream_op_payload->recv_initial_metadata.recv_initial_metadata_ready =
&call->receiving_initial_metadata_ready;
- if (!call->is_client) {
+ if (call->is_client) {
+ stream_op_payload->recv_initial_metadata.trailing_metadata_available =
+ &call->is_trailers_only;
+ } else {
stream_op_payload->recv_initial_metadata.peer_string =
&call->peer_string;
}
@@ -1846,6 +1861,8 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
stream_op->recv_message = true;
call->receiving_buffer = op->data.recv_message.recv_message;
stream_op_payload->recv_message.recv_message = &call->receiving_stream;
+ stream_op_payload->recv_message.call_failed_before_recv_message =
+ &call->call_failed_before_recv_message;
GRPC_CLOSURE_INIT(&call->receiving_stream_ready,
receiving_stream_ready_in_call_combiner, bctl,
grpc_schedule_on_exec_ctx);
@@ -1878,7 +1895,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
op->data.recv_status_on_client.error_string;
stream_op->recv_trailing_metadata = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ &call->recv_trailing_metadata;
stream_op_payload->recv_trailing_metadata.collect_stats =
&call->final_info.stats.transport_stream_stats;
GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
@@ -1908,7 +1925,7 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
op->data.recv_close_on_server.cancelled;
stream_op->recv_trailing_metadata = true;
stream_op_payload->recv_trailing_metadata.recv_trailing_metadata =
- &call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
+ &call->recv_trailing_metadata;
stream_op_payload->recv_trailing_metadata.collect_stats =
&call->final_info.stats.transport_stream_stats;
GRPC_CLOSURE_INIT(&call->receiving_trailing_metadata_ready,
@@ -1944,15 +1961,18 @@ done_with_error:
/* reverse any mutations that occurred */
if (stream_op->send_initial_metadata) {
call->sent_initial_metadata = false;
- grpc_metadata_batch_clear(&call->metadata_batch[0][0]);
+ call->send_initial_metadata.Clear();
}
if (stream_op->send_message) {
call->sending_message = false;
- call->sending_stream->Orphan();
+ // No need to invoke call->sending_stream->Orphan() explicitly.
+ // stream_op_payload->send_message.send_message.reset() calls Deletor
+ // of call->sending_stream which in-turn invokes the Orphan() method.
+ stream_op_payload->send_message.send_message.reset();
}
if (stream_op->send_trailing_metadata) {
call->sent_final_op = false;
- grpc_metadata_batch_clear(&call->metadata_batch[0][1]);
+ call->send_trailing_metadata.Clear();
}
if (stream_op->recv_initial_metadata) {
call->received_initial_metadata = false;
@@ -2015,6 +2035,16 @@ grpc_compression_algorithm grpc_call_compression_for_level(
return algo;
}
+bool grpc_call_is_trailers_only(const grpc_call* call) {
+ bool result = call->is_trailers_only;
+ GPR_DEBUG_ASSERT(!result || call->recv_initial_metadata.empty());
+ return result;
+}
+
+int grpc_call_failed_before_recv_message(const grpc_call* c) {
+ return c->call_failed_before_recv_message;
+}
+
const char* grpc_call_error_to_string(grpc_call_error error) {
switch (error) {
case GRPC_CALL_ERROR:
diff --git a/contrib/libs/grpc/src/core/lib/surface/call.h b/contrib/libs/grpc/src/core/lib/surface/call.h
index 34d01db9029..e16a6be520e 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call.h
+++ b/contrib/libs/grpc/src/core/lib/surface/call.h
@@ -21,15 +21,15 @@
#include <grpc/support/port_platform.h>
+#include <grpc/grpc.h>
+#include <grpc/impl/codegen/compression_types.h>
+
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/context.h"
#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/server.h"
-#include <grpc/grpc.h>
-#include <grpc/impl/codegen/compression_types.h>
-
typedef void (*grpc_ioreq_completion_func)(grpc_call* call, int success,
void* user_data);
@@ -55,8 +55,8 @@ typedef struct grpc_call_create_args {
/* Create a new call based on \a args.
Regardless of success or failure, always returns a valid new call into *call
*/
-grpc_error* grpc_call_create(const grpc_call_create_args* args,
- grpc_call** call);
+grpc_error_handle grpc_call_create(const grpc_call_create_args* args,
+ grpc_call** call);
void grpc_call_set_completion_queue(grpc_call* call, grpc_completion_queue* cq);
@@ -120,6 +120,11 @@ size_t grpc_call_get_initial_size_estimate();
grpc_compression_algorithm grpc_call_compression_for_level(
grpc_call* call, grpc_compression_level level);
+/* Did this client call receive a trailers-only response */
+/* TODO(markdroth): This is currently available only to the C++ API.
+ Move to surface API if requested by other languages. */
+bool grpc_call_is_trailers_only(const grpc_call* call);
+
extern grpc_core::TraceFlag grpc_call_error_trace;
extern grpc_core::TraceFlag grpc_compression_trace;
diff --git a/contrib/libs/grpc/src/core/lib/surface/call_details.cc b/contrib/libs/grpc/src/core/lib/surface/call_details.cc
index 29c184c26b2..ce73c3a5271 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call_details.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/call_details.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
-#include <string.h>
-
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
diff --git a/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc b/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
index c4f78821ab0..944b15a78c6 100644
--- a/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/call_log_batch.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/call.h"
-
#include <inttypes.h>
#include <vector>
@@ -29,8 +27,10 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
+#include "src/core/lib/surface/call.h"
static void add_metadata(const grpc_metadata* md, size_t count,
std::vector<TString>* b) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel.cc b/contrib/libs/grpc/src/core/lib/surface/channel.cc
index aed4459bb48..d764ce08df2 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/channel.cc
@@ -34,17 +34,17 @@
#include "src/core/lib/channel/channel_trace.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/channel/channelz_registry.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/static_metadata.h"
/** Cache grpc-status: X mdelems for X = 0..NUM_CACHED_STATUS_ELEMS.
@@ -54,28 +54,26 @@
* (OK, Cancelled, Unknown). */
#define NUM_CACHED_STATUS_ELEMS 3
-static void destroy_channel(void* arg, grpc_error* error);
+static void destroy_channel(void* arg, grpc_error_handle error);
grpc_channel* grpc_channel_create_with_builder(
grpc_channel_stack_builder* builder,
- grpc_channel_stack_type channel_stack_type, grpc_error** error) {
+ grpc_channel_stack_type channel_stack_type, grpc_error_handle* error) {
char* target = gpr_strdup(grpc_channel_stack_builder_get_target(builder));
grpc_channel_args* args = grpc_channel_args_copy(
grpc_channel_stack_builder_get_channel_arguments(builder));
- grpc_resource_user* resource_user =
- grpc_channel_stack_builder_get_resource_user(builder);
grpc_channel* channel;
if (channel_stack_type == GRPC_SERVER_CHANNEL) {
GRPC_STATS_INC_SERVER_CHANNELS_CREATED();
} else {
GRPC_STATS_INC_CLIENT_CHANNELS_CREATED();
}
- grpc_error* builder_error = grpc_channel_stack_builder_finish(
+ grpc_error_handle builder_error = grpc_channel_stack_builder_finish(
builder, sizeof(grpc_channel), 1, destroy_channel, nullptr,
reinterpret_cast<void**>(&channel));
if (builder_error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR, "channel stack builder failed: %s",
- grpc_error_string(builder_error));
+ grpc_error_std_string(builder_error).c_str());
GPR_ASSERT(channel == nullptr);
if (error != nullptr) {
*error = builder_error;
@@ -87,7 +85,6 @@ grpc_channel* grpc_channel_create_with_builder(
return nullptr;
}
channel->target = target;
- channel->resource_user = resource_user;
channel->is_client = grpc_channel_stack_type_is_client(channel_stack_type);
channel->registration_table.Init();
@@ -180,7 +177,9 @@ void channelz_node_destroy(void* p) {
static_cast<grpc_core::channelz::ChannelNode*>(p);
node->Unref();
}
-int channelz_node_cmp(void* p1, void* p2) { return GPR_ICMP(p1, p2); }
+int channelz_node_cmp(void* p1, void* p2) {
+ return grpc_core::QsortCompare(p1, p2);
+}
const grpc_arg_pointer_vtable channelz_node_arg_vtable = {
channelz_node_copy, channelz_node_destroy, channelz_node_cmp};
@@ -224,8 +223,7 @@ grpc_channel* grpc_channel_create(const char* target,
const grpc_channel_args* input_args,
grpc_channel_stack_type channel_stack_type,
grpc_transport* optional_transport,
- grpc_resource_user* resource_user,
- grpc_error** error) {
+ grpc_error_handle* error) {
// We need to make sure that grpc_shutdown() does not shut things down
// until after the channel is destroyed. However, the channel may not
// actually be destroyed by the time grpc_channel_destroy() returns,
@@ -259,12 +257,9 @@ grpc_channel* grpc_channel_create(const char* target,
grpc_channel_args_destroy(args);
grpc_channel_stack_builder_set_target(builder, target);
grpc_channel_stack_builder_set_transport(builder, optional_transport);
- grpc_channel_stack_builder_set_resource_user(builder, resource_user);
- if (!grpc_channel_init_create_stack(builder, channel_stack_type)) {
+ if (!grpc_core::CoreConfiguration::Get().channel_init().CreateStack(
+ builder, channel_stack_type)) {
grpc_channel_stack_builder_destroy(builder);
- if (resource_user != nullptr) {
- grpc_resource_user_free(resource_user, GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
grpc_shutdown(); // Since we won't call destroy_channel().
return nullptr;
}
@@ -311,7 +306,7 @@ void grpc_channel_update_call_size_estimate(grpc_channel* channel,
/* size shrank: decrease estimate */
gpr_atm_no_barrier_cas(
&channel->call_size_estimate, static_cast<gpr_atm>(cur),
- static_cast<gpr_atm>(GPR_MIN(cur - 1, (255 * cur + size) / 256)));
+ static_cast<gpr_atm>(std::min(cur - 1, (255 * cur + size) / 256)));
/* if we lose: never mind, something else will likely update soon enough */
}
}
@@ -410,35 +405,19 @@ grpc_call* grpc_channel_create_pollset_set_call(
namespace grpc_core {
RegisteredCall::RegisteredCall(const char* method_arg, const char* host_arg)
- : method(method_arg != nullptr ? method_arg : ""),
- host(host_arg != nullptr ? host_arg : ""),
- path(grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
- authority(!host.empty()
- ? grpc_mdelem_from_slices(
- GRPC_MDSTR_AUTHORITY,
- grpc_core::ExternallyManagedSlice(host.c_str()))
- : GRPC_MDNULL) {}
-
-// TODO(vjpai): Delete copy-constructor when allowed by all supported compilers.
+ : path(method_arg != nullptr && method_arg[0] != 0
+ ? grpc_mdelem_from_slices(
+ GRPC_MDSTR_PATH, grpc_slice_from_copied_string(method_arg))
+ : GRPC_MDNULL),
+ authority(
+ host_arg != nullptr && host_arg[0] != 0
+ ? grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY,
+ grpc_slice_from_copied_string(host_arg))
+ : GRPC_MDNULL) {}
+
RegisteredCall::RegisteredCall(const RegisteredCall& other)
- : RegisteredCall(other.method.c_str(), other.host.c_str()) {}
-
-RegisteredCall::RegisteredCall(RegisteredCall&& other) noexcept
- : method(std::move(other.method)),
- host(std::move(other.host)),
- path(grpc_mdelem_from_slices(
- GRPC_MDSTR_PATH, grpc_core::ExternallyManagedSlice(method.c_str()))),
- authority(!host.empty()
- ? grpc_mdelem_from_slices(
- GRPC_MDSTR_AUTHORITY,
- grpc_core::ExternallyManagedSlice(host.c_str()))
- : GRPC_MDNULL) {
- GRPC_MDELEM_UNREF(other.path);
- GRPC_MDELEM_UNREF(other.authority);
- other.path = GRPC_MDNULL;
- other.authority = GRPC_MDNULL;
-}
+ : path(GRPC_MDELEM_REF(other.path)),
+ authority(GRPC_MDELEM_REF(other.authority)) {}
RegisteredCall::~RegisteredCall() {
GRPC_MDELEM_UNREF(path);
@@ -497,7 +476,7 @@ grpc_call* grpc_channel_create_registered_call(
return call;
}
-static void destroy_channel(void* arg, grpc_error* /*error*/) {
+static void destroy_channel(void* arg, grpc_error_handle /*error*/) {
grpc_channel* channel = static_cast<grpc_channel*>(arg);
if (channel->channelz_node != nullptr) {
channel->channelz_node->AddTraceEvent(
@@ -507,10 +486,6 @@ static void destroy_channel(void* arg, grpc_error* /*error*/) {
}
grpc_channel_stack_destroy(CHANNEL_STACK_FROM_CHANNEL(channel));
channel->registration_table.Destroy();
- if (channel->resource_user != nullptr) {
- grpc_resource_user_free(channel->resource_user,
- GRPC_RESOURCE_QUOTA_CHANNEL_SIZE);
- }
gpr_free(channel->target);
gpr_free(channel);
// See comment in grpc_channel_create() for why we do this.
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel.h b/contrib/libs/grpc/src/core/lib/surface/channel.h
index d2e90ee4f72..dbf59f4afe7 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel.h
+++ b/contrib/libs/grpc/src/core/lib/surface/channel.h
@@ -27,23 +27,27 @@
#include "src/core/lib/channel/channel_stack_builder.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/gprpp/manual_constructor.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/surface/channel_stack_type.h"
#include "src/core/lib/transport/metadata.h"
+/// Creates a grpc_channel.
grpc_channel* grpc_channel_create(const char* target,
const grpc_channel_args* args,
grpc_channel_stack_type channel_stack_type,
grpc_transport* optional_transport,
- grpc_resource_user* resource_user = nullptr,
- grpc_error** error = nullptr);
+ grpc_error_handle* error);
/** The same as grpc_channel_destroy, but doesn't create an ExecCtx, and so
* is safe to use from within core. */
void grpc_channel_destroy_internal(grpc_channel* channel);
+/// Creates a grpc_channel with a builder. See the description of
+/// \a grpc_channel_create for variable definitions.
grpc_channel* grpc_channel_create_with_builder(
grpc_channel_stack_builder* builder,
- grpc_channel_stack_type channel_stack_type, grpc_error** error = nullptr);
+ grpc_channel_stack_type channel_stack_type,
+ grpc_error_handle* error = nullptr);
/** Create a call given a grpc_channel, in order to call \a method.
Progress is tied to activity on \a pollset_set. The returned call object is
@@ -70,27 +74,18 @@ void grpc_channel_update_call_size_estimate(grpc_channel* channel, size_t size);
namespace grpc_core {
struct RegisteredCall {
- // The method and host are kept as part of this struct just to manage their
- // lifetime since they must outlive the mdelem contents.
- TString method;
- TString host;
-
grpc_mdelem path;
grpc_mdelem authority;
explicit RegisteredCall(const char* method_arg, const char* host_arg);
- // TODO(vjpai): delete copy constructor once all supported compilers allow
- // std::map value_type to be MoveConstructible.
RegisteredCall(const RegisteredCall& other);
- RegisteredCall(RegisteredCall&& other) noexcept;
RegisteredCall& operator=(const RegisteredCall&) = delete;
- RegisteredCall& operator=(RegisteredCall&&) = delete;
~RegisteredCall();
};
struct CallRegistrationTable {
- grpc_core::Mutex mu;
+ Mutex mu;
// The map key should be owned strings rather than unowned char*'s to
// guarantee that it outlives calls on the core channel (which may outlast the
// C++ or other wrapped language Channel that registered these calls).
@@ -106,7 +101,6 @@ struct grpc_channel {
grpc_compression_options compression_options;
gpr_atm call_size_estimate;
- grpc_resource_user* resource_user;
// TODO(vjpai): Once the grpc_channel is allocated via new rather than malloc,
// expand the members of the CallRegistrationTable directly into
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel_init.cc b/contrib/libs/grpc/src/core/lib/surface/channel_init.cc
index 17f6c901d1f..beeb23d4b7f 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel_init.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/channel_init.cc
@@ -20,90 +20,37 @@
#include "src/core/lib/surface/channel_init.h"
-#include <grpc/support/alloc.h>
+#include <algorithm>
-typedef struct stage_slot {
- grpc_channel_init_stage fn;
- void* arg;
- int priority;
- size_t insertion_order;
-} stage_slot;
+namespace grpc_core {
-typedef struct stage_slots {
- stage_slot* slots;
- size_t num_slots;
- size_t cap_slots;
-} stage_slots;
-
-static stage_slots g_slots[GRPC_NUM_CHANNEL_STACK_TYPES];
-static bool g_finalized;
-
-void grpc_channel_init_init(void) {
- for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- g_slots[i].slots = nullptr;
- g_slots[i].num_slots = 0;
- g_slots[i].cap_slots = 0;
- }
- g_finalized = false;
-}
-
-void grpc_channel_init_register_stage(grpc_channel_stack_type type,
- int priority,
- grpc_channel_init_stage stage,
- void* stage_arg) {
- GPR_ASSERT(!g_finalized);
- if (g_slots[type].cap_slots == g_slots[type].num_slots) {
- g_slots[type].cap_slots = GPR_MAX(8, 3 * g_slots[type].cap_slots / 2);
- g_slots[type].slots = static_cast<stage_slot*>(
- gpr_realloc(g_slots[type].slots,
- g_slots[type].cap_slots * sizeof(*g_slots[type].slots)));
- }
- stage_slot* s = &g_slots[type].slots[g_slots[type].num_slots++];
- s->insertion_order = g_slots[type].num_slots;
- s->priority = priority;
- s->fn = stage;
- s->arg = stage_arg;
-}
-
-static int compare_slots(const void* a, const void* b) {
- const stage_slot* sa = static_cast<const stage_slot*>(a);
- const stage_slot* sb = static_cast<const stage_slot*>(b);
-
- int c = GPR_ICMP(sa->priority, sb->priority);
- if (c != 0) return c;
- return GPR_ICMP(sa->insertion_order, sb->insertion_order);
+void ChannelInit::Builder::RegisterStage(grpc_channel_stack_type type,
+ int priority, Stage stage) {
+ slots_[type].emplace_back(std::move(stage), priority);
}
-void grpc_channel_init_finalize(void) {
- GPR_ASSERT(!g_finalized);
+ChannelInit ChannelInit::Builder::Build() {
+ ChannelInit result;
for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- qsort(g_slots[i].slots, g_slots[i].num_slots, sizeof(*g_slots[i].slots),
- compare_slots);
- }
- g_finalized = true;
-}
-
-void grpc_channel_init_shutdown(void) {
- for (int i = 0; i < GRPC_NUM_CHANNEL_STACK_TYPES; i++) {
- gpr_free(g_slots[i].slots);
- g_slots[i].slots =
- static_cast<stage_slot*>(reinterpret_cast<void*>(0xdeadbeef));
+ auto& slots = slots_[i];
+ std::stable_sort(
+ slots.begin(), slots.end(),
+ [](const Slot& a, const Slot& b) { return a.priority < b.priority; });
+ auto& result_slots = result.slots_[i];
+ result_slots.reserve(slots.size());
+ for (auto& slot : slots) {
+ result_slots.emplace_back(std::move(slot.stage));
+ }
}
+ return result;
}
-bool grpc_channel_init_create_stack(grpc_channel_stack_builder* builder,
- grpc_channel_stack_type type) {
- GPR_ASSERT(g_finalized);
-
- grpc_channel_stack_builder_set_name(builder,
- grpc_channel_stack_type_string(type));
-
- for (size_t i = 0; i < g_slots[type].num_slots; i++) {
- const stage_slot* slot = &g_slots[type].slots[i];
- if (!slot->fn(builder, slot->arg)) {
- return false;
- }
+bool ChannelInit::CreateStack(grpc_channel_stack_builder* builder,
+ grpc_channel_stack_type type) const {
+ for (const auto& stage : slots_[type]) {
+ if (!stage(builder)) return false;
}
-
return true;
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel_init.h b/contrib/libs/grpc/src/core/lib/surface/channel_init.h
index d17a721606d..8f839932cc0 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel_init.h
+++ b/contrib/libs/grpc/src/core/lib/surface/channel_init.h
@@ -21,9 +21,10 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/channel/channel_stack_builder.h"
+#include <functional>
+#include <vector>
+
#include "src/core/lib/surface/channel_stack_type.h"
-#include "src/core/lib/transport/transport.h"
#define GRPC_CHANNEL_INIT_BUILTIN_PRIORITY 10000
@@ -32,47 +33,54 @@
/// It also provides a universal entry path to run those mutators to build
/// a channel stack for various subsystems.
-/// One stage of mutation: call functions against \a builder to influence the
-/// finally constructed channel stack
-typedef bool (*grpc_channel_init_stage)(grpc_channel_stack_builder* builder,
- void* arg);
-
-/// Global initialization of the system
-void grpc_channel_init_init(void);
-
-/// Register one stage of mutators.
-/// Stages are run in priority order (lowest to highest), and then in
-/// registration order (in the case of a tie).
-/// Stages are registered against one of the pre-determined channel stack
-/// types.
-/// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
-/// ensure that subchannels with different filter lists will always have
-/// different channel args. This requires setting a channel arg in case the
-/// registration function relies on some condition other than channel args to
-/// decide whether to add a filter or not.
-void grpc_channel_init_register_stage(grpc_channel_stack_type type,
- int priority,
- grpc_channel_init_stage stage_fn,
- void* stage_arg);
-
-/// Finalize registration. No more calls to grpc_channel_init_register_stage are
-/// allowed.
-void grpc_channel_init_finalize(void);
-/// Shutdown the channel init system
-void grpc_channel_init_shutdown(void);
-
-/// Construct a channel stack of some sort: see channel_stack.h for details
-/// \a type is the type of channel stack to create
-/// \a prefix_bytes is the number of bytes before the channel stack to allocate
-/// \a args are configuration arguments for the channel stack
-/// \a initial_refs is the initial refcount to give the channel stack
-/// \a destroy and \a destroy_arg specify how to destroy the channel stack
-/// if destroy_arg is NULL, the returned value from this function will be
-/// substituted
-/// \a optional_transport is either NULL or a constructed transport object
-/// Returns a pointer to the base of the memory allocated (the actual channel
-/// stack object will be prefix_bytes past that pointer)
-bool grpc_channel_init_create_stack(grpc_channel_stack_builder* builder,
- grpc_channel_stack_type type);
+typedef struct grpc_channel_stack_builder grpc_channel_stack_builder;
+
+namespace grpc_core {
+
+class ChannelInit {
+ public:
+ /// One stage of mutation: call functions against \a builder to influence the
+ /// finally constructed channel stack
+ using Stage = std::function<bool(grpc_channel_stack_builder* builder)>;
+
+ class Builder {
+ public:
+ /// Register one stage of mutators.
+ /// Stages are run in priority order (lowest to highest), and then in
+ /// registration order (in the case of a tie).
+ /// Stages are registered against one of the pre-determined channel stack
+ /// types.
+ /// If the channel stack type is GRPC_CLIENT_SUBCHANNEL, the caller should
+ /// ensure that subchannels with different filter lists will always have
+ /// different channel args. This requires setting a channel arg in case the
+ /// registration function relies on some condition other than channel args
+ /// to decide whether to add a filter or not.
+ void RegisterStage(grpc_channel_stack_type type, int priority, Stage stage);
+
+ /// Finalize registration. No more calls to grpc_channel_init_register_stage
+ /// are allowed.
+ ChannelInit Build();
+
+ private:
+ struct Slot {
+ Slot(Stage stage, int priority)
+ : stage(std::move(stage)), priority(priority) {}
+ Stage stage;
+ int priority;
+ };
+ std::vector<Slot> slots_[GRPC_NUM_CHANNEL_STACK_TYPES];
+ };
+
+ /// Construct a channel stack of some sort: see channel_stack.h for details
+ /// \a type is the type of channel stack to create
+ /// \a builder is the channel stack builder to build into.
+ bool CreateStack(grpc_channel_stack_builder* builder,
+ grpc_channel_stack_type type) const;
+
+ private:
+ std::vector<Stage> slots_[GRPC_NUM_CHANNEL_STACK_TYPES];
+};
+
+} // namespace grpc_core
#endif /* GRPC_CORE_LIB_SURFACE_CHANNEL_INIT_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel_ping.cc b/contrib/libs/grpc/src/core/lib/surface/channel_ping.cc
index 82e552194b8..22c49386629 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel_ping.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/channel_ping.cc
@@ -18,14 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/channel.h"
-
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/surface/api_trace.h"
+#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/completion_queue.h"
struct ping_result {
@@ -38,7 +37,7 @@ static void ping_destroy(void* arg, grpc_cq_completion* /*storage*/) {
gpr_free(arg);
}
-static void ping_done(void* arg, grpc_error* error) {
+static void ping_done(void* arg, grpc_error_handle error) {
ping_result* pr = static_cast<ping_result*>(arg);
grpc_cq_end_op(pr->cq, pr->tag, GRPC_ERROR_REF(error), ping_destroy, pr,
&pr->completion_storage);
diff --git a/contrib/libs/grpc/src/core/lib/surface/channel_stack_type.cc b/contrib/libs/grpc/src/core/lib/surface/channel_stack_type.cc
index fcf96ddc9fb..ecbc3ef6afb 100644
--- a/contrib/libs/grpc/src/core/lib/surface/channel_stack_type.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/channel_stack_type.cc
@@ -18,9 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/support/log.h>
#include "src/core/lib/surface/channel_stack_type.h"
+#include <grpc/support/log.h>
+
bool grpc_channel_stack_type_is_client(grpc_channel_stack_type type) {
switch (type) {
case GRPC_CLIENT_CHANNEL:
diff --git a/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc b/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
index 5c535dcdc1d..784de6d3dcb 100644
--- a/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/completion_queue.cc
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
+#include <atomic>
#include <vector>
#include "y_absl/strings/str_format.h"
@@ -38,7 +39,6 @@
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/tls.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/pollset.h"
#include "src/core/lib/iomgr/timer.h"
@@ -58,8 +58,8 @@ namespace {
// with a cq cache will go into that cache, and
// will only be returned on the thread that initialized the cache.
// NOTE: Only one event will ever be cached.
-GPR_TLS_DECL(g_cached_event);
-GPR_TLS_DECL(g_cached_cq);
+GPR_THREAD_LOCAL(grpc_cq_completion*) g_cached_event;
+GPR_THREAD_LOCAL(grpc_completion_queue*) g_cached_cq;
struct plucker {
grpc_pollset_worker** worker;
@@ -70,10 +70,10 @@ struct cq_poller_vtable {
bool can_listen;
size_t (*size)(void);
void (*init)(grpc_pollset* pollset, gpr_mu** mu);
- grpc_error* (*kick)(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker);
- grpc_error* (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
- grpc_millis deadline);
+ grpc_error_handle (*kick)(grpc_pollset* pollset,
+ grpc_pollset_worker* specific_worker);
+ grpc_error_handle (*work)(grpc_pollset* pollset, grpc_pollset_worker** worker,
+ grpc_millis deadline);
void (*shutdown)(grpc_pollset* pollset, grpc_closure* closure);
void (*destroy)(grpc_pollset* pollset);
};
@@ -103,9 +103,9 @@ void non_polling_poller_destroy(grpc_pollset* pollset) {
gpr_mu_destroy(&npp->mu);
}
-grpc_error* non_polling_poller_work(grpc_pollset* pollset,
- grpc_pollset_worker** worker,
- grpc_millis deadline) {
+grpc_error_handle non_polling_poller_work(grpc_pollset* pollset,
+ grpc_pollset_worker** worker,
+ grpc_millis deadline) {
non_polling_poller* npp = reinterpret_cast<non_polling_poller*>(pollset);
if (npp->shutdown) return GRPC_ERROR_NONE;
if (npp->kicked_without_poller) {
@@ -145,8 +145,8 @@ grpc_error* non_polling_poller_work(grpc_pollset* pollset,
return GRPC_ERROR_NONE;
}
-grpc_error* non_polling_poller_kick(grpc_pollset* pollset,
- grpc_pollset_worker* specific_worker) {
+grpc_error_handle non_polling_poller_kick(
+ grpc_pollset* pollset, grpc_pollset_worker* specific_worker) {
non_polling_poller* p = reinterpret_cast<non_polling_poller*>(pollset);
if (specific_worker == nullptr) {
specific_worker = reinterpret_cast<grpc_pollset_worker*>(p->root);
@@ -197,12 +197,11 @@ const cq_poller_vtable g_poller_vtable_by_poller_type[] = {
struct cq_vtable {
grpc_cq_completion_type cq_completion_type;
size_t data_size;
- void (*init)(void* data,
- grpc_experimental_completion_queue_functor* shutdown_callback);
+ void (*init)(void* data, grpc_completion_queue_functor* shutdown_callback);
void (*shutdown)(grpc_completion_queue* cq);
void (*destroy)(void* data);
bool (*begin_op)(grpc_completion_queue* cq, void* tag);
- void (*end_op)(grpc_completion_queue* cq, void* tag, grpc_error* error,
+ void (*end_op)(grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage),
void* done_arg, grpc_cq_completion* storage, bool internal);
grpc_event (*next)(grpc_completion_queue* cq, gpr_timespec deadline,
@@ -225,7 +224,7 @@ class CqEventQueue {
/* Note: The counter is not incremented/decremented atomically with push/pop.
* The count is only eventually consistent */
intptr_t num_items() const {
- return num_queue_items_.Load(grpc_core::MemoryOrder::RELAXED);
+ return num_queue_items_.load(std::memory_order_relaxed);
}
bool Push(grpc_cq_completion* c);
@@ -240,14 +239,14 @@ class CqEventQueue {
/* A lazy counter of number of items in the queue. This is NOT atomically
incremented/decremented along with push/pop operations and hence is only
eventually consistent */
- grpc_core::Atomic<intptr_t> num_queue_items_{0};
+ std::atomic<intptr_t> num_queue_items_{0};
};
struct cq_next_data {
~cq_next_data() {
GPR_ASSERT(queue.num_items() == 0);
#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -258,11 +257,11 @@ struct cq_next_data {
/** Counter of how many things have ever been queued on this completion queue
useful for avoiding locks to check the queue */
- grpc_core::Atomic<intptr_t> things_queued_ever{0};
+ std::atomic<intptr_t> things_queued_ever{0};
/** Number of outstanding events (+1 if not shut down)
Initial count is dropped by grpc_completion_queue_shutdown */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
@@ -278,7 +277,7 @@ struct cq_pluck_data {
GPR_ASSERT(completed_head.next ==
reinterpret_cast<uintptr_t>(&completed_head));
#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -290,17 +289,17 @@ struct cq_pluck_data {
/** Number of pending events (+1 if we're not shutdown).
Initial count is dropped by grpc_completion_queue_shutdown. */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** Counter of how many things have ever been queued on this completion queue
useful for avoiding locks to check the queue */
- grpc_core::Atomic<intptr_t> things_queued_ever{0};
+ std::atomic<intptr_t> things_queued_ever{0};
/** 0 initially. 1 once we completed shutting */
/* TODO: (sreek) This is not needed since (shutdown == 1) if and only if
* (pending_events == 0). So consider removing this in future and use
* pending_events */
- grpc_core::Atomic<bool> shutdown{false};
+ std::atomic<bool> shutdown{false};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
@@ -310,13 +309,12 @@ struct cq_pluck_data {
};
struct cq_callback_data {
- explicit cq_callback_data(
- grpc_experimental_completion_queue_functor* shutdown_callback)
+ explicit cq_callback_data(grpc_completion_queue_functor* shutdown_callback)
: shutdown_callback(shutdown_callback) {}
~cq_callback_data() {
#ifndef NDEBUG
- if (pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 0) {
+ if (pending_events.load(std::memory_order_acquire) != 0) {
gpr_log(GPR_ERROR, "Destroying CQ without draining it fully.");
}
#endif
@@ -326,13 +324,13 @@ struct cq_callback_data {
/** Number of pending events (+1 if we're not shutdown).
Initial count is dropped by grpc_completion_queue_shutdown. */
- grpc_core::Atomic<intptr_t> pending_events{1};
+ std::atomic<intptr_t> pending_events{1};
/** 0 initially. 1 once we initiated shutdown */
bool shutdown_called = false;
/** A callback that gets invoked when the CQ completes shutdown */
- grpc_experimental_completion_queue_functor* shutdown_callback;
+ grpc_completion_queue_functor* shutdown_callback;
};
} // namespace
@@ -376,17 +374,17 @@ static bool cq_begin_op_for_callback(grpc_completion_queue* cq, void* tag);
// safe to free up that storage. The storage MUST NOT be freed until the
// done callback is invoked.
static void cq_end_op_for_next(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool internal);
static void cq_end_op_for_pluck(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool internal);
static void cq_end_op_for_callback(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool internal);
@@ -397,12 +395,12 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
gpr_timespec deadline, void* reserved);
// Note that cq_init_next and cq_init_pluck do not use the shutdown_callback
-static void cq_init_next(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
-static void cq_init_pluck(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
-static void cq_init_callback(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback);
+static void cq_init_next(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
+static void cq_init_pluck(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
+static void cq_init_callback(void* data,
+ grpc_completion_queue_functor* shutdown_callback);
static void cq_destroy_next(void* data);
static void cq_destroy_pluck(void* data);
static void cq_destroy_callback(void* data);
@@ -439,35 +437,29 @@ grpc_core::TraceFlag grpc_cq_pluck_trace(false, "queue_pluck");
} \
} while (0)
-static void on_pollset_shutdown_done(void* arg, grpc_error* error);
+static void on_pollset_shutdown_done(void* arg, grpc_error_handle error);
-void grpc_cq_global_init() {
- gpr_tls_init(&g_cached_event);
- gpr_tls_init(&g_cached_cq);
-}
+void grpc_cq_global_init() {}
void grpc_completion_queue_thread_local_cache_init(grpc_completion_queue* cq) {
- if (reinterpret_cast<grpc_completion_queue*>(gpr_tls_get(&g_cached_cq)) ==
- nullptr) {
- gpr_tls_set(&g_cached_event, (intptr_t)0);
- gpr_tls_set(&g_cached_cq, (intptr_t)cq);
+ if (g_cached_cq == nullptr) {
+ g_cached_event = nullptr;
+ g_cached_cq = cq;
}
}
int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
void** tag, int* ok) {
- grpc_cq_completion* storage =
- reinterpret_cast<grpc_cq_completion*>(gpr_tls_get(&g_cached_event));
+ grpc_cq_completion* storage = g_cached_event;
int ret = 0;
- if (storage != nullptr && reinterpret_cast<grpc_completion_queue*>(
- gpr_tls_get(&g_cached_cq)) == cq) {
+ if (storage != nullptr && g_cached_cq == cq) {
*tag = storage->tag;
grpc_core::ExecCtx exec_ctx;
*ok = (storage->next & static_cast<uintptr_t>(1)) == 1;
storage->done(storage->done_arg, storage);
ret = 1;
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
@@ -475,8 +467,8 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
GRPC_CQ_INTERNAL_UNREF(cq, "shutting_down");
}
}
- gpr_tls_set(&g_cached_event, (intptr_t)0);
- gpr_tls_set(&g_cached_cq, (intptr_t)0);
+ g_cached_event = nullptr;
+ g_cached_cq = nullptr;
return ret;
}
@@ -484,7 +476,7 @@ int grpc_completion_queue_thread_local_cache_flush(grpc_completion_queue* cq,
bool CqEventQueue::Push(grpc_cq_completion* c) {
queue_.Push(
reinterpret_cast<grpc_core::MultiProducerSingleConsumerQueue::Node*>(c));
- return num_queue_items_.FetchAdd(1, grpc_core::MemoryOrder::RELAXED) == 0;
+ return num_queue_items_.fetch_add(1, std::memory_order_relaxed) == 0;
}
grpc_cq_completion* CqEventQueue::Pop() {
@@ -505,7 +497,7 @@ grpc_cq_completion* CqEventQueue::Pop() {
}
if (c) {
- num_queue_items_.FetchSub(1, grpc_core::MemoryOrder::RELAXED);
+ num_queue_items_.fetch_sub(1, std::memory_order_relaxed);
}
return c;
@@ -513,7 +505,7 @@ grpc_cq_completion* CqEventQueue::Pop() {
grpc_completion_queue* grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_callback) {
+ grpc_completion_queue_functor* shutdown_callback) {
GPR_TIMER_SCOPE("grpc_completion_queue_create_internal", 0);
grpc_completion_queue* cq;
@@ -548,9 +540,8 @@ grpc_completion_queue* grpc_completion_queue_create_internal(
return cq;
}
-static void cq_init_next(
- void* data,
- grpc_experimental_completion_queue_functor* /*shutdown_callback*/) {
+static void cq_init_next(void* data,
+ grpc_completion_queue_functor* /*shutdown_callback*/) {
new (data) cq_next_data();
}
@@ -560,8 +551,7 @@ static void cq_destroy_next(void* data) {
}
static void cq_init_pluck(
- void* data,
- grpc_experimental_completion_queue_functor* /*shutdown_callback*/) {
+ void* data, grpc_completion_queue_functor* /*shutdown_callback*/) {
new (data) cq_pluck_data();
}
@@ -570,8 +560,8 @@ static void cq_destroy_pluck(void* data) {
cqd->~cq_pluck_data();
}
-static void cq_init_callback(
- void* data, grpc_experimental_completion_queue_functor* shutdown_callback) {
+static void cq_init_callback(void* data,
+ grpc_completion_queue_functor* shutdown_callback) {
new (data) cq_callback_data(shutdown_callback);
}
@@ -604,7 +594,7 @@ void grpc_cq_internal_ref(grpc_completion_queue* cq) {
cq->owning_refs.Ref(debug_location, reason);
}
-static void on_pollset_shutdown_done(void* arg, grpc_error* /*error*/) {
+static void on_pollset_shutdown_done(void* arg, grpc_error_handle /*error*/) {
grpc_completion_queue* cq = static_cast<grpc_completion_queue*>(arg);
GRPC_CQ_INTERNAL_UNREF(cq, "pollset_destroy");
}
@@ -638,8 +628,8 @@ static void cq_check_tag(grpc_completion_queue* cq, void* tag, bool lock_cq) {
for (int i = 0; i < static_cast<int>(cq->outstanding_tag_count); i++) {
if (cq->outstanding_tags[i] == tag) {
cq->outstanding_tag_count--;
- GPR_SWAP(void*, cq->outstanding_tags[i],
- cq->outstanding_tags[cq->outstanding_tag_count]);
+ std::swap(cq->outstanding_tags[i],
+ cq->outstanding_tags[cq->outstanding_tag_count]);
found = 1;
break;
}
@@ -658,24 +648,25 @@ static void cq_check_tag(grpc_completion_queue* /*cq*/, void* /*tag*/,
static bool cq_begin_op_for_next(grpc_completion_queue* cq, void* /*tag*/) {
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
static bool cq_begin_op_for_pluck(grpc_completion_queue* cq, void* /*tag*/) {
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
static bool cq_begin_op_for_callback(grpc_completion_queue* cq, void* /*tag*/) {
cq_callback_data* cqd = static_cast<cq_callback_data*> DATA_FROM_CQ(cq);
- return cqd->pending_events.IncrementIfNonzero();
+ return grpc_core::IncrementIfNonzero(&cqd->pending_events);
}
bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) {
#ifndef NDEBUG
gpr_mu_lock(cq->mu);
if (cq->outstanding_tag_count == cq->outstanding_tag_capacity) {
- cq->outstanding_tag_capacity = GPR_MAX(4, 2 * cq->outstanding_tag_capacity);
+ cq->outstanding_tag_capacity =
+ std::max(size_t(4), 2 * cq->outstanding_tag_capacity);
cq->outstanding_tags = static_cast<void**>(gpr_realloc(
cq->outstanding_tags,
sizeof(*cq->outstanding_tags) * cq->outstanding_tag_capacity));
@@ -690,7 +681,7 @@ bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag) {
* completion
* type of GRPC_CQ_NEXT) */
static void cq_end_op_for_next(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool /*internal*/) {
GPR_TIMER_SCOPE("cq_end_op_for_next", 0);
@@ -698,14 +689,15 @@ static void cq_end_op_for_next(
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
(GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE)) {
- const char* errmsg = grpc_error_string(error);
+ TString errmsg = grpc_error_std_string(error);
GRPC_API_TRACE(
"cq_end_op_for_next(cq=%p, tag=%p, error=%s, "
"done=%p, done_arg=%p, storage=%p)",
- 6, (cq, tag, errmsg, done, done_arg, storage));
+ 6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE) {
- gpr_log(GPR_INFO, "Operation failed: tag=%p, error=%s", tag, errmsg);
+ gpr_log(GPR_INFO, "Operation failed: tag=%p, error=%s", tag,
+ errmsg.c_str());
}
}
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
@@ -718,36 +710,32 @@ static void cq_end_op_for_next(
cq_check_tag(cq, tag, true); /* Used in debug builds only */
- if (reinterpret_cast<grpc_completion_queue*>(gpr_tls_get(&g_cached_cq)) ==
- cq &&
- reinterpret_cast<grpc_cq_completion*>(gpr_tls_get(&g_cached_event)) ==
- nullptr) {
- gpr_tls_set(&g_cached_event, (intptr_t)storage);
+ if (g_cached_cq == cq && g_cached_event == nullptr) {
+ g_cached_event = storage;
} else {
/* Add the completion to the queue */
bool is_first = cqd->queue.Push(storage);
- cqd->things_queued_ever.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed);
/* Since we do not hold the cq lock here, it is important to do an 'acquire'
load here (instead of a 'no_barrier' load) to match with the release
store
- (done via pending_events.FetchSub(1, ACQ_REL)) in cq_shutdown_next
+ (done via pending_events.fetch_sub(1, ACQ_REL)) in cq_shutdown_next
*/
- if (cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) != 1) {
+ if (cqd->pending_events.load(std::memory_order_acquire) != 1) {
/* Only kick if this is the first item queued */
if (is_first) {
gpr_mu_lock(cq->mu);
- grpc_error* kick_error =
+ grpc_error_handle kick_error =
cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), nullptr);
gpr_mu_unlock(cq->mu);
if (kick_error != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(kick_error);
- gpr_log(GPR_ERROR, "Kick failed: %s", msg);
+ gpr_log(GPR_ERROR, "Kick failed: %s",
+ grpc_error_std_string(kick_error).c_str());
GRPC_ERROR_UNREF(kick_error);
}
}
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) ==
- 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
@@ -756,7 +744,7 @@ static void cq_end_op_for_next(
}
} else {
GRPC_CQ_INTERNAL_REF(cq, "shutting_down");
- cqd->pending_events.Store(0, grpc_core::MemoryOrder::RELEASE);
+ cqd->pending_events.store(0, std::memory_order_release);
gpr_mu_lock(cq->mu);
cq_finish_shutdown_next(cq);
gpr_mu_unlock(cq->mu);
@@ -771,7 +759,7 @@ static void cq_end_op_for_next(
* completion
* type of GRPC_CQ_PLUCK) */
static void cq_end_op_for_pluck(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool /*internal*/) {
GPR_TIMER_SCOPE("cq_end_op_for_pluck", 0);
@@ -782,14 +770,15 @@ static void cq_end_op_for_pluck(
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
(GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE)) {
- const char* errmsg = grpc_error_string(error);
+ TString errmsg = grpc_error_std_string(error).c_str();
GRPC_API_TRACE(
"cq_end_op_for_pluck(cq=%p, tag=%p, error=%s, "
"done=%p, done_arg=%p, storage=%p)",
- 6, (cq, tag, errmsg, done, done_arg, storage));
+ 6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
+ gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag,
+ errmsg.c_str());
}
}
@@ -803,12 +792,12 @@ static void cq_end_op_for_pluck(
cq_check_tag(cq, tag, false); /* Used in debug builds only */
/* Add to the list of completions */
- cqd->things_queued_ever.FetchAdd(1, grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.fetch_add(1, std::memory_order_relaxed);
cqd->completed_tail->next =
reinterpret_cast<uintptr_t>(storage) | (1u & cqd->completed_tail->next);
cqd->completed_tail = storage;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_pluck(cq);
gpr_mu_unlock(cq->mu);
} else {
@@ -820,15 +809,12 @@ static void cq_end_op_for_pluck(
}
}
- grpc_error* kick_error =
+ grpc_error_handle kick_error =
cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), pluck_worker);
-
gpr_mu_unlock(cq->mu);
-
if (kick_error != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(kick_error);
- gpr_log(GPR_ERROR, "Kick failed: %s", msg);
-
+ gpr_log(GPR_ERROR, "Kick failed: %s",
+ grpc_error_std_string(kick_error).c_str());
GRPC_ERROR_UNREF(kick_error);
}
}
@@ -836,14 +822,14 @@ static void cq_end_op_for_pluck(
GRPC_ERROR_UNREF(error);
}
-static void functor_callback(void* arg, grpc_error* error) {
- auto* functor = static_cast<grpc_experimental_completion_queue_functor*>(arg);
+static void functor_callback(void* arg, grpc_error_handle error) {
+ auto* functor = static_cast<grpc_completion_queue_functor*>(arg);
functor->functor_run(functor, error == GRPC_ERROR_NONE);
}
/* Complete an event on a completion queue of type GRPC_CQ_CALLBACK */
static void cq_end_op_for_callback(
- grpc_completion_queue* cq, void* tag, grpc_error* error,
+ grpc_completion_queue* cq, void* tag, grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage), void* done_arg,
grpc_cq_completion* storage, bool internal) {
GPR_TIMER_SCOPE("cq_end_op_for_callback", 0);
@@ -853,14 +839,15 @@ static void cq_end_op_for_callback(
if (GRPC_TRACE_FLAG_ENABLED(grpc_api_trace) ||
(GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE)) {
- const char* errmsg = grpc_error_string(error);
+ TString errmsg = grpc_error_std_string(error);
GRPC_API_TRACE(
"cq_end_op_for_callback(cq=%p, tag=%p, error=%s, "
"done=%p, done_arg=%p, storage=%p)",
- 6, (cq, tag, errmsg, done, done_arg, storage));
+ 6, (cq, tag, errmsg.c_str(), done, done_arg, storage));
if (GRPC_TRACE_FLAG_ENABLED(grpc_trace_operation_failures) &&
error != GRPC_ERROR_NONE) {
- gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag, errmsg);
+ gpr_log(GPR_ERROR, "Operation failed: tag=%p, error=%s", tag,
+ errmsg.c_str());
}
}
@@ -870,7 +857,7 @@ static void cq_end_op_for_callback(
cq_check_tag(cq, tag, true); /* Used in debug builds only */
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_callback(cq);
}
@@ -880,7 +867,7 @@ static void cq_end_op_for_callback(
// 2. The callback is marked inlineable and there is an ACEC available
// 3. We are already running in a background poller thread (which always has
// an ACEC available at the base of the stack).
- auto* functor = static_cast<grpc_experimental_completion_queue_functor*>(tag);
+ auto* functor = static_cast<grpc_completion_queue_functor*>(tag);
if (((internal || functor->inlineable) &&
grpc_core::ApplicationCallbackExecCtx::Available()) ||
grpc_iomgr_is_any_background_poller_thread()) {
@@ -896,7 +883,8 @@ static void cq_end_op_for_callback(
GRPC_CLOSURE_CREATE(functor_callback, functor, nullptr), error);
}
-void grpc_cq_end_op(grpc_completion_queue* cq, void* tag, grpc_error* error,
+void grpc_cq_end_op(grpc_completion_queue* cq, void* tag,
+ grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage),
void* done_arg, grpc_cq_completion* storage,
bool internal) {
@@ -924,12 +912,12 @@ class ExecCtxNext : public grpc_core::ExecCtx {
GPR_ASSERT(a->stolen_completion == nullptr);
intptr_t current_last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
if (current_last_seen_things_queued_ever !=
a->last_seen_things_queued_ever) {
a->last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
/* Pop a cq_completion from the queue. Returns NULL if the queue is empty
* might return NULL in some cases even if the queue is not empty; but
@@ -988,7 +976,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
grpc_millis deadline_millis = grpc_timespec_to_millis_round_up(deadline);
cq_is_finished_arg is_finished_arg = {
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED),
+ cqd->things_queued_ever.load(std::memory_order_relaxed),
cq,
deadline_millis,
nullptr,
@@ -1027,7 +1015,7 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
}
}
- if (cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) == 0) {
+ if (cqd->pending_events.load(std::memory_order_acquire) == 0) {
/* Before returning, check if the queue has any items left over (since
MultiProducerSingleConsumerQueue::Pop() can sometimes return NULL
even if the queue is not empty. If so, keep retrying but do not
@@ -1056,16 +1044,19 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
/* The main polling work happens in grpc_pollset_work */
gpr_mu_lock(cq->mu);
cq->num_polls++;
- grpc_error* err = cq->poller_vtable->work(POLLSET_FROM_CQ(cq), nullptr,
- iteration_deadline);
+ grpc_error_handle err = cq->poller_vtable->work(
+ POLLSET_FROM_CQ(cq), nullptr, iteration_deadline);
gpr_mu_unlock(cq->mu);
if (err != GRPC_ERROR_NONE) {
- const char* msg = grpc_error_string(err);
- gpr_log(GPR_ERROR, "Completion queue next failed: %s", msg);
-
+ gpr_log(GPR_ERROR, "Completion queue next failed: %s",
+ grpc_error_std_string(err).c_str());
GRPC_ERROR_UNREF(err);
- ret.type = GRPC_QUEUE_TIMEOUT;
+ if (err == GRPC_ERROR_CANCELLED) {
+ ret.type = GRPC_QUEUE_SHUTDOWN;
+ } else {
+ ret.type = GRPC_QUEUE_TIMEOUT;
+ }
ret.success = 0;
dump_pending_tags(cq);
break;
@@ -1074,9 +1065,9 @@ static grpc_event cq_next(grpc_completion_queue* cq, gpr_timespec deadline,
}
if (cqd->queue.num_items() > 0 &&
- cqd->pending_events.Load(grpc_core::MemoryOrder::ACQUIRE) > 0) {
+ cqd->pending_events.load(std::memory_order_acquire) > 0) {
gpr_mu_lock(cq->mu);
- cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), nullptr);
+ (void)cq->poller_vtable->kick(POLLSET_FROM_CQ(cq), nullptr);
gpr_mu_unlock(cq->mu);
}
@@ -1098,7 +1089,7 @@ static void cq_finish_shutdown_next(grpc_completion_queue* cq) {
cq_next_data* cqd = static_cast<cq_next_data*> DATA_FROM_CQ(cq);
GPR_ASSERT(cqd->shutdown_called);
- GPR_ASSERT(cqd->pending_events.Load(grpc_core::MemoryOrder::RELAXED) == 0);
+ GPR_ASSERT(cqd->pending_events.load(std::memory_order_relaxed) == 0);
cq->poller_vtable->shutdown(POLLSET_FROM_CQ(cq), &cq->pollset_shutdown_done);
}
@@ -1120,10 +1111,10 @@ static void cq_shutdown_next(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- /* Doing acq/release FetchSub here to match with
+ /* Doing acq/release fetch_sub here to match with
* cq_begin_op_for_next and cq_end_op_for_next functions which read/write
* on this counter without necessarily holding a lock on cq */
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_next(cq);
}
gpr_mu_unlock(cq->mu);
@@ -1153,7 +1144,7 @@ static void del_plucker(grpc_completion_queue* cq, void* tag,
for (int i = 0; i < cqd->num_pluckers; i++) {
if (cqd->pluckers[i].tag == tag && cqd->pluckers[i].worker == worker) {
cqd->num_pluckers--;
- GPR_SWAP(plucker, cqd->pluckers[i], cqd->pluckers[cqd->num_pluckers]);
+ std::swap(cqd->pluckers[i], cqd->pluckers[cqd->num_pluckers]);
return;
}
}
@@ -1173,12 +1164,12 @@ class ExecCtxPluck : public grpc_core::ExecCtx {
GPR_ASSERT(a->stolen_completion == nullptr);
gpr_atm current_last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
if (current_last_seen_things_queued_ever !=
a->last_seen_things_queued_ever) {
gpr_mu_lock(cq->mu);
a->last_seen_things_queued_ever =
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED);
+ cqd->things_queued_ever.load(std::memory_order_relaxed);
grpc_cq_completion* c;
grpc_cq_completion* prev = &cqd->completed_head;
while ((c = reinterpret_cast<grpc_cq_completion*>(
@@ -1234,7 +1225,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
gpr_mu_lock(cq->mu);
grpc_millis deadline_millis = grpc_timespec_to_millis_round_up(deadline);
cq_is_finished_arg is_finished_arg = {
- cqd->things_queued_ever.Load(grpc_core::MemoryOrder::RELAXED),
+ cqd->things_queued_ever.load(std::memory_order_relaxed),
cq,
deadline_millis,
nullptr,
@@ -1271,7 +1262,7 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
}
prev = c;
}
- if (cqd->shutdown.Load(grpc_core::MemoryOrder::RELAXED)) {
+ if (cqd->shutdown.load(std::memory_order_relaxed)) {
gpr_mu_unlock(cq->mu);
ret.type = GRPC_QUEUE_SHUTDOWN;
ret.success = 0;
@@ -1299,14 +1290,13 @@ static grpc_event cq_pluck(grpc_completion_queue* cq, void* tag,
break;
}
cq->num_polls++;
- grpc_error* err =
+ grpc_error_handle err =
cq->poller_vtable->work(POLLSET_FROM_CQ(cq), &worker, deadline_millis);
if (err != GRPC_ERROR_NONE) {
del_plucker(cq, tag, &worker);
gpr_mu_unlock(cq->mu);
- const char* msg = grpc_error_string(err);
- gpr_log(GPR_ERROR, "Completion queue pluck failed: %s", msg);
-
+ gpr_log(GPR_ERROR, "Completion queue pluck failed: %s",
+ grpc_error_std_string(err).c_str());
GRPC_ERROR_UNREF(err);
ret.type = GRPC_QUEUE_TIMEOUT;
ret.success = 0;
@@ -1334,8 +1324,8 @@ static void cq_finish_shutdown_pluck(grpc_completion_queue* cq) {
cq_pluck_data* cqd = static_cast<cq_pluck_data*> DATA_FROM_CQ(cq);
GPR_ASSERT(cqd->shutdown_called);
- GPR_ASSERT(!cqd->shutdown.Load(grpc_core::MemoryOrder::RELAXED));
- cqd->shutdown.Store(true, grpc_core::MemoryOrder::RELAXED);
+ GPR_ASSERT(!cqd->shutdown.load(std::memory_order_relaxed));
+ cqd->shutdown.store(true, std::memory_order_relaxed);
cq->poller_vtable->shutdown(POLLSET_FROM_CQ(cq), &cq->pollset_shutdown_done);
}
@@ -1359,7 +1349,7 @@ static void cq_shutdown_pluck(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
cq_finish_shutdown_pluck(cq);
}
gpr_mu_unlock(cq->mu);
@@ -1402,7 +1392,7 @@ static void cq_shutdown_callback(grpc_completion_queue* cq) {
return;
}
cqd->shutdown_called = true;
- if (cqd->pending_events.FetchSub(1, grpc_core::MemoryOrder::ACQ_REL) == 1) {
+ if (cqd->pending_events.fetch_sub(1, std::memory_order_acq_rel) == 1) {
gpr_mu_unlock(cq->mu);
cq_finish_shutdown_callback(cq);
} else {
diff --git a/contrib/libs/grpc/src/core/lib/surface/completion_queue.h b/contrib/libs/grpc/src/core/lib/surface/completion_queue.h
index 59116d43281..b2cf19e8c9e 100644
--- a/contrib/libs/grpc/src/core/lib/surface/completion_queue.h
+++ b/contrib/libs/grpc/src/core/lib/surface/completion_queue.h
@@ -77,7 +77,8 @@ bool grpc_cq_begin_op(grpc_completion_queue* cq, void* tag);
/* Queue a GRPC_OP_COMPLETED operation; tag must correspond to the tag passed to
grpc_cq_begin_op */
-void grpc_cq_end_op(grpc_completion_queue* cq, void* tag, grpc_error* error,
+void grpc_cq_end_op(grpc_completion_queue* cq, void* tag,
+ grpc_error_handle error,
void (*done)(void* done_arg, grpc_cq_completion* storage),
void* done_arg, grpc_cq_completion* storage,
bool internal = false);
@@ -92,6 +93,6 @@ int grpc_get_cq_poll_num(grpc_completion_queue* cq);
grpc_completion_queue* grpc_completion_queue_create_internal(
grpc_cq_completion_type completion_type, grpc_cq_polling_type polling_type,
- grpc_experimental_completion_queue_functor* shutdown_callback);
+ grpc_completion_queue_functor* shutdown_callback);
#endif /* GRPC_CORE_LIB_SURFACE_COMPLETION_QUEUE_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.cc b/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.cc
index 72aa03adfd4..80aaba24dc6 100644
--- a/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.cc
@@ -18,11 +18,12 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/completion_queue_factory.h"
#include <grpc/support/log.h>
+#include "src/core/lib/surface/completion_queue.h"
+
/*
* == Default completion queue factory implementation ==
*/
@@ -72,8 +73,7 @@ grpc_completion_queue* grpc_completion_queue_create_for_pluck(void* reserved) {
}
grpc_completion_queue* grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
- void* reserved) {
+ grpc_completion_queue_functor* shutdown_callback, void* reserved) {
GPR_ASSERT(!reserved);
grpc_completion_queue_attributes attr = {
2, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING, shutdown_callback};
diff --git a/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.h b/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.h
index d2b30a9ce19..b1b13722df7 100644
--- a/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.h
+++ b/contrib/libs/grpc/src/core/lib/surface/completion_queue_factory.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/grpc.h>
+
#include "src/core/lib/surface/completion_queue.h"
typedef struct grpc_completion_queue_factory_vtable {
diff --git a/contrib/libs/grpc/src/core/lib/surface/event_string.cc b/contrib/libs/grpc/src/core/lib/surface/event_string.cc
index d69aac6deec..71db16d45c5 100644
--- a/contrib/libs/grpc/src/core/lib/surface/event_string.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/event_string.cc
@@ -29,6 +29,7 @@
#include <grpc/byte_buffer.h>
#include <grpc/support/string_util.h>
+
#include "src/core/lib/gpr/string.h"
static void addhdr(grpc_event* ev, std::vector<TString>* buf) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/init.cc b/contrib/libs/grpc/src/core/lib/surface/init.cc
index bbeed111e56..7099a01b27c 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/init.cc
@@ -32,7 +32,6 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channelz_registry.h"
#include "src/core/lib/channel/connected_channel.h"
-#include "src/core/lib/channel/handshaker_registry.h"
#include "src/core/lib/debug/stats.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/fork.h"
@@ -43,13 +42,11 @@
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
-#include "src/core/lib/iomgr/resource_quota.h"
#include "src/core/lib/iomgr/timer_manager.h"
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
-#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/surface/server.h"
@@ -64,48 +61,18 @@ extern void grpc_register_built_in_plugins(void);
static gpr_once g_basic_init = GPR_ONCE_INIT;
static grpc_core::Mutex* g_init_mu;
-static int g_initializations;
+static int g_initializations Y_ABSL_GUARDED_BY(g_init_mu) = 0;
static grpc_core::CondVar* g_shutting_down_cv;
-static bool g_shutting_down;
+static bool g_shutting_down Y_ABSL_GUARDED_BY(g_init_mu) = false;
static void do_basic_init(void) {
gpr_log_verbosity_init();
g_init_mu = new grpc_core::Mutex();
g_shutting_down_cv = new grpc_core::CondVar();
- g_shutting_down = false;
grpc_register_built_in_plugins();
grpc_cq_global_init();
grpc_core::grpc_executor_global_init();
gpr_time_init();
- g_initializations = 0;
-}
-
-static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_append_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
-
-static bool prepend_filter(grpc_channel_stack_builder* builder, void* arg) {
- return grpc_channel_stack_builder_prepend_filter(
- builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
-}
-
-static void register_builtin_channel_init() {
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL,
- GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- grpc_add_connected_filter, nullptr);
- grpc_channel_init_register_stage(
- GRPC_CLIENT_LAME_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY,
- append_filter, const_cast<grpc_channel_filter*>(&grpc_lame_filter));
- grpc_channel_init_register_stage(
- GRPC_SERVER_CHANNEL, INT_MAX, prepend_filter,
- const_cast<grpc_channel_filter*>(&grpc_core::Server::kServerTopFilter));
}
typedef struct grpc_plugin {
@@ -126,7 +93,6 @@ void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) {
}
void grpc_init(void) {
- int i;
gpr_once_init(&g_basic_init, do_basic_init);
grpc_core::MutexLock lock(g_init_mu);
@@ -138,44 +104,34 @@ void grpc_init(void) {
grpc_core::Fork::GlobalInit();
grpc_fork_handlers_auto_register();
grpc_stats_init();
- grpc_init_static_metadata_ctx();
grpc_slice_intern_init();
grpc_mdctx_global_init();
- grpc_channel_init_init();
grpc_core::channelz::ChannelzRegistry::Init();
grpc_security_pre_init();
grpc_core::ApplicationCallbackExecCtx::GlobalInit();
grpc_core::ExecCtx::GlobalInit();
grpc_iomgr_init();
gpr_timers_global_init();
- grpc_core::HandshakerRegistry::Init();
- grpc_security_init();
- for (i = 0; i < g_number_of_plugins; i++) {
+ for (int i = 0; i < g_number_of_plugins; i++) {
if (g_all_of_the_plugins[i].init != nullptr) {
g_all_of_the_plugins[i].init();
}
}
- /* register channel finalization AFTER all plugins, to ensure that it's run
- * at the appropriate time */
- grpc_register_security_filters();
- register_builtin_channel_init();
grpc_tracer_init();
- /* no more changes to channel init pipelines */
- grpc_channel_init_finalize();
grpc_iomgr_start();
}
GRPC_API_TRACE("grpc_init(void)", 0, ());
}
-void grpc_shutdown_internal_locked(void) {
+void grpc_shutdown_internal_locked(void)
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(g_init_mu) {
int i;
{
grpc_core::ExecCtx exec_ctx(0);
grpc_iomgr_shutdown_background_closure();
{
grpc_timer_manager_set_threading(false); // shutdown timer_manager thread
- grpc_core::Executor::ShutdownAll();
for (i = g_number_of_plugins; i >= 0; i--) {
if (g_all_of_the_plugins[i].destroy != nullptr) {
g_all_of_the_plugins[i].destroy();
@@ -186,7 +142,6 @@ void grpc_shutdown_internal_locked(void) {
gpr_timers_global_destroy();
grpc_tracer_shutdown();
grpc_mdctx_global_shutdown();
- grpc_core::HandshakerRegistry::Shutdown();
grpc_slice_intern_shutdown();
grpc_core::channelz::ChannelzRegistry::Shutdown();
grpc_stats_shutdown();
@@ -196,8 +151,6 @@ void grpc_shutdown_internal_locked(void) {
grpc_core::ApplicationCallbackExecCtx::GlobalShutdown();
g_shutting_down = false;
g_shutting_down_cv->SignalAll();
- // Absolute last action will be to delete static metadata context.
- grpc_destroy_static_metadata_ctx();
}
void grpc_shutdown_internal(void* /*ignored*/) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/init.h b/contrib/libs/grpc/src/core/lib/surface/init.h
index 6eaa488d054..8982e28aae7 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init.h
+++ b/contrib/libs/grpc/src/core/lib/surface/init.h
@@ -15,13 +15,21 @@
* limitations under the License.
*
*/
-
#ifndef GRPC_CORE_LIB_SURFACE_INIT_H
#define GRPC_CORE_LIB_SURFACE_INIT_H
+#include <grpc/support/port_platform.h>
+
+#include <memory>
+
+namespace grpc_event_engine {
+namespace experimental {
+class EventEngine;
+}
+} // namespace grpc_event_engine
+
void grpc_register_security_filters(void);
void grpc_security_pre_init(void);
-void grpc_security_init(void);
void grpc_maybe_wait_for_async_shutdown(void);
#endif /* GRPC_CORE_LIB_SURFACE_INIT_H */
diff --git a/contrib/libs/grpc/src/core/lib/surface/init_secure.cc b/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
index 428c5815c98..cd336fd4f2c 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/init_secure.cc
@@ -18,12 +18,13 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/surface/init.h"
-
#include <limits.h>
#include <string.h>
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
#include "src/core/lib/debug/trace.h"
+#include "src/core/lib/security/authorization/sdk_server_authz_filter.h"
#include "src/core/lib/security/context/security_context.h"
#include "src/core/lib/security/credentials/credentials.h"
#include "src/core/lib/security/credentials/plugin/plugin_credentials.h"
@@ -31,13 +32,13 @@
#include "src/core/lib/security/transport/auth_filters.h"
#include "src/core/lib/security/transport/secure_endpoint.h"
#include "src/core/lib/security/transport/security_handshaker.h"
-#include "src/core/lib/surface/channel_init.h"
+#include "src/core/lib/surface/init.h"
#include "src/core/tsi/transport_security_interface.h"
void grpc_security_pre_init(void) {}
static bool maybe_prepend_client_auth_filter(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
+ grpc_channel_stack_builder* builder) {
const grpc_channel_args* args =
grpc_channel_stack_builder_get_channel_arguments(builder);
if (args) {
@@ -52,7 +53,7 @@ static bool maybe_prepend_client_auth_filter(
}
static bool maybe_prepend_server_auth_filter(
- grpc_channel_stack_builder* builder, void* /*arg*/) {
+ grpc_channel_stack_builder* builder) {
const grpc_channel_args* args =
grpc_channel_stack_builder_get_channel_arguments(builder);
if (args) {
@@ -66,16 +67,37 @@ static bool maybe_prepend_server_auth_filter(
return true;
}
-void grpc_register_security_filters(void) {
+static bool maybe_prepend_sdk_server_authz_filter(
+ grpc_channel_stack_builder* builder) {
+ const grpc_channel_args* args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ const auto* provider =
+ grpc_channel_args_find_pointer<grpc_authorization_policy_provider>(
+ args, GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER);
+ if (provider != nullptr) {
+ return grpc_channel_stack_builder_prepend_filter(
+ builder, &grpc_core::SdkServerAuthzFilter::kFilterVtable, nullptr,
+ nullptr);
+ }
+ return true;
+}
+
+namespace grpc_core {
+void RegisterSecurityFilters(CoreConfiguration::Builder* builder) {
// Register the auth client with a priority < INT_MAX to allow the authority
// filter -on which the auth filter depends- to be higher on the channel
// stack.
- grpc_channel_init_register_stage(GRPC_CLIENT_SUBCHANNEL, INT_MAX - 1,
- maybe_prepend_client_auth_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MAX - 1,
- maybe_prepend_client_auth_filter, nullptr);
- grpc_channel_init_register_stage(GRPC_SERVER_CHANNEL, INT_MAX - 1,
- maybe_prepend_server_auth_filter, nullptr);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_SUBCHANNEL, INT_MAX - 1,
+ maybe_prepend_client_auth_filter);
+ builder->channel_init()->RegisterStage(GRPC_CLIENT_DIRECT_CHANNEL,
+ INT_MAX - 1,
+ maybe_prepend_client_auth_filter);
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL, INT_MAX - 1,
+ maybe_prepend_server_auth_filter);
+ // Register the SdkServerAuthzFilter with a priority less than
+ // server_auth_filter to allow server_auth_filter on which the sdk filter
+ // depends on to be higher on the channel stack.
+ builder->channel_init()->RegisterStage(GRPC_SERVER_CHANNEL, INT_MAX - 2,
+ maybe_prepend_sdk_server_authz_filter);
}
-
-void grpc_security_init() { grpc_core::SecurityRegisterHandshakerFactories(); }
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/surface/init_unsecure.cc b/contrib/libs/grpc/src/core/lib/surface/init_unsecure.cc
index 7b86d50dcf7..c9e1688d42a 100644
--- a/contrib/libs/grpc/src/core/lib/surface/init_unsecure.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/init_unsecure.cc
@@ -25,9 +25,3 @@
void grpc_security_pre_init(void) {}
void grpc_register_security_filters(void) {}
-
-void grpc_security_init(void) {
- gpr_log(GPR_DEBUG,
- "Using insecure gRPC build. Security handshakers will not be invoked "
- "even if secure credentials are used.");
-}
diff --git a/contrib/libs/grpc/src/core/lib/surface/lame_client.cc b/contrib/libs/grpc/src/core/lib/surface/lame_client.cc
index f92c1920df3..a9a564a1282 100644
--- a/contrib/libs/grpc/src/core/lib/surface/lame_client.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/lame_client.cc
@@ -18,20 +18,22 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc.h>
+#include "src/core/lib/surface/lame_client.h"
#include <string.h>
+#include <atomic>
+
+#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
#include "src/core/lib/surface/channel.h"
-#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/static_metadata.h"
@@ -44,14 +46,14 @@ namespace {
struct ChannelData {
explicit ChannelData(grpc_channel_element_args* args)
: state_tracker("lame_channel", GRPC_CHANNEL_SHUTDOWN) {
- grpc_error* err = grpc_channel_args_find_pointer<grpc_error>(
+ grpc_error_handle* err = grpc_channel_args_find_pointer<grpc_error_handle>(
args->channel_args, GRPC_ARG_LAME_FILTER_ERROR);
- if (err != nullptr) error = GRPC_ERROR_REF(err);
+ if (err != nullptr) error = GRPC_ERROR_REF(*err);
}
~ChannelData() { GRPC_ERROR_UNREF(error); }
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
Mutex mu;
ConnectivityStateTracker state_tracker;
};
@@ -60,19 +62,19 @@ struct CallData {
CallCombiner* call_combiner;
};
-static void lame_start_transport_stream_op_batch(
- grpc_call_element* elem, grpc_transport_stream_op_batch* op) {
+void lame_start_transport_stream_op_batch(grpc_call_element* elem,
+ grpc_transport_stream_op_batch* op) {
CallData* calld = static_cast<CallData*>(elem->call_data);
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
grpc_transport_stream_op_batch_finish_with_failure(
op, GRPC_ERROR_REF(chand->error), calld->call_combiner);
}
-static void lame_get_channel_info(grpc_channel_element* /*elem*/,
- const grpc_channel_info* /*channel_info*/) {}
+void lame_get_channel_info(grpc_channel_element* /*elem*/,
+ const grpc_channel_info* /*channel_info*/) {}
-static void lame_start_transport_op(grpc_channel_element* elem,
- grpc_transport_op* op) {
+void lame_start_transport_op(grpc_channel_element* elem,
+ grpc_transport_op* op) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
{
MutexLock lock(&chand->mu);
@@ -98,46 +100,54 @@ static void lame_start_transport_op(grpc_channel_element* elem,
}
}
-static grpc_error* lame_init_call_elem(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+grpc_error_handle lame_init_call_elem(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
CallData* calld = static_cast<CallData*>(elem->call_data);
calld->call_combiner = args->call_combiner;
return GRPC_ERROR_NONE;
}
-static void lame_destroy_call_elem(grpc_call_element* /*elem*/,
- const grpc_call_final_info* /*final_info*/,
- grpc_closure* then_schedule_closure) {
+void lame_destroy_call_elem(grpc_call_element* /*elem*/,
+ const grpc_call_final_info* /*final_info*/,
+ grpc_closure* then_schedule_closure) {
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
}
-static grpc_error* lame_init_channel_elem(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+grpc_error_handle lame_init_channel_elem(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
}
-static void lame_destroy_channel_elem(grpc_channel_element* elem) {
+void lame_destroy_channel_elem(grpc_channel_element* elem) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
chand->~ChannelData();
}
-// Channel arg vtable for a grpc_error*.
+// Channel arg vtable for a grpc_error_handle.
void* ErrorCopy(void* p) {
- grpc_error* error = static_cast<grpc_error*>(p);
- return GRPC_ERROR_REF(error);
+ grpc_error_handle* new_error = nullptr;
+ if (p != nullptr) {
+ grpc_error_handle* error = static_cast<grpc_error_handle*>(p);
+ new_error = new grpc_error_handle();
+ *new_error = GRPC_ERROR_REF(*error);
+ }
+ return new_error;
}
void ErrorDestroy(void* p) {
- grpc_error* error = static_cast<grpc_error*>(p);
- GRPC_ERROR_UNREF(error);
+ if (p != nullptr) {
+ grpc_error_handle* error = static_cast<grpc_error_handle*>(p);
+ GRPC_ERROR_UNREF(*error);
+ delete error;
+ }
}
-int ErrorCompare(void* p, void* q) { return GPR_ICMP(p, q); }
+int ErrorCompare(void* p, void* q) { return QsortCompare(p, q); }
const grpc_arg_pointer_vtable kLameFilterErrorArgVtable = {
ErrorCopy, ErrorDestroy, ErrorCompare};
} // namespace
-grpc_arg MakeLameClientErrorArg(grpc_error* error) {
+grpc_arg MakeLameClientErrorArg(grpc_error_handle* error) {
return grpc_channel_arg_pointer_create(
const_cast<char*>(GRPC_ARG_LAME_FILTER_ERROR), error,
&kLameFilterErrorArgVtable);
@@ -169,16 +179,21 @@ grpc_channel* grpc_lame_client_channel_create(const char* target,
"grpc_lame_client_channel_create(target=%s, error_code=%d, "
"error_message=%s)",
3, (target, (int)error_code, error_message));
- grpc_error* error = grpc_error_set_str(
+ grpc_error_handle error = grpc_error_set_str(
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("lame client channel"),
GRPC_ERROR_INT_GRPC_STATUS, error_code),
- GRPC_ERROR_STR_GRPC_MESSAGE,
- grpc_slice_from_static_string(error_message));
- grpc_arg error_arg = grpc_core::MakeLameClientErrorArg(error);
- grpc_channel_args args = {1, &error_arg};
- grpc_channel* channel =
- grpc_channel_create(target, &args, GRPC_CLIENT_LAME_CHANNEL, nullptr);
+ GRPC_ERROR_STR_GRPC_MESSAGE, error_message);
+ grpc_arg error_arg = grpc_core::MakeLameClientErrorArg(&error);
+ grpc_channel_args* args0 =
+ grpc_channel_args_copy_and_add(nullptr, &error_arg, 1);
+ const grpc_channel_args* args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args0);
+ grpc_channel_args_destroy(args0);
+ grpc_channel* channel = grpc_channel_create(
+ target, args, GRPC_CLIENT_LAME_CHANNEL, nullptr, nullptr);
+ grpc_channel_args_destroy(args);
GRPC_ERROR_UNREF(error);
return channel;
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/lame_client.h b/contrib/libs/grpc/src/core/lib/surface/lame_client.h
index 94c7e553ad8..6c9d1459e21 100644
--- a/contrib/libs/grpc/src/core/lib/surface/lame_client.h
+++ b/contrib/libs/grpc/src/core/lib/surface/lame_client.h
@@ -25,7 +25,7 @@
namespace grpc_core {
// Does NOT take ownership of error.
-grpc_arg MakeLameClientErrorArg(grpc_error* error);
+grpc_arg MakeLameClientErrorArg(grpc_error_handle* error);
} // namespace grpc_core
extern const grpc_channel_filter grpc_lame_filter;
diff --git a/contrib/libs/grpc/src/core/lib/surface/metadata_array.cc b/contrib/libs/grpc/src/core/lib/surface/metadata_array.cc
index f794a2bb952..3633382a1ce 100644
--- a/contrib/libs/grpc/src/core/lib/surface/metadata_array.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/metadata_array.cc
@@ -18,11 +18,11 @@
#include <grpc/support/port_platform.h>
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
-#include <string.h>
-
#include "src/core/lib/surface/api_trace.h"
void grpc_metadata_array_init(grpc_metadata_array* array) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/server.cc b/contrib/libs/grpc/src/core/lib/surface/server.cc
index fc094be47f9..b10ddcd866f 100644
--- a/contrib/libs/grpc/src/core/lib/surface/server.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/server.cc
@@ -46,6 +46,7 @@
#include "src/core/lib/gprpp/mpscq.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/iomgr.h"
+#include "src/core/lib/resource_quota/api.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/api_trace.h"
#include "src/core/lib/surface/call.h"
@@ -159,7 +160,7 @@ class Server::RequestMatcherInterface {
// Mark all application-requested RPCs failed if they have not been matched to
// an incoming RPC. The error parameter indicates why the RPCs are being
// failed (always server shutdown in all current implementations).
- virtual void KillRequests(grpc_error* error) = 0;
+ virtual void KillRequests(grpc_error_handle error) = 0;
// How many request queues are supported by this matcher. This is an abstract
// concept that essentially maps to gRPC completion queues.
@@ -211,7 +212,7 @@ class Server::RealRequestMatcher : public RequestMatcherInterface {
}
}
- void KillRequests(grpc_error* error) override {
+ void KillRequests(grpc_error_handle error) override {
for (size_t i = 0; i < requests_per_cq_.size(); i++) {
RequestedCall* rc;
while ((rc = reinterpret_cast<RequestedCall*>(
@@ -336,7 +337,9 @@ class Server::AllocatingRequestMatcherBase : public RequestMatcherInterface {
void ZombifyPending() override {}
- void KillRequests(grpc_error* error) override { GRPC_ERROR_UNREF(error); }
+ void KillRequests(grpc_error_handle error) override {
+ GRPC_ERROR_UNREF(error);
+ }
size_t request_queue_count() const override { return 0; }
@@ -444,7 +447,7 @@ class ChannelBroadcaster {
}
// Broadcasts a shutdown on each channel.
- void BroadcastShutdown(bool send_goaway, grpc_error* force_disconnect) {
+ void BroadcastShutdown(bool send_goaway, grpc_error_handle force_disconnect) {
for (grpc_channel* channel : channels_) {
SendShutdown(channel, send_goaway, GRPC_ERROR_REF(force_disconnect));
GRPC_CHANNEL_INTERNAL_UNREF(channel, "broadcast");
@@ -459,14 +462,14 @@ class ChannelBroadcaster {
grpc_slice slice;
};
- static void ShutdownCleanup(void* arg, grpc_error* /*error*/) {
+ static void ShutdownCleanup(void* arg, grpc_error_handle /*error*/) {
ShutdownCleanupArgs* a = static_cast<ShutdownCleanupArgs*>(arg);
grpc_slice_unref_internal(a->slice);
delete a;
}
static void SendShutdown(grpc_channel* channel, bool send_goaway,
- grpc_error* send_disconnect) {
+ grpc_error_handle send_disconnect) {
ShutdownCleanupArgs* sc = new ShutdownCleanupArgs;
GRPC_CLOSURE_INIT(&sc->closure, ShutdownCleanup, sc,
grpc_schedule_on_exec_ctx);
@@ -511,17 +514,6 @@ const grpc_channel_filter Server::kServerTopFilter = {
namespace {
-grpc_resource_user* CreateDefaultResourceUser(const grpc_channel_args* args) {
- if (args != nullptr) {
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_from_channel_args(args, false /* create */);
- if (resource_quota != nullptr) {
- return grpc_resource_user_create(resource_quota, "default");
- }
- }
- return nullptr;
-}
-
RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
const grpc_channel_args* args) {
RefCountedPtr<channelz::ServerNode> channelz_node;
@@ -543,7 +535,6 @@ RefCountedPtr<channelz::ServerNode> CreateChannelzNode(
Server::Server(const grpc_channel_args* args)
: channel_args_(grpc_channel_args_copy(args)),
- default_resource_user_(CreateDefaultResourceUser(args)),
channelz_node_(CreateChannelzNode(args)) {}
Server::~Server() {
@@ -607,15 +598,14 @@ void Server::Start() {
starting_cv_.Signal();
}
-grpc_error* Server::SetupTransport(
+grpc_error_handle Server::SetupTransport(
grpc_transport* transport, grpc_pollset* accepting_pollset,
const grpc_channel_args* args,
- const RefCountedPtr<grpc_core::channelz::SocketNode>& socket_node,
- grpc_resource_user* resource_user) {
+ const RefCountedPtr<channelz::SocketNode>& socket_node) {
// Create channel.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_channel* channel = grpc_channel_create(
- nullptr, args, GRPC_SERVER_CHANNEL, transport, resource_user, &error);
+ nullptr, args, GRPC_SERVER_CHANNEL, transport, &error);
if (channel == nullptr) {
return error;
}
@@ -710,7 +700,8 @@ void Server::DoneRequestEvent(void* req, grpc_cq_completion* /*c*/) {
delete static_cast<RequestedCall*>(req);
}
-void Server::FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error) {
+void Server::FailCall(size_t cq_idx, RequestedCall* rc,
+ grpc_error_handle error) {
*rc->call = nullptr;
rc->initial_metadata->count = 0;
GPR_ASSERT(error != GRPC_ERROR_NONE);
@@ -750,7 +741,7 @@ void Server::MaybeFinishShutdown() {
}
}
-void Server::KillPendingWorkLocked(grpc_error* error) {
+void Server::KillPendingWorkLocked(grpc_error_handle error) {
if (started_) {
unregistered_request_matcher_->KillRequests(GRPC_ERROR_REF(error));
unregistered_request_matcher_->ZombifyPending();
@@ -772,7 +763,7 @@ std::vector<grpc_channel*> Server::GetChannelsLocked() const {
return channels;
}
-void Server::ListenerDestroyDone(void* arg, grpc_error* /*error*/) {
+void Server::ListenerDestroyDone(void* arg, grpc_error_handle /*error*/) {
Server* server = static_cast<Server*>(arg);
MutexLock lock(&server->mu_global_);
server->listeners_destroyed_++;
@@ -802,11 +793,14 @@ void DonePublishedShutdown(void* /*done_arg*/, grpc_cq_completion* storage) {
// connection is NOT closed until the server is done with all those calls.
// -- Once there are no more calls in progress, the channel is closed.
void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
+ y_absl::Notification* await_requests = nullptr;
ChannelBroadcaster broadcaster;
{
// Wait for startup to be finished. Locks mu_global.
MutexLock lock(&mu_global_);
- WaitUntil(&starting_cv_, &mu_global_, [this] { return !starting_; });
+ while (starting_) {
+ starting_cv_.Wait(&mu_global_);
+ }
// Stay locked, and gather up some stuff to do.
GPR_ASSERT(grpc_cq_begin_op(cq, tag));
if (shutdown_published_) {
@@ -826,7 +820,12 @@ void Server::ShutdownAndNotify(grpc_completion_queue* cq, void* tag) {
KillPendingWorkLocked(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server Shutdown"));
}
- ShutdownUnrefOnShutdownCall();
+ await_requests = ShutdownUnrefOnShutdownCall();
+ }
+ // We expect no new requests but there can still be requests in-flight.
+ // Wait for them to complete before proceeding.
+ if (await_requests != nullptr) {
+ await_requests->WaitForNotification();
}
// Shutdown listeners.
for (auto& listener : listeners_) {
@@ -861,11 +860,6 @@ void Server::Orphan() {
GPR_ASSERT(ShutdownCalled() || listeners_.empty());
GPR_ASSERT(listeners_destroyed_ == listeners_.size());
}
- if (default_resource_user_ != nullptr) {
- grpc_resource_quota_unref(grpc_resource_user_quota(default_resource_user_));
- grpc_resource_user_shutdown(default_resource_user_);
- grpc_resource_user_unref(default_resource_user_);
- }
Unref();
}
@@ -1134,7 +1128,7 @@ void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
args.add_initial_metadata_count = 0;
args.send_deadline = GRPC_MILLIS_INF_FUTURE;
grpc_call* call;
- grpc_error* error = grpc_call_create(&args, &call);
+ grpc_error_handle error = grpc_call_create(&args, &call);
grpc_call_element* elem =
grpc_call_stack_element(grpc_call_get_call_stack(call), 0);
auto* calld = static_cast<Server::CallData*>(elem->call_data);
@@ -1146,7 +1140,8 @@ void Server::ChannelData::AcceptStream(void* arg, grpc_transport* /*transport*/,
calld->Start(elem);
}
-void Server::ChannelData::FinishDestroy(void* arg, grpc_error* /*error*/) {
+void Server::ChannelData::FinishDestroy(void* arg,
+ grpc_error_handle /*error*/) {
auto* chand = static_cast<Server::ChannelData*>(arg);
Server* server = chand->server_.get();
GRPC_CHANNEL_INTERNAL_UNREF(chand->channel_, "server");
@@ -1173,7 +1168,7 @@ void Server::ChannelData::Destroy() {
op);
}
-grpc_error* Server::ChannelData::InitChannelElement(
+grpc_error_handle Server::ChannelData::InitChannelElement(
grpc_channel_element* elem, grpc_channel_element_args* args) {
GPR_ASSERT(args->is_first);
GPR_ASSERT(!args->is_last);
@@ -1203,7 +1198,7 @@ Server::CallData::CallData(grpc_call_element* elem,
}
Server::CallData::~CallData() {
- GPR_ASSERT(state_.Load(MemoryOrder::RELAXED) != CallState::PENDING);
+ GPR_ASSERT(state_.load(std::memory_order_relaxed) != CallState::PENDING);
GRPC_ERROR_UNREF(recv_initial_metadata_error_);
if (host_.has_value()) {
grpc_slice_unref_internal(*host_);
@@ -1216,26 +1211,26 @@ Server::CallData::~CallData() {
}
void Server::CallData::SetState(CallState state) {
- state_.Store(state, MemoryOrder::RELAXED);
+ state_.store(state, std::memory_order_relaxed);
}
bool Server::CallData::MaybeActivate() {
CallState expected = CallState::PENDING;
- return state_.CompareExchangeStrong(&expected, CallState::ACTIVATED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED);
+ return state_.compare_exchange_strong(expected, CallState::ACTIVATED,
+ std::memory_order_acq_rel,
+ std::memory_order_relaxed);
}
void Server::CallData::FailCallCreation() {
CallState expected_not_started = CallState::NOT_STARTED;
CallState expected_pending = CallState::PENDING;
- if (state_.CompareExchangeStrong(&expected_not_started, CallState::ZOMBIED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::ACQUIRE)) {
+ if (state_.compare_exchange_strong(expected_not_started, CallState::ZOMBIED,
+ std::memory_order_acq_rel,
+ std::memory_order_acquire)) {
KillZombie();
- } else if (state_.CompareExchangeStrong(&expected_pending, CallState::ZOMBIED,
- MemoryOrder::ACQ_REL,
- MemoryOrder::RELAXED)) {
+ } else if (state_.compare_exchange_strong(
+ expected_pending, CallState::ZOMBIED,
+ std::memory_order_acq_rel, std::memory_order_relaxed)) {
// Zombied call will be destroyed when it's removed from the pending
// queue... later.
}
@@ -1258,7 +1253,7 @@ void Server::CallData::Publish(size_t cq_idx, RequestedCall* rc) {
grpc_call_set_completion_queue(call_, rc->cq_bound_to_call);
*rc->call = call_;
cq_new_ = server_->cqs_[cq_idx];
- GPR_SWAP(grpc_metadata_array, *rc->initial_metadata, initial_metadata_);
+ std::swap(*rc->initial_metadata, initial_metadata_);
switch (rc->type) {
case RequestedCall::Type::BATCH_CALL:
GPR_ASSERT(host_.has_value());
@@ -1284,14 +1279,14 @@ void Server::CallData::Publish(size_t cq_idx, RequestedCall* rc) {
rc, &rc->completion, true);
}
-void Server::CallData::PublishNewRpc(void* arg, grpc_error* error) {
+void Server::CallData::PublishNewRpc(void* arg, grpc_error_handle error) {
grpc_call_element* call_elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<Server::CallData*>(call_elem->call_data);
auto* chand = static_cast<Server::ChannelData*>(call_elem->channel_data);
RequestMatcherInterface* rm = calld->matcher_;
Server* server = rm->server();
if (error != GRPC_ERROR_NONE || server->ShutdownCalled()) {
- calld->state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ calld->state_.store(CallState::ZOMBIED, std::memory_order_relaxed);
calld->KillZombie();
return;
}
@@ -1300,7 +1295,7 @@ void Server::CallData::PublishNewRpc(void* arg, grpc_error* error) {
namespace {
-void KillZombieClosure(void* call, grpc_error* /*error*/) {
+void KillZombieClosure(void* call, grpc_error_handle /*error*/) {
grpc_call_unref(static_cast<grpc_call*>(call));
}
@@ -1315,7 +1310,7 @@ void Server::CallData::KillZombie() {
void Server::CallData::StartNewRpc(grpc_call_element* elem) {
auto* chand = static_cast<ChannelData*>(elem->channel_data);
if (server_->ShutdownCalled()) {
- state_.Store(CallState::ZOMBIED, MemoryOrder::RELAXED);
+ state_.store(CallState::ZOMBIED, std::memory_order_relaxed);
KillZombie();
return;
}
@@ -1352,8 +1347,8 @@ void Server::CallData::StartNewRpc(grpc_call_element* elem) {
}
}
-void Server::CallData::RecvInitialMetadataBatchComplete(void* arg,
- grpc_error* error) {
+void Server::CallData::RecvInitialMetadataBatchComplete(
+ void* arg, grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
auto* calld = static_cast<Server::CallData*>(elem->call_data);
if (error != GRPC_ERROR_NONE) {
@@ -1385,33 +1380,34 @@ void Server::CallData::StartTransportStreamOpBatchImpl(
grpc_call_next_op(elem, batch);
}
-void Server::CallData::RecvInitialMetadataReady(void* arg, grpc_error* error) {
+void Server::CallData::RecvInitialMetadataReady(void* arg,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
CallData* calld = static_cast<CallData*>(elem->call_data);
- grpc_millis op_deadline;
if (error == GRPC_ERROR_NONE) {
- GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.path != nullptr);
- GPR_DEBUG_ASSERT(calld->recv_initial_metadata_->idx.named.authority !=
- nullptr);
- calld->path_.emplace(grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.path->md)));
- calld->host_.emplace(grpc_slice_ref_internal(
- GRPC_MDVALUE(calld->recv_initial_metadata_->idx.named.authority->md)));
- grpc_metadata_batch_remove(calld->recv_initial_metadata_, GRPC_BATCH_PATH);
- grpc_metadata_batch_remove(calld->recv_initial_metadata_,
- GRPC_BATCH_AUTHORITY);
+ GPR_DEBUG_ASSERT(
+ calld->recv_initial_metadata_->legacy_index()->named.path != nullptr);
+ GPR_DEBUG_ASSERT(
+ calld->recv_initial_metadata_->legacy_index()->named.authority !=
+ nullptr);
+ calld->path_.emplace(grpc_slice_ref_internal(GRPC_MDVALUE(
+ calld->recv_initial_metadata_->legacy_index()->named.path->md)));
+ calld->host_.emplace(grpc_slice_ref_internal(GRPC_MDVALUE(
+ calld->recv_initial_metadata_->legacy_index()->named.authority->md)));
+ calld->recv_initial_metadata_->Remove(GRPC_BATCH_PATH);
+ calld->recv_initial_metadata_->Remove(GRPC_BATCH_AUTHORITY);
} else {
- GRPC_ERROR_REF(error);
+ (void)GRPC_ERROR_REF(error);
}
- op_deadline = calld->recv_initial_metadata_->deadline;
- if (op_deadline != GRPC_MILLIS_INF_FUTURE) {
- calld->deadline_ = op_deadline;
+ auto op_deadline = calld->recv_initial_metadata_->get(GrpcTimeoutMetadata());
+ if (op_deadline.has_value()) {
+ calld->deadline_ = *op_deadline;
}
if (calld->host_.has_value() && calld->path_.has_value()) {
/* do nothing */
} else {
/* Pass the error reference to calld->recv_initial_metadata_error */
- grpc_error* src_error = error;
+ grpc_error_handle src_error = error;
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Missing :authority or :path", &src_error, 1);
GRPC_ERROR_UNREF(src_error);
@@ -1428,7 +1424,8 @@ void Server::CallData::RecvInitialMetadataReady(void* arg, grpc_error* error) {
Closure::Run(DEBUG_LOCATION, closure, error);
}
-void Server::CallData::RecvTrailingMetadataReady(void* arg, grpc_error* error) {
+void Server::CallData::RecvTrailingMetadataReady(void* arg,
+ grpc_error_handle error) {
grpc_call_element* elem = static_cast<grpc_call_element*>(arg);
CallData* calld = static_cast<CallData*>(elem->call_data);
if (calld->original_recv_initial_metadata_ready_ != nullptr) {
@@ -1449,7 +1446,7 @@ void Server::CallData::RecvTrailingMetadataReady(void* arg, grpc_error* error) {
error);
}
-grpc_error* Server::CallData::InitCallElement(
+grpc_error_handle Server::CallData::InitCallElement(
grpc_call_element* elem, const grpc_call_element_args* args) {
auto* chand = static_cast<ChannelData*>(elem->channel_data);
new (elem->call_data) Server::CallData(elem, *args, chand->server());
@@ -1478,9 +1475,12 @@ void Server::CallData::StartTransportStreamOpBatch(
grpc_server* grpc_server_create(const grpc_channel_args* args, void* reserved) {
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved));
- grpc_server* c_server = new grpc_server;
- c_server->core_server = grpc_core::MakeOrphanable<grpc_core::Server>(args);
- return c_server;
+ const grpc_channel_args* new_args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(args);
+ grpc_core::Server* server = new grpc_core::Server(new_args);
+ grpc_channel_args_destroy(new_args);
+ return server->c_ptr();
}
void grpc_server_register_completion_queue(grpc_server* server,
@@ -1499,7 +1499,7 @@ void grpc_server_register_completion_queue(grpc_server* server,
/* Ideally we should log an error and abort but ruby-wrapped-language API
calls grpc_completion_queue_pluck() on server completion queues */
}
- server->core_server->RegisterCompletionQueue(cq);
+ grpc_core::Server::FromC(server)->RegisterCompletionQueue(cq);
}
void* grpc_server_register_method(
@@ -1510,14 +1510,14 @@ void* grpc_server_register_method(
"grpc_server_register_method(server=%p, method=%s, host=%s, "
"flags=0x%08x)",
4, (server, method, host, flags));
- return server->core_server->RegisterMethod(method, host, payload_handling,
- flags);
+ return grpc_core::Server::FromC(server)->RegisterMethod(
+ method, host, payload_handling, flags);
}
void grpc_server_start(grpc_server* server) {
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_start(server=%p)", 1, (server));
- server->core_server->Start();
+ grpc_core::Server::FromC(server)->Start();
}
void grpc_server_shutdown_and_notify(grpc_server* server,
@@ -1526,21 +1526,21 @@ void grpc_server_shutdown_and_notify(grpc_server* server,
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_shutdown_and_notify(server=%p, cq=%p, tag=%p)", 3,
(server, cq, tag));
- server->core_server->ShutdownAndNotify(cq, tag);
+ grpc_core::Server::FromC(server)->ShutdownAndNotify(cq, tag);
}
void grpc_server_cancel_all_calls(grpc_server* server) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_cancel_all_calls(server=%p)", 1, (server));
- server->core_server->CancelAllCalls();
+ grpc_core::Server::FromC(server)->CancelAllCalls();
}
void grpc_server_destroy(grpc_server* server) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_destroy(server=%p)", 1, (server));
- delete server;
+ grpc_core::Server::FromC(server)->Orphan();
}
grpc_call_error grpc_server_request_call(
@@ -1558,9 +1558,9 @@ grpc_call_error grpc_server_request_call(
7,
(server, call, details, request_metadata, cq_bound_to_call,
cq_for_notification, tag));
- return server->core_server->RequestCall(call, details, request_metadata,
- cq_bound_to_call, cq_for_notification,
- tag);
+ return grpc_core::Server::FromC(server)->RequestCall(
+ call, details, request_metadata, cq_bound_to_call, cq_for_notification,
+ tag);
}
grpc_call_error grpc_server_request_registered_call(
@@ -1583,7 +1583,7 @@ grpc_call_error grpc_server_request_registered_call(
9,
(server, registered_method, call, deadline, request_metadata,
optional_payload, cq_bound_to_call, cq_for_notification, tag_new));
- return server->core_server->RequestRegisteredCall(
+ return grpc_core::Server::FromC(server)->RequestRegisteredCall(
rm, call, deadline, request_metadata, optional_payload, cq_bound_to_call,
cq_for_notification, tag_new);
}
@@ -1594,7 +1594,7 @@ void grpc_server_set_config_fetcher(
grpc_core::ExecCtx exec_ctx;
GRPC_API_TRACE("grpc_server_set_config_fetcher(server=%p, config_fetcher=%p)",
2, (server, server_config_fetcher));
- server->core_server->set_config_fetcher(
+ grpc_core::Server::FromC(server)->set_config_fetcher(
std::unique_ptr<grpc_server_config_fetcher>(server_config_fetcher));
}
diff --git a/contrib/libs/grpc/src/core/lib/surface/server.h b/contrib/libs/grpc/src/core/lib/surface/server.h
index a6166b8d507..f42df7d9a74 100644
--- a/contrib/libs/grpc/src/core/lib/surface/server.h
+++ b/contrib/libs/grpc/src/core/lib/surface/server.h
@@ -19,10 +19,12 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <list>
#include <vector>
#include "y_absl/status/statusor.h"
+#include "y_absl/synchronization/notification.h"
#include "y_absl/types/optional.h"
#include <grpc/grpc.h>
@@ -31,8 +33,10 @@
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
+#include "src/core/lib/gprpp/cpp_impl_of.h"
+#include "src/core/lib/gprpp/dual_ref_counted.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/resource_quota/memory_quota.h"
#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/transport/transport.h"
@@ -40,7 +44,8 @@ namespace grpc_core {
extern TraceFlag grpc_server_channel_trace;
-class Server : public InternallyRefCounted<Server> {
+class Server : public InternallyRefCounted<Server>,
+ public CppImplOf<Server, grpc_server> {
public:
// Filter vtable.
static const grpc_channel_filter kServerTopFilter;
@@ -97,9 +102,6 @@ class Server : public InternallyRefCounted<Server> {
void Orphan() Y_ABSL_LOCKS_EXCLUDED(mu_global_) override;
const grpc_channel_args* channel_args() const { return channel_args_; }
- grpc_resource_user* default_resource_user() const {
- return default_resource_user_;
- }
channelz::ServerNode* channelz_node() const { return channelz_node_.get(); }
// Do not call this before Start(). Returns the pollsets. The
@@ -128,11 +130,11 @@ class Server : public InternallyRefCounted<Server> {
// Sets up a transport. Creates a channel stack and binds the transport to
// the server. Called from the listener when a new connection is accepted.
- grpc_error* SetupTransport(
+ // Takes ownership of a ref on resource_user from the caller.
+ grpc_error_handle SetupTransport(
grpc_transport* transport, grpc_pollset* accepting_pollset,
const grpc_channel_args* args,
- const RefCountedPtr<channelz::SocketNode>& socket_node,
- grpc_resource_user* resource_user = nullptr);
+ const RefCountedPtr<channelz::SocketNode>& socket_node);
void RegisterCompletionQueue(grpc_completion_queue* cq);
@@ -202,8 +204,8 @@ class Server : public InternallyRefCounted<Server> {
bool is_idempotent);
// Filter vtable functions.
- static grpc_error* InitChannelElement(grpc_channel_element* elem,
- grpc_channel_element_args* args);
+ static grpc_error_handle InitChannelElement(
+ grpc_channel_element* elem, grpc_channel_element_args* args);
static void DestroyChannelElement(grpc_channel_element* elem);
private:
@@ -214,7 +216,7 @@ class Server : public InternallyRefCounted<Server> {
void Destroy() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(server_->mu_global_);
- static void FinishDestroy(void* arg, grpc_error* error);
+ static void FinishDestroy(void* arg, grpc_error_handle error);
RefCountedPtr<Server> server_;
grpc_channel* channel_;
@@ -264,8 +266,8 @@ class Server : public InternallyRefCounted<Server> {
void FailCallCreation();
// Filter vtable functions.
- static grpc_error* InitCallElement(grpc_call_element* elem,
- const grpc_call_element_args* args);
+ static grpc_error_handle InitCallElement(
+ grpc_call_element* elem, const grpc_call_element_args* args);
static void DestroyCallElement(grpc_call_element* elem,
const grpc_call_final_info* /*final_info*/,
grpc_closure* /*ignored*/);
@@ -274,21 +276,22 @@ class Server : public InternallyRefCounted<Server> {
private:
// Helper functions for handling calls at the top of the call stack.
- static void RecvInitialMetadataBatchComplete(void* arg, grpc_error* error);
+ static void RecvInitialMetadataBatchComplete(void* arg,
+ grpc_error_handle error);
void StartNewRpc(grpc_call_element* elem);
- static void PublishNewRpc(void* arg, grpc_error* error);
+ static void PublishNewRpc(void* arg, grpc_error_handle error);
// Functions used inside the call stack.
void StartTransportStreamOpBatchImpl(grpc_call_element* elem,
grpc_transport_stream_op_batch* batch);
- static void RecvInitialMetadataReady(void* arg, grpc_error* error);
- static void RecvTrailingMetadataReady(void* arg, grpc_error* error);
+ static void RecvInitialMetadataReady(void* arg, grpc_error_handle error);
+ static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error);
RefCountedPtr<Server> server_;
grpc_call* call_;
- Atomic<CallState> state_{CallState::NOT_STARTED};
+ std::atomic<CallState> state_{CallState::NOT_STARTED};
y_absl::optional<grpc_slice> path_;
y_absl::optional<grpc_slice> host_;
@@ -309,12 +312,12 @@ class Server : public InternallyRefCounted<Server> {
uint32_t recv_initial_metadata_flags_ = 0;
grpc_closure recv_initial_metadata_ready_;
grpc_closure* original_recv_initial_metadata_ready_;
- grpc_error* recv_initial_metadata_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle recv_initial_metadata_error_ = GRPC_ERROR_NONE;
bool seen_recv_trailing_metadata_ready_ = false;
grpc_closure recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ready_;
- grpc_error* recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
grpc_closure publish_;
@@ -336,7 +339,7 @@ class Server : public InternallyRefCounted<Server> {
grpc_cq_completion completion;
};
- static void ListenerDestroyDone(void* arg, grpc_error* error);
+ static void ListenerDestroyDone(void* arg, grpc_error_handle error);
static void DoneShutdownEvent(void* server,
grpc_cq_completion* /*completion*/) {
@@ -345,13 +348,13 @@ class Server : public InternallyRefCounted<Server> {
static void DoneRequestEvent(void* req, grpc_cq_completion* completion);
- void FailCall(size_t cq_idx, RequestedCall* rc, grpc_error* error);
+ void FailCall(size_t cq_idx, RequestedCall* rc, grpc_error_handle error);
grpc_call_error QueueRequestedCall(size_t cq_idx, RequestedCall* rc);
void MaybeFinishShutdown() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_)
Y_ABSL_LOCKS_EXCLUDED(mu_call_);
- void KillPendingWorkLocked(grpc_error* error)
+ void KillPendingWorkLocked(grpc_error_handle error)
Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_call_);
static grpc_call_error ValidateServerRequest(
@@ -364,9 +367,9 @@ class Server : public InternallyRefCounted<Server> {
std::vector<grpc_channel*> GetChannelsLocked() const;
// Take a shutdown ref for a request (increment by 2) and return if shutdown
- // has already been called.
+ // has not been called.
bool ShutdownRefOnRequest() {
- int old_value = shutdown_refs_.FetchAdd(2, MemoryOrder::ACQ_REL);
+ int old_value = shutdown_refs_.fetch_add(2, std::memory_order_acq_rel);
return (old_value & 1) != 0;
}
@@ -374,30 +377,41 @@ class Server : public InternallyRefCounted<Server> {
// (for in-flight request) and possibly call MaybeFinishShutdown if
// appropriate.
void ShutdownUnrefOnRequest() Y_ABSL_LOCKS_EXCLUDED(mu_global_) {
- if (shutdown_refs_.FetchSub(2, MemoryOrder::ACQ_REL) == 2) {
+ if (shutdown_refs_.fetch_sub(2, std::memory_order_acq_rel) == 2) {
MutexLock lock(&mu_global_);
MaybeFinishShutdown();
+ // The last request in-flight during shutdown is now complete.
+ if (requests_complete_ != nullptr) {
+ GPR_ASSERT(!requests_complete_->HasBeenNotified());
+ requests_complete_->Notify();
+ }
}
}
- void ShutdownUnrefOnShutdownCall() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) {
- if (shutdown_refs_.FetchSub(1, MemoryOrder::ACQ_REL) == 1) {
+ // Returns a notification pointer to wait on if there are requests in-flight,
+ // or null.
+ y_absl::Notification* ShutdownUnrefOnShutdownCall()
+ Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_global_) GRPC_MUST_USE_RESULT {
+ if (shutdown_refs_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
+ // There is no request in-flight.
MaybeFinishShutdown();
+ return nullptr;
}
+ requests_complete_ = y_absl::make_unique<y_absl::Notification>();
+ return requests_complete_.get();
}
bool ShutdownCalled() const {
- return (shutdown_refs_.Load(MemoryOrder::ACQUIRE) & 1) == 0;
+ return (shutdown_refs_.load(std::memory_order_acquire) & 1) == 0;
}
// Returns whether there are no more shutdown refs, which means that shutdown
// has been called and all accepted requests have been published if using an
// AllocatingRequestMatcher.
bool ShutdownReady() const {
- return shutdown_refs_.Load(MemoryOrder::ACQUIRE) == 0;
+ return shutdown_refs_.load(std::memory_order_acquire) == 0;
}
grpc_channel_args* const channel_args_;
- grpc_resource_user* default_resource_user_ = nullptr;
RefCountedPtr<channelz::ServerNode> channelz_node_;
std::unique_ptr<grpc_server_config_fetcher> config_fetcher_;
@@ -415,9 +429,9 @@ class Server : public InternallyRefCounted<Server> {
Mutex mu_global_; // mutex for server and channel state
Mutex mu_call_; // mutex for call-specific state
- // startup synchronization: flag is protected by mu_global_, signals whether
- // we are doing the listener start routine or not.
- bool starting_ = false;
+ // startup synchronization: flag, signals whether we are doing the listener
+ // start routine or not.
+ bool starting_ Y_ABSL_GUARDED_BY(mu_global_) = false;
CondVar starting_cv_;
std::vector<std::unique_ptr<RegisteredMethod>> registered_methods_;
@@ -431,9 +445,11 @@ class Server : public InternallyRefCounted<Server> {
// the lowest bit will be 0 (defaults to 1) and the counter will be even. The
// server should not notify on shutdown until the counter is 0 (shutdown is
// called and there are no requests that are accepted but not started).
- Atomic<int> shutdown_refs_{1};
+ std::atomic<int> shutdown_refs_{1};
bool shutdown_published_ Y_ABSL_GUARDED_BY(mu_global_) = false;
std::vector<ShutdownTag> shutdown_tags_ Y_ABSL_GUARDED_BY(mu_global_);
+ std::unique_ptr<y_absl::Notification> requests_complete_
+ Y_ABSL_GUARDED_BY(mu_global_);
std::list<ChannelData*> channels_;
@@ -446,19 +462,10 @@ class Server : public InternallyRefCounted<Server> {
} // namespace grpc_core
-struct grpc_server {
- grpc_core::OrphanablePtr<grpc_core::Server> core_server;
-};
-
-// TODO(roth): Eventually, will need a way to modify configuration even after
-// a connection is established (e.g., to change things like L7 rate
-// limiting, RBAC, and fault injection configs). One possible option
-// would be to do something like ServiceConfig and ConfigSelector, but
-// that might add unnecessary per-call overhead. Need to consider other
-// approaches here.
struct grpc_server_config_fetcher {
public:
- class ConnectionManager : public grpc_core::RefCounted<ConnectionManager> {
+ class ConnectionManager
+ : public grpc_core::DualRefCounted<ConnectionManager> {
public:
// Ownership of \a args is transfered.
virtual y_absl::StatusOr<grpc_channel_args*> UpdateChannelArgsForConnection(
@@ -480,9 +487,7 @@ struct grpc_server_config_fetcher {
virtual ~grpc_server_config_fetcher() = default;
- // Ownership of \a args is transferred.
virtual void StartWatch(TString listening_address,
- grpc_channel_args* args,
std::unique_ptr<WatcherInterface> watcher) = 0;
virtual void CancelWatch(WatcherInterface* watcher) = 0;
virtual grpc_pollset_set* interested_parties() = 0;
diff --git a/contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc b/contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc
index 138f5745e51..1f737b170fd 100644
--- a/contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/validate_metadata.cc
@@ -18,51 +18,72 @@
#include <grpc/support/port_platform.h>
+#include "src/core/lib/surface/validate_metadata.h"
+
#include <stdlib.h>
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
+#include "src/core/lib/gprpp/bitset.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-#include "src/core/lib/surface/validate_metadata.h"
-static grpc_error* conforms_to(const grpc_slice& slice,
- const uint8_t* legal_bits,
- const char* err_desc) {
+#if __cplusplus > 201103l
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_FN constexpr
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE constexpr
+#else
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_FN
+#define GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE const
+#endif
+
+static grpc_error_handle conforms_to(const grpc_slice& slice,
+ const grpc_core::BitSet<256>& legal_bits,
+ const char* err_desc) {
const uint8_t* p = GRPC_SLICE_START_PTR(slice);
const uint8_t* e = GRPC_SLICE_END_PTR(slice);
for (; p != e; p++) {
- int idx = *p;
- int byte = idx / 8;
- int bit = idx % 8;
- if ((legal_bits[byte] & (1 << bit)) == 0) {
- grpc_error* error = grpc_error_set_str(
+ if (!legal_bits.is_set(*p)) {
+ size_t len;
+ grpc_core::UniquePtr<char> ptr(gpr_dump_return_len(
+ reinterpret_cast<const char*> GRPC_SLICE_START_PTR(slice),
+ GRPC_SLICE_LENGTH(slice), GPR_DUMP_HEX | GPR_DUMP_ASCII, &len));
+ grpc_error_handle error = grpc_error_set_str(
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_COPIED_STRING(err_desc),
GRPC_ERROR_INT_OFFSET,
p - GRPC_SLICE_START_PTR(slice)),
- GRPC_ERROR_STR_RAW_BYTES,
- grpc_dump_slice_to_slice(slice, GPR_DUMP_HEX | GPR_DUMP_ASCII));
+ GRPC_ERROR_STR_RAW_BYTES, y_absl::string_view(ptr.get(), len));
return error;
}
}
return GRPC_ERROR_NONE;
}
-static int error2int(grpc_error* error) {
+static int error2int(grpc_error_handle error) {
int r = (error == GRPC_ERROR_NONE);
GRPC_ERROR_UNREF(error);
return r;
}
-grpc_error* grpc_validate_header_key_is_legal(const grpc_slice& slice) {
- static const uint8_t legal_header_bits[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xff, 0x03, 0x00, 0x00, 0x00,
- 0x80, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+namespace {
+class LegalHeaderKeyBits : public grpc_core::BitSet<256> {
+ public:
+ GRPC_VALIDATE_METADATA_CONSTEXPR_FN LegalHeaderKeyBits() {
+ for (int i = 'a'; i <= 'z'; i++) set(i);
+ for (int i = '0'; i <= '9'; i++) set(i);
+ set('-');
+ set('_');
+ set('.');
+ }
+};
+GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE LegalHeaderKeyBits
+ g_legal_header_key_bits;
+} // namespace
+
+grpc_error_handle grpc_validate_header_key_is_legal(const grpc_slice& slice) {
if (GRPC_SLICE_LENGTH(slice) == 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Metadata keys cannot be zero length");
@@ -75,20 +96,30 @@ grpc_error* grpc_validate_header_key_is_legal(const grpc_slice& slice) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Metadata keys cannot start with :");
}
- return conforms_to(slice, legal_header_bits, "Illegal header key");
+ return conforms_to(slice, g_legal_header_key_bits, "Illegal header key");
}
int grpc_header_key_is_legal(grpc_slice slice) {
return error2int(grpc_validate_header_key_is_legal(slice));
}
-grpc_error* grpc_validate_header_nonbin_value_is_legal(
+namespace {
+class LegalHeaderNonBinValueBits : public grpc_core::BitSet<256> {
+ public:
+ GRPC_VALIDATE_METADATA_CONSTEXPR_FN LegalHeaderNonBinValueBits() {
+ for (int i = 32; i <= 126; i++) {
+ set(i);
+ }
+ }
+};
+GRPC_VALIDATE_METADATA_CONSTEXPR_VALUE LegalHeaderNonBinValueBits
+ g_legal_header_non_bin_value_bits;
+} // namespace
+
+grpc_error_handle grpc_validate_header_nonbin_value_is_legal(
const grpc_slice& slice) {
- static const uint8_t legal_header_bits[256 / 8] = {
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- return conforms_to(slice, legal_header_bits, "Illegal header value");
+ return conforms_to(slice, g_legal_header_non_bin_value_bits,
+ "Illegal header value");
}
int grpc_header_nonbin_value_is_legal(grpc_slice slice) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/validate_metadata.h b/contrib/libs/grpc/src/core/lib/surface/validate_metadata.h
index 07c802c98b8..daaaa1a3783 100644
--- a/contrib/libs/grpc/src/core/lib/surface/validate_metadata.h
+++ b/contrib/libs/grpc/src/core/lib/surface/validate_metadata.h
@@ -27,8 +27,9 @@
#include "src/core/lib/iomgr/error.h"
-grpc_error* grpc_validate_header_key_is_legal(const grpc_slice& slice);
-grpc_error* grpc_validate_header_nonbin_value_is_legal(const grpc_slice& slice);
+grpc_error_handle grpc_validate_header_key_is_legal(const grpc_slice& slice);
+grpc_error_handle grpc_validate_header_nonbin_value_is_legal(
+ const grpc_slice& slice);
int grpc_is_binary_header_internal(const grpc_slice& slice);
inline int grpc_key_is_binary_header(const uint8_t* buf, size_t length) {
diff --git a/contrib/libs/grpc/src/core/lib/surface/version.cc b/contrib/libs/grpc/src/core/lib/surface/version.cc
index 737c2eb1bff..64f2829d9dc 100644
--- a/contrib/libs/grpc/src/core/lib/surface/version.cc
+++ b/contrib/libs/grpc/src/core/lib/surface/version.cc
@@ -23,6 +23,6 @@
#include <grpc/grpc.h>
-const char* grpc_version_string(void) { return "15.0.0"; }
+const char* grpc_version_string(void) { return "21.0.0"; }
-const char* grpc_g_stands_for(void) { return "gilded"; }
+const char* grpc_g_stands_for(void) { return "green"; }
diff --git a/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc b/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc
index dd266877c0d..6af45afc01a 100644
--- a/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/bdp_estimator.cc
@@ -55,7 +55,7 @@ grpc_millis BdpEstimator::CompletePing() {
}
GPR_ASSERT(ping_state_ == PingState::STARTED);
if (accumulator_ > 2 * estimate_ / 3 && bw > bw_est_) {
- estimate_ = GPR_MAX(accumulator_, estimate_ * 2);
+ estimate_ = std::max(accumulator_, estimate_ * 2);
bw_est_ = bw;
if (GRPC_TRACE_FLAG_ENABLED(grpc_bdp_estimator_trace)) {
gpr_log(GPR_INFO, "bdp[%s]: estimate increased to %" PRId64, name_,
@@ -81,7 +81,7 @@ grpc_millis BdpEstimator::CompletePing() {
}
ping_state_ = PingState::UNSCHEDULED;
accumulator_ = 0;
- return grpc_core::ExecCtx::Get()->Now() + inter_ping_delay_;
+ return ExecCtx::Get()->Now() + inter_ping_delay_;
}
} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/transport/byte_stream.cc b/contrib/libs/grpc/src/core/lib/transport/byte_stream.cc
index 82f34ca1504..8d3b22bd26e 100644
--- a/contrib/libs/grpc/src/core/lib/transport/byte_stream.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/byte_stream.cc
@@ -40,6 +40,10 @@ SliceBufferByteStream::SliceBufferByteStream(grpc_slice_buffer* slice_buffer,
GPR_ASSERT(slice_buffer->length <= UINT32_MAX);
grpc_slice_buffer_init(&backing_buffer_);
grpc_slice_buffer_swap(slice_buffer, &backing_buffer_);
+ if (backing_buffer_.count == 0) {
+ grpc_slice_buffer_add_indexed(&backing_buffer_, grpc_empty_slice());
+ GPR_ASSERT(backing_buffer_.count > 0);
+ }
}
SliceBufferByteStream::~SliceBufferByteStream() {}
@@ -59,7 +63,7 @@ bool SliceBufferByteStream::Next(size_t /*max_size_hint*/,
return true;
}
-grpc_error* SliceBufferByteStream::Pull(grpc_slice* slice) {
+grpc_error_handle SliceBufferByteStream::Pull(grpc_slice* slice) {
if (GPR_UNLIKELY(shutdown_error_ != GRPC_ERROR_NONE)) {
return GRPC_ERROR_REF(shutdown_error_);
}
@@ -67,7 +71,7 @@ grpc_error* SliceBufferByteStream::Pull(grpc_slice* slice) {
return GRPC_ERROR_NONE;
}
-void SliceBufferByteStream::Shutdown(grpc_error* error) {
+void SliceBufferByteStream::Shutdown(grpc_error_handle error) {
GRPC_ERROR_UNREF(shutdown_error_);
shutdown_error_ = error;
}
@@ -117,7 +121,7 @@ bool ByteStreamCache::CachingByteStream::Next(size_t max_size_hint,
return cache_->underlying_stream_->Next(max_size_hint, on_complete);
}
-grpc_error* ByteStreamCache::CachingByteStream::Pull(grpc_slice* slice) {
+grpc_error_handle ByteStreamCache::CachingByteStream::Pull(grpc_slice* slice) {
if (shutdown_error_ != GRPC_ERROR_NONE) {
return GRPC_ERROR_REF(shutdown_error_);
}
@@ -128,7 +132,7 @@ grpc_error* ByteStreamCache::CachingByteStream::Pull(grpc_slice* slice) {
return GRPC_ERROR_NONE;
}
GPR_ASSERT(cache_->underlying_stream_ != nullptr);
- grpc_error* error = cache_->underlying_stream_->Pull(slice);
+ grpc_error_handle error = cache_->underlying_stream_->Pull(slice);
if (error == GRPC_ERROR_NONE) {
grpc_slice_buffer_add(&cache_->cache_buffer_,
grpc_slice_ref_internal(*slice));
@@ -142,7 +146,7 @@ grpc_error* ByteStreamCache::CachingByteStream::Pull(grpc_slice* slice) {
return error;
}
-void ByteStreamCache::CachingByteStream::Shutdown(grpc_error* error) {
+void ByteStreamCache::CachingByteStream::Shutdown(grpc_error_handle error) {
GRPC_ERROR_UNREF(shutdown_error_);
shutdown_error_ = GRPC_ERROR_REF(error);
if (cache_->underlying_stream_ != nullptr) {
diff --git a/contrib/libs/grpc/src/core/lib/transport/byte_stream.h b/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
index e83fb626b32..28dd443a8e9 100644
--- a/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
+++ b/contrib/libs/grpc/src/core/lib/transport/byte_stream.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/closure.h"
@@ -56,7 +57,7 @@ class ByteStream : public Orphanable {
// indicated by Next().
//
// Once a slice is returned into *slice, it is owned by the caller.
- virtual grpc_error* Pull(grpc_slice* slice) = 0;
+ virtual grpc_error_handle Pull(grpc_slice* slice) = 0;
// Shuts down the byte stream.
//
@@ -65,7 +66,7 @@ class ByteStream : public Orphanable {
//
// The next call to Pull() (if any) will return the error passed to
// Shutdown().
- virtual void Shutdown(grpc_error* error) = 0;
+ virtual void Shutdown(grpc_error_handle error) = 0;
uint32_t length() const { return length_; }
uint32_t flags() const { return flags_; }
@@ -97,11 +98,11 @@ class SliceBufferByteStream : public ByteStream {
void Orphan() override;
bool Next(size_t max_size_hint, grpc_closure* on_complete) override;
- grpc_error* Pull(grpc_slice* slice) override;
- void Shutdown(grpc_error* error) override;
+ grpc_error_handle Pull(grpc_slice* slice) override;
+ void Shutdown(grpc_error_handle error) override;
private:
- grpc_error* shutdown_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle shutdown_error_ = GRPC_ERROR_NONE;
grpc_slice_buffer backing_buffer_;
};
@@ -131,8 +132,8 @@ class ByteStreamCache {
void Orphan() override;
bool Next(size_t max_size_hint, grpc_closure* on_complete) override;
- grpc_error* Pull(grpc_slice* slice) override;
- void Shutdown(grpc_error* error) override;
+ grpc_error_handle Pull(grpc_slice* slice) override;
+ void Shutdown(grpc_error_handle error) override;
// Resets the byte stream to the start of the underlying stream.
void Reset();
@@ -141,7 +142,7 @@ class ByteStreamCache {
ByteStreamCache* cache_;
size_t cursor_ = 0;
size_t offset_ = 0;
- grpc_error* shutdown_error_ = GRPC_ERROR_NONE;
+ grpc_error_handle shutdown_error_ = GRPC_ERROR_NONE;
};
explicit ByteStreamCache(OrphanablePtr<ByteStream> underlying_stream);
diff --git a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
index 7b130490177..97c7d775e17 100644
--- a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.cc
@@ -73,7 +73,7 @@ class AsyncConnectivityStateWatcherInterface::Notifier {
}
private:
- static void SendNotification(void* arg, grpc_error* /*ignored*/) {
+ static void SendNotification(void* arg, grpc_error_handle /*ignored*/) {
Notifier* self = static_cast<Notifier*>(arg);
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO, "watcher %p: delivering async notification for %s (%s)",
@@ -101,7 +101,8 @@ void AsyncConnectivityStateWatcherInterface::Notify(
//
ConnectivityStateTracker::~ConnectivityStateTracker() {
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_relaxed);
if (current_state == GRPC_CHANNEL_SHUTDOWN) return;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
@@ -121,7 +122,8 @@ void ConnectivityStateTracker::AddWatcher(
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: add watcher %p", name_,
this, watcher.get());
}
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_relaxed);
if (initial_state != current_state) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO,
@@ -150,14 +152,15 @@ void ConnectivityStateTracker::RemoveWatcher(
void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
const y_absl::Status& status,
const char* reason) {
- grpc_connectivity_state current_state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state current_state =
+ state_.load(std::memory_order_relaxed);
if (state == current_state) return;
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: %s -> %s (%s, %s)",
name_, this, ConnectivityStateName(current_state),
ConnectivityStateName(state), reason, status.ToString().c_str());
}
- state_.Store(state, MemoryOrder::RELAXED);
+ state_.store(state, std::memory_order_relaxed);
status_ = status;
for (const auto& p : watchers_) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
@@ -174,7 +177,7 @@ void ConnectivityStateTracker::SetState(grpc_connectivity_state state,
}
grpc_connectivity_state ConnectivityStateTracker::state() const {
- grpc_connectivity_state state = state_.Load(MemoryOrder::RELAXED);
+ grpc_connectivity_state state = state_.load(std::memory_order_relaxed);
if (GRPC_TRACE_FLAG_ENABLED(grpc_connectivity_state_trace)) {
gpr_log(GPR_INFO, "ConnectivityStateTracker %s[%p]: get current state: %s",
name_, this, ConnectivityStateName(state));
diff --git a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
index d4a41a80381..835504a921d 100644
--- a/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
+++ b/contrib/libs/grpc/src/core/lib/transport/connectivity_state.h
@@ -21,6 +21,7 @@
#include <grpc/support/port_platform.h>
+#include <atomic>
#include <map>
#include <memory>
@@ -29,7 +30,6 @@
#include <grpc/grpc.h>
#include "src/core/lib/debug/trace.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -131,7 +131,7 @@ class ConnectivityStateTracker {
private:
const char* name_;
- Atomic<grpc_connectivity_state> state_;
+ std::atomic<grpc_connectivity_state> state_{grpc_connectivity_state()};
y_absl::Status status_;
// TODO(roth): Once we can use C++-14 heterogeneous lookups, this can
// be a set instead of a map.
diff --git a/contrib/libs/grpc/src/core/lib/transport/error_utils.cc b/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
index 9634f09ad1e..72d555cccd8 100644
--- a/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/error_utils.cc
@@ -21,47 +21,58 @@
#include "src/core/lib/transport/error_utils.h"
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/iomgr/error_internal.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/transport/status_conversion.h"
-static grpc_error* recursively_find_error_with_field(grpc_error* error,
- grpc_error_ints which) {
+static grpc_error_handle recursively_find_error_with_field(
+ grpc_error_handle error, grpc_error_ints which) {
intptr_t unused;
// If the error itself has a status code, return it.
if (grpc_error_get_int(error, which, &unused)) {
return error;
}
- if (grpc_error_is_special(error)) return nullptr;
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ std::vector<y_absl::Status> children = grpc_core::StatusGetChildren(error);
+ for (const y_absl::Status& child : children) {
+ grpc_error_handle result = recursively_find_error_with_field(child, which);
+ if (result != GRPC_ERROR_NONE) return result;
+ }
+#else
+ if (grpc_error_is_special(error)) return GRPC_ERROR_NONE;
// Otherwise, search through its children.
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
reinterpret_cast<grpc_linked_error*>(error->arena + slot);
- grpc_error* result = recursively_find_error_with_field(lerr->err, which);
+ grpc_error_handle result =
+ recursively_find_error_with_field(lerr->err, which);
if (result) return result;
slot = lerr->next;
}
- return nullptr;
+#endif
+ return GRPC_ERROR_NONE;
}
-void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
- grpc_status_code* code, grpc_slice* slice,
+void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
+ grpc_status_code* code, TString* message,
grpc_http2_error_code* http_error,
const char** error_string) {
// Fast path: We expect no error.
if (GPR_LIKELY(error == GRPC_ERROR_NONE)) {
if (code != nullptr) *code = GRPC_STATUS_OK;
- if (slice != nullptr) {
+ if (message != nullptr) {
// Normally, we call grpc_error_get_str(
- // error, GRPC_ERROR_STR_GRPC_MESSAGE, slice).
+ // error, GRPC_ERROR_STR_GRPC_MESSAGE, message).
// We can fastpath since we know that:
// 1) Error is null
// 2) which == GRPC_ERROR_STR_GRPC_MESSAGE
- // 3) The resulting slice is statically known.
- // 4) Said resulting slice is of length 0 ("").
+ // 3) The resulting message is statically known.
+ // 4) Said resulting message is "".
// This means 3 movs, instead of 10s of instructions and a strlen.
- *slice = grpc_core::ExternallyManagedSlice("");
+ *message = "";
}
if (http_error != nullptr) {
*http_error = GRPC_HTTP2_NO_ERROR;
@@ -71,9 +82,9 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
// Start with the parent error and recurse through the tree of children
// until we find the first one that has a status code.
- grpc_error* found_error =
+ grpc_error_handle found_error =
recursively_find_error_with_field(error, GRPC_ERROR_INT_GRPC_STATUS);
- if (found_error == nullptr) {
+ if (found_error == GRPC_ERROR_NONE) {
/// If no grpc-status exists, retry through the tree to find a http2 error
/// code
found_error =
@@ -82,7 +93,7 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
// If we found an error with a status code above, use that; otherwise,
// fall back to using the parent error.
- if (found_error == nullptr) found_error = error;
+ if (found_error == GRPC_ERROR_NONE) found_error = error;
grpc_status_code status = GRPC_STATUS_UNKNOWN;
intptr_t integer;
@@ -92,11 +103,15 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
&integer)) {
status = grpc_http2_error_to_grpc_status(
static_cast<grpc_http2_error_code>(integer), deadline);
+ } else {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ status = static_cast<grpc_status_code>(found_error.code());
+#endif
}
if (code != nullptr) *code = status;
if (error_string != nullptr && status != GRPC_STATUS_OK) {
- *error_string = gpr_strdup(grpc_error_string(error));
+ *error_string = gpr_strdup(grpc_error_std_string(error).c_str());
}
if (http_error != nullptr) {
@@ -114,33 +129,54 @@ void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
// If the error has a status message, use it. Otherwise, fall back to
// the error description.
- if (slice != nullptr) {
- if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE, slice)) {
- if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION, slice)) {
- *slice = grpc_slice_from_static_string("unknown error");
+ if (message != nullptr) {
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE,
+ message)) {
+ if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION,
+ message)) {
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ *message = grpc_error_std_string(error);
+#else
+ *message = "unknown error";
+#endif
}
}
}
}
-y_absl::Status grpc_error_to_absl_status(grpc_error* error) {
+y_absl::Status grpc_error_to_absl_status(grpc_error_handle error) {
grpc_status_code status;
// TODO(yashykt): This should be updated once we decide on how to use the
// y_absl::Status payload to capture all the contents of grpc_error.
- grpc_slice message;
+ TString message;
grpc_error_get_status(error, GRPC_MILLIS_INF_FUTURE, &status, &message,
nullptr /* http_error */, nullptr /* error_string */);
- return y_absl::Status(static_cast<y_absl::StatusCode>(status),
- y_absl::string_view(reinterpret_cast<const char*>(
- GRPC_SLICE_START_PTR(message)),
- GRPC_SLICE_LENGTH(message)));
+ return y_absl::Status(static_cast<y_absl::StatusCode>(status), message);
+}
+
+grpc_error_handle absl_status_to_grpc_error(y_absl::Status status) {
+ // Special error checks
+ if (status.ok()) {
+ return GRPC_ERROR_NONE;
+ }
+ return grpc_error_set_int(
+ GRPC_ERROR_CREATE_FROM_STRING_VIEW(status.message()),
+ GRPC_ERROR_INT_GRPC_STATUS, static_cast<grpc_status_code>(status.code()));
}
-bool grpc_error_has_clear_grpc_status(grpc_error* error) {
+bool grpc_error_has_clear_grpc_status(grpc_error_handle error) {
intptr_t unused;
if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &unused)) {
return true;
}
+#ifdef GRPC_ERROR_IS_ABSEIL_STATUS
+ std::vector<y_absl::Status> children = grpc_core::StatusGetChildren(error);
+ for (const y_absl::Status& child : children) {
+ if (grpc_error_has_clear_grpc_status(child)) {
+ return true;
+ }
+ }
+#else
uint8_t slot = error->first_err;
while (slot != UINT8_MAX) {
grpc_linked_error* lerr =
@@ -150,5 +186,6 @@ bool grpc_error_has_clear_grpc_status(grpc_error* error) {
}
slot = lerr->next;
}
+#endif
return false;
}
diff --git a/contrib/libs/grpc/src/core/lib/transport/error_utils.h b/contrib/libs/grpc/src/core/lib/transport/error_utils.h
index 28db288445f..86725416199 100644
--- a/contrib/libs/grpc/src/core/lib/transport/error_utils.h
+++ b/contrib/libs/grpc/src/core/lib/transport/error_utils.h
@@ -34,19 +34,25 @@
/// be populated with the entire error string. If any of the attributes (code,
/// msg, http_status, error_string) are unneeded, they can be passed as
/// NULL.
-void grpc_error_get_status(grpc_error* error, grpc_millis deadline,
- grpc_status_code* code, grpc_slice* slice,
+void grpc_error_get_status(grpc_error_handle error, grpc_millis deadline,
+ grpc_status_code* code, TString* message,
grpc_http2_error_code* http_error,
const char** error_string);
-/// Utility Function to convert a grpc_error * \a error to an y_absl::Status.
-/// Does NOT consume a ref to grpc_error.
-y_absl::Status grpc_error_to_absl_status(grpc_error* error);
+/// Utility Function to convert a grpc_error_handle \a error to an
+/// y_absl::Status. Does NOT consume a ref to grpc_error.
+y_absl::Status grpc_error_to_absl_status(grpc_error_handle error);
+
+/// Utility function to convert an y_absl::Status \a status to grpc_error. Note
+/// that this method does not return "special case" errors such as
+/// GRPC_ERROR_CANCELLED, with the exception of GRPC_ERROR_NONE returned for
+/// \a y_absl::OkStatus().
+grpc_error_handle absl_status_to_grpc_error(y_absl::Status status);
/// A utility function to check whether there is a clear status code that
/// doesn't need to be guessed in \a error. This means that \a error or some
/// child has GRPC_ERROR_INT_GRPC_STATUS set, or that it is GRPC_ERROR_NONE or
/// GRPC_ERROR_CANCELLED
-bool grpc_error_has_clear_grpc_status(grpc_error* error);
+bool grpc_error_has_clear_grpc_status(grpc_error_handle error);
#endif /* GRPC_CORE_LIB_TRANSPORT_ERROR_UTILS_H */
diff --git a/contrib/libs/grpc/src/core/lib/transport/metadata.cc b/contrib/libs/grpc/src/core/lib/transport/metadata.cc
index ef1e07d2cd0..004e44af23e 100644
--- a/contrib/libs/grpc/src/core/lib/transport/metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/metadata.cc
@@ -145,10 +145,10 @@ AllocatedMetadata::AllocatedMetadata(
AllocatedMetadata::~AllocatedMetadata() {
grpc_slice_unref_internal(key());
grpc_slice_unref_internal(value());
- void* user_data = user_data_.data.Load(grpc_core::MemoryOrder::RELAXED);
+ void* user_data = user_data_.data.load(std::memory_order_relaxed);
if (user_data) {
destroy_user_data_func destroy_user_data =
- user_data_.destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED);
+ user_data_.destroy_user_data.load(std::memory_order_relaxed);
destroy_user_data(user_data);
}
}
@@ -189,10 +189,10 @@ InternedMetadata::InternedMetadata(const grpc_slice& key,
InternedMetadata::~InternedMetadata() {
grpc_slice_unref_internal(key());
grpc_slice_unref_internal(value());
- void* user_data = user_data_.data.Load(grpc_core::MemoryOrder::RELAXED);
+ void* user_data = user_data_.data.load(std::memory_order_relaxed);
if (user_data) {
destroy_user_data_func destroy_user_data =
- user_data_.destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED);
+ user_data_.destroy_user_data.load(std::memory_order_relaxed);
destroy_user_data(user_data);
}
}
@@ -279,9 +279,9 @@ void grpc_mdctx_global_shutdown() {
#ifndef NDEBUG
static int is_mdelem_static(grpc_mdelem e) {
return reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) >=
- &grpc_static_mdelem_table()[0] &&
+ &grpc_core::g_static_mdelem_table[0] &&
reinterpret_cast<grpc_core::StaticMetadata*>(GRPC_MDELEM_DATA(e)) <
- &grpc_static_mdelem_table()[GRPC_STATIC_MDELEM_COUNT];
+ &grpc_core::g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
}
#endif
@@ -549,20 +549,41 @@ grpc_mdelem grpc_mdelem_from_slices(
}
grpc_mdelem grpc_mdelem_from_grpc_metadata(grpc_metadata* metadata) {
- bool changed = false;
+ bool key_changed = false;
grpc_slice key_slice =
- grpc_slice_maybe_static_intern(metadata->key, &changed);
+ grpc_slice_maybe_static_intern(metadata->key, &key_changed);
+ bool value_changed = false;
+ grpc_slice* unref_slice = nullptr;
grpc_slice value_slice =
- grpc_slice_maybe_static_intern(metadata->value, &changed);
- return grpc_mdelem_create(
- key_slice, value_slice,
- changed ? nullptr : reinterpret_cast<grpc_mdelem_data*>(metadata));
+ grpc_slice_maybe_static_intern(metadata->value, &value_changed);
+ // If key or value changed, but the other didn't.... AND the other is a NOP
+ // refcount, then we need to convert it to a slice with a refcount else we run
+ // the risk of leaving a dangling reference to that metadata on the heap via
+ // this mdelem.
+ if (key_changed && !value_changed && value_slice.refcount != nullptr &&
+ value_slice.refcount->GetType() == grpc_slice_refcount::Type::NOP) {
+ value_slice = grpc_slice_copy(value_slice);
+ unref_slice = &value_slice;
+ value_changed = true;
+ } else if (!key_changed && value_changed && key_slice.refcount != nullptr &&
+ key_slice.refcount->GetType() == grpc_slice_refcount::Type::NOP) {
+ key_slice = grpc_slice_copy(key_slice);
+ unref_slice = &key_slice;
+ key_changed = true;
+ }
+ auto mdelem =
+ grpc_mdelem_create(key_slice, value_slice,
+ key_changed || value_changed
+ ? nullptr
+ : reinterpret_cast<grpc_mdelem_data*>(metadata));
+ if (unref_slice != nullptr) grpc_slice_unref_internal(*unref_slice);
+ return mdelem;
}
static void* get_user_data(UserData* user_data, void (*destroy_func)(void*)) {
- if (user_data->destroy_user_data.Load(grpc_core::MemoryOrder::ACQUIRE) ==
+ if (user_data->destroy_user_data.load(std::memory_order_acquire) ==
destroy_func) {
- return user_data->data.Load(grpc_core::MemoryOrder::RELAXED);
+ return user_data->data.load(std::memory_order_relaxed);
} else {
return nullptr;
}
@@ -577,7 +598,7 @@ void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*destroy_func)(void*)) {
grpc_static_mdelem_user_data
[reinterpret_cast<grpc_core::StaticMetadata*>(
GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table()]);
+ grpc_core::g_static_mdelem_table]);
case GRPC_MDELEM_STORAGE_ALLOCATED: {
auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
return get_user_data(am->user_data(), destroy_func);
@@ -594,16 +615,16 @@ static void* set_user_data(UserData* ud, void (*destroy_func)(void*),
void* data) {
GPR_ASSERT((data == nullptr) == (destroy_func == nullptr));
grpc_core::ReleasableMutexLock lock(&ud->mu_user_data);
- if (ud->destroy_user_data.Load(grpc_core::MemoryOrder::RELAXED)) {
+ if (ud->destroy_user_data.load(std::memory_order_relaxed)) {
/* user data can only be set once */
lock.Release();
if (destroy_func != nullptr) {
destroy_func(data);
}
- return ud->data.Load(grpc_core::MemoryOrder::RELAXED);
+ return ud->data.load(std::memory_order_relaxed);
}
- ud->data.Store(data, grpc_core::MemoryOrder::RELAXED);
- ud->destroy_user_data.Store(destroy_func, grpc_core::MemoryOrder::RELEASE);
+ ud->data.store(data, std::memory_order_relaxed);
+ ud->destroy_user_data.store(destroy_func, std::memory_order_release);
return data;
}
@@ -619,7 +640,7 @@ void* grpc_mdelem_set_user_data(grpc_mdelem md, void (*destroy_func)(void*),
grpc_static_mdelem_user_data
[reinterpret_cast<grpc_core::StaticMetadata*>(
GRPC_MDELEM_DATA(md)) -
- grpc_static_mdelem_table()]);
+ grpc_core::g_static_mdelem_table]);
case GRPC_MDELEM_STORAGE_ALLOCATED: {
auto* am = reinterpret_cast<AllocatedMetadata*>(GRPC_MDELEM_DATA(md));
return set_user_data(am->user_data(), destroy_func, data);
diff --git a/contrib/libs/grpc/src/core/lib/transport/metadata.h b/contrib/libs/grpc/src/core/lib/transport/metadata.h
index e6de4ea9a99..88128192481 100644
--- a/contrib/libs/grpc/src/core/lib/transport/metadata.h
+++ b/contrib/libs/grpc/src/core/lib/transport/metadata.h
@@ -21,14 +21,14 @@
#include <grpc/support/port_platform.h>
-#include <grpc/impl/codegen/log.h>
+#include <atomic>
#include <grpc/grpc.h>
+#include <grpc/impl/codegen/log.h>
#include <grpc/slice.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/gprpp/atomic.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/slice/slice_utils.h"
@@ -203,8 +203,8 @@ typedef void (*destroy_user_data_func)(void* data);
struct UserData {
Mutex mu_user_data;
- grpc_core::Atomic<destroy_user_data_func> destroy_user_data;
- grpc_core::Atomic<void*> data;
+ std::atomic<destroy_user_data_func> destroy_user_data{nullptr};
+ std::atomic<void*> data{nullptr};
};
class StaticMetadata {
@@ -241,7 +241,7 @@ class RefcountedMdBase {
#ifndef NDEBUG
void Ref(const char* file, int line) {
grpc_mdelem_trace_ref(this, key_, value_, RefValue(), file, line);
- const intptr_t prior = refcnt_.FetchAdd(1, MemoryOrder::RELAXED);
+ const intptr_t prior = refcnt_.fetch_add(1, std::memory_order_relaxed);
GPR_ASSERT(prior > 0);
}
bool Unref(const char* file, int line) {
@@ -253,10 +253,10 @@ class RefcountedMdBase {
/* we can assume the ref count is >= 1 as the application is calling
this function - meaning that no adjustment to mdtab_free is necessary,
simplifying the logic here to be just an atomic increment */
- refcnt_.FetchAdd(1, MemoryOrder::RELAXED);
+ refcnt_.fetch_add(1, std::memory_order_relaxed);
}
bool Unref() {
- const intptr_t prior = refcnt_.FetchSub(1, MemoryOrder::ACQ_REL);
+ const intptr_t prior = refcnt_.fetch_sub(1, std::memory_order_acq_rel);
GPR_DEBUG_ASSERT(prior > 0);
return prior == 1;
}
@@ -266,15 +266,17 @@ class RefcountedMdBase {
void TraceAtStart(const char* tag);
#endif
- intptr_t RefValue() { return refcnt_.Load(MemoryOrder::RELAXED); }
- bool AllRefsDropped() { return refcnt_.Load(MemoryOrder::ACQUIRE) == 0; }
- bool FirstRef() { return refcnt_.FetchAdd(1, MemoryOrder::RELAXED) == 0; }
+ intptr_t RefValue() { return refcnt_.load(std::memory_order_relaxed); }
+ bool AllRefsDropped() { return refcnt_.load(std::memory_order_acquire) == 0; }
+ bool FirstRef() {
+ return refcnt_.fetch_add(1, std::memory_order_relaxed) == 0;
+ }
private:
/* must be byte compatible with grpc_mdelem_data */
grpc_slice key_;
grpc_slice value_;
- grpc_core::Atomic<intptr_t> refcnt_;
+ std::atomic<intptr_t> refcnt_{0};
uint32_t hash_ = 0;
};
@@ -311,10 +313,10 @@ class AllocatedMetadata : public RefcountedMdBase {
// TODO(arjunroy): Change to use strongly typed slices instead.
struct NoRefKey {};
AllocatedMetadata(const grpc_slice& key, const grpc_slice& value);
- AllocatedMetadata(const grpc_core::ManagedMemorySlice& key,
- const grpc_core::UnmanagedMemorySlice& value);
- AllocatedMetadata(const grpc_core::ExternallyManagedSlice& key,
- const grpc_core::UnmanagedMemorySlice& value);
+ AllocatedMetadata(const ManagedMemorySlice& key,
+ const UnmanagedMemorySlice& value);
+ AllocatedMetadata(const ExternallyManagedSlice& key,
+ const UnmanagedMemorySlice& value);
AllocatedMetadata(const grpc_slice& key, const grpc_slice& value,
const NoRefKey*);
~AllocatedMetadata();
@@ -407,7 +409,8 @@ inline void grpc_mdelem_unref(grpc_mdelem gmd) {
(GRPC_SLICE_LENGTH(GRPC_MDKEY((e))) + GRPC_SLICE_LENGTH(GRPC_MDVALUE((e))) + \
32)
-#define GRPC_MDSTR_KV_HASH(k_hash, v_hash) (GPR_ROTL((k_hash), 2) ^ (v_hash))
+#define GRPC_MDSTR_KV_HASH(k_hash, v_hash) \
+ (::grpc_core::RotateLeft(size_t(k_hash), size_t(2)) ^ (v_hash))
void grpc_mdctx_global_init(void);
void grpc_mdctx_global_shutdown();
diff --git a/contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc b/contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc
index 466a135c0f0..cef8a04dfb1 100644
--- a/contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/metadata_batch.cc
@@ -24,7 +24,6 @@
#include <string.h>
#include "y_absl/container/inlined_vector.h"
-#include "y_absl/strings/str_join.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -33,263 +32,6 @@
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"
-static void assert_valid_list(grpc_mdelem_list* list) {
-#ifndef NDEBUG
- grpc_linked_mdelem* l;
-
- GPR_ASSERT((list->head == nullptr) == (list->tail == nullptr));
- if (!list->head) return;
- GPR_ASSERT(list->head->prev == nullptr);
- GPR_ASSERT(list->tail->next == nullptr);
- GPR_ASSERT((list->head == list->tail) == (list->head->next == nullptr));
-
- size_t verified_count = 0;
- for (l = list->head; l; l = l->next) {
- GPR_ASSERT(!GRPC_MDISNULL(l->md));
- GPR_ASSERT((l->prev == nullptr) == (l == list->head));
- GPR_ASSERT((l->next == nullptr) == (l == list->tail));
- if (l->next) GPR_ASSERT(l->next->prev == l);
- if (l->prev) GPR_ASSERT(l->prev->next == l);
- verified_count++;
- }
- GPR_ASSERT(list->count == verified_count);
-#else
- // Avoid unused-parameter warning for debug-only parameter
- (void)list;
-#endif /* NDEBUG */
-}
-
-static void assert_valid_callouts(grpc_metadata_batch* batch) {
-#ifndef NDEBUG
- for (grpc_linked_mdelem* l = batch->list.head; l != nullptr; l = l->next) {
- grpc_slice key_interned = grpc_slice_intern(GRPC_MDKEY(l->md));
- grpc_metadata_batch_callouts_index callout_idx =
- GRPC_BATCH_INDEX_OF(key_interned);
- if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
- GPR_ASSERT(batch->idx.array[callout_idx] == l);
- }
- grpc_slice_unref_internal(key_interned);
- }
-#else
- // Avoid unused-parameter warning for debug-only parameter
- (void)batch;
-#endif
-}
-
-#ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
- assert_valid_list(&batch->list);
-}
-#endif /* NDEBUG */
-
-void grpc_metadata_batch_init(grpc_metadata_batch* batch) {
- memset(batch, 0, sizeof(*batch));
- batch->deadline = GRPC_MILLIS_INF_FUTURE;
-}
-
-void grpc_metadata_batch_destroy(grpc_metadata_batch* batch) {
- grpc_linked_mdelem* l;
- for (l = batch->list.head; l; l = l->next) {
- GRPC_MDELEM_UNREF(l->md);
- }
-}
-
-grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md) {
- grpc_error* out = grpc_error_set_str(
- grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
- grpc_slice_ref_internal(GRPC_MDKEY(md))),
- GRPC_ERROR_STR_VALUE, grpc_slice_ref_internal(GRPC_MDVALUE(md)));
- return out;
-}
-
-static grpc_error* GPR_ATTRIBUTE_NOINLINE error_with_md(grpc_mdelem md) {
- return grpc_attach_md_to_error(
- GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"), md);
-}
-
-static grpc_error* link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(idx >= 0 && idx < GRPC_BATCH_CALLOUTS_COUNT);
- if (GPR_LIKELY(batch->idx.array[idx] == nullptr)) {
- ++batch->list.default_count;
- batch->idx.array[idx] = storage;
- return GRPC_ERROR_NONE;
- }
- return error_with_md(storage->md);
-}
-
-static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-
-static grpc_error* maybe_link_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_callouts_index idx =
- GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
- if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
- return GRPC_ERROR_NONE;
- }
- return link_callout(batch, storage, idx);
-}
-
-static void maybe_unlink_callout(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_callouts_index idx =
- GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
- if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
- return;
- }
- --batch->list.default_count;
- GPR_DEBUG_ASSERT(batch->idx.array[idx] != nullptr);
- batch->idx.array[idx] = nullptr;
-}
-
-grpc_error* grpc_metadata_batch_add_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_link_head(batch, storage);
-}
-
-static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
- storage->prev = nullptr;
- storage->next = list->head;
- storage->reserved = nullptr;
- if (list->head != nullptr) {
- list->head->prev = storage;
- } else {
- list->tail = storage;
- }
- list->head = storage;
- list->count++;
- assert_valid_list(list);
-}
-
-grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- grpc_error* err = maybe_link_callout(batch, storage);
- if (err != GRPC_ERROR_NONE) {
- assert_valid_callouts(batch);
- return err;
- }
- link_head(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-// TODO(arjunroy): Need to revisit this and see what guarantees exist between
-// C-core and the internal-metadata subsystem. E.g. can we ensure a particular
-// metadata is never added twice, even in the presence of user supplied data?
-grpc_error* grpc_metadata_batch_link_head(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
- assert_valid_callouts(batch);
- grpc_error* err = link_callout(batch, storage, idx);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
- assert_valid_callouts(batch);
- return err;
- }
- link_head(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* grpc_metadata_batch_add_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) {
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
- storage->md = elem_to_add;
- return grpc_metadata_batch_link_tail(batch, storage);
-}
-
-static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
- storage->prev = list->tail;
- storage->next = nullptr;
- storage->reserved = nullptr;
- if (list->tail != nullptr) {
- list->tail->next = storage;
- } else {
- list->head = storage;
- }
- list->tail = storage;
- list->count++;
- assert_valid_list(list);
-}
-
-grpc_error* grpc_metadata_batch_link_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- grpc_error* err = maybe_link_callout(batch, storage);
- if (err != GRPC_ERROR_NONE) {
- assert_valid_callouts(batch);
- return err;
- }
- link_tail(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-grpc_error* grpc_metadata_batch_link_tail(
- grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) {
- GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
- assert_valid_callouts(batch);
- grpc_error* err = link_callout(batch, storage, idx);
- if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
- assert_valid_callouts(batch);
- return err;
- }
- link_tail(&batch->list, storage);
- assert_valid_callouts(batch);
- return GRPC_ERROR_NONE;
-}
-
-static void unlink_storage(grpc_mdelem_list* list,
- grpc_linked_mdelem* storage) {
- assert_valid_list(list);
- if (storage->prev != nullptr) {
- storage->prev->next = storage->next;
- } else {
- list->head = storage->next;
- }
- if (storage->next != nullptr) {
- storage->next->prev = storage->prev;
- } else {
- list->tail = storage->prev;
- }
- list->count--;
- assert_valid_list(list);
-}
-
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage) {
- assert_valid_callouts(batch);
- maybe_unlink_callout(batch, storage);
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- assert_valid_callouts(batch);
-}
-
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_metadata_batch_callouts_index idx) {
- assert_valid_callouts(batch);
- grpc_linked_mdelem* storage = batch->idx.array[idx];
- GPR_DEBUG_ASSERT(storage != nullptr);
- --batch->list.default_count;
- batch->idx.array[idx] = nullptr;
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- assert_valid_callouts(batch);
-}
-
void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
const grpc_slice& value) {
grpc_mdelem old_mdelem = storage->md;
@@ -299,121 +41,59 @@ void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
GRPC_MDELEM_UNREF(old_mdelem);
}
-y_absl::optional<y_absl::string_view> grpc_metadata_batch_get_value(
- grpc_metadata_batch* batch, y_absl::string_view target_key,
- TString* concatenated_value) {
- // Find all values for the specified key.
- GPR_DEBUG_ASSERT(batch != nullptr);
- y_absl::InlinedVector<y_absl::string_view, 1> values;
- for (grpc_linked_mdelem* md = batch->list.head; md != nullptr;
- md = md->next) {
- y_absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md->md));
- y_absl::string_view value =
- grpc_core::StringViewFromSlice(GRPC_MDVALUE(md->md));
- if (target_key == key) values.push_back(value);
- }
- // If none found, no match.
- if (values.empty()) return y_absl::nullopt;
- // If exactly one found, return it as-is.
- if (values.size() == 1) return values.front();
- // If more than one found, concatenate the values, using
- // *concatenated_values as a temporary holding place for the
- // concatenated string.
- *concatenated_value = y_absl::StrJoin(values, ",");
- return *concatenated_value;
-}
-
-grpc_error* grpc_metadata_batch_substitute(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem new_mdelem) {
- assert_valid_callouts(batch);
- grpc_error* error = GRPC_ERROR_NONE;
- grpc_mdelem old_mdelem = storage->md;
- if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
- maybe_unlink_callout(batch, storage);
- storage->md = new_mdelem;
- error = maybe_link_callout(batch, storage);
- if (error != GRPC_ERROR_NONE) {
- unlink_storage(&batch->list, storage);
- GRPC_MDELEM_UNREF(storage->md);
- }
- } else {
- storage->md = new_mdelem;
- }
- GRPC_MDELEM_UNREF(old_mdelem);
- assert_valid_callouts(batch);
- return error;
-}
-
-void grpc_metadata_batch_clear(grpc_metadata_batch* batch) {
- grpc_metadata_batch_destroy(batch);
- grpc_metadata_batch_init(batch);
-}
-
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch) {
- return batch->list.head == nullptr &&
- batch->deadline == GRPC_MILLIS_INF_FUTURE;
-}
-
-size_t grpc_metadata_batch_size(grpc_metadata_batch* batch) {
- size_t size = 0;
- for (grpc_linked_mdelem* elem = batch->list.head; elem != nullptr;
- elem = elem->next) {
- size += GRPC_MDELEM_LENGTH(elem->md);
- }
- return size;
-}
+namespace {
-static void add_error(grpc_error** composite, grpc_error* error,
- const char* composite_error_string) {
- if (error == GRPC_ERROR_NONE) return;
- if (*composite == GRPC_ERROR_NONE) {
- *composite = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
- }
- *composite = grpc_error_add_child(*composite, error);
-}
+class CopySink {
+ public:
+ explicit CopySink(grpc_metadata_batch* dst) : dst_(dst) {}
-grpc_error* grpc_metadata_batch_filter(grpc_metadata_batch* batch,
- grpc_metadata_batch_filter_func func,
- void* user_data,
- const char* composite_error_string) {
- grpc_linked_mdelem* l = batch->list.head;
- grpc_error* error = GRPC_ERROR_NONE;
- while (l) {
- grpc_linked_mdelem* next = l->next;
- grpc_filtered_mdelem new_mdelem = func(user_data, l->md);
- add_error(&error, new_mdelem.error, composite_error_string);
- if (GRPC_MDISNULL(new_mdelem.md)) {
- grpc_metadata_batch_remove(batch, l);
- } else if (new_mdelem.md.payload != l->md.payload) {
- grpc_metadata_batch_substitute(batch, l, new_mdelem.md);
+ void Encode(grpc_mdelem md) {
+ // If the mdelem is not external, take a ref.
+ // Otherwise, create a new copy, holding its own refs to the
+ // underlying slices.
+ if (GRPC_MDELEM_STORAGE(md) != GRPC_MDELEM_STORAGE_EXTERNAL) {
+ md = GRPC_MDELEM_REF(md);
+ } else {
+ md = grpc_mdelem_from_slices(grpc_slice_copy(GRPC_MDKEY(md)),
+ grpc_slice_copy(GRPC_MDVALUE(md)));
}
- l = next;
- }
- return error;
-}
-
-void grpc_metadata_batch_copy(grpc_metadata_batch* src,
- grpc_metadata_batch* dst,
- grpc_linked_mdelem* storage) {
- grpc_metadata_batch_init(dst);
- dst->deadline = src->deadline;
- size_t i = 0;
- for (grpc_linked_mdelem* elem = src->list.head; elem != nullptr;
- elem = elem->next) {
// Error unused in non-debug builds.
- grpc_error* GRPC_UNUSED error = grpc_metadata_batch_add_tail(
- dst, &storage[i++], GRPC_MDELEM_REF(elem->md));
- // The only way that grpc_metadata_batch_add_tail() can fail is if
+ grpc_error_handle GRPC_UNUSED error = dst_->Append(md);
+ // The only way that Append() can fail is if
// there's a duplicate entry for a callout. However, that can't be
// the case here, because we would not have been allowed to create
// a source batch that had that kind of conflict.
GPR_DEBUG_ASSERT(error == GRPC_ERROR_NONE);
}
-}
-void grpc_metadata_batch_move(grpc_metadata_batch* src,
+ template <class T, class V>
+ void Encode(T trait, V value) {
+ dst_->Set(trait, value);
+ }
+
+ template <class T>
+ void Encode(T trait, const grpc_core::Slice& value) {
+ dst_->Set(trait, std::move(value.AsOwned()));
+ }
+
+ private:
+ grpc_metadata_batch* dst_;
+};
+
+} // namespace
+
+void grpc_metadata_batch_copy(const grpc_metadata_batch* src,
grpc_metadata_batch* dst) {
- *dst = *src;
- grpc_metadata_batch_init(src);
+ dst->Clear();
+ CopySink sink(dst);
+ src->Encode(&sink);
+}
+
+grpc_error_handle grpc_attach_md_to_error(grpc_error_handle src,
+ grpc_mdelem md) {
+ grpc_error_handle out = grpc_error_set_str(
+ grpc_error_set_str(src, GRPC_ERROR_STR_KEY,
+ grpc_core::StringViewFromSlice(GRPC_MDKEY(md))),
+ GRPC_ERROR_STR_VALUE, grpc_core::StringViewFromSlice(GRPC_MDVALUE(md)));
+ return out;
}
diff --git a/contrib/libs/grpc/src/core/lib/transport/metadata_batch.h b/contrib/libs/grpc/src/core/lib/transport/metadata_batch.h
index bc8c8a0cd4a..2052ba640bf 100644
--- a/contrib/libs/grpc/src/core/lib/transport/metadata_batch.h
+++ b/contrib/libs/grpc/src/core/lib/transport/metadata_batch.h
@@ -23,15 +23,23 @@
#include <stdbool.h>
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/str_join.h"
#include "y_absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/time.h>
+#include "src/core/lib/gprpp/chunked_vector.h"
+#include "src/core/lib/gprpp/table.h"
#include "src/core/lib/iomgr/exec_ctx.h"
+#include "src/core/lib/slice/slice.h"
+#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/metadata.h"
+#include "src/core/lib/transport/parsed_metadata.h"
#include "src/core/lib/transport/static_metadata.h"
+#include "src/core/lib/transport/timeout_encoding.h"
typedef struct grpc_linked_mdelem {
grpc_linked_mdelem() {}
@@ -49,34 +57,951 @@ typedef struct grpc_mdelem_list {
grpc_linked_mdelem* tail;
} grpc_mdelem_list;
-typedef struct grpc_metadata_batch {
+struct grpc_filtered_mdelem {
+ grpc_error_handle error;
+ grpc_mdelem md;
+};
+#define GRPC_FILTERED_ERROR(error) \
+ { (error), GRPC_MDNULL }
+#define GRPC_FILTERED_MDELEM(md) \
+ { GRPC_ERROR_NONE, (md) }
+#define GRPC_FILTERED_REMOVE() \
+ { GRPC_ERROR_NONE, GRPC_MDNULL }
+
+grpc_error_handle grpc_attach_md_to_error(grpc_error_handle src,
+ grpc_mdelem md);
+
+namespace grpc_core {
+
+// grpc-timeout metadata trait.
+// ValueType is defined as grpc_millis - an absolute timestamp (i.e. a
+// deadline!), that is converted to a duration by transports before being
+// sent.
+// TODO(ctiller): Move this elsewhere. During the transition we need to be able
+// to name this in MetadataMap, but ultimately once the transition is done we
+// should not need to.
+struct GrpcTimeoutMetadata {
+ using ValueType = grpc_millis;
+ using MementoType = grpc_millis;
+ static y_absl::string_view key() { return "grpc-timeout"; }
+ static MementoType ParseMemento(Slice value) {
+ grpc_millis timeout;
+ if (GPR_UNLIKELY(!grpc_http2_decode_timeout(value.c_slice(), &timeout))) {
+ timeout = GRPC_MILLIS_INF_FUTURE;
+ }
+ return timeout;
+ }
+ static ValueType MementoToValue(MementoType timeout) {
+ if (timeout == GRPC_MILLIS_INF_FUTURE) {
+ return GRPC_MILLIS_INF_FUTURE;
+ }
+ return ExecCtx::Get()->Now() + timeout;
+ }
+ static Slice Encode(ValueType x) {
+ char timeout[GRPC_HTTP2_TIMEOUT_ENCODE_MIN_BUFSIZE];
+ grpc_http2_encode_timeout(x, timeout);
+ return Slice::FromCopiedString(timeout);
+ }
+ static MementoType DisplayValue(MementoType x) { return x; }
+};
+
+// TE metadata trait.
+struct TeMetadata {
+ // HTTP2 says that TE can either be empty or "trailers".
+ // Empty means this trait is not included, "trailers" means kTrailers, and
+ // kInvalid is used to remember an invalid value.
+ enum ValueType : uint8_t {
+ kTrailers,
+ kInvalid,
+ };
+ using MementoType = ValueType;
+ static y_absl::string_view key() { return "te"; }
+ static MementoType ParseMemento(Slice value) {
+ auto out = kInvalid;
+ if (value == "trailers") {
+ out = kTrailers;
+ }
+ return out;
+ }
+ static ValueType MementoToValue(MementoType te) { return te; }
+ static StaticSlice Encode(ValueType x) {
+ GPR_ASSERT(x == kTrailers);
+ return StaticSlice(GRPC_MDSTR_TRAILERS);
+ }
+ static const char* DisplayValue(MementoType te) {
+ switch (te) {
+ case ValueType::kTrailers:
+ return "trailers";
+ default:
+ return "<discarded-invalid-value>";
+ }
+ }
+};
+
+struct SimpleSliceBasedMetadata {
+ using ValueType = Slice;
+ using MementoType = Slice;
+ static MementoType ParseMemento(Slice value) { return value.TakeOwned(); }
+ static ValueType MementoToValue(MementoType value) { return value; }
+ static Slice Encode(const ValueType& x) { return x.Ref(); }
+ static y_absl::string_view DisplayValue(const MementoType& value) {
+ return value.as_string_view();
+ }
+};
+
+// user-agent metadata trait.
+struct UserAgentMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "user-agent"; }
+};
+
+// grpc-message metadata trait.
+struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "grpc-message"; }
+};
+
+// host metadata trait.
+struct HostMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "host"; }
+};
+
+// x-endpoint-load-metrics-bin metadata trait.
+struct XEndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "x-endpoint-load-metrics-bin"; }
+};
+
+// grpc-server-stats-bin metadata trait.
+struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "grpc-server-stats-bin"; }
+};
+
+// grpc-trace-bin metadata trait.
+struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "grpc-trace-bin"; }
+};
+
+// grpc-tags-bin metadata trait.
+struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
+ static y_absl::string_view key() { return "grpc-tags-bin"; }
+};
+
+namespace metadata_detail {
+
+// Helper type - maps a string name to a trait.
+template <typename... Traits>
+struct NameLookup;
+
+template <typename Trait, typename... Traits>
+struct NameLookup<Trait, Traits...> {
+ // Call op->Found(Trait()) if op->name == Trait::key() for some Trait in
+ // Traits. If not found, call op->NotFount().
+ template <typename Op>
+ static auto Lookup(y_absl::string_view key, Op* op)
+ -> decltype(op->Found(Trait())) {
+ if (key == Trait::key()) {
+ return op->Found(Trait());
+ }
+ return NameLookup<Traits...>::Lookup(key, op);
+ }
+};
+
+template <>
+struct NameLookup<> {
+ template <typename Op>
+ static auto Lookup(y_absl::string_view key, Op* op)
+ -> decltype(op->NotFound(key)) {
+ return op->NotFound(key);
+ }
+};
+
+// Helper to take a slice to a memento to a value.
+// By splitting this part out we can scale code size as the number of (memento,
+// value) types, rather than as the number of traits.
+template <typename ParseMementoFn, typename MementoToValueFn>
+struct ParseValue {
+ template <ParseMementoFn parse_memento, MementoToValueFn memento_to_value>
+ static GPR_ATTRIBUTE_NOINLINE auto Parse(Slice* value)
+ -> decltype(memento_to_value(parse_memento(std::move(*value)))) {
+ return memento_to_value(parse_memento(std::move(*value)));
+ }
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
+// ParsedMetadata object.
+template <typename Container>
+class ParseHelper {
+ public:
+ ParseHelper(Slice value, size_t transport_size)
+ : value_(std::move(value)), transport_size_(transport_size) {}
+
+ template <typename Trait>
+ ParsedMetadata<Container> Found(Trait trait) {
+ return ParsedMetadata<Container>(
+ trait, Trait::ParseMemento(std::move(value_)), transport_size_);
+ }
+
+ GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
+ y_absl::string_view key) {
+ return ParsedMetadata<Container>(
+ grpc_mdelem_from_slices(grpc_slice_intern(grpc_slice_from_static_buffer(
+ key.data(), key.size())),
+ value_.TakeCSlice()));
+ }
+
+ private:
+ Slice value_;
+ const size_t transport_size_;
+};
+
+// This is an "Op" type for NameLookup.
+// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
+// value and add it to a container.
+template <typename Container>
+class AppendHelper {
+ public:
+ AppendHelper(Container* container, Slice value)
+ : container_(container), value_(std::move(value)) {}
+
+ template <typename Trait>
+ GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
+ container_->Set(
+ trait, ParseValue<decltype(Trait::ParseMemento),
+ decltype(Trait::MementoToValue)>::
+ template Parse<Trait::ParseMemento, Trait::MementoToValue>(
+ &value_));
+ }
+
+ void NotFound(y_absl::string_view key) {
+ GPR_ASSERT(GRPC_ERROR_NONE ==
+ container_->Append(grpc_mdelem_from_slices(
+ grpc_slice_intern(
+ grpc_slice_from_static_buffer(key.data(), key.length())),
+ value_.TakeCSlice())));
+ }
+
+ private:
+ Container* const container_;
+ Slice value_;
+};
+
+} // namespace metadata_detail
+
+// MetadataMap encodes the mapping of metadata keys to metadata values.
+// Right now the API presented is the minimal one that will allow us to
+// substitute this type for grpc_metadata_batch in a relatively easy fashion. At
+// that point we'll start iterating this API into something that's ergonomic
+// again, whilst minimally holding the performance bar already set (and
+// hopefully improving some things).
+// In the meantime, we're not going to invest much time in ephemeral API
+// documentation, so if you must use one of these APIs and it's not obvious
+// how, reach out to ctiller.
+//
+// MetadataMap takes a list of traits. Each of these trait objects defines
+// one metadata field that is used by core, and so should have more specialized
+// handling than just using the generic APIs.
+//
+// Each trait object has the following signature:
+// // Traits for the grpc-xyz metadata field:
+// struct GrpcXyzMetadata {
+// // The type that's stored on MetadataBatch
+// using ValueType = ...;
+// // The type that's stored in compression/decompression tables
+// using MementoType = ...;
+// // The string key for this metadata type (for transports that require it)
+// static y_absl::string_view key() { return "grpc-xyz"; }
+// // Parse a memento from a slice
+// // Takes ownership of value
+// static MementoType ParseMemento(Slice value) { ... }
+// // Convert a memento to a value
+// static ValueType MementoToValue(MementoType memento) { ... }
+// // Convert a value to its canonical text wire format (the format that
+// // ParseMemento will accept!)
+// static Slice Encode(const ValueType& value);
+// // Convert a value to something that can be passed to StrCat and displayed
+// // for debugging
+// static SomeStrCatableType DisplayValue(MementoType value) { ... }
+// };
+//
+// About parsing and mementos:
+//
+// Many gRPC transports exchange metadata as key/value strings, but also allow
+// for a more efficient representation as a single integer. We can use this
+// integer representation to avoid reparsing too, by storing the parsed value
+// in the compression table. This is what mementos are used for.
+//
+// A trait offers the capability to turn a slice into a memento via
+// ParseMemento. This is exposed to users of MetadataMap via the Parse() method,
+// that returns a ParsedMetadata object. That ParsedMetadata object can in turn
+// be used to set the same value on many different MetadataMaps without having
+// to reparse.
+//
+// Implementation wise, ParsedMetadata is a type erased wrapper around
+// MementoType. When we set a value on MetadataMap, we first turn that memento
+// into a value. For most types, this is going to be a no-op, but for example
+// for grpc-timeout we make the memento the timeout expressed on the wire, but
+// we make the value the timestamp of when the timeout will expire (i.e. the
+// deadline).
+template <typename... Traits>
+class MetadataMap {
+ public:
+ explicit MetadataMap(Arena* arena);
+ ~MetadataMap();
+
+ MetadataMap(const MetadataMap&) = delete;
+ MetadataMap& operator=(const MetadataMap&) = delete;
+ MetadataMap(MetadataMap&&) noexcept;
+ MetadataMap& operator=(MetadataMap&&) noexcept;
+
+ // Encode this metadata map into some encoder.
+ // For each field that is set in the MetadataMap, call
+ // encoder->Encode.
+ //
+ // For fields for which we have traits, this will be a method with
+ // the signature:
+ // void Encode(TraitsType, typename TraitsType::ValueType value);
+ // For fields for which we do not have traits, this will be a method
+ // with the signature:
+ // void Encode(grpc_mdelem md);
+ // TODO(ctiller): It's expected that the latter Encode method will
+ // become Encode(Slice, Slice) by the end of the current metadata API
+ // transitions.
+ template <typename Encoder>
+ void Encode(Encoder* encoder) const {
+ for (auto* l = list_.head; l; l = l->next) {
+ encoder->Encode(l->md);
+ }
+ table_.ForEach(EncodeWrapper<Encoder>{encoder});
+ }
+
+ // Get the pointer to the value of some known metadata.
+ // Returns nullptr if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ const typename Which::ValueType* get_pointer(Which) const {
+ if (auto* p = table_.template get<Value<Which>>()) return &p->value;
+ return nullptr;
+ }
+
+ // Get the pointer to the value of some known metadata.
+ // Returns nullptr if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ typename Which::ValueType* get_pointer(Which) {
+ if (auto* p = table_.template get<Value<Which>>()) return &p->value;
+ return nullptr;
+ }
+
+ // Get the value of some known metadata.
+ // Returns nullopt if the metadata is not present.
+ // Causes a compilation error if Which is not an element of Traits.
+ template <typename Which>
+ y_absl::optional<typename Which::ValueType> get(Which) const {
+ if (auto* p = table_.template get<Value<Which>>()) return p->value;
+ return y_absl::nullopt;
+ }
+
+ // Set the value of some known metadata.
+ // Returns a pointer to the new value.
+ template <typename Which, typename... Args>
+ typename Which::ValueType* Set(Which, Args&&... args) {
+ return &table_.template set<Value<Which>>(std::forward<Args>(args)...)
+ ->value;
+ }
+
+ // Remove a specific piece of known metadata.
+ template <typename Which>
+ void Remove(Which) {
+ table_.template clear<Value<Which>>();
+ }
+
+ // Extract a piece of known metadata.
+ // Returns nullopt if the metadata was not present, or the value if it was.
+ // The same as:
+ // auto value = m.get(T());
+ // m.Remove(T());
+ template <typename Which>
+ y_absl::optional<typename Which::ValueType> Take(Which which) {
+ if (auto* p = get_pointer(which)) {
+ y_absl::optional<typename Which::ValueType> value(std::move(*p));
+ Remove(which);
+ return value;
+ }
+ return {};
+ }
+
+ // Parse metadata from a key/value pair, and return an object representing
+ // that result.
+ // TODO(ctiller): key should probably be an y_absl::string_view.
+ // Once we don't care about interning anymore, make that change!
+ static ParsedMetadata<MetadataMap> Parse(y_absl::string_view key, Slice value,
+ uint32_t transport_size) {
+ metadata_detail::ParseHelper<MetadataMap> helper(value.TakeOwned(),
+ transport_size);
+ return metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
+ }
+
+ // Set a value from a parsed metadata object.
+ GRPC_MUST_USE_RESULT grpc_error_handle
+ Set(const ParsedMetadata<MetadataMap>& m) {
+ return m.SetOnContainer(this);
+ }
+
+ // Append a key/value pair - takes ownership of value
+ void Append(y_absl::string_view key, Slice value) {
+ metadata_detail::AppendHelper<MetadataMap> helper(this, value.TakeOwned());
+ metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
+ }
+
+ //
+ // All APIs below this point are subject to change.
+ //
+
+ template <typename F>
+ void ForEach(F f) const {
+ for (auto* l = list_.head; l; l = l->next) {
+ f(l->md);
+ }
+ }
+
+ template <typename F>
+ grpc_error_handle Filter(F f, const char* composite_error_string) {
+ grpc_linked_mdelem* l = list_.head;
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ auto add_error = [&](grpc_error_handle new_error) {
+ if (new_error == GRPC_ERROR_NONE) return;
+ if (error == GRPC_ERROR_NONE) {
+ error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(composite_error_string);
+ }
+ error = grpc_error_add_child(error, new_error);
+ };
+ while (l) {
+ grpc_linked_mdelem* next = l->next;
+ grpc_filtered_mdelem new_mdelem = f(l->md);
+ add_error(new_mdelem.error);
+ if (GRPC_MDISNULL(new_mdelem.md)) {
+ Remove(l);
+ } else if (new_mdelem.md.payload != l->md.payload) {
+ add_error(Substitute(l, new_mdelem.md));
+ }
+ l = next;
+ }
+ return error;
+ }
+
+ GRPC_MUST_USE_RESULT grpc_error_handle Append(grpc_mdelem md) {
+ return AddTail(elem_storage_.EmplaceBack(), md);
+ }
+
+ GRPC_MUST_USE_RESULT grpc_error_handle ReplaceOrAppend(grpc_slice key,
+ grpc_slice value) {
+ if (ReplaceIfExists(key, value)) return GRPC_ERROR_NONE;
+ return Append(grpc_mdelem_from_slices(key, value));
+ }
+
+ // Set key to value if it exists and return true, otherwise return false.
+ // If this function returns true, it takes ownership of key and value.
+ // If this function returns false, it does not take ownership of key nor
+ // value.
+ bool ReplaceIfExists(grpc_slice key, grpc_slice value);
+
+ void Clear();
+ bool empty() const { return count() == 0; }
+
+ size_t count() const { return list_.count + table_.count(); }
+ size_t non_deadline_count() const { return list_.count; }
+ size_t default_count() const { return list_.default_count; }
+
+ size_t TransportSize() const;
+
+ void Remove(grpc_linked_mdelem* storage);
+ void Remove(grpc_metadata_batch_callouts_index idx);
+
+ y_absl::optional<grpc_slice> Remove(grpc_slice key);
+
+ grpc_error_handle Substitute(grpc_linked_mdelem* storage,
+ grpc_mdelem new_mdelem);
+
+ y_absl::optional<y_absl::string_view> GetValue(
+ y_absl::string_view target_key, TString* concatenated_value) const;
+
+ grpc_error_handle LinkHead(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
+ grpc_error_handle LinkHead(grpc_linked_mdelem* storage,
+ grpc_metadata_batch_callouts_index idx)
+ GRPC_MUST_USE_RESULT;
+ grpc_error_handle LinkTail(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
+ grpc_error_handle LinkTail(grpc_linked_mdelem* storage,
+ grpc_metadata_batch_callouts_index idx)
+ GRPC_MUST_USE_RESULT;
+
+ grpc_error_handle AddHead(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
+ grpc_error_handle AddHead(grpc_linked_mdelem* storage,
+ grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+ grpc_error_handle AddTail(grpc_linked_mdelem* storage) GRPC_MUST_USE_RESULT;
+ grpc_error_handle AddTail(grpc_linked_mdelem* storage,
+ grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+
+ void CopyFrom(MetadataMap* src, grpc_linked_mdelem* storage);
+
+#ifndef NDEBUG
+ void AssertOk();
+#else
+ void AssertOk() {}
+#endif
+
+ // TODO(ctiller): the following explicit deadline handling methods are
+ // deprecated in terms of the traits based APIs.
+ grpc_millis deadline() const {
+ return get(GrpcTimeoutMetadata()).value_or(GRPC_MILLIS_INF_FUTURE);
+ };
+
+ const grpc_metadata_batch_callouts* legacy_index() const { return &idx_; }
+
+ private:
+ // Generate a strong type for metadata values per trait.
+ template <typename Which>
+ struct Value {
+ Value() = default;
+ explicit Value(const typename Which::ValueType& value) : value(value) {}
+ explicit Value(typename Which::ValueType&& value)
+ : value(std::forward<typename Which::ValueType>(value)) {}
+ Value(const Value&) = delete;
+ Value& operator=(const Value&) = delete;
+ Value(Value&&) noexcept = default;
+ Value& operator=(Value&& other) noexcept {
+ value = std::move(other.value);
+ return *this;
+ }
+ GPR_NO_UNIQUE_ADDRESS typename Which::ValueType value;
+ };
+ // Callable for the ForEach in Encode() -- for each value, call the
+ // appropriate encoder method.
+ template <typename Encoder>
+ struct EncodeWrapper {
+ Encoder* encoder;
+ template <typename Which>
+ void operator()(const Value<Which>& which) {
+ encoder->Encode(Which(), which.value);
+ }
+ };
+
+ void AssertValidCallouts();
+ grpc_error_handle LinkCallout(grpc_linked_mdelem* storage,
+ grpc_metadata_batch_callouts_index idx)
+ GRPC_MUST_USE_RESULT;
+ grpc_error_handle MaybeLinkCallout(grpc_linked_mdelem* storage)
+ GRPC_MUST_USE_RESULT;
+ void MaybeUnlinkCallout(grpc_linked_mdelem* storage);
+
+ static void assert_valid_list(grpc_mdelem_list* list) {
+#ifndef NDEBUG
+ grpc_linked_mdelem* l;
+
+ GPR_ASSERT((list->head == nullptr) == (list->tail == nullptr));
+ if (!list->head) return;
+ GPR_ASSERT(list->head->prev == nullptr);
+ GPR_ASSERT(list->tail->next == nullptr);
+ GPR_ASSERT((list->head == list->tail) == (list->head->next == nullptr));
+
+ size_t verified_count = 0;
+ for (l = list->head; l; l = l->next) {
+ GPR_ASSERT(!GRPC_MDISNULL(l->md));
+ GPR_ASSERT((l->prev == nullptr) == (l == list->head));
+ GPR_ASSERT((l->next == nullptr) == (l == list->tail));
+ if (l->next) GPR_ASSERT(l->next->prev == l);
+ if (l->prev) GPR_ASSERT(l->prev->next == l);
+ verified_count++;
+ }
+ GPR_ASSERT(list->count == verified_count);
+#else
+ // Avoid unused-parameter warning for debug-only parameter
+ (void)list;
+#endif /* NDEBUG */
+ }
+
+ static grpc_error_handle GPR_ATTRIBUTE_NOINLINE
+ error_with_md(grpc_mdelem md) {
+ return grpc_attach_md_to_error(
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unallowed duplicate metadata"),
+ md);
+ }
+
+ static void link_head(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
+ assert_valid_list(list);
+ GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
+ storage->prev = nullptr;
+ storage->next = list->head;
+ storage->reserved = nullptr;
+ if (list->head != nullptr) {
+ list->head->prev = storage;
+ } else {
+ list->tail = storage;
+ }
+ list->head = storage;
+ list->count++;
+ assert_valid_list(list);
+ }
+
+ static void link_tail(grpc_mdelem_list* list, grpc_linked_mdelem* storage) {
+ assert_valid_list(list);
+ GPR_DEBUG_ASSERT(!GRPC_MDISNULL(storage->md));
+ storage->prev = list->tail;
+ storage->next = nullptr;
+ storage->reserved = nullptr;
+ if (list->tail != nullptr) {
+ list->tail->next = storage;
+ } else {
+ list->head = storage;
+ }
+ list->tail = storage;
+ list->count++;
+ assert_valid_list(list);
+ }
+
+ static void unlink_storage(grpc_mdelem_list* list,
+ grpc_linked_mdelem* storage) {
+ assert_valid_list(list);
+ if (storage->prev != nullptr) {
+ storage->prev->next = storage->next;
+ } else {
+ list->head = storage->next;
+ }
+ if (storage->next != nullptr) {
+ storage->next->prev = storage->prev;
+ } else {
+ list->tail = storage->prev;
+ }
+ list->count--;
+ assert_valid_list(list);
+ }
+
+ // Table of known metadata types.
+ Table<Value<Traits>...> table_;
/** Metadata elements in this batch */
- grpc_mdelem_list list;
- grpc_metadata_batch_callouts idx;
- /** Used to calculate grpc-timeout at the point of sending,
- or GRPC_MILLIS_INF_FUTURE if this batch does not need to send a
- grpc-timeout */
- grpc_millis deadline;
-} grpc_metadata_batch;
-
-void grpc_metadata_batch_init(grpc_metadata_batch* batch);
-void grpc_metadata_batch_destroy(grpc_metadata_batch* batch);
-void grpc_metadata_batch_clear(grpc_metadata_batch* batch);
-bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch);
+ grpc_mdelem_list list_;
+ grpc_metadata_batch_callouts idx_;
+ // Backing store for added metadata.
+ ChunkedVector<grpc_linked_mdelem, 10> elem_storage_;
+};
+
+template <typename... Traits>
+void MetadataMap<Traits...>::AssertValidCallouts() {
+#ifndef NDEBUG
+ for (grpc_linked_mdelem* l = list_.head; l != nullptr; l = l->next) {
+ grpc_slice key_interned = grpc_slice_intern(GRPC_MDKEY(l->md));
+ grpc_metadata_batch_callouts_index callout_idx =
+ GRPC_BATCH_INDEX_OF(key_interned);
+ if (callout_idx != GRPC_BATCH_CALLOUTS_COUNT) {
+ GPR_ASSERT(idx_.array[callout_idx] == l);
+ }
+ grpc_slice_unref_internal(key_interned);
+ }
+#endif
+}
+
+#ifndef NDEBUG
+template <typename... Traits>
+void MetadataMap<Traits...>::AssertOk() {
+ assert_valid_list(&list_);
+}
+#endif /* NDEBUG */
+
+template <typename... Traits>
+MetadataMap<Traits...>::MetadataMap(Arena* arena) : elem_storage_(arena) {
+ memset(&list_, 0, sizeof(list_));
+ memset(&idx_, 0, sizeof(idx_));
+}
+
+template <typename... Traits>
+MetadataMap<Traits...>::MetadataMap(MetadataMap&& other) noexcept
+ : table_(std::move(other.table_)) {
+ list_ = other.list_;
+ idx_ = other.idx_;
+ memset(&other.list_, 0, sizeof(list_));
+ memset(&other.idx_, 0, sizeof(idx_));
+}
+
+template <typename... Traits>
+MetadataMap<Traits...>& MetadataMap<Traits...>::operator=(
+ MetadataMap&& other) noexcept {
+ Clear();
+ table_ = std::move(other.table_);
+ list_ = other.list_;
+ idx_ = other.idx_;
+ memset(&other.list_, 0, sizeof(list_));
+ memset(&other.idx_, 0, sizeof(idx_));
+ return *this;
+}
+
+template <typename... Traits>
+MetadataMap<Traits...>::~MetadataMap() {
+ AssertValidCallouts();
+ for (auto* l = list_.head; l; l = l->next) {
+ GRPC_MDELEM_UNREF(l->md);
+ }
+}
+
+template <typename... Traits>
+y_absl::optional<grpc_slice> MetadataMap<Traits...>::Remove(grpc_slice key) {
+ for (auto* l = list_.head; l; l = l->next) {
+ if (grpc_slice_eq(GRPC_MDKEY(l->md), key)) {
+ auto out = grpc_slice_ref_internal(GRPC_MDVALUE(l->md));
+ Remove(l);
+ return out;
+ }
+ }
+ return {};
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::LinkCallout(
+ grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
+ AssertValidCallouts();
+ GPR_DEBUG_ASSERT(idx >= 0 && idx < GRPC_BATCH_CALLOUTS_COUNT);
+ if (GPR_LIKELY(idx_.array[idx] == nullptr)) {
+ ++list_.default_count;
+ idx_.array[idx] = storage;
+ AssertValidCallouts();
+ return GRPC_ERROR_NONE;
+ }
+ AssertValidCallouts();
+ return error_with_md(storage->md);
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::MaybeLinkCallout(
+ grpc_linked_mdelem* storage) {
+ grpc_metadata_batch_callouts_index idx =
+ GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
+ if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
+ return GRPC_ERROR_NONE;
+ }
+ return LinkCallout(storage, idx);
+}
+
+template <typename... Traits>
+void MetadataMap<Traits...>::MaybeUnlinkCallout(grpc_linked_mdelem* storage) {
+ grpc_metadata_batch_callouts_index idx =
+ GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md));
+ if (idx == GRPC_BATCH_CALLOUTS_COUNT) {
+ return;
+ }
+ --list_.default_count;
+ GPR_DEBUG_ASSERT(idx_.array[idx] != nullptr);
+ idx_.array[idx] = nullptr;
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::AddHead(grpc_linked_mdelem* storage,
+ grpc_mdelem elem_to_add) {
+ GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
+ storage->md = elem_to_add;
+ return LinkHead(storage);
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::LinkHead(
+ grpc_linked_mdelem* storage) {
+ AssertValidCallouts();
+ grpc_error_handle err = MaybeLinkCallout(storage);
+ if (err != GRPC_ERROR_NONE) {
+ AssertValidCallouts();
+ return err;
+ }
+ link_head(&list_, storage);
+ AssertValidCallouts();
+ return GRPC_ERROR_NONE;
+}
+
+// TODO(arjunroy): Need to revisit this and see what guarantees exist between
+// C-core and the internal-metadata subsystem. E.g. can we ensure a particular
+// metadata is never added twice, even in the presence of user supplied data?
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::LinkHead(
+ grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
+ GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
+ AssertValidCallouts();
+ grpc_error_handle err = LinkCallout(storage, idx);
+ if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
+ AssertValidCallouts();
+ return err;
+ }
+ link_head(&list_, storage);
+ AssertValidCallouts();
+ return GRPC_ERROR_NONE;
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::AddTail(grpc_linked_mdelem* storage,
+ grpc_mdelem elem_to_add) {
+ GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
+ storage->md = elem_to_add;
+ return LinkTail(storage);
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::LinkTail(
+ grpc_linked_mdelem* storage) {
+ AssertValidCallouts();
+ grpc_error_handle err = MaybeLinkCallout(storage);
+ if (err != GRPC_ERROR_NONE) {
+ AssertValidCallouts();
+ return err;
+ }
+ link_tail(&list_, storage);
+ AssertValidCallouts();
+ return GRPC_ERROR_NONE;
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::LinkTail(
+ grpc_linked_mdelem* storage, grpc_metadata_batch_callouts_index idx) {
+ GPR_DEBUG_ASSERT(GRPC_BATCH_INDEX_OF(GRPC_MDKEY(storage->md)) == idx);
+ AssertValidCallouts();
+ grpc_error_handle err = LinkCallout(storage, idx);
+ if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) {
+ AssertValidCallouts();
+ return err;
+ }
+ link_tail(&list_, storage);
+ AssertValidCallouts();
+ return GRPC_ERROR_NONE;
+}
+
+template <typename... Traits>
+void MetadataMap<Traits...>::Remove(grpc_linked_mdelem* storage) {
+ AssertValidCallouts();
+ MaybeUnlinkCallout(storage);
+ unlink_storage(&list_, storage);
+ GRPC_MDELEM_UNREF(storage->md);
+ AssertValidCallouts();
+}
+
+template <typename... Traits>
+void MetadataMap<Traits...>::Remove(grpc_metadata_batch_callouts_index idx) {
+ AssertValidCallouts();
+ if (idx_.array[idx] == nullptr) return;
+ --list_.default_count;
+ unlink_storage(&list_, idx_.array[idx]);
+ GRPC_MDELEM_UNREF(idx_.array[idx]->md);
+ idx_.array[idx] = nullptr;
+ AssertValidCallouts();
+}
+
+template <typename... Traits>
+y_absl::optional<y_absl::string_view> MetadataMap<Traits...>::GetValue(
+ y_absl::string_view target_key, TString* concatenated_value) const {
+ // Find all values for the specified key.
+ y_absl::InlinedVector<y_absl::string_view, 1> values;
+ for (grpc_linked_mdelem* md = list_.head; md != nullptr; md = md->next) {
+ y_absl::string_view key = StringViewFromSlice(GRPC_MDKEY(md->md));
+ y_absl::string_view value = StringViewFromSlice(GRPC_MDVALUE(md->md));
+ if (target_key == key) values.push_back(value);
+ }
+ // If none found, no match.
+ if (values.empty()) return y_absl::nullopt;
+ // If exactly one found, return it as-is.
+ if (values.size() == 1) return values.front();
+ // If more than one found, concatenate the values, using
+ // *concatenated_values as a temporary holding place for the
+ // concatenated string.
+ *concatenated_value = y_absl::StrJoin(values, ",");
+ return *concatenated_value;
+}
+
+template <typename... Traits>
+grpc_error_handle MetadataMap<Traits...>::Substitute(
+ grpc_linked_mdelem* storage, grpc_mdelem new_mdelem) {
+ AssertValidCallouts();
+ grpc_error_handle error = GRPC_ERROR_NONE;
+ grpc_mdelem old_mdelem = storage->md;
+ if (!grpc_slice_eq(GRPC_MDKEY(new_mdelem), GRPC_MDKEY(old_mdelem))) {
+ MaybeUnlinkCallout(storage);
+ storage->md = new_mdelem;
+ error = MaybeLinkCallout(storage);
+ if (error != GRPC_ERROR_NONE) {
+ unlink_storage(&list_, storage);
+ GRPC_MDELEM_UNREF(storage->md);
+ }
+ } else {
+ storage->md = new_mdelem;
+ }
+ GRPC_MDELEM_UNREF(old_mdelem);
+ AssertValidCallouts();
+ return error;
+}
+
+template <typename... Traits>
+void MetadataMap<Traits...>::Clear() {
+ // TODO(ctiller): implement this without deconstructing/reconstructing once
+ // linked_mdelem is no longer a thing.
+ auto* arena = elem_storage_.arena();
+ this->~MetadataMap();
+ new (this) MetadataMap(arena);
+}
+
+template <typename... Traits>
+size_t MetadataMap<Traits...>::TransportSize() const {
+ size_t size = 0;
+ for (grpc_linked_mdelem* elem = list_.head; elem != nullptr;
+ elem = elem->next) {
+ size += GRPC_MDELEM_LENGTH(elem->md);
+ }
+ return size;
+}
+
+template <typename... Traits>
+bool MetadataMap<Traits...>::ReplaceIfExists(grpc_slice key, grpc_slice value) {
+ AssertValidCallouts();
+ for (grpc_linked_mdelem* l = list_.head; l != nullptr; l = l->next) {
+ if (grpc_slice_eq(GRPC_MDKEY(l->md), key)) {
+ auto new_mdelem = grpc_mdelem_from_slices(key, value);
+ GRPC_MDELEM_UNREF(l->md);
+ l->md = new_mdelem;
+ AssertValidCallouts();
+ return true;
+ }
+ }
+ AssertValidCallouts();
+ return false;
+}
+
+} // namespace grpc_core
+
+using grpc_metadata_batch = grpc_core::MetadataMap<
+ grpc_core::GrpcTimeoutMetadata, grpc_core::TeMetadata,
+ grpc_core::UserAgentMetadata, grpc_core::GrpcMessageMetadata,
+ grpc_core::HostMetadata, grpc_core::XEndpointLoadMetricsBinMetadata,
+ grpc_core::GrpcServerStatsBinMetadata, grpc_core::GrpcTraceBinMetadata,
+ grpc_core::GrpcTagsBinMetadata>;
+
+inline void grpc_metadata_batch_clear(grpc_metadata_batch* batch) {
+ batch->Clear();
+}
+inline bool grpc_metadata_batch_is_empty(grpc_metadata_batch* batch) {
+ return batch->empty();
+}
/* Returns the transport size of the batch. */
-size_t grpc_metadata_batch_size(grpc_metadata_batch* batch);
+inline size_t grpc_metadata_batch_size(grpc_metadata_batch* batch) {
+ return batch->TransportSize();
+}
/** Remove \a storage from the batch, unreffing the mdelem contained */
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage);
-void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
- grpc_metadata_batch_callouts_index idx);
+inline void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
+ grpc_linked_mdelem* storage) {
+ batch->Remove(storage);
+}
+inline void grpc_metadata_batch_remove(grpc_metadata_batch* batch,
+ grpc_metadata_batch_callouts_index idx) {
+ batch->Remove(idx);
+}
/** Substitute a new mdelem for an old value */
-grpc_error* grpc_metadata_batch_substitute(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage,
- grpc_mdelem new_mdelem);
+inline grpc_error_handle grpc_metadata_batch_substitute(
+ grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
+ grpc_mdelem new_mdelem) {
+ return batch->Substitute(storage, new_mdelem);
+}
void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
const grpc_slice& value);
@@ -88,33 +1013,43 @@ void grpc_metadata_batch_set_value(grpc_linked_mdelem* storage,
If the key is present more than once in the batch, constructs a
comma-concatenated string of all values in concatenated_value and returns a
string_view of that string. */
-y_absl::optional<y_absl::string_view> grpc_metadata_batch_get_value(
+inline y_absl::optional<y_absl::string_view> grpc_metadata_batch_get_value(
grpc_metadata_batch* batch, y_absl::string_view target_key,
- TString* concatenated_value);
+ TString* concatenated_value) {
+ return batch->GetValue(target_key, concatenated_value);
+}
/** Add \a storage to the beginning of \a batch. storage->md is
assumed to be valid.
\a storage is owned by the caller and must survive for the
lifetime of batch. This usually means it should be around
for the lifetime of the call. */
-grpc_error* grpc_metadata_batch_link_head(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-grpc_error* grpc_metadata_batch_link_head(
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_head(
+ grpc_metadata_batch* batch, grpc_linked_mdelem* storage) {
+ return batch->LinkHead(storage);
+}
+
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_head(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT;
+ grpc_metadata_batch_callouts_index idx) {
+ return batch->LinkHead(storage, idx);
+}
/** Add \a storage to the end of \a batch. storage->md is
assumed to be valid.
\a storage is owned by the caller and must survive for the
lifetime of batch. This usually means it should be around
for the lifetime of the call. */
-grpc_error* grpc_metadata_batch_link_tail(grpc_metadata_batch* batch,
- grpc_linked_mdelem* storage)
- GRPC_MUST_USE_RESULT;
-grpc_error* grpc_metadata_batch_link_tail(
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_tail(
+ grpc_metadata_batch* batch, grpc_linked_mdelem* storage) {
+ return batch->LinkTail(storage);
+}
+
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_link_tail(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_metadata_batch_callouts_index idx) GRPC_MUST_USE_RESULT;
+ grpc_metadata_batch_callouts_index idx) {
+ return batch->LinkTail(storage, idx);
+}
/** Add \a elem_to_add as the first element in \a batch, using
\a storage as backing storage for the linked list element.
@@ -122,19 +1057,21 @@ grpc_error* grpc_metadata_batch_link_tail(
lifetime of batch. This usually means it should be around
for the lifetime of the call.
Takes ownership of \a elem_to_add */
-grpc_error* grpc_metadata_batch_add_head(
+inline grpc_error_handle grpc_metadata_batch_add_head(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+ grpc_mdelem elem_to_add) {
+ return batch->AddHead(storage, elem_to_add);
+}
// TODO(arjunroy, roth): Remove redundant methods.
// add/link_head/tail are almost identical.
-inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
+inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
grpc_metadata_batch_callouts_index idx) {
return grpc_metadata_batch_link_head(batch, storage, idx);
}
-inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
+inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
@@ -148,17 +1085,19 @@ inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_head(
lifetime of batch. This usually means it should be around
for the lifetime of the call.
Takes ownership of \a elem_to_add */
-grpc_error* grpc_metadata_batch_add_tail(
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_add_tail(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
- grpc_mdelem elem_to_add) GRPC_MUST_USE_RESULT;
+ grpc_mdelem elem_to_add) {
+ return batch->AddTail(storage, elem_to_add);
+}
-inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
+inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
grpc_metadata_batch_callouts_index idx) {
return grpc_metadata_batch_link_tail(batch, storage, idx);
}
-inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
+inline grpc_error_handle GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
grpc_metadata_batch* batch, grpc_linked_mdelem* storage,
grpc_mdelem elem_to_add, grpc_metadata_batch_callouts_index idx) {
GPR_DEBUG_ASSERT(!GRPC_MDISNULL(elem_to_add));
@@ -166,40 +1105,26 @@ inline grpc_error* GRPC_MUST_USE_RESULT grpc_metadata_batch_add_tail(
return grpc_metadata_batch_add_tail(batch, storage, idx);
}
-grpc_error* grpc_attach_md_to_error(grpc_error* src, grpc_mdelem md);
-
-struct grpc_filtered_mdelem {
- grpc_error* error;
- grpc_mdelem md;
-};
-#define GRPC_FILTERED_ERROR(error) \
- { (error), GRPC_MDNULL }
-#define GRPC_FILTERED_MDELEM(md) \
- { GRPC_ERROR_NONE, (md) }
-#define GRPC_FILTERED_REMOVE() \
- { GRPC_ERROR_NONE, GRPC_MDNULL }
-
typedef grpc_filtered_mdelem (*grpc_metadata_batch_filter_func)(
void* user_data, grpc_mdelem elem);
-grpc_error* grpc_metadata_batch_filter(
+inline GRPC_MUST_USE_RESULT grpc_error_handle grpc_metadata_batch_filter(
grpc_metadata_batch* batch, grpc_metadata_batch_filter_func func,
- void* user_data, const char* composite_error_string) GRPC_MUST_USE_RESULT;
-
-#ifndef NDEBUG
-void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch);
-#else
-#define grpc_metadata_batch_assert_ok(batch) \
- do { \
- } while (0)
-#endif
+ void* user_data, const char* composite_error_string) {
+ return batch->Filter([=](grpc_mdelem elem) { return func(user_data, elem); },
+ composite_error_string);
+}
-/// Copies \a src to \a dst. \a storage must point to an array of
-/// \a grpc_linked_mdelem structs of at least the same size as \a src.
-void grpc_metadata_batch_copy(grpc_metadata_batch* src,
- grpc_metadata_batch* dst,
- grpc_linked_mdelem* storage);
+inline void grpc_metadata_batch_assert_ok(grpc_metadata_batch* batch) {
+ batch->AssertOk();
+}
-void grpc_metadata_batch_move(grpc_metadata_batch* src,
+/// Copies \a src to \a dst.
+///
+/// For each mdelem in \a src, if the mdelem is of storage types
+/// GRPC_MDELEM_STORAGE_INTERNED or GRPC_MDELEM_STORAGE_ALLOCATED,
+/// refs the original mdelem for the copy. Otherwise, makes a new
+/// mdelem that will hold its own refs to the key and value slices.
+void grpc_metadata_batch_copy(const grpc_metadata_batch* src,
grpc_metadata_batch* dst);
#endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_BATCH_H */
diff --git a/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.cc b/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.cc
new file mode 100644
index 00000000000..4858e95a2e8
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.cc
@@ -0,0 +1,35 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/transport/parsed_metadata.h"
+
+namespace grpc_core {
+namespace metadata_detail {
+
+TString MakeDebugString(y_absl::string_view key, y_absl::string_view value) {
+ return y_absl::StrCat(key, ": ", value);
+}
+
+Slice SliceFromBuffer(const Buffer& buffer) {
+ return Slice(grpc_slice_ref_internal(buffer.slice));
+}
+
+void DestroySliceValue(const Buffer& value) {
+ grpc_slice_unref_internal(value.slice);
+}
+
+} // namespace metadata_detail
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.h b/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.h
new file mode 100644
index 00000000000..551d89f3cb7
--- /dev/null
+++ b/contrib/libs/grpc/src/core/lib/transport/parsed_metadata.h
@@ -0,0 +1,382 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_CORE_LIB_TRANSPORT_PARSED_METADATA_H
+#define GRPC_CORE_LIB_TRANSPORT_PARSED_METADATA_H
+
+#include <grpc/support/port_platform.h>
+
+#include <cstdint>
+#include <type_traits>
+
+#include "y_absl/meta/type_traits.h"
+#include "y_absl/strings/match.h"
+
+#include "src/core/lib/iomgr/error.h"
+#include "src/core/lib/slice/slice.h"
+#include "src/core/lib/surface/validate_metadata.h"
+#include "src/core/lib/transport/metadata.h"
+
+namespace grpc_core {
+
+namespace metadata_detail {
+
+// Helper to determine whether a traits metadata is inlinable inside a memento,
+// or (if not) we'll need to take the memory allocation path.
+template <typename Which>
+struct HasSimpleMemento {
+ static constexpr bool value =
+ std::is_trivial<typename Which::MementoType>::value &&
+ sizeof(typename Which::MementoType) <= sizeof(uint64_t);
+};
+
+// Storage type for a single metadata entry.
+union Buffer {
+ uint64_t trivial;
+ void* pointer;
+ grpc_slice slice;
+ grpc_mdelem mdelem;
+};
+
+// Given a key and a value, concatenate together to make a debug string.
+// Split out to avoid template bloat.
+TString MakeDebugString(y_absl::string_view key, y_absl::string_view value);
+
+// Wrapper around MakeDebugString.
+// For the value part, use two functions - one to extract a typed field from
+// Buffer, and a second (sourced from the trait) to generate a displayable debug
+// string from the field value. We try to maximize indirection/code sharing here
+// as this is not critical path code and we'd like to avoid some code bloat -
+// better to scale by number of types than then number of metadata traits!
+template <typename Field, typename CompatibleWithField, typename Display>
+GPR_ATTRIBUTE_NOINLINE TString MakeDebugStringPipeline(
+ y_absl::string_view key, const Buffer& value,
+ Field (*field_from_buffer)(const Buffer&),
+ Display (*display_from_field)(CompatibleWithField)) {
+ return MakeDebugString(
+ key, y_absl::StrCat(display_from_field(field_from_buffer(value))));
+}
+
+// Extract a trivial field value from a Buffer - for MakeDebugStringPipeline.
+template <typename Field>
+Field FieldFromTrivial(const Buffer& value) {
+ return static_cast<Field>(value.trivial);
+}
+
+// Extract a pointer field value from a Buffer - for MakeDebugStringPipeline.
+template <typename Field>
+Field FieldFromPointer(const Buffer& value) {
+ return *static_cast<const Field*>(value.pointer);
+}
+
+// Extract a Slice from a Buffer.
+Slice SliceFromBuffer(const Buffer& buffer);
+
+// Unref the grpc_slice part of a Buffer (assumes it is in fact a grpc_slice).
+void DestroySliceValue(const Buffer& value);
+
+} // namespace metadata_detail
+
+// A parsed metadata value.
+// This type captures a type erased MementoType from one trait of
+// MetadataContainer, and provides utilities to manipulate that and to set it on
+// a MetadataContainer.
+template <typename MetadataContainer>
+class ParsedMetadata {
+ public:
+ // Construct metadata from a trait Which of MetadataContainer.
+ // Two versions: the first is for simple inlinable mementos, and the second
+ // forces an allocation.
+ template <typename Which>
+ ParsedMetadata(
+ Which,
+ y_absl::enable_if_t<metadata_detail::HasSimpleMemento<Which>::value,
+ typename Which::MementoType>
+ value,
+ uint32_t transport_size)
+ : vtable_(ParsedMetadata::template TrivialTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ value_.trivial = static_cast<uint64_t>(value);
+ }
+ template <typename Which>
+ ParsedMetadata(
+ Which,
+ y_absl::enable_if_t<
+ !metadata_detail::HasSimpleMemento<Which>::value &&
+ !std::is_convertible<typename Which::MementoType, Slice>::value,
+ typename Which::MementoType>
+ value,
+ uint32_t transport_size)
+ : vtable_(ParsedMetadata::template NonTrivialTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ value_.pointer = new typename Which::MementoType(std::move(value));
+ }
+ // Construct metadata from a Slice typed value.
+ template <typename Which>
+ ParsedMetadata(Which, Slice value, uint32_t transport_size)
+ : vtable_(ParsedMetadata::template SliceTraitVTable<Which>()),
+ transport_size_(transport_size) {
+ value_.slice = value.TakeCSlice();
+ }
+ // Takes ownership of elem
+ explicit ParsedMetadata(grpc_mdelem elem)
+ : vtable_(grpc_is_binary_header_internal(GRPC_MDKEY(elem))
+ ? MdelemVtable<true>()
+ : MdelemVtable<false>()),
+ transport_size_(GRPC_MDELEM_LENGTH(elem)) {
+ value_.mdelem = elem;
+ }
+ ParsedMetadata() : vtable_(EmptyVTable()), transport_size_(0) {}
+ ~ParsedMetadata() { vtable_->destroy(value_); }
+
+ // Non copyable, but movable.
+ ParsedMetadata(const ParsedMetadata&) = delete;
+ ParsedMetadata& operator=(const ParsedMetadata&) = delete;
+ ParsedMetadata(ParsedMetadata&& other) noexcept
+ : vtable_(other.vtable_),
+ value_(other.value_),
+ transport_size_(other.transport_size_) {
+ other.vtable_ = EmptyVTable();
+ }
+ ParsedMetadata& operator=(ParsedMetadata&& other) noexcept {
+ vtable_ = other.vtable_;
+ value_ = other.value_;
+ transport_size_ = other.transport_size_;
+ other.vtable_ = EmptyVTable();
+ return *this;
+ }
+
+ // Set this parsed value on a container.
+ GRPC_MUST_USE_RESULT grpc_error_handle
+ SetOnContainer(MetadataContainer* container) const {
+ return vtable_->set(value_, container);
+ }
+
+ // Is this a binary header or not?
+ bool is_binary_header() const { return vtable_->is_binary_header; }
+ // HTTP2 defined storage size of this metadatum.
+ uint32_t transport_size() const { return transport_size_; }
+ // Create a new parsed metadata with the same key but a different value.
+ ParsedMetadata WithNewValue(Slice value) const {
+ ParsedMetadata result;
+ result.vtable_ = vtable_;
+ result.value_ = value_;
+ result.transport_size_ =
+ TransportSize(vtable_->key_length(value_), value.length());
+ vtable_->with_new_value(&value, &result);
+ return result;
+ }
+ TString DebugString() const { return vtable_->debug_string(value_); }
+
+ // TODO(ctiller): move to transport
+ static uint32_t TransportSize(uint32_t key_size, uint32_t value_size) {
+ // TODO(ctiller): use hpack constant?
+ return key_size + value_size + 32;
+ }
+
+ private:
+ using Buffer = metadata_detail::Buffer;
+
+ struct VTable {
+ const bool is_binary_header;
+ void (*const destroy)(const Buffer& value);
+ grpc_error_handle (*const set)(const Buffer& value,
+ MetadataContainer* container);
+ // result is a bitwise copy of the originating ParsedMetadata.
+ void (*const with_new_value)(Slice* new_value, ParsedMetadata* result);
+ TString (*const debug_string)(const Buffer& value);
+ // TODO(ctiller): when we delete mdelem, make this a simple integer constant
+ // on the vtable
+ size_t (*const key_length)(const Buffer& value);
+ };
+
+ static const VTable* EmptyVTable();
+ template <typename Which>
+ static const VTable* TrivialTraitVTable();
+ template <typename Which>
+ static const VTable* NonTrivialTraitVTable();
+ template <typename Which>
+ static const VTable* SliceTraitVTable();
+ template <bool kIsBinaryHeader>
+ static const VTable* MdelemVtable();
+
+ template <Slice (*ParseMemento)(Slice)>
+ GPR_ATTRIBUTE_NOINLINE void WithNewValueSetSlice(Slice* slice) {
+ value_.slice = ParseMemento(std::move(*slice)).TakeCSlice();
+ }
+
+ const VTable* vtable_;
+ Buffer value_;
+ uint32_t transport_size_;
+};
+
+namespace metadata_detail {} // namespace metadata_detail
+
+template <typename MetadataContainer>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::EmptyVTable() {
+ static const VTable vtable = {
+ false,
+ // destroy
+ [](const Buffer&) {},
+ // set
+ [](const Buffer&, MetadataContainer*) { return GRPC_ERROR_NONE; },
+ // with_new_value
+ [](Slice*, ParsedMetadata*) {},
+ // debug_string
+ [](const Buffer&) -> TString { return "empty"; },
+ // key_length
+ [](const Buffer&) -> size_t { return 0; },
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::TrivialTraitVTable() {
+ static const VTable vtable = {
+ y_absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ [](const Buffer&) {},
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ map->Set(Which(),
+ Which::MementoToValue(
+ static_cast<typename Which::MementoType>(value.trivial)));
+ return GRPC_ERROR_NONE;
+ },
+ // with_new_value
+ [](Slice* value, ParsedMetadata* result) {
+ result->value_.trivial = Which::ParseMemento(std::move(*value));
+ },
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value,
+ metadata_detail::FieldFromTrivial<typename Which::MementoType>,
+ Which::DisplayValue);
+ },
+ // key_length
+ [](const Buffer&) { return Which::key().size(); },
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::NonTrivialTraitVTable() {
+ static const VTable vtable = {
+ y_absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ [](const Buffer& value) {
+ delete static_cast<typename Which::MementoType*>(value.pointer);
+ },
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ auto* p = static_cast<typename Which::MementoType*>(value.pointer);
+ map->Set(Which(), Which::MementoToValue(*p));
+ return GRPC_ERROR_NONE;
+ },
+ // with_new_value
+ [](Slice* value, ParsedMetadata* result) {
+ result->value_.pointer = new
+ typename Which::MementoType(Which::ParseMemento(std::move(*value)));
+ },
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value,
+ metadata_detail::FieldFromPointer<typename Which::MementoType>,
+ Which::DisplayValue);
+ },
+ // key_length
+ [](const Buffer&) { return Which::key().size(); },
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <typename Which>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::SliceTraitVTable() {
+ static const VTable vtable = {
+ y_absl::EndsWith(Which::key(), "-bin"),
+ // destroy
+ metadata_detail::DestroySliceValue,
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ map->Set(Which(), Which::MementoToValue(
+ metadata_detail::SliceFromBuffer(value)));
+ return GRPC_ERROR_NONE;
+ },
+ // with_new_value
+ [](Slice* value, ParsedMetadata* result) {
+ result->WithNewValueSetSlice<Which::ParseMemento>(value);
+ },
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugStringPipeline(
+ Which::key(), value, metadata_detail::SliceFromBuffer,
+ Which::DisplayValue);
+ },
+ // key_length
+ [](const Buffer&) { return Which::key().size(); },
+ };
+ return &vtable;
+}
+
+template <typename MetadataContainer>
+template <bool kIsBinaryHeader>
+const typename ParsedMetadata<MetadataContainer>::VTable*
+ParsedMetadata<MetadataContainer>::MdelemVtable() {
+ static const VTable vtable = {
+ kIsBinaryHeader,
+ // destroy
+ [](const Buffer& value) { GRPC_MDELEM_UNREF(value.mdelem); },
+ // set
+ [](const Buffer& value, MetadataContainer* map) {
+ auto md = GRPC_MDELEM_REF(value.mdelem);
+ auto err = map->Append(md);
+ // If an error occurs, md is not consumed and we need to.
+ // This is an awful API, but that's why we're replacing it.
+ if (err != GRPC_ERROR_NONE) {
+ GRPC_MDELEM_UNREF(md);
+ }
+ return err;
+ },
+ // with_new_value
+ [](Slice* value_slice, ParsedMetadata* result) {
+ result->value_.mdelem = grpc_mdelem_from_slices(
+ static_cast<const ManagedMemorySlice&>(
+ grpc_slice_ref_internal(GRPC_MDKEY(result->value_.mdelem))),
+ value_slice->TakeCSlice());
+ },
+ // debug_string
+ [](const Buffer& value) {
+ return metadata_detail::MakeDebugString(
+ StringViewFromSlice(GRPC_MDKEY(value.mdelem)),
+ StringViewFromSlice(GRPC_MDVALUE(value.mdelem)));
+ },
+ // key_length
+ [](const Buffer& value) {
+ return GRPC_SLICE_LENGTH(GRPC_MDKEY(value.mdelem));
+ }};
+ return &vtable;
+}
+
+} // namespace grpc_core
+
+#endif // GRPC_CORE_LIB_TRANSPORT_PARSED_METADATA_H
diff --git a/contrib/libs/grpc/src/core/lib/transport/pid_controller.cc b/contrib/libs/grpc/src/core/lib/transport/pid_controller.cc
index dbc98f4917f..c0dc38ad6ad 100644
--- a/contrib/libs/grpc/src/core/lib/transport/pid_controller.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/pid_controller.cc
@@ -31,8 +31,8 @@ double PidController::Update(double error, double dt) {
if (dt <= 0) return last_control_value_;
/* integrate error using the trapezoid rule */
error_integral_ += dt * (last_error_ + error) * 0.5;
- error_integral_ = GPR_CLAMP(error_integral_, -args_.integral_range(),
- args_.integral_range());
+ error_integral_ =
+ Clamp(error_integral_, -args_.integral_range(), args_.integral_range());
double diff_error = (error - last_error_) / dt;
/* calculate derivative of control value vs time */
double dc_dt = args_.gain_p() * error + args_.gain_i() * error_integral_ +
@@ -40,8 +40,8 @@ double PidController::Update(double error, double dt) {
/* and perform trapezoidal integration */
double new_control_value =
last_control_value_ + dt * (last_dc_dt_ + dc_dt) * 0.5;
- new_control_value = GPR_CLAMP(new_control_value, args_.min_control_value(),
- args_.max_control_value());
+ new_control_value = Clamp(new_control_value, args_.min_control_value(),
+ args_.max_control_value());
last_error_ = error;
last_dc_dt_ = dc_dt;
last_control_value_ = new_control_value;
diff --git a/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc b/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
index 483a40f0325..0ea4b614a7d 100644
--- a/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/static_metadata.cc
@@ -30,1181 +30,965 @@
#include "src/core/lib/slice/slice_internal.h"
-static constexpr uint8_t g_bytes[] = {
- 58, 112, 97, 116, 104, 58, 109, 101, 116, 104, 111, 100, 58, 115, 116,
- 97, 116, 117, 115, 58, 97, 117, 116, 104, 111, 114, 105, 116, 121, 58,
- 115, 99, 104, 101, 109, 101, 116, 101, 103, 114, 112, 99, 45, 109, 101,
- 115, 115, 97, 103, 101, 103, 114, 112, 99, 45, 115, 116, 97, 116, 117,
- 115, 103, 114, 112, 99, 45, 112, 97, 121, 108, 111, 97, 100, 45, 98,
- 105, 110, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103,
- 103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99,
- 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 115, 101, 114, 118, 101,
- 114, 45, 115, 116, 97, 116, 115, 45, 98, 105, 110, 103, 114, 112, 99,
- 45, 116, 97, 103, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116,
- 114, 97, 99, 101, 45, 98, 105, 110, 99, 111, 110, 116, 101, 110, 116,
- 45, 116, 121, 112, 101, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110,
- 99, 111, 100, 105, 110, 103, 97, 99, 99, 101, 112, 116, 45, 101, 110,
- 99, 111, 100, 105, 110, 103, 103, 114, 112, 99, 45, 105, 110, 116, 101,
- 114, 110, 97, 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114,
- 101, 113, 117, 101, 115, 116, 103, 114, 112, 99, 45, 105, 110, 116, 101,
- 114, 110, 97, 108, 45, 115, 116, 114, 101, 97, 109, 45, 101, 110, 99,
- 111, 100, 105, 110, 103, 45, 114, 101, 113, 117, 101, 115, 116, 117, 115,
- 101, 114, 45, 97, 103, 101, 110, 116, 104, 111, 115, 116, 103, 114, 112,
- 99, 45, 112, 114, 101, 118, 105, 111, 117, 115, 45, 114, 112, 99, 45,
- 97, 116, 116, 101, 109, 112, 116, 115, 103, 114, 112, 99, 45, 114, 101,
- 116, 114, 121, 45, 112, 117, 115, 104, 98, 97, 99, 107, 45, 109, 115,
- 120, 45, 101, 110, 100, 112, 111, 105, 110, 116, 45, 108, 111, 97, 100,
- 45, 109, 101, 116, 114, 105, 99, 115, 45, 98, 105, 110, 103, 114, 112,
- 99, 45, 116, 105, 109, 101, 111, 117, 116, 49, 50, 51, 52, 103, 114,
- 112, 99, 46, 119, 97, 105, 116, 95, 102, 111, 114, 95, 114, 101, 97,
- 100, 121, 103, 114, 112, 99, 46, 116, 105, 109, 101, 111, 117, 116, 103,
- 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 113, 117, 101, 115, 116,
- 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115, 103,
- 114, 112, 99, 46, 109, 97, 120, 95, 114, 101, 115, 112, 111, 110, 115,
- 101, 95, 109, 101, 115, 115, 97, 103, 101, 95, 98, 121, 116, 101, 115,
- 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49, 46, 76, 111, 97,
- 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66, 97, 108, 97, 110,
- 99, 101, 76, 111, 97, 100, 47, 101, 110, 118, 111, 121, 46, 115, 101,
- 114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95, 115, 116, 97, 116,
- 115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101, 112, 111, 114, 116,
- 105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101,
- 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115, 47, 101, 110, 118,
- 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100,
- 95, 115, 116, 97, 116, 115, 46, 118, 51, 46, 76, 111, 97, 100, 82,
- 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101,
- 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116,
- 115, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108, 116, 104, 46, 118,
- 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97, 116, 99, 104, 47,
- 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 100,
- 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50, 46, 65, 103, 103,
- 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, 114,
- 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109,
- 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, 117,
- 114, 99, 101, 115, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118,
- 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118,
- 51, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115,
- 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83,
- 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100,
- 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101, 102, 108, 97, 116,
- 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109, 47, 103, 122, 105,
- 112, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120,
- 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50,
- 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52,
- 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97,
- 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97,
- 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97,
- 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115,
- 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111,
- 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105,
- 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104,
- 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45,
- 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45,
- 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116,
- 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110,
- 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116,
- 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110,
- 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105,
- 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116,
- 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109,
- 97, 116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100,
- 45, 115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109,
- 97, 116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45,
- 117, 110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99,
- 101, 108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108,
- 105, 110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45,
- 102, 111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97,
- 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120,
- 121, 45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110,
- 114, 97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102,
- 114, 101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114,
- 115, 101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105,
- 101, 115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111,
- 114, 116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110,
- 115, 102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97,
- 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110,
- 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121,
- 116, 114, 97, 105, 108, 101, 114, 115, 97, 112, 112, 108, 105, 99, 97,
- 116, 105, 111, 110, 47, 103, 114, 112, 99, 103, 114, 112, 99, 80, 85,
- 84, 108, 98, 45, 99, 111, 115, 116, 45, 98, 105, 110, 105, 100, 101,
- 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101, 105, 100,
- 101, 110, 116, 105, 116, 121, 44, 103, 122, 105, 112, 100, 101, 102, 108,
- 97, 116, 101, 44, 103, 122, 105, 112, 105, 100, 101, 110, 116, 105, 116,
- 121, 44, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112};
-
-grpc_slice_refcount grpc_core::StaticSliceRefcount::kStaticSubRefcount;
-
namespace grpc_core {
-struct StaticMetadataCtx {
-#ifndef NDEBUG
- const uint64_t init_canary = kGrpcStaticMetadataInitCanary;
-#endif
- StaticSliceRefcount refcounts[GRPC_STATIC_MDSTR_COUNT] = {
-
- StaticSliceRefcount(0), StaticSliceRefcount(1),
- StaticSliceRefcount(2), StaticSliceRefcount(3),
- StaticSliceRefcount(4), StaticSliceRefcount(5),
- StaticSliceRefcount(6), StaticSliceRefcount(7),
- StaticSliceRefcount(8), StaticSliceRefcount(9),
- StaticSliceRefcount(10), StaticSliceRefcount(11),
- StaticSliceRefcount(12), StaticSliceRefcount(13),
- StaticSliceRefcount(14), StaticSliceRefcount(15),
- StaticSliceRefcount(16), StaticSliceRefcount(17),
- StaticSliceRefcount(18), StaticSliceRefcount(19),
- StaticSliceRefcount(20), StaticSliceRefcount(21),
- StaticSliceRefcount(22), StaticSliceRefcount(23),
- StaticSliceRefcount(24), StaticSliceRefcount(25),
- StaticSliceRefcount(26), StaticSliceRefcount(27),
- StaticSliceRefcount(28), StaticSliceRefcount(29),
- StaticSliceRefcount(30), StaticSliceRefcount(31),
- StaticSliceRefcount(32), StaticSliceRefcount(33),
- StaticSliceRefcount(34), StaticSliceRefcount(35),
- StaticSliceRefcount(36), StaticSliceRefcount(37),
- StaticSliceRefcount(38), StaticSliceRefcount(39),
- StaticSliceRefcount(40), StaticSliceRefcount(41),
- StaticSliceRefcount(42), StaticSliceRefcount(43),
- StaticSliceRefcount(44), StaticSliceRefcount(45),
- StaticSliceRefcount(46), StaticSliceRefcount(47),
- StaticSliceRefcount(48), StaticSliceRefcount(49),
- StaticSliceRefcount(50), StaticSliceRefcount(51),
- StaticSliceRefcount(52), StaticSliceRefcount(53),
- StaticSliceRefcount(54), StaticSliceRefcount(55),
- StaticSliceRefcount(56), StaticSliceRefcount(57),
- StaticSliceRefcount(58), StaticSliceRefcount(59),
- StaticSliceRefcount(60), StaticSliceRefcount(61),
- StaticSliceRefcount(62), StaticSliceRefcount(63),
- StaticSliceRefcount(64), StaticSliceRefcount(65),
- StaticSliceRefcount(66), StaticSliceRefcount(67),
- StaticSliceRefcount(68), StaticSliceRefcount(69),
- StaticSliceRefcount(70), StaticSliceRefcount(71),
- StaticSliceRefcount(72), StaticSliceRefcount(73),
- StaticSliceRefcount(74), StaticSliceRefcount(75),
- StaticSliceRefcount(76), StaticSliceRefcount(77),
- StaticSliceRefcount(78), StaticSliceRefcount(79),
- StaticSliceRefcount(80), StaticSliceRefcount(81),
- StaticSliceRefcount(82), StaticSliceRefcount(83),
- StaticSliceRefcount(84), StaticSliceRefcount(85),
- StaticSliceRefcount(86), StaticSliceRefcount(87),
- StaticSliceRefcount(88), StaticSliceRefcount(89),
- StaticSliceRefcount(90), StaticSliceRefcount(91),
- StaticSliceRefcount(92), StaticSliceRefcount(93),
- StaticSliceRefcount(94), StaticSliceRefcount(95),
- StaticSliceRefcount(96), StaticSliceRefcount(97),
- StaticSliceRefcount(98), StaticSliceRefcount(99),
- StaticSliceRefcount(100), StaticSliceRefcount(101),
- StaticSliceRefcount(102), StaticSliceRefcount(103),
- StaticSliceRefcount(104), StaticSliceRefcount(105),
- StaticSliceRefcount(106), StaticSliceRefcount(107),
- StaticSliceRefcount(108), StaticSliceRefcount(109),
- };
-
- const StaticMetadataSlice slices[GRPC_STATIC_MDSTR_COUNT] = {
-
- grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[3].base, 10, g_bytes + 19),
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[5].base, 2, g_bytes + 36),
- grpc_core::StaticMetadataSlice(&refcounts[6].base, 12, g_bytes + 38),
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[8].base, 16, g_bytes + 61),
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[11].base, 21, g_bytes + 110),
- grpc_core::StaticMetadataSlice(&refcounts[12].base, 13, g_bytes + 131),
- grpc_core::StaticMetadataSlice(&refcounts[13].base, 14, g_bytes + 144),
- grpc_core::StaticMetadataSlice(&refcounts[14].base, 12, g_bytes + 158),
- grpc_core::StaticMetadataSlice(&refcounts[15].base, 16, g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[16].base, 15, g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[17].base, 30, g_bytes + 201),
- grpc_core::StaticMetadataSlice(&refcounts[18].base, 37, g_bytes + 231),
- grpc_core::StaticMetadataSlice(&refcounts[19].base, 10, g_bytes + 268),
- grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278),
- grpc_core::StaticMetadataSlice(&refcounts[21].base, 26, g_bytes + 282),
- grpc_core::StaticMetadataSlice(&refcounts[22].base, 22, g_bytes + 308),
- grpc_core::StaticMetadataSlice(&refcounts[23].base, 27, g_bytes + 330),
- grpc_core::StaticMetadataSlice(&refcounts[24].base, 12, g_bytes + 357),
- grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369),
- grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370),
- grpc_core::StaticMetadataSlice(&refcounts[27].base, 1, g_bytes + 371),
- grpc_core::StaticMetadataSlice(&refcounts[28].base, 1, g_bytes + 372),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- grpc_core::StaticMetadataSlice(&refcounts[30].base, 19, g_bytes + 373),
- grpc_core::StaticMetadataSlice(&refcounts[31].base, 12, g_bytes + 392),
- grpc_core::StaticMetadataSlice(&refcounts[32].base, 30, g_bytes + 404),
- grpc_core::StaticMetadataSlice(&refcounts[33].base, 31, g_bytes + 434),
- grpc_core::StaticMetadataSlice(&refcounts[34].base, 36, g_bytes + 465),
- grpc_core::StaticMetadataSlice(&refcounts[35].base, 65, g_bytes + 501),
- grpc_core::StaticMetadataSlice(&refcounts[36].base, 65, g_bytes + 566),
- grpc_core::StaticMetadataSlice(&refcounts[37].base, 28, g_bytes + 631),
- grpc_core::StaticMetadataSlice(&refcounts[38].base, 80, g_bytes + 659),
- grpc_core::StaticMetadataSlice(&refcounts[39].base, 80, g_bytes + 739),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- grpc_core::StaticMetadataSlice(&refcounts[42].base, 11, g_bytes + 830),
- grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
- grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
- grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
- grpc_core::StaticMetadataSlice(&refcounts[46].base, 11, g_bytes + 849),
- grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
- grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
- grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
- grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
- grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
- grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
- grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
- grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
- grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
- grpc_core::StaticMetadataSlice(&refcounts[56].base, 14, g_bytes + 890),
- grpc_core::StaticMetadataSlice(&refcounts[57].base, 13, g_bytes + 904),
- grpc_core::StaticMetadataSlice(&refcounts[58].base, 15, g_bytes + 917),
- grpc_core::StaticMetadataSlice(&refcounts[59].base, 13, g_bytes + 932),
- grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
- grpc_core::StaticMetadataSlice(&refcounts[61].base, 27, g_bytes + 951),
- grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
- grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
- grpc_core::StaticMetadataSlice(&refcounts[64].base, 13, g_bytes + 986),
- grpc_core::StaticMetadataSlice(&refcounts[65].base, 13, g_bytes + 999),
- grpc_core::StaticMetadataSlice(&refcounts[66].base, 19, g_bytes + 1012),
- grpc_core::StaticMetadataSlice(&refcounts[67].base, 16, g_bytes + 1031),
- grpc_core::StaticMetadataSlice(&refcounts[68].base, 14, g_bytes + 1047),
- grpc_core::StaticMetadataSlice(&refcounts[69].base, 16, g_bytes + 1061),
- grpc_core::StaticMetadataSlice(&refcounts[70].base, 13, g_bytes + 1077),
- grpc_core::StaticMetadataSlice(&refcounts[71].base, 6, g_bytes + 1090),
- grpc_core::StaticMetadataSlice(&refcounts[72].base, 4, g_bytes + 1096),
- grpc_core::StaticMetadataSlice(&refcounts[73].base, 4, g_bytes + 1100),
- grpc_core::StaticMetadataSlice(&refcounts[74].base, 6, g_bytes + 1104),
- grpc_core::StaticMetadataSlice(&refcounts[75].base, 7, g_bytes + 1110),
- grpc_core::StaticMetadataSlice(&refcounts[76].base, 4, g_bytes + 1117),
- grpc_core::StaticMetadataSlice(&refcounts[77].base, 8, g_bytes + 1121),
- grpc_core::StaticMetadataSlice(&refcounts[78].base, 17, g_bytes + 1129),
- grpc_core::StaticMetadataSlice(&refcounts[79].base, 13, g_bytes + 1146),
- grpc_core::StaticMetadataSlice(&refcounts[80].base, 8, g_bytes + 1159),
- grpc_core::StaticMetadataSlice(&refcounts[81].base, 19, g_bytes + 1167),
- grpc_core::StaticMetadataSlice(&refcounts[82].base, 13, g_bytes + 1186),
- grpc_core::StaticMetadataSlice(&refcounts[83].base, 4, g_bytes + 1199),
- grpc_core::StaticMetadataSlice(&refcounts[84].base, 8, g_bytes + 1203),
- grpc_core::StaticMetadataSlice(&refcounts[85].base, 12, g_bytes + 1211),
- grpc_core::StaticMetadataSlice(&refcounts[86].base, 18, g_bytes + 1223),
- grpc_core::StaticMetadataSlice(&refcounts[87].base, 19, g_bytes + 1241),
- grpc_core::StaticMetadataSlice(&refcounts[88].base, 5, g_bytes + 1260),
- grpc_core::StaticMetadataSlice(&refcounts[89].base, 7, g_bytes + 1265),
- grpc_core::StaticMetadataSlice(&refcounts[90].base, 7, g_bytes + 1272),
- grpc_core::StaticMetadataSlice(&refcounts[91].base, 11, g_bytes + 1279),
- grpc_core::StaticMetadataSlice(&refcounts[92].base, 6, g_bytes + 1290),
- grpc_core::StaticMetadataSlice(&refcounts[93].base, 10, g_bytes + 1296),
- grpc_core::StaticMetadataSlice(&refcounts[94].base, 25, g_bytes + 1306),
- grpc_core::StaticMetadataSlice(&refcounts[95].base, 17, g_bytes + 1331),
- grpc_core::StaticMetadataSlice(&refcounts[96].base, 4, g_bytes + 1348),
- grpc_core::StaticMetadataSlice(&refcounts[97].base, 3, g_bytes + 1352),
- grpc_core::StaticMetadataSlice(&refcounts[98].base, 16, g_bytes + 1355),
- grpc_core::StaticMetadataSlice(&refcounts[99].base, 1, g_bytes + 1371),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8, g_bytes + 1372),
- grpc_core::StaticMetadataSlice(&refcounts[101].base, 8, g_bytes + 1380),
- grpc_core::StaticMetadataSlice(&refcounts[102].base, 16, g_bytes + 1388),
- grpc_core::StaticMetadataSlice(&refcounts[103].base, 4, g_bytes + 1404),
- grpc_core::StaticMetadataSlice(&refcounts[104].base, 3, g_bytes + 1408),
- grpc_core::StaticMetadataSlice(&refcounts[105].base, 11, g_bytes + 1411),
- grpc_core::StaticMetadataSlice(&refcounts[106].base, 16, g_bytes + 1422),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13, g_bytes + 1438),
- grpc_core::StaticMetadataSlice(&refcounts[108].base, 12, g_bytes + 1451),
- grpc_core::StaticMetadataSlice(&refcounts[109].base, 21, g_bytes + 1463),
- };
- StaticMetadata static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[3].base, 10, g_bytes + 19),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 0),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[43].base, 3, g_bytes + 841),
- 1),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[44].base, 4, g_bytes + 844),
- 2),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[45].base, 1, g_bytes + 848),
- 3),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[0].base, 5, g_bytes + 0),
- grpc_core::StaticMetadataSlice(&refcounts[46].base, 11,
- g_bytes + 849),
- 4),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[47].base, 4, g_bytes + 860),
- 5),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[48].base, 5, g_bytes + 864),
- 6),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[49].base, 3, g_bytes + 869),
- 7),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[50].base, 3, g_bytes + 872),
- 8),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[51].base, 3, g_bytes + 875),
- 9),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[52].base, 3, g_bytes + 878),
- 10),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[53].base, 3, g_bytes + 881),
- 11),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[54].base, 3, g_bytes + 884),
- 12),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[2].base, 7, g_bytes + 12),
- grpc_core::StaticMetadataSlice(&refcounts[55].base, 3, g_bytes + 887),
- 13),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[56].base, 14,
- g_bytes + 890),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 14),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[57].base, 13,
- g_bytes + 904),
- 15),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[58].base, 15,
- g_bytes + 917),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 16),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[59].base, 13,
- g_bytes + 932),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 17),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[60].base, 6, g_bytes + 945),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 18),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[61].base, 27,
- g_bytes + 951),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 19),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[62].base, 3, g_bytes + 978),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 20),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[63].base, 5, g_bytes + 981),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 21),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[64].base, 13,
- g_bytes + 986),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 22),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[65].base, 13,
- g_bytes + 999),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 23),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[66].base, 19,
- g_bytes + 1012),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 24),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
- g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 25),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[67].base, 16,
- g_bytes + 1031),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 26),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[68].base, 14,
- g_bytes + 1047),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 27),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[69].base, 16,
- g_bytes + 1061),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 28),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[70].base, 13,
- g_bytes + 1077),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 29),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[14].base, 12,
- g_bytes + 158),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 30),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[71].base, 6,
- g_bytes + 1090),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 31),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[72].base, 4,
- g_bytes + 1096),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 32),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[73].base, 4,
- g_bytes + 1100),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 33),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[74].base, 6,
- g_bytes + 1104),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 34),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[75].base, 7,
- g_bytes + 1110),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 35),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[76].base, 4,
- g_bytes + 1117),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 36),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[20].base, 4, g_bytes + 278),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 37),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[77].base, 8,
- g_bytes + 1121),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 38),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[78].base, 17,
- g_bytes + 1129),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 39),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[79].base, 13,
- g_bytes + 1146),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 40),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[80].base, 8,
- g_bytes + 1159),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 41),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[81].base, 19,
- g_bytes + 1167),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 42),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[82].base, 13,
- g_bytes + 1186),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 43),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[83].base, 4,
- g_bytes + 1199),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 44),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[84].base, 8,
- g_bytes + 1203),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 45),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[85].base, 12,
- g_bytes + 1211),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 46),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[86].base, 18,
- g_bytes + 1223),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 47),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[87].base, 19,
- g_bytes + 1241),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 48),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[88].base, 5,
- g_bytes + 1260),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 49),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[89].base, 7,
- g_bytes + 1265),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 50),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[90].base, 7,
- g_bytes + 1272),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 51),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[91].base, 11,
- g_bytes + 1279),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 52),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[92].base, 6,
- g_bytes + 1290),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 53),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[93].base, 10,
- g_bytes + 1296),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 54),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[94].base, 25,
- g_bytes + 1306),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 55),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[95].base, 17,
- g_bytes + 1331),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 56),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[19].base, 10,
- g_bytes + 268),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 57),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[96].base, 4,
- g_bytes + 1348),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 58),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[97].base, 3,
- g_bytes + 1352),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 59),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[98].base, 16,
- g_bytes + 1355),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 60),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[99].base, 1,
- g_bytes + 1371),
- 61),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[25].base, 1, g_bytes + 369),
- 62),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[7].base, 11, g_bytes + 50),
- grpc_core::StaticMetadataSlice(&refcounts[26].base, 1, g_bytes + 370),
- 63),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
- 64),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- 65),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[9].base, 13, g_bytes + 77),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
- 66),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[5].base, 2, g_bytes + 36),
- grpc_core::StaticMetadataSlice(&refcounts[101].base, 8,
- g_bytes + 1380),
- 67),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[14].base, 12,
- g_bytes + 158),
- grpc_core::StaticMetadataSlice(&refcounts[102].base, 16,
- g_bytes + 1388),
- 68),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[4].base, 7, g_bytes + 29),
- grpc_core::StaticMetadataSlice(&refcounts[103].base, 4,
- g_bytes + 1404),
- 69),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[1].base, 7, g_bytes + 5),
- grpc_core::StaticMetadataSlice(&refcounts[104].base, 3,
- g_bytes + 1408),
- 70),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 71),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
- g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
- 72),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[15].base, 16,
- g_bytes + 170),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- 73),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[105].base, 11,
- g_bytes + 1411),
- grpc_core::StaticMetadataSlice(&refcounts[29].base, 0, g_bytes + 373),
- 74),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
- 75),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[40].base, 7, g_bytes + 819),
- 76),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[106].base, 16,
- g_bytes + 1422),
- 77),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- 78),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
- g_bytes + 1438),
- 79),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[108].base, 12,
- g_bytes + 1451),
- 80),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[10].base, 20, g_bytes + 90),
- grpc_core::StaticMetadataSlice(&refcounts[109].base, 21,
- g_bytes + 1463),
- 81),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[100].base, 8,
- g_bytes + 1372),
- 82),
- StaticMetadata(
- grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[41].base, 4, g_bytes + 826),
- 83),
- StaticMetadata(grpc_core::StaticMetadataSlice(&refcounts[16].base, 15,
- g_bytes + 186),
- grpc_core::StaticMetadataSlice(&refcounts[107].base, 13,
- g_bytes + 1438),
- 84),
- };
+StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10,
+ g_static_metadata_bytes + 19),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 0),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
+ g_static_metadata_bytes + 5),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 3,
+ g_static_metadata_bytes + 603),
+ 1),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
+ g_static_metadata_bytes + 5),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 4,
+ g_static_metadata_bytes + 606),
+ 2),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
+ g_static_metadata_bytes + 0),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 1,
+ g_static_metadata_bytes + 610),
+ 3),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
+ g_static_metadata_bytes + 0),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 11,
+ g_static_metadata_bytes + 611),
+ 4),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
+ g_static_metadata_bytes + 29),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
+ g_static_metadata_bytes + 622),
+ 5),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
+ g_static_metadata_bytes + 29),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 5,
+ g_static_metadata_bytes + 626),
+ 6),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 3,
+ g_static_metadata_bytes + 631),
+ 7),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 3,
+ g_static_metadata_bytes + 634),
+ 8),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 3,
+ g_static_metadata_bytes + 637),
+ 9),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 3,
+ g_static_metadata_bytes + 640),
+ 10),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 3,
+ g_static_metadata_bytes + 643),
+ 11),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 3,
+ g_static_metadata_bytes + 646),
+ 12),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
+ g_static_metadata_bytes + 12),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 3,
+ g_static_metadata_bytes + 649),
+ 13),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 14,
+ g_static_metadata_bytes + 652),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 14),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 13,
+ g_static_metadata_bytes + 666),
+ 15),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 15,
+ g_static_metadata_bytes + 679),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 16),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 13,
+ g_static_metadata_bytes + 694),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 17),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 6,
+ g_static_metadata_bytes + 707),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 18),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 27,
+ g_static_metadata_bytes + 713),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 19),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
+ g_static_metadata_bytes + 740),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 20),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 5,
+ g_static_metadata_bytes + 743),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 21),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 13,
+ g_static_metadata_bytes + 748),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 22),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 13,
+ g_static_metadata_bytes + 761),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 23),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 19,
+ g_static_metadata_bytes + 774),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 24),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
+ g_static_metadata_bytes + 92),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 25),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 16,
+ g_static_metadata_bytes + 793),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 26),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 14,
+ g_static_metadata_bytes + 809),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 27),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 16,
+ g_static_metadata_bytes + 823),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 28),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
+ g_static_metadata_bytes + 839),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 29),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
+ g_static_metadata_bytes + 80),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 30),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 6,
+ g_static_metadata_bytes + 852),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 31),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 4,
+ g_static_metadata_bytes + 858),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 32),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 4,
+ g_static_metadata_bytes + 862),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 33),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 6,
+ g_static_metadata_bytes + 866),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 34),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 7,
+ g_static_metadata_bytes + 872),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 35),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 4,
+ g_static_metadata_bytes + 879),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 36),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 4,
+ g_static_metadata_bytes + 883),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 37),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 8,
+ g_static_metadata_bytes + 887),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 38),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 17,
+ g_static_metadata_bytes + 895),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 39),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 13,
+ g_static_metadata_bytes + 912),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 40),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 8,
+ g_static_metadata_bytes + 925),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 41),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 19,
+ g_static_metadata_bytes + 933),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 42),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
+ g_static_metadata_bytes + 952),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 43),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 4,
+ g_static_metadata_bytes + 965),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 44),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 8,
+ g_static_metadata_bytes + 969),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 45),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 12,
+ g_static_metadata_bytes + 977),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 46),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 18,
+ g_static_metadata_bytes + 989),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 47),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 19,
+ g_static_metadata_bytes + 1007),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 48),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 5,
+ g_static_metadata_bytes + 1026),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 49),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 7,
+ g_static_metadata_bytes + 1031),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 50),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 7,
+ g_static_metadata_bytes + 1038),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 51),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 11,
+ g_static_metadata_bytes + 1045),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 52),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 6,
+ g_static_metadata_bytes + 1056),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 53),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 10,
+ g_static_metadata_bytes + 1062),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 54),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 25,
+ g_static_metadata_bytes + 1072),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 55),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 17,
+ g_static_metadata_bytes + 1097),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 56),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 10,
+ g_static_metadata_bytes + 1114),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 57),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 4,
+ g_static_metadata_bytes + 1124),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 58),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 3,
+ g_static_metadata_bytes + 1128),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 59),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 16,
+ g_static_metadata_bytes + 1131),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 60),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
+ g_static_metadata_bytes + 36),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 1,
+ g_static_metadata_bytes + 1147),
+ 61),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
+ g_static_metadata_bytes + 36),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 1,
+ g_static_metadata_bytes + 213),
+ 62),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
+ g_static_metadata_bytes + 36),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 1,
+ g_static_metadata_bytes + 214),
+ 63),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
+ g_static_metadata_bytes + 47),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
+ g_static_metadata_bytes + 1148),
+ 64),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
+ g_static_metadata_bytes + 47),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
+ g_static_metadata_bytes + 578),
+ 65),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
+ g_static_metadata_bytes + 47),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
+ g_static_metadata_bytes + 571),
+ 66),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
+ g_static_metadata_bytes + 80),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 16,
+ g_static_metadata_bytes + 1156),
+ 67),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
+ g_static_metadata_bytes + 29),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 4,
+ g_static_metadata_bytes + 1172),
+ 68),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
+ g_static_metadata_bytes + 5),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 3,
+ g_static_metadata_bytes + 1176),
+ 69),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 70),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
+ g_static_metadata_bytes + 92),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
+ g_static_metadata_bytes + 1148),
+ 71),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
+ g_static_metadata_bytes + 92),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
+ g_static_metadata_bytes + 578),
+ 72),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 11,
+ g_static_metadata_bytes + 1179),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
+ g_static_metadata_bytes + 217),
+ 73),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
+ g_static_metadata_bytes + 1148),
+ 74),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
+ g_static_metadata_bytes + 571),
+ 75),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 16,
+ g_static_metadata_bytes + 1190),
+ 76),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
+ g_static_metadata_bytes + 578),
+ 77),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
+ g_static_metadata_bytes + 1206),
+ 78),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 12,
+ g_static_metadata_bytes + 1219),
+ 79),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
+ g_static_metadata_bytes + 60),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 21,
+ g_static_metadata_bytes + 1231),
+ 80),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
+ g_static_metadata_bytes + 1148),
+ 81),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
+ g_static_metadata_bytes + 578),
+ 82),
+ StaticMetadata(
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
+ g_static_metadata_bytes + 108),
+ StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
+ g_static_metadata_bytes + 1206),
+ 83),
+};
- /* Warning: the core static metadata currently operates under the soft
- constraint that the first GRPC_CHTTP2_LAST_STATIC_ENTRY (61) entries must
- contain metadata specified by the http2 hpack standard. The CHTTP2 transport
- reads the core metadata with this assumption in mind. If the order of the core
- static metadata is to be changed, then the CHTTP2 transport must be changed as
- well to stop relying on the core metadata. */
+/* Warning: the core static metadata currently operates under the soft
+constraint that the first GRPC_CHTTP2_LAST_STATIC_ENTRY (61) entries must
+contain metadata specified by the http2 hpack standard. The CHTTP2 transport
+reads the core metadata with this assumption in mind. If the order of the core
+static metadata is to be changed, then the CHTTP2 transport must be changed as
+well to stop relying on the core metadata. */
- grpc_mdelem static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT] = {
- // clang-format off
+grpc_mdelem g_static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT] = {
+ // clang-format off
/* GRPC_MDELEM_AUTHORITY_EMPTY:
":authority": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[0].data(),
+ &g_static_mdelem_table[0].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_METHOD_GET:
":method": "GET" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[1].data(),
+ &g_static_mdelem_table[1].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_METHOD_POST:
":method": "POST" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[2].data(),
+ &g_static_mdelem_table[2].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_PATH_SLASH:
":path": "/" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[3].data(),
+ &g_static_mdelem_table[3].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML:
":path": "/index.html" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[4].data(),
+ &g_static_mdelem_table[4].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_SCHEME_HTTP:
":scheme": "http" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[5].data(),
+ &g_static_mdelem_table[5].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_SCHEME_HTTPS:
":scheme": "https" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[6].data(),
+ &g_static_mdelem_table[6].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_200:
":status": "200" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[7].data(),
+ &g_static_mdelem_table[7].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_204:
":status": "204" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[8].data(),
+ &g_static_mdelem_table[8].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_206:
":status": "206" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[9].data(),
+ &g_static_mdelem_table[9].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_304:
":status": "304" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[10].data(),
+ &g_static_mdelem_table[10].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_400:
":status": "400" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[11].data(),
+ &g_static_mdelem_table[11].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_404:
":status": "404" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[12].data(),
+ &g_static_mdelem_table[12].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STATUS_500:
":status": "500" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[13].data(),
+ &g_static_mdelem_table[13].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_CHARSET_EMPTY:
"accept-charset": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[14].data(),
+ &g_static_mdelem_table[14].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE:
"accept-encoding": "gzip, deflate" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[15].data(),
+ &g_static_mdelem_table[15].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY:
"accept-language": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[16].data(),
+ &g_static_mdelem_table[16].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_RANGES_EMPTY:
"accept-ranges": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[17].data(),
+ &g_static_mdelem_table[17].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_EMPTY:
"accept": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[18].data(),
+ &g_static_mdelem_table[18].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY:
"access-control-allow-origin": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[19].data(),
+ &g_static_mdelem_table[19].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_AGE_EMPTY:
"age": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[20].data(),
+ &g_static_mdelem_table[20].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ALLOW_EMPTY:
"allow": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[21].data(),
+ &g_static_mdelem_table[21].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_AUTHORIZATION_EMPTY:
"authorization": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[22].data(),
+ &g_static_mdelem_table[22].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CACHE_CONTROL_EMPTY:
"cache-control": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[23].data(),
+ &g_static_mdelem_table[23].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY:
"content-disposition": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[24].data(),
+ &g_static_mdelem_table[24].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_ENCODING_EMPTY:
"content-encoding": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[25].data(),
+ &g_static_mdelem_table[25].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY:
"content-language": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[26].data(),
+ &g_static_mdelem_table[26].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_LENGTH_EMPTY:
"content-length": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[27].data(),
+ &g_static_mdelem_table[27].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_LOCATION_EMPTY:
"content-location": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[28].data(),
+ &g_static_mdelem_table[28].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_RANGE_EMPTY:
"content-range": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[29].data(),
+ &g_static_mdelem_table[29].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_TYPE_EMPTY:
"content-type": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[30].data(),
+ &g_static_mdelem_table[30].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_COOKIE_EMPTY:
"cookie": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[31].data(),
+ &g_static_mdelem_table[31].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_DATE_EMPTY:
"date": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[32].data(),
+ &g_static_mdelem_table[32].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ETAG_EMPTY:
"etag": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[33].data(),
+ &g_static_mdelem_table[33].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_EXPECT_EMPTY:
"expect": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[34].data(),
+ &g_static_mdelem_table[34].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_EXPIRES_EMPTY:
"expires": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[35].data(),
+ &g_static_mdelem_table[35].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_FROM_EMPTY:
"from": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[36].data(),
+ &g_static_mdelem_table[36].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_HOST_EMPTY:
"host": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[37].data(),
+ &g_static_mdelem_table[37].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_IF_MATCH_EMPTY:
"if-match": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[38].data(),
+ &g_static_mdelem_table[38].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY:
"if-modified-since": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[39].data(),
+ &g_static_mdelem_table[39].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_IF_NONE_MATCH_EMPTY:
"if-none-match": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[40].data(),
+ &g_static_mdelem_table[40].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_IF_RANGE_EMPTY:
"if-range": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[41].data(),
+ &g_static_mdelem_table[41].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY:
"if-unmodified-since": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[42].data(),
+ &g_static_mdelem_table[42].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_LAST_MODIFIED_EMPTY:
"last-modified": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[43].data(),
+ &g_static_mdelem_table[43].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_LINK_EMPTY:
"link": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[44].data(),
+ &g_static_mdelem_table[44].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_LOCATION_EMPTY:
"location": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[45].data(),
+ &g_static_mdelem_table[45].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_MAX_FORWARDS_EMPTY:
"max-forwards": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[46].data(),
+ &g_static_mdelem_table[46].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY:
"proxy-authenticate": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[47].data(),
+ &g_static_mdelem_table[47].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY:
"proxy-authorization": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[48].data(),
+ &g_static_mdelem_table[48].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_RANGE_EMPTY:
"range": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[49].data(),
+ &g_static_mdelem_table[49].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_REFERER_EMPTY:
"referer": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[50].data(),
+ &g_static_mdelem_table[50].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_REFRESH_EMPTY:
"refresh": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[51].data(),
+ &g_static_mdelem_table[51].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_RETRY_AFTER_EMPTY:
"retry-after": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[52].data(),
+ &g_static_mdelem_table[52].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_SERVER_EMPTY:
"server": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[53].data(),
+ &g_static_mdelem_table[53].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_SET_COOKIE_EMPTY:
"set-cookie": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[54].data(),
+ &g_static_mdelem_table[54].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY:
"strict-transport-security": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[55].data(),
+ &g_static_mdelem_table[55].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_TRANSFER_ENCODING_EMPTY:
"transfer-encoding": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[56].data(),
+ &g_static_mdelem_table[56].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_USER_AGENT_EMPTY:
"user-agent": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[57].data(),
+ &g_static_mdelem_table[57].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_VARY_EMPTY:
"vary": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[58].data(),
+ &g_static_mdelem_table[58].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_VIA_EMPTY:
"via": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[59].data(),
+ &g_static_mdelem_table[59].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY:
"www-authenticate": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[60].data(),
+ &g_static_mdelem_table[60].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_STATUS_0:
"grpc-status": "0" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[61].data(),
+ &g_static_mdelem_table[61].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_STATUS_1:
"grpc-status": "1" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[62].data(),
+ &g_static_mdelem_table[62].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_STATUS_2:
"grpc-status": "2" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[63].data(),
+ &g_static_mdelem_table[63].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ENCODING_IDENTITY:
"grpc-encoding": "identity" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[64].data(),
+ &g_static_mdelem_table[64].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ENCODING_GZIP:
"grpc-encoding": "gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[65].data(),
+ &g_static_mdelem_table[65].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ENCODING_DEFLATE:
"grpc-encoding": "deflate" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[66].data(),
- GRPC_MDELEM_STORAGE_STATIC),
- /* GRPC_MDELEM_TE_TRAILERS:
- "te": "trailers" */
- GRPC_MAKE_MDELEM(
- &static_mdelem_table[67].data(),
+ &g_static_mdelem_table[66].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC:
"content-type": "application/grpc" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[68].data(),
+ &g_static_mdelem_table[67].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_SCHEME_GRPC:
":scheme": "grpc" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[69].data(),
+ &g_static_mdelem_table[68].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_METHOD_PUT:
":method": "PUT" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[70].data(),
+ &g_static_mdelem_table[69].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_ENCODING_EMPTY:
"accept-encoding": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[71].data(),
+ &g_static_mdelem_table[70].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_ENCODING_IDENTITY:
"content-encoding": "identity" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[72].data(),
+ &g_static_mdelem_table[71].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_CONTENT_ENCODING_GZIP:
"content-encoding": "gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[73].data(),
+ &g_static_mdelem_table[72].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_LB_COST_BIN_EMPTY:
"lb-cost-bin": "" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[74].data(),
+ &g_static_mdelem_table[73].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY:
"grpc-accept-encoding": "identity" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[75].data(),
+ &g_static_mdelem_table[74].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE:
"grpc-accept-encoding": "deflate" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[76].data(),
+ &g_static_mdelem_table[75].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE:
"grpc-accept-encoding": "identity,deflate" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[77].data(),
+ &g_static_mdelem_table[76].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP:
"grpc-accept-encoding": "gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[78].data(),
+ &g_static_mdelem_table[77].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP:
"grpc-accept-encoding": "identity,gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[79].data(),
+ &g_static_mdelem_table[78].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP:
"grpc-accept-encoding": "deflate,gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[80].data(),
+ &g_static_mdelem_table[79].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP:
"grpc-accept-encoding": "identity,deflate,gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[81].data(),
+ &g_static_mdelem_table[80].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY:
"accept-encoding": "identity" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[82].data(),
+ &g_static_mdelem_table[81].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_ENCODING_GZIP:
"accept-encoding": "gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[83].data(),
+ &g_static_mdelem_table[82].data(),
GRPC_MDELEM_STORAGE_STATIC),
/* GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP:
"accept-encoding": "identity,gzip" */
GRPC_MAKE_MDELEM(
- &static_mdelem_table[84].data(),
+ &g_static_mdelem_table[83].data(),
GRPC_MDELEM_STORAGE_STATIC)
- // clang-format on
- };
+ // clang-format on
};
} // namespace grpc_core
-namespace grpc_core {
-static StaticMetadataCtx* g_static_metadata_slice_ctx = nullptr;
-const StaticMetadataSlice* g_static_metadata_slice_table = nullptr;
-StaticSliceRefcount* g_static_metadata_slice_refcounts = nullptr;
-StaticMetadata* g_static_mdelem_table = nullptr;
-grpc_mdelem* g_static_mdelem_manifested = nullptr;
-#ifndef NDEBUG
-uint64_t StaticMetadataInitCanary() {
- return g_static_metadata_slice_ctx->init_canary;
-}
-#endif
-} // namespace grpc_core
-
-void grpc_init_static_metadata_ctx(void) {
- grpc_core::g_static_metadata_slice_ctx = new grpc_core::StaticMetadataCtx();
- grpc_core::g_static_metadata_slice_table =
- grpc_core::g_static_metadata_slice_ctx->slices;
- grpc_core::g_static_metadata_slice_refcounts =
- grpc_core::g_static_metadata_slice_ctx->refcounts;
- grpc_core::g_static_mdelem_table =
- grpc_core::g_static_metadata_slice_ctx->static_mdelem_table;
- grpc_core::g_static_mdelem_manifested =
- grpc_core::g_static_metadata_slice_ctx->static_mdelem_manifested;
-}
-
-void grpc_destroy_static_metadata_ctx(void) {
- delete grpc_core::g_static_metadata_slice_ctx;
- grpc_core::g_static_metadata_slice_ctx = nullptr;
- grpc_core::g_static_metadata_slice_table = nullptr;
- grpc_core::g_static_metadata_slice_refcounts = nullptr;
- grpc_core::g_static_mdelem_table = nullptr;
- grpc_core::g_static_mdelem_manifested = nullptr;
-}
-
uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4};
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4};
static const int8_t elems_r[] = {
- 15, 10, -8, 0, 2, -43, -83, -44, 0, 4, -8, 0, 0, 0, 10, 0, -7, 0,
- 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, -68, 0, -53, -56, -53, -77, 0, 30, 29, 28, 27, 26, 25, 24, 35, 22,
- 21, 20, 19, 18, 17, 16, 15, 16, 16, 16, 15, 14, 13, 12, 11, 10, 9, 8,
- 7, 6, 5, 4, 3, 2, 3, 2, 2, 6, 0, 0, 0, 0, 0, 0, -7, 0};
+ 18, 11, -8, 0, -1, -46, 11, 0, 13, 10, 7, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, -51, 0, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63,
+ 0, 33, 32, 31, 30, 29, 29, 28, 27, 26, 25, 24, 23, 22,
+ 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8,
+ 7, 6, 5, 4, 4, 3, 0, 0, 0, 0, 0, -8, 0};
static uint32_t elems_phash(uint32_t i) {
- i -= 45;
- uint32_t x = i % 108;
- uint32_t y = i / 108;
+ i -= 33;
+ uint32_t x = i % 97;
+ uint32_t y = i / 97;
uint32_t h = x;
if (y < GPR_ARRAY_SIZE(elems_r)) {
uint32_t delta = static_cast<uint32_t>(elems_r[y]);
@@ -1214,36 +998,35 @@ static uint32_t elems_phash(uint32_t i) {
}
static const uint16_t elem_keys[] = {
- 269, 270, 271, 272, 273, 274, 275, 1140, 1141, 1789, 153,
- 154, 487, 488, 1679, 45, 46, 1030, 1031, 795, 796, 1801,
- 1569, 651, 869, 2119, 1691, 2229, 6189, 6739, 6849, 6959, 7069,
- 7179, 7289, 7399, 7509, 1817, 7729, 7839, 7949, 8059, 8169, 8279,
- 8389, 8499, 6519, 6409, 8609, 7619, 8719, 6629, 8829, 8939, 9049,
- 9159, 9269, 9379, 9489, 9599, 9709, 9819, 9929, 10039, 10149, 10259,
- 10369, 1200, 543, 10479, 10589, 214, 10699, 1206, 1207, 1208, 1209,
- 1090, 10809, 11579, 1860, 0, 0, 0, 0, 1750, 0, 1867,
- 0, 0, 359, 0, 0, 0, 0, 1642};
+ 235, 236, 237, 238, 239, 240, 241, 719, 720, 431, 432, 130,
+ 131, 1009, 910, 811, 620, 621, 33, 34, 584, 1017, 918, 4375,
+ 4573, 4672, 4771, 4870, 4969, 5068, 5167, 5266, 5365, 5464, 5563, 5662,
+ 5761, 5860, 5959, 1035, 6058, 6157, 6256, 6355, 6454, 6553, 6652, 6751,
+ 6850, 6949, 7048, 7147, 7246, 7345, 7444, 7543, 7642, 7741, 7840, 7939,
+ 8038, 8137, 8236, 8335, 8434, 8533, 488, 8632, 8731, 9325, 0, 783,
+ 0, 192, 0, 0, 788, 789, 790, 791, 684, 316, 0, 0,
+ 1080, 981, 0, 883, 510, 511, 1086};
static const uint8_t elem_idxs[] = {
- 7, 8, 9, 10, 11, 12, 13, 76, 78, 71, 1, 2, 5, 6, 25, 3,
- 4, 66, 65, 62, 63, 83, 30, 67, 61, 57, 73, 37, 14, 19, 20, 21,
- 22, 23, 24, 26, 27, 15, 29, 31, 32, 33, 34, 35, 36, 38, 17, 16,
- 39, 28, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- 53, 54, 55, 75, 69, 56, 58, 70, 59, 77, 79, 80, 81, 64, 60, 74,
- 82, 255, 255, 255, 255, 72, 255, 84, 255, 255, 0, 255, 255, 255, 255, 68};
+ 7, 8, 9, 10, 11, 12, 13, 75, 77, 5, 6, 1, 2, 70, 25, 30,
+ 66, 65, 3, 4, 61, 82, 72, 14, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 26, 27, 28, 29, 31, 32, 15, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 68, 59, 60, 73, 255, 74, 255, 69, 255, 255, 76, 78, 79, 80,
+ 64, 0, 255, 255, 81, 71, 255, 67, 62, 63, 83};
grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) {
if (a == -1 || b == -1) return GRPC_MDNULL;
- uint32_t k = static_cast<uint32_t>(a * 110 + b);
+ uint32_t k = static_cast<uint32_t>(a * 99 + b);
uint32_t h = elems_phash(k);
return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k &&
elem_idxs[h] != 255
? GRPC_MAKE_MDELEM(
- &grpc_static_mdelem_table()[elem_idxs[h]].data(),
+ &grpc_core::g_static_mdelem_table[elem_idxs[h]].data(),
GRPC_MDELEM_STORAGE_STATIC)
: GRPC_MDNULL;
}
-const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 75, 76, 77,
- 78, 79, 80, 81};
+const uint8_t grpc_static_accept_encoding_metadata[8] = {0, 74, 75, 76,
+ 77, 78, 79, 80};
-const uint8_t grpc_static_accept_stream_encoding_metadata[4] = {0, 82, 83, 84};
+const uint8_t grpc_static_accept_stream_encoding_metadata[4] = {0, 81, 82, 83};
diff --git a/contrib/libs/grpc/src/core/lib/transport/static_metadata.h b/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
index 5d844af558c..488e5ec49b5 100644
--- a/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
+++ b/contrib/libs/grpc/src/core/lib/transport/static_metadata.h
@@ -31,493 +31,231 @@
#include <cstdint>
+#include "src/core/lib/slice/static_slice.h"
#include "src/core/lib/transport/metadata.h"
-static_assert(
- std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
- "grpc_core::StaticMetadataSlice must be trivially destructible.");
-#define GRPC_STATIC_MDSTR_COUNT 110
+#define GRPC_STATIC_MDELEM_COUNT 84
-void grpc_init_static_metadata_ctx(void);
-void grpc_destroy_static_metadata_ctx(void);
namespace grpc_core {
-#ifndef NDEBUG
-constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
-uint64_t StaticMetadataInitCanary();
-#endif
-extern const StaticMetadataSlice* g_static_metadata_slice_table;
+extern StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT];
+extern grpc_mdelem g_static_mdelem_manifested[GRPC_STATIC_MDELEM_COUNT];
} // namespace grpc_core
-inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_table != nullptr);
- return grpc_core::g_static_metadata_slice_table;
-}
-
-/* ":path" */
-#define GRPC_MDSTR_PATH (grpc_static_slice_table()[0])
-/* ":method" */
-#define GRPC_MDSTR_METHOD (grpc_static_slice_table()[1])
-/* ":status" */
-#define GRPC_MDSTR_STATUS (grpc_static_slice_table()[2])
-/* ":authority" */
-#define GRPC_MDSTR_AUTHORITY (grpc_static_slice_table()[3])
-/* ":scheme" */
-#define GRPC_MDSTR_SCHEME (grpc_static_slice_table()[4])
-/* "te" */
-#define GRPC_MDSTR_TE (grpc_static_slice_table()[5])
-/* "grpc-message" */
-#define GRPC_MDSTR_GRPC_MESSAGE (grpc_static_slice_table()[6])
-/* "grpc-status" */
-#define GRPC_MDSTR_GRPC_STATUS (grpc_static_slice_table()[7])
-/* "grpc-payload-bin" */
-#define GRPC_MDSTR_GRPC_PAYLOAD_BIN (grpc_static_slice_table()[8])
-/* "grpc-encoding" */
-#define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table()[9])
-/* "grpc-accept-encoding" */
-#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table()[10])
-/* "grpc-server-stats-bin" */
-#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table()[11])
-/* "grpc-tags-bin" */
-#define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table()[12])
-/* "grpc-trace-bin" */
-#define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table()[13])
-/* "content-type" */
-#define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table()[14])
-/* "content-encoding" */
-#define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table()[15])
-/* "accept-encoding" */
-#define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table()[16])
-/* "grpc-internal-encoding-request" */
-#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
- (grpc_static_slice_table()[17])
-/* "grpc-internal-stream-encoding-request" */
-#define GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST \
- (grpc_static_slice_table()[18])
-/* "user-agent" */
-#define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table()[19])
-/* "host" */
-#define GRPC_MDSTR_HOST (grpc_static_slice_table()[20])
-/* "grpc-previous-rpc-attempts" */
-#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table()[21])
-/* "grpc-retry-pushback-ms" */
-#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table()[22])
-/* "x-endpoint-load-metrics-bin" */
-#define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN (grpc_static_slice_table()[23])
-/* "grpc-timeout" */
-#define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[24])
-/* "1" */
-#define GRPC_MDSTR_1 (grpc_static_slice_table()[25])
-/* "2" */
-#define GRPC_MDSTR_2 (grpc_static_slice_table()[26])
-/* "3" */
-#define GRPC_MDSTR_3 (grpc_static_slice_table()[27])
-/* "4" */
-#define GRPC_MDSTR_4 (grpc_static_slice_table()[28])
-/* "" */
-#define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[29])
-/* "grpc.wait_for_ready" */
-#define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[30])
-/* "grpc.timeout" */
-#define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[31])
-/* "grpc.max_request_message_bytes" */
-#define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \
- (grpc_static_slice_table()[32])
-/* "grpc.max_response_message_bytes" */
-#define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \
- (grpc_static_slice_table()[33])
-/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
-#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
- (grpc_static_slice_table()[34])
-/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
- (grpc_static_slice_table()[35])
-/* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
- (grpc_static_slice_table()[36])
-/* "/grpc.health.v1.Health/Watch" */
-#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
- (grpc_static_slice_table()[37])
-/* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
- */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
- (grpc_static_slice_table()[38])
-/* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
- */
-#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
- (grpc_static_slice_table()[39])
-/* "deflate" */
-#define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[40])
-/* "gzip" */
-#define GRPC_MDSTR_GZIP (grpc_static_slice_table()[41])
-/* "stream/gzip" */
-#define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[42])
-/* "GET" */
-#define GRPC_MDSTR_GET (grpc_static_slice_table()[43])
-/* "POST" */
-#define GRPC_MDSTR_POST (grpc_static_slice_table()[44])
-/* "/" */
-#define GRPC_MDSTR_SLASH (grpc_static_slice_table()[45])
-/* "/index.html" */
-#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[46])
-/* "http" */
-#define GRPC_MDSTR_HTTP (grpc_static_slice_table()[47])
-/* "https" */
-#define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[48])
-/* "200" */
-#define GRPC_MDSTR_200 (grpc_static_slice_table()[49])
-/* "204" */
-#define GRPC_MDSTR_204 (grpc_static_slice_table()[50])
-/* "206" */
-#define GRPC_MDSTR_206 (grpc_static_slice_table()[51])
-/* "304" */
-#define GRPC_MDSTR_304 (grpc_static_slice_table()[52])
-/* "400" */
-#define GRPC_MDSTR_400 (grpc_static_slice_table()[53])
-/* "404" */
-#define GRPC_MDSTR_404 (grpc_static_slice_table()[54])
-/* "500" */
-#define GRPC_MDSTR_500 (grpc_static_slice_table()[55])
-/* "accept-charset" */
-#define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[56])
-/* "gzip, deflate" */
-#define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[57])
-/* "accept-language" */
-#define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[58])
-/* "accept-ranges" */
-#define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[59])
-/* "accept" */
-#define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[60])
-/* "access-control-allow-origin" */
-#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[61])
-/* "age" */
-#define GRPC_MDSTR_AGE (grpc_static_slice_table()[62])
-/* "allow" */
-#define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[63])
-/* "authorization" */
-#define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[64])
-/* "cache-control" */
-#define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[65])
-/* "content-disposition" */
-#define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[66])
-/* "content-language" */
-#define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[67])
-/* "content-length" */
-#define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[68])
-/* "content-location" */
-#define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[69])
-/* "content-range" */
-#define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[70])
-/* "cookie" */
-#define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[71])
-/* "date" */
-#define GRPC_MDSTR_DATE (grpc_static_slice_table()[72])
-/* "etag" */
-#define GRPC_MDSTR_ETAG (grpc_static_slice_table()[73])
-/* "expect" */
-#define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[74])
-/* "expires" */
-#define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[75])
-/* "from" */
-#define GRPC_MDSTR_FROM (grpc_static_slice_table()[76])
-/* "if-match" */
-#define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[77])
-/* "if-modified-since" */
-#define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[78])
-/* "if-none-match" */
-#define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[79])
-/* "if-range" */
-#define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[80])
-/* "if-unmodified-since" */
-#define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[81])
-/* "last-modified" */
-#define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[82])
-/* "link" */
-#define GRPC_MDSTR_LINK (grpc_static_slice_table()[83])
-/* "location" */
-#define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[84])
-/* "max-forwards" */
-#define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[85])
-/* "proxy-authenticate" */
-#define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[86])
-/* "proxy-authorization" */
-#define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[87])
-/* "range" */
-#define GRPC_MDSTR_RANGE (grpc_static_slice_table()[88])
-/* "referer" */
-#define GRPC_MDSTR_REFERER (grpc_static_slice_table()[89])
-/* "refresh" */
-#define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[90])
-/* "retry-after" */
-#define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[91])
-/* "server" */
-#define GRPC_MDSTR_SERVER (grpc_static_slice_table()[92])
-/* "set-cookie" */
-#define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[93])
-/* "strict-transport-security" */
-#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[94])
-/* "transfer-encoding" */
-#define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[95])
-/* "vary" */
-#define GRPC_MDSTR_VARY (grpc_static_slice_table()[96])
-/* "via" */
-#define GRPC_MDSTR_VIA (grpc_static_slice_table()[97])
-/* "www-authenticate" */
-#define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[98])
-/* "0" */
-#define GRPC_MDSTR_0 (grpc_static_slice_table()[99])
-/* "identity" */
-#define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[100])
-/* "trailers" */
-#define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[101])
-/* "application/grpc" */
-#define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[102])
-/* "grpc" */
-#define GRPC_MDSTR_GRPC (grpc_static_slice_table()[103])
-/* "PUT" */
-#define GRPC_MDSTR_PUT (grpc_static_slice_table()[104])
-/* "lb-cost-bin" */
-#define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[105])
-/* "identity,deflate" */
-#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[106])
-/* "identity,gzip" */
-#define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[107])
-/* "deflate,gzip" */
-#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[108])
-/* "identity,deflate,gzip" */
-#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
- (grpc_static_slice_table()[109])
-
-namespace grpc_core {
-struct StaticSliceRefcount;
-extern StaticSliceRefcount* g_static_metadata_slice_refcounts;
-} // namespace grpc_core
-inline grpc_core::StaticSliceRefcount* grpc_static_metadata_refcounts() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_refcounts != nullptr);
- return grpc_core::g_static_metadata_slice_refcounts;
-}
-
-#define GRPC_IS_STATIC_METADATA_STRING(slice) \
- ((slice).refcount != NULL && \
- (slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC)
-
-#define GRPC_STATIC_METADATA_INDEX(static_slice) \
- (reinterpret_cast<grpc_core::StaticSliceRefcount*>((static_slice).refcount) \
- ->index)
-
-#define GRPC_STATIC_MDELEM_COUNT 85
-
-namespace grpc_core {
-extern StaticMetadata* g_static_mdelem_table;
-extern grpc_mdelem* g_static_mdelem_manifested;
-} // namespace grpc_core
-inline grpc_core::StaticMetadata* grpc_static_mdelem_table() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_table != nullptr);
- return grpc_core::g_static_mdelem_table;
-}
-inline grpc_mdelem* grpc_static_mdelem_manifested() {
- GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
- grpc_core::kGrpcStaticMetadataInitCanary);
- GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_manifested != nullptr);
- return grpc_core::g_static_mdelem_manifested;
-}
extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
/* ":authority": "" */
-#define GRPC_MDELEM_AUTHORITY_EMPTY (grpc_static_mdelem_manifested()[0])
+#define GRPC_MDELEM_AUTHORITY_EMPTY (::grpc_core::g_static_mdelem_manifested[0])
/* ":method": "GET" */
-#define GRPC_MDELEM_METHOD_GET (grpc_static_mdelem_manifested()[1])
+#define GRPC_MDELEM_METHOD_GET (::grpc_core::g_static_mdelem_manifested[1])
/* ":method": "POST" */
-#define GRPC_MDELEM_METHOD_POST (grpc_static_mdelem_manifested()[2])
+#define GRPC_MDELEM_METHOD_POST (::grpc_core::g_static_mdelem_manifested[2])
/* ":path": "/" */
-#define GRPC_MDELEM_PATH_SLASH (grpc_static_mdelem_manifested()[3])
+#define GRPC_MDELEM_PATH_SLASH (::grpc_core::g_static_mdelem_manifested[3])
/* ":path": "/index.html" */
#define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
- (grpc_static_mdelem_manifested()[4])
+ (::grpc_core::g_static_mdelem_manifested[4])
/* ":scheme": "http" */
-#define GRPC_MDELEM_SCHEME_HTTP (grpc_static_mdelem_manifested()[5])
+#define GRPC_MDELEM_SCHEME_HTTP (::grpc_core::g_static_mdelem_manifested[5])
/* ":scheme": "https" */
-#define GRPC_MDELEM_SCHEME_HTTPS (grpc_static_mdelem_manifested()[6])
+#define GRPC_MDELEM_SCHEME_HTTPS (::grpc_core::g_static_mdelem_manifested[6])
/* ":status": "200" */
-#define GRPC_MDELEM_STATUS_200 (grpc_static_mdelem_manifested()[7])
+#define GRPC_MDELEM_STATUS_200 (::grpc_core::g_static_mdelem_manifested[7])
/* ":status": "204" */
-#define GRPC_MDELEM_STATUS_204 (grpc_static_mdelem_manifested()[8])
+#define GRPC_MDELEM_STATUS_204 (::grpc_core::g_static_mdelem_manifested[8])
/* ":status": "206" */
-#define GRPC_MDELEM_STATUS_206 (grpc_static_mdelem_manifested()[9])
+#define GRPC_MDELEM_STATUS_206 (::grpc_core::g_static_mdelem_manifested[9])
/* ":status": "304" */
-#define GRPC_MDELEM_STATUS_304 (grpc_static_mdelem_manifested()[10])
+#define GRPC_MDELEM_STATUS_304 (::grpc_core::g_static_mdelem_manifested[10])
/* ":status": "400" */
-#define GRPC_MDELEM_STATUS_400 (grpc_static_mdelem_manifested()[11])
+#define GRPC_MDELEM_STATUS_400 (::grpc_core::g_static_mdelem_manifested[11])
/* ":status": "404" */
-#define GRPC_MDELEM_STATUS_404 (grpc_static_mdelem_manifested()[12])
+#define GRPC_MDELEM_STATUS_404 (::grpc_core::g_static_mdelem_manifested[12])
/* ":status": "500" */
-#define GRPC_MDELEM_STATUS_500 (grpc_static_mdelem_manifested()[13])
+#define GRPC_MDELEM_STATUS_500 (::grpc_core::g_static_mdelem_manifested[13])
/* "accept-charset": "" */
-#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (grpc_static_mdelem_manifested()[14])
+#define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[14])
/* "accept-encoding": "gzip, deflate" */
#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \
- (grpc_static_mdelem_manifested()[15])
+ (::grpc_core::g_static_mdelem_manifested[15])
/* "accept-language": "" */
-#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[16])
+#define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[16])
/* "accept-ranges": "" */
-#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (grpc_static_mdelem_manifested()[17])
+#define GRPC_MDELEM_ACCEPT_RANGES_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[17])
/* "accept": "" */
-#define GRPC_MDELEM_ACCEPT_EMPTY (grpc_static_mdelem_manifested()[18])
+#define GRPC_MDELEM_ACCEPT_EMPTY (::grpc_core::g_static_mdelem_manifested[18])
/* "access-control-allow-origin": "" */
#define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \
- (grpc_static_mdelem_manifested()[19])
+ (::grpc_core::g_static_mdelem_manifested[19])
/* "age": "" */
-#define GRPC_MDELEM_AGE_EMPTY (grpc_static_mdelem_manifested()[20])
+#define GRPC_MDELEM_AGE_EMPTY (::grpc_core::g_static_mdelem_manifested[20])
/* "allow": "" */
-#define GRPC_MDELEM_ALLOW_EMPTY (grpc_static_mdelem_manifested()[21])
+#define GRPC_MDELEM_ALLOW_EMPTY (::grpc_core::g_static_mdelem_manifested[21])
/* "authorization": "" */
-#define GRPC_MDELEM_AUTHORIZATION_EMPTY (grpc_static_mdelem_manifested()[22])
+#define GRPC_MDELEM_AUTHORIZATION_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[22])
/* "cache-control": "" */
-#define GRPC_MDELEM_CACHE_CONTROL_EMPTY (grpc_static_mdelem_manifested()[23])
+#define GRPC_MDELEM_CACHE_CONTROL_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[23])
/* "content-disposition": "" */
#define GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY \
- (grpc_static_mdelem_manifested()[24])
+ (::grpc_core::g_static_mdelem_manifested[24])
/* "content-encoding": "" */
-#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[25])
+#define GRPC_MDELEM_CONTENT_ENCODING_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[25])
/* "content-language": "" */
-#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[26])
+#define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[26])
/* "content-length": "" */
-#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY (grpc_static_mdelem_manifested()[27])
+#define GRPC_MDELEM_CONTENT_LENGTH_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[27])
/* "content-location": "" */
-#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY (grpc_static_mdelem_manifested()[28])
+#define GRPC_MDELEM_CONTENT_LOCATION_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[28])
/* "content-range": "" */
-#define GRPC_MDELEM_CONTENT_RANGE_EMPTY (grpc_static_mdelem_manifested()[29])
+#define GRPC_MDELEM_CONTENT_RANGE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[29])
/* "content-type": "" */
-#define GRPC_MDELEM_CONTENT_TYPE_EMPTY (grpc_static_mdelem_manifested()[30])
+#define GRPC_MDELEM_CONTENT_TYPE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[30])
/* "cookie": "" */
-#define GRPC_MDELEM_COOKIE_EMPTY (grpc_static_mdelem_manifested()[31])
+#define GRPC_MDELEM_COOKIE_EMPTY (::grpc_core::g_static_mdelem_manifested[31])
/* "date": "" */
-#define GRPC_MDELEM_DATE_EMPTY (grpc_static_mdelem_manifested()[32])
+#define GRPC_MDELEM_DATE_EMPTY (::grpc_core::g_static_mdelem_manifested[32])
/* "etag": "" */
-#define GRPC_MDELEM_ETAG_EMPTY (grpc_static_mdelem_manifested()[33])
+#define GRPC_MDELEM_ETAG_EMPTY (::grpc_core::g_static_mdelem_manifested[33])
/* "expect": "" */
-#define GRPC_MDELEM_EXPECT_EMPTY (grpc_static_mdelem_manifested()[34])
+#define GRPC_MDELEM_EXPECT_EMPTY (::grpc_core::g_static_mdelem_manifested[34])
/* "expires": "" */
-#define GRPC_MDELEM_EXPIRES_EMPTY (grpc_static_mdelem_manifested()[35])
+#define GRPC_MDELEM_EXPIRES_EMPTY (::grpc_core::g_static_mdelem_manifested[35])
/* "from": "" */
-#define GRPC_MDELEM_FROM_EMPTY (grpc_static_mdelem_manifested()[36])
+#define GRPC_MDELEM_FROM_EMPTY (::grpc_core::g_static_mdelem_manifested[36])
/* "host": "" */
-#define GRPC_MDELEM_HOST_EMPTY (grpc_static_mdelem_manifested()[37])
+#define GRPC_MDELEM_HOST_EMPTY (::grpc_core::g_static_mdelem_manifested[37])
/* "if-match": "" */
-#define GRPC_MDELEM_IF_MATCH_EMPTY (grpc_static_mdelem_manifested()[38])
+#define GRPC_MDELEM_IF_MATCH_EMPTY (::grpc_core::g_static_mdelem_manifested[38])
/* "if-modified-since": "" */
#define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY \
- (grpc_static_mdelem_manifested()[39])
+ (::grpc_core::g_static_mdelem_manifested[39])
/* "if-none-match": "" */
-#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY (grpc_static_mdelem_manifested()[40])
+#define GRPC_MDELEM_IF_NONE_MATCH_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[40])
/* "if-range": "" */
-#define GRPC_MDELEM_IF_RANGE_EMPTY (grpc_static_mdelem_manifested()[41])
+#define GRPC_MDELEM_IF_RANGE_EMPTY (::grpc_core::g_static_mdelem_manifested[41])
/* "if-unmodified-since": "" */
#define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY \
- (grpc_static_mdelem_manifested()[42])
+ (::grpc_core::g_static_mdelem_manifested[42])
/* "last-modified": "" */
-#define GRPC_MDELEM_LAST_MODIFIED_EMPTY (grpc_static_mdelem_manifested()[43])
+#define GRPC_MDELEM_LAST_MODIFIED_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[43])
/* "link": "" */
-#define GRPC_MDELEM_LINK_EMPTY (grpc_static_mdelem_manifested()[44])
+#define GRPC_MDELEM_LINK_EMPTY (::grpc_core::g_static_mdelem_manifested[44])
/* "location": "" */
-#define GRPC_MDELEM_LOCATION_EMPTY (grpc_static_mdelem_manifested()[45])
+#define GRPC_MDELEM_LOCATION_EMPTY (::grpc_core::g_static_mdelem_manifested[45])
/* "max-forwards": "" */
-#define GRPC_MDELEM_MAX_FORWARDS_EMPTY (grpc_static_mdelem_manifested()[46])
+#define GRPC_MDELEM_MAX_FORWARDS_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[46])
/* "proxy-authenticate": "" */
#define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \
- (grpc_static_mdelem_manifested()[47])
+ (::grpc_core::g_static_mdelem_manifested[47])
/* "proxy-authorization": "" */
#define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \
- (grpc_static_mdelem_manifested()[48])
+ (::grpc_core::g_static_mdelem_manifested[48])
/* "range": "" */
-#define GRPC_MDELEM_RANGE_EMPTY (grpc_static_mdelem_manifested()[49])
+#define GRPC_MDELEM_RANGE_EMPTY (::grpc_core::g_static_mdelem_manifested[49])
/* "referer": "" */
-#define GRPC_MDELEM_REFERER_EMPTY (grpc_static_mdelem_manifested()[50])
+#define GRPC_MDELEM_REFERER_EMPTY (::grpc_core::g_static_mdelem_manifested[50])
/* "refresh": "" */
-#define GRPC_MDELEM_REFRESH_EMPTY (grpc_static_mdelem_manifested()[51])
+#define GRPC_MDELEM_REFRESH_EMPTY (::grpc_core::g_static_mdelem_manifested[51])
/* "retry-after": "" */
-#define GRPC_MDELEM_RETRY_AFTER_EMPTY (grpc_static_mdelem_manifested()[52])
+#define GRPC_MDELEM_RETRY_AFTER_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[52])
/* "server": "" */
-#define GRPC_MDELEM_SERVER_EMPTY (grpc_static_mdelem_manifested()[53])
+#define GRPC_MDELEM_SERVER_EMPTY (::grpc_core::g_static_mdelem_manifested[53])
/* "set-cookie": "" */
-#define GRPC_MDELEM_SET_COOKIE_EMPTY (grpc_static_mdelem_manifested()[54])
+#define GRPC_MDELEM_SET_COOKIE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[54])
/* "strict-transport-security": "" */
#define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
- (grpc_static_mdelem_manifested()[55])
+ (::grpc_core::g_static_mdelem_manifested[55])
/* "transfer-encoding": "" */
#define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \
- (grpc_static_mdelem_manifested()[56])
+ (::grpc_core::g_static_mdelem_manifested[56])
/* "user-agent": "" */
-#define GRPC_MDELEM_USER_AGENT_EMPTY (grpc_static_mdelem_manifested()[57])
+#define GRPC_MDELEM_USER_AGENT_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[57])
/* "vary": "" */
-#define GRPC_MDELEM_VARY_EMPTY (grpc_static_mdelem_manifested()[58])
+#define GRPC_MDELEM_VARY_EMPTY (::grpc_core::g_static_mdelem_manifested[58])
/* "via": "" */
-#define GRPC_MDELEM_VIA_EMPTY (grpc_static_mdelem_manifested()[59])
+#define GRPC_MDELEM_VIA_EMPTY (::grpc_core::g_static_mdelem_manifested[59])
/* "www-authenticate": "" */
-#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested()[60])
+#define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[60])
/* "grpc-status": "0" */
-#define GRPC_MDELEM_GRPC_STATUS_0 (grpc_static_mdelem_manifested()[61])
+#define GRPC_MDELEM_GRPC_STATUS_0 (::grpc_core::g_static_mdelem_manifested[61])
/* "grpc-status": "1" */
-#define GRPC_MDELEM_GRPC_STATUS_1 (grpc_static_mdelem_manifested()[62])
+#define GRPC_MDELEM_GRPC_STATUS_1 (::grpc_core::g_static_mdelem_manifested[62])
/* "grpc-status": "2" */
-#define GRPC_MDELEM_GRPC_STATUS_2 (grpc_static_mdelem_manifested()[63])
+#define GRPC_MDELEM_GRPC_STATUS_2 (::grpc_core::g_static_mdelem_manifested[63])
/* "grpc-encoding": "identity" */
-#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY (grpc_static_mdelem_manifested()[64])
+#define GRPC_MDELEM_GRPC_ENCODING_IDENTITY \
+ (::grpc_core::g_static_mdelem_manifested[64])
/* "grpc-encoding": "gzip" */
-#define GRPC_MDELEM_GRPC_ENCODING_GZIP (grpc_static_mdelem_manifested()[65])
+#define GRPC_MDELEM_GRPC_ENCODING_GZIP \
+ (::grpc_core::g_static_mdelem_manifested[65])
/* "grpc-encoding": "deflate" */
-#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (grpc_static_mdelem_manifested()[66])
-/* "te": "trailers" */
-#define GRPC_MDELEM_TE_TRAILERS (grpc_static_mdelem_manifested()[67])
+#define GRPC_MDELEM_GRPC_ENCODING_DEFLATE \
+ (::grpc_core::g_static_mdelem_manifested[66])
/* "content-type": "application/grpc" */
#define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
- (grpc_static_mdelem_manifested()[68])
+ (::grpc_core::g_static_mdelem_manifested[67])
/* ":scheme": "grpc" */
-#define GRPC_MDELEM_SCHEME_GRPC (grpc_static_mdelem_manifested()[69])
+#define GRPC_MDELEM_SCHEME_GRPC (::grpc_core::g_static_mdelem_manifested[68])
/* ":method": "PUT" */
-#define GRPC_MDELEM_METHOD_PUT (grpc_static_mdelem_manifested()[70])
+#define GRPC_MDELEM_METHOD_PUT (::grpc_core::g_static_mdelem_manifested[69])
/* "accept-encoding": "" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[71])
+#define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[70])
/* "content-encoding": "identity" */
#define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[72])
+ (::grpc_core::g_static_mdelem_manifested[71])
/* "content-encoding": "gzip" */
-#define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested()[73])
+#define GRPC_MDELEM_CONTENT_ENCODING_GZIP \
+ (::grpc_core::g_static_mdelem_manifested[72])
/* "lb-cost-bin": "" */
-#define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested()[74])
+#define GRPC_MDELEM_LB_COST_BIN_EMPTY \
+ (::grpc_core::g_static_mdelem_manifested[73])
/* "grpc-accept-encoding": "identity" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[75])
+ (::grpc_core::g_static_mdelem_manifested[74])
/* "grpc-accept-encoding": "deflate" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \
- (grpc_static_mdelem_manifested()[76])
+ (::grpc_core::g_static_mdelem_manifested[75])
/* "grpc-accept-encoding": "identity,deflate" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \
- (grpc_static_mdelem_manifested()[77])
+ (::grpc_core::g_static_mdelem_manifested[76])
/* "grpc-accept-encoding": "gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \
- (grpc_static_mdelem_manifested()[78])
+ (::grpc_core::g_static_mdelem_manifested[77])
/* "grpc-accept-encoding": "identity,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[79])
+ (::grpc_core::g_static_mdelem_manifested[78])
/* "grpc-accept-encoding": "deflate,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[80])
+ (::grpc_core::g_static_mdelem_manifested[79])
/* "grpc-accept-encoding": "identity,deflate,gzip" */
#define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[81])
+ (::grpc_core::g_static_mdelem_manifested[80])
/* "accept-encoding": "identity" */
#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY \
- (grpc_static_mdelem_manifested()[82])
+ (::grpc_core::g_static_mdelem_manifested[81])
/* "accept-encoding": "gzip" */
-#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested()[83])
+#define GRPC_MDELEM_ACCEPT_ENCODING_GZIP \
+ (::grpc_core::g_static_mdelem_manifested[82])
/* "accept-encoding": "identity,gzip" */
#define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
- (grpc_static_mdelem_manifested()[84])
+ (::grpc_core::g_static_mdelem_manifested[83])
grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b);
typedef enum {
@@ -526,25 +264,15 @@ typedef enum {
GRPC_BATCH_STATUS,
GRPC_BATCH_AUTHORITY,
GRPC_BATCH_SCHEME,
- GRPC_BATCH_TE,
- GRPC_BATCH_GRPC_MESSAGE,
GRPC_BATCH_GRPC_STATUS,
- GRPC_BATCH_GRPC_PAYLOAD_BIN,
GRPC_BATCH_GRPC_ENCODING,
GRPC_BATCH_GRPC_ACCEPT_ENCODING,
- GRPC_BATCH_GRPC_SERVER_STATS_BIN,
- GRPC_BATCH_GRPC_TAGS_BIN,
- GRPC_BATCH_GRPC_TRACE_BIN,
GRPC_BATCH_CONTENT_TYPE,
GRPC_BATCH_CONTENT_ENCODING,
GRPC_BATCH_ACCEPT_ENCODING,
GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST,
- GRPC_BATCH_GRPC_INTERNAL_STREAM_ENCODING_REQUEST,
- GRPC_BATCH_USER_AGENT,
- GRPC_BATCH_HOST,
GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS,
GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS,
- GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN,
GRPC_BATCH_CALLOUTS_COUNT
} grpc_metadata_batch_callouts_index;
@@ -556,25 +284,15 @@ typedef union {
struct grpc_linked_mdelem* status;
struct grpc_linked_mdelem* authority;
struct grpc_linked_mdelem* scheme;
- struct grpc_linked_mdelem* te;
- struct grpc_linked_mdelem* grpc_message;
struct grpc_linked_mdelem* grpc_status;
- struct grpc_linked_mdelem* grpc_payload_bin;
struct grpc_linked_mdelem* grpc_encoding;
struct grpc_linked_mdelem* grpc_accept_encoding;
- struct grpc_linked_mdelem* grpc_server_stats_bin;
- struct grpc_linked_mdelem* grpc_tags_bin;
- struct grpc_linked_mdelem* grpc_trace_bin;
struct grpc_linked_mdelem* content_type;
struct grpc_linked_mdelem* content_encoding;
struct grpc_linked_mdelem* accept_encoding;
struct grpc_linked_mdelem* grpc_internal_encoding_request;
- struct grpc_linked_mdelem* grpc_internal_stream_encoding_request;
- struct grpc_linked_mdelem* user_agent;
- struct grpc_linked_mdelem* host;
struct grpc_linked_mdelem* grpc_previous_rpc_attempts;
struct grpc_linked_mdelem* grpc_retry_pushback_ms;
- struct grpc_linked_mdelem* x_endpoint_load_metrics_bin;
} named;
} grpc_metadata_batch_callouts;
@@ -590,14 +308,14 @@ typedef union {
extern const uint8_t grpc_static_accept_encoding_metadata[8];
#define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \
- (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
+ (GRPC_MAKE_MDELEM(&grpc_core::g_static_mdelem_table \
[grpc_static_accept_encoding_metadata[(algs)]] \
.data(), \
GRPC_MDELEM_STORAGE_STATIC))
extern const uint8_t grpc_static_accept_stream_encoding_metadata[4];
#define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) \
- (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
+ (GRPC_MAKE_MDELEM(&grpc_core::g_static_mdelem_table \
[grpc_static_accept_stream_encoding_metadata[(algs)]] \
.data(), \
GRPC_MDELEM_STORAGE_STATIC))
diff --git a/contrib/libs/grpc/src/core/lib/transport/status_metadata.cc b/contrib/libs/grpc/src/core/lib/transport/status_metadata.cc
index 1b19307e7c6..fb7064641d8 100644
--- a/contrib/libs/grpc/src/core/lib/transport/status_metadata.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/status_metadata.cc
@@ -20,6 +20,7 @@
#include "src/core/lib/transport/status_metadata.h"
+#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/static_metadata.h"
diff --git a/contrib/libs/grpc/src/core/lib/transport/transport.cc b/contrib/libs/grpc/src/core/lib/transport/transport.cc
index dccab66dc04..5d74ec254f9 100644
--- a/contrib/libs/grpc/src/core/lib/transport/transport.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/transport.cc
@@ -61,25 +61,6 @@ void slice_stream_destroy(void* arg) {
grpc_stream_destroy(static_cast<grpc_stream_refcount*>(arg));
}
-#define STREAM_REF_FROM_SLICE_REF(p) \
- ((grpc_stream_refcount*)(((uint8_t*)(p)) - \
- offsetof(grpc_stream_refcount, slice_refcount)))
-
-grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount,
- void* buffer, size_t length) {
-#ifndef NDEBUG
- grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(&refcount->slice_refcount),
- "slice");
-#else
- grpc_stream_ref(STREAM_REF_FROM_SLICE_REF(&refcount->slice_refcount));
-#endif
- grpc_slice res;
- res.refcount = &refcount->slice_refcount;
- res.data.refcounted.bytes = static_cast<uint8_t*>(buffer);
- res.data.refcounted.length = length;
- return res;
-}
-
#ifndef NDEBUG
void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/,
grpc_iomgr_cb_func cb, void* cb_arg,
@@ -94,21 +75,18 @@ void grpc_stream_ref_init(grpc_stream_refcount* refcount, int /*initial_refs*/,
new (&refcount->refs) grpc_core::RefCount(
1, GRPC_TRACE_FLAG_ENABLED(grpc_trace_stream_refcount) ? "stream_refcount"
: nullptr);
- new (&refcount->slice_refcount) grpc_slice_refcount(
- grpc_slice_refcount::Type::REGULAR, &refcount->refs, slice_stream_destroy,
- refcount, &refcount->slice_refcount);
}
-static void move64(uint64_t* from, uint64_t* to) {
+static void move64bits(uint64_t* from, uint64_t* to) {
*to += *from;
*from = 0;
}
void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats* from,
grpc_transport_one_way_stats* to) {
- move64(&from->framing_bytes, &to->framing_bytes);
- move64(&from->data_bytes, &to->data_bytes);
- move64(&from->header_bytes, &to->header_bytes);
+ move64bits(&from->framing_bytes, &to->framing_bytes);
+ move64bits(&from->data_bytes, &to->data_bytes);
+ move64bits(&from->header_bytes, &to->header_bytes);
}
void grpc_transport_move_stats(grpc_transport_stream_stats* from,
@@ -177,7 +155,7 @@ grpc_endpoint* grpc_transport_get_endpoint(grpc_transport* transport) {
// though it lives in lib, it handles transport stream ops sure
// it's grpc_transport_stream_op_batch_finish_with_failure
void grpc_transport_stream_op_batch_finish_with_failure(
- grpc_transport_stream_op_batch* batch, grpc_error* error,
+ grpc_transport_stream_op_batch* batch, grpc_error_handle error,
grpc_core::CallCombiner* call_combiner) {
if (batch->send_message) {
batch->payload->send_message.send_message.reset();
@@ -219,7 +197,7 @@ struct made_transport_op {
}
};
-static void destroy_made_transport_op(void* arg, grpc_error* error) {
+static void destroy_made_transport_op(void* arg, grpc_error_handle error) {
made_transport_op* op = static_cast<made_transport_op*>(arg);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->inner_on_complete,
GRPC_ERROR_REF(error));
@@ -237,21 +215,21 @@ grpc_transport_op* grpc_make_transport_op(grpc_closure* on_complete) {
struct made_transport_stream_op {
grpc_closure outer_on_complete;
- grpc_closure* inner_on_complete;
+ grpc_closure* inner_on_complete = nullptr;
grpc_transport_stream_op_batch op;
- grpc_transport_stream_op_batch_payload payload;
+ grpc_transport_stream_op_batch_payload payload{nullptr};
};
-static void destroy_made_transport_stream_op(void* arg, grpc_error* error) {
+static void destroy_made_transport_stream_op(void* arg,
+ grpc_error_handle error) {
made_transport_stream_op* op = static_cast<made_transport_stream_op*>(arg);
grpc_closure* c = op->inner_on_complete;
- gpr_free(op);
+ delete op;
grpc_core::Closure::Run(DEBUG_LOCATION, c, GRPC_ERROR_REF(error));
}
grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
grpc_closure* on_complete) {
- made_transport_stream_op* op =
- static_cast<made_transport_stream_op*>(gpr_zalloc(sizeof(*op)));
+ made_transport_stream_op* op = new made_transport_stream_op();
op->op.payload = &op->payload;
GRPC_CLOSURE_INIT(&op->outer_on_complete, destroy_made_transport_stream_op,
op, grpc_schedule_on_exec_ctx);
diff --git a/contrib/libs/grpc/src/core/lib/transport/transport.h b/contrib/libs/grpc/src/core/lib/transport/transport.h
index 0523dadc498..c1b4d19c558 100644
--- a/contrib/libs/grpc/src/core/lib/transport/transport.h
+++ b/contrib/libs/grpc/src/core/lib/transport/transport.h
@@ -59,7 +59,6 @@ typedef struct grpc_stream_refcount {
#ifndef NDEBUG
const char* object_type;
#endif
- grpc_slice_refcount slice_refcount;
} grpc_stream_refcount;
#ifndef NDEBUG
@@ -295,6 +294,8 @@ struct grpc_transport_stream_op_batch_payload {
// containing a received message.
// Will be NULL if trailing metadata is received instead of a message.
grpc_core::OrphanablePtr<grpc_core::ByteStream>* recv_message = nullptr;
+ // Was this recv_message failed for reasons other than a clean end-of-stream
+ bool* call_failed_before_recv_message = nullptr;
/** Should be enqueued when one message is ready to be processed. */
grpc_closure* recv_message_ready = nullptr;
} recv_message;
@@ -319,7 +320,7 @@ struct grpc_transport_stream_op_batch_payload {
struct {
// Error contract: the transport that gets this op must cause cancel_error
// to be unref'ed after processing it
- grpc_error* cancel_error = GRPC_ERROR_NONE;
+ grpc_error_handle cancel_error = GRPC_ERROR_NONE;
} cancel_stream;
/* Indexes correspond to grpc_context_index enum values */
@@ -339,11 +340,11 @@ typedef struct grpc_transport_op {
/** should the transport be disconnected
* Error contract: the transport that gets this op must cause
* disconnect_with_error to be unref'ed after processing it */
- grpc_error* disconnect_with_error = nullptr;
+ grpc_error_handle disconnect_with_error = GRPC_ERROR_NONE;
/** what should the goaway contain?
* Error contract: the transport that gets this op must cause
* goaway_error to be unref'ed after processing it */
- grpc_error* goaway_error = nullptr;
+ grpc_error_handle goaway_error = GRPC_ERROR_NONE;
/** set the callback for accepting new streams;
this is a permanent callback, unlike the other one-shot closures.
If true, the callback is set to set_accept_stream_fn, with its
@@ -411,7 +412,7 @@ void grpc_transport_destroy_stream(grpc_transport* transport,
grpc_closure* then_schedule_closure);
void grpc_transport_stream_op_batch_finish_with_failure(
- grpc_transport_stream_op_batch* batch, grpc_error* error,
+ grpc_transport_stream_op_batch* batch, grpc_error_handle error,
grpc_core::CallCombiner* call_combiner);
TString grpc_transport_stream_op_batch_string(
diff --git a/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc b/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
index b26ee0a4fde..d03a3b38869 100644
--- a/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
+++ b/contrib/libs/grpc/src/core/lib/transport/transport_op_string.cc
@@ -18,8 +18,6 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/channel/channel_stack.h"
-
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
@@ -33,6 +31,8 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+
+#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/slice/slice_string_helpers.h"
#include "src/core/lib/transport/connectivity_state.h"
@@ -40,27 +40,47 @@
/* These routines are here to facilitate debugging - they produce string
representations of various transport data structures */
-static void put_metadata(grpc_mdelem md, std::vector<TString>* out) {
- out->push_back("key=");
- char* dump = grpc_dump_slice(GRPC_MDKEY(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- out->push_back(dump);
- gpr_free(dump);
- out->push_back(" value=");
- dump = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
- out->push_back(dump);
- gpr_free(dump);
-}
+namespace {
+class MetadataListEncoder {
+ public:
+ explicit MetadataListEncoder(std::vector<TString>* out) : out_(out) {}
+ void Encode(const grpc_mdelem& md) {
+ MaybeAddComma();
+ out_->push_back("key=");
+ char* dump = grpc_dump_slice(GRPC_MDKEY(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ out_->push_back(dump);
+ gpr_free(dump);
+ out_->push_back(" value=");
+ dump = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX | GPR_DUMP_ASCII);
+ out_->push_back(dump);
+ gpr_free(dump);
+ }
-static void put_metadata_list(grpc_metadata_batch md,
- std::vector<TString>* out) {
- grpc_linked_mdelem* m;
- for (m = md.list.head; m != nullptr; m = m->next) {
- if (m != md.list.head) out->push_back(", ");
- put_metadata(m->md, out);
+ void Encode(grpc_core::GrpcTimeoutMetadata, grpc_millis deadline) {
+ MaybeAddComma();
+ out_->push_back(y_absl::StrFormat("deadline=%" PRId64, deadline));
}
- if (md.deadline != GRPC_MILLIS_INF_FUTURE) {
- out->push_back(y_absl::StrFormat(" deadline=%" PRId64, md.deadline));
+
+ template <typename Which>
+ void Encode(Which, const typename Which::ValueType& value) {
+ MaybeAddComma();
+ out_->push_back(
+ y_absl::StrCat(Which::key(), "=", Which::DisplayValue(value)));
+ }
+
+ private:
+ void MaybeAddComma() {
+ if (out_->size() != initial_size_) out_->push_back(", ");
}
+ std::vector<TString>* const out_;
+ const size_t initial_size_ = out_->size();
+};
+} // namespace
+
+static void put_metadata_list(const grpc_metadata_batch& md,
+ std::vector<TString>* out) {
+ MetadataListEncoder encoder(out);
+ md.Encode(&encoder);
}
TString grpc_transport_stream_op_batch_string(
@@ -109,7 +129,7 @@ TString grpc_transport_stream_op_batch_string(
if (op->cancel_stream) {
out.push_back(y_absl::StrCat(
" CANCEL:",
- grpc_error_string(op->payload->cancel_stream.cancel_error)));
+ grpc_error_std_string(op->payload->cancel_stream.cancel_error)));
}
return y_absl::StrJoin(out, "");
@@ -131,13 +151,13 @@ TString grpc_transport_op_string(grpc_transport_op* op) {
}
if (op->disconnect_with_error != GRPC_ERROR_NONE) {
- out.push_back(y_absl::StrCat(" DISCONNECT:",
- grpc_error_string(op->disconnect_with_error)));
+ out.push_back(y_absl::StrCat(
+ " DISCONNECT:", grpc_error_std_string(op->disconnect_with_error)));
}
- if (op->goaway_error) {
- out.push_back(
- y_absl::StrCat(" SEND_GOAWAY:%s", grpc_error_string(op->goaway_error)));
+ if (op->goaway_error != GRPC_ERROR_NONE) {
+ out.push_back(y_absl::StrCat(" SEND_GOAWAY:%s",
+ grpc_error_std_string(op->goaway_error)));
}
if (op->set_accept_stream) {
diff --git a/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc b/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
index ab0a11526e5..2885957883b 100644
--- a/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
+++ b/contrib/libs/grpc/src/core/lib/uri/uri_parser.cc
@@ -34,11 +34,29 @@
#include "src/core/lib/gpr/string.h"
namespace grpc_core {
+
namespace {
+// Checks if this string is made up of pchars, '/', '?', and '%' exclusively.
+// See https://tools.ietf.org/html/rfc3986#section-3.4
+bool IsPCharString(y_absl::string_view str) {
+ return (str.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789"
+ "?/:@\\-._~!$&'()*+,;=%") ==
+ y_absl::string_view::npos);
+}
+
+y_absl::Status MakeInvalidURIStatus(y_absl::string_view part_name,
+ y_absl::string_view uri,
+ y_absl::string_view extra) {
+ return y_absl::InvalidArgumentError(y_absl::StrFormat(
+ "Could not parse '%s' from uri '%s'. %s", part_name, uri, extra));
+}
+} // namespace
// Similar to `grpc_permissive_percent_decode_slice`, this %-decodes all valid
// triplets, and passes through the rest verbatim.
-TString PercentDecode(y_absl::string_view str) {
+TString URI::PercentDecode(y_absl::string_view str) {
if (str.empty() || !y_absl::StrContains(str, "%")) {
return TString(str);
}
@@ -64,24 +82,6 @@ TString PercentDecode(y_absl::string_view str) {
return out;
}
-// Checks if this string is made up of pchars, '/', '?', and '%' exclusively.
-// See https://tools.ietf.org/html/rfc3986#section-3.4
-bool IsPCharString(y_absl::string_view str) {
- return (str.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789"
- "?/:@\\-._~!$&'()*+,;=%") ==
- y_absl::string_view::npos);
-}
-
-y_absl::Status MakeInvalidURIStatus(y_absl::string_view part_name,
- y_absl::string_view uri,
- y_absl::string_view extra) {
- return y_absl::InvalidArgumentError(y_absl::StrFormat(
- "Could not parse '%s' from uri '%s'. %s", part_name, uri, extra));
-}
-} // namespace
-
y_absl::StatusOr<URI> URI::Parse(y_absl::string_view uri_text) {
y_absl::StatusOr<TString> decoded;
y_absl::string_view remaining = uri_text;
diff --git a/contrib/libs/grpc/src/core/lib/uri/uri_parser.h b/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
index 35ffbd4b9ca..b204ffe508c 100644
--- a/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
+++ b/contrib/libs/grpc/src/core/lib/uri/uri_parser.h
@@ -56,6 +56,8 @@ class URI {
URI(URI&&) = default;
URI& operator=(URI&&) = default;
+ static TString PercentDecode(y_absl::string_view str);
+
const TString& scheme() const { return scheme_; }
const TString& authority() const { return authority_; }
const TString& path() const { return path_; }
diff --git a/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc b/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
index d3def27e17a..8a31816e40c 100644
--- a/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
+++ b/contrib/libs/grpc/src/core/plugin_registry/grpc_plugin_registry.cc
@@ -20,12 +20,11 @@
#include <grpc/grpc.h>
-void grpc_http_filters_init(void);
-void grpc_http_filters_shutdown(void);
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/builtins.h"
+
void grpc_chttp2_plugin_init(void);
void grpc_chttp2_plugin_shutdown(void);
-void grpc_deadline_filter_init(void);
-void grpc_deadline_filter_shutdown(void);
void grpc_client_channel_init(void);
void grpc_client_channel_shutdown(void);
void grpc_inproc_plugin_init(void);
@@ -48,21 +47,19 @@ void grpc_resolver_dns_native_init(void);
void grpc_resolver_dns_native_shutdown(void);
void grpc_resolver_sockaddr_init(void);
void grpc_resolver_sockaddr_shutdown(void);
-void grpc_client_idle_filter_init(void);
-void grpc_client_idle_filter_shutdown(void);
-void grpc_max_age_filter_init(void);
-void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
-void grpc_service_config_channel_arg_filter_init(void);
-void grpc_service_config_channel_arg_filter_shutdown(void);
-void grpc_client_authority_filter_init(void);
-void grpc_client_authority_filter_shutdown(void);
-void grpc_workaround_cronet_compression_filter_init(void);
-void grpc_workaround_cronet_compression_filter_shutdown(void);
namespace grpc_core {
void FaultInjectionFilterInit(void);
void FaultInjectionFilterShutdown(void);
+void GrpcLbPolicyRingHashInit(void);
+void GrpcLbPolicyRingHashShutdown(void);
+#ifndef GRPC_NO_RLS
+void RlsLbPluginInit();
+void RlsLbPluginShutdown();
+#endif // !GRPC_NO_RLS
+void ServiceConfigParserInit(void);
+void ServiceConfigParserShutdown(void);
} // namespace grpc_core
#ifndef GRPC_NO_XDS
@@ -89,24 +86,27 @@ void grpc_resolver_xds_shutdown(void);
namespace grpc_core {
void GoogleCloud2ProdResolverInit();
void GoogleCloud2ProdResolverShutdown();
-}
+} // namespace grpc_core
+#endif
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+void grpc_resolver_binder_init(void);
+void grpc_resolver_binder_shutdown(void);
#endif
void grpc_register_built_in_plugins(void) {
- grpc_register_plugin(grpc_http_filters_init,
- grpc_http_filters_shutdown);
- grpc_register_plugin(grpc_chttp2_plugin_init,
- grpc_chttp2_plugin_shutdown);
- grpc_register_plugin(grpc_deadline_filter_init,
- grpc_deadline_filter_shutdown);
- grpc_register_plugin(grpc_client_channel_init,
- grpc_client_channel_shutdown);
- grpc_register_plugin(grpc_inproc_plugin_init,
- grpc_inproc_plugin_shutdown);
- grpc_register_plugin(grpc_resolver_fake_init,
- grpc_resolver_fake_shutdown);
+ grpc_register_plugin(grpc_chttp2_plugin_init, grpc_chttp2_plugin_shutdown);
+ grpc_register_plugin(grpc_core::ServiceConfigParserInit,
+ grpc_core::ServiceConfigParserShutdown);
+ grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown);
+ grpc_register_plugin(grpc_inproc_plugin_init, grpc_inproc_plugin_shutdown);
+ grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
+#ifndef GRPC_NO_RLS
+ grpc_register_plugin(grpc_core::RlsLbPluginInit,
+ grpc_core::RlsLbPluginShutdown);
+#endif // !GRPC_NO_RLS
grpc_register_plugin(grpc_lb_policy_priority_init,
grpc_lb_policy_priority_shutdown);
grpc_register_plugin(grpc_lb_policy_weighted_target_init,
@@ -115,26 +115,18 @@ void grpc_register_built_in_plugins(void) {
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
grpc_lb_policy_round_robin_shutdown);
+ grpc_register_plugin(grpc_core::GrpcLbPolicyRingHashInit,
+ grpc_core::GrpcLbPolicyRingHashShutdown);
grpc_register_plugin(grpc_resolver_dns_ares_init,
grpc_resolver_dns_ares_shutdown);
grpc_register_plugin(grpc_resolver_dns_native_init,
grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init,
grpc_resolver_sockaddr_shutdown);
- grpc_register_plugin(grpc_client_idle_filter_init,
- grpc_client_idle_filter_shutdown);
- grpc_register_plugin(grpc_max_age_filter_init,
- grpc_max_age_filter_shutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
grpc_register_plugin(grpc_core::FaultInjectionFilterInit,
grpc_core::FaultInjectionFilterShutdown);
- grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
- grpc_service_config_channel_arg_filter_shutdown);
- grpc_register_plugin(grpc_client_authority_filter_init,
- grpc_client_authority_filter_shutdown);
- grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
- grpc_workaround_cronet_compression_filter_shutdown);
#ifndef GRPC_NO_XDS
grpc_register_plugin(grpc_core::XdsClientGlobalInit,
grpc_core::XdsClientGlobalShutdown);
@@ -142,17 +134,66 @@ void grpc_register_built_in_plugins(void) {
grpc_certificate_provider_registry_shutdown);
grpc_register_plugin(grpc_core::FileWatcherCertificateProviderInit,
grpc_core::FileWatcherCertificateProviderShutdown);
- grpc_register_plugin(grpc_lb_policy_cds_init,
- grpc_lb_policy_cds_shutdown);
+ grpc_register_plugin(grpc_lb_policy_cds_init, grpc_lb_policy_cds_shutdown);
grpc_register_plugin(grpc_lb_policy_xds_cluster_impl_init,
grpc_lb_policy_xds_cluster_impl_shutdown);
grpc_register_plugin(grpc_lb_policy_xds_cluster_resolver_init,
grpc_lb_policy_xds_cluster_resolver_shutdown);
grpc_register_plugin(grpc_lb_policy_xds_cluster_manager_init,
grpc_lb_policy_xds_cluster_manager_shutdown);
- grpc_register_plugin(grpc_resolver_xds_init,
- grpc_resolver_xds_shutdown);
+ grpc_register_plugin(grpc_resolver_xds_init, grpc_resolver_xds_shutdown);
grpc_register_plugin(grpc_core::GoogleCloud2ProdResolverInit,
grpc_core::GoogleCloud2ProdResolverShutdown);
#endif
+
+#ifdef GPR_SUPPORT_BINDER_TRANSPORT
+ grpc_register_plugin(grpc_resolver_binder_init,
+ grpc_resolver_binder_shutdown);
+#endif
+}
+
+namespace grpc_core {
+
+extern void BuildClientChannelConfiguration(
+ CoreConfiguration::Builder* builder);
+extern void SecurityRegisterHandshakerFactories(
+ CoreConfiguration::Builder* builder);
+extern void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder);
+extern void RegisterClientIdleFilter(CoreConfiguration::Builder* builder);
+extern void RegisterDeadlineFilter(CoreConfiguration::Builder* builder);
+extern void RegisterGrpcLbLoadReportingFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterHttpFilters(CoreConfiguration::Builder* builder);
+extern void RegisterMaxAgeFilter(CoreConfiguration::Builder* builder);
+extern void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder);
+extern void RegisterSecurityFilters(CoreConfiguration::Builder* builder);
+extern void RegisterServiceConfigChannelArgFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterResourceQuota(CoreConfiguration::Builder* builder);
+#ifndef GRPC_NO_XDS
+extern void RegisterXdsChannelStackModifier(
+ CoreConfiguration::Builder* builder);
+#endif
+
+void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
+ BuildClientChannelConfiguration(builder);
+ SecurityRegisterHandshakerFactories(builder);
+ RegisterClientAuthorityFilter(builder);
+ RegisterClientIdleFilter(builder);
+ RegisterGrpcLbLoadReportingFilter(builder);
+ RegisterHttpFilters(builder);
+ RegisterMaxAgeFilter(builder);
+ RegisterDeadlineFilter(builder);
+ RegisterMessageSizeFilter(builder);
+ RegisterServiceConfigChannelArgFilter(builder);
+ RegisterResourceQuota(builder);
+#ifndef GRPC_NO_XDS
+ RegisterXdsChannelStackModifier(builder);
+#endif
+ // Run last so it gets a consistent location.
+ // TODO(ctiller): Is this actually necessary?
+ RegisterSecurityFilters(builder);
+ RegisterBuiltins(builder);
}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc b/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
index 5e7452936a1..fe653356a39 100644
--- a/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
+++ b/contrib/libs/grpc/src/core/plugin_registry/grpc_unsecure_plugin_registry.cc
@@ -20,12 +20,11 @@
#include <grpc/grpc.h>
-void grpc_http_filters_init(void);
-void grpc_http_filters_shutdown(void);
+#include "src/core/lib/config/core_configuration.h"
+#include "src/core/lib/surface/builtins.h"
+
void grpc_chttp2_plugin_init(void);
void grpc_chttp2_plugin_shutdown(void);
-void grpc_deadline_filter_init(void);
-void grpc_deadline_filter_shutdown(void);
void grpc_client_channel_init(void);
void grpc_client_channel_shutdown(void);
void grpc_inproc_plugin_init(void);
@@ -48,42 +47,30 @@ void grpc_lb_policy_pick_first_init(void);
void grpc_lb_policy_pick_first_shutdown(void);
void grpc_lb_policy_round_robin_init(void);
void grpc_lb_policy_round_robin_shutdown(void);
-void grpc_client_idle_filter_init(void);
-void grpc_client_idle_filter_shutdown(void);
-void grpc_max_age_filter_init(void);
-void grpc_max_age_filter_shutdown(void);
void grpc_message_size_filter_init(void);
void grpc_message_size_filter_shutdown(void);
namespace grpc_core {
void FaultInjectionFilterInit(void);
void FaultInjectionFilterShutdown(void);
+void GrpcLbPolicyRingHashInit(void);
+void GrpcLbPolicyRingHashShutdown(void);
+void ServiceConfigParserInit(void);
+void ServiceConfigParserShutdown(void);
} // namespace grpc_core
-void grpc_service_config_channel_arg_filter_init(void);
-void grpc_service_config_channel_arg_filter_shutdown(void);
-void grpc_client_authority_filter_init(void);
-void grpc_client_authority_filter_shutdown(void);
-void grpc_workaround_cronet_compression_filter_init(void);
-void grpc_workaround_cronet_compression_filter_shutdown(void);
void grpc_register_built_in_plugins(void) {
- grpc_register_plugin(grpc_http_filters_init,
- grpc_http_filters_shutdown);
- grpc_register_plugin(grpc_chttp2_plugin_init,
- grpc_chttp2_plugin_shutdown);
- grpc_register_plugin(grpc_deadline_filter_init,
- grpc_deadline_filter_shutdown);
- grpc_register_plugin(grpc_client_channel_init,
- grpc_client_channel_shutdown);
- grpc_register_plugin(grpc_inproc_plugin_init,
- grpc_inproc_plugin_shutdown);
+ grpc_register_plugin(grpc_chttp2_plugin_init, grpc_chttp2_plugin_shutdown);
+ grpc_register_plugin(grpc_core::ServiceConfigParserInit,
+ grpc_core::ServiceConfigParserShutdown);
+ grpc_register_plugin(grpc_client_channel_init, grpc_client_channel_shutdown);
+ grpc_register_plugin(grpc_inproc_plugin_init, grpc_inproc_plugin_shutdown);
grpc_register_plugin(grpc_resolver_dns_ares_init,
grpc_resolver_dns_ares_shutdown);
grpc_register_plugin(grpc_resolver_dns_native_init,
grpc_resolver_dns_native_shutdown);
grpc_register_plugin(grpc_resolver_sockaddr_init,
grpc_resolver_sockaddr_shutdown);
- grpc_register_plugin(grpc_resolver_fake_init,
- grpc_resolver_fake_shutdown);
+ grpc_register_plugin(grpc_resolver_fake_init, grpc_resolver_fake_shutdown);
grpc_register_plugin(grpc_lb_policy_grpclb_init,
grpc_lb_policy_grpclb_shutdown);
grpc_register_plugin(grpc_lb_policy_priority_init,
@@ -94,18 +81,45 @@ void grpc_register_built_in_plugins(void) {
grpc_lb_policy_pick_first_shutdown);
grpc_register_plugin(grpc_lb_policy_round_robin_init,
grpc_lb_policy_round_robin_shutdown);
- grpc_register_plugin(grpc_client_idle_filter_init,
- grpc_client_idle_filter_shutdown);
- grpc_register_plugin(grpc_max_age_filter_init,
- grpc_max_age_filter_shutdown);
+ grpc_register_plugin(grpc_core::GrpcLbPolicyRingHashInit,
+ grpc_core::GrpcLbPolicyRingHashShutdown);
grpc_register_plugin(grpc_message_size_filter_init,
grpc_message_size_filter_shutdown);
grpc_register_plugin(grpc_core::FaultInjectionFilterInit,
grpc_core::FaultInjectionFilterShutdown);
- grpc_register_plugin(grpc_service_config_channel_arg_filter_init,
- grpc_service_config_channel_arg_filter_shutdown);
- grpc_register_plugin(grpc_client_authority_filter_init,
- grpc_client_authority_filter_shutdown);
- grpc_register_plugin(grpc_workaround_cronet_compression_filter_init,
- grpc_workaround_cronet_compression_filter_shutdown);
}
+
+namespace grpc_core {
+
+extern void BuildClientChannelConfiguration(
+ CoreConfiguration::Builder* builder);
+extern void RegisterClientAuthorityFilter(CoreConfiguration::Builder* builder);
+extern void RegisterClientIdleFilter(CoreConfiguration::Builder* builder);
+extern void RegisterDeadlineFilter(CoreConfiguration::Builder* builder);
+extern void RegisterGrpcLbLoadReportingFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterHttpFilters(CoreConfiguration::Builder* builder);
+extern void RegisterMaxAgeFilter(CoreConfiguration::Builder* builder);
+extern void RegisterMessageSizeFilter(CoreConfiguration::Builder* builder);
+extern void RegisterSecurityFilters(CoreConfiguration::Builder* builder);
+extern void RegisterServiceConfigChannelArgFilter(
+ CoreConfiguration::Builder* builder);
+extern void RegisterResourceQuota(CoreConfiguration::Builder* builder);
+
+void BuildCoreConfiguration(CoreConfiguration::Builder* builder) {
+ BuildClientChannelConfiguration(builder);
+ RegisterClientAuthorityFilter(builder);
+ RegisterClientIdleFilter(builder);
+ RegisterGrpcLbLoadReportingFilter(builder);
+ RegisterHttpFilters(builder);
+ RegisterMaxAgeFilter(builder);
+ RegisterDeadlineFilter(builder);
+ RegisterMessageSizeFilter(builder);
+ RegisterServiceConfigChannelArgFilter(builder);
+ RegisterResourceQuota(builder);
+ // Run last so it gets a consistent location.
+ // TODO(ctiller): Is this actually necessary?
+ RegisterBuiltins(builder);
+}
+
+} // namespace grpc_core
diff --git a/contrib/libs/grpc/src/core/tsi/alts/crypt/aes_gcm.cc b/contrib/libs/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
index 02b1ac4492f..4eaaee2898b 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/crypt/aes_gcm.cc
@@ -18,17 +18,18 @@
#include <grpc/support/port_platform.h>
-#include "src/core/tsi/alts/crypt/gsec.h"
+#include <string.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
-#include <string.h>
#include <grpc/support/alloc.h>
+#include "src/core/tsi/alts/crypt/gsec.h"
+
constexpr size_t kKdfKeyLen = 32;
constexpr size_t kKdfCounterLen = 6;
constexpr size_t kKdfCounterOffset = 2;
@@ -558,7 +559,9 @@ static grpc_status_code gsec_aes_gcm_aead_crypter_decrypt_iovec(
if (!EVP_DecryptFinal_ex(aes_gcm_crypter->ctx, nullptr,
&bytes_written_temp)) {
aes_gcm_format_errors("Checking tag failed.", error_details);
- memset(plaintext_vec.iov_base, 0x00, plaintext_vec.iov_len);
+ if (plaintext_vec.iov_base != nullptr) {
+ memset(plaintext_vec.iov_base, 0x00, plaintext_vec.iov_len);
+ }
return GRPC_STATUS_FAILED_PRECONDITION;
}
if (bytes_written_temp != 0) {
diff --git a/contrib/libs/grpc/src/core/tsi/alts/crypt/gsec.h b/contrib/libs/grpc/src/core/tsi/alts/crypt/gsec.h
index 5a28c1b9d48..a3a830b670b 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/crypt/gsec.h
+++ b/contrib/libs/grpc/src/core/tsi/alts/crypt/gsec.h
@@ -25,15 +25,18 @@
#include <stdint.h>
#include <stdlib.h>
+#include <grpc/event_engine/port.h>
#include <grpc/grpc.h>
-#if !defined(_STRUCT_IOVEC) && !defined(__DEFINED_struct_iovec)
+#ifndef _STRUCT_IOVEC && !defined(__DEFINED_struct_iovec)
+#if !defined(GRPC_EVENT_ENGINE_POSIX)
#define _STRUCT_IOVEC
#define __DEFINED_struct_iovec
struct iovec {
void* iov_base;
size_t iov_len;
};
+#endif // GRPC_EVENT_ENGINE_POSIX
#endif // _STRUCT_IOVEC
/**
diff --git a/contrib/libs/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc b/contrib/libs/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
index bfa0b7a720f..aae92a4733c 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/frame_protector/alts_frame_protector.cc
@@ -23,6 +23,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -156,10 +158,10 @@ static tsi_result alts_protect(tsi_frame_protector* self,
*/
if (impl->in_place_protect_bytes_buffered + impl->overhead_length <
max_encrypted_payload_bytes(impl)) {
- size_t bytes_to_buffer = GPR_MIN(*unprotected_bytes_size,
- max_encrypted_payload_bytes(impl) -
- impl->in_place_protect_bytes_buffered -
- impl->overhead_length);
+ size_t bytes_to_buffer = std::min(
+ *unprotected_bytes_size, max_encrypted_payload_bytes(impl) -
+ impl->in_place_protect_bytes_buffered -
+ impl->overhead_length);
*unprotected_bytes_size = bytes_to_buffer;
if (bytes_to_buffer > 0) {
memcpy(
@@ -266,9 +268,9 @@ static tsi_result alts_unprotect(tsi_frame_protector* self,
if (!alts_is_frame_reader_done(impl->reader)) {
ensure_buffer_size(impl);
*protected_frames_bytes_size =
- GPR_MIN(impl->max_unprotected_frame_size -
- alts_get_output_bytes_read(impl->reader),
- *protected_frames_bytes_size);
+ std::min(impl->max_unprotected_frame_size -
+ alts_get_output_bytes_read(impl->reader),
+ *protected_frames_bytes_size);
size_t read_frames_bytes_size = *protected_frames_bytes_size;
if (!alts_read_frame_bytes(impl->reader, protected_frames_bytes,
&read_frames_bytes_size)) {
@@ -290,7 +292,7 @@ static tsi_result alts_unprotect(tsi_frame_protector* self,
return result;
}
}
- size_t bytes_to_write = GPR_MIN(
+ size_t bytes_to_write = std::min(
*unprotected_bytes_size, alts_get_output_bytes_read(impl->reader) -
impl->in_place_unprotect_bytes_processed -
impl->overhead_length);
@@ -368,8 +370,7 @@ tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size,
return TSI_INTERNAL_ERROR;
}
char* error_details = nullptr;
- alts_frame_protector* impl =
- static_cast<alts_frame_protector*>(gpr_zalloc(sizeof(*impl)));
+ alts_frame_protector* impl = grpc_core::Zalloc<alts_frame_protector>();
grpc_status_code status = create_alts_crypters(
key, key_size, is_client, is_rekey, impl, &error_details);
if (status != GRPC_STATUS_OK) {
@@ -385,9 +386,9 @@ tsi_result alts_create_frame_protector(const uint8_t* key, size_t key_size,
size_t max_protected_frame_size_to_set = kDefaultFrameLength;
if (max_protected_frame_size != nullptr) {
*max_protected_frame_size =
- GPR_MIN(*max_protected_frame_size, kMaxFrameLength);
+ std::min(*max_protected_frame_size, kMaxFrameLength);
*max_protected_frame_size =
- GPR_MAX(*max_protected_frame_size, kMinFrameLength);
+ std::max(*max_protected_frame_size, kMinFrameLength);
max_protected_frame_size_to_set = *max_protected_frame_size;
}
impl->max_protected_frame_size = max_protected_frame_size_to_set;
diff --git a/contrib/libs/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc b/contrib/libs/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
index aa90bbc634a..0237f24707b 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/frame_protector/frame_handler.cc
@@ -24,10 +24,12 @@
#include <stdint.h>
#include <string.h>
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/memory.h"
/* Use little endian to interpret a string of bytes as uint32_t. */
static uint32_t load_32_le(const unsigned char* buffer) {
@@ -47,9 +49,7 @@ static void store_32_le(uint32_t value, unsigned char* buffer) {
/* Frame writer implementation. */
alts_frame_writer* alts_create_frame_writer() {
- alts_frame_writer* writer =
- static_cast<alts_frame_writer*>(gpr_zalloc(sizeof(*writer)));
- return writer;
+ return grpc_core::Zalloc<alts_frame_writer>();
}
bool alts_reset_frame_writer(alts_frame_writer* writer,
@@ -82,8 +82,8 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output,
/* Write some header bytes, if needed. */
if (writer->header_bytes_written != sizeof(writer->header_buffer)) {
size_t bytes_to_write =
- GPR_MIN(*bytes_size,
- sizeof(writer->header_buffer) - writer->header_bytes_written);
+ std::min(*bytes_size,
+ sizeof(writer->header_buffer) - writer->header_bytes_written);
memcpy(output, writer->header_buffer + writer->header_bytes_written,
bytes_to_write);
bytes_written += bytes_to_write;
@@ -97,7 +97,7 @@ bool alts_write_frame_bytes(alts_frame_writer* writer, unsigned char* output,
}
/* Write some non-header bytes. */
size_t bytes_to_write =
- GPR_MIN(writer->input_size - writer->input_bytes_written, *bytes_size);
+ std::min(writer->input_size - writer->input_bytes_written, *bytes_size);
memcpy(output, writer->input_buffer, bytes_to_write);
writer->input_buffer += bytes_to_write;
bytes_written += bytes_to_write;
@@ -120,8 +120,7 @@ void alts_destroy_frame_writer(alts_frame_writer* writer) { gpr_free(writer); }
/* Frame reader implementation. */
alts_frame_reader* alts_create_frame_reader() {
- alts_frame_reader* reader =
- static_cast<alts_frame_reader*>(gpr_zalloc(sizeof(*reader)));
+ alts_frame_reader* reader = grpc_core::Zalloc<alts_frame_reader>();
return reader;
}
@@ -167,7 +166,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader,
size_t bytes_processed = 0;
/* Process the header, if needed. */
if (reader->header_bytes_read != sizeof(reader->header_buffer)) {
- size_t bytes_to_write = GPR_MIN(
+ size_t bytes_to_write = std::min(
*bytes_size, sizeof(reader->header_buffer) - reader->header_bytes_read);
memcpy(reader->header_buffer + reader->header_bytes_read, bytes,
bytes_to_write);
@@ -199,7 +198,7 @@ bool alts_read_frame_bytes(alts_frame_reader* reader,
reader->bytes_remaining = frame_length - kFrameMessageTypeFieldSize;
}
/* Process the non-header bytes. */
- size_t bytes_to_write = GPR_MIN(*bytes_size, reader->bytes_remaining);
+ size_t bytes_to_write = std::min(*bytes_size, reader->bytes_remaining);
memcpy(reader->output_buffer, bytes, bytes_to_write);
reader->output_buffer += bytes_to_write;
bytes_processed += bytes_to_write;
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
index 921de5fe3e7..b82d76fbff6 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include <list>
-
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
+#include <list>
+
#include "upb/upb.hpp"
#include <grpc/byte_buffer.h>
@@ -178,8 +178,7 @@ static void handle_response_done(alts_grpc_handshaker_client* client,
const unsigned char* bytes_to_send,
size_t bytes_to_send_size,
tsi_handshaker_result* result) {
- recv_message_result* p =
- static_cast<recv_message_result*>(gpr_zalloc(sizeof(*p)));
+ recv_message_result* p = grpc_core::Zalloc<recv_message_result>();
p->status = status;
p->bytes_to_send = bytes_to_send;
p->bytes_to_send_size = bytes_to_send_size;
@@ -439,7 +438,7 @@ static tsi_result make_grpc_call(alts_handshaker_client* c, bool is_start) {
}
}
-static void on_status_received(void* arg, grpc_error* error) {
+static void on_status_received(void* arg, grpc_error_handle error) {
alts_grpc_handshaker_client* client =
static_cast<alts_grpc_handshaker_client*>(arg);
if (client->handshake_status_code != GRPC_STATUS_OK) {
@@ -451,7 +450,7 @@ static void on_status_received(void* arg, grpc_error* error) {
"alts_grpc_handshaker_client:%p on_status_received "
"status:%d details:|%s| error:|%s|",
client, client->handshake_status_code, status_details,
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
gpr_free(status_details);
}
maybe_complete_tsi_next(client, true /* receive_status_finished */,
@@ -642,7 +641,7 @@ static void handshaker_client_shutdown(alts_handshaker_client* c) {
}
}
-static void handshaker_call_unref(void* arg, grpc_error* /* error */) {
+static void handshaker_call_unref(void* arg, grpc_error_handle /* error */) {
grpc_call* call = static_cast<grpc_call*>(arg);
grpc_call_unref(call);
}
@@ -838,7 +837,8 @@ void alts_handshaker_client_ref_for_testing(alts_handshaker_client* c) {
}
void alts_handshaker_client_on_status_received_for_testing(
- alts_handshaker_client* c, grpc_status_code status, grpc_error* error) {
+ alts_handshaker_client* c, grpc_status_code status,
+ grpc_error_handle error) {
// We first make sure that the handshake queue has been initialized
// here because there are tests that use this API that mock out
// other parts of the alts_handshaker_client in such a way that the
@@ -849,7 +849,7 @@ void alts_handshaker_client_on_status_received_for_testing(
reinterpret_cast<alts_grpc_handshaker_client*>(c);
client->handshake_status_code = status;
client->handshake_status_details = grpc_empty_slice();
- grpc_core::Closure::Run(DEBUG_LOCATION, &client->on_status_received, error);
+ Closure::Run(DEBUG_LOCATION, &client->on_status_received, error);
}
} // namespace internal
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
index d8669da01cb..133cea5da7d 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_handshaker_client.h
@@ -25,11 +25,10 @@
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
-#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
-#include "src/core/tsi/transport_security_interface.h"
-
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/pollset_set.h"
+#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
+#include "src/core/tsi/transport_security_interface.h"
#define ALTS_SERVICE_METHOD "/grpc.gcp.HandshakerService/DoHandshake"
#define ALTS_APPLICATION_PROTOCOL "grpc"
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
index 60df0ce71f4..aac64452f40 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc
@@ -32,6 +32,7 @@
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/closure.h"
@@ -151,6 +152,13 @@ static tsi_result handshaker_result_extract_peer(
return ok;
}
+static tsi_result handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY;
+ return TSI_OK;
+}
+
static tsi_result handshaker_result_create_zero_copy_grpc_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_zero_copy_grpc_protector** protector) {
@@ -247,9 +255,11 @@ static void handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable result_vtable = {
handshaker_result_extract_peer,
+ handshaker_result_get_frame_protector_type,
handshaker_result_create_zero_copy_grpc_protector,
handshaker_result_create_frame_protector,
- handshaker_result_get_unused_bytes, handshaker_result_destroy};
+ handshaker_result_get_unused_bytes,
+ handshaker_result_destroy};
tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
bool is_client,
@@ -306,7 +316,7 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
// We don't check if local service account is empty here
// because local identity could be empty in certain situations.
alts_tsi_handshaker_result* sresult =
- static_cast<alts_tsi_handshaker_result*>(gpr_zalloc(sizeof(*sresult)));
+ grpc_core::Zalloc<alts_tsi_handshaker_result>();
sresult->key_data =
static_cast<char*>(gpr_zalloc(kAltsAes128GcmRekeyKeyLength));
memcpy(sresult->key_data, key_data.data, kAltsAes128GcmRekeyKeyLength);
@@ -372,7 +382,8 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
}
/* gRPC provided callback used when gRPC thread model is applied. */
-static void on_handshaker_service_resp_recv(void* arg, grpc_error* error) {
+static void on_handshaker_service_resp_recv(void* arg,
+ grpc_error_handle error) {
alts_handshaker_client* client = static_cast<alts_handshaker_client*>(arg);
if (client == nullptr) {
gpr_log(GPR_ERROR, "ALTS handshaker client is nullptr");
@@ -382,7 +393,7 @@ static void on_handshaker_service_resp_recv(void* arg, grpc_error* error) {
if (error != GRPC_ERROR_NONE) {
gpr_log(GPR_ERROR,
"ALTS handshaker on_handshaker_service_resp_recv error: %s",
- grpc_error_string(error));
+ grpc_error_std_string(error).c_str());
success = false;
}
alts_handshaker_client_handle_response(client, success);
@@ -390,8 +401,8 @@ static void on_handshaker_service_resp_recv(void* arg, grpc_error* error) {
/* gRPC provided callback used when dedicatd CQ and thread are used.
* It serves to safely bring the control back to application. */
-static void on_handshaker_service_resp_recv_dedicated(void* arg,
- grpc_error* /*error*/) {
+static void on_handshaker_service_resp_recv_dedicated(
+ void* arg, grpc_error_handle /*error*/) {
alts_shared_resource_dedicated* resource =
grpc_alts_get_shared_resource_dedicated();
grpc_cq_end_op(
@@ -480,8 +491,8 @@ struct alts_tsi_handshaker_continue_handshaker_next_args {
grpc_closure closure;
};
-static void alts_tsi_handshaker_create_channel(void* arg,
- grpc_error* /* unused_error */) {
+static void alts_tsi_handshaker_create_channel(
+ void* arg, grpc_error_handle /* unused_error */) {
alts_tsi_handshaker_continue_handshaker_next_args* next_args =
static_cast<alts_tsi_handshaker_continue_handshaker_next_args*>(arg);
alts_tsi_handshaker* handshaker = next_args->handshaker;
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h
index cb99fdcce0d..d5ab14dc034 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h
+++ b/contrib/libs/grpc/src/core/tsi/alts/handshaker/alts_tsi_handshaker_private.h
@@ -78,7 +78,8 @@ grpc_closure* alts_handshaker_client_get_closure_for_testing(
alts_handshaker_client* client);
void alts_handshaker_client_on_status_received_for_testing(
- alts_handshaker_client* client, grpc_status_code status, grpc_error* error);
+ alts_handshaker_client* client, grpc_status_code status,
+ grpc_error_handle error);
void alts_handshaker_client_ref_for_testing(alts_handshaker_client* c);
diff --git a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options b/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options
deleted file mode 100644
index 702ba3802af..00000000000
--- a/contrib/libs/grpc/src/core/tsi/alts/handshaker/proto/handshaker.options
+++ /dev/null
@@ -1,2 +0,0 @@
-handshaker.proto no_unions:true
-grpc.gcp.StartServerHandshakeReq.handshake_parameters max_count:3
diff --git a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
index 352561d4697..67cdd994f7b 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.cc
@@ -20,11 +20,11 @@
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_integrity_only_record_protocol.h"
+#include <string.h>
+
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <string.h>
-
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_iovec_record_protocol.h"
diff --git a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
index 1048b600f0b..f601b3261cd 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_grpc_record_protocol_common.cc
@@ -39,7 +39,7 @@ static void ensure_iovec_buf_size(alts_grpc_record_protocol* rp,
return;
}
/* At least double the iovec buffer size. */
- rp->iovec_buf_length = GPR_MAX(sb->count, 2 * rp->iovec_buf_length);
+ rp->iovec_buf_length = std::max(sb->count, 2 * rp->iovec_buf_length);
rp->iovec_buf = static_cast<iovec_t*>(
gpr_realloc(rp->iovec_buf, rp->iovec_buf_length * sizeof(iovec_t)));
}
diff --git a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
index e0ce64104c9..d5455b6d76d 100644
--- a/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
+++ b/contrib/libs/grpc/src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.cc
@@ -278,9 +278,9 @@ tsi_result alts_zero_copy_grpc_protector_create(
size_t max_protected_frame_size_to_set = kDefaultFrameLength;
if (max_protected_frame_size != nullptr) {
*max_protected_frame_size =
- GPR_MIN(*max_protected_frame_size, kMaxFrameLength);
+ std::min(*max_protected_frame_size, kMaxFrameLength);
*max_protected_frame_size =
- GPR_MAX(*max_protected_frame_size, kMinFrameLength);
+ std::max(*max_protected_frame_size, kMinFrameLength);
max_protected_frame_size_to_set = *max_protected_frame_size;
}
impl->max_protected_frame_size = max_protected_frame_size_to_set;
diff --git a/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc b/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
index 5e63f11a2a4..ce09cdb7494 100644
--- a/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/fake_transport_security.cc
@@ -27,6 +27,7 @@
#include <grpc/support/log.h>
#include "src/core/lib/gpr/useful.h"
+#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/tsi/transport_security_grpc.h"
@@ -416,8 +417,8 @@ static tsi_result fake_zero_copy_grpc_protector_protect(
/* Protects each frame. */
while (unprotected_slices->length > 0) {
size_t frame_length =
- GPR_MIN(impl->max_frame_size,
- unprotected_slices->length + TSI_FAKE_FRAME_HEADER_SIZE);
+ std::min(impl->max_frame_size,
+ unprotected_slices->length + TSI_FAKE_FRAME_HEADER_SIZE);
grpc_slice slice = GRPC_SLICE_MALLOC(TSI_FAKE_FRAME_HEADER_SIZE);
store32_little_endian(static_cast<uint32_t>(frame_length),
GRPC_SLICE_START_PTR(slice));
@@ -498,6 +499,7 @@ struct fake_handshaker_result {
unsigned char* unused_bytes;
size_t unused_bytes_size;
};
+
static tsi_result fake_handshaker_result_extract_peer(
const tsi_handshaker_result* /*self*/, tsi_peer* peer) {
/* Construct a tsi_peer with 1 property: certificate type, security_level. */
@@ -514,6 +516,13 @@ static tsi_result fake_handshaker_result_extract_peer(
return result;
}
+static tsi_result fake_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY;
+ return TSI_OK;
+}
+
static tsi_result fake_handshaker_result_create_zero_copy_grpc_protector(
const tsi_handshaker_result* /*self*/,
size_t* max_output_protected_frame_size,
@@ -549,6 +558,7 @@ static void fake_handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable handshaker_result_vtable = {
fake_handshaker_result_extract_peer,
+ fake_handshaker_result_get_frame_protector_type,
fake_handshaker_result_create_zero_copy_grpc_protector,
fake_handshaker_result_create_frame_protector,
fake_handshaker_result_get_unused_bytes,
@@ -562,8 +572,7 @@ static tsi_result fake_handshaker_result_create(
handshaker_result == nullptr) {
return TSI_INVALID_ARGUMENT;
}
- fake_handshaker_result* result =
- static_cast<fake_handshaker_result*>(gpr_zalloc(sizeof(*result)));
+ fake_handshaker_result* result = grpc_core::Zalloc<fake_handshaker_result>();
result->base.vtable = &handshaker_result_vtable;
if (unused_bytes_size > 0) {
result->unused_bytes =
@@ -755,8 +764,7 @@ static const tsi_handshaker_vtable handshaker_vtable = {
};
tsi_handshaker* tsi_create_fake_handshaker(int is_client) {
- tsi_fake_handshaker* impl =
- static_cast<tsi_fake_handshaker*>(gpr_zalloc(sizeof(*impl)));
+ tsi_fake_handshaker* impl = grpc_core::Zalloc<tsi_fake_handshaker>();
impl->base.vtable = &handshaker_vtable;
impl->is_client = is_client;
impl->result = TSI_HANDSHAKE_IN_PROGRESS;
@@ -777,7 +785,7 @@ tsi_handshaker* tsi_create_fake_handshaker(int is_client) {
tsi_frame_protector* tsi_create_fake_frame_protector(
size_t* max_protected_frame_size) {
tsi_fake_frame_protector* impl =
- static_cast<tsi_fake_frame_protector*>(gpr_zalloc(sizeof(*impl)));
+ grpc_core::Zalloc<tsi_fake_frame_protector>();
impl->max_frame_size = (max_protected_frame_size == nullptr)
? TSI_FAKE_DEFAULT_FRAME_SIZE
: *max_protected_frame_size;
diff --git a/contrib/libs/grpc/src/core/tsi/local_transport_security.cc b/contrib/libs/grpc/src/core/tsi/local_transport_security.cc
index 19043cd1a9a..6067a4b49af 100644
--- a/contrib/libs/grpc/src/core/tsi/local_transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/local_transport_security.cc
@@ -42,6 +42,8 @@ typedef struct local_zero_copy_grpc_protector {
typedef struct local_tsi_handshaker_result {
tsi_handshaker_result base;
bool is_client;
+ unsigned char* unused_bytes;
+ size_t unused_bytes_size;
} local_tsi_handshaker_result;
/* Main struct for local TSI handshaker. */
@@ -50,109 +52,70 @@ typedef struct local_tsi_handshaker {
bool is_client;
} local_tsi_handshaker;
-/* --- tsi_zero_copy_grpc_protector methods implementation. --- */
+/* --- tsi_handshaker_result methods implementation. --- */
-static tsi_result local_zero_copy_grpc_protector_protect(
- tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* unprotected_slices,
- grpc_slice_buffer* protected_slices) {
- if (self == nullptr || unprotected_slices == nullptr ||
- protected_slices == nullptr) {
- gpr_log(GPR_ERROR, "Invalid nullptr arguments to zero-copy grpc protect.");
- return TSI_INVALID_ARGUMENT;
- }
- grpc_slice_buffer_move_into(unprotected_slices, protected_slices);
+tsi_result handshaker_result_extract_peer(const tsi_handshaker_result* /*self*/,
+ tsi_peer* /*peer*/) {
return TSI_OK;
}
-static tsi_result local_zero_copy_grpc_protector_unprotect(
- tsi_zero_copy_grpc_protector* self, grpc_slice_buffer* protected_slices,
- grpc_slice_buffer* unprotected_slices) {
- if (self == nullptr || unprotected_slices == nullptr ||
- protected_slices == nullptr) {
- gpr_log(GPR_ERROR,
- "Invalid nullptr arguments to zero-copy grpc unprotect.");
- return TSI_INVALID_ARGUMENT;
- }
- grpc_slice_buffer_move_into(protected_slices, unprotected_slices);
+tsi_result handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NONE;
return TSI_OK;
}
-static void local_zero_copy_grpc_protector_destroy(
- tsi_zero_copy_grpc_protector* self) {
- gpr_free(self);
-}
-
-static const tsi_zero_copy_grpc_protector_vtable
- local_zero_copy_grpc_protector_vtable = {
- local_zero_copy_grpc_protector_protect,
- local_zero_copy_grpc_protector_unprotect,
- local_zero_copy_grpc_protector_destroy,
- nullptr /* local_zero_copy_grpc_protector_max_frame_size */};
-
-tsi_result local_zero_copy_grpc_protector_create(
- tsi_zero_copy_grpc_protector** protector) {
- if (grpc_core::ExecCtx::Get() == nullptr || protector == nullptr) {
- gpr_log(
- GPR_ERROR,
- "Invalid nullptr arguments to local_zero_copy_grpc_protector create.");
+tsi_result handshaker_result_get_unused_bytes(const tsi_handshaker_result* self,
+ const unsigned char** bytes,
+ size_t* bytes_size) {
+ if (self == nullptr || bytes == nullptr || bytes_size == nullptr) {
+ gpr_log(GPR_ERROR, "Invalid arguments to get_unused_bytes()");
return TSI_INVALID_ARGUMENT;
}
- local_zero_copy_grpc_protector* impl =
- static_cast<local_zero_copy_grpc_protector*>(gpr_zalloc(sizeof(*impl)));
- impl->base.vtable = &local_zero_copy_grpc_protector_vtable;
- *protector = &impl->base;
+ auto* result = reinterpret_cast<local_tsi_handshaker_result*>(
+ const_cast<tsi_handshaker_result*>(self));
+ *bytes_size = result->unused_bytes_size;
+ *bytes = result->unused_bytes;
return TSI_OK;
}
-/* --- tsi_handshaker_result methods implementation. --- */
-
-static tsi_result handshaker_result_extract_peer(
- const tsi_handshaker_result* /*self*/, tsi_peer* /*peer*/) {
- return TSI_OK;
-}
-
-static tsi_result handshaker_result_create_zero_copy_grpc_protector(
- const tsi_handshaker_result* self,
- size_t* /*max_output_protected_frame_size*/,
- tsi_zero_copy_grpc_protector** protector) {
- if (self == nullptr || protector == nullptr) {
- gpr_log(GPR_ERROR,
- "Invalid arguments to create_zero_copy_grpc_protector()");
- return TSI_INVALID_ARGUMENT;
- }
- tsi_result ok = local_zero_copy_grpc_protector_create(protector);
- if (ok != TSI_OK) {
- gpr_log(GPR_ERROR, "Failed to create zero-copy grpc protector");
- }
- return ok;
-}
-
-static void handshaker_result_destroy(tsi_handshaker_result* self) {
+void handshaker_result_destroy(tsi_handshaker_result* self) {
if (self == nullptr) {
return;
}
local_tsi_handshaker_result* result =
reinterpret_cast<local_tsi_handshaker_result*>(
const_cast<tsi_handshaker_result*>(self));
+ gpr_free(result->unused_bytes);
gpr_free(result);
}
-static const tsi_handshaker_result_vtable result_vtable = {
+const tsi_handshaker_result_vtable result_vtable = {
handshaker_result_extract_peer,
- handshaker_result_create_zero_copy_grpc_protector,
+ handshaker_result_get_frame_protector_type,
+ nullptr, /* handshaker_result_create_zero_copy_grpc_protector */
nullptr, /* handshaker_result_create_frame_protector */
- nullptr, /* handshaker_result_get_unused_bytes */
+ handshaker_result_get_unused_bytes,
handshaker_result_destroy};
-static tsi_result create_handshaker_result(bool is_client,
- tsi_handshaker_result** self) {
+tsi_result create_handshaker_result(bool is_client,
+ const unsigned char* received_bytes,
+ size_t received_bytes_size,
+ tsi_handshaker_result** self) {
if (self == nullptr) {
gpr_log(GPR_ERROR, "Invalid arguments to create_handshaker_result()");
return TSI_INVALID_ARGUMENT;
}
local_tsi_handshaker_result* result =
- static_cast<local_tsi_handshaker_result*>(gpr_zalloc(sizeof(*result)));
+ grpc_core::Zalloc<local_tsi_handshaker_result>();
result->is_client = is_client;
+ if (received_bytes_size > 0) {
+ result->unused_bytes =
+ static_cast<unsigned char*>(gpr_malloc(received_bytes_size));
+ memcpy(result->unused_bytes, received_bytes, received_bytes_size);
+ }
+ result->unused_bytes_size = received_bytes_size;
result->base.vtable = &result_vtable;
*self = &result->base;
return TSI_OK;
@@ -160,9 +123,9 @@ static tsi_result create_handshaker_result(bool is_client,
/* --- tsi_handshaker methods implementation. --- */
-static tsi_result handshaker_next(
- tsi_handshaker* self, const unsigned char* /*received_bytes*/,
- size_t /*received_bytes_size*/, const unsigned char** /*bytes_to_send*/,
+tsi_result handshaker_next(
+ tsi_handshaker* self, const unsigned char* received_bytes,
+ size_t received_bytes_size, const unsigned char** /*bytes_to_send*/,
size_t* bytes_to_send_size, tsi_handshaker_result** result,
tsi_handshaker_on_next_done_cb /*cb*/, void* /*user_data*/) {
if (self == nullptr) {
@@ -175,11 +138,12 @@ static tsi_result handshaker_next(
local_tsi_handshaker* handshaker =
reinterpret_cast<local_tsi_handshaker*>(self);
*bytes_to_send_size = 0;
- create_handshaker_result(handshaker->is_client, result);
+ create_handshaker_result(handshaker->is_client, received_bytes,
+ received_bytes_size, result);
return TSI_OK;
}
-static void handshaker_destroy(tsi_handshaker* self) {
+void handshaker_destroy(tsi_handshaker* self) {
if (self == nullptr) {
return;
}
@@ -188,7 +152,7 @@ static void handshaker_destroy(tsi_handshaker* self) {
gpr_free(handshaker);
}
-static const tsi_handshaker_vtable handshaker_vtable = {
+const tsi_handshaker_vtable handshaker_vtable = {
nullptr, /* get_bytes_to_send_to_peer -- deprecated */
nullptr, /* process_bytes_from_peer -- deprecated */
nullptr, /* get_result -- deprecated */
@@ -206,8 +170,7 @@ tsi_result tsi_local_handshaker_create(bool is_client, tsi_handshaker** self) {
gpr_log(GPR_ERROR, "Invalid arguments to local_tsi_handshaker_create()");
return TSI_INVALID_ARGUMENT;
}
- local_tsi_handshaker* handshaker =
- static_cast<local_tsi_handshaker*>(gpr_zalloc(sizeof(*handshaker)));
+ local_tsi_handshaker* handshaker = grpc_core::Zalloc<local_tsi_handshaker>();
handshaker->is_client = is_client;
handshaker->base.vtable = &handshaker_vtable;
*self = &handshaker->base;
diff --git a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
index 9254dcee5f6..d1288de3e49 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.cc
@@ -18,51 +18,29 @@
#include <grpc/support/port_platform.h>
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/slice/slice_internal.h"
-#include "src/core/tsi/ssl/session_cache/ssl_session.h"
#include "src/core/tsi/ssl/session_cache/ssl_session_cache.h"
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-namespace tsi {
-
-static void cache_key_avl_destroy(void* /*key*/, void* /*unused*/) {}
-
-static void* cache_key_avl_copy(void* key, void* /*unused*/) { return key; }
-
-static long cache_key_avl_compare(void* key1, void* key2, void* /*unused*/) {
- return grpc_slice_cmp(*static_cast<grpc_slice*>(key1),
- *static_cast<grpc_slice*>(key2));
-}
-
-static void cache_value_avl_destroy(void* /*value*/, void* /*unused*/) {}
-
-static void* cache_value_avl_copy(void* value, void* /*unused*/) {
- return value;
-}
+#include "src/core/lib/gprpp/sync.h"
+#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/tsi/ssl/session_cache/ssl_session.h"
-// AVL only stores pointers, ownership belonges to the linked list.
-static const grpc_avl_vtable cache_avl_vtable = {
- cache_key_avl_destroy, cache_key_avl_copy, cache_key_avl_compare,
- cache_value_avl_destroy, cache_value_avl_copy,
-};
+namespace tsi {
/// Node for single cached session.
class SslSessionLRUCache::Node {
public:
- Node(const grpc_slice& key, SslSessionPtr session) : key_(key) {
+ Node(const TString& key, SslSessionPtr session) : key_(key) {
SetSession(std::move(session));
}
- ~Node() { grpc_slice_unref_internal(key_); }
-
// Not copyable nor movable.
Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
- void* AvlKey() { return &key_; }
+ const TString& key() const { return key_; }
/// Returns a copy of the node's cache session.
SslSessionPtr CopySession() const { return session_->CopySession(); }
@@ -75,7 +53,7 @@ class SslSessionLRUCache::Node {
private:
friend class SslSessionLRUCache;
- grpc_slice key_;
+ TString key_;
std::unique_ptr<SslCachedSession> session_;
Node* next_ = nullptr;
@@ -84,7 +62,6 @@ class SslSessionLRUCache::Node {
SslSessionLRUCache::SslSessionLRUCache(size_t capacity) : capacity_(capacity) {
GPR_ASSERT(capacity > 0);
- entry_by_key_ = grpc_avl_create(&cache_avl_vtable);
}
SslSessionLRUCache::~SslSessionLRUCache() {
@@ -94,7 +71,6 @@ SslSessionLRUCache::~SslSessionLRUCache() {
delete node;
node = next;
}
- grpc_avl_unref(entry_by_key_, nullptr);
}
size_t SslSessionLRUCache::Size() {
@@ -103,13 +79,12 @@ size_t SslSessionLRUCache::Size() {
}
SslSessionLRUCache::Node* SslSessionLRUCache::FindLocked(
- const grpc_slice& key) {
- void* value =
- grpc_avl_get(entry_by_key_, const_cast<grpc_slice*>(&key), nullptr);
- if (value == nullptr) {
+ const TString& key) {
+ auto it = entry_by_key_.find(key);
+ if (it == entry_by_key_.end()) {
return nullptr;
}
- Node* node = static_cast<Node*>(value);
+ Node* node = it->second;
// Move to the beginning.
Remove(node);
PushFront(node);
@@ -119,22 +94,21 @@ SslSessionLRUCache::Node* SslSessionLRUCache::FindLocked(
void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
grpc_core::MutexLock lock(&lock_);
- Node* node = FindLocked(grpc_slice_from_static_string(key));
+ Node* node = FindLocked(key);
if (node != nullptr) {
node->SetSession(std::move(session));
return;
}
- grpc_slice key_slice = grpc_slice_from_copied_string(key);
- node = new Node(key_slice, std::move(session));
+ node = new Node(key, std::move(session));
PushFront(node);
- entry_by_key_ = grpc_avl_add(entry_by_key_, node->AvlKey(), node, nullptr);
+ entry_by_key_.emplace(key, node);
AssertInvariants();
if (use_order_list_size_ > capacity_) {
GPR_ASSERT(use_order_list_tail_);
node = use_order_list_tail_;
Remove(node);
// Order matters, key is destroyed after deleting node.
- entry_by_key_ = grpc_avl_remove(entry_by_key_, node->AvlKey(), nullptr);
+ entry_by_key_.erase(node->key());
delete node;
AssertInvariants();
}
@@ -143,8 +117,7 @@ void SslSessionLRUCache::Put(const char* key, SslSessionPtr session) {
SslSessionPtr SslSessionLRUCache::Get(const char* key) {
grpc_core::MutexLock lock(&lock_);
// Key is only used for lookups.
- grpc_slice key_slice = grpc_slice_from_static_string(key);
- Node* node = FindLocked(key_slice);
+ Node* node = FindLocked(key);
if (node == nullptr) {
return nullptr;
}
@@ -182,13 +155,6 @@ void SslSessionLRUCache::PushFront(SslSessionLRUCache::Node* node) {
}
#ifndef NDEBUG
-static size_t calculate_tree_size(grpc_avl_node* node) {
- if (node == nullptr) {
- return 0;
- }
- return 1 + calculate_tree_size(node->left) + calculate_tree_size(node->right);
-}
-
void SslSessionLRUCache::AssertInvariants() {
size_t size = 0;
Node* prev = nullptr;
@@ -196,14 +162,15 @@ void SslSessionLRUCache::AssertInvariants() {
while (current != nullptr) {
size++;
GPR_ASSERT(current->prev_ == prev);
- void* node = grpc_avl_get(entry_by_key_, current->AvlKey(), nullptr);
- GPR_ASSERT(node == current);
+ auto it = entry_by_key_.find(current->key());
+ GPR_ASSERT(it != entry_by_key_.end());
+ GPR_ASSERT(it->second == current);
prev = current;
current = current->next_;
}
GPR_ASSERT(prev == use_order_list_tail_);
GPR_ASSERT(size == use_order_list_size_);
- GPR_ASSERT(calculate_tree_size(entry_by_key_.root) == use_order_list_size_);
+ GPR_ASSERT(entry_by_key_.size() == use_order_list_size_);
}
#else
void SslSessionLRUCache::AssertInvariants() {}
diff --git a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
index 0aa3f1696c2..5db782913e9 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
+++ b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_cache.h
@@ -28,7 +28,8 @@ extern "C" {
#include <openssl/ssl.h>
}
-#include "src/core/lib/avl/avl.h"
+#include <map>
+
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/sync.h"
@@ -72,7 +73,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
private:
class Node;
- Node* FindLocked(const grpc_slice& key);
+ Node* FindLocked(const TString& key);
void Remove(Node* node);
void PushFront(Node* node);
void AssertInvariants();
@@ -83,7 +84,7 @@ class SslSessionLRUCache : public grpc_core::RefCounted<SslSessionLRUCache> {
Node* use_order_list_head_ = nullptr;
Node* use_order_list_tail_ = nullptr;
size_t use_order_list_size_ = 0;
- grpc_avl entry_by_key_;
+ std::map<TString, Node*> entry_by_key_;
};
} // namespace tsi
diff --git a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
index 1df81396816..06eb1bc5576 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl/session_cache/ssl_session_openssl.cc
@@ -18,10 +18,10 @@
#include <grpc/support/port_platform.h>
-#include "src/core/tsi/ssl/session_cache/ssl_session.h"
-
#include <grpc/support/log.h>
+#include "src/core/tsi/ssl/session_cache/ssl_session.h"
+
#ifndef OPENSSL_IS_BORINGSSL
// OpenSSL invalidates SSL_SESSION on SSL destruction making it pointless
diff --git a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
index f3b2eb76342..0213d56af4d 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.cc
@@ -35,6 +35,9 @@
#include <util/generic/string.h>
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/string_view.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -42,9 +45,6 @@
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
-#include "y_absl/strings/match.h"
-#include "y_absl/strings/string_view.h"
-
extern "C" {
#include <openssl/bio.h>
#include <openssl/crypto.h> /* For OPENSSL_free */
@@ -333,6 +333,30 @@ static tsi_result peer_property_from_x509_common_name(
return result;
}
+/* Gets the subject of an X509 cert as a tsi_peer_property. */
+static tsi_result peer_property_from_x509_subject(X509* cert,
+ tsi_peer_property* property) {
+ X509_NAME* subject_name = X509_get_subject_name(cert);
+ if (subject_name == nullptr) {
+ gpr_log(GPR_INFO, "Could not get subject name from certificate.");
+ return TSI_NOT_FOUND;
+ }
+ BIO* bio = BIO_new(BIO_s_mem());
+ X509_NAME_print_ex(bio, subject_name, 0, XN_FLAG_RFC2253);
+ char* contents;
+ long len = BIO_get_mem_data(bio, &contents);
+ if (len < 0) {
+ gpr_log(GPR_ERROR, "Could not get subject entry from certificate.");
+ BIO_free(bio);
+ return TSI_INTERNAL_ERROR;
+ }
+ tsi_result result = tsi_construct_string_peer_property(
+ TSI_X509_SUBJECT_PEER_PROPERTY, contents, static_cast<size_t>(len),
+ property);
+ BIO_free(bio);
+ return result;
+}
+
/* Gets the X509 cert in PEM format as a tsi_peer_property. */
static tsi_result add_pem_certificate(X509* cert, tsi_peer_property* property) {
BIO* bio = BIO_new(BIO_s_mem());
@@ -367,13 +391,17 @@ static tsi_result add_subject_alt_names_properties_to_peer(
subject_alt_name->type == GEN_URI) {
unsigned char* name = nullptr;
int name_size;
+ TString property_name;
if (subject_alt_name->type == GEN_DNS) {
name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.dNSName);
+ property_name = TSI_X509_DNS_PEER_PROPERTY;
} else if (subject_alt_name->type == GEN_EMAIL) {
name_size = ASN1_STRING_to_UTF8(&name, subject_alt_name->d.rfc822Name);
+ property_name = TSI_X509_EMAIL_PEER_PROPERTY;
} else {
name_size = ASN1_STRING_to_UTF8(
&name, subject_alt_name->d.uniformResourceIdentifier);
+ property_name = TSI_X509_URI_PEER_PROPERTY;
}
if (name_size < 0) {
gpr_log(GPR_ERROR, "Could not get utf8 from asn1 string.");
@@ -388,12 +416,10 @@ static tsi_result add_subject_alt_names_properties_to_peer(
OPENSSL_free(name);
break;
}
- if (subject_alt_name->type == GEN_URI) {
- result = tsi_construct_string_peer_property(
- TSI_X509_URI_PEER_PROPERTY, reinterpret_cast<const char*>(name),
- static_cast<size_t>(name_size),
- &peer->properties[(*current_insert_index)++]);
- }
+ result = tsi_construct_string_peer_property(
+ property_name.c_str(), reinterpret_cast<const char*>(name),
+ static_cast<size_t>(name_size),
+ &peer->properties[(*current_insert_index)++]);
OPENSSL_free(name);
} else if (subject_alt_name->type == GEN_IPADD) {
char ntop_buf[INET6_ADDRSTRLEN];
@@ -419,6 +445,10 @@ static tsi_result add_subject_alt_names_properties_to_peer(
result = tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, name,
&peer->properties[(*current_insert_index)++]);
+ if (result != TSI_OK) break;
+ result = tsi_construct_string_peer_property_from_cstring(
+ TSI_X509_IP_PEER_PROPERTY, name,
+ &peer->properties[(*current_insert_index)++]);
} else {
result = tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "other types of SAN",
@@ -443,12 +473,19 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
tsi_result result;
GPR_ASSERT(subject_alt_name_count >= 0);
property_count = (include_certificate_type ? static_cast<size_t>(1) : 0) +
- 2 /* common name, certificate */ +
+ 3 /* subject, common name, certificate */ +
static_cast<size_t>(subject_alt_name_count);
for (int i = 0; i < subject_alt_name_count; i++) {
GENERAL_NAME* subject_alt_name =
sk_GENERAL_NAME_value(subject_alt_names, TSI_SIZE_AS_SIZE(i));
- if (subject_alt_name->type == GEN_URI) {
+ // TODO(zhenlian): Clean up tsi_peer to avoid duplicate entries.
+ // URI, DNS, email and ip address SAN fields are plumbed to tsi_peer, in
+ // addition to all SAN fields (results in duplicate values). This code
+ // snippet updates property_count accordingly.
+ if (subject_alt_name->type == GEN_URI ||
+ subject_alt_name->type == GEN_DNS ||
+ subject_alt_name->type == GEN_EMAIL ||
+ subject_alt_name->type == GEN_IPADD) {
property_count += 1;
}
}
@@ -462,6 +499,11 @@ static tsi_result peer_from_x509(X509* cert, int include_certificate_type,
&peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
}
+
+ result = peer_property_from_x509_subject(
+ cert, &peer->properties[current_insert_index++]);
+ if (result != TSI_OK) break;
+
result = peer_property_from_x509_common_name(
cert, &peer->properties[current_insert_index++]);
if (result != TSI_OK) break;
@@ -500,10 +542,10 @@ static void log_ssl_error_stack(void) {
/* Performs an SSL_read and handle errors. */
static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
size_t* unprotected_bytes_size) {
- int read_from_ssl;
GPR_ASSERT(*unprotected_bytes_size <= INT_MAX);
- read_from_ssl = SSL_read(ssl, unprotected_bytes,
- static_cast<int>(*unprotected_bytes_size));
+ ERR_clear_error();
+ int read_from_ssl = SSL_read(ssl, unprotected_bytes,
+ static_cast<int>(*unprotected_bytes_size));
if (read_from_ssl <= 0) {
read_from_ssl = SSL_get_error(ssl, read_from_ssl);
switch (read_from_ssl) {
@@ -533,10 +575,10 @@ static tsi_result do_ssl_read(SSL* ssl, unsigned char* unprotected_bytes,
/* Performs an SSL_write and handle errors. */
static tsi_result do_ssl_write(SSL* ssl, unsigned char* unprotected_bytes,
size_t unprotected_bytes_size) {
- int ssl_write_result;
GPR_ASSERT(unprotected_bytes_size <= INT_MAX);
- ssl_write_result = SSL_write(ssl, unprotected_bytes,
- static_cast<int>(unprotected_bytes_size));
+ ERR_clear_error();
+ int ssl_write_result = SSL_write(ssl, unprotected_bytes,
+ static_cast<int>(unprotected_bytes_size));
if (ssl_write_result < 0) {
ssl_write_result = SSL_get_error(ssl, ssl_write_result);
if (ssl_write_result == SSL_ERROR_WANT_READ) {
@@ -1299,6 +1341,13 @@ static tsi_result ssl_handshaker_result_extract_peer(
return result;
}
+static tsi_result ssl_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* /*self*/,
+ tsi_frame_protector_type* frame_protector_type) {
+ *frame_protector_type = TSI_FRAME_PROTECTOR_NORMAL;
+ return TSI_OK;
+}
+
static tsi_result ssl_handshaker_result_create_frame_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_frame_protector** protector) {
@@ -1365,6 +1414,7 @@ static void ssl_handshaker_result_destroy(tsi_handshaker_result* self) {
static const tsi_handshaker_result_vtable handshaker_result_vtable = {
ssl_handshaker_result_extract_peer,
+ ssl_handshaker_result_get_frame_protector_type,
nullptr, /* create_zero_copy_grpc_protector */
ssl_handshaker_result_create_frame_protector,
ssl_handshaker_result_get_unused_bytes,
@@ -1379,7 +1429,7 @@ static tsi_result ssl_handshaker_result_create(
return TSI_INVALID_ARGUMENT;
}
tsi_ssl_handshaker_result* result =
- static_cast<tsi_ssl_handshaker_result*>(gpr_zalloc(sizeof(*result)));
+ grpc_core::Zalloc<tsi_ssl_handshaker_result>();
result->base.vtable = &handshaker_result_vtable;
/* Transfer ownership of ssl and network_io to the handshaker result. */
result->ssl = handshaker->ssl;
@@ -1446,6 +1496,7 @@ static tsi_result ssl_handshaker_process_bytes_from_peer(
impl->result = TSI_OK;
return impl->result;
} else {
+ ERR_clear_error();
/* Get ready to get some bytes from SSL. */
int ssl_result = SSL_do_handshake(impl->ssl);
ssl_result = SSL_get_error(impl->ssl, ssl_result);
@@ -1642,6 +1693,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
tsi_ssl_handshaker_resume_session(ssl,
client_factory->session_cache.get());
}
+ ERR_clear_error();
ssl_result = SSL_do_handshake(ssl);
ssl_result = SSL_get_error(ssl, ssl_result);
if (ssl_result != SSL_ERROR_WANT_READ) {
@@ -1656,7 +1708,7 @@ static tsi_result create_tsi_ssl_handshaker(SSL_CTX* ctx, int is_client,
SSL_set_accept_state(ssl);
}
- impl = static_cast<tsi_ssl_handshaker*>(gpr_zalloc(sizeof(*impl)));
+ impl = grpc_core::Zalloc<tsi_ssl_handshaker>();
impl->ssl = ssl;
impl->network_io = network_io;
impl->result = TSI_HANDSHAKE_IN_PROGRESS;
@@ -1921,14 +1973,16 @@ tsi_result tsi_create_ssl_client_handshaker_factory_with_options(
#else
ssl_context = SSL_CTX_new(TLSv1_2_method());
#endif
- result = tsi_set_min_and_max_tls_versions(
- ssl_context, options->min_tls_version, options->max_tls_version);
- if (result != TSI_OK) return result;
if (ssl_context == nullptr) {
+ log_ssl_error_stack();
gpr_log(GPR_ERROR, "Could not create ssl context.");
return TSI_INVALID_ARGUMENT;
}
+ result = tsi_set_min_and_max_tls_versions(
+ ssl_context, options->min_tls_version, options->max_tls_version);
+ if (result != TSI_OK) return result;
+
impl = static_cast<tsi_ssl_client_handshaker_factory*>(
gpr_zalloc(sizeof(*impl)));
tsi_ssl_handshaker_factory_init(&impl->base);
@@ -2088,15 +2142,18 @@ tsi_result tsi_create_ssl_server_handshaker_factory_with_options(
#else
impl->ssl_contexts[i] = SSL_CTX_new(TLSv1_2_method());
#endif
- result = tsi_set_min_and_max_tls_versions(impl->ssl_contexts[i],
- options->min_tls_version,
- options->max_tls_version);
- if (result != TSI_OK) return result;
if (impl->ssl_contexts[i] == nullptr) {
+ log_ssl_error_stack();
gpr_log(GPR_ERROR, "Could not create ssl context.");
result = TSI_OUT_OF_RESOURCES;
break;
}
+
+ result = tsi_set_min_and_max_tls_versions(impl->ssl_contexts[i],
+ options->min_tls_version,
+ options->max_tls_version);
+ if (result != TSI_OK) return result;
+
result = populate_ssl_context(impl->ssl_contexts[i],
&options->pem_key_cert_pairs[i],
options->cipher_suites);
diff --git a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
index c277cfc3479..88087e7a72c 100644
--- a/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
+++ b/contrib/libs/grpc/src/core/tsi/ssl_transport_security.h
@@ -21,8 +21,10 @@
#include <grpc/support/port_platform.h>
-#include <grpc/grpc_security_constants.h>
#include "y_absl/strings/string_view.h"
+
+#include <grpc/grpc_security_constants.h>
+
#include "src/core/tsi/transport_security_interface.h"
extern "C" {
@@ -33,18 +35,18 @@ extern "C" {
#define TSI_X509_CERTIFICATE_TYPE "X509"
/* This property is of type TSI_PEER_PROPERTY_STRING. */
+#define TSI_X509_SUBJECT_PEER_PROPERTY "x509_subject"
#define TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY "x509_subject_common_name"
#define TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY \
"x509_subject_alternative_name"
#define TSI_SSL_SESSION_REUSED_PEER_PROPERTY "ssl_session_reused"
-
#define TSI_X509_PEM_CERT_PROPERTY "x509_pem_cert"
-
#define TSI_X509_PEM_CERT_CHAIN_PROPERTY "x509_pem_cert_chain"
-
#define TSI_SSL_ALPN_SELECTED_PROTOCOL "ssl_alpn_selected_protocol"
-
+#define TSI_X509_DNS_PEER_PROPERTY "x509_dns"
#define TSI_X509_URI_PEER_PROPERTY "x509_uri"
+#define TSI_X509_EMAIL_PEER_PROPERTY "x509_email"
+#define TSI_X509_IP_PEER_PROPERTY "x509_ip"
/* --- tsi_ssl_root_certs_store object ---
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/BUILD b/contrib/libs/grpc/src/core/tsi/test_creds/BUILD
index 94bb5d4bdef..1ff24718ecf 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/BUILD
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/BUILD
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-licenses(["notice"]) # Apache v2
+licenses(["notice"])
exports_files([
"ca.pem",
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
index 265950f56d6..33ecc9d9b84 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain-openssl.cnf
@@ -28,3 +28,6 @@ URI.2 = https://bar.test.domain.com/test
URI.3 = spiffe://foo.com/bar/baz
email.1 = foo@test.domain.com
email.2 = bar@test.domain.com
+IP.1 = 192.168.7.1
+IP.2 = 13::17
+RID.1 = 1.2.3.4
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
index b5789e92f94..2b9cce0bdb9 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.key
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCuGVBYD3P/D2eT
-nhBhZ0izP+nuozNCEO/iQu/kyy6ZCzIEFvykt0aPzJVLcsCHCaWcNJVFPSqVDVRm
-9S5ZHUyLlnSl53mKUltZI4tDDVMcEdr7KpfXeBc86lm/93DqFDgAYDkvebekRr/8
-B1OJhVJRGowXjAU9sYABzuUqjkra522BleIik3m+7DborGHS4Io5X/8D8VjlXjeB
-Vht6QA8ij5JVfHvO6DsZr99EITPpha6i182O6S6lO2t1V+bdWP+EPjiOQJktrmvM
-QYTFjmjYkRKLCZI1xxSfCK8t7ia5sLPFOF6uDH91ck8mXmuHs96nSOyB1i/LdBy9
-XdInSRGXAgMBAAECggEAWoqZqSJoPfah9DhY5n8TZP1RSKUhTDOIvc/3+LHeSwNy
-gIP/4h3amYBZCELmc5QFx8Xk93xG//tNsLnD396H53RYt8s4/0GzdhkxHK76UPfM
-PaE6FHnFBA4QnPAvjdzz/uYL92/CnLGauJSK0lM+qyU2RCyysRH1s3sI3Wfg8BRd
-C9Xik+YzYirhCEGlYKju2D2As/tB2L0b/PRpM9FWeqd/YGCj8pUpceNrbvU8udc7
-4xQS6ssgMI2H1xGc50kJVDjoZix5OLiTaHDO4oRBZT+QdPTtfkam0/y2yZ9oX6UN
-Byl+ybtUpxsmsvl+I7bb/fZsILrXE3GHXtcsCMi5iQKBgQDmKi1HfmQo6KeDSnjp
-R+yIMc77QpZpLuzjPlKWGxY915KlL77GOUYR2cm0rPP9CPGN2Nj5IyuR32u6uHtI
-WKewR7cn69prxZI3VSNFQmsatWKBoR7dwyJ4j93cN54naEuBLA1BJQ0uXgYJtgwT
-x5KP97LcudpoDNVsh+FUopon8wKBgQDBpBMeDoc+7YVLnlx4FRJudzVfWWb4bPCL
-2cusycOVAlN2E0VsrD2vbVWoinpVPIeOfGgD0RZZLtVQL5Ui8mZcANmuoRXtEqaS
-sQ6VxkdC62uDXgrsi+i/0nsxvACmfde4sxALu3DZ7rjNlWUW7amJt34CsDBMlVeL
-eDAmD0WczQKBgQCHzSLiKATYzkzn/izRF4rL4PeK8ILmlLVYbxEzV9ALtQHlTQJ2
-2pwpNCL644EiLwC2/NcoSEQQ0Y4yoV68FPL745SBjXtWU0AuPaGN395p59OzQGmB
-1vyjvd7dbEN4ZOUH1gIMCdx5Gyjc2fjOQtaK808pRM9EzS2v14xv73CdWQKBgC/8
-qiQrs4Z7tCm+L+ouRqgLcLWVYTg1PxNZQOksAwT9U5OSSQUaVhsQPEcNMi3HV0yP
-NfOkMCafvYsmj43ehlFMgKWPE/DxS0hVCmlBfs1tq/IdLxXZwi8vSQpVLdAUpY4H
-CfXuWJQZXcDMwgWBlh8j0t11rjJ8W/qbKUt1Q2oNAoGBALdy/RpspFttVvthzFbg
-FLHUAwUhEsK1VSi26AYy4L0ZHw/KLnbIGEzKCEFWqn6nfWOlb9Rw5C7QlGx/1UCC
-Tnn9KnZoziK4JDQw6SEl/3hNQ5+FYI8y7QGsqAm1W9dobbgl0a1IfmbtBeEOZt+e
-7oFnqaxVruVmNr56M9IMCwA1
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAg51YU8NkgC7w
+Hx7Jf9Zj+wjHcLxedY6czsFjhl9wUlYRkQ+wdt3suH998TrbdVMc38tpI460pGk7
+gGBpMkbZgo1YNnwz/U1jAOR11EVGHN1QDy3H0BI2E5RYtl/vTWQLFo1khIaKK4eS
+3ptrPd+1XB6L25E4ISOVgd3yn4b5eTMGRbEei+wrkZIyZAVgCIw8d6BHHwldWz3A
+ljKRErMPzKtnyVL+ctp0Kx6ObppiBPPOWhNNTtMkmLgfeZQK3U7cPN5WI13Fso05
+FA3wVo/w6sXTtz4inIT14Y57E34V6sWZezrBbTtAI0yN3DqXSKTBgGjOQUbjqVxS
+i/JzRbZpAgMBAAECggEAXJMt59qn3D1T1P5yFJ2X4A5Io3eP7bCEOt2l25EzddTy
+NJJYRBh1Ea+LB2ooTn410G3B6DZEGpPxUr6iHhQiQ9hm1eOliG6ndxNnyU2hXlzl
+A+m4rxxclYqGzL4ulenWUQqwRYUBGZJjKHpJrKFdYV4CBmk4hRBSh0OjElgqVO5g
+nliMl3fC+GgUXtdMDGoPnC6MwD8q0RSJxbzpd8r+yREgX6KveEfPTfgSLAUieJrf
+2qqEk0Prdrwzsu0iyDYCaWLOq0cUstnHCo3e5synV4VzAFnaqxMT7lCVuUHgFpHj
+62rTwBCG/n3s+IVAp9CGBe37+SiJPRE8t5PDr65F3QKBgQDovkKLWzXxVJauTF/E
+tFRA+HqNDzYC3yiN0MIBmcF7IntdwCHznMyqydkaSE6WYn+NKglbH3c4RD5Hmdxc
+PUta8wgpmTg264568Svgna5jhwoqStrzh7qeBPXHmJvK4MkWALH4ukr3hIsWzsAh
+881ebstQDke8uHzyNZBY/URebwKBgQDTwEP6hgcgDOaf9yzipeMhtsArIm7zXn+r
+1RknpKUA8wM6fpEMpdUTgReu9tdJDgrcKac6imSZoNM6DBoOb/Hdj6FourHiTTvE
+dXAOjAzkDz/c86HFuDNoz27usoMPu/3iJPwuLQSO0IlflccLuOirhnnY8yVxIuy2
++9g+2iOkpwKBgE/Kin3EM2YdHdt7i4mgWRI9HaamhFnPr9OOsjRiRha0555odDtU
+kkYrFScRiv+7nQcEVljLHNBJdSCO+yEUUnVHxJCeWstZTmuPqv9Cj7rHXRDKwO2k
+prHt+WUISMDw9393lYw0MedRpW2YS/5X2xx413MGsklc5lkTS/12Nq45AoGAaVCf
+vrL4Sj2AWqEhxtwAmlz9OLbYfdxLHVhQOYJOuqkiuu4GEEdOMXQsJk4IhwIf7p4c
+2SXJoQr241DviKyum6Z6/c6U+Fu3VR+fiuym4Kqg9bCKjf7uOruojbllK+cw/0+r
+yP+E287l9A9XPwJJXj30zi0oOxvGpb+eLqxpu9MCgYEAxIgVhzyfRvoAdNYk7FE7
+JDig38EGC4m9grh/9G0tMvWT/E+F1Hb5V9NDK/iWA25dD3hOASxza1Hqkt1dP5on
+FMZrmP2T9Ov0wgfVuRIf8/c3YyiS1wJXb3wROVaJJDSvE5c2UszR5pfqvNE5C1YV
+zpc3ITQSAX66LK6ImkHb9Jw=
-----END PRIVATE KEY-----
diff --git a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
index d4ff936fde3..727b8ff4901 100644
--- a/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
+++ b/contrib/libs/grpc/src/core/tsi/test_creds/multi-domain.pem
@@ -1,24 +1,24 @@
-----BEGIN CERTIFICATE-----
-MIID/jCCAuagAwIBAgIUV2eOzlQQj1U+++TDdNyRHjRNamQwDQYJKoZIhvcNAQEL
+MIIEGzCCAwOgAwIBAgIUVwCmP2zKfeoWdaMbn32PjFgpdRswDQYJKoZIhvcNAQEL
BQAwSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYDVQQHDAJTRjEPMA0G
-A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTIwMDYwNzIyNTk1MFoX
-DTMwMDYwNTIyNTk1MFowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD
+A1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMB4XDTIxMDQwOTE5MzgxOVoX
+DTMxMDQwNzE5MzgxOVowSjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQswCQYD
VQQHDAJTRjEPMA0GA1UECwwGR29vZ2xlMRAwDgYDVQQDDAd4cGlnb3JzMIIBIjAN
-BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArhlQWA9z/w9nk54QYWdIsz/p7qMz
-QhDv4kLv5MsumQsyBBb8pLdGj8yVS3LAhwmlnDSVRT0qlQ1UZvUuWR1Mi5Z0ped5
-ilJbWSOLQw1THBHa+yqX13gXPOpZv/dw6hQ4AGA5L3m3pEa//AdTiYVSURqMF4wF
-PbGAAc7lKo5K2udtgZXiIpN5vuw26Kxh0uCKOV//A/FY5V43gVYbekAPIo+SVXx7
-zug7Ga/fRCEz6YWuotfNjukupTtrdVfm3Vj/hD44jkCZLa5rzEGExY5o2JESiwmS
-NccUnwivLe4mubCzxThergx/dXJPJl5rh7Pep0jsgdYvy3QcvV3SJ0kRlwIDAQAB
-o4HbMIHYMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIG9BgNVHREEgbUwgbKCE2Zv
+BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwIOdWFPDZIAu8B8eyX/WY/sIx3C8
+XnWOnM7BY4ZfcFJWEZEPsHbd7Lh/ffE623VTHN/LaSOOtKRpO4BgaTJG2YKNWDZ8
+M/1NYwDkddRFRhzdUA8tx9ASNhOUWLZf701kCxaNZISGiiuHkt6baz3ftVwei9uR
+OCEjlYHd8p+G+XkzBkWxHovsK5GSMmQFYAiMPHegRx8JXVs9wJYykRKzD8yrZ8lS
+/nLadCsejm6aYgTzzloTTU7TJJi4H3mUCt1O3DzeViNdxbKNORQN8FaP8OrF07c+
+IpyE9eGOexN+FerFmXs6wW07QCNMjdw6l0ikwYBozkFG46lcUovyc0W2aQIDAQAB
+o4H4MIH1MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgXgMIHaBgNVHREEgdIwgc+CE2Zv
by50ZXN0LmRvbWFpbi5jb22CE2Jhci50ZXN0LmRvbWFpbi5jb22GIGh0dHBzOi8v
Zm9vLnRlc3QuZG9tYWluLmNvbS90ZXN0hiBodHRwczovL2Jhci50ZXN0LmRvbWFp
bi5jb20vdGVzdIYYc3BpZmZlOi8vZm9vLmNvbS9iYXIvYmF6gRNmb29AdGVzdC5k
-b21haW4uY29tgRNiYXJAdGVzdC5kb21haW4uY29tMA0GCSqGSIb3DQEBCwUAA4IB
-AQBlLNl/uXN01VARQFd5CNFMhwez879uB5N3s/pGBjzE8Z+NA9YjsBFkBSQlebFM
-5UP304rsvG2opHwcSkblG9a3TbpQVNaYjcHgudip3FqLTJ3NhYtx1A3uCBp4ABeP
-+AVlCcsNVysGwGvMzXlN++Y++U0A9BbfrP85VBslLaKn4rYpfB5pAdzu277ICdEy
-nyFZ+jo2OS1lbv7kE7IW6slCXbCFaxPIKvjPbpGFngsLt44sZ9VvSJCeKhDglMfn
-HKkhd4/UMnRn+8tZZ6eH/C5tpeKAChMUF+bkuwk3dBwnHq484KbBAKd2cwzZhTB7
-8unku1S1GumvoEYAgbG1P4gC
+b21haW4uY29tgRNiYXJAdGVzdC5kb21haW4uY29thwTAqAcBhxAAEwAAAAAAAAAA
+AAAAAAAXiAMqAwQwDQYJKoZIhvcNAQELBQADggEBAIHzi/MWANQDYqpNDGVA6HGg
+vYPnwxjLXL/8apVf1ZMHzS/R6Eudu8ugppnnEL7Cjsd4oA0r/sJLjBvhaZtf0r4S
+GguWdmai2RR1ghwkCLPF/HlCqiBKwUfWrjTxq8GOwwodhW7lk4hLPzhFRzh/I93g
+uN5/ugPKcloWQ7X/0okMdkdPmk8uLpMckXNKj13Lupl/0BgDggghVXRTA2t0ujhx
+TvRWfYi5H1eJtNcj824PaIDifPiSOpzeXZi+na2XzzVmCz5n/e2H4nlTMVcN6YGG
+M3U3uJqjjjpKkCrrdNAJJpqqJpln4P6fVvO2ND1QmyE5YIKV3tZ8p38AJOheUcw=
-----END CERTIFICATE-----
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security.cc b/contrib/libs/grpc/src/core/tsi/transport_security.cc
index dd62189654e..5d822604747 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security.cc
+++ b/contrib/libs/grpc/src/core/tsi/transport_security.cc
@@ -20,12 +20,12 @@
#include "src/core/tsi/transport_security.h"
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-
#include <stdlib.h>
#include <string.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+
/* --- Tracing. --- */
grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi");
@@ -251,6 +251,18 @@ tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
return self->vtable->extract_peer(self, peer);
}
+tsi_result tsi_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type) {
+ if (self == nullptr || frame_protector_type == nullptr) {
+ return TSI_INVALID_ARGUMENT;
+ }
+ if (self->vtable->get_frame_protector_type == nullptr) {
+ return TSI_UNIMPLEMENTED;
+ }
+ return self->vtable->get_frame_protector_type(self, frame_protector_type);
+}
+
tsi_result tsi_handshaker_result_create_frame_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_frame_protector** protector) {
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security.h b/contrib/libs/grpc/src/core/tsi/transport_security.h
index d3b1c7f4aa9..53f85d2852b 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security.h
+++ b/contrib/libs/grpc/src/core/tsi/transport_security.h
@@ -29,7 +29,8 @@
extern grpc_core::TraceFlag tsi_tracing_enabled;
/* Base for tsi_frame_protector implementations.
- See transport_security_interface.h for documentation. */
+ See transport_security_interface.h for documentation.
+ All methods must be implemented. */
struct tsi_frame_protector_vtable {
tsi_result (*protect)(tsi_frame_protector* self,
const unsigned char* unprotected_bytes,
@@ -54,6 +55,9 @@ struct tsi_frame_protector {
/* Base for tsi_handshaker implementations.
See transport_security_interface.h for documentation. */
struct tsi_handshaker_vtable {
+ /* Methods for supporting the old synchronous API.
+ These can be null if the TSI impl supports only the new
+ async-capable API. */
tsi_result (*get_bytes_to_send_to_peer)(tsi_handshaker* self,
unsigned char* bytes,
size_t* bytes_size);
@@ -65,7 +69,10 @@ struct tsi_handshaker_vtable {
tsi_result (*create_frame_protector)(tsi_handshaker* self,
size_t* max_protected_frame_size,
tsi_frame_protector** protector);
+ /* Must be implemented by all TSI impls. */
void (*destroy)(tsi_handshaker* self);
+ /* Methods for supporting the new async-capable API.
+ These can be null if the TSI impl supports only the old sync API. */
tsi_result (*next)(tsi_handshaker* self, const unsigned char* received_bytes,
size_t received_bytes_size,
const unsigned char** bytes_to_send,
@@ -88,13 +95,21 @@ struct tsi_handshaker {
API depend on grpc. The create_zero_copy_grpc_protector() method is only used
in grpc, where we do need the exec_ctx passed through, but the API still
needs to compile in other applications, where grpc_exec_ctx is not defined.
+ All methods must be non-null, except where noted below.
*/
struct tsi_handshaker_result_vtable {
tsi_result (*extract_peer)(const tsi_handshaker_result* self, tsi_peer* peer);
+ tsi_result (*get_frame_protector_type)(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type);
+ /* May be null if get_frame_protector_type() returns
+ TSI_FRAME_PROTECTOR_NORMAL or TSI_FRAME_PROTECTOR_NONE. */
tsi_result (*create_zero_copy_grpc_protector)(
const tsi_handshaker_result* self,
size_t* max_output_protected_frame_size,
tsi_zero_copy_grpc_protector** protector);
+ /* May be null if get_frame_protector_type() returns
+ TSI_FRAME_PROTECTOR_ZERO_COPY or TSI_FRAME_PROTECTOR_NONE. */
tsi_result (*create_frame_protector)(const tsi_handshaker_result* self,
size_t* max_output_protected_frame_size,
tsi_frame_protector** protector);
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
index 4779b686c66..ba9428b5885 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
+++ b/contrib/libs/grpc/src/core/tsi/transport_security_grpc.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpc/slice_buffer.h>
+
#include "src/core/tsi/transport_security.h"
/* This method creates a tsi_zero_copy_grpc_protector object. It return TSI_OK
diff --git a/contrib/libs/grpc/src/core/tsi/transport_security_interface.h b/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
index 50beccac328..0ba139379be 100644
--- a/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
+++ b/contrib/libs/grpc/src/core/tsi/transport_security_interface.h
@@ -65,6 +65,26 @@ typedef enum {
} tsi_client_certificate_request_type;
typedef enum {
+ // TSI implementation provides a normal frame protector. The caller
+ // should invoke tsi_handshaker_result_create_frame_protector() to
+ // generate the frame protector.
+ TSI_FRAME_PROTECTOR_NORMAL,
+ // TSI implementation provides a zero-copy frame protector. The caller
+ // should invoke tsi_handshaker_result_create_zero_copy_grpc_protector()
+ // to generate the frame protector.
+ TSI_FRAME_PROTECTOR_ZERO_COPY,
+ // TSI implementation provides both normal and zero-copy frame protectors.
+ // The caller should invoke either
+ // tsi_handshaker_result_create_frame_protector() or
+ // tsi_handshaker_result_create_zero_copy_grpc_protector() to generate
+ // the frame protector.
+ TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY,
+ // TSI implementation does not provide any frame protector. This means
+ // that it is safe for the caller to send bytes unprotected on the wire.
+ TSI_FRAME_PROTECTOR_NONE,
+} tsi_frame_protector_type;
+
+typedef enum {
TSI_TLS1_2,
TSI_TLS1_3,
} tsi_tls_version;
@@ -234,6 +254,12 @@ typedef struct tsi_handshaker_result tsi_handshaker_result;
tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result* self,
tsi_peer* peer);
+/* This method indicates what type of frame protector is provided by the
+ TSI implementation. */
+tsi_result tsi_handshaker_result_get_frame_protector_type(
+ const tsi_handshaker_result* self,
+ tsi_frame_protector_type* frame_protector_type);
+
/* This method creates a tsi_frame_protector object. It returns TSI_OK assuming
there is no fatal error.
The caller is responsible for destroying the protector. */
diff --git a/contrib/libs/grpc/src/cpp/README.md b/contrib/libs/grpc/src/cpp/README.md
index 134f4db56c7..5c1c40acf7f 100755
--- a/contrib/libs/grpc/src/cpp/README.md
+++ b/contrib/libs/grpc/src/cpp/README.md
@@ -9,6 +9,39 @@ This section describes how to add gRPC as a dependency to your C++ project.
In the C++ world, there's no universally accepted standard for managing project dependencies.
Therefore, gRPC supports several major build systems, which should satisfy most users.
+## Supported Platforms
+
+* Officially Supported: These platforms are officially supported. We test our
+ code on these platform and have automated continuous integration tests for
+ them.
+
+* Best Effort: We do not have continous integration tests for these, but we are
+ fairly confident that gRPC C++ would work on them. We will make our best
+ effort to support them, and we welcome patches for such platforms, but we
+ might need to declare bankruptcy on some issues.
+
+* Community Supported: These platforms are supported by contributions from the
+ open source community, there is no official support for them. Breakages on
+ these platforms may go unnoticed, and the community is responsible for all
+ maintenance. Unmaintained code for these platforms may be deleted.
+
+| Operating System | Architectures | Versions | Support Level |
+|------------------|---------------|----------|---------------|
+| Linux - Debian, Ubuntu, CentOS | x86, x64 | clang 4+, GCC 4.9+ | Officially Supported |
+| Windows 10+ | x86, x64 | Visual Studio 2015+ | Officially Supported |
+| MacOS | x86, x64 | XCode 7.2+ | Officially Supported |
+| Linux - Others | x86, x64 | clang 4+, GCC 4.9+ | Best Effort |
+| Linux | ARM | | Best Effort |
+| iOS | | | Best Effort |
+| Android | | | Best Effort |
+| Asylo | | | Best Effort |
+| FreeBSD | | | Community Supported |
+| OpenBSD | | | Community Supported |
+| AIX | | | Community Supported |
+| Solaris | | | Community Supported |
+| NaCL | | | Community Supported |
+| Fuchsia | | | Community Supported |
+
## Bazel
Bazel is the primary build system used by the core gRPC development team. Bazel
@@ -122,6 +155,13 @@ first install gRPC C++ using CMake, and have your non-CMake project rely on the
`pkgconfig` files which are provided by gRPC installation.
[Example](../../test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh)
+**Note for CentOS 7 users**
+
+CentOS-7 ships with `pkg-config` 0.27.1, which has a
+[bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make
+invocations take extremely long to complete. If you plan to use `pkg-config`,
+you'll want to upgrade it to something newer.
+
## make (deprecated)
The default choice for building on UNIX based systems used to be `make`, but we are no longer recommending it.
@@ -147,11 +187,16 @@ gRPC is available using the [vcpkg](https://github.com/Microsoft/vcpkg) dependen
# install vcpkg package manager on your system using the official instructions
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
+
+# Bootstrap on Linux:
./bootstrap-vcpkg.sh
+# Bootstrap on Windows instead:
+# ./bootstrap-vcpkg.bat
+
./vcpkg integrate install
# install gRPC using vcpkg package manager
-vcpkg install grpc
+./vcpkg install grpc
```
The gRPC port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
diff --git a/contrib/libs/grpc/src/cpp/client/channel_cc.cc b/contrib/libs/grpc/src/cpp/client/channel_cc.cc
index 1793161d6ce..280537bbbd0 100644
--- a/contrib/libs/grpc/src/cpp/client/channel_cc.cc
+++ b/contrib/libs/grpc/src/cpp/client/channel_cc.cc
@@ -16,8 +16,6 @@
*
*/
-#include <grpcpp/channel.h>
-
#include <cstring>
#include <memory>
@@ -27,6 +25,7 @@
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/call.h>
@@ -57,12 +56,13 @@ Channel::Channel(const TString& host, grpc_channel* channel,
Channel::~Channel() {
grpc_channel_destroy(c_channel_);
- if (callback_cq_ != nullptr) {
+ CompletionQueue* callback_cq = callback_cq_.load(std::memory_order_relaxed);
+ if (callback_cq != nullptr) {
if (grpc_iomgr_run_in_background()) {
// gRPC-core provides the backing needed for the preferred CQ type
- callback_cq_->Shutdown();
+ callback_cq->Shutdown();
} else {
- CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq_);
+ CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq);
}
}
}
@@ -146,9 +146,9 @@ void ChannelResetConnectionBackoff(Channel* channel) {
// ClientRpcInfo should be set before call because set_call also checks
// whether the call has been cancelled, and if the call was cancelled, we
// should notify the interceptors too.
- auto* info =
- context->set_client_rpc_info(method.name(), method.method_type(), this,
- interceptor_creators_, interceptor_pos);
+ auto* info = context->set_client_rpc_info(
+ method.name(), method.suffix_for_stats(), method.method_type(), this,
+ interceptor_creators_, interceptor_pos);
context->set_call(c_call, shared_from_this());
return ::grpc::internal::Call(c_call, this, cq, info);
@@ -213,7 +213,7 @@ bool Channel::WaitForStateChangeImpl(grpc_connectivity_state last_observed,
}
namespace {
-class ShutdownCallback : public grpc_experimental_completion_queue_functor {
+class ShutdownCallback : public grpc_completion_queue_functor {
public:
ShutdownCallback() {
functor_run = &ShutdownCallback::Run;
@@ -229,7 +229,7 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
// The Run function will get invoked by the completion queue library
// when the shutdown is actually complete
- static void Run(grpc_experimental_completion_queue_functor* cb, int) {
+ static void Run(grpc_completion_queue_functor* cb, int) {
auto* callback = static_cast<ShutdownCallback*>(cb);
delete callback->cq_;
delete callback;
@@ -243,25 +243,33 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
::grpc::CompletionQueue* Channel::CallbackCQ() {
// TODO(vjpai): Consider using a single global CQ for the default CQ
// if there is no explicit per-channel CQ registered
+ CompletionQueue* callback_cq = callback_cq_.load(std::memory_order_acquire);
+ if (callback_cq != nullptr) {
+ return callback_cq;
+ }
+ // The callback_cq_ wasn't already set, so grab a lock and set it up exactly
+ // once for this channel.
grpc::internal::MutexLock l(&mu_);
- if (callback_cq_ == nullptr) {
+ callback_cq = callback_cq_.load(std::memory_order_relaxed);
+ if (callback_cq == nullptr) {
if (grpc_iomgr_run_in_background()) {
// gRPC-core provides the backing needed for the preferred CQ type
auto* shutdown_callback = new ShutdownCallback;
- callback_cq_ =
+ callback_cq =
new ::grpc::CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK,
GRPC_CQ_DEFAULT_POLLING, shutdown_callback});
// Transfer ownership of the new cq to its own shutdown callback
- shutdown_callback->TakeCQ(callback_cq_);
+ shutdown_callback->TakeCQ(callback_cq);
} else {
// Otherwise we need to use the alternative CQ variant
- callback_cq_ = CompletionQueue::CallbackAlternativeCQ();
+ callback_cq = CompletionQueue::CallbackAlternativeCQ();
}
+ callback_cq_.store(callback_cq, std::memory_order_release);
}
- return callback_cq_;
+ return callback_cq;
}
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/client_callback.cc b/contrib/libs/grpc/src/cpp/client/client_callback.cc
index a05761ad063..9e4ebbb3f82 100644
--- a/contrib/libs/grpc/src/cpp/client/client_callback.cc
+++ b/contrib/libs/grpc/src/cpp/client/client_callback.cc
@@ -20,6 +20,7 @@
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
+#include "src/core/lib/surface/call.h"
namespace grpc {
namespace internal {
@@ -36,7 +37,7 @@ void ClientReactor::InternalScheduleOnDone(grpc::Status s) {
: reactor(reactor_arg), status(std::move(s)) {
GRPC_CLOSURE_INIT(
&closure,
- [](void* void_arg, grpc_error*) {
+ [](void* void_arg, grpc_error_handle) {
ClosureWithArg* arg = static_cast<ClosureWithArg*>(void_arg);
arg->reactor->OnDone(arg->status);
delete arg;
@@ -48,5 +49,9 @@ void ClientReactor::InternalScheduleOnDone(grpc::Status s) {
grpc_core::Executor::Run(&arg->closure, GRPC_ERROR_NONE);
}
+bool ClientReactor::InternalTrailersOnly(const grpc_call* call) const {
+ return grpc_call_is_trailers_only(call);
+}
+
} // namespace internal
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/client_context.cc b/contrib/libs/grpc/src/cpp/client/client_context.cc
index 8f18bfe7245..fd4a52c88ed 100644
--- a/contrib/libs/grpc/src/cpp/client/client_context.cc
+++ b/contrib/libs/grpc/src/cpp/client/client_context.cc
@@ -16,14 +16,12 @@
*
*/
-#include <grpcpp/client_context.h>
-
#include <grpc/compression.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-
+#include <grpcpp/client_context.h>
#include <grpcpp/impl/codegen/interceptor_common.h>
#include <grpcpp/impl/codegen/sync.h>
#include <grpcpp/impl/grpc_library.h>
@@ -98,7 +96,7 @@ std::unique_ptr<ClientContext> ClientContext::FromInternalServerContext(
}
std::unique_ptr<ClientContext> ClientContext::FromServerContext(
- const grpc::ServerContext& server_context, PropagationOptions options) {
+ const grpc::ServerContextBase& server_context, PropagationOptions options) {
return FromInternalServerContext(server_context, options);
}
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc b/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
index da2a878a227..77ab7ac8b56 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
+++ b/contrib/libs/grpc/src/cpp/client/create_channel_internal.cc
@@ -16,7 +16,12 @@
*
*/
+#include "src/cpp/client/create_channel_internal.h"
+
#include <memory>
+#include <util/generic/string.h>
+#include <utility>
+#include <vector>
#include <grpcpp/channel.h>
diff --git a/contrib/libs/grpc/src/cpp/client/create_channel_internal.h b/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
index 09d4e56b023..730051694bf 100644
--- a/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
+++ b/contrib/libs/grpc/src/cpp/client/create_channel_internal.h
@@ -20,6 +20,8 @@
#define GRPC_INTERNAL_CPP_CLIENT_CREATE_CHANNEL_INTERNAL_H
#include <memory>
+#include <util/generic/string.h>
+#include <vector>
#include <grpcpp/channel.h>
#include <grpcpp/impl/codegen/client_interceptor.h>
diff --git a/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc b/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
index b7036e541c9..d266e214352 100644
--- a/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/client/insecure_credentials.cc
@@ -15,13 +15,13 @@
* limitations under the License.
*
*/
-#include <grpcpp/security/credentials.h>
-
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/channel.h>
+#include <grpcpp/security/credentials.h>
#include <grpcpp/support/channel_arguments.h>
#include <grpcpp/support/config.h>
+
#include "src/cpp/client/create_channel_internal.h"
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/client/secure_credentials.cc b/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
index 109b50448df..ee3bde2eb24 100644
--- a/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/client/secure_credentials.cc
@@ -18,6 +18,8 @@
#include "src/cpp/client/secure_credentials.h"
+#include "y_absl/strings/str_join.h"
+
#include <grpc/impl/codegen/slice.h>
#include <grpc/slice.h>
#include <grpc/support/alloc.h>
@@ -28,8 +30,6 @@
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/channel_arguments.h>
-#include "y_absl/strings/str_join.h"
-
// TODO(yashykt): We shouldn't be including "src/core" headers.
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/error.h"
@@ -157,7 +157,7 @@ grpc::Status StsCredentialsOptionsFromJson(const TString& json_string,
"options cannot be nullptr.");
}
ClearStsCredentialsOptions(options);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::Json json = grpc_core::Json::Parse(json_string.c_str(), &error);
if (error != GRPC_ERROR_NONE ||
json.type() != grpc_core::Json::Type::OBJECT) {
@@ -215,8 +215,9 @@ grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions* options) {
ClearStsCredentialsOptions(options);
grpc_slice json_string = grpc_empty_slice();
char* sts_creds_path = gpr_getenv("STS_CREDENTIALS");
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc::Status status;
+ // NOLINTNEXTLINE(clang-diagnostic-unused-lambda-capture)
auto cleanup = [&json_string, &sts_creds_path, &error, &status]() {
grpc_slice_unref_internal(json_string);
gpr_free(sts_creds_path);
@@ -232,7 +233,7 @@ grpc::Status StsCredentialsOptionsFromEnv(StsCredentialsOptions* options) {
error = grpc_load_file(sts_creds_path, 1, &json_string);
if (error != GRPC_ERROR_NONE) {
status =
- grpc::Status(grpc::StatusCode::NOT_FOUND, grpc_error_string(error));
+ grpc::Status(grpc::StatusCode::NOT_FOUND, grpc_error_std_string(error));
return cleanup();
}
status = StsCredentialsOptionsFromJson(
@@ -406,7 +407,7 @@ std::shared_ptr<CallCredentials> MetadataCredentialsFromPlugin(
}
namespace {
-void DeleteWrapper(void* wrapper, grpc_error* /*ignored*/) {
+void DeleteWrapper(void* wrapper, grpc_error_handle /*ignored*/) {
MetadataCredentialsPluginWrapper* w =
static_cast<MetadataCredentialsPluginWrapper*>(wrapper);
delete w;
@@ -492,7 +493,6 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
grpc_metadata md_entry;
md_entry.key = SliceFromCopiedString(metadatum.first);
md_entry.value = SliceFromCopiedString(metadatum.second);
- md_entry.flags = 0;
md.push_back(md_entry);
}
if (creds_md != nullptr) {
@@ -507,7 +507,6 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
for (const auto& elem : md) {
creds_md[*num_creds_md].key = elem.key;
creds_md[*num_creds_md].value = elem.value;
- creds_md[*num_creds_md].flags = elem.flags;
++(*num_creds_md);
}
*status_code = static_cast<grpc_status_code>(status.error_code());
@@ -525,6 +524,10 @@ void MetadataCredentialsPluginWrapper::InvokePlugin(
MetadataCredentialsPluginWrapper::MetadataCredentialsPluginWrapper(
std::unique_ptr<MetadataCredentialsPlugin> plugin)
- : thread_pool_(CreateDefaultThreadPool()), plugin_(std::move(plugin)) {}
+ : plugin_(std::move(plugin)) {
+ if (plugin_->IsBlocking()) {
+ thread_pool_.reset(CreateDefaultThreadPool());
+ }
+}
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/client/secure_credentials.h b/contrib/libs/grpc/src/cpp/client/secure_credentials.h
index 9325f365b1e..d6f1c89c2c1 100644
--- a/contrib/libs/grpc/src/cpp/client/secure_credentials.h
+++ b/contrib/libs/grpc/src/cpp/client/secure_credentials.h
@@ -19,13 +19,12 @@
#ifndef GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H
#define GRPC_INTERNAL_CPP_CLIENT_SECURE_CREDENTIALS_H
-#include <grpc/grpc_security.h>
+#include "y_absl/strings/str_cat.h"
+#include <grpc/grpc_security.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/security/tls_credentials_options.h>
#include <grpcpp/support/config.h>
-
-#include "y_absl/strings/str_cat.h"
// TODO(yashykt): We shouldn't be including "src/core" headers.
#include "src/core/lib/security/credentials/credentials.h"
#include "src/cpp/server/thread_pool_interface.h"
diff --git a/contrib/libs/grpc/src/cpp/client/xds_credentials.cc b/contrib/libs/grpc/src/cpp/client/xds_credentials.cc
index 63b48837ef0..d5446a02fe5 100644
--- a/contrib/libs/grpc/src/cpp/client/xds_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/client/xds_credentials.cc
@@ -19,7 +19,6 @@
#include "src/cpp/client/secure_credentials.h"
namespace grpc {
-namespace experimental {
std::shared_ptr<ChannelCredentials> XdsCredentials(
const std::shared_ptr<ChannelCredentials>& fallback_creds) {
@@ -37,5 +36,12 @@ std::shared_ptr<ChannelCredentials> XdsCredentials(
}
}
+namespace experimental {
+
+std::shared_ptr<ChannelCredentials> XdsCredentials(
+ const std::shared_ptr<ChannelCredentials>& fallback_creds) {
+ return grpc::XdsCredentials(fallback_creds);
+}
+
} // namespace experimental
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
index ed4a3efa9f4..b042e4af0c0 100644
--- a/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/cpp/common/.yandex_meta/licenses.list.txt
@@ -39,8 +39,12 @@
====================COPYRIGHT====================
+ * Copyright 2019 gRPC authors.
+
+
+====================COPYRIGHT====================
* Copyright 2020 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+// Copyright 2021 gRPC authors.
diff --git a/contrib/libs/grpc/src/cpp/common/alarm.cc b/contrib/libs/grpc/src/cpp/common/alarm.cc
index ac1b747b493..a367b53d3a2 100644
--- a/contrib/libs/grpc/src/cpp/common/alarm.cc
+++ b/contrib/libs/grpc/src/cpp/common/alarm.cc
@@ -15,23 +15,22 @@
*
*/
-#include <grpcpp/alarm.h>
+#include <grpc/support/port_platform.h>
#include <memory>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
+#include <grpcpp/alarm.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
+
+#include "src/core/lib/debug/trace.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/surface/completion_queue.h"
-#include <grpc/support/log.h>
-#include "src/core/lib/debug/trace.h"
-
namespace grpc {
namespace internal {
@@ -56,7 +55,7 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
GPR_ASSERT(grpc_cq_begin_op(cq_, this));
GRPC_CLOSURE_INIT(
&on_alarm_,
- [](void* arg, grpc_error* error) {
+ [](void* arg, grpc_error_handle error) {
// queue the op on the completion queue
AlarmImpl* alarm = static_cast<AlarmImpl*>(arg);
alarm->Ref();
@@ -82,10 +81,10 @@ class AlarmImpl : public ::grpc::internal::CompletionQueueTag {
Ref();
GRPC_CLOSURE_INIT(
&on_alarm_,
- [](void* arg, grpc_error* error) {
+ [](void* arg, grpc_error_handle error) {
grpc_core::Executor::Run(
GRPC_CLOSURE_CREATE(
- [](void* arg, grpc_error* error) {
+ [](void* arg, grpc_error_handle error) {
AlarmImpl* alarm = static_cast<AlarmImpl*>(arg);
alarm->callback_(error == GRPC_ERROR_NONE);
alarm->Unref();
diff --git a/contrib/libs/grpc/src/cpp/common/auth_property_iterator.cc b/contrib/libs/grpc/src/cpp/common/auth_property_iterator.cc
index 0f380b09507..1334ea99663 100644
--- a/contrib/libs/grpc/src/cpp/common/auth_property_iterator.cc
+++ b/contrib/libs/grpc/src/cpp/common/auth_property_iterator.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/security/auth_context.h>
-
#include <grpc/grpc_security.h>
+#include <grpcpp/security/auth_context.h>
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/common/channel_arguments.cc b/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
index 5a5dd91b5ec..4950a800bb5 100644
--- a/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
+++ b/contrib/libs/grpc/src/cpp/common/channel_arguments.cc
@@ -15,14 +15,14 @@
* limitations under the License.
*
*/
-#include <grpcpp/support/channel_arguments.h>
-
#include <sstream>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/resource_quota.h>
+#include <grpcpp/support/channel_arguments.h>
+
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/socket_mutator.h"
@@ -66,9 +66,9 @@ ChannelArguments::ChannelArguments(const ChannelArguments& other)
}
ChannelArguments::~ChannelArguments() {
- grpc_core::ExecCtx exec_ctx;
for (auto& arg : args_) {
if (arg.type == GRPC_ARG_POINTER) {
+ grpc_core::ExecCtx exec_ctx;
arg.value.pointer.vtable->destroy(arg.value.pointer.p);
}
}
diff --git a/contrib/libs/grpc/src/cpp/common/channel_filter.cc b/contrib/libs/grpc/src/cpp/common/channel_filter.cc
index ab56d6073fe..373aebf61b7 100644
--- a/contrib/libs/grpc/src/cpp/common/channel_filter.cc
+++ b/contrib/libs/grpc/src/cpp/common/channel_filter.cc
@@ -16,13 +16,16 @@
*
*/
-#include <string.h>
-
-#include "src/core/lib/channel/channel_stack.h"
#include "src/cpp/common/channel_filter.h"
+#include <string.h>
+
#include <grpcpp/impl/codegen/slice.h>
+#include "src/core/lib/channel/channel_stack.h"
+#include "src/core/lib/channel/channel_stack_builder.h"
+#include "src/core/lib/config/core_configuration.h"
+
namespace grpc {
// MetadataBatch
@@ -32,8 +35,7 @@ grpc_linked_mdelem* MetadataBatch::AddMetadata(const string& key,
grpc_linked_mdelem* storage = new grpc_linked_mdelem;
storage->md = grpc_mdelem_from_slices(SliceFromCopiedString(key),
SliceFromCopiedString(value));
- GRPC_LOG_IF_ERROR("MetadataBatch::AddMetadata",
- grpc_metadata_batch_link_head(batch_, storage));
+ GRPC_LOG_IF_ERROR("MetadataBatch::AddMetadata", batch_->LinkHead(storage));
return storage;
}
@@ -61,38 +63,30 @@ void CallData::SetPollsetOrPollsetSet(grpc_call_element* elem,
grpc_call_stack_ignore_set_pollset_or_pollset_set(elem, pollent);
}
-// internal code used by RegisterChannelFilter()
-
namespace internal {
-// Note: Implicitly initialized to nullptr due to static lifetime.
-std::vector<FilterRecord>* channel_filters;
-
-namespace {
-
-bool MaybeAddFilter(grpc_channel_stack_builder* builder, void* arg) {
- const FilterRecord& filter = *static_cast<FilterRecord*>(arg);
- if (filter.include_filter) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- if (!filter.include_filter(*args)) return true;
- }
- return grpc_channel_stack_builder_prepend_filter(builder, &filter.filter,
- nullptr, nullptr);
+void RegisterChannelFilter(
+ grpc_channel_stack_type stack_type, int priority,
+ std::function<bool(const grpc_channel_args&)> include_filter,
+ const grpc_channel_filter* filter) {
+ auto maybe_add_filter = [include_filter,
+ filter](grpc_channel_stack_builder* builder) {
+ if (include_filter != nullptr) {
+ const grpc_channel_args* args =
+ grpc_channel_stack_builder_get_channel_arguments(builder);
+ if (!include_filter(*args)) return true;
+ }
+ return grpc_channel_stack_builder_prepend_filter(builder, filter, nullptr,
+ nullptr);
+ };
+ grpc_core::CoreConfiguration::RegisterBuilder(
+ [stack_type, priority,
+ maybe_add_filter](grpc_core::CoreConfiguration::Builder* builder) {
+ builder->channel_init()->RegisterStage(stack_type, priority,
+ maybe_add_filter);
+ });
}
-} // namespace
-
-void ChannelFilterPluginInit() {
- for (size_t i = 0; i < channel_filters->size(); ++i) {
- FilterRecord& filter = (*channel_filters)[i];
- grpc_channel_init_register_stage(filter.stack_type, filter.priority,
- MaybeAddFilter, &filter);
- }
-}
-
-void ChannelFilterPluginShutdown() {}
-
} // namespace internal
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/channel_filter.h b/contrib/libs/grpc/src/cpp/common/channel_filter.h
index b16f06bddcf..5364895e844 100644
--- a/contrib/libs/grpc/src/cpp/common/channel_filter.h
+++ b/contrib/libs/grpc/src/cpp/common/channel_filter.h
@@ -19,13 +19,13 @@
#ifndef GRPCXX_CHANNEL_FILTER_H
#define GRPCXX_CHANNEL_FILTER_H
+#include <functional>
+#include <vector>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpcpp/impl/codegen/config.h>
-#include <functional>
-#include <vector>
-
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/surface/channel_init.h"
#include "src/core/lib/transport/metadata_batch.h"
@@ -56,48 +56,6 @@ class MetadataBatch {
/// lifetime of the gRPC call.
grpc_linked_mdelem* AddMetadata(const string& key, const string& value);
- class const_iterator : public std::iterator<std::bidirectional_iterator_tag,
- const grpc_mdelem> {
- public:
- const grpc_mdelem& operator*() const { return elem_->md; }
- grpc_mdelem operator->() const { return elem_->md; }
-
- const_iterator& operator++() {
- elem_ = elem_->next;
- return *this;
- }
- const_iterator operator++(int) {
- const_iterator tmp(*this);
- operator++();
- return tmp;
- }
- const_iterator& operator--() {
- elem_ = elem_->prev;
- return *this;
- }
- const_iterator operator--(int) {
- const_iterator tmp(*this);
- operator--();
- return tmp;
- }
-
- bool operator==(const const_iterator& other) const {
- return elem_ == other.elem_;
- }
- bool operator!=(const const_iterator& other) const {
- return elem_ != other.elem_;
- }
-
- private:
- friend class MetadataBatch;
- explicit const_iterator(grpc_linked_mdelem* elem) : elem_(elem) {}
-
- grpc_linked_mdelem* elem_;
- };
-
- const_iterator begin() const { return const_iterator(batch_->list.head); }
- const_iterator end() const { return const_iterator(nullptr); }
-
private:
grpc_metadata_batch* batch_; // Not owned.
};
@@ -113,7 +71,7 @@ class TransportOp {
grpc_transport_op* op() const { return op_; }
// TODO(roth): Add a C++ wrapper for grpc_error?
- grpc_error* disconnect_with_error() const {
+ grpc_error_handle disconnect_with_error() const {
return op_->disconnect_with_error;
}
bool send_goaway() const { return op_->goaway_error != GRPC_ERROR_NONE; }
@@ -236,8 +194,8 @@ class ChannelData {
// TODO(roth): Come up with a more C++-like API for the channel element.
/// Initializes the channel data.
- virtual grpc_error* Init(grpc_channel_element* /*elem*/,
- grpc_channel_element_args* /*args*/) {
+ virtual grpc_error_handle Init(grpc_channel_element* /*elem*/,
+ grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
@@ -259,8 +217,8 @@ class CallData {
// TODO(roth): Come up with a more C++-like API for the call element.
/// Initializes the call data.
- virtual grpc_error* Init(grpc_call_element* /*elem*/,
- const grpc_call_element_args* /*args*/) {
+ virtual grpc_error_handle Init(grpc_call_element* /*elem*/,
+ const grpc_call_element_args* /*args*/) {
return GRPC_ERROR_NONE;
}
@@ -288,8 +246,8 @@ class ChannelFilter final {
public:
static const size_t channel_data_size = sizeof(ChannelDataType);
- static grpc_error* InitChannelElement(grpc_channel_element* elem,
- grpc_channel_element_args* args) {
+ static grpc_error_handle InitChannelElement(grpc_channel_element* elem,
+ grpc_channel_element_args* args) {
// Construct the object in the already-allocated memory.
ChannelDataType* channel_data = new (elem->channel_data) ChannelDataType();
return channel_data->Init(elem, args);
@@ -319,8 +277,8 @@ class ChannelFilter final {
static const size_t call_data_size = sizeof(CallDataType);
- static grpc_error* InitCallElement(grpc_call_element* elem,
- const grpc_call_element_args* args) {
+ static grpc_error_handle InitCallElement(grpc_call_element* elem,
+ const grpc_call_element_args* args) {
// Construct the object in the already-allocated memory.
CallDataType* call_data = new (elem->call_data) CallDataType();
return call_data->Init(elem, args);
@@ -348,16 +306,10 @@ class ChannelFilter final {
}
};
-struct FilterRecord {
- grpc_channel_stack_type stack_type;
- int priority;
- std::function<bool(const grpc_channel_args&)> include_filter;
- grpc_channel_filter filter;
-};
-extern std::vector<FilterRecord>* channel_filters;
-
-void ChannelFilterPluginInit();
-void ChannelFilterPluginShutdown();
+void RegisterChannelFilter(
+ grpc_channel_stack_type stack_type, int priority,
+ std::function<bool(const grpc_channel_args&)> include_filter,
+ const grpc_channel_filter* filter);
} // namespace internal
@@ -375,26 +327,21 @@ template <typename ChannelDataType, typename CallDataType>
void RegisterChannelFilter(
const char* name, grpc_channel_stack_type stack_type, int priority,
std::function<bool(const grpc_channel_args&)> include_filter) {
- // If we haven't been called before, initialize channel_filters and
- // call grpc_register_plugin().
- if (internal::channel_filters == nullptr) {
- grpc_register_plugin(internal::ChannelFilterPluginInit,
- internal::ChannelFilterPluginShutdown);
- internal::channel_filters = new std::vector<internal::FilterRecord>();
- }
- // Add an entry to channel_filters. The filter will be added when the
- // C-core initialization code calls ChannelFilterPluginInit().
- typedef internal::ChannelFilter<ChannelDataType, CallDataType> FilterType;
- internal::FilterRecord filter_record = {
- stack_type,
- priority,
- include_filter,
- {FilterType::StartTransportStreamOpBatch, FilterType::StartTransportOp,
- FilterType::call_data_size, FilterType::InitCallElement,
- FilterType::SetPollsetOrPollsetSet, FilterType::DestroyCallElement,
- FilterType::channel_data_size, FilterType::InitChannelElement,
- FilterType::DestroyChannelElement, FilterType::GetChannelInfo, name}};
- internal::channel_filters->push_back(filter_record);
+ using FilterType = internal::ChannelFilter<ChannelDataType, CallDataType>;
+ static const grpc_channel_filter filter = {
+ FilterType::StartTransportStreamOpBatch,
+ FilterType::StartTransportOp,
+ FilterType::call_data_size,
+ FilterType::InitCallElement,
+ FilterType::SetPollsetOrPollsetSet,
+ FilterType::DestroyCallElement,
+ FilterType::channel_data_size,
+ FilterType::InitChannelElement,
+ FilterType::DestroyChannelElement,
+ FilterType::GetChannelInfo,
+ name};
+ grpc::internal::RegisterChannelFilter(stack_type, priority,
+ std::move(include_filter), &filter);
}
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc b/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
index 67745590745..f4834214d0d 100644
--- a/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
+++ b/contrib/libs/grpc/src/cpp/common/completion_queue_cc.cc
@@ -15,13 +15,12 @@
*
*/
-#include <grpcpp/completion_queue.h>
-
#include <memory>
#include <grpc/grpc.h>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
+#include <grpcpp/completion_queue.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/time.h>
@@ -53,7 +52,8 @@ struct CallbackAlternativeCQ {
refs++;
if (refs == 1) {
cq = new CompletionQueue;
- int num_nexting_threads = GPR_CLAMP(gpr_cpu_num_cores() / 2, 2, 16);
+ int num_nexting_threads =
+ grpc_core::Clamp(gpr_cpu_num_cores() / 2, 2u, 16u);
nexting_threads = new std::vector<grpc_core::Thread>;
for (int i = 0; i < num_nexting_threads; i++) {
nexting_threads->emplace_back(
@@ -89,8 +89,7 @@ struct CallbackAlternativeCQ {
// hold any application locks before executing the callback,
// and cannot be entered recursively.
auto* functor =
- static_cast<grpc_experimental_completion_queue_functor*>(
- ev.tag);
+ static_cast<grpc_completion_queue_functor*>(ev.tag);
functor->functor_run(functor, ev.success);
}
},
diff --git a/contrib/libs/grpc/src/cpp/common/core_codegen.cc b/contrib/libs/grpc/src/cpp/common/core_codegen.cc
index 75383ed5110..da964f66628 100644
--- a/contrib/libs/grpc/src/cpp/common/core_codegen.cc
+++ b/contrib/libs/grpc/src/cpp/common/core_codegen.cc
@@ -16,7 +16,7 @@
*
*/
-#include <grpcpp/impl/codegen/core_codegen.h>
+#include <grpc/support/port_platform.h>
#include <stdlib.h>
@@ -27,8 +27,8 @@
#include <grpc/slice_buffer.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/sync.h>
+#include <grpcpp/impl/codegen/core_codegen.h>
#include <grpcpp/support/config.h>
#include "src/core/lib/profiling/timers.h"
@@ -118,6 +118,10 @@ grpc_call_error CoreCodegen::grpc_call_cancel_with_status(
void* reserved) {
return ::grpc_call_cancel_with_status(call, status, description, reserved);
}
+
+int CoreCodegen::grpc_call_failed_before_recv_message(const grpc_call* c) {
+ return ::grpc_call_failed_before_recv_message(c);
+}
void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); }
void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); }
void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) {
diff --git a/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc b/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
index 844bc627ab3..c9b1d4ab3bd 100644
--- a/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
+++ b/contrib/libs/grpc/src/cpp/common/secure_channel_arguments.cc
@@ -16,9 +16,9 @@
*
*/
+#include <grpc/grpc_security.h>
#include <grpcpp/support/channel_arguments.h>
-#include <grpc/grpc_security.h>
#include "src/core/lib/channel/channel_args.h"
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc b/contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc
index 908c46629e6..6633374b65b 100644
--- a/contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc
+++ b/contrib/libs/grpc/src/cpp/common/secure_create_auth_context.cc
@@ -20,6 +20,7 @@
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpcpp/security/auth_context.h>
+
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/cpp/common/secure_auth_context.h"
diff --git a/contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc b/contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc
index 8e99b571a18..073abae7d52 100644
--- a/contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc
+++ b/contrib/libs/grpc/src/cpp/common/tls_certificate_provider.cc
@@ -14,12 +14,12 @@
// limitations under the License.
//
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpcpp/security/tls_certificate_provider.h>
-#include "y_absl/container/inlined_vector.h"
-
namespace grpc {
namespace experimental {
diff --git a/contrib/libs/grpc/src/cpp/common/tls_certificate_verifier.cc b/contrib/libs/grpc/src/cpp/common/tls_certificate_verifier.cc
new file mode 100644
index 00000000000..7e51934e01c
--- /dev/null
+++ b/contrib/libs/grpc/src/cpp/common/tls_certificate_verifier.cc
@@ -0,0 +1,244 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "y_absl/container/inlined_vector.h"
+#include "y_absl/status/status.h"
+
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/string_util.h>
+#include <grpcpp/security/tls_certificate_verifier.h>
+
+namespace grpc {
+namespace experimental {
+
+static internal::GrpcLibraryInitializer g_gli_initializer;
+
+TlsCustomVerificationCheckRequest::TlsCustomVerificationCheckRequest(
+ grpc_tls_custom_verification_check_request* request)
+ : c_request_(request) {
+ GPR_ASSERT(c_request_ != nullptr);
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::target_name() const {
+ return c_request_->target_name != nullptr ? c_request_->target_name : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::peer_cert() const {
+ return c_request_->peer_info.peer_cert != nullptr
+ ? c_request_->peer_info.peer_cert
+ : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::peer_cert_full_chain()
+ const {
+ return c_request_->peer_info.peer_cert_full_chain != nullptr
+ ? c_request_->peer_info.peer_cert_full_chain
+ : "";
+}
+
+grpc::string_ref TlsCustomVerificationCheckRequest::common_name() const {
+ return c_request_->peer_info.common_name != nullptr
+ ? c_request_->peer_info.common_name
+ : "";
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::uri_names()
+ const {
+ std::vector<grpc::string_ref> uri_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.uri_names_size; ++i) {
+ uri_names.emplace_back(c_request_->peer_info.san_names.uri_names[i]);
+ }
+ return uri_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::dns_names()
+ const {
+ std::vector<grpc::string_ref> dns_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.dns_names_size; ++i) {
+ dns_names.emplace_back(c_request_->peer_info.san_names.dns_names[i]);
+ }
+ return dns_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::email_names()
+ const {
+ std::vector<grpc::string_ref> email_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.email_names_size;
+ ++i) {
+ email_names.emplace_back(c_request_->peer_info.san_names.email_names[i]);
+ }
+ return email_names;
+}
+
+std::vector<grpc::string_ref> TlsCustomVerificationCheckRequest::ip_names()
+ const {
+ std::vector<grpc::string_ref> ip_names;
+ for (size_t i = 0; i < c_request_->peer_info.san_names.ip_names_size; ++i) {
+ ip_names.emplace_back(c_request_->peer_info.san_names.ip_names[i]);
+ }
+ return ip_names;
+}
+
+CertificateVerifier::CertificateVerifier(grpc_tls_certificate_verifier* v)
+ : verifier_(v) {
+ g_gli_initializer.summon();
+}
+
+CertificateVerifier::~CertificateVerifier() {
+ grpc_tls_certificate_verifier_release(verifier_);
+}
+
+bool CertificateVerifier::Verify(TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) {
+ GPR_ASSERT(request != nullptr);
+ GPR_ASSERT(request->c_request() != nullptr);
+ {
+ internal::MutexLock lock(&mu_);
+ request_map_.emplace(request->c_request(), std::move(callback));
+ }
+ grpc_status_code status_code = GRPC_STATUS_OK;
+ char* error_details = nullptr;
+ bool is_done = grpc_tls_certificate_verifier_verify(
+ verifier_, request->c_request(), &AsyncCheckDone, this, &status_code,
+ &error_details);
+ if (is_done) {
+ if (status_code != GRPC_STATUS_OK) {
+ *sync_status = grpc::Status(static_cast<grpc::StatusCode>(status_code),
+ error_details);
+ }
+ internal::MutexLock lock(&mu_);
+ request_map_.erase(request->c_request());
+ }
+ gpr_free(error_details);
+ return is_done;
+}
+
+void CertificateVerifier::Cancel(TlsCustomVerificationCheckRequest* request) {
+ GPR_ASSERT(request != nullptr);
+ GPR_ASSERT(request->c_request() != nullptr);
+ grpc_tls_certificate_verifier_cancel(verifier_, request->c_request());
+}
+
+void CertificateVerifier::AsyncCheckDone(
+ grpc_tls_custom_verification_check_request* request, void* callback_arg,
+ grpc_status_code status, const char* error_details) {
+ auto* self = static_cast<CertificateVerifier*>(callback_arg);
+ std::function<void(grpc::Status)> callback;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = std::move(it->second);
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ grpc::Status return_status;
+ if (status != GRPC_STATUS_OK) {
+ return_status =
+ grpc::Status(static_cast<grpc::StatusCode>(status), error_details);
+ }
+ callback(return_status);
+ }
+}
+
+ExternalCertificateVerifier::ExternalCertificateVerifier() {
+ base_ = new grpc_tls_certificate_verifier_external();
+ base_->user_data = this;
+ base_->verify = VerifyInCoreExternalVerifier;
+ base_->cancel = CancelInCoreExternalVerifier;
+ base_->destruct = DestructInCoreExternalVerifier;
+}
+
+ExternalCertificateVerifier::~ExternalCertificateVerifier() { delete base_; }
+
+int ExternalCertificateVerifier::VerifyInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code* sync_status, char** sync_error_details) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ TlsCustomVerificationCheckRequest* cpp_request = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto pair = self->request_map_.emplace(
+ request, AsyncRequestState(callback, callback_arg, request));
+ GPR_ASSERT(pair.second);
+ cpp_request = &pair.first->second.cpp_request;
+ }
+ grpc::Status sync_current_verifier_status;
+ bool is_done = self->Verify(
+ cpp_request,
+ [self, request](grpc::Status status) {
+ grpc_tls_on_custom_verification_check_done_cb callback = nullptr;
+ void* callback_arg = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ callback = it->second.callback;
+ callback_arg = it->second.callback_arg;
+ self->request_map_.erase(it);
+ }
+ }
+ if (callback != nullptr) {
+ callback(request, callback_arg,
+ static_cast<grpc_status_code>(status.error_code()),
+ status.error_message().c_str());
+ }
+ },
+ &sync_current_verifier_status);
+ if (is_done) {
+ if (!sync_current_verifier_status.ok()) {
+ *sync_status = static_cast<grpc_status_code>(
+ sync_current_verifier_status.error_code());
+ *sync_error_details =
+ gpr_strdup(sync_current_verifier_status.error_message().c_str());
+ }
+ internal::MutexLock lock(&self->mu_);
+ self->request_map_.erase(request);
+ }
+ return is_done;
+}
+
+void ExternalCertificateVerifier::CancelInCoreExternalVerifier(
+ void* user_data, grpc_tls_custom_verification_check_request* request) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ TlsCustomVerificationCheckRequest* cpp_request = nullptr;
+ {
+ internal::MutexLock lock(&self->mu_);
+ auto it = self->request_map_.find(request);
+ if (it != self->request_map_.end()) {
+ cpp_request = &it->second.cpp_request;
+ }
+ }
+ if (cpp_request != nullptr) {
+ self->Cancel(cpp_request);
+ }
+}
+
+void ExternalCertificateVerifier::DestructInCoreExternalVerifier(
+ void* user_data) {
+ auto* self = static_cast<ExternalCertificateVerifier*>(user_data);
+ delete self;
+}
+
+HostNameCertificateVerifier::HostNameCertificateVerifier()
+ : CertificateVerifier(grpc_tls_certificate_verifier_host_name_create()) {}
+
+} // namespace experimental
+} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc b/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
index d612bd062eb..e669f600b5e 100644
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
+++ b/contrib/libs/grpc/src/cpp/common/tls_credentials_options.cc
@@ -16,114 +16,15 @@
*
*/
+#include "y_absl/container/inlined_vector.h"
+
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpcpp/security/tls_credentials_options.h>
-#include "y_absl/container/inlined_vector.h"
-#include "src/cpp/common/tls_credentials_options_util.h"
-
namespace grpc {
namespace experimental {
-/** gRPC TLS server authorization check arg API implementation **/
-TlsServerAuthorizationCheckArg::TlsServerAuthorizationCheckArg(
- grpc_tls_server_authorization_check_arg* arg)
- : c_arg_(arg) {
- GPR_ASSERT(c_arg_ != nullptr);
- if (c_arg_->context != nullptr) {
- gpr_log(GPR_ERROR, "c_arg context has already been set");
- }
- c_arg_->context = static_cast<void*>(this);
- c_arg_->destroy_context = &TlsServerAuthorizationCheckArgDestroyContext;
-}
-
-TlsServerAuthorizationCheckArg::~TlsServerAuthorizationCheckArg() {}
-
-void* TlsServerAuthorizationCheckArg::cb_user_data() const {
- return c_arg_->cb_user_data;
-}
-
-int TlsServerAuthorizationCheckArg::success() const { return c_arg_->success; }
-
-TString TlsServerAuthorizationCheckArg::target_name() const {
- TString cpp_target_name(c_arg_->target_name);
- return cpp_target_name;
-}
-
-TString TlsServerAuthorizationCheckArg::peer_cert() const {
- TString cpp_peer_cert(c_arg_->peer_cert);
- return cpp_peer_cert;
-}
-
-TString TlsServerAuthorizationCheckArg::peer_cert_full_chain() const {
- TString cpp_peer_cert_full_chain(c_arg_->peer_cert_full_chain);
- return cpp_peer_cert_full_chain;
-}
-
-grpc_status_code TlsServerAuthorizationCheckArg::status() const {
- return c_arg_->status;
-}
-
-TString TlsServerAuthorizationCheckArg::error_details() const {
- return c_arg_->error_details->error_details();
-}
-
-void TlsServerAuthorizationCheckArg::set_cb_user_data(void* cb_user_data) {
- c_arg_->cb_user_data = cb_user_data;
-}
-
-void TlsServerAuthorizationCheckArg::set_success(int success) {
- c_arg_->success = success;
-}
-
-void TlsServerAuthorizationCheckArg::set_target_name(
- const TString& target_name) {
- c_arg_->target_name = gpr_strdup(target_name.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::set_peer_cert(
- const TString& peer_cert) {
- c_arg_->peer_cert = gpr_strdup(peer_cert.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::set_peer_cert_full_chain(
- const TString& peer_cert_full_chain) {
- c_arg_->peer_cert_full_chain = gpr_strdup(peer_cert_full_chain.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::set_status(grpc_status_code status) {
- c_arg_->status = status;
-}
-
-void TlsServerAuthorizationCheckArg::set_error_details(
- const TString& error_details) {
- c_arg_->error_details->set_error_details(error_details.c_str());
-}
-
-void TlsServerAuthorizationCheckArg::OnServerAuthorizationCheckDoneCallback() {
- if (c_arg_->cb == nullptr) {
- gpr_log(GPR_ERROR, "server authorizaton check arg callback API is nullptr");
- return;
- }
- c_arg_->cb(c_arg_);
-}
-
-TlsServerAuthorizationCheckConfig::TlsServerAuthorizationCheckConfig(
- std::shared_ptr<TlsServerAuthorizationCheckInterface>
- server_authorization_check_interface)
- : server_authorization_check_interface_(
- std::move(server_authorization_check_interface)) {
- c_config_ = grpc_tls_server_authorization_check_config_create(
- nullptr, &TlsServerAuthorizationCheckConfigCSchedule,
- &TlsServerAuthorizationCheckConfigCCancel, nullptr);
- c_config_->set_context(static_cast<void*>(this));
-}
-
-TlsServerAuthorizationCheckConfig::~TlsServerAuthorizationCheckConfig() {
- grpc_tls_server_authorization_check_config_release(c_config_);
-}
-
TlsCredentialsOptions::TlsCredentialsOptions() {
c_credentials_options_ = grpc_tls_credentials_options_create();
}
@@ -158,22 +59,27 @@ void TlsCredentialsOptions::set_identity_cert_name(
c_credentials_options_, identity_cert_name.c_str());
}
-void TlsChannelCredentialsOptions::set_server_verification_option(
- grpc_tls_server_verification_option server_verification_option) {
+void TlsCredentialsOptions::set_certificate_verifier(
+ std::shared_ptr<CertificateVerifier> certificate_verifier) {
+ certificate_verifier_ = std::move(certificate_verifier);
+ if (certificate_verifier_ != nullptr) {
+ grpc_tls_credentials_options_set_certificate_verifier(
+ c_credentials_options_, certificate_verifier_->c_verifier());
+ }
+}
+
+void TlsCredentialsOptions::set_check_call_host(bool check_call_host) {
grpc_tls_credentials_options* options = c_credentials_options();
GPR_ASSERT(options != nullptr);
- grpc_tls_credentials_options_set_server_verification_option(
- options, server_verification_option);
+ grpc_tls_credentials_options_set_check_call_host(options, check_call_host);
}
-void TlsChannelCredentialsOptions::set_server_authorization_check_config(
- std::shared_ptr<TlsServerAuthorizationCheckConfig> config) {
+void TlsChannelCredentialsOptions::set_verify_server_certs(
+ bool verify_server_certs) {
grpc_tls_credentials_options* options = c_credentials_options();
GPR_ASSERT(options != nullptr);
- if (config != nullptr) {
- grpc_tls_credentials_options_set_server_authorization_check_config(
- options, config->c_config());
- }
+ grpc_tls_credentials_options_set_verify_server_cert(options,
+ verify_server_certs);
}
void TlsServerCredentialsOptions::set_cert_request_type(
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
deleted file mode 100644
index 920f897bd73..00000000000
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "y_absl/container/inlined_vector.h"
-
-#include <grpcpp/security/tls_credentials_options.h>
-
-#include "src/cpp/common/tls_credentials_options_util.h"
-
-namespace grpc {
-namespace experimental {
-
-/** The C schedule and cancel functions for the server authorization check
- * config. They populate a C server authorization check arg with the result
- * of a C++ server authorization check schedule/cancel API. **/
-int TlsServerAuthorizationCheckConfigCSchedule(
- void* /*config_user_data*/, grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr || arg->config == nullptr ||
- arg->config->context() == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg was not properly initialized");
- return 1;
- }
- TlsServerAuthorizationCheckConfig* cpp_config =
- static_cast<TlsServerAuthorizationCheckConfig*>(arg->config->context());
- TlsServerAuthorizationCheckArg* cpp_arg =
- new TlsServerAuthorizationCheckArg(arg);
- int schedule_result = cpp_config->Schedule(cpp_arg);
- return schedule_result;
-}
-
-void TlsServerAuthorizationCheckConfigCCancel(
- void* /*config_user_data*/, grpc_tls_server_authorization_check_arg* arg) {
- if (arg == nullptr || arg->config == nullptr ||
- arg->config->context() == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg was not properly initialized");
- return;
- }
- if (arg->context == nullptr) {
- gpr_log(GPR_ERROR,
- "server authorization check arg schedule has already completed");
- return;
- }
- TlsServerAuthorizationCheckConfig* cpp_config =
- static_cast<TlsServerAuthorizationCheckConfig*>(arg->config->context());
- TlsServerAuthorizationCheckArg* cpp_arg =
- static_cast<TlsServerAuthorizationCheckArg*>(arg->context);
- cpp_config->Cancel(cpp_arg);
-}
-
-void TlsServerAuthorizationCheckArgDestroyContext(void* context) {
- if (context != nullptr) {
- TlsServerAuthorizationCheckArg* cpp_arg =
- static_cast<TlsServerAuthorizationCheckArg*>(context);
- delete cpp_arg;
- }
-}
-
-} // namespace experimental
-} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h b/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h
deleted file mode 100644
index d6247219fb7..00000000000
--- a/contrib/libs/grpc/src/cpp/common/tls_credentials_options_util.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2019 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
-#define GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
-
-#include <grpc/grpc_security.h>
-#include <grpcpp/security/tls_credentials_options.h>
-
-#include "src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h"
-
-namespace grpc {
-namespace experimental {
-
-/** The following 2 functions convert the user-provided schedule or cancel
- * functions into C style schedule or cancel functions. These are internal
- * functions, not meant to be accessed by the user. **/
-int TlsServerAuthorizationCheckConfigCSchedule(
- void* config_user_data, grpc_tls_server_authorization_check_arg* arg);
-
-void TlsServerAuthorizationCheckConfigCCancel(
- void* config_user_data, grpc_tls_server_authorization_check_arg* arg);
-
-void TlsServerAuthorizationCheckArgDestroyContext(void* context);
-
-} // namespace experimental
-} // namespace grpc
-
-#endif // GRPC_INTERNAL_CPP_COMMON_TLS_CREDENTIALS_OPTIONS_UTIL_H
diff --git a/contrib/libs/grpc/src/cpp/common/validate_service_config.cc b/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
index f63cfbc68c9..fa0c3937924 100644
--- a/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
+++ b/contrib/libs/grpc/src/cpp/common/validate_service_config.cc
@@ -19,18 +19,18 @@
#include <grpc/grpc.h>
#include <grpcpp/support/validate_service_config.h>
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
namespace grpc {
namespace experimental {
TString ValidateServiceConfigJSON(const TString& service_config_json) {
grpc_init();
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::ServiceConfig::Create(/*args=*/nullptr,
service_config_json.c_str(), &error);
TString return_value;
if (error != GRPC_ERROR_NONE) {
- return_value = grpc_error_string(error);
+ return_value = grpc_error_std_string(error);
GRPC_ERROR_UNREF(error);
}
grpc_shutdown();
diff --git a/contrib/libs/grpc/src/cpp/common/version_cc.cc b/contrib/libs/grpc/src/cpp/common/version_cc.cc
index cb9895b58f8..8054bda78bc 100644
--- a/contrib/libs/grpc/src/cpp/common/version_cc.cc
+++ b/contrib/libs/grpc/src/cpp/common/version_cc.cc
@@ -22,5 +22,5 @@
#include <grpcpp/grpcpp.h>
namespace grpc {
-TString Version() { return "1.37.1"; }
+TString Version() { return "1.43.2"; }
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
index 2a610ff8a92..6c13a0c9cfc 100644
--- a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
+++ b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.cc
@@ -16,13 +16,13 @@
*
*/
+#include "src/cpp/ext/proto_server_reflection.h"
+
#include <unordered_set>
#include <vector>
#include <grpcpp/grpcpp.h>
-#include "src/cpp/ext/proto_server_reflection.h"
-
using grpc::Status;
using grpc::StatusCode;
using grpc::reflection::v1alpha::ErrorResponse;
diff --git a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
index 2d17eed95a8..86982f3ffa2 100644
--- a/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
+++ b/contrib/libs/grpc/src/cpp/ext/proto_server_reflection.h
@@ -23,6 +23,7 @@
#include <vector>
#include <grpcpp/grpcpp.h>
+
#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/async_generic_service.cc b/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
index 07697a52d1f..fdb3da830c5 100644
--- a/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/async_generic_service.cc
@@ -17,7 +17,6 @@
*/
#include <grpcpp/generic/async_generic_service.h>
-
#include <grpcpp/server.h>
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.h b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.h
index b4a66ba1c66..824f0a9fe17 100644
--- a/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.h
+++ b/contrib/libs/grpc/src/cpp/server/channelz/channelz_service.h
@@ -22,6 +22,7 @@
#include <grpc/support/port_platform.h>
#include <grpcpp/grpcpp.h>
+
#include "src/proto/grpc/channelz/channelz.grpc.pb.h"
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
index f39270924b0..52341c1612d 100644
--- a/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
+++ b/contrib/libs/grpc/src/cpp/server/health/default_health_check_service.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/cpp/server/health/default_health_check_service.h"
+
#include <memory>
#include "y_absl/memory/memory.h"
@@ -26,9 +28,7 @@
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/method_handler.h>
-#include "src/cpp/server/health/default_health_check_service.h"
#include "src/proto/grpc/health/v1/health.upb.h"
-#include "upb/upb.hpp"
#define MAX_SERVICE_NAME_LENGTH 200
@@ -202,28 +202,16 @@ void DefaultHealthCheckService::HealthCheckServiceImpl::Serve(void* arg) {
bool DefaultHealthCheckService::HealthCheckServiceImpl::DecodeRequest(
const ByteBuffer& request, TString* service_name) {
- std::vector<Slice> slices;
- if (!request.Dump(&slices).ok()) return false;
+ Slice slice;
+ if (!request.DumpToSingleSlice(&slice).ok()) return false;
uint8_t* request_bytes = nullptr;
size_t request_size = 0;
- if (slices.size() == 1) {
- request_bytes = const_cast<uint8_t*>(slices[0].begin());
- request_size = slices[0].size();
- } else if (slices.size() > 1) {
- request_bytes = static_cast<uint8_t*>(gpr_malloc(request.Length()));
- uint8_t* copy_to = request_bytes;
- for (size_t i = 0; i < slices.size(); i++) {
- memcpy(copy_to, slices[i].begin(), slices[i].size());
- copy_to += slices[i].size();
- }
- }
+ request_bytes = const_cast<uint8_t*>(slice.begin());
+ request_size = slice.size();
upb::Arena arena;
grpc_health_v1_HealthCheckRequest* request_struct =
grpc_health_v1_HealthCheckRequest_parse(
reinterpret_cast<char*>(request_bytes), request_size, arena.ptr());
- if (slices.size() > 1) {
- gpr_free(request_bytes);
- }
if (request_struct == nullptr) {
return false;
}
diff --git a/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc b/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
index 4eb492e0732..133647a5ed1 100644
--- a/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/insecure_server_credentials.cc
@@ -16,10 +16,9 @@
*
*/
-#include <grpcpp/security/server_credentials.h>
-
#include <grpc/grpc.h>
#include <grpc/support/log.h>
+#include <grpcpp/security/server_credentials.h>
namespace grpc {
namespace {
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
index 561d4f50482..f778b137855 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_linux.cc
@@ -20,6 +20,8 @@
#ifdef GPR_LINUX
+#include <inttypes.h>
+
#include <cstdio>
#include "src/cpp/server/load_reporter/get_cpu_stats.h"
@@ -32,7 +34,8 @@ std::pair<uint64_t, uint64_t> GetCpuStatsImpl() {
FILE* fp;
fp = fopen("/proc/stat", "r");
uint64_t user, nice, system, idle;
- if (fscanf(fp, "cpu %lu %lu %lu %lu", &user, &nice, &system, &idle) != 4) {
+ if (fscanf(fp, "cpu %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64, &user,
+ &nice, &system, &idle) != 4) {
// Something bad happened with the information, so assume it's all invalid
user = nice = system = idle = 0;
}
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
index 0a98e848a2c..c03daddb35b 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/get_cpu_stats_windows.cc
@@ -21,6 +21,7 @@
#ifdef GPR_WINDOWS
#include <windows.h>
+
#include <cstdint>
#include "src/cpp/server/load_reporter/get_cpu_stats.h"
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
index 16542bfddf6..78e6c328644 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/load_data_store.cc
@@ -18,14 +18,16 @@
#include <grpc/impl/codegen/port_platform.h>
+#include "src/cpp/server/load_reporter/load_data_store.h"
+
#include <stdio.h>
+
#include <cstdlib>
#include <set>
#include <unordered_map>
#include <vector>
#include "src/core/lib/iomgr/socket_utils.h"
-#include "src/cpp/server/load_reporter/load_data_store.h"
namespace grpc {
namespace load_reporter {
diff --git a/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc b/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
index 24ad9f3f248..4b4e778a62e 100644
--- a/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
+++ b/contrib/libs/grpc/src/cpp/server/load_reporter/util.cc
@@ -18,11 +18,10 @@
#include <grpc/impl/codegen/port_platform.h>
-#include <grpcpp/ext/server_load_reporting.h>
-
#include <cmath>
#include <grpc/support/log.h>
+#include <grpcpp/ext/server_load_reporting.h>
namespace grpc {
namespace load_reporter {
diff --git a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
index b6ea87f4fe1..819a12e294c 100644
--- a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.cc
@@ -16,6 +16,8 @@
*
*/
+#include "src/cpp/server/secure_server_credentials.h"
+
#include <functional>
#include <map>
#include <memory>
@@ -25,7 +27,6 @@
#include <grpcpp/security/auth_metadata_processor.h>
#include "src/cpp/common/secure_auth_context.h"
-#include "src/cpp/server/secure_server_credentials.h"
namespace grpc {
@@ -74,7 +75,6 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
grpc_metadata md_entry;
md_entry.key = SliceReferencingString(consumed.first);
md_entry.value = SliceReferencingString(consumed.second);
- md_entry.flags = 0;
consumed_md.push_back(md_entry);
}
std::vector<grpc_metadata> response_md;
@@ -82,7 +82,6 @@ void AuthMetadataProcessorAyncWrapper::InvokeProcessor(
grpc_metadata md_entry;
md_entry.key = SliceReferencingString(response.first);
md_entry.value = SliceReferencingString(response.second);
- md_entry.flags = 0;
response_md.push_back(md_entry);
}
auto consumed_md_data = consumed_md.empty() ? nullptr : &consumed_md[0];
diff --git a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
index f2b65c28646..95b4cab9587 100644
--- a/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
+++ b/contrib/libs/grpc/src/cpp/server/secure_server_credentials.h
@@ -21,11 +21,10 @@
#include <memory>
+#include <grpc/grpc_security.h>
#include <grpcpp/security/server_credentials.h>
#include <grpcpp/security/tls_credentials_options.h>
-#include <grpc/grpc_security.h>
-
#include "src/cpp/server/thread_pool_interface.h"
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/server_builder.cc b/contrib/libs/grpc/src/cpp/server/server_builder.cc
index 502d4f20ae6..abe95fd8343 100644
--- a/contrib/libs/grpc/src/cpp/server/server_builder.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_builder.cc
@@ -16,15 +16,14 @@
*
*/
-#include <grpcpp/server_builder.h>
+#include <utility>
#include <grpc/support/cpu.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/resource_quota.h>
#include <grpcpp/server.h>
-
-#include <utility>
+#include <grpcpp/server_builder.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/string.h"
@@ -102,38 +101,23 @@ ServerBuilder& ServerBuilder::RegisterAsyncGenericService(
return *this;
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
ServerBuilder& ServerBuilder::RegisterCallbackGenericService(
CallbackGenericService* service) {
if (generic_service_ || callback_generic_service_) {
gpr_log(GPR_ERROR,
"Adding multiple generic services is unsupported for now. "
"Dropping the service %p",
- (void*)service);
+ service);
} else {
callback_generic_service_ = service;
}
return *this;
}
-#else
-ServerBuilder& ServerBuilder::experimental_type::RegisterCallbackGenericService(
- experimental::CallbackGenericService* service) {
- if (builder_->generic_service_ || builder_->callback_generic_service_) {
- gpr_log(GPR_ERROR,
- "Adding multiple generic services is unsupported for now. "
- "Dropping the service %p",
- service);
- } else {
- builder_->callback_generic_service_ = service;
- }
- return *builder_;
-}
-#endif
-ServerBuilder& ServerBuilder::experimental_type::SetContextAllocator(
+ServerBuilder& ServerBuilder::SetContextAllocator(
std::unique_ptr<grpc::ContextAllocator> context_allocator) {
- builder_->context_allocator_ = std::move(context_allocator);
- return *builder_;
+ context_allocator_ = std::move(context_allocator);
+ return *this;
}
std::unique_ptr<grpc::experimental::ExternalConnectionAcceptor>
@@ -149,6 +133,12 @@ ServerBuilder::experimental_type::AddExternalConnectionAcceptor(
return builder_->acceptors_.back()->GetAcceptor();
}
+void ServerBuilder::experimental_type::SetAuthorizationPolicyProvider(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider) {
+ builder_->authorization_provider_ = std::move(provider);
+}
+
ServerBuilder& ServerBuilder::SetOption(
std::unique_ptr<ServerBuilderOption> option) {
options_.push_back(std::move(option));
@@ -177,9 +167,9 @@ ServerBuilder& ServerBuilder::SetSyncServerOption(
ServerBuilder& ServerBuilder::SetCompressionAlgorithmSupportStatus(
grpc_compression_algorithm algorithm, bool enabled) {
if (enabled) {
- GPR_BITSET(&enabled_compression_algorithms_bitset_, algorithm);
+ grpc_core::SetBit(&enabled_compression_algorithms_bitset_, algorithm);
} else {
- GPR_BITCLEAR(&enabled_compression_algorithms_bitset_, algorithm);
+ grpc_core::ClearBit(&enabled_compression_algorithms_bitset_, algorithm);
}
return *this;
}
@@ -223,8 +213,8 @@ ServerBuilder& ServerBuilder::AddListeningPort(
return *this;
}
-std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
- grpc::ChannelArguments args;
+ChannelArguments ServerBuilder::BuildChannelArgs() {
+ ChannelArguments args;
if (max_receive_message_size_ >= -1) {
args.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, max_receive_message_size_);
}
@@ -245,16 +235,24 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
args.SetInt(GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM,
maybe_default_compression_algorithm_.algorithm);
}
-
if (resource_quota_ != nullptr) {
args.SetPointerWithVtable(GRPC_ARG_RESOURCE_QUOTA, resource_quota_,
grpc_resource_quota_arg_vtable());
}
-
for (const auto& plugin : plugins_) {
plugin->UpdateServerBuilder(this);
plugin->UpdateChannelArguments(&args);
}
+ if (authorization_provider_ != nullptr) {
+ args.SetPointerWithVtable(GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER,
+ authorization_provider_->c_provider(),
+ grpc_authorization_policy_provider_arg_vtable());
+ }
+ return args;
+}
+
+std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
+ ChannelArguments args = BuildChannelArgs();
// == Determine if the server has any syncrhonous methods ==
bool has_sync_methods = false;
@@ -304,6 +302,10 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
}
}
+ if (callback_generic_service_ != nullptr) {
+ has_frequently_polled_cqs = true;
+ }
+
const bool is_hybrid_server = has_sync_methods && has_frequently_polled_cqs;
if (has_sync_methods) {
@@ -375,12 +377,7 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
return nullptr;
}
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
server->RegisterContextAllocator(std::move(context_allocator_));
-#else
- server->experimental_registration()->RegisterContextAllocator(
- std::move(context_allocator_));
-#endif
for (const auto& value : services_) {
if (!server->RegisterService(value->host.get(), value->service)) {
diff --git a/contrib/libs/grpc/src/cpp/server/server_callback.cc b/contrib/libs/grpc/src/cpp/server/server_callback.cc
index f6b72c0fcce..5b2d328b81b 100644
--- a/contrib/libs/grpc/src/cpp/server/server_callback.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_callback.cc
@@ -37,7 +37,7 @@ void ServerCallbackCall::ScheduleOnDone(bool inline_ondone) {
explicit ClosureWithArg(ServerCallbackCall* call_arg) : call(call_arg) {
GRPC_CLOSURE_INIT(
&closure,
- [](void* void_arg, grpc_error*) {
+ [](void* void_arg, grpc_error_handle) {
ClosureWithArg* arg = static_cast<ClosureWithArg*>(void_arg);
arg->call->CallOnDone();
delete arg;
@@ -66,7 +66,7 @@ void ServerCallbackCall::CallOnCancel(ServerReactor* reactor) {
: call(call_arg), reactor(reactor_arg) {
GRPC_CLOSURE_INIT(
&closure,
- [](void* void_arg, grpc_error*) {
+ [](void* void_arg, grpc_error_handle) {
ClosureWithArg* arg = static_cast<ClosureWithArg*>(void_arg);
arg->reactor->OnCancel();
arg->call->MaybeDone();
diff --git a/contrib/libs/grpc/src/cpp/server/server_cc.cc b/contrib/libs/grpc/src/cpp/server/server_cc.cc
index dab7f488a7d..edb1fe4d1d7 100644
--- a/contrib/libs/grpc/src/cpp/server/server_cc.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_cc.cc
@@ -15,13 +15,13 @@
*
*/
-#include <grpcpp/server.h>
-
#include <cstdlib>
#include <sstream>
#include <type_traits>
#include <utility>
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
@@ -39,11 +39,10 @@
#include <grpcpp/impl/server_initializer.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
#include <grpcpp/server_context.h>
#include <grpcpp/support/time.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/ext/transport/inproc/inproc_transport.h"
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -69,6 +68,15 @@ namespace {
// max-threads set) to the server builder.
#define DEFAULT_MAX_SYNC_SERVER_THREADS INT_MAX
+// Give a useful status error message if the resource is exhausted specifically
+// because the server threadpool is full.
+const char* kServerThreadpoolExhausted = "Server Threadpool Exhausted";
+
+// Although we might like to give a useful status error message on unimplemented
+// RPCs, it's not always possible since that also would need to be added across
+// languages and isn't actually required by the spec.
+const char* kUnknownRpcMethod = "";
+
class DefaultGlobalCallbacks final : public Server::GlobalCallbacks {
public:
~DefaultGlobalCallbacks() override {}
@@ -107,15 +115,6 @@ class UnimplementedAsyncRequestContext {
GenericServerAsyncReaderWriter generic_stream_;
};
-// TODO(vjpai): Just for this file, use some contents of the experimental
-// namespace here to make the code easier to read below. Remove this when
-// de-experimentalized fully.
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-using ::grpc::experimental::CallbackGenericService;
-using ::grpc::experimental::CallbackServerContext;
-using ::grpc::experimental::GenericCallbackServerContext;
-#endif
-
} // namespace
ServerInterface::BaseAsyncRequest::BaseAsyncRequest(
@@ -266,7 +265,7 @@ bool ServerInterface::GenericAsyncRequest::FinalizeResult(void** tag,
}
namespace {
-class ShutdownCallback : public grpc_experimental_completion_queue_functor {
+class ShutdownCallback : public grpc_completion_queue_functor {
public:
ShutdownCallback() {
functor_run = &ShutdownCallback::Run;
@@ -282,7 +281,7 @@ class ShutdownCallback : public grpc_experimental_completion_queue_functor {
// The Run function will get invoked by the completion queue library
// when the shutdown is actually complete
- static void Run(grpc_experimental_completion_queue_functor* cb, int) {
+ static void Run(grpc_completion_queue_functor* cb, int) {
auto* callback = static_cast<ShutdownCallback*>(cb);
delete callback->cq_;
delete callback;
@@ -410,7 +409,9 @@ class Server::SyncRequest final : public grpc::internal::CompletionQueueTag {
: server_->resource_exhausted_handler_.get();
deserialized_request_ = handler->Deserialize(call_, request_payload_,
&request_status_, nullptr);
-
+ if (!request_status_.ok()) {
+ gpr_log(GPR_DEBUG, "Failed to deserialize message.");
+ }
request_payload_ = nullptr;
interceptor_methods_.AddInterceptionHookPoint(
grpc::experimental::InterceptionHookPoints::POST_RECV_MESSAGE);
@@ -576,7 +577,7 @@ class Server::CallbackRequest final
// method_name needs to be specialized between named method and generic
const char* method_name() const;
- class CallbackCallTag : public grpc_experimental_completion_queue_functor {
+ class CallbackCallTag : public grpc_completion_queue_functor {
public:
explicit CallbackCallTag(Server::CallbackRequest<ServerContextType>* req)
: req_(req) {
@@ -599,8 +600,7 @@ class Server::CallbackRequest final
Server::CallbackRequest<ServerContextType>* req_;
grpc::internal::Call* call_;
- static void StaticRun(grpc_experimental_completion_queue_functor* cb,
- int ok) {
+ static void StaticRun(grpc_completion_queue_functor* cb, int ok) {
static_cast<CallbackCallTag*>(cb)->Run(static_cast<bool>(ok));
}
void Run(bool ok) {
@@ -650,6 +650,9 @@ class Server::CallbackRequest final
req_->request_ = req_->method_->handler()->Deserialize(
req_->call_, req_->request_payload_, &req_->request_status_,
&req_->handler_data_);
+ if (!(req_->request_status_.ok())) {
+ gpr_log(GPR_DEBUG, "Failed to deserialize message.");
+ }
req_->request_payload_ = nullptr;
req_->interceptor_methods_.AddInterceptionHookPoint(
grpc::experimental::InterceptionHookPoints::POST_RECV_MESSAGE);
@@ -791,8 +794,8 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
}
void AddSyncMethod(grpc::internal::RpcServiceMethod* method, void* tag) {
- server_->server()->core_server->SetRegisteredMethodAllocator(
- server_cq_->cq(), tag, [this, method] {
+ grpc_core::Server::FromC(server_->server())
+ ->SetRegisteredMethodAllocator(server_cq_->cq(), tag, [this, method] {
grpc_core::Server::RegisteredCallAllocation result;
new SyncRequest(server_, method, &result);
return result;
@@ -804,9 +807,9 @@ class Server::SyncRequestThreadManager : public grpc::ThreadManager {
if (has_sync_method_) {
unknown_method_ = y_absl::make_unique<grpc::internal::RpcServiceMethod>(
"unknown", grpc::internal::RpcMethod::BIDI_STREAMING,
- new grpc::internal::UnknownMethodHandler);
- server_->server()->core_server->SetBatchMethodAllocator(
- server_cq_->cq(), [this] {
+ new grpc::internal::UnknownMethodHandler(kUnknownRpcMethod));
+ grpc_core::Server::FromC(server_->server())
+ ->SetBatchMethodAllocator(server_cq_->cq(), [this] {
grpc_core::Server::BatchCallAllocation result;
new SyncRequest(server_, unknown_method_.get(), &result);
return result;
@@ -932,14 +935,16 @@ Server::~Server() {
for (const auto& value : sync_req_mgrs_) {
value->Shutdown();
}
- if (callback_cq_ != nullptr) {
+ CompletionQueue* callback_cq =
+ callback_cq_.load(std::memory_order_relaxed);
+ if (callback_cq != nullptr) {
if (grpc_iomgr_run_in_background()) {
// gRPC-core provides the backing needed for the preferred CQ type
- callback_cq_->Shutdown();
+ callback_cq->Shutdown();
} else {
- CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq_);
+ CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq);
}
- callback_cq_ = nullptr;
+ callback_cq_.store(nullptr, std::memory_order_release);
}
}
}
@@ -1028,7 +1033,7 @@ bool Server::RegisterService(const TString* addr, grpc::Service* service) {
has_callback_methods_ = true;
grpc::internal::RpcServiceMethod* method_value = method.get();
grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetRegisteredMethodAllocator(
+ grpc_core::Server::FromC(server_)->SetRegisteredMethodAllocator(
cq->cq(), method_registration_tag, [this, cq, method_value] {
grpc_core::Server::RegisteredCallAllocation result;
new CallbackRequest<grpc::CallbackServerContext>(this, method_value,
@@ -1069,7 +1074,8 @@ void Server::RegisterCallbackGenericService(
generic_handler_.reset(service->Handler());
grpc::CompletionQueue* cq = CallbackCQ();
- server_->core_server->SetBatchMethodAllocator(cq->cq(), [this, cq] {
+ grpc_core::Server::FromC(server_)->SetBatchMethodAllocator(cq->cq(), [this,
+ cq] {
grpc_core::Server::BatchCallAllocation result;
new CallbackRequest<grpc::GenericCallbackServerContext>(this, cq, &result);
return result;
@@ -1106,9 +1112,9 @@ void Server::UnrefAndWaitLocked() {
shutdown_done_ = true;
return; // no need to wait on CV since done condition already set
}
- grpc::internal::WaitUntil(
- &shutdown_done_cv_, &mu_,
- [this]() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_) { return shutdown_done_; });
+ while (!shutdown_done_) {
+ shutdown_done_cv_.Wait(&mu_);
+ }
}
void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
@@ -1194,7 +1200,8 @@ void Server::Start(grpc::ServerCompletionQueue** cqs, size_t num_cqs) {
// to deal with the case of thread exhaustion
if (sync_server_cqs_ != nullptr && !sync_server_cqs_->empty()) {
resource_exhausted_handler_ =
- y_absl::make_unique<grpc::internal::ResourceExhaustedHandler>();
+ y_absl::make_unique<grpc::internal::ResourceExhaustedHandler>(
+ kServerThreadpoolExhausted);
}
for (const auto& value : sync_req_mgrs_) {
@@ -1258,14 +1265,15 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
// Shutdown the callback CQ. The CQ is owned by its own shutdown tag, so it
// will delete itself at true shutdown.
- if (callback_cq_ != nullptr) {
+ CompletionQueue* callback_cq = callback_cq_.load(std::memory_order_relaxed);
+ if (callback_cq != nullptr) {
if (grpc_iomgr_run_in_background()) {
// gRPC-core provides the backing needed for the preferred CQ type
- callback_cq_->Shutdown();
+ callback_cq->Shutdown();
} else {
- CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq_);
+ CompletionQueue::ReleaseCallbackAlternativeCQ(callback_cq);
}
- callback_cq_ = nullptr;
+ callback_cq_.store(nullptr, std::memory_order_release);
}
// Drain the shutdown queue (if the previous call to AsyncNext() timed out
@@ -1320,8 +1328,9 @@ bool Server::UnimplementedAsyncRequest::FinalizeResult(void** tag,
Server::UnimplementedAsyncResponse::UnimplementedAsyncResponse(
UnimplementedAsyncRequest* request)
: request_(request) {
- grpc::Status status(grpc::StatusCode::UNIMPLEMENTED, "");
- grpc::internal::UnknownMethodHandler::FillOps(request_->context(), this);
+ grpc::Status status(grpc::StatusCode::UNIMPLEMENTED, kUnknownRpcMethod);
+ grpc::internal::UnknownMethodHandler::FillOps(request_->context(),
+ kUnknownRpcMethod, this);
request_->stream()->call_.PerformOps(this);
}
@@ -1332,25 +1341,33 @@ grpc::ServerInitializer* Server::initializer() {
grpc::CompletionQueue* Server::CallbackCQ() {
// TODO(vjpai): Consider using a single global CQ for the default CQ
// if there is no explicit per-server CQ registered
+ CompletionQueue* callback_cq = callback_cq_.load(std::memory_order_acquire);
+ if (callback_cq != nullptr) {
+ return callback_cq;
+ }
+ // The callback_cq_ wasn't already set, so grab a lock and set it up exactly
+ // once for this server.
grpc::internal::MutexLock l(&mu_);
- if (callback_cq_ != nullptr) {
- return callback_cq_;
+ callback_cq = callback_cq_.load(std::memory_order_relaxed);
+ if (callback_cq != nullptr) {
+ return callback_cq;
}
if (grpc_iomgr_run_in_background()) {
// gRPC-core provides the backing needed for the preferred CQ type
auto* shutdown_callback = new grpc::ShutdownCallback;
- callback_cq_ = new grpc::CompletionQueue(grpc_completion_queue_attributes{
+ callback_cq = new grpc::CompletionQueue(grpc_completion_queue_attributes{
GRPC_CQ_CURRENT_VERSION, GRPC_CQ_CALLBACK, GRPC_CQ_DEFAULT_POLLING,
shutdown_callback});
// Transfer ownership of the new cq to its own shutdown callback
- shutdown_callback->TakeCQ(callback_cq_);
+ shutdown_callback->TakeCQ(callback_cq);
} else {
// Otherwise we need to use the alternative CQ variant
- callback_cq_ = CompletionQueue::CallbackAlternativeCQ();
+ callback_cq = CompletionQueue::CallbackAlternativeCQ();
}
- return callback_cq_;
+ callback_cq_.store(callback_cq, std::memory_order_release);
+ return callback_cq;
}
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/server/server_context.cc b/contrib/libs/grpc/src/cpp/server/server_context.cc
index df82c69ed8e..c8ace3d9142 100644
--- a/contrib/libs/grpc/src/cpp/server/server_context.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_context.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/impl/codegen/server_context.h>
-
#include <algorithm>
+#include <atomic>
#include <utility>
#include <grpc/compression.h>
@@ -28,6 +27,7 @@
#include <grpc/support/log.h>
#include <grpcpp/impl/call.h>
#include <grpcpp/impl/codegen/completion_queue.h>
+#include <grpcpp/impl/codegen/server_context.h>
#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/support/time.h>
@@ -327,14 +327,16 @@ void ServerContextBase::TryCancel() const {
bool ServerContextBase::IsCancelled() const {
if (completion_tag_) {
// When using callback API, this result is always valid.
- return completion_op_->CheckCancelledAsync();
+ return marked_cancelled_.load(std::memory_order_acquire) ||
+ completion_op_->CheckCancelledAsync();
} else if (has_notify_when_done_tag_) {
// When using async API, the result is only valid
// if the tag has already been delivered at the completion queue
return completion_op_ && completion_op_->CheckCancelledAsync();
} else {
// when using sync API, the result is always valid
- return completion_op_ && completion_op_->CheckCancelled(cq_);
+ return marked_cancelled_.load(std::memory_order_acquire) ||
+ (completion_op_ && completion_op_->CheckCancelled(cq_));
}
}
diff --git a/contrib/libs/grpc/src/cpp/server/server_credentials.cc b/contrib/libs/grpc/src/cpp/server/server_credentials.cc
index 36b5a52dc7c..454e8b4e9d6 100644
--- a/contrib/libs/grpc/src/cpp/server/server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_credentials.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/security/server_credentials.h>
-
#include <grpcpp/impl/grpc_library.h>
+#include <grpcpp/security/server_credentials.h>
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/server_posix.cc b/contrib/libs/grpc/src/cpp/server/server_posix.cc
index c3d40d4fa2d..f2452cc3261 100644
--- a/contrib/libs/grpc/src/cpp/server/server_posix.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_posix.cc
@@ -16,9 +16,8 @@
*
*/
-#include <grpcpp/server_posix.h>
-
#include <grpc/grpc_posix.h>
+#include <grpcpp/server_posix.h>
namespace grpc {
diff --git a/contrib/libs/grpc/src/cpp/server/xds_server_credentials.cc b/contrib/libs/grpc/src/cpp/server/xds_server_credentials.cc
index b543f3f172d..f1842389066 100644
--- a/contrib/libs/grpc/src/cpp/server/xds_server_credentials.cc
+++ b/contrib/libs/grpc/src/cpp/server/xds_server_credentials.cc
@@ -19,7 +19,6 @@
#include "src/cpp/server/secure_server_credentials.h"
namespace grpc {
-namespace experimental {
std::shared_ptr<ServerCredentials> XdsServerCredentials(
const std::shared_ptr<ServerCredentials>& fallback_credentials) {
@@ -37,5 +36,12 @@ std::shared_ptr<ServerCredentials> XdsServerCredentials(
fallback_credentials->AsSecureServerCredentials()->c_creds()));
}
+namespace experimental {
+
+std::shared_ptr<ServerCredentials> XdsServerCredentials(
+ const std::shared_ptr<ServerCredentials>& fallback_credentials) {
+ return grpc::XdsServerCredentials(fallback_credentials);
+}
+
} // namespace experimental
} // namespace grpc
diff --git a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
index 5155f610a8c..25c065588ee 100644
--- a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
+++ b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.cc
@@ -21,6 +21,7 @@
#include <climits>
#include <grpc/support/log.h>
+
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/exec_ctx.h"
@@ -49,17 +50,16 @@ ThreadManager::WorkerThread::~WorkerThread() {
thd_.Join();
}
-ThreadManager::ThreadManager(const char* name,
- grpc_resource_quota* resource_quota,
+ThreadManager::ThreadManager(const char*, grpc_resource_quota* resource_quota,
int min_pollers, int max_pollers)
: shutdown_(false),
+ thread_quota_(
+ grpc_core::ResourceQuota::FromC(resource_quota)->thread_quota()),
num_pollers_(0),
min_pollers_(min_pollers),
max_pollers_(max_pollers == -1 ? INT_MAX : max_pollers),
num_threads_(0),
- max_active_threads_sofar_(0) {
- resource_user_ = grpc_resource_user_create(resource_quota, name);
-}
+ max_active_threads_sofar_(0) {}
ThreadManager::~ThreadManager() {
{
@@ -67,8 +67,6 @@ ThreadManager::~ThreadManager() {
GPR_ASSERT(num_threads_ == 0);
}
- grpc_core::ExecCtx exec_ctx; // grpc_resource_user_unref needs an exec_ctx
- grpc_resource_user_unref(resource_user_);
CleanupCompletedThreads();
}
@@ -109,7 +107,7 @@ void ThreadManager::MarkAsCompleted(WorkerThread* thd) {
}
// Give a thread back to the resource quota
- grpc_resource_user_free_threads(resource_user_, 1);
+ thread_quota_->Release(1);
}
void ThreadManager::CleanupCompletedThreads() {
@@ -124,7 +122,7 @@ void ThreadManager::CleanupCompletedThreads() {
}
void ThreadManager::Initialize() {
- if (!grpc_resource_user_allocate_threads(resource_user_, min_pollers_)) {
+ if (!thread_quota_->Reserve(min_pollers_)) {
gpr_log(GPR_ERROR,
"No thread quota available to even create the minimum required "
"polling threads (i.e %d). Unable to start the thread manager",
@@ -171,7 +169,7 @@ void ThreadManager::MainWorkLoop() {
// quota available to create a new thread, start a new poller thread
bool resource_exhausted = false;
if (!shutdown_ && num_pollers_ < min_pollers_) {
- if (grpc_resource_user_allocate_threads(resource_user_, 1)) {
+ if (thread_quota_->Reserve(1)) {
// We can allocate a new poller thread
num_pollers_++;
num_threads_++;
diff --git a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.h b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.h
index aae24177873..4c49854d32e 100644
--- a/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.h
+++ b/contrib/libs/grpc/src/cpp/thread_manager/thread_manager.h
@@ -22,11 +22,12 @@
#include <list>
#include <memory>
+#include <grpc/grpc.h>
#include <grpcpp/support/config.h>
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
-#include "src/core/lib/iomgr/resource_quota.h"
+#include "src/core/lib/resource_quota/api.h"
namespace grpc {
@@ -154,7 +155,7 @@ class ThreadManager {
// object (that contains the actual max thread quota) and a grpc_resource_user
// object through which quota is requested whenever new threads need to be
// created
- grpc_resource_user* resource_user_;
+ grpc_core::ThreadQuotaPtr thread_quota_;
// Number of threads doing polling
int num_pollers_;
diff --git a/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc b/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc
index fb705906455..5c6f22bd7c6 100644
--- a/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc
+++ b/contrib/libs/grpc/src/cpp/util/byte_buffer_cc.cc
@@ -25,6 +25,37 @@ namespace grpc {
static internal::GrpcLibraryInitializer g_gli_initializer;
+Status ByteBuffer::TrySingleSlice(Slice* slice) const {
+ if (!buffer_) {
+ return Status(StatusCode::FAILED_PRECONDITION, "Buffer not initialized");
+ }
+ if ((buffer_->type == GRPC_BB_RAW) &&
+ (buffer_->data.raw.compression == GRPC_COMPRESS_NONE) &&
+ (buffer_->data.raw.slice_buffer.count == 1)) {
+ grpc_slice internal_slice = buffer_->data.raw.slice_buffer.slices[0];
+ *slice = Slice(internal_slice, Slice::ADD_REF);
+ return Status::OK;
+ } else {
+ return Status(StatusCode::FAILED_PRECONDITION,
+ "Buffer isn't made up of a single uncompressed slice.");
+ }
+}
+
+Status ByteBuffer::DumpToSingleSlice(Slice* slice) const {
+ if (!buffer_) {
+ return Status(StatusCode::FAILED_PRECONDITION, "Buffer not initialized");
+ }
+ grpc_byte_buffer_reader reader;
+ if (!grpc_byte_buffer_reader_init(&reader, buffer_)) {
+ return Status(StatusCode::INTERNAL,
+ "Couldn't initialize byte buffer reader");
+ }
+ grpc_slice s = grpc_byte_buffer_reader_readall(&reader);
+ *slice = Slice(s, Slice::STEAL_REF);
+ grpc_byte_buffer_reader_destroy(&reader);
+ return Status::OK;
+}
+
Status ByteBuffer::Dump(std::vector<Slice>* slices) const {
slices->clear();
if (!buffer_) {
diff --git a/contrib/libs/grpc/src/proto/grpc/auth/v1/authz_policy.proto b/contrib/libs/grpc/src/proto/grpc/auth/v1/authz_policy.proto
deleted file mode 100644
index 347386f3e66..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/auth/v1/authz_policy.proto
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2021 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package grpc.auth.v1;
-
-// Peer specifies attributes of a peer. Fields in the Peer are ANDed together, once
-// we support multiple fields in the future.
-message Peer {
- // Optional. A list of peer identities to match for authorization. The principals
- // are one of, i.e., it matches if one of the principals matches. The field
- // supports Exact, Prefix, Suffix, and Presence matches.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string principals = 1;
-}
-
-// Specification of HTTP header match attributes.
-message Header {
- // Required. The name of the HTTP header to match. The following headers are *not*
- // supported: "hop-by-hop" headers (e.g., those listed in "Connection" header),
- // HTTP/2 pseudo headers (":"-prefixed), the "Host" header, and headers prefixed
- // with "grpc-".
- string key = 1;
-
- // Required. A list of header values to match. The header values are ORed together,
- // i.e., it matches if one of the values matches. This field supports Exact,
- // Prefix, Suffix, and Presence match. Multi-valued headers are considered a single
- // value with commas added between values.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string values = 2;
-}
-
-// Request specifies attributes of a request. Fields in the Request are ANDed
-// together.
-message Request {
- // Optional. A list of paths to match for authorization. This is the fully
- // qualified name in the form of "/package.service/method". The paths are ORed
- // together, i.e., it matches if one of the paths matches. This field supports
- // Exact, Prefix, Suffix, and Presence matches.
- // - Exact match: "abc" will match on value "abc".
- // - Prefix match: "abc*" will match on value "abc" and "abcd".
- // - Suffix match: "*abc" will match on value "abc" and "xabc".
- // - Presence match: "*" will match when the value is not empty.
- repeated string paths = 1;
-
- // Optional. A list of HTTP header key/value pairs to match against, for
- // potentially advanced use cases. The headers are ANDed together, i.e., it matches
- // only if *all* the headers match.
- repeated Header headers = 3;
-}
-
-// Specification of rules.
-message Rule {
- // Required. The name of an authorization rule.
- // It is mainly for monitoring and error message generation.
- string name = 1;
-
- // Optional. If not set, no checks will be performed against the source. An empty
- // rule is always matched (i.e., both source and request are empty).
- Peer source = 2;
-
- // Optional. If not set, no checks will be performed against the request. An empty
- // rule is always matched (i.e., both source and request are empty).
- Request request = 3;
-}
-
-// AuthorizationPolicy defines which principals are permitted to access which
-// resource. Resources are RPC methods scoped by services.
-//
-// In the following yaml policy example, a peer identity from ["admin1", "admin2", "admin3"]
-// is authorized to access any RPC methods in pkg.service, and peer identity "dev" is
-// authorized to access the "foo" and "bar" RPC methods.
-//
-// name: example-policy
-// allow_rules:
-// - name: admin-access
-// source:
-// principals:
-// - "spiffe://foo.com/sa/admin1"
-// - "spiffe://foo.com/sa/admin2"
-// - "spiffe://foo.com/sa/admin3"
-// request:
-// paths: ["/pkg.service/*"]
-// - name: dev-access
-// source:
-// principals: ["spiffe://foo.com/sa/dev"]
-// request:
-// paths: ["/pkg.service/foo", "/pkg.service/bar"]
-
-message AuthorizationPolicy {
- // Required. The name of an authorization policy.
- // It is mainly for monitoring and error message generation.
- string name = 1;
-
- // Optional. List of deny rules to match. If a request matches any of the deny
- // rules, then it will be denied. If none of the deny rules matches or there are
- // no deny rules, the allow rules will be evaluated.
- repeated Rule deny_rules = 2;
-
- // Required. List of allow rules to match. The allow rules will only be evaluated
- // after the deny rules. If a request matches any of the allow rules, then it will
- // allowed. If none of the allow rules matches, it will be denied.
- repeated Rule allow_rules = 3;
-}
diff --git a/contrib/libs/grpc/src/proto/grpc/binary_log/v1alpha/log.proto b/contrib/libs/grpc/src/proto/grpc/binary_log/v1alpha/log.proto
deleted file mode 100644
index 77100ebbef9..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/binary_log/v1alpha/log.proto
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2016 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-import "google/protobuf/timestamp.proto";
-
-package grpc.binary_log.v1alpha;
-
-enum Direction {
- SERVER_SEND = 0;
- SERVER_RECV = 1;
- CLIENT_SEND = 2;
- CLIENT_RECV = 3;
-}
-
-message KeyValuePair {
- string key = 1;
- string value = 2;
-}
-
-// Any sort of metadata that may be sent in either direction during a call
-message Metadata {
- // Cryptographically unique identifier, generated on the client and sent
- // to the server.
- uint64 rpc_id = 1;
- // Timestamp of logging the metadata
- google.protobuf.Timestamp timestamp = 2;
- Direction direction = 3;
- // The actual metadata that is being sent
- repeated KeyValuePair metadata = 4;
-
- // Initial metadata sent by the client to initiate a request
- message ClientInitialMetadata {
- // The full method name that is being called
- string method_name = 1;
- // The call's deadline
- google.protobuf.Timestamp deadline = 2;
- // The address of the connected peer
- string peer = 3;
- }
-
- // Arbitrary key/value pairs specified by the user that are not sent over
- // the network but are nonetheless useful to log
- message UserData {
- }
-
- // Initial metadata response sent by the server after accepting the request
- message ServerInitialMetadata {
- }
-
- // Status sent by the server when closing the call on the server side
- message ServerStatus {
- // The status code
- uint32 code = 1;
- // The status details
- string details = 2;
- }
-
- oneof kind {
- ClientInitialMetadata client_initial_metadata = 5;
- UserData user_data = 6;
- ServerInitialMetadata server_initial_metadata = 7;
- ServerStatus server_status = 8;
- }
-}
-
-// A message that is sent during a call
-message Message {
- // Cryptographically unique identifier, generated on the client and sent
- // to the server.
- uint64 rpc_id = 1;
- // The sequence number of the message. Messages sent by the client and by the
- // server should have independently incrementing sequence numbers.
- uint32 sequence_number = 2;
- Direction direction = 3;
- // The length of the complete message.
- uint32 length = 4;
- // The contents of the message. May be a prefix instead of the complete
- // message.
- bytes data = 5;
-}
diff --git a/contrib/libs/grpc/src/proto/grpc/health/v1/health.options b/contrib/libs/grpc/src/proto/grpc/health/v1/health.options
deleted file mode 100644
index 240b498b580..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/health/v1/health.options
+++ /dev/null
@@ -1 +0,0 @@
-grpc.health.v1.HealthCheckRequest.service max_size:200
diff --git a/contrib/libs/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto b/contrib/libs/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto
deleted file mode 100644
index ccfa951cd4a..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/http_over_grpc/http_over_grpc.proto
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2019 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package grpc.http_over_grpc;
-
-// Represents HTTP 1.1 header.
-message Header {
- string key = 1;
- repeated string values = 2;
-}
-
-// An HTTP 1.1 request encapsulated in a gRPC.
-message HTTPOverGRPCRequest {
- // The HTTP request method.
- string method = 1;
- // The HTTP request URL.
- string url = 2;
- // The HTTP request headers.
- repeated Header headers = 3;
- // HTTP request body.
- bytes body = 4;
-}
-
-// An HTTP 1.1 reply encapsulated in an RPC.
-message HTTPOverGRPCReply {
- // The HTTP status code (e.g. 200, 400, 404).
- int32 status = 1;
- // The HTTP response headers.
- repeated Header headers = 2;
- // The HTTP response body.
- bytes body = 3;
-}
-
-// Currently does not support HTTP chunked transfer encoding.
-service HTTPOverGRPC {
- // Perform the given HTTP request.
- rpc HTTPRequest(HTTPOverGRPCRequest) returns (HTTPOverGRPCReply) {}
-}
diff --git a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.options b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.options
deleted file mode 100644
index 7fbd44b9ded..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.options
+++ /dev/null
@@ -1,5 +0,0 @@
-grpc.lb.v1.InitialLoadBalanceRequest.name max_size:128
-grpc.lb.v1.InitialLoadBalanceResponse.load_balancer_delegate max_size:64
-grpc.lb.v1.Server.ip_address max_size:16
-grpc.lb.v1.Server.load_balance_token max_size:50
-load_balancer.proto no_unions:true
diff --git a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
index ccf2efd629e..00fc7096c9c 100644
--- a/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
+++ b/contrib/libs/grpc/src/proto/grpc/lb/v1/load_balancer.proto
@@ -26,7 +26,7 @@ import "google/protobuf/timestamp.proto";
option go_package = "google.golang.org/grpc/balancer/grpclb/grpc_lb_v1";
option java_multiple_files = true;
option java_outer_classname = "LoadBalancerProto";
-option java_package = "io.grpc.grpclb";
+option java_package = "io.grpc.lb.v1";
service LoadBalancer {
// Bidirectional rpc to get a list of servers.
@@ -97,18 +97,14 @@ message LoadBalanceResponse {
// If this field is set, then the client should eagerly enter fallback
// mode (even if there are existing, healthy connections to backends).
- // See go/grpclb-explicit-fallback for more details.
FallbackResponse fallback_response = 3;
}
}
+message FallbackResponse {}
+
message InitialLoadBalanceResponse {
- // This is an application layer redirect that indicates the client should use
- // the specified server for load balancing. When this field is non-empty in
- // the response, the client should open a separate connection to the
- // load_balancer_delegate and call the BalanceLoad method. Its length should
- // be less than 64 bytes.
- string load_balancer_delegate = 1;
+ reserved 1; // never-used load_balancer_delegate
// This interval defines how often the client should send the client stats
// to the load balancer. Stats should only be reported when the duration is
@@ -153,5 +149,3 @@ message Server {
reserved 5;
}
-
-message FallbackResponse {}
diff --git a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto
new file mode 100644
index 00000000000..7d1735289d5
--- /dev/null
+++ b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls.proto
@@ -0,0 +1,62 @@
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package grpc.lookup.v1;
+
+option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.lookup.v1";
+option java_outer_classname = "RlsProto";
+
+message RouteLookupRequest {
+ // Target type allows the client to specify what kind of target format it
+ // would like from RLS to allow it to find the regional server, e.g. "grpc".
+ string target_type = 3;
+ // Possible reasons for making a request.
+ enum Reason {
+ REASON_UNKNOWN = 0; // Unused
+ REASON_MISS = 1; // No data available in local cache
+ REASON_STALE = 2; // Data in local cache is stale
+ }
+ // Reason for making this request.
+ Reason reason = 5;
+ // For REASON_STALE, the header_data from the stale response, if any.
+ string stale_header_data = 6;
+ // Map of key values extracted via key builders for the gRPC or HTTP request.
+ map<string, string> key_map = 4;
+
+ reserved 1, 2;
+ reserved "server", "path";
+}
+
+message RouteLookupResponse {
+ // Prioritized list (best one first) of addressable entities to use
+ // for routing, using syntax requested by the request target_type.
+ // The targets will be tried in order until a healthy one is found.
+ repeated string targets = 3;
+ // Optional header value to pass along to AFE in the X-Google-RLS-Data header.
+ // Cached with "target" and sent with all requests that match the request key.
+ // Allows the RLS to pass its work product to the eventual target.
+ string header_data = 2;
+
+ reserved 1;
+ reserved "target";
+}
+
+service RouteLookupService {
+ // Lookup returns a target for a single key.
+ rpc RouteLookup(RouteLookupRequest) returns (RouteLookupResponse) {}
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto
new file mode 100644
index 00000000000..9d2b6c54cfb
--- /dev/null
+++ b/contrib/libs/grpc/src/proto/grpc/lookup/v1/rls_config.proto
@@ -0,0 +1,225 @@
+// Copyright 2020 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package grpc.lookup.v1;
+
+import "google/protobuf/duration.proto";
+
+option go_package = "google.golang.org/grpc/lookup/grpc_lookup_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.lookup.v1";
+option java_outer_classname = "RlsConfigProto";
+
+// Extract a key based on a given name (e.g. header name or query parameter
+// name). The name must match one of the names listed in the "name" field. If
+// the "required_match" field is true, one of the specified names must be
+// present for the keybuilder to match.
+message NameMatcher {
+ // The name that will be used in the RLS key_map to refer to this value.
+ // If required_match is true, you may omit this field or set it to an empty
+ // string, in which case the matcher will require a match, but won't update
+ // the key_map.
+ string key = 1;
+
+ // Ordered list of names (headers or query parameter names) that can supply
+ // this value; the first one with a non-empty value is used.
+ repeated string names = 2;
+
+ // If true, make this extraction required; the key builder will not match
+ // if no value is found.
+ bool required_match = 3;
+}
+
+// A GrpcKeyBuilder applies to a given gRPC service, name, and headers.
+message GrpcKeyBuilder {
+ // To match, one of the given Name fields must match; the service and method
+ // fields are specified as fixed strings. The service name is required and
+ // includes the proto package name. The method name may be omitted, in
+ // which case any method on the given service is matched.
+ message Name {
+ string service = 1;
+ string method = 2;
+ }
+ repeated Name names = 1;
+
+ // If you wish to include the host, service, or method names as keys in the
+ // generated RouteLookupRequest, specify key names to use in the extra_keys
+ // submessage. If a key name is empty, no key will be set for that value.
+ // If this submessage is specified, the normal host/path fields will be left
+ // unset in the RouteLookupRequest. We are deprecating host/path in the
+ // RouteLookupRequest, so services should migrate to the ExtraKeys approach.
+ message ExtraKeys {
+ string host = 1;
+ string service = 2;
+ string method = 3;
+ }
+ ExtraKeys extra_keys = 3;
+
+ // Extract keys from all listed headers.
+ // For gRPC, it is an error to specify "required_match" on the NameMatcher
+ // protos.
+ repeated NameMatcher headers = 2;
+
+ // You can optionally set one or more specific key/value pairs to be added to
+ // the key_map. This can be useful to identify which builder built the key,
+ // for example if you are suppressing the actual method, but need to
+ // separately cache and request all the matched methods.
+ map<string, string> constant_keys = 4;
+}
+
+// An HttpKeyBuilder applies to a given HTTP URL and headers.
+//
+// Path and host patterns use the matching syntax from gRPC transcoding to
+// extract named key/value pairs from the path and host components of the URL:
+// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto
+//
+// It is invalid to specify the same key name in multiple places in a pattern.
+//
+// For a service where the project id can be expressed either as a subdomain or
+// in the path, separate HttpKeyBuilders must be used:
+// host_pattern: 'example.com' path_pattern: '/{id}/{object}/**'
+// host_pattern: '{id}.example.com' path_pattern: '/{object}/**'
+// If the host is exactly 'example.com', the first path segment will be used as
+// the id and the second segment as the object. If the host has a subdomain, the
+// subdomain will be used as the id and the first segment as the object. If
+// neither pattern matches, no keys will be extracted.
+message HttpKeyBuilder {
+ // host_pattern is an ordered list of host template patterns for the desired
+ // value. If any host_pattern values are specified, then at least one must
+ // match, and the last one wins and sets any specified variables. A host
+ // consists of labels separated by dots. Each label is matched against the
+ // label in the pattern as follows:
+ // - "*": Matches any single label.
+ // - "**": Matches zero or more labels (first or last part of host only).
+ // - "{<name>=...}": One or more label capture, where "..." can be any
+ // template that does not include a capture.
+ // - "{<name>}": A single label capture. Identical to {<name>=*}.
+ //
+ // Examples:
+ // - "example.com": Only applies to the exact host example.com.
+ // - "*.example.com": Matches subdomains of example.com.
+ // - "**.example.com": matches example.com, and all levels of subdomains.
+ // - "{project}.example.com": Extracts the third level subdomain.
+ // - "{project=**}.example.com": Extracts the third level+ subdomains.
+ // - "{project=**}": Extracts the entire host.
+ repeated string host_patterns = 1;
+
+ // path_pattern is an ordered list of path template patterns for the desired
+ // value. If any path_pattern values are specified, then at least one must
+ // match, and the last one wins and sets any specified variables. A path
+ // consists of segments separated by slashes. Each segment is matched against
+ // the segment in the pattern as follows:
+ // - "*": Matches any single segment.
+ // - "**": Matches zero or more segments (first or last part of path only).
+ // - "{<name>=...}": One or more segment capture, where "..." can be any
+ // template that does not include a capture.
+ // - "{<name>}": A single segment capture. Identical to {<name>=*}.
+ // A custom method may also be specified by appending ":" and the custom
+ // method name or "*" to indicate any custom method (including no custom
+ // method). For example, "/*/projects/{project_id}/**:*" extracts
+ // `{project_id}` for any version, resource and custom method that includes
+ // it. By default, any custom method will be matched.
+ //
+ // Examples:
+ // - "/v1/{name=messages/*}": extracts a name like "messages/12345".
+ // - "/v1/messages/{message_id}": extracts a message_id like "12345".
+ // - "/v1/users/{user_id}/messages/{message_id}": extracts two key values.
+ repeated string path_patterns = 2;
+
+ // List of query parameter names to try to match.
+ // For example: ["parent", "name", "resource.name"]
+ // We extract all the specified query_parameters (case-sensitively). If any
+ // are marked as "required_match" and are not present, this keybuilder fails
+ // to match. If a given parameter appears multiple times (?foo=a&foo=b) we
+ // will report it as a comma-separated string (foo=a,b).
+ repeated NameMatcher query_parameters = 3;
+
+ // List of headers to try to match.
+ // We extract all the specified header values (case-insensitively). If any
+ // are marked as "required_match" and are not present, this keybuilder fails
+ // to match. If a given header appears multiple times in the request we will
+ // report it as a comma-separated string, in standard HTTP fashion.
+ repeated NameMatcher headers = 4;
+
+ // You can optionally set one or more specific key/value pairs to be added to
+ // the key_map. This can be useful to identify which builder built the key,
+ // for example if you are suppressing a lot of information from the URL, but
+ // need to separately cache and request URLs with that content.
+ map<string, string> constant_keys = 5;
+}
+
+message RouteLookupConfig {
+ // Ordered specifications for constructing keys for HTTP requests. Last
+ // match wins. If no HttpKeyBuilder matches, an empty key_map will be sent to
+ // the lookup service; it should likely reply with a global default route
+ // and raise an alert.
+ repeated HttpKeyBuilder http_keybuilders = 1;
+
+ // Unordered specifications for constructing keys for gRPC requests. All
+ // GrpcKeyBuilders on this list must have unique "name" fields so that the
+ // client is free to prebuild a hash map keyed by name. If no GrpcKeyBuilder
+ // matches, an empty key_map will be sent to the lookup service; it should
+ // likely reply with a global default route and raise an alert.
+ repeated GrpcKeyBuilder grpc_keybuilders = 2;
+
+ // The name of the lookup service as a gRPC URI. Typically, this will be
+ // a subdomain of the target, such as "lookup.datastore.googleapis.com".
+ string lookup_service = 3;
+
+ // Configure a timeout value for lookup service requests.
+ // Defaults to 10 seconds if not specified.
+ google.protobuf.Duration lookup_service_timeout = 4;
+
+ // How long are responses valid for (like HTTP Cache-Control).
+ // If omitted or zero, the longest valid cache time is used.
+ // This value is clamped to 5 minutes to avoid unflushable bad responses.
+ google.protobuf.Duration max_age = 5;
+
+ // After a response has been in the client cache for this amount of time
+ // and is re-requested, start an asynchronous RPC to re-validate it.
+ // This value should be less than max_age by at least the length of a
+ // typical RTT to the Route Lookup Service to fully mask the RTT latency.
+ // If omitted, keys are only re-requested after they have expired.
+ google.protobuf.Duration stale_age = 6;
+
+ // Rough indicator of amount of memory to use for the client cache. Some of
+ // the data structure overhead is not accounted for, so actual memory consumed
+ // will be somewhat greater than this value. If this field is omitted or set
+ // to zero, a client default will be used. The value may be capped to a lower
+ // amount based on client configuration.
+ int64 cache_size_bytes = 7;
+
+ // This is a list of all the possible targets that can be returned by the
+ // lookup service. If a target not on this list is returned, it will be
+ // treated the same as an unhealthy target.
+ repeated string valid_targets = 8;
+
+ // This value provides a default target to use if needed. If set, it will be
+ // used if RLS returns an error, times out, or returns an invalid response.
+ // Note that requests can be routed only to a subdomain of the original
+ // target, e.g. "us_east_1.cloudbigtable.googleapis.com".
+ string default_target = 9;
+
+ reserved 10;
+ reserved "request_processing_strategy";
+}
+
+// RouteLookupClusterSpecifier is used in xDS to represent a cluster specifier
+// plugin for RLS.
+message RouteLookupClusterSpecifier {
+ // The RLS config for this cluster specifier plugin instance.
+ RouteLookupConfig route_lookup_config = 1;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto b/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto
new file mode 100644
index 00000000000..1a2ceedc3d2
--- /dev/null
+++ b/contrib/libs/grpc/src/proto/grpc/reflection/v1/reflection.proto
@@ -0,0 +1,147 @@
+// Copyright 2016 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Service exported by server reflection. A more complete description of how
+// server reflection works can be found at
+// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
+//
+// The canonical version of this proto can be found at
+// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
+
+syntax = "proto3";
+
+package grpc.reflection.v1;
+
+option go_package = "google.golang.org/grpc/reflection/grpc_reflection_v1";
+option java_multiple_files = true;
+option java_package = "io.grpc.reflection.v1";
+option java_outer_classname = "ServerReflectionProto";
+
+service ServerReflection {
+ // The reflection service is structured as a bidirectional stream, ensuring
+ // all related requests go to a single server.
+ rpc ServerReflectionInfo(stream ServerReflectionRequest)
+ returns (stream ServerReflectionResponse);
+}
+
+// The message sent by the client when calling ServerReflectionInfo method.
+message ServerReflectionRequest {
+ string host = 1;
+ // To use reflection service, the client should set one of the following
+ // fields in message_request. The server distinguishes requests by their
+ // defined field and then handles them using corresponding methods.
+ oneof message_request {
+ // Find a proto file by the file name.
+ string file_by_filename = 3;
+
+ // Find the proto file that declares the given fully-qualified symbol name.
+ // This field should be a fully-qualified symbol name
+ // (e.g. <package>.<service>[.<method>] or <package>.<type>).
+ string file_containing_symbol = 4;
+
+ // Find the proto file which defines an extension extending the given
+ // message type with the given field number.
+ ExtensionRequest file_containing_extension = 5;
+
+ // Finds the tag numbers used by all known extensions of the given message
+ // type, and appends them to ExtensionNumberResponse in an undefined order.
+ // Its corresponding method is best-effort: it's not guaranteed that the
+ // reflection service will implement this method, and it's not guaranteed
+ // that this method will provide all extensions. Returns
+ // StatusCode::UNIMPLEMENTED if it's not implemented.
+ // This field should be a fully-qualified type name. The format is
+ // <package>.<type>
+ string all_extension_numbers_of_type = 6;
+
+ // List the full names of registered services. The content will not be
+ // checked.
+ string list_services = 7;
+ }
+}
+
+// The type name and extension number sent by the client when requesting
+// file_containing_extension.
+message ExtensionRequest {
+ // Fully-qualified type name. The format should be <package>.<type>
+ string containing_type = 1;
+ int32 extension_number = 2;
+}
+
+// The message sent by the server to answer ServerReflectionInfo method.
+message ServerReflectionResponse {
+ string valid_host = 1;
+ ServerReflectionRequest original_request = 2;
+ // The server sets one of the following fields according to the message_request
+ // in the request.
+ oneof message_response {
+ // This message is used to answer file_by_filename, file_containing_symbol,
+ // file_containing_extension requests with transitive dependencies.
+ // As the repeated label is not allowed in oneof fields, we use a
+ // FileDescriptorResponse message to encapsulate the repeated fields.
+ // The reflection service is allowed to avoid sending FileDescriptorProtos
+ // that were previously sent in response to earlier requests in the stream.
+ FileDescriptorResponse file_descriptor_response = 4;
+
+ // This message is used to answer all_extension_numbers_of_type requests.
+ ExtensionNumberResponse all_extension_numbers_response = 5;
+
+ // This message is used to answer list_services requests.
+ ListServiceResponse list_services_response = 6;
+
+ // This message is used when an error occurs.
+ ErrorResponse error_response = 7;
+ }
+}
+
+// Serialized FileDescriptorProto messages sent by the server answering
+// a file_by_filename, file_containing_symbol, or file_containing_extension
+// request.
+message FileDescriptorResponse {
+ // Serialized FileDescriptorProto messages. We avoid taking a dependency on
+ // descriptor.proto, which uses proto2 only features, by making them opaque
+ // bytes instead.
+ repeated bytes file_descriptor_proto = 1;
+}
+
+// A list of extension numbers sent by the server answering
+// all_extension_numbers_of_type request.
+message ExtensionNumberResponse {
+ // Full name of the base type, including the package name. The format
+ // is <package>.<type>
+ string base_type_name = 1;
+ repeated int32 extension_number = 2;
+}
+
+// A list of ServiceResponse sent by the server answering list_services request.
+message ListServiceResponse {
+ // The information of each service may be expanded in the future, so we use
+ // ServiceResponse message to encapsulate it.
+ repeated ServiceResponse service = 1;
+}
+
+// The information of a single service used by ListServiceResponse to answer
+// list_services request.
+message ServiceResponse {
+ // Full name of a registered service, including its package name. The format
+ // is <package>.<service>
+ string name = 1;
+}
+
+// The error code and error message sent by the server when an error occurs.
+message ErrorResponse {
+ // This field uses the error codes defined in grpc::StatusCode.
+ int32 error_code = 1;
+ string error_message = 2;
+}
+
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/echo.proto b/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
index 33db1118648..ae38aeaf194 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/echo.proto
@@ -33,6 +33,7 @@ service EchoTestService {
rpc ResponseStream(EchoRequest) returns (stream EchoResponse);
rpc BidiStream(stream EchoRequest) returns (stream EchoResponse);
rpc Unimplemented(EchoRequest) returns (EchoResponse);
+ rpc UnimplementedBidi(stream EchoRequest) returns (stream EchoResponse);
}
service EchoTest1Service {
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto
deleted file mode 100644
index 1feaedd6a40..00000000000
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/orca_load_report_for_test.proto
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2019 The gRPC Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file contains a copy of the ORCA load reporting protos, with the
-// validation options stripped out to avoid the extra dependency on
-// protoc-gen-validate.
-//
-// TODO(juanlishen): This file is a hack to avoid a problem we're
-// currently having where we can't depend on a proto file in an external
-// repo due to bazel limitations. Once that's fixed, this should be
-// removed. Until this, it should be used in the gRPC tests only, or else it
-// will cause a conflict due to the same proto messages being defined in
-// multiple files in the same binary.
-
-syntax = "proto3";
-
-package udpa.data.orca.v1;
-
-option java_outer_classname = "OrcaLoadReportProto";
-option java_multiple_files = true;
-option java_package = "io.envoyproxy.udpa.data.orca.v1";
-option go_package = "v1";
-
-// See section `ORCA load report format` of the design document in
-// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
-
-message OrcaLoadReport {
- // CPU utilization expressed as a fraction of available CPU resources. This
- // should be derived from the latest sample or measurement.
- double cpu_utilization = 1;
-
- // Memory utilization expressed as a fraction of available memory
- // resources. This should be derived from the latest sample or measurement.
- double mem_utilization = 2;
-
- // Total RPS being served by an endpoint. This should cover all services that an endpoint is
- // responsible for.
- uint64 rps = 3;
-
- // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
- // storage) associated with the request.
- map<string, double> request_cost = 4;
-
- // Resource utilization values. Each value is expressed as a fraction of total resources
- // available, derived from the latest sample or measurement.
- map<string, double> utilization = 5;
-}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
index 38592ccfda9..47efbed8e06 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/address.proto
@@ -40,6 +40,13 @@ message SocketAddress {
oneof port_specifier {
uint32 port_value = 3;
}
+
+ // The name of the custom resolver. This must have been registered with Envoy. If
+ // this is empty, a context dependent default applies. If the address is a concrete
+ // IP address, no resolution will occur. If address is a hostname this
+ // should be set for resolution other than DNS. Specifying a custom resolver with
+ // *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime.
+ string resolver_name = 5;
}
// Addresses specify either a logical or physical address and port, which are
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
index d576c1ddc57..4688aeedb29 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/ads.proto
@@ -40,6 +40,6 @@ service AggregatedDiscoveryService {
}
// [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing
-// services: https://github.com/google/protobuf/issues/4221
+// services: https://github.com/protocolbuffers/protobuf/issues/4221
message AdsPhony {
}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
index b5acb0945b7..33719f687c5 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/base.proto
@@ -96,6 +96,9 @@ message Node {
repeated string client_features = 10;
}
+// Data source consisting of either a file or an inline value.
+message DataSource {}
+
// Runtime derived FractionalPercent with defaults for when the numerator or denominator is not
// specified via a runtime key.
//
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
index c04fe20a919..1bc2d51b507 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/cluster.proto
@@ -20,6 +20,7 @@ package envoy.config.cluster.v3;
import "src/proto/grpc/testing/xds/v3/base.proto";
import "src/proto/grpc/testing/xds/v3/config_source.proto";
+import "src/proto/grpc/testing/xds/v3/endpoint.proto";
import "google/protobuf/any.proto";
import "google/protobuf/wrappers.proto";
@@ -153,12 +154,63 @@ message Cluster {
// Configuration to use for EDS updates for the Cluster.
EdsClusterConfig eds_cluster_config = 3;
+ // Specific configuration for the :ref:`RingHash<arch_overview_load_balancing_types_ring_hash>`
+ // load balancing policy.
+ message RingHashLbConfig {
+ // The hash function used to hash hosts onto the ketama ring.
+ enum HashFunction {
+ // Use `xxHash <https://github.com/Cyan4973/xxHash>`_, this is the default hash function.
+ XX_HASH = 0;
+ MURMUR_HASH_2 = 1;
+ }
+
+ reserved 2;
+
+ // Minimum hash ring size. The larger the ring is (that is, the more hashes there are for each
+ // provided host) the better the request distribution will reflect the desired weights. Defaults
+ // to 1024 entries, and limited to 8M entries. See also
+ // :ref:`maximum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.maximum_ring_size>`.
+ google.protobuf.UInt64Value minimum_ring_size = 1;
+
+ // The hash function used to hash hosts onto the ketama ring. The value defaults to
+ // :ref:`XX_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.RingHashLbConfig.HashFunction.XX_HASH>`.
+ HashFunction hash_function = 3;
+
+ // Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries, but can be lowered
+ // to further constrain resource use. See also
+ // :ref:`minimum_ring_size<envoy_api_field_config.cluster.v3.Cluster.RingHashLbConfig.minimum_ring_size>`.
+ google.protobuf.UInt64Value maximum_ring_size = 4;
+ }
+
// The :ref:`load balancer type <arch_overview_load_balancing_types>` to use
// when picking a host in the cluster.
LbPolicy lb_policy = 6;
+ // Setting this is required for specifying members of
+ // :ref:`STATIC<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STATIC>`,
+ // :ref:`STRICT_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.STRICT_DNS>`
+ // or :ref:`LOGICAL_DNS<envoy_api_enum_value_config.cluster.v3.Cluster.DiscoveryType.LOGICAL_DNS>` clusters.
+ // This field supersedes the *hosts* field in the v2 API.
+ //
+ // .. attention::
+ //
+ // Setting this allows non-EDS cluster types to contain embedded EDS equivalent
+ // :ref:`endpoint assignments<envoy_api_msg_config.endpoint.v3.ClusterLoadAssignment>`.
+ //
+ endpoint.v3.ClusterLoadAssignment load_assignment = 33;
+
CircuitBreakers circuit_breakers = 10;
+ // Optional configuration for the load balancing algorithm selected by
+ // LbPolicy. Currently only
+ // :ref:`RING_HASH<envoy_api_enum_value_config.cluster.v3.Cluster.LbPolicy.RING_HASH>`,
+ // Specifying ring_hash_lb_config without setting the corresponding
+ // LbPolicy will generate an error at runtime.
+ oneof lb_config {
+ // Optional configuration for the Ring Hash load balancing policy.
+ RingHashLbConfig ring_hash_lb_config = 23;
+ }
+
// Optional custom transport socket implementation to use for upstream connections.
// To setup TLS, set a transport socket with name `tls` and
// :ref:`UpstreamTlsContexts <envoy_api_msg_extensions.transport_sockets.tls.v3.UpstreamTlsContext>` in the `typed_config`.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto
index bbdfd4e048b..79b8bc8b642 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/csds.proto
@@ -21,6 +21,9 @@ package envoy.service.status.v3;
import "src/proto/grpc/testing/xds/v3/config_dump.proto";
import "src/proto/grpc/testing/xds/v3/base.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/timestamp.proto";
+
// CSDS is Client Status Discovery Service. It can be used to get the status of
// an xDS-compliant client from the management server's point of view. It can
@@ -77,10 +80,58 @@ message PerXdsConfig {
// All xds configs for a particular client.
message ClientConfig {
+ // GenericXdsConfig is used to specify the config status and the dump
+ // of any xDS resource identified by their type URL. It is the generalized
+ // version of the now deprecated ListenersConfigDump, ClustersConfigDump etc
+ // [#next-free-field: 10]
+ message GenericXdsConfig {
+ // Type_url represents the fully qualified name of xDS resource type
+ // like envoy.v3.Cluster, envoy.v3.ClusterLoadAssignment etc.
+ string type_url = 1;
+
+ // Name of the xDS resource
+ string name = 2;
+
+ // This is the :ref:`version_info <envoy_v3_api_field_service.discovery.v3.DiscoveryResponse.version_info>`
+ // in the last processed xDS discovery response. If there are only
+ // static bootstrap listeners, this field will be ""
+ string version_info = 3;
+
+ // The xDS resource config. Actual content depends on the type
+ google.protobuf.Any xds_config = 4;
+
+ // Timestamp when the xDS resource was last updated
+ google.protobuf.Timestamp last_updated = 5;
+
+ // Per xDS resource config status. It is generated by management servers.
+ // It will not be present if the CSDS server is an xDS client.
+ ConfigStatus config_status = 6;
+
+ // Per xDS resource status from the view of a xDS client
+ admin.v3.ClientResourceStatus client_status = 7;
+
+ // Set if the last update failed, cleared after the next successful
+ // update. The *error_state* field contains the rejected version of
+ // this particular resource along with the reason and timestamp. For
+ // successfully updated or acknowledged resource, this field should
+ // be empty.
+ admin.v3.UpdateFailureState error_state = 8;
+
+ // Is static resource is true if it is specified in the config supplied
+ // through the file at the startup.
+ bool is_static_resource = 9;
+ }
+
// Node for a particular client.
config.core.v3.Node node = 1;
- repeated PerXdsConfig xds_config = 2;
+ // This field is deprecated in favor of generic_xds_configs which is
+ // much simpler and uniform in structure.
+ repeated PerXdsConfig xds_config = 2 [deprecated = true];
+
+ // Represents generic xDS config and the exact config structure depends on
+ // the type URL (like Cluster if it is CDS)
+ repeated GenericXdsConfig generic_xds_configs = 3;
}
message ClientStatusResponse {
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
index 7cc1d40ca6e..7cbea7f443f 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/endpoint.proto
@@ -76,6 +76,17 @@ message LbEndpoint {
// Optional health status when known and supplied by EDS server.
HealthStatus health_status = 2;
+
+ // The optional load balancing weight of the upstream host; at least 1.
+ // Envoy uses the load balancing weight in some of the built in load
+ // balancers. The load balancing weight for an endpoint is divided by the sum
+ // of the weights of all endpoints in the endpoint's locality to produce a
+ // percentage of traffic for the endpoint. This percentage is then further
+ // weighted by the endpoint's locality's load balancing weight from
+ // LocalityLbEndpoints. If unspecified, each host is presumed to have equal
+ // weight in a locality. The sum of the weights of all endpoints in the
+ // endpoint's locality must not exceed uint32_t maximal value (4294967295).
+ google.protobuf.UInt32Value load_balancing_weight = 4;
}
// A group of endpoints belonging to a Locality.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto
new file mode 100644
index 00000000000..10f4b002081
--- /dev/null
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/extension.proto
@@ -0,0 +1,38 @@
+// Copyright 2021 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Local copy of Envoy xDS proto file, used for testing only.
+
+syntax = "proto3";
+
+package envoy.config.core.v3;
+
+import "google/protobuf/any.proto";
+
+// [#protodoc-title: Extension configuration]
+
+// Message type for extension configuration.
+// [#next-major-version: revisit all existing typed_config that doesn't use this wrapper.].
+message TypedExtensionConfig {
+ // The name of an extension. This is not used to select the extension, instead
+ // it serves the role of an opaque identifier.
+ string name = 1;
+
+ // The typed config for the extension. The type URL will be used to identify
+ // the extension. In the case that the type URL is *udpa.type.v1.TypedStruct*,
+ // the inner type URL of *TypedStruct* will be utilized. See the
+ // :ref:`extension configuration overview
+ // <config_overview_extension_configuration>` for further details.
+ google.protobuf.Any typed_config = 2;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
index 0d6a1699a21..033e64ba491 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/orca_load_report.proto
@@ -16,7 +16,7 @@
syntax = "proto3";
-package udpa.data.orca.v1;
+package xds.data.orca.v3;
// See section `ORCA load report format` of the design document in
// :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
index af9045774f8..9039ed46441 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/regex.proto
@@ -36,3 +36,8 @@ message RegexMatcher {
// The regex match string. The string must be supported by the configured engine.
string regex = 2;
}
+
+message RegexMatchAndSubstitute {
+ RegexMatcher pattern = 1;
+ string substitution = 2;
+}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
index baeaaf644d4..7109fe21db1 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/route.proto
@@ -31,6 +31,18 @@ import "google/protobuf/wrappers.proto";
// * Routing :ref:`architecture overview <arch_overview_http_routing>`
// * HTTP :ref:`router filter <config_http_filters_router>`
+message RetryPolicy {
+ string retry_on = 1;
+ google.protobuf.UInt32Value num_retries = 2;
+
+ message RetryBackOff {
+ google.protobuf.Duration base_interval = 1;
+ google.protobuf.Duration max_interval = 2;
+ }
+
+ RetryBackOff retry_back_off = 8;
+}
+
// The top level element in the routing configuration is a virtual host. Each virtual host has
// a logical name as well as a set of domains that get routed to it based on the incoming request's
// host header. This allows a single listener to service multiple top level domain path trees. Once
@@ -72,6 +84,8 @@ message VirtualHost {
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
map<string, google.protobuf.Any> typed_per_filter_config = 15;
+
+ RetryPolicy retry_policy = 16;
}
// A route is both a specification of how to match a request as well as an indication of what to do
@@ -89,12 +103,21 @@ message Route {
// Route matching parameters.
RouteMatch match = 1;
+ message NonForwardingAction {
+ }
+
oneof action {
// Route request to some upstream cluster.
RouteAction route = 2;
// Return a redirect.
RedirectAction redirect = 3;
+
+ // An action used when the route will generate a response directly,
+ // without forwarding to an upstream host. This will be used in non-proxy
+ // xDS clients like the gRPC server. It could also be used in the future
+ // in Envoy for a filter that directly generates responses for requests.
+ NonForwardingAction non_forwarding_action = 18;
}
// The typed_per_filter_config field can be used to provide route-specific
@@ -246,6 +269,80 @@ message RouteAction {
// for additional documentation.
WeightedCluster weighted_clusters = 3;
}
+
+ message HashPolicy {
+ message Header {
+ // The name of the request header that will be used to obtain the hash
+ // key. If the request header is not present, no hash will be produced.
+ string header_name = 1;
+
+ // If specified, the request header value will be rewritten and used
+ // to produce the hash key.
+ type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
+ }
+
+ message Cookie {
+ string name = 1;
+ }
+
+ message ConnectionProperties {
+ bool source_ip = 1;
+ }
+
+ message QueryParameter {
+ string name = 1;
+ }
+
+ message FilterState {
+ // The name of the Object in the per-request filterState, which is an
+ // Envoy::Http::Hashable object. If there is no data associated with the key,
+ // or the stored object is not Envoy::Http::Hashable, no hash will be produced.
+ string key = 1;
+ }
+
+ oneof policy_specifier {
+ // Header hash policy.
+ Header header = 1;
+
+ // Cookie hash policy.
+ Cookie cookie = 2;
+
+ // Connection properties hash policy.
+ ConnectionProperties connection_properties = 3;
+
+ // Query parameter hash policy.
+ QueryParameter query_parameter = 5;
+
+ // Filter state hash policy.
+ FilterState filter_state = 6;
+ }
+
+ // The flag that short-circuits the hash computing. This field provides a
+ // 'fallback' style of configuration: "if a terminal policy doesn't work,
+ // fallback to rest of the policy list", it saves time when the terminal
+ // policy works.
+ //
+ // If true, and there is already a hash computed, ignore rest of the
+ // list of hash polices.
+ // For example, if the following hash methods are configured:
+ //
+ // ========= ========
+ // specifier terminal
+ // ========= ========
+ // Header A true
+ // Header B false
+ // Header C false
+ // ========= ========
+ //
+ // The generateHash process ends if policy "header A" generates a hash, as
+ // it's a terminal policy.
+ bool terminal = 4;
+ }
+
+ repeated HashPolicy hash_policy = 15;
+
+ RetryPolicy retry_policy = 9;
+
// Specifies the maximum stream duration for this route.
MaxStreamDuration max_stream_duration = 36;
}
diff --git a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto
index e9acfb52a62..b2fc4532d8b 100644
--- a/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto
+++ b/contrib/libs/grpc/src/proto/grpc/testing/xds/v3/tls.proto
@@ -18,16 +18,104 @@ syntax = "proto3";
package envoy.extensions.transport_sockets.tls.v3;
+import "src/proto/grpc/testing/xds/v3/base.proto";
+import "src/proto/grpc/testing/xds/v3/extension.proto";
import "src/proto/grpc/testing/xds/v3/string.proto";
import "google/protobuf/wrappers.proto";
+// Indicates a certificate to be obtained from a named CertificateProvider plugin instance.
+// The plugin instances are defined in the client's bootstrap file.
+// The plugin allows certificates to be fetched/refreshed over the network asynchronously with
+// respect to the TLS handshake.
+// [#not-implemented-hide:]
+message CertificateProviderPluginInstance {
+ // Provider instance name. If not present, defaults to "default".
+ //
+ // Instance names should generally be defined not in terms of the underlying provider
+ // implementation (e.g., "file_watcher") but rather in terms of the function of the
+ // certificates (e.g., "foo_deployment_identity").
+ string instance_name = 1;
+
+ // Opaque name used to specify certificate instances or types. For example, "ROOTCA" to specify
+ // a root-certificate (validation context) or "example.com" to specify a certificate for a
+ // particular domain. Not all provider instances will actually use this field, so the value
+ // defaults to the empty string.
+ string certificate_name = 2;
+}
+
message CertificateValidationContext {
+ // Certificate provider instance for fetching TLS certificates.
+ //
+ // Only one of *trusted_ca* and *ca_certificate_provider_instance* may be specified.
+ // [#not-implemented-hide:]
+ CertificateProviderPluginInstance ca_certificate_provider_instance = 13;
+
+ // An optional list of base64-encoded SHA-256 hashes. If specified, Envoy will verify that the
+ // SHA-256 of the DER-encoded Subject Public Key Information (SPKI) of the presented certificate
+ // matches one of the specified values.
+ //
+ // A base64-encoded SHA-256 of the Subject Public Key Information (SPKI) of the certificate
+ // can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -noout -pubkey
+ // | openssl pkey -pubin -outform DER
+ // | openssl dgst -sha256 -binary
+ // | openssl enc -base64
+ // NvqYIYSbgK2vCJpQhObf77vv+bQWtc5ek5RIOwPiC9A=
+ //
+ // This is the format used in HTTP Public Key Pinning.
+ //
+ // When both:
+ // :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and
+ // :ref:`verify_certificate_spki
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified,
+ // a hash matching value from either of the lists will result in the certificate being accepted.
+ //
+ // .. attention::
+ //
+ // This option is preferred over :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>`,
+ // because SPKI is tied to a private key, so it doesn't change when the certificate
+ // is renewed using the same private key.
+ repeated string verify_certificate_spki = 3;
+
+ // An optional list of hex-encoded SHA-256 hashes. If specified, Envoy will verify that
+ // the SHA-256 of the DER-encoded presented certificate matches one of the specified values.
+ //
+ // A hex-encoded SHA-256 of the certificate can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -outform DER | openssl dgst -sha256 | cut -d" " -f2
+ // df6ff72fe9116521268f6f2dd4966f51df479883fe7037b39f75916ac3049d1a
+ //
+ // A long hex-encoded and colon-separated SHA-256 (a.k.a. "fingerprint") of the certificate
+ // can be generated with the following command:
+ //
+ // .. code-block:: bash
+ //
+ // $ openssl x509 -in path/to/client.crt -noout -fingerprint -sha256 | cut -d"=" -f2
+ // DF:6F:F7:2F:E9:11:65:21:26:8F:6F:2D:D4:96:6F:51:DF:47:98:83:FE:70:37:B3:9F:75:91:6A:C3:04:9D:1A
+ //
+ // Both of those formats are acceptable.
+ //
+ // When both:
+ // :ref:`verify_certificate_hash
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_hash>` and
+ // :ref:`verify_certificate_spki
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.verify_certificate_spki>` are specified,
+ // a hash matching value from either of the lists will result in the certificate being accepted.
+ repeated string verify_certificate_hash = 2;
+
// An optional list of Subject Alternative name matchers. If specified, Envoy will verify that the
// Subject Alternative Name of the presented certificate matches one of the specified matchers.
//
// When a certificate has wildcard DNS SAN entries, to match a specific client, it should be
- // configured with exact match type in the :ref:`string matcher <envoy_api_msg_type.matcher.v3.StringMatcher>`.
+ // configured with exact match type in the :ref:`string matcher <envoy_v3_api_msg_type.matcher.v3.StringMatcher>`.
// For example if the certificate has "\*.example.com" as DNS SAN entry, to allow only "api.example.com",
// it should be configured as shown below.
//
@@ -40,8 +128,29 @@ message CertificateValidationContext {
//
// Subject Alternative Names are easily spoofable and verifying only them is insecure,
// therefore this option must be used together with :ref:`trusted_ca
- // <envoy_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>`.
+ // <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CertificateValidationContext.trusted_ca>`.
repeated type.matcher.v3.StringMatcher match_subject_alt_names = 9;
+
+ // [#not-implemented-hide:] Must present signed certificate time-stamp.
+ google.protobuf.BoolValue require_signed_certificate_timestamp = 6;
+
+ // An optional `certificate revocation list
+ // <https://en.wikipedia.org/wiki/Certificate_revocation_list>`_
+ // (in PEM format). If specified, Envoy will verify that the presented peer
+ // certificate has not been revoked by this CRL. If this DataSource contains
+ // multiple CRLs, all of them will be used. Note that if a CRL is provided
+ // for any certificate authority in a trust chain, a CRL must be provided
+ // for all certificate authorities in that chain. Failure to do so will
+ // result in verification failure for both revoked and unrevoked certificates
+ // from that chain.
+ config.core.v3.DataSource crl = 7;
+
+ // The configuration of an extension specific certificate validator.
+ // If specified, all validation is done by the specified validator,
+ // and the behavior of all other validation settings is defined by the specified validator (and may be entirely ignored, unused, and unvalidated).
+ // Refer to the documentation for the specified validator. If you do not want a custom validation algorithm, do not set this field.
+ // [#extension-category: envoy.tls.cert_validator]
+ config.core.v3.TypedExtensionConfig custom_validator_config = 12;
}
message UpstreamTlsContext {
@@ -56,12 +165,43 @@ message UpstreamTlsContext {
}
message DownstreamTlsContext {
+ enum OcspStaplePolicy {
+ // OCSP responses are optional. If an OCSP response is absent
+ // or expired, the associated certificate will be used for
+ // connections without an OCSP staple.
+ LENIENT_STAPLING = 0;
+
+ // OCSP responses are optional. If an OCSP response is absent,
+ // the associated certificate will be used without an
+ // OCSP staple. If a response is provided but is expired,
+ // the associated certificate will not be used for
+ // subsequent connections. If no suitable certificate is found,
+ // the connection is rejected.
+ STRICT_STAPLING = 1;
+
+ // OCSP responses are required. Configuration will fail if
+ // a certificate is provided without an OCSP response. If a
+ // response expires, the associated certificate will not be
+ // used connections. If no suitable certificate is found, the
+ // connection is rejected.
+ MUST_STAPLE = 2;
+ }
+
// Common TLS context settings.
CommonTlsContext common_tls_context = 1;
// If specified, Envoy will reject connections without a valid client
// certificate.
google.protobuf.BoolValue require_client_certificate = 2;
+
+ // If specified, Envoy will reject connections without a valid and matching SNI.
+ // [#not-implemented-hide:]
+ google.protobuf.BoolValue require_sni = 3;
+
+ // Config for whether to use certificates if they do not have
+ // an accompanying OCSP response or if the response expires at runtime.
+ // Defaults to LENIENT_STAPLING
+ OcspStaplePolicy ocsp_staple_policy = 8;
}
@@ -98,10 +238,60 @@ message CommonTlsContext {
CertificateProviderInstance validation_context_certificate_provider_instance = 4;
}
+ message TlsParameters {}
+
+ // TLS protocol versions, cipher suites etc.
+ TlsParameters tls_params = 1;
+
+ message TlsCertificate {}
+
+ // :ref:`Multiple TLS certificates <arch_overview_ssl_cert_select>` can be associated with the
+ // same context to allow both RSA and ECDSA certificates.
+ //
+ // Only a single TLS certificate is supported in client contexts. In server contexts, the first
+ // RSA certificate is used for clients that only support RSA and the first ECDSA certificate is
+ // used for clients that support ECDSA.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's
+ // not legal to put a repeated field in a oneof. In the next major version, we should rework
+ // this to avoid this problem.]
+ repeated TlsCertificate tls_certificates = 2;
+
+ message SdsSecretConfig {}
+
+ // Configs for fetching TLS certificates via SDS API. Note SDS API allows certificates to be
+ // fetched/refreshed over the network asynchronously with respect to the TLS handshake.
+ //
+ // The same number and types of certificates as :ref:`tls_certificates <envoy_v3_api_field_extensions.transport_sockets.tls.v3.CommonTlsContext.tls_certificates>`
+ // are valid in the the certificates fetched through this setting.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#next-major-version: These mutually exclusive fields should ideally be in a oneof, but it's
+ // not legal to put a repeated field in a oneof. In the next major version, we should rework
+ // this to avoid this problem.]
+ repeated SdsSecretConfig tls_certificate_sds_secret_configs = 6;
+
+ // Certificate provider instance for fetching TLS certs.
+ //
+ // Only one of *tls_certificates*, *tls_certificate_sds_secret_configs*,
+ // and *tls_certificate_provider_instance* may be used.
+ // [#not-implemented-hide:]
+ CertificateProviderPluginInstance tls_certificate_provider_instance = 14;
+
// Certificate provider instance for fetching TLS certificates.
CertificateProviderInstance tls_certificate_certificate_provider_instance = 11;
oneof validation_context_type {
+ // How to validate peer certificates.
+ CertificateValidationContext validation_context = 3;
+
+ // Config for fetching validation context via SDS API. Note SDS API allows certificates to be
+ // fetched/refreshed over the network asynchronously with respect to the TLS handshake.
+ SdsSecretConfig validation_context_sds_secret_config = 7;
+
// Combined certificate validation context holds a default CertificateValidationContext
// and SDS config. When SDS server returns dynamic CertificateValidationContext, both dynamic
// and default CertificateValidationContext are merged into a new CertificateValidationContext
@@ -111,4 +301,8 @@ message CommonTlsContext {
// CertificateValidationContext, and logical OR is applied to boolean fields.
CombinedCertificateValidationContext combined_validation_context = 8;
}
+
+ // Custom TLS handshaker. If empty, defaults to native TLS handshaking
+ // behavior.
+ config.core.v3.TypedExtensionConfig custom_handshaker = 13;
}
diff --git a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
index fa5b12c5a5c..94d1b32617a 100644
--- a/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio/.yandex_meta/licenses.list.txt
@@ -33,15 +33,15 @@
====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
+ * Copyright 2019 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 The gRPC authors.
+ * Copyright 2020 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+# Copyright 2019 The gRPC authors.
====================COPYRIGHT====================
@@ -58,3 +58,7 @@
====================COPYRIGHT====================
// Copyright 2020 The gRPC Authors
+
+
+====================COPYRIGHT====================
+// Copyright 2021 The gRPC Authors
diff --git a/contrib/libs/grpc/src/python/grpcio/README.rst b/contrib/libs/grpc/src/python/grpcio/README.rst
index fe34ad5adfe..0beb0296e80 100644
--- a/contrib/libs/grpc/src/python/grpcio/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio/README.rst
@@ -10,7 +10,7 @@ Package for gRPC Python.
Supported Python Versions
-------------------------
-Python >= 3.5
+Python >= 3.6
Installation
------------
diff --git a/contrib/libs/grpc/src/python/grpcio/commands.py b/contrib/libs/grpc/src/python/grpcio/commands.py
index f4a3d2bdc04..d1a756e1852 100644
--- a/contrib/libs/grpc/src/python/grpcio/commands.py
+++ b/contrib/libs/grpc/src/python/grpcio/commands.py
@@ -13,27 +13,21 @@
# limitations under the License.
"""Provides distutils command classes for the GRPC Python setup process."""
-from __future__ import print_function
+# NOTE(https://github.com/grpc/grpc/issues/24028): allow setuptools to monkey
+# patch distutils
+import setuptools # isort:skip
-import distutils
import glob
import os
import os.path
-import platform
-import re
import shutil
import subprocess
import sys
import sysconfig
import traceback
-import setuptools
from setuptools.command import build_ext
from setuptools.command import build_py
-from setuptools.command import easy_install
-from setuptools.command import install
-from setuptools.command import test
-
import support
PYTHON_STEM = os.path.dirname(os.path.abspath(__file__))
@@ -258,10 +252,14 @@ class BuildExt(build_ext.build_ext):
old_compile = self.compiler._compile
def new_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
- if src[-2:] == '.c':
+ if src.endswith('.c'):
extra_postargs = [
arg for arg in extra_postargs if not '-std=c++' in arg
]
+ elif src.endswith('.cc') or src.endswith('.cpp'):
+ extra_postargs = [
+ arg for arg in extra_postargs if not '-std=gnu99' in arg
+ ]
return old_compile(obj, src, ext, cc_args, extra_postargs,
pp_opts)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
index 69803ed1616..bc645e5750e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/__init__.py
@@ -18,14 +18,18 @@ import contextlib
import enum
import logging
import sys
-import six
-from grpc._cython import cygrpc as _cygrpc
from grpc import _compression
+from grpc._cython import cygrpc as _cygrpc
+from grpc._runtime_protos import protos
+from grpc._runtime_protos import protos_and_services
+from grpc._runtime_protos import services
+import six
logging.getLogger(__name__).addHandler(logging.NullHandler())
try:
+ # pylint: disable=ungrouped-imports
from grpc._grpcio_metadata import __version__
except ImportError:
__version__ = "dev0"
@@ -1174,6 +1178,16 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
"""
raise NotImplementedError()
+ def trailing_metadata(self):
+ """Access value to be used as trailing metadata upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The trailing :term:`metadata` for the RPC.
+ """
+ raise NotImplementedError()
+
@abc.abstractmethod
def abort(self, code, details):
"""Raises an exception to terminate the RPC with a non-OK status.
@@ -1237,6 +1251,26 @@ class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)):
"""
raise NotImplementedError()
+ def code(self):
+ """Accesses the value to be used as status code upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The StatusCode value for the RPC.
+ """
+ raise NotImplementedError()
+
+ def details(self):
+ """Accesses the value to be used as detail string upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The details string of the RPC.
+ """
+ raise NotImplementedError()
+
def disable_next_message_compression(self):
"""Disables compression for the next response message.
@@ -2062,8 +2096,6 @@ class Compression(enum.IntEnum):
Gzip = _compression.Gzip
-from grpc._runtime_protos import protos, services, protos_and_services # pylint: disable=wrong-import-position
-
################################### __all__ #################################
__all__ = (
@@ -2112,6 +2144,7 @@ __all__ = (
'access_token_call_credentials',
'composite_call_credentials',
'composite_channel_credentials',
+ 'compute_engine_channel_credentials',
'local_channel_credentials',
'local_server_credentials',
'alts_channel_credentials',
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
index b98f3002f4a..8f9d7e972a2 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_channel.py
@@ -22,11 +22,11 @@ import threading
import time
import grpc
-import grpc.experimental
-from grpc import _compression
from grpc import _common
+from grpc import _compression
from grpc import _grpcio_metadata
from grpc._cython import cygrpc
+import grpc.experimental
_LOGGER = logging.getLogger(__name__)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_common.py b/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
index 128124c3256..d8f951456e4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_common.py
@@ -15,10 +15,10 @@
import logging
import time
-import six
import grpc
from grpc._cython import cygrpc
+import six
_LOGGER = logging.getLogger(__name__)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
index 2c2a3ff3f6e..7bce1850dc8 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/call.pyx.pxi
@@ -134,37 +134,38 @@ cdef class _AioCall(GrpcCallWrapper):
cdef void _set_status(self, AioRpcStatus status) except *:
cdef list waiters
+ # No more waiters should be expected since status has been set.
self._status = status
if self._initial_metadata is None:
self._set_initial_metadata(_IMMUTABLE_EMPTY_METADATA)
- # No more waiters should be expected since status
- # has been set.
- waiters = self._waiters_status
- self._waiters_status = None
-
- for waiter in waiters:
+ for waiter in self._waiters_status:
if not waiter.done():
waiter.set_result(None)
+ self._waiters_status = []
for callback in self._done_callbacks:
callback()
cdef void _set_initial_metadata(self, tuple initial_metadata) except *:
+ if self._initial_metadata is not None:
+ # Some gRPC calls might end before the initial metadata arrived in
+ # the Call object. That causes this method to be invoked twice: 1.
+ # filled with an empty metadata; 2. updated with the actual user
+ # provided metadata.
+ return
+
cdef list waiters
+ # No more waiters should be expected since initial metadata has been
+ # set.
self._initial_metadata = initial_metadata
- # No more waiters should be expected since initial metadata
- # has been set.
- waiters = self._waiters_initial_metadata
- self._waiters_initial_metadata = None
-
- for waiter in waiters:
+ for waiter in self._waiters_initial_metadata:
if not waiter.done():
waiter.set_result(None)
-
+ self._waiters_initial_metadata = []
def add_done_callback(self, callback):
if self.done():
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
index e5620cd166d..e54e5107547 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pxd.pxi
@@ -25,7 +25,7 @@ cdef struct CallbackContext:
# C struct to store callback context in the form of pointers.
#
# Attributes:
- # functor: A grpc_experimental_completion_queue_functor represents the
+ # functor: A grpc_completion_queue_functor represents the
# callback function in the only way Core understands.
# waiter: An asyncio.Future object that fulfills when the callback is
# invoked by Core.
@@ -33,7 +33,7 @@ cdef struct CallbackContext:
# returns 'success == 0' state.
# wrapper: A self-reference to the CallbackWrapper to help life cycle
# management.
- grpc_experimental_completion_queue_functor functor
+ grpc_completion_queue_functor functor
cpython.PyObject *waiter
cpython.PyObject *loop
cpython.PyObject *failure_handler
@@ -47,10 +47,10 @@ cdef class CallbackWrapper:
@staticmethod
cdef void functor_run(
- grpc_experimental_completion_queue_functor* functor,
+ grpc_completion_queue_functor* functor,
int succeed)
- cdef grpc_experimental_completion_queue_functor *c_functor(self)
+ cdef grpc_completion_queue_functor *c_functor(self)
cdef class GrpcCallWrapper:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
index bc25c2e4bae..f2d94a96e85 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/callback_common.pyx.pxi
@@ -49,7 +49,7 @@ cdef class CallbackWrapper:
@staticmethod
cdef void functor_run(
- grpc_experimental_completion_queue_functor* functor,
+ grpc_completion_queue_functor* functor,
int success):
cdef CallbackContext *context = <CallbackContext *>functor
cdef object waiter = <object>context.waiter
@@ -60,7 +60,7 @@ cdef class CallbackWrapper:
waiter.set_result(None)
cpython.Py_DECREF(<object>context.callback_wrapper)
- cdef grpc_experimental_completion_queue_functor *c_functor(self):
+ cdef grpc_completion_queue_functor *c_functor(self):
return &self.context.functor
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
index f759fbbec0c..2bbe5498900 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi
@@ -14,6 +14,8 @@
from cpython.version cimport PY_MAJOR_VERSION, PY_MINOR_VERSION
+TYPE_METADATA_STRING = "Tuple[Tuple[str, Union[str, bytes]]...]"
+
cdef grpc_status_code get_status_code(object code) except *:
if isinstance(code, int):
@@ -56,7 +58,7 @@ class _EOF:
def __bool__(self):
return False
-
+
def __len__(self):
return 0
@@ -144,7 +146,7 @@ async def generator_to_async_generator(object gen, object loop, object thread_po
TypeError: StopIteration interacts badly with generators and cannot be
raised into a Future
"""
- queue = asyncio.Queue(maxsize=1, loop=loop)
+ queue = asyncio.Queue(maxsize=1)
def yield_to_queue():
try:
@@ -184,3 +186,17 @@ else:
def get_working_loop():
"""Returns a running event loop."""
return asyncio.get_event_loop()
+
+
+def raise_if_not_valid_trailing_metadata(object metadata):
+ if not hasattr(metadata, '__iter__') or isinstance(metadata, dict):
+ raise TypeError(f'Invalid trailing metadata type, expected {TYPE_METADATA_STRING}: {metadata}')
+ for item in metadata:
+ if not isinstance(item, tuple):
+ raise TypeError(f'Invalid trailing metadata type, expected {TYPE_METADATA_STRING}: {metadata}')
+ if len(item) != 2:
+ raise TypeError(f'Invalid trailing metadata type, expected {TYPE_METADATA_STRING}: {metadata}')
+ if not isinstance(item[0], str):
+ raise TypeError(f'Invalid trailing metadata type, expected {TYPE_METADATA_STRING}: {metadata}')
+ if not isinstance(item[1], str) and not isinstance(item[1], bytes):
+ raise TypeError(f'Invalid trailing metadata type, expected {TYPE_METADATA_STRING}: {metadata}')
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
index a5189ad5267..712a589798e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pxd.pxi
@@ -68,9 +68,3 @@ cdef class PollerCompletionQueue(BaseCompletionQueue):
cdef void _poll(self) nogil
cdef shutdown(self)
-
-
-cdef class CallbackCompletionQueue(BaseCompletionQueue):
- cdef object _shutdown_completed # asyncio.Future
- cdef CallbackWrapper _wrapper
- cdef object _loop
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
index 1a32a553504..b9132c85602 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
@@ -163,7 +163,7 @@ cdef class PollerCompletionQueue(BaseCompletionQueue):
if loop is context_loop:
# Executes callbacks: complete the future
CallbackWrapper.functor_run(
- <grpc_experimental_completion_queue_functor *>event.tag,
+ <grpc_completion_queue_functor *>event.tag,
event.success
)
else:
@@ -172,23 +172,3 @@ cdef class PollerCompletionQueue(BaseCompletionQueue):
<CallbackWrapper>context.callback_wrapper,
event.success
)
-
-
-cdef class CallbackCompletionQueue(BaseCompletionQueue):
-
- def __cinit__(self):
- self._loop = get_working_loop()
- self._shutdown_completed = self._loop.create_future()
- self._wrapper = CallbackWrapper(
- self._shutdown_completed,
- self._loop,
- CQ_SHUTDOWN_FAILURE_HANDLER)
- self._cq = grpc_completion_queue_create_for_callback(
- self._wrapper.c_functor(),
- NULL
- )
-
- async def shutdown(self):
- grpc_completion_queue_shutdown(self._cq)
- await self._shutdown_completed
- grpc_completion_queue_destroy(self._cq)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
index 9aec95520fb..7f9f52da7c0 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/grpc_aio.pyx.pxi
@@ -19,6 +19,8 @@ cdef _AioState _global_aio_state = _AioState()
class AsyncIOEngine(enum.Enum):
+ # NOTE(lidiz) the support for custom_io_manager is removed in favor of the
+ # EventEngine project, which will be the only IO platform in Core.
CUSTOM_IO_MANAGER = 'custom_io_manager'
POLLER = 'poller'
@@ -40,29 +42,6 @@ cdef class _AioState:
self.cq = None
-cdef _initialize_custom_io_manager():
- # Activates asyncio IO manager.
- # NOTE(lidiz) Custom IO manager must be activated before the first
- # `grpc_init()`. Otherwise, some special configurations in Core won't
- # pick up the change, and resulted in SEGFAULT or ABORT.
- install_asyncio_iomgr()
-
- # Initializes gRPC Core, must be called before other Core API
- grpc_init()
-
- # Timers are triggered by the Asyncio loop. We disable
- # the background thread that is being used by the native
- # gRPC iomgr.
- grpc_timer_manager_set_threading(False)
-
- # gRPC callbaks are executed within the same thread used by the Asyncio
- # event loop, as it is being done by the other Asyncio callbacks.
- Executor.SetThreadingAll(False)
-
- # Creates the only completion queue
- _global_aio_state.cq = CallbackCompletionQueue()
-
-
cdef _initialize_poller():
# Initializes gRPC Core, must be called before other Core API
grpc_init()
@@ -80,9 +59,7 @@ cdef _actual_aio_initialization():
_LOGGER.debug('Using %s as I/O engine', _global_aio_state.engine)
# Initializes the process-level state accordingly
- if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
- _initialize_custom_io_manager()
- elif _global_aio_state.engine is AsyncIOEngine.POLLER:
+ if _global_aio_state.engine is AsyncIOEngine.POLLER:
_initialize_poller()
else:
raise ValueError('Unsupported engine type [%s]' % _global_aio_state.engine)
@@ -98,13 +75,7 @@ def _grpc_shutdown_wrapper(_):
cdef _actual_aio_shutdown():
- if _global_aio_state.engine is AsyncIOEngine.CUSTOM_IO_MANAGER:
- future = schedule_coro_threadsafe(
- _global_aio_state.cq.shutdown(),
- (<CallbackCompletionQueue>_global_aio_state.cq)._loop
- )
- future.add_done_callback(_grpc_shutdown_wrapper)
- elif _global_aio_state.engine is AsyncIOEngine.POLLER:
+ if _global_aio_state.engine is AsyncIOEngine.POLLER:
(<PollerCompletionQueue>_global_aio_state.cq).shutdown()
grpc_shutdown()
else:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
deleted file mode 100644
index 917ae24e11e..00000000000
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
+++ /dev/null
@@ -1,256 +0,0 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-import platform
-
-from cpython cimport Py_INCREF, Py_DECREF
-from libc cimport string
-
-import socket as native_socket
-try:
- import ipaddress # CPython 3.3 and above
-except ImportError:
- pass
-
-cdef grpc_socket_vtable asyncio_socket_vtable
-cdef grpc_custom_resolver_vtable asyncio_resolver_vtable
-cdef grpc_custom_timer_vtable asyncio_timer_vtable
-cdef grpc_custom_poller_vtable asyncio_pollset_vtable
-cdef bint so_reuse_port
-
-
-cdef grpc_error* asyncio_socket_init(
- grpc_custom_socket* grpc_socket,
- int domain) with gil:
- socket = _AsyncioSocket.create(grpc_socket, None, None)
- Py_INCREF(socket)
- grpc_socket.impl = <void*>socket
- return <grpc_error*>0
-
-
-cdef void asyncio_socket_destroy(grpc_custom_socket* grpc_socket) with gil:
- Py_DECREF(<_AsyncioSocket>grpc_socket.impl)
-
-
-cdef void asyncio_socket_connect(
- grpc_custom_socket* grpc_socket,
- const grpc_sockaddr* addr,
- size_t addr_len,
- grpc_custom_connect_callback connect_cb) with gil:
- host, port = sockaddr_to_tuple(addr, addr_len)
- socket = <_AsyncioSocket>grpc_socket.impl
- socket.connect(host, port, connect_cb)
-
-
-cdef void asyncio_socket_close(
- grpc_custom_socket* grpc_socket,
- grpc_custom_close_callback close_cb) with gil:
- socket = (<_AsyncioSocket>grpc_socket.impl)
- socket.close()
- close_cb(grpc_socket)
-
-
-cdef void asyncio_socket_shutdown(grpc_custom_socket* grpc_socket) with gil:
- socket = (<_AsyncioSocket>grpc_socket.impl)
- socket.close()
-
-
-cdef void asyncio_socket_write(
- grpc_custom_socket* grpc_socket,
- grpc_slice_buffer* slice_buffer,
- grpc_custom_write_callback write_cb) with gil:
- socket = (<_AsyncioSocket>grpc_socket.impl)
- socket.write(slice_buffer, write_cb)
-
-
-cdef void asyncio_socket_read(
- grpc_custom_socket* grpc_socket,
- char* buffer_,
- size_t length,
- grpc_custom_read_callback read_cb) with gil:
- socket = (<_AsyncioSocket>grpc_socket.impl)
- socket.read(buffer_, length, read_cb)
-
-
-cdef grpc_error* asyncio_socket_getpeername(
- grpc_custom_socket* grpc_socket,
- const grpc_sockaddr* addr,
- int* length) with gil:
- peer = (<_AsyncioSocket>grpc_socket.impl).peername()
-
- cdef grpc_resolved_address c_addr
- hostname = str_to_bytes(peer[0])
- grpc_string_to_sockaddr(&c_addr, hostname, peer[1])
- # TODO(https://github.com/grpc/grpc/issues/20684) Remove the memcpy
- string.memcpy(<void*>addr, <void*>c_addr.addr, c_addr.len)
- length[0] = c_addr.len
- return grpc_error_none()
-
-
-cdef grpc_error* asyncio_socket_getsockname(
- grpc_custom_socket* grpc_socket,
- const grpc_sockaddr* addr,
- int* length) with gil:
- """Supplies sock_addr in add_socket_to_server."""
- cdef grpc_resolved_address c_addr
- socket = (<_AsyncioSocket>grpc_socket.impl)
- if socket is None:
- peer = ('0.0.0.0', 0)
- else:
- peer = socket.sockname()
- hostname = str_to_bytes(peer[0])
- grpc_string_to_sockaddr(&c_addr, hostname, peer[1])
- # TODO(https://github.com/grpc/grpc/issues/20684) Remove the memcpy
- string.memcpy(<void*>addr, <void*>c_addr.addr, c_addr.len)
- length[0] = c_addr.len
- return grpc_error_none()
-
-
-cdef grpc_error* asyncio_socket_listen(grpc_custom_socket* grpc_socket) with gil:
- (<_AsyncioSocket>grpc_socket.impl).listen()
- return grpc_error_none()
-
-
-def _asyncio_apply_socket_options(object s, int flags):
- # Turn SO_REUSEADDR on for TCP sockets; if we want to support UDS, we will
- # need to update this function.
- s.setsockopt(native_socket.SOL_SOCKET, native_socket.SO_REUSEADDR, 1)
- # SO_REUSEPORT only available in POSIX systems.
- if platform.system() != 'Windows':
- if GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT & flags:
- s.setsockopt(native_socket.SOL_SOCKET, native_socket.SO_REUSEPORT, 1)
- s.setsockopt(native_socket.IPPROTO_TCP, native_socket.TCP_NODELAY, True)
-
-
-cdef grpc_error* asyncio_socket_bind(
- grpc_custom_socket* grpc_socket,
- const grpc_sockaddr* addr,
- size_t len, int flags) with gil:
- host, port = sockaddr_to_tuple(addr, len)
- try:
- ip = ipaddress.ip_address(host)
- if isinstance(ip, ipaddress.IPv6Address):
- family = native_socket.AF_INET6
- else:
- family = native_socket.AF_INET
-
- socket = native_socket.socket(family=family)
- _asyncio_apply_socket_options(socket, flags)
- socket.bind((host, port))
- except IOError as io_error:
- socket.close()
- return socket_error("bind", str(io_error))
- else:
- aio_socket = _AsyncioSocket.create_with_py_socket(grpc_socket, socket)
- cpython.Py_INCREF(aio_socket) # Py_DECREF in asyncio_socket_destroy
- grpc_socket.impl = <void*>aio_socket
- return grpc_error_none()
-
-
-cdef void asyncio_socket_accept(
- grpc_custom_socket* grpc_socket,
- grpc_custom_socket* grpc_socket_client,
- grpc_custom_accept_callback accept_cb) with gil:
- (<_AsyncioSocket>grpc_socket.impl).accept(grpc_socket_client, accept_cb)
-
-
-cdef grpc_error* asyncio_resolve(
- const char* host,
- const char* port,
- grpc_resolved_addresses** res) with gil:
- result = native_socket.getaddrinfo(host, port)
- res[0] = tuples_to_resolvaddr(result)
-
-
-cdef void asyncio_resolve_async(
- grpc_custom_resolver* grpc_resolver,
- const char* host,
- const char* port) with gil:
- resolver = _AsyncioResolver.create(grpc_resolver)
- resolver.resolve(host, port)
-
-
-cdef void asyncio_timer_start(grpc_custom_timer* grpc_timer) with gil:
- timer = _AsyncioTimer.create(grpc_timer, grpc_timer.timeout_ms / 1000.0)
- grpc_timer.timer = <void*>timer
-
-
-cdef void asyncio_timer_stop(grpc_custom_timer* grpc_timer) with gil:
- # TODO(https://github.com/grpc/grpc/issues/22278) remove this if condition
- if grpc_timer.timer == NULL:
- return
- else:
- timer = <_AsyncioTimer>grpc_timer.timer
- timer.stop()
-
-
-cdef void asyncio_init_loop() with gil:
- pass
-
-
-cdef void asyncio_destroy_loop() with gil:
- pass
-
-
-cdef void asyncio_kick_loop() with gil:
- pass
-
-
-cdef void asyncio_run_loop(size_t timeout_ms) with gil:
- pass
-
-
-def _auth_plugin_callback_wrapper(object cb,
- str service_url,
- str method_name,
- object callback):
- get_working_loop().call_soon(cb, service_url, method_name, callback)
-
-
-def install_asyncio_iomgr():
- # Auth plugins invoke user provided logic in another thread by default. We
- # need to override that behavior by registering the call to the event loop.
- set_async_callback_func(_auth_plugin_callback_wrapper)
-
- asyncio_resolver_vtable.resolve = asyncio_resolve
- asyncio_resolver_vtable.resolve_async = asyncio_resolve_async
-
- asyncio_socket_vtable.init = asyncio_socket_init
- asyncio_socket_vtable.connect = asyncio_socket_connect
- asyncio_socket_vtable.destroy = asyncio_socket_destroy
- asyncio_socket_vtable.shutdown = asyncio_socket_shutdown
- asyncio_socket_vtable.close = asyncio_socket_close
- asyncio_socket_vtable.write = asyncio_socket_write
- asyncio_socket_vtable.read = asyncio_socket_read
- asyncio_socket_vtable.getpeername = asyncio_socket_getpeername
- asyncio_socket_vtable.getsockname = asyncio_socket_getsockname
- asyncio_socket_vtable.bind = asyncio_socket_bind
- asyncio_socket_vtable.listen = asyncio_socket_listen
- asyncio_socket_vtable.accept = asyncio_socket_accept
-
- asyncio_timer_vtable.start = asyncio_timer_start
- asyncio_timer_vtable.stop = asyncio_timer_stop
-
- asyncio_pollset_vtable.init = asyncio_init_loop
- asyncio_pollset_vtable.poll = asyncio_run_loop
- asyncio_pollset_vtable.kick = asyncio_kick_loop
- asyncio_pollset_vtable.shutdown = asyncio_destroy_loop
-
- grpc_custom_iomgr_init(
- &asyncio_socket_vtable,
- &asyncio_resolver_vtable,
- &asyncio_timer_vtable,
- &asyncio_pollset_vtable
- )
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
deleted file mode 100644
index 1a2e244ff9c..00000000000
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pyx.pxi
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-cdef class _AsyncioResolver:
- def __cinit__(self):
- self._loop = get_working_loop()
- self._grpc_resolver = NULL
- self._task_resolve = None
-
- @staticmethod
- cdef _AsyncioResolver create(grpc_custom_resolver* grpc_resolver):
- resolver = _AsyncioResolver()
- resolver._grpc_resolver = grpc_resolver
- return resolver
-
- def __repr__(self):
- class_name = self.__class__.__name__
- id_ = id(self)
- return f"<{class_name} {id_}>"
-
- async def _async_resolve(self, bytes host, bytes port):
- self._task_resolve = None
- try:
- resolved = await self._loop.getaddrinfo(host, port)
- except Exception as e:
- grpc_custom_resolve_callback(
- <grpc_custom_resolver*>self._grpc_resolver,
- NULL,
- grpc_socket_error("Resolve address [{}:{}] failed: {}: {}".format(
- host, port, type(e), str(e)).encode())
- )
- else:
- grpc_custom_resolve_callback(
- <grpc_custom_resolver*>self._grpc_resolver,
- tuples_to_resolvaddr(resolved),
- <grpc_error*>0
- )
-
- cdef void resolve(self, const char* host, const char* port):
- assert not self._task_resolve
-
- self._task_resolve = self._loop.create_task(
- self._async_resolve(host, port)
- )
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi
deleted file mode 100644
index cfab5549b2e..00000000000
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pxd.pxi
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-cdef class _AsyncioSocket:
- cdef:
- # Common attributes
- grpc_custom_socket * _grpc_socket
- grpc_custom_read_callback _grpc_read_cb
- grpc_custom_write_callback _grpc_write_cb
- object _reader
- object _writer
- object _task_read
- object _task_write
- object _task_connect
- object _task_listen
- char * _read_buffer
- # Caches the picked event loop, so we can avoid the 30ns overhead each
- # time we need access to the event loop.
- object _loop
- # TODO(lidiz) Drop after 3.6 deprecation. Python 3.7 introduces methods
- # like `is_closing()` to help graceful shutdown.
- bint _closed
-
- # Client-side attributes
- grpc_custom_connect_callback _grpc_connect_cb
-
- # Server-side attributes
- grpc_custom_accept_callback _grpc_accept_cb
- grpc_custom_socket * _grpc_client_socket
- object _server
- object _py_socket
- object _peername
-
- @staticmethod
- cdef _AsyncioSocket create(
- grpc_custom_socket * grpc_socket,
- object reader,
- object writer)
- @staticmethod
- cdef _AsyncioSocket create_with_py_socket(grpc_custom_socket * grpc_socket, object py_socket)
-
- cdef void connect(self, object host, object port, grpc_custom_connect_callback grpc_connect_cb)
- cdef void write(self, grpc_slice_buffer * g_slice_buffer, grpc_custom_write_callback grpc_write_cb)
- cdef void read(self, char * buffer_, size_t length, grpc_custom_read_callback grpc_read_cb)
- cdef bint is_connected(self)
- cdef void close(self)
-
- cdef accept(self, grpc_custom_socket* grpc_socket_client, grpc_custom_accept_callback grpc_accept_cb)
- cdef listen(self)
- cdef tuple peername(self)
- cdef tuple sockname(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi
deleted file mode 100644
index eecef17d98a..00000000000
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/socket.pyx.pxi
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import socket as native_socket
-
-from libc cimport string
-
-cdef int _ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG = 100
-
-
-# TODO(https://github.com/grpc/grpc/issues/21348) Better flow control needed.
-cdef class _AsyncioSocket:
- def __cinit__(self):
- self._grpc_socket = NULL
- self._grpc_connect_cb = NULL
- self._grpc_read_cb = NULL
- self._grpc_write_cb = NULL
- self._reader = None
- self._writer = None
- self._task_connect = None
- self._task_read = None
- self._task_write = None
- self._task_listen = None
- self._read_buffer = NULL
- self._server = None
- self._py_socket = None
- self._peername = None
- self._closed = False
- self._loop = get_working_loop()
-
- @staticmethod
- cdef _AsyncioSocket create(grpc_custom_socket * grpc_socket,
- object reader,
- object writer):
- socket = _AsyncioSocket()
- socket._grpc_socket = grpc_socket
- socket._reader = reader
- socket._writer = writer
- if writer is not None:
- socket._peername = writer.get_extra_info('peername')
- return socket
-
- @staticmethod
- cdef _AsyncioSocket create_with_py_socket(grpc_custom_socket * grpc_socket, object py_socket):
- socket = _AsyncioSocket()
- socket._grpc_socket = grpc_socket
- socket._py_socket = py_socket
- return socket
-
- def __repr__(self):
- class_name = self.__class__.__name__
- id_ = id(self)
- connected = self.is_connected()
- return f"<{class_name} {id_} connected={connected}>"
-
- async def _async_connect(self, object host, object port,):
- self._task_connect = None
- try:
- self._reader, self._writer = await asyncio.open_connection(host, port)
- except Exception as e:
- self._grpc_connect_cb(
- <grpc_custom_socket*>self._grpc_socket,
- grpc_socket_error("Socket connect failed: {}: {}".format(type(e), str(e)).encode())
- )
- else:
- # gRPC default posix implementation disables nagle
- # algorithm.
- sock = self._writer.transport.get_extra_info('socket')
- sock.setsockopt(native_socket.IPPROTO_TCP, native_socket.TCP_NODELAY, True)
-
- self._grpc_connect_cb(
- <grpc_custom_socket*>self._grpc_socket,
- <grpc_error*>0
- )
-
- cdef void connect(self,
- object host,
- object port,
- grpc_custom_connect_callback grpc_connect_cb):
- assert not self._reader
- assert not self._task_connect
-
- self._task_connect = self._loop.create_task(
- self._async_connect(host, port)
- )
- self._grpc_connect_cb = grpc_connect_cb
-
- async def _async_read(self, size_t length):
- self._task_read = None
- try:
- inbound_buffer = await self._reader.read(n=length)
- except ConnectionError as e:
- self._grpc_read_cb(
- <grpc_custom_socket*>self._grpc_socket,
- -1,
- grpc_socket_error("Read failed: {}".format(e).encode())
- )
- else:
- string.memcpy(
- <void*>self._read_buffer,
- <char*>inbound_buffer,
- len(inbound_buffer)
- )
- self._grpc_read_cb(
- <grpc_custom_socket*>self._grpc_socket,
- len(inbound_buffer),
- <grpc_error*>0
- )
-
- cdef void read(self, char * buffer_, size_t length, grpc_custom_read_callback grpc_read_cb):
- assert not self._task_read
-
- self._grpc_read_cb = grpc_read_cb
- self._read_buffer = buffer_
- self._task_read = self._loop.create_task(self._async_read(length))
-
- async def _async_write(self, bytearray outbound_buffer):
- self._writer.write(outbound_buffer)
- self._task_write = None
- try:
- await self._writer.drain()
- self._grpc_write_cb(
- <grpc_custom_socket*>self._grpc_socket,
- <grpc_error*>0
- )
- except ConnectionError as connection_error:
- self._grpc_write_cb(
- <grpc_custom_socket*>self._grpc_socket,
- grpc_socket_error("Socket write failed: {}".format(connection_error).encode()),
- )
-
- cdef void write(self, grpc_slice_buffer * g_slice_buffer, grpc_custom_write_callback grpc_write_cb):
- """Performs write to network socket in AsyncIO.
-
- For each socket, Core guarantees there'll be only one ongoing write.
- When the write is finished, we need to call grpc_write_cb to notify
- Core that the work is done.
- """
- assert not self._task_write
- cdef char* start
- cdef bytearray outbound_buffer = bytearray()
- for i in range(g_slice_buffer.count):
- start = grpc_slice_buffer_start(g_slice_buffer, i)
- length = grpc_slice_buffer_length(g_slice_buffer, i)
- outbound_buffer.extend(<bytes>start[:length])
-
- self._grpc_write_cb = grpc_write_cb
- self._task_write = self._loop.create_task(self._async_write(outbound_buffer))
-
- cdef bint is_connected(self):
- return self._reader and not self._reader._transport.is_closing()
-
- cdef void close(self):
- if self._closed:
- return
- else:
- self._closed = True
- if self.is_connected():
- self._writer.close()
- if self._task_listen and not self._task_listen.done():
- self._task_listen.close()
- if self._server:
- self._server.close()
- # NOTE(lidiz) If the asyncio.Server is created from a Python socket,
- # the server.close() won't release the fd until the close() is called
- # for the Python socket.
- if self._py_socket:
- self._py_socket.close()
-
- def _new_connection_callback(self, object reader, object writer):
- # If the socket is closed, stop.
- if self._closed:
- return
-
- # Close the connection if server is not started yet.
- if self._grpc_accept_cb == NULL:
- writer.close()
- return
-
- client_socket = _AsyncioSocket.create(
- self._grpc_client_socket,
- reader,
- writer,
- )
-
- self._grpc_client_socket.impl = <void*>client_socket
- cpython.Py_INCREF(client_socket) # Py_DECREF in asyncio_socket_destroy
- # Accept callback expects to be called with:
- # * grpc_custom_socket: A grpc custom socket for server
- # * grpc_custom_socket: A grpc custom socket for client (with new Socket instance)
- # * grpc_error: An error object
- self._grpc_accept_cb(self._grpc_socket, self._grpc_client_socket, grpc_error_none())
-
- cdef listen(self):
- self._py_socket.listen(_ASYNCIO_STREAM_DEFAULT_SOCKET_BACKLOG)
- async def create_asyncio_server():
- self._server = await asyncio.start_server(
- self._new_connection_callback,
- sock=self._py_socket,
- )
-
- self._task_listen = self._loop.create_task(create_asyncio_server())
-
- cdef accept(self,
- grpc_custom_socket* grpc_socket_client,
- grpc_custom_accept_callback grpc_accept_cb):
- self._grpc_client_socket = grpc_socket_client
- self._grpc_accept_cb = grpc_accept_cb
-
- cdef tuple peername(self):
- return self._peername
-
- cdef tuple sockname(self):
- return self._py_socket.getsockname()
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi
deleted file mode 100644
index c1508373a4b..00000000000
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pyx.pxi
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2019 gRPC authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-cdef class _AsyncioTimer:
- def __cinit__(self):
- self._grpc_timer = NULL
- self._timer_future = None
- self._active = False
- self._loop = get_working_loop()
- cpython.Py_INCREF(self)
-
- @staticmethod
- cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout):
- timer = _AsyncioTimer()
- timer._grpc_timer = grpc_timer
- timer._timer_future = timer._loop.call_later(timeout, timer.on_time_up)
- timer._active = True
- return timer
-
- def on_time_up(self):
- self._active = False
- grpc_custom_timer_callback(self._grpc_timer, <grpc_error*>0)
- cpython.Py_DECREF(self)
-
- def __repr__(self):
- class_name = self.__class__.__name__
- id_ = id(self)
- return f"<{class_name} {id_} deadline={self._deadline} active={self._active}>"
-
- cdef stop(self):
- if not self._active:
- return
-
- self._timer_future.cancel()
- self._active = False
- cpython.Py_DECREF(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
index 4651a6b6f22..fe10c3883c3 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pxd.pxi
@@ -33,6 +33,7 @@ cdef class RPCState(GrpcCallWrapper):
cdef tuple trailing_metadata
cdef object compression_algorithm
cdef bint disable_next_compression
+ cdef object callbacks
cdef bytes method(self)
cdef tuple invocation_metadata(self)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
index 38c0d713522..1023a2006a6 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
@@ -59,6 +59,7 @@ cdef class RPCState:
self.trailing_metadata = _IMMUTABLE_EMPTY_METADATA
self.compression_algorithm = None
self.disable_next_compression = False
+ self.callbacks = []
cdef bytes method(self):
return _slice_bytes(self.details.method)
@@ -173,11 +174,17 @@ cdef class _ServicerContext:
if trailing_metadata == _IMMUTABLE_EMPTY_METADATA and self._rpc_state.trailing_metadata:
trailing_metadata = self._rpc_state.trailing_metadata
+ else:
+ raise_if_not_valid_trailing_metadata(trailing_metadata)
+ self._rpc_state.trailing_metadata = trailing_metadata
if details == '' and self._rpc_state.status_details:
details = self._rpc_state.status_details
+ else:
+ self._rpc_state.status_details = details
actual_code = get_status_code(code)
+ self._rpc_state.status_code = actual_code
self._rpc_state.status_sent = True
await _send_error_status_from_server(
@@ -195,17 +202,27 @@ cdef class _ServicerContext:
await self.abort(status.code, status.details, status.trailing_metadata)
def set_trailing_metadata(self, object metadata):
+ raise_if_not_valid_trailing_metadata(metadata)
self._rpc_state.trailing_metadata = tuple(metadata)
+ def trailing_metadata(self):
+ return self._rpc_state.trailing_metadata
+
def invocation_metadata(self):
return self._rpc_state.invocation_metadata()
def set_code(self, object code):
self._rpc_state.status_code = get_status_code(code)
+ def code(self):
+ return self._rpc_state.status_code
+
def set_details(self, str details):
self._rpc_state.status_details = details
+ def details(self):
+ return self._rpc_state.status_details
+
def set_compression(self, object compression):
if self._rpc_state.metadata_sent:
raise RuntimeError('Compression setting must be specified before sending initial metadata')
@@ -258,6 +275,16 @@ cdef class _ServicerContext:
else:
return max(_time_from_timespec(self._rpc_state.details.deadline) - time.time(), 0)
+ def add_done_callback(self, callback):
+ cb = functools.partial(callback, self)
+ self._rpc_state.callbacks.append(cb)
+
+ def done(self):
+ return self._rpc_state.status_sent
+
+ def cancelled(self):
+ return self._rpc_state.status_code == StatusCode.cancelled
+
cdef class _SyncServicerContext:
"""Sync servicer context for sync handler compatibility."""
@@ -688,6 +715,7 @@ async def _handle_exceptions(RPCState rpc_state, object rpc_coro, object loop):
else:
status_code = rpc_state.status_code
+ rpc_state.status_sent = True
await _send_error_status_from_server(
rpc_state,
status_code,
@@ -698,6 +726,19 @@ async def _handle_exceptions(RPCState rpc_state, object rpc_coro, object loop):
)
+cdef _add_callback_handler(object rpc_task, RPCState rpc_state):
+
+ def handle_callbacks(object unused_task):
+ try:
+ for callback in rpc_state.callbacks:
+ # The _ServicerContext object is bound in add_done_callback.
+ callback()
+ except:
+ _LOGGER.exception('Error in callback for method [%s]', _decode(rpc_state.method()))
+
+ rpc_task.add_done_callback(handle_callbacks)
+
+
async def _handle_cancellation_from_core(object rpc_task,
RPCState rpc_state,
object loop):
@@ -724,6 +765,7 @@ async def _schedule_rpc_coro(object rpc_coro,
rpc_coro,
loop,
))
+ _add_callback_handler(rpc_task, rpc_state)
await _handle_cancellation_from_core(rpc_task, rpc_state, loop)
@@ -845,7 +887,7 @@ cdef class AioServer:
self.add_generic_rpc_handlers(generic_handlers)
self._serving_task = None
- self._shutdown_lock = asyncio.Lock(loop=self._loop)
+ self._shutdown_lock = asyncio.Lock()
self._shutdown_completed = self._loop.create_future()
self._shutdown_callback_wrapper = CallbackWrapper(
self._shutdown_completed,
@@ -854,7 +896,7 @@ cdef class AioServer:
self._crash_exception = None
if interceptors:
- self._interceptors = interceptors
+ self._interceptors = tuple(interceptors)
else:
self._interceptors = ()
@@ -999,12 +1041,8 @@ cdef class AioServer:
else:
try:
await asyncio.wait_for(
- asyncio.shield(
- self._shutdown_completed,
- loop=self._loop
- ),
+ asyncio.shield(self._shutdown_completed),
grace,
- loop=self._loop,
)
except asyncio.TimeoutError:
# Cancels all ongoing calls by the end of grace period.
@@ -1024,12 +1062,8 @@ cdef class AioServer:
else:
try:
await asyncio.wait_for(
- asyncio.shield(
- self._shutdown_completed,
- loop=self._loop,
- ),
+ asyncio.shield(self._shutdown_completed),
timeout,
- loop=self._loop,
)
except asyncio.TimeoutError:
if self._crash_exception is not None:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi
index 54c55f85f12..5eb5f087067 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/completion_queue.pyx.pxi
@@ -31,7 +31,7 @@ cdef grpc_event _next(grpc_completion_queue *c_completion_queue, deadline) excep
c_timeout = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME), c_increment)
if gpr_time_cmp(c_timeout, c_deadline) > 0:
c_timeout = c_deadline
-
+
c_event = grpc_completion_queue_next(c_completion_queue, c_timeout, NULL)
if (c_event.type != GRPC_QUEUE_TIMEOUT or
@@ -73,6 +73,7 @@ cdef class CompletionQueue:
c_attrs.version = 1
c_attrs.cq_completion_type = GRPC_CQ_NEXT
c_attrs.cq_polling_type = GRPC_CQ_NON_LISTENING
+ c_attrs.cq_shutdown_cb = NULL
self.c_completion_queue = grpc_completion_queue_create(
grpc_completion_queue_factory_lookup(&c_attrs), &c_attrs, NULL);
else:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
index e7e59261b45..23de3a0b188 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi
@@ -45,14 +45,23 @@ cdef int _get_metadata(void *state,
cdef size_t metadata_count
cdef grpc_metadata *c_metadata
def callback(metadata, grpc_status_code status, bytes error_details):
+ cdef char* c_error_details = NULL
+ if error_details is not None:
+ c_error_details = <char*> error_details
if status == StatusCode.ok:
_store_c_metadata(metadata, &c_metadata, &metadata_count)
- cb(user_data, c_metadata, metadata_count, status, NULL)
+ with nogil:
+ cb(user_data, c_metadata, metadata_count, status, NULL)
_release_c_metadata(c_metadata, metadata_count)
else:
- cb(user_data, NULL, 0, status, error_details)
+ with nogil:
+ cb(user_data, NULL, 0, status, c_error_details)
args = context.service_url, context.method_name, callback,
- _spawn_callback_async(<object>state, args)
+ plugin = <object>state
+ if plugin._stored_ctx is not None:
+ plugin._stored_ctx.copy().run(_spawn_callback_async, plugin, args)
+ else:
+ _spawn_callback_async(<object>state, args)
return 0 # Asynchronous return
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/csds.pyx.pxi
index 76c3be0c57c..c33eb76e47f 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/timer.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/csds.pyx.pxi
@@ -1,4 +1,4 @@
-# Copyright 2019 gRPC authors.
+# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,14 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cdef class _AsyncioTimer:
- cdef:
- grpc_custom_timer * _grpc_timer
- object _timer_future
- bint _active
- object _loop
- @staticmethod
- cdef _AsyncioTimer create(grpc_custom_timer * grpc_timer, float timeout)
-
- cdef stop(self)
+def dump_xds_configs():
+ cdef grpc_slice client_config_in_slice
+ with nogil:
+ client_config_in_slice = grpc_dump_xds_configs()
+ cdef bytes result = _slice_bytes(client_config_in_slice)
+ return result
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
index 0b7c49a0377..f6854daa1da 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
@@ -42,8 +42,8 @@ cdef extern from "grpc/byte_buffer_reader.h":
cdef extern from "grpc/impl/codegen/grpc_types.h":
- ctypedef struct grpc_experimental_completion_queue_functor:
- void (*functor_run)(grpc_experimental_completion_queue_functor*, int);
+ ctypedef struct grpc_completion_queue_functor:
+ void (*functor_run)(grpc_completion_queue_functor*, int);
cdef extern from "grpc/grpc.h":
@@ -236,6 +236,7 @@ cdef extern from "grpc/grpc.h":
int version
grpc_cq_completion_type cq_completion_type
grpc_cq_polling_type cq_polling_type
+ void* cq_shutdown_cb
ctypedef enum grpc_connectivity_state:
GRPC_CHANNEL_IDLE
@@ -359,7 +360,7 @@ cdef extern from "grpc/grpc.h":
void grpc_completion_queue_destroy(grpc_completion_queue *cq) nogil
grpc_completion_queue *grpc_completion_queue_create_for_callback(
- grpc_experimental_completion_queue_functor* shutdown_callback,
+ grpc_completion_queue_functor* shutdown_callback,
void *reserved) nogil
grpc_call_error grpc_call_start_batch(
@@ -406,13 +407,14 @@ cdef extern from "grpc/grpc.h":
grpc_server* server, grpc_server_config_fetcher* config_fetcher) nogil
ctypedef struct grpc_server_xds_status_notifier:
- void (*on_serving_status_change)(void* user_data, const char* uri,
+ void (*on_serving_status_update)(void* user_data, const char* uri,
grpc_status_code code,
const char* error_message)
void* user_data;
grpc_server_config_fetcher* grpc_server_config_fetcher_xds_create(
- grpc_server_xds_status_notifier notifier) nogil
+ grpc_server_xds_status_notifier notifier,
+ const grpc_channel_args* args) nogil
int grpc_server_add_insecure_http2_port(
@@ -433,6 +435,8 @@ cdef extern from "grpc/grpc.h":
char* grpc_channelz_get_subchannel(intptr_t subchannel_id)
char* grpc_channelz_get_socket(intptr_t socket_id)
+ grpc_slice grpc_dump_xds_configs() nogil
+
cdef extern from "grpc/grpc_security.h":
@@ -584,7 +588,7 @@ cdef extern from "grpc/grpc_security.h":
ctypedef void (*grpc_credentials_plugin_metadata_cb)(
void *user_data, const grpc_metadata *creds_md, size_t num_creds_md,
- grpc_status_code status, const char *error_details)
+ grpc_status_code status, const char *error_details) nogil
ctypedef struct grpc_metadata_credentials_plugin:
int (*get_metadata)(
@@ -697,3 +701,8 @@ cdef extern from "grpc/grpc_security_constants.h":
ctypedef enum grpc_local_connect_type:
UDS
LOCAL_TCP
+
+
+cdef extern from "src/core/lib/iomgr/error.h":
+ ctypedef grpc_error* grpc_error_handle
+ grpc_error_handle GRPC_ERROR_CANCELLED
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
index d857317ead0..9aa012de0b1 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/grpc_gevent.pyx.pxi
@@ -15,6 +15,7 @@
from libc cimport string
import errno
+import sys
gevent_g = None
gevent_socket = None
gevent_hub = None
@@ -41,7 +42,7 @@ cdef class SocketWrapper:
def __dealloc__(self):
grpc_shutdown()
-cdef grpc_error* socket_init(grpc_custom_socket* socket, int domain) with gil:
+cdef grpc_error_handle socket_init(grpc_custom_socket* socket, int domain) with gil:
sw = SocketWrapper()
sw.c_socket = socket
sw.sockopts = []
@@ -168,7 +169,7 @@ cdef void socket_read(grpc_custom_socket* socket, char* buffer,
sw.len = length
_spawn_greenlet(socket_read_async, sw)
-cdef grpc_error* socket_getpeername(grpc_custom_socket* socket,
+cdef grpc_error_handle socket_getpeername(grpc_custom_socket* socket,
const grpc_sockaddr* addr,
int* length) with gil:
cdef char* src_buf
@@ -181,7 +182,7 @@ cdef grpc_error* socket_getpeername(grpc_custom_socket* socket,
length[0] = c_addr.len
return grpc_error_none()
-cdef grpc_error* socket_getsockname(grpc_custom_socket* socket,
+cdef grpc_error_handle socket_getsockname(grpc_custom_socket* socket,
const grpc_sockaddr* addr,
int* length) with gil:
cdef char* src_buf
@@ -200,7 +201,7 @@ def applysockopts(s):
s.setsockopt(gevent_socket.SOL_SOCKET, gevent_socket.SO_REUSEADDR, 1)
s.setsockopt(gevent_socket.IPPROTO_TCP, gevent_socket.TCP_NODELAY, True)
-cdef grpc_error* socket_bind(grpc_custom_socket* socket,
+cdef grpc_error_handle socket_bind(grpc_custom_socket* socket,
const grpc_sockaddr* addr,
size_t len, int flags) with gil:
addr_tuple = sockaddr_to_tuple(addr, len)
@@ -219,7 +220,7 @@ cdef grpc_error* socket_bind(grpc_custom_socket* socket,
else:
return grpc_error_none()
-cdef grpc_error* socket_listen(grpc_custom_socket* socket) with gil:
+cdef grpc_error_handle socket_listen(grpc_custom_socket* socket) with gil:
(<SocketWrapper>socket.impl).socket.listen(50)
return grpc_error_none()
@@ -290,7 +291,7 @@ cdef void socket_resolve_async(grpc_custom_resolver* r, const char* host, const
rw.c_port = port
_spawn_greenlet(socket_resolve_async_python, rw)
-cdef grpc_error* socket_resolve(const char* host, const char* port,
+cdef grpc_error_handle socket_resolve(const char* host, const char* port,
grpc_resolved_addresses** res) with gil:
try:
result = gevent_socket.getaddrinfo(host, port)
@@ -348,12 +349,24 @@ cdef void destroy_loop() with gil:
cdef void kick_loop() with gil:
g_event.set()
-cdef void run_loop(size_t timeout_ms) with gil:
- timeout = timeout_ms / 1000.0
- if timeout_ms > 0:
+def _run_loop(timeout_ms):
+ timeout = timeout_ms / 1000.0
+ if timeout_ms > 0:
+ try:
g_event.wait(timeout)
+ finally:
g_event.clear()
+cdef grpc_error_handle run_loop(size_t timeout_ms) with gil:
+ try:
+ _run_loop(timeout_ms)
+ return grpc_error_none()
+ except BaseException:
+ exc_info = sys.exc_info()
+ # Avoid running any Python code after setting the exception
+ cpython.PyErr_SetObject(exc_info[0], exc_info[1])
+ return GRPC_ERROR_CANCELLED
+
###############################
### Initializer ###############
###############################
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
index 0c5a4e5763d..5f4a51f76f0 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pxd.pxi
@@ -23,11 +23,12 @@ cdef extern from "grpc/impl/codegen/slice.h":
cdef extern from "src/core/lib/iomgr/error.h":
struct grpc_error:
pass
+ ctypedef grpc_error* grpc_error_handle
# TODO(https://github.com/grpc/grpc/issues/20135) Change the filename
# for something more meaningful.
cdef extern from "src/core/lib/iomgr/python_util.h":
- grpc_error* grpc_socket_error(char* error)
+ grpc_error_handle grpc_socket_error(char* error)
char* grpc_slice_buffer_start(grpc_slice_buffer* buffer, int i)
int grpc_slice_buffer_length(grpc_slice_buffer* buffer, int i)
@@ -49,12 +50,12 @@ cdef extern from "src/core/lib/iomgr/resolve_address_custom.h":
pass
struct grpc_custom_resolver_vtable:
- grpc_error* (*resolve)(const char* host, const char* port, grpc_resolved_addresses** res);
+ grpc_error_handle (*resolve)(const char* host, const char* port, grpc_resolved_addresses** res);
void (*resolve_async)(grpc_custom_resolver* resolver, const char* host, const char* port);
void grpc_custom_resolve_callback(grpc_custom_resolver* resolver,
grpc_resolved_addresses* result,
- grpc_error* error);
+ grpc_error_handle error);
cdef extern from "src/core/lib/iomgr/tcp_custom.h":
cdef int GRPC_CUSTOM_SOCKET_OPT_SO_REUSEPORT
@@ -63,18 +64,18 @@ cdef extern from "src/core/lib/iomgr/tcp_custom.h":
void* impl
# We don't care about the rest of the fields
ctypedef void (*grpc_custom_connect_callback)(grpc_custom_socket* socket,
- grpc_error* error)
+ grpc_error_handle error)
ctypedef void (*grpc_custom_write_callback)(grpc_custom_socket* socket,
- grpc_error* error)
+ grpc_error_handle error)
ctypedef void (*grpc_custom_read_callback)(grpc_custom_socket* socket,
- size_t nread, grpc_error* error)
+ size_t nread, grpc_error_handle error)
ctypedef void (*grpc_custom_accept_callback)(grpc_custom_socket* socket,
grpc_custom_socket* client,
- grpc_error* error)
+ grpc_error_handle error)
ctypedef void (*grpc_custom_close_callback)(grpc_custom_socket* socket)
struct grpc_socket_vtable:
- grpc_error* (*init)(grpc_custom_socket* socket, int domain);
+ grpc_error_handle (*init)(grpc_custom_socket* socket, int domain);
void (*connect)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
size_t len, grpc_custom_connect_callback cb);
void (*destroy)(grpc_custom_socket* socket);
@@ -84,13 +85,13 @@ cdef extern from "src/core/lib/iomgr/tcp_custom.h":
grpc_custom_write_callback cb);
void (*read)(grpc_custom_socket* socket, char* buffer, size_t length,
grpc_custom_read_callback cb);
- grpc_error* (*getpeername)(grpc_custom_socket* socket,
+ grpc_error_handle (*getpeername)(grpc_custom_socket* socket,
const grpc_sockaddr* addr, int* len);
- grpc_error* (*getsockname)(grpc_custom_socket* socket,
+ grpc_error_handle (*getsockname)(grpc_custom_socket* socket,
const grpc_sockaddr* addr, int* len);
- grpc_error* (*bind)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
+ grpc_error_handle (*bind)(grpc_custom_socket* socket, const grpc_sockaddr* addr,
size_t len, int flags);
- grpc_error* (*listen)(grpc_custom_socket* socket);
+ grpc_error_handle (*listen)(grpc_custom_socket* socket);
void (*accept)(grpc_custom_socket* socket, grpc_custom_socket* client,
grpc_custom_accept_callback cb);
@@ -104,12 +105,12 @@ cdef extern from "src/core/lib/iomgr/timer_custom.h":
void (*start)(grpc_custom_timer* t);
void (*stop)(grpc_custom_timer* t);
- void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* error);
+ void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error_handle error);
cdef extern from "src/core/lib/iomgr/pollset_custom.h":
struct grpc_custom_poller_vtable:
void (*init)()
- void (*poll)(size_t timeout_ms)
+ grpc_error_handle (*poll)(size_t timeout_ms)
void (*kick)()
void (*shutdown)()
@@ -119,11 +120,11 @@ cdef extern from "src/core/lib/iomgr/iomgr_custom.h":
grpc_custom_timer_vtable* timer,
grpc_custom_poller_vtable* poller);
-cdef extern from "src/core/lib/iomgr/sockaddr_utils.h":
+cdef extern from "src/core/lib/address_utils/sockaddr_utils.h":
int grpc_sockaddr_get_port(const grpc_resolved_address *addr);
cppstring grpc_sockaddr_to_string(const grpc_resolved_address *addr,
bool_t normalize);
- void grpc_string_to_sockaddr(grpc_resolved_address *out, char* addr, int port);
+ grpc_error_handle grpc_string_to_sockaddr(grpc_resolved_address *out, char* addr, int port);
int grpc_sockaddr_set_port(const grpc_resolved_address *resolved_addr,
int port)
const char* grpc_sockaddr_get_uri_scheme(const grpc_resolved_address* resolved_addr)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
index 3d6bb24f9a1..292e0473af6 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/iomgr.pyx.pxi
@@ -17,10 +17,10 @@ from libc cimport string
from libc.stdlib cimport malloc
from libcpp.string cimport string as cppstring
-cdef grpc_error* grpc_error_none():
- return <grpc_error*>0
+cdef grpc_error_handle grpc_error_none():
+ return <grpc_error_handle>0
-cdef grpc_error* socket_error(str syscall, str err):
+cdef grpc_error_handle socket_error(str syscall, str err):
error_str = "{} failed: {}".format(syscall, err)
error_bytes = str_to_bytes(error_str)
return grpc_socket_error(error_bytes)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
index ed1dda292d6..d3caf3a5b84 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/server.pyx.pxi
@@ -26,11 +26,11 @@ cdef class Server:
cdef _ChannelArgs channel_args = _ChannelArgs(arguments)
self.c_server = grpc_server_create(channel_args.c_args(), NULL)
cdef grpc_server_xds_status_notifier notifier
- notifier.on_serving_status_change = NULL
+ notifier.on_serving_status_update = NULL
notifier.user_data = NULL
if xds:
grpc_server_set_config_fetcher(self.c_server,
- grpc_server_config_fetcher_xds_create(notifier))
+ grpc_server_config_fetcher_xds_create(notifier, channel_args.c_args()))
self.references.append(arguments)
def request_call(
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
index 166be370227..70c5b5d31d0 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pxd
@@ -42,9 +42,6 @@ IF UNAME_SYSNAME != "Windows":
include "_cygrpc/fork_posix.pxd.pxi"
# Following pxi files are part of the Aio module
-include "_cygrpc/aio/iomgr/socket.pxd.pxi"
-include "_cygrpc/aio/iomgr/timer.pxd.pxi"
-include "_cygrpc/aio/iomgr/resolver.pxd.pxi"
include "_cygrpc/aio/completion_queue.pxd.pxi"
include "_cygrpc/aio/rpc_status.pxd.pxi"
include "_cygrpc/aio/grpc_aio.pxd.pxi"
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
index 8d355c6fbbb..1a9eabe17c8 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_cython/cygrpc.pyx
@@ -41,6 +41,7 @@ include "_cygrpc/arguments.pyx.pxi"
include "_cygrpc/call.pyx.pxi"
include "_cygrpc/channel.pyx.pxi"
include "_cygrpc/channelz.pyx.pxi"
+include "_cygrpc/csds.pyx.pxi"
include "_cygrpc/credentials.pyx.pxi"
include "_cygrpc/completion_queue.pyx.pxi"
include "_cygrpc/event.pyx.pxi"
@@ -67,10 +68,6 @@ ELSE:
include "_cygrpc/fork_posix.pyx.pxi"
# Following pxi files are part of the Aio module
-include "_cygrpc/aio/iomgr/iomgr.pyx.pxi"
-include "_cygrpc/aio/iomgr/socket.pyx.pxi"
-include "_cygrpc/aio/iomgr/timer.pyx.pxi"
-include "_cygrpc/aio/iomgr/resolver.pyx.pxi"
include "_cygrpc/aio/common.pyx.pxi"
include "_cygrpc/aio/rpc_status.pyx.pxi"
include "_cygrpc/aio/completion_queue.pyx.pxi"
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py b/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
index d182b9b7685..10322bde182 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_grpcio_metadata.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc/_grpcio_metadata.py.template`!!!
-__version__ = """1.37.1"""
+__version__ = """1.43.2"""
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py b/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
index e3bfa909169..ad74b256a37 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_plugin_wrapping.py
@@ -68,6 +68,18 @@ class _Plugin(object):
def __init__(self, metadata_plugin):
self._metadata_plugin = metadata_plugin
+ self._stored_ctx = None
+
+ try:
+ import contextvars # pylint: disable=wrong-import-position
+
+ # The plugin may be invoked on a thread created by Core, which will not
+ # have the context propagated. This context is stored and installed in
+ # the thread invoking the plugin.
+ self._stored_ctx = contextvars.copy_context()
+ except ImportError:
+ # Support versions predating contextvars.
+ pass
def __call__(self, service_url, method_name, callback):
context = _AuthMetadataContext(_common.decode(service_url),
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
index 069ffa79822..58ab14feb3d 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_server.py
@@ -14,19 +14,18 @@
"""Service-side implementation of gRPC Python."""
import collections
+from concurrent import futures
import enum
import logging
import threading
import time
-from concurrent import futures
-import six
-
import grpc
from grpc import _common
from grpc import _compression
from grpc import _interceptor
from grpc._cython import cygrpc
+import six
_LOGGER = logging.getLogger(__name__)
@@ -305,6 +304,9 @@ class _Context(grpc.ServicerContext):
with self._state.condition:
self._state.trailing_metadata = trailing_metadata
+ def trailing_metadata(self):
+ return self._state.trailing_metadata
+
def abort(self, code, details):
# treat OK like other invalid arguments: fail the RPC
if code == grpc.StatusCode.OK:
@@ -326,10 +328,16 @@ class _Context(grpc.ServicerContext):
with self._state.condition:
self._state.code = code
+ def code(self):
+ return self._state.code
+
def set_details(self, details):
with self._state.condition:
self._state.details = _common.encode(details)
+ def details(self):
+ return self._state.details
+
def _finalize_state(self):
pass
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py b/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
index 3dd44c705ed..54c2a2d5dbd 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_simple_stubs.py
@@ -15,8 +15,8 @@
import collections
import datetime
-import os
import logging
+import os
import threading
from typing import (Any, AnyStr, Callable, Dict, Iterator, Optional, Sequence,
Tuple, TypeVar, Union)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_utilities.py b/contrib/libs/grpc/src/python/grpcio/grpc/_utilities.py
index c48aaf60a2f..9293c9bcefd 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_utilities.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/_utilities.py
@@ -14,14 +14,13 @@
"""Internal utilities for gRPC Python."""
import collections
+import logging
import threading
import time
-import logging
-
-import six
import grpc
from grpc import _common
+import six
_LOGGER = logging.getLogger(__name__)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
index 2933aa5a45e..3436d2ef98c 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/__init__.py
@@ -20,27 +20,41 @@ created. AsyncIO doesn't provide thread safety for most of its APIs.
from typing import Any, Optional, Sequence, Tuple
import grpc
-from grpc._cython.cygrpc import (init_grpc_aio, shutdown_grpc_aio, EOF,
- AbortError, BaseError, InternalError,
- UsageError)
+from grpc._cython.cygrpc import AbortError
+from grpc._cython.cygrpc import BaseError
+from grpc._cython.cygrpc import EOF
+from grpc._cython.cygrpc import InternalError
+from grpc._cython.cygrpc import UsageError
+from grpc._cython.cygrpc import init_grpc_aio
+from grpc._cython.cygrpc import shutdown_grpc_aio
-from ._base_call import (Call, RpcContext, StreamStreamCall, StreamUnaryCall,
- UnaryStreamCall, UnaryUnaryCall)
-from ._base_channel import (Channel, StreamStreamMultiCallable,
- StreamUnaryMultiCallable, UnaryStreamMultiCallable,
- UnaryUnaryMultiCallable)
+from ._base_call import Call
+from ._base_call import RpcContext
+from ._base_call import StreamStreamCall
+from ._base_call import StreamUnaryCall
+from ._base_call import UnaryStreamCall
+from ._base_call import UnaryUnaryCall
+from ._base_channel import Channel
+from ._base_channel import StreamStreamMultiCallable
+from ._base_channel import StreamUnaryMultiCallable
+from ._base_channel import UnaryStreamMultiCallable
+from ._base_channel import UnaryUnaryMultiCallable
+from ._base_server import Server
+from ._base_server import ServicerContext
from ._call import AioRpcError
-from ._interceptor import (ClientCallDetails, ClientInterceptor,
- InterceptedUnaryUnaryCall,
- UnaryUnaryClientInterceptor,
- UnaryStreamClientInterceptor,
- StreamUnaryClientInterceptor,
- StreamStreamClientInterceptor, ServerInterceptor)
+from ._channel import insecure_channel
+from ._channel import secure_channel
+from ._interceptor import ClientCallDetails
+from ._interceptor import ClientInterceptor
+from ._interceptor import InterceptedUnaryUnaryCall
+from ._interceptor import ServerInterceptor
+from ._interceptor import StreamStreamClientInterceptor
+from ._interceptor import StreamUnaryClientInterceptor
+from ._interceptor import UnaryStreamClientInterceptor
+from ._interceptor import UnaryUnaryClientInterceptor
+from ._metadata import Metadata
from ._server import server
-from ._base_server import Server, ServicerContext
from ._typing import ChannelArgumentType
-from ._channel import insecure_channel, secure_channel
-from ._metadata import Metadata
################################### __all__ #################################
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
index 4ccbb3be132..029584e94a5 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_call.py
@@ -18,13 +18,17 @@ its information. They also offer methods to manipulate the life-cycle of the
RPC, e.g. cancellation.
"""
-from abc import ABCMeta, abstractmethod
+from abc import ABCMeta
+from abc import abstractmethod
from typing import AsyncIterable, Awaitable, Generic, Optional, Union
import grpc
-from ._typing import (DoneCallbackType, EOFType, RequestType, ResponseType)
from ._metadata import Metadata
+from ._typing import DoneCallbackType
+from ._typing import EOFType
+from ._typing import RequestType
+from ._typing import ResponseType
__all__ = 'RpcContext', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
index b9a47efb41c..24be9246b97 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_channel.py
@@ -19,9 +19,10 @@ from typing import Any, Optional
import grpc
from . import _base_call
-from ._typing import (DeserializingFunction, RequestIterableType,
- SerializingFunction)
-from ._metadata import Metadata
+from ._typing import DeserializingFunction
+from ._typing import MetadataType
+from ._typing import RequestIterableType
+from ._typing import SerializingFunction
class UnaryUnaryMultiCallable(abc.ABC):
@@ -33,7 +34,7 @@ class UnaryUnaryMultiCallable(abc.ABC):
request: Any,
*,
timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
+ metadata: Optional[MetadataType] = None,
credentials: Optional[grpc.CallCredentials] = None,
wait_for_ready: Optional[bool] = None,
compression: Optional[grpc.Compression] = None
@@ -72,7 +73,7 @@ class UnaryStreamMultiCallable(abc.ABC):
request: Any,
*,
timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
+ metadata: Optional[MetadataType] = None,
credentials: Optional[grpc.CallCredentials] = None,
wait_for_ready: Optional[bool] = None,
compression: Optional[grpc.Compression] = None
@@ -110,7 +111,7 @@ class StreamUnaryMultiCallable(abc.ABC):
self,
request_iterator: Optional[RequestIterableType] = None,
timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
+ metadata: Optional[MetadataType] = None,
credentials: Optional[grpc.CallCredentials] = None,
wait_for_ready: Optional[bool] = None,
compression: Optional[grpc.Compression] = None
@@ -149,7 +150,7 @@ class StreamStreamMultiCallable(abc.ABC):
self,
request_iterator: Optional[RequestIterableType] = None,
timeout: Optional[float] = None,
- metadata: Optional[Metadata] = None,
+ metadata: Optional[MetadataType] = None,
credentials: Optional[grpc.CallCredentials] = None,
wait_for_ready: Optional[bool] = None,
compression: Optional[grpc.Compression] = None
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
index 7cbedf9b60c..263ac8d9318 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_base_server.py
@@ -14,12 +14,15 @@
"""Abstract base classes for server-side classes."""
import abc
-from typing import Generic, Mapping, Optional, Iterable, Sequence
+from typing import Generic, Iterable, Mapping, Optional, Sequence
import grpc
-from ._typing import RequestType, ResponseType
from ._metadata import Metadata
+from ._typing import DoneCallbackType
+from ._typing import MetadataType
+from ._typing import RequestType
+from ._typing import ResponseType
class Server(abc.ABC):
@@ -131,6 +134,7 @@ class Server(abc.ABC):
"""
+# pylint: disable=too-many-public-methods
class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
"""A context object passed to method implementations."""
@@ -158,7 +162,8 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
"""
@abc.abstractmethod
- async def send_initial_metadata(self, initial_metadata: Metadata) -> None:
+ async def send_initial_metadata(self,
+ initial_metadata: MetadataType) -> None:
"""Sends the initial metadata value to the client.
This method need not be called by implementations if they have no
@@ -173,7 +178,7 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
self,
code: grpc.StatusCode,
details: str = '',
- trailing_metadata: Metadata = tuple()) -> None:
+ trailing_metadata: MetadataType = tuple()) -> None:
"""Raises an exception to terminate the RPC with a non-OK status.
The code and details passed as arguments will supercede any existing
@@ -193,7 +198,7 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
"""
@abc.abstractmethod
- async def set_trailing_metadata(self, trailing_metadata: Metadata) -> None:
+ def set_trailing_metadata(self, trailing_metadata: MetadataType) -> None:
"""Sends the trailing metadata for the RPC.
This method need not be called by implementations if they have no
@@ -205,7 +210,7 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
@abc.abstractmethod
def invocation_metadata(self) -> Optional[Metadata]:
- """Accesses the metadata from the sent by the client.
+ """Accesses the metadata sent by the client.
Returns:
The invocation :term:`metadata`.
@@ -304,3 +309,65 @@ class ServicerContext(Generic[RequestType, ResponseType], abc.ABC):
remaining for the RPC to complete before it is considered to have
timed out, or None if no deadline was specified for the RPC.
"""
+
+ def trailing_metadata(self):
+ """Access value to be used as trailing metadata upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The trailing :term:`metadata` for the RPC.
+ """
+ raise NotImplementedError()
+
+ def code(self):
+ """Accesses the value to be used as status code upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The StatusCode value for the RPC.
+ """
+ raise NotImplementedError()
+
+ def details(self):
+ """Accesses the value to be used as detail string upon RPC completion.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ The details string of the RPC.
+ """
+ raise NotImplementedError()
+
+ def add_done_callback(self, callback: DoneCallbackType) -> None:
+ """Registers a callback to be called on RPC termination.
+
+ This is an EXPERIMENTAL API.
+
+ Args:
+ callback: A callable object will be called with the servicer context
+ object as its only argument.
+ """
+
+ def cancelled(self) -> bool:
+ """Return True if the RPC is cancelled.
+
+ The RPC is cancelled when the cancellation was requested with cancel().
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ A bool indicates whether the RPC is cancelled or not.
+ """
+
+ def done(self) -> bool:
+ """Return True if the RPC is done.
+
+ An RPC is done if the RPC is completed, cancelled or aborted.
+
+ This is an EXPERIMENTAL API.
+
+ Returns:
+ A bool indicates if the RPC is done.
+ """
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
index def89b4df01..31f7ea1b5e4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_call.py
@@ -15,9 +15,10 @@
import asyncio
import enum
+from functools import partial
import inspect
import logging
-from functools import partial
+import traceback
from typing import AsyncIterable, Optional, Tuple
import grpc
@@ -26,9 +27,13 @@ from grpc._cython import cygrpc
from . import _base_call
from ._metadata import Metadata
-from ._typing import (DeserializingFunction, DoneCallbackType, MetadatumType,
- RequestIterableType, RequestType, ResponseType,
- SerializingFunction)
+from ._typing import DeserializingFunction
+from ._typing import DoneCallbackType
+from ._typing import MetadatumType
+from ._typing import RequestIterableType
+from ._typing import RequestType
+from ._typing import ResponseType
+from ._typing import SerializingFunction
__all__ = 'AioRpcError', 'Call', 'UnaryUnaryCall', 'UnaryStreamCall'
@@ -160,7 +165,7 @@ class Call:
_loop: asyncio.AbstractEventLoop
_code: grpc.StatusCode
_cython_call: cygrpc._AioCall
- _metadata: Tuple[MetadatumType]
+ _metadata: Tuple[MetadatumType, ...]
_request_serializer: SerializingFunction
_response_deserializer: DeserializingFunction
@@ -366,7 +371,7 @@ class _StreamRequestMixin(Call):
def _init_stream_request_mixin(
self, request_iterator: Optional[RequestIterableType]):
- self._metadata_sent = asyncio.Event(loop=self._loop)
+ self._metadata_sent = asyncio.Event()
self._done_writing_flag = False
# If user passes in an async iterator, create a consumer Task.
@@ -399,18 +404,31 @@ class _StreamRequestMixin(Call):
if inspect.isasyncgen(request_iterator) or hasattr(
request_iterator, '__aiter__'):
async for request in request_iterator:
- await self._write(request)
+ try:
+ await self._write(request)
+ except AioRpcError as rpc_error:
+ _LOGGER.debug(
+ 'Exception while consuming the request_iterator: %s',
+ rpc_error)
+ return
else:
for request in request_iterator:
- await self._write(request)
+ try:
+ await self._write(request)
+ except AioRpcError as rpc_error:
+ _LOGGER.debug(
+ 'Exception while consuming the request_iterator: %s',
+ rpc_error)
+ return
await self._done_writing()
- except AioRpcError as rpc_error:
- # Rpc status should be exposed through other API. Exceptions raised
- # within this Task won't be retrieved by another coroutine. It's
- # better to suppress the error than spamming users' screen.
- _LOGGER.debug('Exception while consuming the request_iterator: %s',
- rpc_error)
+ except: # pylint: disable=bare-except
+ # Client iterators can raise exceptions, which we should handle by
+ # cancelling the RPC and logging the client's error. No exceptions
+ # should escape this function.
+ _LOGGER.debug('Client request_iterator raised exception:\n%s',
+ traceback.format_exc())
+ self.cancel()
async def _write(self, request: RequestType) -> None:
if self.done():
@@ -426,6 +444,8 @@ class _StreamRequestMixin(Call):
self._request_serializer)
try:
await self._cython_call.send_serialized_message(serialized_request)
+ except cygrpc.InternalError:
+ await self._raise_for_status()
except asyncio.CancelledError:
if not self.cancelled():
self.cancel()
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
index 99f256e0b9c..442a4ce57a2 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_channel.py
@@ -15,23 +15,34 @@
import asyncio
import sys
-from typing import Any, Iterable, Optional, Sequence, List
+from typing import Any, Iterable, List, Optional, Sequence
import grpc
-from grpc import _common, _compression, _grpcio_metadata
+from grpc import _common
+from grpc import _compression
+from grpc import _grpcio_metadata
from grpc._cython import cygrpc
-from . import _base_call, _base_channel
-from ._call import (StreamStreamCall, StreamUnaryCall, UnaryStreamCall,
- UnaryUnaryCall)
-from ._interceptor import (
- InterceptedUnaryUnaryCall, InterceptedUnaryStreamCall,
- InterceptedStreamUnaryCall, InterceptedStreamStreamCall, ClientInterceptor,
- UnaryUnaryClientInterceptor, UnaryStreamClientInterceptor,
- StreamUnaryClientInterceptor, StreamStreamClientInterceptor)
+from . import _base_call
+from . import _base_channel
+from ._call import StreamStreamCall
+from ._call import StreamUnaryCall
+from ._call import UnaryStreamCall
+from ._call import UnaryUnaryCall
+from ._interceptor import ClientInterceptor
+from ._interceptor import InterceptedStreamStreamCall
+from ._interceptor import InterceptedStreamUnaryCall
+from ._interceptor import InterceptedUnaryStreamCall
+from ._interceptor import InterceptedUnaryUnaryCall
+from ._interceptor import StreamStreamClientInterceptor
+from ._interceptor import StreamUnaryClientInterceptor
+from ._interceptor import UnaryStreamClientInterceptor
+from ._interceptor import UnaryUnaryClientInterceptor
from ._metadata import Metadata
-from ._typing import (ChannelArgumentType, DeserializingFunction,
- SerializingFunction, RequestIterableType)
+from ._typing import ChannelArgumentType
+from ._typing import DeserializingFunction
+from ._typing import RequestIterableType
+from ._typing import SerializingFunction
from ._utils import _timeout_to_deadline
_USER_AGENT = 'grpc-python-asyncio/{}'.format(_grpcio_metadata.__version__)
@@ -347,7 +358,7 @@ class Channel(_base_channel.Channel):
# If needed, try to wait for them to finish.
# Call objects are not always awaitables.
if grace and call_tasks:
- await asyncio.wait(call_tasks, timeout=grace, loop=self._loop)
+ await asyncio.wait(call_tasks, timeout=grace)
# Time to cancel existing calls.
for call in calls:
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
index f62685c1278..8614c738589 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_interceptor.py
@@ -12,24 +12,35 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Interceptors implementation of gRPC Asyncio Python."""
+from abc import ABCMeta
+from abc import abstractmethod
import asyncio
import collections
import functools
-from abc import ABCMeta, abstractmethod
-from typing import Callable, Optional, Iterator, Sequence, Union, Awaitable, AsyncIterable
+from typing import (AsyncIterable, Awaitable, Callable, Iterator, Optional,
+ Sequence, Union)
import grpc
from grpc._cython import cygrpc
from . import _base_call
-from ._call import UnaryUnaryCall, UnaryStreamCall, StreamUnaryCall, StreamStreamCall, AioRpcError
-from ._call import _RPC_ALREADY_FINISHED_DETAILS, _RPC_HALF_CLOSED_DETAILS
+from ._call import AioRpcError
+from ._call import StreamStreamCall
+from ._call import StreamUnaryCall
+from ._call import UnaryStreamCall
+from ._call import UnaryUnaryCall
from ._call import _API_STYLE_ERROR
-from ._utils import _timeout_to_deadline
-from ._typing import (RequestType, SerializingFunction, DeserializingFunction,
- ResponseType, DoneCallbackType, RequestIterableType,
- ResponseIterableType)
+from ._call import _RPC_ALREADY_FINISHED_DETAILS
+from ._call import _RPC_HALF_CLOSED_DETAILS
from ._metadata import Metadata
+from ._typing import DeserializingFunction
+from ._typing import DoneCallbackType
+from ._typing import RequestIterableType
+from ._typing import RequestType
+from ._typing import ResponseIterableType
+from ._typing import ResponseType
+from ._typing import SerializingFunction
+from ._utils import _timeout_to_deadline
_LOCAL_CANCELLATION_DETAILS = 'Locally cancelled by application!'
@@ -169,7 +180,7 @@ class StreamUnaryClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
async def intercept_stream_unary(
self,
continuation: Callable[[ClientCallDetails, RequestType],
- UnaryStreamCall],
+ StreamUnaryCall],
client_call_details: ClientCallDetails,
request_iterator: RequestIterableType,
) -> StreamUnaryCall:
@@ -210,7 +221,7 @@ class StreamStreamClientInterceptor(ClientInterceptor, metaclass=ABCMeta):
async def intercept_stream_stream(
self,
continuation: Callable[[ClientCallDetails, RequestType],
- UnaryStreamCall],
+ StreamStreamCall],
client_call_details: ClientCallDetails,
request_iterator: RequestIterableType,
) -> Union[ResponseIterableType, StreamStreamCall]:
@@ -464,6 +475,7 @@ class _InterceptedStreamRequestMixin:
_write_to_iterator_async_gen: Optional[AsyncIterable[RequestType]]
_write_to_iterator_queue: Optional[asyncio.Queue]
+ _status_code_task: Optional[asyncio.Task]
_FINISH_ITERATOR_SENTINEL = object()
@@ -477,6 +489,7 @@ class _InterceptedStreamRequestMixin:
self._write_to_iterator_queue = asyncio.Queue(maxsize=1)
self._write_to_iterator_async_gen = self._proxy_writes_as_request_iterator(
)
+ self._status_code_task = None
request_iterator = self._write_to_iterator_async_gen
else:
self._write_to_iterator_queue = None
@@ -492,6 +505,19 @@ class _InterceptedStreamRequestMixin:
break
yield value
+ async def _write_to_iterator_queue_interruptible(self, request: RequestType,
+ call: InterceptedCall):
+ # Write the specified 'request' to the request iterator queue using the
+ # specified 'call' to allow for interruption of the write in the case
+ # of abrupt termination of the call.
+ if self._status_code_task is None:
+ self._status_code_task = self._loop.create_task(call.code())
+
+ await asyncio.wait(
+ (self._loop.create_task(self._write_to_iterator_queue.put(request)),
+ self._status_code_task),
+ return_when=asyncio.FIRST_COMPLETED)
+
async def write(self, request: RequestType) -> None:
# If no queue was created it means that requests
# should be expected through an iterators provided
@@ -509,11 +535,7 @@ class _InterceptedStreamRequestMixin:
elif call._done_writing_flag:
raise asyncio.InvalidStateError(_RPC_HALF_CLOSED_DETAILS)
- # Write might never end up since the call could abrubtly finish,
- # we give up on the first awaitable object that finishes.
- _, _ = await asyncio.wait(
- (self._write_to_iterator_queue.put(request), call.code()),
- return_when=asyncio.FIRST_COMPLETED)
+ await self._write_to_iterator_queue_interruptible(request, call)
if call.done():
raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
@@ -534,12 +556,8 @@ class _InterceptedStreamRequestMixin:
except asyncio.CancelledError:
raise asyncio.InvalidStateError(_RPC_ALREADY_FINISHED_DETAILS)
- # Write might never end up since the call could abrubtly finish,
- # we give up on the first awaitable object that finishes.
- _, _ = await asyncio.wait((self._write_to_iterator_queue.put(
- _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL),
- call.code()),
- return_when=asyncio.FIRST_COMPLETED)
+ await self._write_to_iterator_queue_interruptible(
+ _InterceptedStreamRequestMixin._FINISH_ITERATOR_SENTINEL, call)
class InterceptedUnaryUnaryCall(_InterceptedUnaryResponseMixin, InterceptedCall,
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
index 3c7d9244049..970f62c0590 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_metadata.py
@@ -12,8 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Implementation of the metadata abstraction for gRPC Asyncio Python."""
-from typing import List, Tuple, Iterator, Any, Union
-from collections import abc, OrderedDict
+from collections import OrderedDict
+from collections import abc
+from typing import Any, Iterator, List, Tuple, Union
MetadataKey = str
MetadataValue = Union[str, bytes]
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
index 4d7cb75892e..c4c0891f8d8 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_server.py
@@ -17,12 +17,13 @@ from concurrent.futures import Executor
from typing import Any, Optional, Sequence
import grpc
-from grpc import _common, _compression
+from grpc import _common
+from grpc import _compression
from grpc._cython import cygrpc
from . import _base_server
-from ._typing import ChannelArgumentType
from ._interceptor import ServerInterceptor
+from ._typing import ChannelArgumentType
def _augment_channel_arguments(base_options: ChannelArgumentType,
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
index 7e2e8da8a06..f9c0eb10fc7 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/aio/_typing.py
@@ -17,14 +17,17 @@ from typing import (Any, AsyncIterable, Callable, Iterable, Sequence, Tuple,
TypeVar, Union)
from grpc._cython.cygrpc import EOF
-from ._metadata import Metadata, MetadataKey, MetadataValue
+
+from ._metadata import Metadata
+from ._metadata import MetadataKey
+from ._metadata import MetadataValue
RequestType = TypeVar('RequestType')
ResponseType = TypeVar('ResponseType')
SerializingFunction = Callable[[Any], bytes]
DeserializingFunction = Callable[[bytes], Any]
MetadatumType = Tuple[MetadataKey, MetadataValue]
-MetadataType = Metadata
+MetadataType = Union[Metadata, Sequence[MetadatumType]]
ChannelArgumentType = Sequence[Tuple[str, Any]]
EOFType = type(EOF)
DoneCallbackType = Callable[[Any], None]
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py b/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
index c5507b543fb..43312aac7c8 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/beta/implementations.py
@@ -25,7 +25,8 @@ from grpc.beta import _metadata
from grpc.beta import _server_adaptations
from grpc.beta import interfaces # pylint: disable=unused-import
from grpc.framework.common import cardinality # pylint: disable=unused-import
-from grpc.framework.interfaces.face import face # pylint: disable=unused-import
+from grpc.framework.interfaces.face import \
+ face # pylint: disable=unused-import
# pylint: disable=too-many-arguments
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/beta/interfaces.py b/contrib/libs/grpc/src/python/grpcio/grpc/beta/interfaces.py
index fb8266c74bd..a1713329ccb 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/beta/interfaces.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/beta/interfaces.py
@@ -15,9 +15,8 @@
import abc
-import six
-
import grpc
+import six
ChannelConnectivity = grpc.ChannelConnectivity
# FATAL_FAILURE was a Beta-API name for SHUTDOWN
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
index c820bc9db3b..f0d142c981e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/experimental/__init__.py
@@ -121,5 +121,8 @@ __all__ = (
)
if sys.version_info > (3, 6):
- from grpc._simple_stubs import unary_unary, unary_stream, stream_unary, stream_stream
+ from grpc._simple_stubs import stream_stream
+ from grpc._simple_stubs import stream_unary
+ from grpc._simple_stubs import unary_stream
+ from grpc._simple_stubs import unary_unary
__all__ = __all__ + (unary_unary, unary_stream, stream_unary, stream_stream)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py b/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
index 421999fb1c3..53d2cd00825 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/framework/foundation/logging_pool.py
@@ -13,9 +13,8 @@
# limitations under the License.
"""A thread pool that logs exceptions raised by tasks executed within it."""
-import logging
-
from concurrent import futures
+import logging
_LOGGER = logging.getLogger(__name__)
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/base/base.py b/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/base/base.py
index 82c44f91104..9e63d6a931a 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/base/base.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/base/base.py
@@ -28,9 +28,6 @@ import threading # pylint: disable=unused-import
import six
-# abandonment is referenced from specification in this module.
-from grpc.framework.foundation import abandonment # pylint: disable=unused-import
-
# pylint: disable=too-many-arguments
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/face/face.py b/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/face/face.py
index 5b47f11d0d7..be173978c0e 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/face/face.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc/framework/interfaces/face/face.py
@@ -17,15 +17,13 @@ import abc
import collections
import enum
-import six
-
# cardinality, style, abandonment, future, and stream are
# referenced from specification in this module.
from grpc.framework.common import cardinality # pylint: disable=unused-import
from grpc.framework.common import style # pylint: disable=unused-import
-from grpc.framework.foundation import abandonment # pylint: disable=unused-import
from grpc.framework.foundation import future # pylint: disable=unused-import
from grpc.framework.foundation import stream # pylint: disable=unused-import
+import six
# pylint: disable=too-many-arguments
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py b/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
index f3d11423ef2..338b05b1ca4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc_core_dependencies.py
@@ -41,6 +41,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc',
'src/core/ext/filters/client_channel/lb_policy/priority/priority.cc',
'src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc',
+ 'src/core/ext/filters/client_channel/lb_policy/rls/rls.cc',
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc',
'src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc',
'src/core/ext/filters/client_channel/lb_policy/xds/cds.cc',
@@ -51,12 +52,13 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/local_subchannel_pool.cc',
'src/core/ext/filters/client_channel/proxy_mapper_registry.cc',
'src/core/ext/filters/client_channel/resolver.cc',
+ 'src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc',
- 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_libuv.cc',
+ 'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_event_engine.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc',
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc',
'src/core/ext/filters/client_channel/resolver/dns/dns_resolver_selection.cc',
@@ -67,14 +69,15 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc',
'src/core/ext/filters/client_channel/resolver_registry.cc',
'src/core/ext/filters/client_channel/resolver_result_parsing.cc',
+ 'src/core/ext/filters/client_channel/retry_filter.cc',
+ 'src/core/ext/filters/client_channel/retry_service_config.cc',
'src/core/ext/filters/client_channel/retry_throttle.cc',
'src/core/ext/filters/client_channel/server_address.cc',
- 'src/core/ext/filters/client_channel/service_config.cc',
'src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc',
- 'src/core/ext/filters/client_channel/service_config_parser.cc',
'src/core/ext/filters/client_channel/subchannel.cc',
'src/core/ext/filters/client_channel/subchannel_pool_interface.cc',
'src/core/ext/filters/client_idle/client_idle_filter.cc',
+ 'src/core/ext/filters/client_idle/idle_filter_state.cc',
'src/core/ext/filters/deadline/deadline_filter.cc',
'src/core/ext/filters/fault_injection/fault_injection_filter.cc',
'src/core/ext/filters/fault_injection/service_config_parser.cc',
@@ -86,10 +89,11 @@ CORE_SOURCE_FILES = [
'src/core/ext/filters/http/server/http_server_filter.cc',
'src/core/ext/filters/max_age/max_age_filter.cc',
'src/core/ext/filters/message_size/message_size_filter.cc',
- 'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc',
- 'src/core/ext/filters/workarounds/workaround_utils.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector.cc',
+ 'src/core/ext/filters/server_config_selector/server_config_selector_filter.cc',
+ 'src/core/ext/service_config/service_config.cc',
+ 'src/core/ext/service_config/service_config_parser.cc',
'src/core/ext/transport/chttp2/alpn/alpn.cc',
- 'src/core/ext/transport/chttp2/client/authority.cc',
'src/core/ext/transport/chttp2/client/chttp2_connector.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc',
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc',
@@ -111,11 +115,12 @@ CORE_SOURCE_FILES = [
'src/core/ext/transport/chttp2/transport/frame_settings.cc',
'src/core/ext/transport/chttp2/transport/frame_window_update.cc',
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_encoder_table.cc',
'src/core/ext/transport/chttp2/transport/hpack_parser.cc',
- 'src/core/ext/transport/chttp2/transport/hpack_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_parser_table.cc',
+ 'src/core/ext/transport/chttp2/transport/hpack_utils.cc',
'src/core/ext/transport/chttp2/transport/http2_settings.cc',
'src/core/ext/transport/chttp2/transport/huffsyms.cc',
- 'src/core/ext/transport/chttp2/transport/incoming_metadata.cc',
'src/core/ext/transport/chttp2/transport/parsing.cc',
'src/core/ext/transport/chttp2/transport/stream_lists.cc',
'src/core/ext/transport/chttp2/transport/stream_map.cc',
@@ -143,14 +148,17 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c',
'src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c',
'src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c',
+ 'src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c',
'src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c',
'src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c',
'src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c',
@@ -177,6 +185,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/envoy/service/route/v3/rds.upb.c',
'src/core/ext/upb-generated/envoy/service/route/v3/srds.upb.c',
'src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c',
+ 'src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c',
'src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c',
@@ -193,7 +202,10 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c',
'src/core/ext/upb-generated/google/api/annotations.upb.c',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c',
+ 'src/core/ext/upb-generated/google/api/expr/v1alpha1/eval.upb.c',
+ 'src/core/ext/upb-generated/google/api/expr/v1alpha1/explain.upb.c',
'src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c',
+ 'src/core/ext/upb-generated/google/api/expr/v1alpha1/value.upb.c',
'src/core/ext/upb-generated/google/api/http.upb.c',
'src/core/ext/upb-generated/google/protobuf/any.upb.c',
'src/core/ext/upb-generated/google/protobuf/descriptor.upb.c',
@@ -208,20 +220,22 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c',
'src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c',
+ 'src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c',
'src/core/ext/upb-generated/udpa/annotations/migrate.upb.c',
'src/core/ext/upb-generated/udpa/annotations/security.upb.c',
'src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c',
'src/core/ext/upb-generated/udpa/annotations/status.upb.c',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
- 'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
- 'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
+ 'src/core/ext/upb-generated/xds/annotations/v3/status.upb.c',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c',
'src/core/ext/upb-generated/xds/core/v3/context_params.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c',
'src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c',
+ 'src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c',
+ 'src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c',
'src/core/ext/upbdefs-generated/envoy/admin/v3/config_dump.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/annotations/deprecation.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/annotations/resource.upbdefs.c',
@@ -242,14 +256,17 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-generated/envoy/config/core/v3/http_uri.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/protocol.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/proxy_protocol.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/resolver.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/socket_option.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/core/v3/substitution_format_string.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/core/v3/udp_socket_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/endpoint_components.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/endpoint/v3/load_report.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/api_listener.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/config/listener/v3/quic_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/listener/v3/udp_listener_config.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/metrics/v3/stats.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/overload/v3/overload.upbdefs.c',
@@ -275,6 +292,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-generated/envoy/service/route/v3/rds.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/route/v3/srds.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/service/status/v3/csds.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/envoy/type/http/v3/path_transformation.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/metadata.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/node.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/type/matcher/v3/number.upbdefs.c',
@@ -304,28 +322,33 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
- 'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/annotations/v3/status.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/context_params.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_locator.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/resource_name.upbdefs.c',
+ 'src/core/ext/upbdefs-generated/xds/type/v3/typed_struct.upbdefs.c',
'src/core/ext/xds/certificate_provider_registry.cc',
'src/core/ext/xds/certificate_provider_store.cc',
'src/core/ext/xds/file_watcher_certificate_provider_factory.cc',
'src/core/ext/xds/xds_api.cc',
'src/core/ext/xds/xds_bootstrap.cc',
'src/core/ext/xds/xds_certificate_provider.cc',
+ 'src/core/ext/xds/xds_channel_stack_modifier.cc',
'src/core/ext/xds/xds_client.cc',
'src/core/ext/xds/xds_client_stats.cc',
'src/core/ext/xds/xds_http_fault_filter.cc',
'src/core/ext/xds/xds_http_filters.cc',
+ 'src/core/ext/xds/xds_routing.cc',
'src/core/ext/xds/xds_server_config_fetcher.cc',
- 'src/core/lib/avl/avl.cc',
+ 'src/core/lib/address_utils/parse_address.cc',
+ 'src/core/lib/address_utils/sockaddr_utils.cc',
'src/core/lib/backoff/backoff.cc',
'src/core/lib/channel/channel_args.cc',
+ 'src/core/lib/channel/channel_args_preconditioning.cc',
'src/core/lib/channel/channel_stack.cc',
'src/core/lib/channel/channel_stack_builder.cc',
'src/core/lib/channel/channel_trace.cc',
@@ -342,9 +365,15 @@ CORE_SOURCE_FILES = [
'src/core/lib/compression/stream_compression.cc',
'src/core/lib/compression/stream_compression_gzip.cc',
'src/core/lib/compression/stream_compression_identity.cc',
+ 'src/core/lib/config/core_configuration.cc',
'src/core/lib/debug/stats.cc',
'src/core/lib/debug/stats_data.cc',
'src/core/lib/debug/trace.cc',
+ 'src/core/lib/event_engine/channel_args_endpoint_config.cc',
+ 'src/core/lib/event_engine/event_engine.cc',
+ 'src/core/lib/event_engine/event_engine_factory.cc',
+ 'src/core/lib/event_engine/memory_allocator.cc',
+ 'src/core/lib/event_engine/sockaddr.cc',
'src/core/lib/gpr/alloc.cc',
'src/core/lib/gpr/atm.cc',
'src/core/lib/gpr/cpu_iphone.cc',
@@ -372,7 +401,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/gpr/time_posix.cc',
'src/core/lib/gpr/time_precise.cc',
'src/core/lib/gpr/time_windows.cc',
- 'src/core/lib/gpr/tls_pthread.cc',
'src/core/lib/gpr/tmpfile_msys.cc',
'src/core/lib/gpr/tmpfile_posix.cc',
'src/core/lib/gpr/tmpfile_windows.cc',
@@ -385,6 +413,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/gprpp/mpscq.cc',
'src/core/lib/gprpp/stat_posix.cc',
'src/core/lib/gprpp/stat_windows.cc',
+ 'src/core/lib/gprpp/status_helper.cc',
'src/core/lib/gprpp/thd_posix.cc',
'src/core/lib/gprpp/thd_windows.cc',
'src/core/lib/gprpp/time_util.cc',
@@ -399,8 +428,8 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/dualstack_socket_posix.cc',
'src/core/lib/iomgr/endpoint.cc',
'src/core/lib/iomgr/endpoint_cfstream.cc',
+ 'src/core/lib/iomgr/endpoint_pair_event_engine.cc',
'src/core/lib/iomgr/endpoint_pair_posix.cc',
- 'src/core/lib/iomgr/endpoint_pair_uv.cc',
'src/core/lib/iomgr/endpoint_pair_windows.cc',
'src/core/lib/iomgr/error.cc',
'src/core/lib/iomgr/error_cfstream.cc',
@@ -410,6 +439,14 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/ev_poll_posix.cc',
'src/core/lib/iomgr/ev_posix.cc',
'src/core/lib/iomgr/ev_windows.cc',
+ 'src/core/lib/iomgr/event_engine/closure.cc',
+ 'src/core/lib/iomgr/event_engine/endpoint.cc',
+ 'src/core/lib/iomgr/event_engine/iomgr.cc',
+ 'src/core/lib/iomgr/event_engine/pollset.cc',
+ 'src/core/lib/iomgr/event_engine/resolved_address_internal.cc',
+ 'src/core/lib/iomgr/event_engine/resolver.cc',
+ 'src/core/lib/iomgr/event_engine/tcp.cc',
+ 'src/core/lib/iomgr/event_engine/timer.cc',
'src/core/lib/iomgr/exec_ctx.cc',
'src/core/lib/iomgr/executor.cc',
'src/core/lib/iomgr/executor/mpmcqueue.cc',
@@ -428,33 +465,26 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/iomgr_internal.cc',
'src/core/lib/iomgr/iomgr_posix.cc',
'src/core/lib/iomgr/iomgr_posix_cfstream.cc',
- 'src/core/lib/iomgr/iomgr_uv.cc',
'src/core/lib/iomgr/iomgr_windows.cc',
'src/core/lib/iomgr/is_epollexclusive_available.cc',
'src/core/lib/iomgr/load_file.cc',
'src/core/lib/iomgr/lockfree_event.cc',
- 'src/core/lib/iomgr/parse_address.cc',
- 'src/core/lib/iomgr/poller/eventmanager_libuv.cc',
'src/core/lib/iomgr/polling_entity.cc',
'src/core/lib/iomgr/pollset.cc',
'src/core/lib/iomgr/pollset_custom.cc',
'src/core/lib/iomgr/pollset_set.cc',
'src/core/lib/iomgr/pollset_set_custom.cc',
'src/core/lib/iomgr/pollset_set_windows.cc',
- 'src/core/lib/iomgr/pollset_uv.cc',
'src/core/lib/iomgr/pollset_windows.cc',
'src/core/lib/iomgr/resolve_address.cc',
'src/core/lib/iomgr/resolve_address_custom.cc',
'src/core/lib/iomgr/resolve_address_posix.cc',
'src/core/lib/iomgr/resolve_address_windows.cc',
- 'src/core/lib/iomgr/resource_quota.cc',
- 'src/core/lib/iomgr/sockaddr_utils.cc',
'src/core/lib/iomgr/socket_factory_posix.cc',
'src/core/lib/iomgr/socket_mutator.cc',
'src/core/lib/iomgr/socket_utils_common_posix.cc',
'src/core/lib/iomgr/socket_utils_linux.cc',
'src/core/lib/iomgr/socket_utils_posix.cc',
- 'src/core/lib/iomgr/socket_utils_uv.cc',
'src/core/lib/iomgr/socket_utils_windows.cc',
'src/core/lib/iomgr/socket_windows.cc',
'src/core/lib/iomgr/tcp_client.cc',
@@ -471,7 +501,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc',
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc',
'src/core/lib/iomgr/tcp_server_windows.cc',
- 'src/core/lib/iomgr/tcp_uv.cc',
'src/core/lib/iomgr/tcp_windows.cc',
'src/core/lib/iomgr/time_averaged_stats.cc',
'src/core/lib/iomgr/timer.cc',
@@ -479,8 +508,6 @@ CORE_SOURCE_FILES = [
'src/core/lib/iomgr/timer_generic.cc',
'src/core/lib/iomgr/timer_heap.cc',
'src/core/lib/iomgr/timer_manager.cc',
- 'src/core/lib/iomgr/timer_uv.cc',
- 'src/core/lib/iomgr/udp_server.cc',
'src/core/lib/iomgr/unix_sockets_posix.cc',
'src/core/lib/iomgr/unix_sockets_posix_noop.cc',
'src/core/lib/iomgr/wakeup_fd_eventfd.cc',
@@ -494,6 +521,15 @@ CORE_SOURCE_FILES = [
'src/core/lib/matchers/matchers.cc',
'src/core/lib/profiling/basic_timers.cc',
'src/core/lib/profiling/stap_timers.cc',
+ 'src/core/lib/promise/activity.cc',
+ 'src/core/lib/resource_quota/api.cc',
+ 'src/core/lib/resource_quota/memory_quota.cc',
+ 'src/core/lib/resource_quota/resource_quota.cc',
+ 'src/core/lib/resource_quota/thread_quota.cc',
+ 'src/core/lib/resource_quota/trace.cc',
+ 'src/core/lib/security/authorization/authorization_policy_provider_vtable.cc',
+ 'src/core/lib/security/authorization/evaluate_args.cc',
+ 'src/core/lib/security/authorization/sdk_server_authz_filter.cc',
'src/core/lib/security/context/security_context.cc',
'src/core/lib/security/credentials/alts/alts_credentials.cc',
'src/core/lib/security/credentials/alts/check_gcp_environment.cc',
@@ -525,6 +561,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/security/credentials/ssl/ssl_credentials.cc',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_distributor.cc',
'src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.cc',
+ 'src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc',
'src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc',
'src/core/lib/security/credentials/tls/tls_credentials.cc',
'src/core/lib/security/credentials/tls/tls_utils.cc',
@@ -549,10 +586,15 @@ CORE_SOURCE_FILES = [
'src/core/lib/slice/b64.cc',
'src/core/lib/slice/percent_encoding.cc',
'src/core/lib/slice/slice.cc',
+ 'src/core/lib/slice/slice_api.cc',
'src/core/lib/slice/slice_buffer.cc',
'src/core/lib/slice/slice_intern.cc',
+ 'src/core/lib/slice/slice_refcount.cc',
+ 'src/core/lib/slice/slice_split.cc',
'src/core/lib/slice/slice_string_helpers.cc',
+ 'src/core/lib/slice/static_slice.cc',
'src/core/lib/surface/api_trace.cc',
+ 'src/core/lib/surface/builtins.cc',
'src/core/lib/surface/byte_buffer.cc',
'src/core/lib/surface/byte_buffer_reader.cc',
'src/core/lib/surface/call.cc',
@@ -572,13 +614,13 @@ CORE_SOURCE_FILES = [
'src/core/lib/surface/server.cc',
'src/core/lib/surface/validate_metadata.cc',
'src/core/lib/surface/version.cc',
- 'src/core/lib/transport/authority_override.cc',
'src/core/lib/transport/bdp_estimator.cc',
'src/core/lib/transport/byte_stream.cc',
'src/core/lib/transport/connectivity_state.cc',
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/metadata.cc',
'src/core/lib/transport/metadata_batch.cc',
+ 'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',
@@ -616,7 +658,6 @@ CORE_SOURCE_FILES = [
'src/core/tsi/transport_security.cc',
'src/core/tsi/transport_security_grpc.cc',
'third_party/abseil-cpp/y_absl/base/internal/cycleclock.cc',
- 'third_party/abseil-cpp/y_absl/base/internal/exponential_biased.cc',
'third_party/abseil-cpp/y_absl/base/internal/low_level_alloc.cc',
'third_party/abseil-cpp/y_absl/base/internal/raw_logging.cc',
'third_party/abseil-cpp/y_absl/base/internal/spinlock.cc',
@@ -637,7 +678,9 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/y_absl/debugging/symbolize.cc',
'third_party/abseil-cpp/y_absl/hash/internal/city.cc',
'third_party/abseil-cpp/y_absl/hash/internal/hash.cc',
+ 'third_party/abseil-cpp/y_absl/hash/internal/low_level_hash.cc',
'third_party/abseil-cpp/y_absl/numeric/int128.cc',
+ 'third_party/abseil-cpp/y_absl/profiling/internal/exponential_biased.cc',
'third_party/abseil-cpp/y_absl/status/status.cc',
'third_party/abseil-cpp/y_absl/status/status_payload_printer.cc',
'third_party/abseil-cpp/y_absl/status/statusor.cc',
@@ -647,6 +690,15 @@ CORE_SOURCE_FILES = [
'third_party/abseil-cpp/y_absl/strings/escaping.cc',
'third_party/abseil-cpp/y_absl/strings/internal/charconv_bigint.cc',
'third_party/abseil-cpp/y_absl/strings/internal/charconv_parse.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_internal.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree_navigator.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_btree_reader.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_consume.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cord_rep_ring.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cordz_functions.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cordz_handle.cc',
+ 'third_party/abseil-cpp/y_absl/strings/internal/cordz_info.cc',
'third_party/abseil-cpp/y_absl/strings/internal/escaping.cc',
'third_party/abseil-cpp/y_absl/strings/internal/memutil.cc',
'third_party/abseil-cpp/y_absl/strings/internal/ostringstream.cc',
@@ -705,6 +757,7 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/crypto/asn1/a_object.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/a_octet.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/a_print.c',
+ 'third_party/boringssl-with-bazel/src/crypto/asn1/a_strex.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/a_strnid.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/a_time.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/a_type.c',
@@ -713,7 +766,6 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_lib.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/asn1_par.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/asn_pack.c',
- 'third_party/boringssl-with-bazel/src/crypto/asn1/f_enum.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/f_int.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/f_string.c',
'third_party/boringssl-with-bazel/src/crypto/asn1/tasn_dec.c',
@@ -799,7 +851,6 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/crypto/ex_data.c',
'third_party/boringssl-with-bazel/src/crypto/fipsmodule/bcm.c',
'third_party/boringssl-with-bazel/src/crypto/fipsmodule/fips_shared_support.c',
- 'third_party/boringssl-with-bazel/src/crypto/fipsmodule/is_fips.c',
'third_party/boringssl-with-bazel/src/crypto/hkdf/hkdf.c',
'third_party/boringssl-with-bazel/src/crypto/hpke/hpke.c',
'third_party/boringssl-with-bazel/src/crypto/hrss/hrss.c',
@@ -846,13 +897,13 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/crypto/trust_token/voprf.c',
'third_party/boringssl-with-bazel/src/crypto/x509/a_digest.c',
'third_party/boringssl-with-bazel/src/crypto/x509/a_sign.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/a_strex.c',
'third_party/boringssl-with-bazel/src/crypto/x509/a_verify.c',
'third_party/boringssl-with-bazel/src/crypto/x509/algorithm.c',
'third_party/boringssl-with-bazel/src/crypto/x509/asn1_gen.c',
'third_party/boringssl-with-bazel/src/crypto/x509/by_dir.c',
'third_party/boringssl-with-bazel/src/crypto/x509/by_file.c',
'third_party/boringssl-with-bazel/src/crypto/x509/i2d_pr.c',
+ 'third_party/boringssl-with-bazel/src/crypto/x509/name_print.c',
'third_party/boringssl-with-bazel/src/crypto/x509/rsa_pss.c',
'third_party/boringssl-with-bazel/src/crypto/x509/t_crl.c',
'third_party/boringssl-with-bazel/src/crypto/x509/t_req.c',
@@ -866,7 +917,6 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/crypto/x509/x509_ext.c',
'third_party/boringssl-with-bazel/src/crypto/x509/x509_lu.c',
'third_party/boringssl-with-bazel/src/crypto/x509/x509_obj.c',
- 'third_party/boringssl-with-bazel/src/crypto/x509/x509_r2x.c',
'third_party/boringssl-with-bazel/src/crypto/x509/x509_req.c',
'third_party/boringssl-with-bazel/src/crypto/x509/x509_set.c',
'third_party/boringssl-with-bazel/src/crypto/x509/x509_trs.c',
@@ -931,6 +981,8 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/ssl/d1_srtp.cc',
'third_party/boringssl-with-bazel/src/ssl/dtls_method.cc',
'third_party/boringssl-with-bazel/src/ssl/dtls_record.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/encrypted_client_hello.cc',
+ 'third_party/boringssl-with-bazel/src/ssl/extensions.cc',
'third_party/boringssl-with-bazel/src/ssl/handoff.cc',
'third_party/boringssl-with-bazel/src/ssl/handshake.cc',
'third_party/boringssl-with-bazel/src/ssl/handshake_client.cc',
@@ -953,7 +1005,6 @@ CORE_SOURCE_FILES = [
'third_party/boringssl-with-bazel/src/ssl/ssl_versions.cc',
'third_party/boringssl-with-bazel/src/ssl/ssl_x509.cc',
'third_party/boringssl-with-bazel/src/ssl/t1_enc.cc',
- 'third_party/boringssl-with-bazel/src/ssl/t1_lib.cc',
'third_party/boringssl-with-bazel/src/ssl/tls13_both.cc',
'third_party/boringssl-with-bazel/src/ssl/tls13_client.cc',
'third_party/boringssl-with-bazel/src/ssl/tls13_enc.cc',
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc_version.py b/contrib/libs/grpc/src/python/grpcio/grpc_version.py
index ece1ae87a5f..9636ff390e1 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio/support.py b/contrib/libs/grpc/src/python/grpcio/support.py
index 217f3cb9ed5..3d64b3170ca 100644
--- a/contrib/libs/grpc/src/python/grpcio/support.py
+++ b/contrib/libs/grpc/src/python/grpcio/support.py
@@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from distutils import errors
import os
import os.path
import shutil
import sys
import tempfile
-from distutils import errors
-
import commands
C_PYTHON_DEV = """
diff --git a/contrib/libs/grpc/src/python/grpcio_admin/README.rst b/contrib/libs/grpc/src/python/grpcio_admin/README.rst
new file mode 100644
index 00000000000..d9959840eb5
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_admin/README.rst
@@ -0,0 +1,23 @@
+gRPC Python Admin Interface Package
+===================================
+
+Debugging gRPC library can be a complex task. There are many configurations and
+internal states, which will affect the behavior of the library. This Python
+package will be the collection of admin services that are exposing debug
+information. Currently, it includes:
+
+* Channel tracing metrics (grpcio-channelz)
+* Client Status Discovery Service (grpcio-csds)
+
+Here is a snippet to create an admin server on "localhost:50051":
+
+ server = grpc.server(ThreadPoolExecutor())
+ port = server.add_insecure_port('localhost:50051')
+ grpc_admin.add_admin_servicers(self._server)
+ server.start()
+
+Welcome to explore the admin services with CLI tool "grpcdebug":
+https://github.com/grpc-ecosystem/grpcdebug.
+
+For any issues or suggestions, please send to
+https://github.com/grpc/grpc/issues.
diff --git a/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py b/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py
new file mode 100644
index 00000000000..95e70858b3b
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_admin/grpc_admin/__init__.py
@@ -0,0 +1,42 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""gRPC Python's Admin interface."""
+
+from grpc_channelz.v1 import channelz
+import grpc_csds
+
+
+def add_admin_servicers(server):
+ """Register admin servicers to a server.
+
+ gRPC provides some predefined admin services to make debugging easier by
+ exposing gRPC's internal states. Each existing admin service is packaged as
+ a separate library, and the documentation of the predefined admin services
+ is usually scattered. It can be time consuming to get the dependency
+ management, module initialization, and library import right for each one of
+ them.
+
+ This API provides a convenient way to create a gRPC server to expose admin
+ services. With this, any new admin services that you may add in the future
+ are automatically available via the admin interface just by upgrading your
+ gRPC version.
+
+ Args:
+ server: A gRPC server to which all admin services will be added.
+ """
+ channelz.add_channelz_servicer(server)
+ grpc_csds.add_csds_servicer(server)
+
+
+__all__ = ['add_admin_servicers']
diff --git a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi b/contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py
index 51730c15976..c48475b87e4 100644
--- a/contrib/libs/grpc/src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/resolver.pxd.pxi
+++ b/contrib/libs/grpc/src/python/grpcio_admin/grpc_version.py
@@ -1,4 +1,4 @@
-# Copyright 2019 gRPC authors.
+# Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,13 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cdef class _AsyncioResolver:
- cdef:
- object _loop
- grpc_custom_resolver* _grpc_resolver
- object _task_resolve
+# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_admin/grpc_version.py.template`!!!
- @staticmethod
- cdef _AsyncioResolver create(grpc_custom_resolver* grpc_resolver)
-
- cdef void resolve(self, const char* host, const char* port)
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_admin/setup.py b/contrib/libs/grpc/src/python/grpcio_admin/setup.py
new file mode 100644
index 00000000000..2d966cdc0aa
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_admin/setup.py
@@ -0,0 +1,60 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Setup module for admin interface in gRPC Python."""
+
+import os
+import sys
+
+import setuptools
+
+_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
+_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst')
+
+# Ensure we're in the proper directory whether or not we're being used by pip.
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
+
+# Break import-style to ensure we can actually find our local modules.
+import grpc_version
+
+CLASSIFIERS = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'License :: OSI Approved :: Apache Software License',
+]
+
+PACKAGE_DIRECTORIES = {
+ '': '.',
+}
+
+INSTALL_REQUIRES = (
+ 'grpcio-channelz>={version}'.format(version=grpc_version.VERSION),
+ 'grpcio-csds>={version}'.format(version=grpc_version.VERSION),
+)
+SETUP_REQUIRES = INSTALL_REQUIRES
+
+setuptools.setup(name='grpcio-admin',
+ version=grpc_version.VERSION,
+ license='Apache License 2.0',
+ description='a collection of admin services',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='grpc-io@googlegroups.com',
+ classifiers=CLASSIFIERS,
+ url='https://grpc.io',
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
+ install_requires=INSTALL_REQUIRES,
+ setup_requires=SETUP_REQUIRES)
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/README.rst b/contrib/libs/grpc/src/python/grpcio_channelz/README.rst
index d66d0c4f922..526b34ac83b 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/README.rst
@@ -5,11 +5,7 @@ Channelz is a live debug tool in gRPC Python.
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Dependencies
------------
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
index 3f0d93fdc35..463f5e14dcf 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_async.py
@@ -14,10 +14,10 @@
"""AsyncIO version of Channelz servicer."""
from grpc.experimental import aio
-
+from grpc_channelz.v1._servicer import \
+ ChannelzServicer as _SyncChannelzServicer
import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
-from grpc_channelz.v1._servicer import ChannelzServicer as _SyncChannelzServicer
class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
index 6ba28f56a39..2d44976ec1d 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/_servicer.py
@@ -13,14 +13,12 @@
# limitations under the License.
"""Channelz debug service implementation in gRPC Python."""
+from google.protobuf import json_format
import grpc
from grpc._cython import cygrpc
-
import grpc_channelz.v1.channelz_pb2 as _channelz_pb2
import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
-from google.protobuf import json_format
-
class ChannelzServicer(_channelz_pb2_grpc.ChannelzServicer):
"""Servicer handling RPCs for service statuses."""
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
index 508fad53974..605150b79a7 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_channelz/v1/channelz.py
@@ -14,10 +14,10 @@
"""Channelz debug service implementation in gRPC Python."""
import sys
-import grpc
-import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
+import grpc
from grpc_channelz.v1._servicer import ChannelzServicer
+import grpc_channelz.v1.channelz_pb2_grpc as _channelz_pb2_grpc
_add_channelz_servicer_doc = """Add Channelz servicer to a server.
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
index 197b5299222..34edb1e08c5 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_channelz/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py b/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
index 678b5ef13f3..cec1ea2ee9b 100644
--- a/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_channelz/setup.py
@@ -47,8 +47,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
@@ -56,6 +54,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: Apache Software License',
]
@@ -70,6 +69,7 @@ INSTALL_REQUIRES = (
try:
import channelz_commands as _channelz_commands
+
# we are in the build environment, otherwise the above import fails
SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
version=grpc_version.VERSION),)
@@ -98,6 +98,7 @@ setuptools.setup(
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_csds/README.rst b/contrib/libs/grpc/src/python/grpcio_csds/README.rst
new file mode 100644
index 00000000000..f8803f253d8
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_csds/README.rst
@@ -0,0 +1,10 @@
+gRPC Python Client Status Discovery Service package
+===================================================
+
+CSDS is part of the Envoy xDS protocol:
+https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/status/v3/csds.proto.
+It allows the gRPC application to programmatically expose the received traffic
+configuration (xDS resources). Welcome to explore with CLI tool "grpcdebug":
+https://github.com/grpc-ecosystem/grpcdebug.
+
+For any issues or suggestions, please send to https://github.com/grpc/grpc/issues.
diff --git a/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py b/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py
new file mode 100644
index 00000000000..aa83465c613
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_csds/grpc_csds/__init__.py
@@ -0,0 +1,61 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Channelz debug service implementation in gRPC Python."""
+
+from google.protobuf import json_format
+from grpc._cython import cygrpc
+
+try:
+ from envoy.service.status.v3 import csds_pb2
+ from envoy.service.status.v3 import csds_pb2_grpc
+except ImportError:
+ from src.proto.grpc.testing.xds.v3 import csds_pb2
+ from src.proto.grpc.testing.xds.v3 import csds_pb2_grpc
+
+
+class ClientStatusDiscoveryServiceServicer(
+ csds_pb2_grpc.ClientStatusDiscoveryServiceServicer):
+ """CSDS Servicer works for both the sync API and asyncio API."""
+
+ @staticmethod
+ def FetchClientStatus(request, unused_context):
+ client_config = csds_pb2.ClientConfig.FromString(
+ cygrpc.dump_xds_configs())
+ response = csds_pb2.ClientStatusResponse()
+ response.config.append(client_config)
+ return response
+
+ @staticmethod
+ def StreamClientStatus(request_iterator, context):
+ for request in request_iterator:
+ yield ClientStatusDiscoveryServiceServicer.FetchClientStatus(
+ request, context)
+
+
+def add_csds_servicer(server):
+ """Register CSDS servicer to a server.
+
+ CSDS is part of xDS protocol used to expose in-effective traffic
+ configuration (or xDS resources). It focuses on simplify the debugging of
+ unexpected routing behaviors, which could be due to a misconfiguration,
+ unhealthy backends or issues in the control or data plane.
+
+ Args:
+ server: A gRPC server to which the CSDS service will be added.
+ """
+ csds_pb2_grpc.add_ClientStatusDiscoveryServiceServicer_to_server(
+ ClientStatusDiscoveryServiceServicer(), server)
+
+
+__all__ = ['ClientStatusDiscoveryServiceServicer', 'add_csds_servicer']
diff --git a/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py
new file mode 100644
index 00000000000..88b38f3a6e7
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_csds/grpc_version.py
@@ -0,0 +1,17 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_csds/grpc_version.py.template`!!!
+
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_csds/setup.py b/contrib/libs/grpc/src/python/grpcio_csds/setup.py
new file mode 100644
index 00000000000..c89c6b927b0
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_csds/setup.py
@@ -0,0 +1,61 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""Setup module for CSDS in gRPC Python."""
+
+import os
+import sys
+
+import setuptools
+
+_PACKAGE_PATH = os.path.realpath(os.path.dirname(__file__))
+_README_PATH = os.path.join(_PACKAGE_PATH, 'README.rst')
+
+# Ensure we're in the proper directory whether or not we're being used by pip.
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
+
+# Break import-style to ensure we can actually find our local modules.
+import grpc_version
+
+CLASSIFIERS = [
+ 'Development Status :: 5 - Production/Stable',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'License :: OSI Approved :: Apache Software License',
+]
+
+PACKAGE_DIRECTORIES = {
+ '': '.',
+}
+
+INSTALL_REQUIRES = (
+ 'protobuf>=3.6.0',
+ 'xds-protos>=0.0.7',
+ 'grpcio>={version}'.format(version=grpc_version.VERSION),
+)
+SETUP_REQUIRES = INSTALL_REQUIRES
+
+setuptools.setup(name='grpcio-csds',
+ version=grpc_version.VERSION,
+ license='Apache License 2.0',
+ description='xDS configuration dump library',
+ long_description=open(_README_PATH, 'r').read(),
+ author='The gRPC Authors',
+ author_email='grpc-io@googlegroups.com',
+ classifiers=CLASSIFIERS,
+ url='https://grpc.io',
+ package_dir=PACKAGE_DIRECTORIES,
+ packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
+ install_requires=INSTALL_REQUIRES,
+ setup_requires=SETUP_REQUIRES)
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/README.rst b/contrib/libs/grpc/src/python/grpcio_health_checking/README.rst
index 044377a5828..bb4ff867c41 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/README.rst
@@ -5,11 +5,7 @@ Reference package for GRPC Python health checking.
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Dependencies
------------
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
index de9712a7c51..b56a945c614 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/_async.py
@@ -16,8 +16,8 @@
import asyncio
import collections
from typing import MutableMapping
-import grpc
+import grpc
from grpc_health.v1 import health_pb2 as _health_pb2
from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
index f7ee639ec8a..e5f0e032134 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_health/v1/health.py
@@ -14,10 +14,10 @@
"""Reference implementation for health checking in gRPC Python."""
import collections
-import threading
import sys
-import grpc
+import threading
+import grpc
from grpc_health.v1 import health_pb2 as _health_pb2
from grpc_health.v1 import health_pb2_grpc as _health_pb2_grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
index 3e60e12ef85..0ba5178b82d 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_health_checking/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py b/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
index fa1fbbd55ad..7491bd400ac 100644
--- a/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_health_checking/setup.py
@@ -46,8 +46,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
@@ -55,6 +53,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: Apache Software License',
]
@@ -69,6 +68,7 @@ INSTALL_REQUIRES = (
try:
import health_commands as _health_commands
+
# we are in the build environment, otherwise the above import fails
SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
version=grpc_version.VERSION),)
@@ -96,6 +96,7 @@ setuptools.setup(name='grpcio-health-checking',
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/README.rst b/contrib/libs/grpc/src/python/grpcio_reflection/README.rst
index 56f9953373b..f8c4c548663 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/README.rst
@@ -5,11 +5,7 @@ Reference package for reflection in GRPC Python.
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Dependencies
------------
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
index bdd9b232897..c23f3a248ba 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_async.py
@@ -16,7 +16,6 @@
from typing import AsyncIterable
import grpc
-
from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
from grpc_reflection.v1alpha._base import BaseReflectionServicer
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
index 677dca98586..5ba1925618f 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/_base.py
@@ -13,10 +13,9 @@
# limitations under the License.
"""Base implementation of reflection servicer."""
-import grpc
from google.protobuf import descriptor_pb2
from google.protobuf import descriptor_pool
-
+import grpc
from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
from src.proto.grpc.reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
index b302cea2419..fe2c70ab4f2 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_reflection/v1alpha/reflection.py
@@ -14,11 +14,10 @@
"""Reference implementation for reflection in gRPC Python."""
import sys
-import grpc
+import grpc
from src.proto.grpc.reflection.v1alpha import reflection_pb2 as _reflection_pb2
from src.proto.grpc.reflection.v1alpha import reflection_pb2_grpc as _reflection_pb2_grpc
-
from grpc_reflection.v1alpha._base import BaseReflectionServicer
SERVICE_NAME = _reflection_pb2.DESCRIPTOR.services_by_name[
@@ -64,9 +63,10 @@ Args:
if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
# Exposes AsyncReflectionServicer as public API.
- from . import _async as aio
from grpc.experimental import aio as grpc_aio # pylint: disable=ungrouped-imports
+ from . import _async as aio
+
def enable_server_reflection(service_names, server, pool=None):
if isinstance(server, grpc_aio.Server):
_reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
index 7b3e707985a..55ed71e32f9 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_reflection/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py b/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
index 2d0a3fcdaaf..f90a3cce880 100644
--- a/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_reflection/setup.py
@@ -47,8 +47,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
@@ -56,6 +54,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: Apache Software License',
]
@@ -70,6 +69,7 @@ INSTALL_REQUIRES = (
try:
import reflection_commands as _reflection_commands
+
# we are in the build environment, otherwise the above import fails
SETUP_REQUIRES = ('grpcio-tools=={version}'.format(
version=grpc_version.VERSION),)
@@ -97,6 +97,7 @@ setuptools.setup(name='grpcio-reflection',
url='https://grpc.io',
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_status/README.rst b/contrib/libs/grpc/src/python/grpcio_status/README.rst
index 16c59387a61..e9483d033fd 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio_status/README.rst
@@ -5,11 +5,7 @@ Reference package for GRPC Python status proto mapping.
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Dependencies
------------
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
index a6a6f7ef6ad..bbd3be8971a 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/_async.py
@@ -13,11 +13,11 @@
# limitations under the License.
"""Reference implementation for status mapping in gRPC Python."""
-from grpc.experimental import aio
-
from google.rpc import status_pb2
+from grpc.experimental import aio
-from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
+from ._common import GRPC_DETAILS_METADATA_KEY
+from ._common import code_to_grpc_status_code
async def from_call(call: aio.Call):
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
index d0ec08e3a5d..432e414f708 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_status/rpc_status.py
@@ -16,10 +16,11 @@
import collections
import sys
+from google.rpc import status_pb2
import grpc
-from google.rpc import status_pb2
-from ._common import code_to_grpc_status_code, GRPC_DETAILS_METADATA_KEY
+from ._common import GRPC_DETAILS_METADATA_KEY
+from ._common import code_to_grpc_status_code
class _Status(
diff --git a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
index 95a2a872e84..c80d0a4a887 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_status/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_status/setup.py b/contrib/libs/grpc/src/python/grpcio_status/setup.py
index eb49069c34f..23bd11cb6b2 100644
--- a/contrib/libs/grpc/src/python/grpcio_status/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_status/setup.py
@@ -46,8 +46,6 @@ class _NoOpCommand(setuptools.Command):
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
@@ -55,6 +53,7 @@ CLASSIFIERS = [
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'License :: OSI Approved :: Apache Software License',
]
@@ -70,6 +69,7 @@ INSTALL_REQUIRES = (
try:
import status_commands as _status_commands
+
# we are in the build environment, otherwise the above import fails
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
@@ -94,5 +94,6 @@ setuptools.setup(name='grpcio-status',
classifiers=CLASSIFIERS,
package_dir=PACKAGE_DIRECTORIES,
packages=setuptools.find_packages('.'),
+ python_requires='>=3.6',
install_requires=INSTALL_REQUIRES,
cmdclass=COMMAND_CLASS)
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/README.rst b/contrib/libs/grpc/src/python/grpcio_testing/README.rst
index 968dec85071..66d80b1d535 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/README.rst
+++ b/contrib/libs/grpc/src/python/grpcio_testing/README.rst
@@ -5,11 +5,7 @@ Testing utilities for gRPC Python
Supported Python Versions
-------------------------
-Python >= 3.5
-
-Deprecated Python Versions
---------------------------
-Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
+Python >= 3.6
Dependencies
------------
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py
index 65fdd1b8ca4..235b3afcf4f 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/__init__.py
@@ -14,11 +14,10 @@
"""Objects for use in testing gRPC Python-using application code."""
import abc
-import six
from google.protobuf import descriptor
-
import grpc
+import six
class UnaryUnaryChannelRpc(six.with_metaclass(abc.ABCMeta)):
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
index a65628a1216..661257e275e 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_testing/_server/_service.py
@@ -13,6 +13,7 @@
# limitations under the License.
import copy
+
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
index 899dae77308..66abb8b188d 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_testing/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_testing/setup.py b/contrib/libs/grpc/src/python/grpcio_testing/setup.py
index 1946793fe62..b9766204840 100644
--- a/contrib/libs/grpc/src/python/grpcio_testing/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_testing/setup.py
@@ -55,6 +55,7 @@ INSTALL_REQUIRES = (
try:
import testing_commands as _testing_commands
+
# we are in the build environment, otherwise the above import fails
COMMAND_CLASS = {
# Run preprocess from the repository *before* doing any packaging!
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
index a9192e37f1c..bc0e4575ef8 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/src/python/grpcio_tests/.yandex_meta/licenses.list.txt
@@ -29,6 +29,10 @@
====================COPYRIGHT====================
+ * Copyright 2019 gRPC authors.
+
+
+====================COPYRIGHT====================
* Copyright 2020 gRPC authors.
@@ -45,10 +49,6 @@
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
-
-
-====================COPYRIGHT====================
# Copyright 2019 the gRPC authors.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/commands.py b/contrib/libs/grpc/src/python/grpcio_tests/commands.py
index 889b0bd9dc3..84331aed63a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/commands.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/commands.py
@@ -231,6 +231,9 @@ class TestGevent(setuptools.Command):
# TODO(https://github.com/grpc/grpc/pull/15411) enable this test
'unit._server_test.ServerTest.test_failed_port_binding_exception',
)
+ BANNED_MACOS_TESTS = (
+ # TODO(https://github.com/grpc/grpc/issues/15411) enable this test
+ 'unit._dynamic_stubs_test.DynamicStubTest',)
description = 'run tests with gevent. Assumes grpc/gevent are installed'
user_options = []
@@ -245,19 +248,21 @@ class TestGevent(setuptools.Command):
from gevent import monkey
monkey.patch_all()
- import tests
-
import grpc.experimental.gevent
+
+ import tests
grpc.experimental.gevent.init_gevent()
import gevent
import tests
loader = tests.Loader()
- loader.loadTestsFromNames(['tests'])
+ loader.loadTestsFromNames(['tests', 'tests_gevent'])
runner = tests.Runner()
if sys.platform == 'win32':
runner.skip_tests(self.BANNED_TESTS + self.BANNED_WINDOWS_TESTS)
+ elif sys.platform == 'darwin':
+ runner.skip_tests(self.BANNED_TESTS + self.BANNED_MACOS_TESTS)
else:
runner.skip_tests(self.BANNED_TESTS)
result = gevent.spawn(runner.run, loader.suite)
@@ -303,6 +308,7 @@ class RunInterop(test.test):
# edit the Python system path.
if self.use_asyncio:
import asyncio
+
from tests_aio.interop import server
sys.argv[1:] = self.args.split()
asyncio.get_event_loop().run_until_complete(server.serve())
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py b/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
index 69d40de2a52..0a2b753cd39 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/grpc_version.py
@@ -14,4 +14,4 @@
# AUTO-GENERATED FROM `$REPO_ROOT/templates/src/python/grpcio_tests/grpc_version.py.template`!!!
-VERSION = '1.37.1'
+VERSION = '1.43.2'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/setup.py b/contrib/libs/grpc/src/python/grpcio_tests/setup.py
index 87cccda425b..90f722cc27c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/setup.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/setup.py
@@ -18,9 +18,8 @@ import os
import os.path
import sys
-import setuptools
-
import grpc_tools.command
+import setuptools
PY3 = sys.version_info.major == 3
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/admin/test_admin.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/admin/test_admin.py
new file mode 100644
index 00000000000..adc48782828
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/admin/test_admin.py
@@ -0,0 +1,60 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""A test to ensure that admin services are registered correctly."""
+
+from concurrent.futures import ThreadPoolExecutor
+import logging
+import sys
+import unittest
+
+import grpc
+import grpc_admin
+from grpc_channelz.v1 import channelz_pb2
+from grpc_channelz.v1 import channelz_pb2_grpc
+from grpc_csds import csds_pb2
+from grpc_csds import csds_pb2_grpc
+
+
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
+class TestAdmin(unittest.TestCase):
+
+ def setUp(self):
+ self._server = grpc.server(ThreadPoolExecutor())
+ port = self._server.add_insecure_port('localhost:0')
+ grpc_admin.add_admin_servicers(self._server)
+ self._server.start()
+
+ self._channel = grpc.insecure_channel('localhost:%s' % port)
+
+ def tearDown(self):
+ self._channel.close()
+ self._server.stop(0)
+
+ def test_has_csds(self):
+ stub = csds_pb2_grpc.ClientStatusDiscoveryServiceStub(self._channel)
+ resp = stub.FetchClientStatus(csds_pb2.ClientStatusRequest())
+ # No exception raised and the response is valid
+ self.assertGreater(len(resp.config), 0)
+
+ def test_has_channelz(self):
+ stub = channelz_pb2_grpc.ChannelzStub(self._channel)
+ resp = stub.GetTopChannels(channelz_pb2.GetTopChannelsRequest())
+ # No exception raised and the response is valid
+ self.assertGreater(len(resp.channel), 0)
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
index a5008970293..565a79814cd 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
@@ -13,12 +13,11 @@
# limitations under the License.
"""Tests of grpc_channelz.v1.channelz."""
-import unittest
-
from concurrent import futures
+import sys
+import unittest
import grpc
-
from grpc_channelz.v1 import channelz
from grpc_channelz.v1 import channelz_pb2
from grpc_channelz.v1 import channelz_pb2_grpc
@@ -92,6 +91,8 @@ def _close_channel_server_pairs(pairs):
pair.channel.close()
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class ChannelzServicerTest(unittest.TestCase):
def _send_successful_unary_unary(self, idx):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/csds/test_csds.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/csds/test_csds.py
new file mode 100644
index 00000000000..3a78b5c8ae7
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/csds/test_csds.py
@@ -0,0 +1,147 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+"""A simple test to ensure that the Python wrapper can get xDS config."""
+
+from concurrent.futures import ThreadPoolExecutor
+import logging
+import os
+import sys
+import time
+import unittest
+
+from google.protobuf import json_format
+import grpc
+import grpc_csds
+from six.moves import queue
+
+try:
+ from envoy.service.status.v3 import csds_pb2
+ from envoy.service.status.v3 import csds_pb2_grpc
+except ImportError:
+ from src.proto.grpc.testing.xds.v3 import csds_pb2
+ from src.proto.grpc.testing.xds.v3 import csds_pb2_grpc
+
+_DUMMY_XDS_ADDRESS = 'xds:///foo.bar'
+_DUMMY_BOOTSTRAP_FILE = """
+{
+ \"xds_servers\": [
+ {
+ \"server_uri\": \"fake:///xds_server\",
+ \"channel_creds\": [
+ {
+ \"type\": \"fake\"
+ }
+ ],
+ \"server_features\": [\"xds_v3\"]
+ }
+ ],
+ \"node\": {
+ \"id\": \"python_test_csds\",
+ \"cluster\": \"test\",
+ \"metadata\": {
+ \"foo\": \"bar\"
+ },
+ \"locality\": {
+ \"region\": \"corp\",
+ \"zone\": \"svl\",
+ \"sub_zone\": \"mp3\"
+ }
+ }
+}\
+"""
+
+
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
+class TestCsds(unittest.TestCase):
+
+ def setUp(self):
+ os.environ['GRPC_XDS_BOOTSTRAP_CONFIG'] = _DUMMY_BOOTSTRAP_FILE
+ self._server = grpc.server(ThreadPoolExecutor())
+ port = self._server.add_insecure_port('localhost:0')
+ grpc_csds.add_csds_servicer(self._server)
+ self._server.start()
+
+ self._channel = grpc.insecure_channel('localhost:%s' % port)
+ self._stub = csds_pb2_grpc.ClientStatusDiscoveryServiceStub(
+ self._channel)
+
+ def tearDown(self):
+ self._channel.close()
+ self._server.stop(0)
+ os.environ.pop('GRPC_XDS_BOOTSTRAP_CONFIG', None)
+
+ def get_xds_config_dump(self):
+ return self._stub.FetchClientStatus(csds_pb2.ClientStatusRequest())
+
+ def test_has_node(self):
+ resp = self.get_xds_config_dump()
+ self.assertEqual(1, len(resp.config))
+ self.assertEqual('python_test_csds', resp.config[0].node.id)
+ self.assertEqual('test', resp.config[0].node.cluster)
+
+ def test_no_lds_found(self):
+ dummy_channel = grpc.insecure_channel(_DUMMY_XDS_ADDRESS)
+
+ # Force the XdsClient to initialize and request a resource
+ with self.assertRaises(grpc.RpcError) as rpc_error:
+ dummy_channel.unary_unary('')(b'', wait_for_ready=False)
+ self.assertEqual(grpc.StatusCode.UNAVAILABLE,
+ rpc_error.exception.code())
+
+ # The resource request will fail with DOES_NOT_EXIST (after 15s)
+ while True:
+ resp = self.get_xds_config_dump()
+ config = json_format.MessageToDict(resp)
+ ok = False
+ try:
+ for xds_config in config["config"][0].get("xdsConfig", []):
+ if "listenerConfig" in xds_config:
+ listener = xds_config["listenerConfig"][
+ "dynamicListeners"][0]
+ if listener['clientStatus'] == 'DOES_NOT_EXIST':
+ ok = True
+ break
+ for generic_xds_config in config["config"][0].get(
+ "genericXdsConfigs", []):
+ if "Listener" in generic_xds_config["typeUrl"]:
+ if generic_xds_config[
+ 'clientStatus'] == 'DOES_NOT_EXIST':
+ ok = True
+ break
+ except KeyError as e:
+ logging.debug("Invalid config: %s\n%s: %s", config, type(e), e)
+ pass
+ if ok:
+ break
+ time.sleep(1)
+ dummy_channel.close()
+
+
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
+class TestCsdsStream(TestCsds):
+
+ def get_xds_config_dump(self):
+ if not hasattr(self, 'request_queue'):
+ request_queue = queue.Queue()
+ response_iterator = self._stub.StreamClientStatus(
+ iter(request_queue.get, None))
+ request_queue.put(csds_pb2.ClientStatusRequest())
+ return next(response_iterator)
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.DEBUG)
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
index a6fd5f8624c..bf44ae15154 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/_fork_interop_test.py
@@ -13,13 +13,15 @@
# limitations under the License.
"""Client-side fork interop tests as a unit test."""
-import six
import subprocess
import sys
import tempfile
import threading
import unittest
+
from grpc._cython import cygrpc
+import six
+
from tests.fork import methods
# New instance of multiprocessing.Process using fork without exec can and will
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
index 3ccebcf6510..a991272c6fc 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/fork/methods.py
@@ -22,7 +22,6 @@ import threading
import time
import grpc
-
from six.moves import queue
from src.proto.grpc.testing import empty_pb2
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
index 01345aaca08..d3dfa45944e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
@@ -14,22 +14,21 @@
"""Tests of grpc_health.v1.health."""
import logging
+import sys
import threading
import time
import unittest
import grpc
-
from grpc_health.v1 import health
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
+from six.moves import queue
from tests.unit import test_common
from tests.unit import thread_pool
from tests.unit.framework.common import test_constants
-from six.moves import queue
-
_SERVING_SERVICE = 'grpc.test.TestServiceServing'
_UNKNOWN_SERVICE = 'grpc.test.TestServiceUnknown'
_NOT_SERVING_SERVICE = 'grpc.test.TestServiceNotServing'
@@ -43,6 +42,8 @@ def _consume_responses(response_iterator, response_queue):
class BaseWatchTests(object):
+ @unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class WatchTests(unittest.TestCase):
def start_server(self, non_blocking=False, thread_pool=None):
@@ -230,6 +231,8 @@ class BaseWatchTests(object):
self.assertTrue(response_queue.empty())
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class HealthServicerTest(BaseWatchTests.WatchTests):
def setUp(self):
@@ -270,6 +273,8 @@ class HealthServicerTest(BaseWatchTests.WatchTests):
self.assertEqual(health.SERVICE_NAME, 'grpc.health.v1.Health')
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class HealthServicerBackwardsCompatibleWatchTest(BaseWatchTests.WatchTests):
def setUp(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
index 0753872b5e4..138f61995c9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/http2/negative_http2_client.py
@@ -14,11 +14,12 @@
"""The Python client used to test negative http2 conditions."""
import argparse
+import time
import grpc
-import time
-from src.proto.grpc.testing import test_pb2_grpc
+
from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
def _validate_payload_type_and_length(response, expected_type, expected_length):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
index fecf31767a7..27e5dcdd759 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_insecure_intraop_test.py
@@ -13,17 +13,20 @@
# limitations under the License.
"""Insecure client-server interoperability as a unit test."""
+import sys
import unittest
import grpc
-from src.proto.grpc.testing import test_pb2_grpc
+from src.proto.grpc.testing import test_pb2_grpc
from tests.interop import _intraop_test_case
-from tests.interop import service
from tests.interop import server
+from tests.interop import service
from tests.unit import test_common
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class InsecureIntraopTest(_intraop_test_case.IntraopTestCase,
unittest.TestCase):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
index bf1f1b118b3..0ec88a2cd99 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/_secure_intraop_test.py
@@ -13,19 +13,22 @@
# limitations under the License.
"""Secure client-server interoperability as a unit test."""
+import sys
import unittest
import grpc
-from src.proto.grpc.testing import test_pb2_grpc
+from src.proto.grpc.testing import test_pb2_grpc
from tests.interop import _intraop_test_case
-from tests.interop import service
from tests.interop import resources
+from tests.interop import service
from tests.unit import test_common
_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class SecureIntraopTest(_intraop_test_case.IntraopTestCase, unittest.TestCase):
def setUp(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
index 4d35f7ca32a..c95e81353d9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/client.py
@@ -19,8 +19,8 @@ import os
from google import auth as google_auth
from google.auth import jwt as google_auth_jwt
import grpc
-from src.proto.grpc.testing import test_pb2_grpc
+from src.proto.grpc.testing import test_pb2_grpc
from tests.interop import methods
from tests.interop import resources
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/resources.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/resources.py
index a55919a60ae..a47228a355d 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/resources.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/resources.py
@@ -14,8 +14,8 @@
"""Constants and functions for data used in interoperability testing."""
import argparse
-import pkgutil
import os
+import pkgutil
_ROOT_CERTIFICATES_RESOURCE_PATH = 'credentials/ca.pem'
_PRIVATE_KEY_RESOURCE_PATH = 'credentials/server1.key'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
index c85adb0b0bb..6286733eddb 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/interop/server.py
@@ -18,10 +18,10 @@ from concurrent import futures
import logging
import grpc
-from src.proto.grpc.testing import test_pb2_grpc
-from tests.interop import service
+from src.proto.grpc.testing import test_pb2_grpc
from tests.interop import resources
+from tests.interop import service
from tests.unit import test_common
logging.basicConfig()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
index 29cd35efb17..81d11c18657 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_client.py
@@ -14,15 +14,15 @@
"""Defines test client behaviors (UNARY/STREAMING) (SYNC/ASYNC)."""
import abc
+from concurrent import futures
import threading
import time
-from concurrent import futures
+import grpc
from six.moves import queue
-import grpc
-from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import benchmark_service_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
from tests.unit import resources
from tests.unit import test_common
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
index 75280bd7719..644543086b6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/benchmark_server.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import benchmark_service_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
class BenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
index de8eefbd7f5..0708cc06f3e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/qps_worker.py
@@ -18,8 +18,8 @@ import logging
import time
import grpc
-from src.proto.grpc.testing import worker_service_pb2_grpc
+from src.proto.grpc.testing import worker_service_pb2_grpc
from tests.qps import worker_server
from tests.unit import test_common
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
index 327b8e3b4c0..1b5a7593b54 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/qps/worker_server.py
@@ -12,18 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from concurrent import futures
import multiprocessing
import random
import threading
import time
-from concurrent import futures
import grpc
-from src.proto.grpc.testing import control_pb2
+
from src.proto.grpc.testing import benchmark_service_pb2_grpc
-from src.proto.grpc.testing import worker_service_pb2_grpc
+from src.proto.grpc.testing import control_pb2
from src.proto.grpc.testing import stats_pb2
-
+from src.proto.grpc.testing import worker_service_pb2_grpc
from tests.qps import benchmark_client
from tests.qps import benchmark_server
from tests.qps import client_runner
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
index 169e55022da..63b73e231c0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py
@@ -13,20 +13,18 @@
# limitations under the License.
"""Tests of grpc_reflection.v1alpha.reflection."""
+import sys
import unittest
+from google.protobuf import descriptor_pb2
+from google.protobuf import descriptor_pool
import grpc
-
from grpc_reflection.v1alpha import reflection
from grpc_reflection.v1alpha import reflection_pb2
from grpc_reflection.v1alpha import reflection_pb2_grpc
-from google.protobuf import descriptor_pool
-from google.protobuf import descriptor_pb2
-
from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
-
from tests.unit import test_common
_EMPTY_PROTO_FILE_NAME = 'src/proto/grpc/testing/empty.proto'
@@ -49,6 +47,8 @@ def _file_descriptor_to_proto(descriptor):
return proto.SerializeToString()
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class ReflectionServicerTest(unittest.TestCase):
# TODO(https://github.com/grpc/grpc/issues/17844)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
index 54a3b624203..a79dd555abf 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/status/_grpc_status_test.py
@@ -11,7 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""Tests of grpc_status."""
+"""Tests of grpc_status.
+
+isort:skip_file
+"""
# NOTE(lidiz) This module only exists in Bazel BUILD file, for more details
# please refer to comments in the "bazel_namespace_package_hack" module.
@@ -25,6 +28,7 @@ import unittest
import logging
import traceback
+import sys
import grpc
from grpc_status import rpc_status
@@ -110,6 +114,8 @@ class _GenericHandler(grpc.GenericRpcHandler):
return None
+@unittest.skipIf(sys.version_info[0] < 3,
+ 'ProtoBuf descriptor has moved on from Python2')
class StatusTest(unittest.TestCase):
def setUp(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
index 01c14ba3e20..4481e61696a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/client.py
@@ -19,9 +19,9 @@ import threading
import grpc
from six.moves import queue
+
from src.proto.grpc.testing import metrics_pb2_grpc
from src.proto.grpc.testing import test_pb2_grpc
-
from tests.interop import methods
from tests.interop import resources
from tests.qps import histogram
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
index cd872ece29d..21d7e6c6089 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/stress/unary_stream_benchmark.py
@@ -12,14 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import contextlib
import datetime
-import threading
-import grpc
-import grpc.experimental
import subprocess
import sys
+import threading
import time
-import contextlib
+
+import grpc
+import grpc.experimental
_PORT = 5741
_MESSAGE_SIZE = 4
@@ -49,8 +50,9 @@ server.wait_for_termination()
""" % _PORT
try:
+ from src.python.grpcio_tests.tests.stress import \
+ unary_stream_benchmark_pb2_grpc
from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2
- from src.python.grpcio_tests.tests.stress import unary_stream_benchmark_pb2_grpc
_GRPC_CHANNEL_OPTIONS = [
('grpc.max_metadata_size', 16 * 1024 * 1024),
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_application_testing_common.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_application_testing_common.py
index 9c9e485a783..cac813c04d8 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_application_testing_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_application_testing_common.py
@@ -18,7 +18,7 @@ from tests.testing.proto import requests_pb2
from tests.testing.proto import services_pb2
# TODO(https://github.com/grpc/grpc/issues/11657): Eliminate this entirely.
-# TODO(https://github.com/google/protobuf/issues/3452): Eliminate this if/else.
+# TODO(https://github.com/protocolbuffers/protobuf/issues/3452): Eliminate this if/else.
if services_pb2.DESCRIPTOR.services_by_name.get('FirstService') is None:
FIRST_SERVICE = 'Fix protobuf issue 3452!'
FIRST_SERVICE_UNUN = 'Fix protobuf issue 3452!'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
index 57fa5109139..548ed30c931 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_application.py
@@ -19,13 +19,12 @@ import threading
import time
import grpc
-from tests.unit.framework.common import test_constants
+from tests.testing import _application_common
from tests.testing.proto import requests_pb2
from tests.testing.proto import services_pb2
from tests.testing.proto import services_pb2_grpc
-
-from tests.testing import _application_common
+from tests.unit.framework.common import test_constants
@enum.unique
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_test.py
index 5b051c39390..d92a1a9733c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_client_test.py
@@ -18,7 +18,6 @@ import unittest
import grpc
from grpc.framework.foundation import logging_pool
-from tests.unit.framework.common import test_constants
import grpc_testing
from tests.testing import _application_common
@@ -26,9 +25,10 @@ from tests.testing import _application_testing_common
from tests.testing import _client_application
from tests.testing.proto import requests_pb2
from tests.testing.proto import services_pb2
+from tests.unit.framework.common import test_constants
-# TODO(https://github.com/google/protobuf/issues/3452): Drop this skip.
+# TODO(https://github.com/protocolbuffers/protobuf/issues/3452): Drop this skip.
@unittest.skipIf(
services_pb2.DESCRIPTOR.services_by_name.get('FirstService') is None,
'Fix protobuf issue 3452!')
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_server_application.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_server_application.py
index 51ed977b8fe..ffab6f5b933 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_server_application.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/testing/_server_application.py
@@ -13,10 +13,10 @@
# limitations under the License.
"""An example gRPC Python-using server-side application."""
-import grpc
-
import threading
+import grpc
+
# requests_pb2 is a semantic dependency of this module.
from tests.testing import _application_common
from tests.testing.proto import requests_pb2 # pylint: disable=unused-import
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
index d2eaf97d5f4..84604726c99 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_abort_test.py
@@ -13,10 +13,10 @@
# limitations under the License.
"""Tests server context abort mechanism"""
-import unittest
import collections
import gc
import logging
+import unittest
import weakref
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
index e98632d0d28..c536328142d 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_api_test.py
@@ -13,12 +13,11 @@
# limitations under the License.
"""Test of gRPC Python's application-layer API."""
-import unittest
import logging
-
-import six
+import unittest
import grpc
+import six
from tests.unit import _from_grpc_import_star
@@ -76,6 +75,7 @@ class AllTest(unittest.TestCase):
'access_token_call_credentials',
'composite_call_credentials',
'composite_channel_credentials',
+ 'compute_engine_channel_credentials',
'ssl_server_credentials',
'ssl_server_certificate_configuration',
'dynamic_ssl_server_credentials',
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
index 817c528237b..97a13085748 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_context_test.py
@@ -13,17 +13,17 @@
# limitations under the License.
"""Tests exposure of SSL auth context"""
+import logging
import pickle
import unittest
-import logging
import grpc
from grpc import _channel
from grpc.experimental import session_cache
import six
-from tests.unit import test_common
from tests.unit import resources
+from tests.unit import test_common
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x00\x00\x00'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_test.py
index d9df2add4f2..345239e0b87 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_auth_test.py
@@ -14,9 +14,9 @@
"""Tests of standard AuthMetadataPlugins."""
import collections
+import logging
import threading
import unittest
-import logging
from grpc import _auth
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
index 2f2eea61dbd..d71906f6f41 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_args_test.py
@@ -14,8 +14,8 @@
"""Tests of channel arguments on client/server side."""
from concurrent import futures
-import unittest
import logging
+import unittest
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
index d1b4c3c932f..912d8290a4c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py
@@ -19,8 +19,9 @@ import time
import unittest
import grpc
-from tests.unit.framework.common import test_constants
+
from tests.unit import thread_pool
+from tests.unit.framework.common import test_constants
def _ready_in_connectivities(connectivities):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
index ca9ebc16fe9..84a6f9196b3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_channel_ready_future_test.py
@@ -13,13 +13,14 @@
# limitations under the License.
"""Tests of grpc.channel_ready_future."""
+import logging
import threading
import unittest
-import logging
import grpc
-from tests.unit.framework.common import test_constants
+
from tests.unit import thread_pool
+from tests.unit.framework.common import test_constants
class _Callback(object):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
index bc58e1032ca..cd55db58baf 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_compression_test.py
@@ -13,21 +13,20 @@
# limitations under the License.
"""Tests server and client side compression."""
-import unittest
-
-import contextlib
from concurrent import futures
+import contextlib
import functools
import itertools
import logging
import os
+import unittest
import grpc
from grpc import _grpcio_metadata
+from tests.unit import _tcp_proxy
from tests.unit import test_common
from tests.unit.framework.common import test_constants
-from tests.unit import _tcp_proxy
_UNARY_UNARY = '/test/UnaryUnary'
_UNARY_STREAM = '/test/UnaryStream'
@@ -260,6 +259,8 @@ def _stream_stream_client(channel, multicallable_kwargs, message):
i, response))
+@unittest.skipIf(test_common.running_under_gevent(),
+ "This test is nondeterministic under gevent.")
class CompressionTest(unittest.TestCase):
def assertCompressed(self, compression_ratio):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
index fec0fbd7df4..128ec514d06 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_contextvars_propagation_test.py
@@ -17,9 +17,11 @@ import contextlib
import logging
import os
import sys
+import threading
import unittest
import grpc
+from six.moves import queue
from tests.unit import test_common
@@ -95,6 +97,8 @@ else:
# TODO(https://github.com/grpc/grpc/issues/22257)
@unittest.skipIf(os.name == "nt", "LocalCredentials not supported on Windows.")
+@unittest.skipIf(test_common.running_under_gevent(),
+ "ThreadLocals do not work under gevent.")
class ContextVarsPropagationTest(unittest.TestCase):
def test_propagation_to_auth_plugin(self):
@@ -112,6 +116,47 @@ class ContextVarsPropagationTest(unittest.TestCase):
response = stub(_REQUEST, wait_for_ready=True)
self.assertEqual(_REQUEST, response)
+ def test_concurrent_propagation(self):
+ _THREAD_COUNT = 32
+ _RPC_COUNT = 32
+
+ set_up_expected_context()
+ with _server() as port:
+ target = "localhost:{}".format(port)
+ local_credentials = grpc.local_channel_credentials()
+ test_call_credentials = TestCallCredentials()
+ call_credentials = grpc.metadata_call_credentials(
+ test_call_credentials, "test call credentials")
+ composite_credentials = grpc.composite_channel_credentials(
+ local_credentials, call_credentials)
+ wait_group = test_common.WaitGroup(_THREAD_COUNT)
+
+ def _run_on_thread(exception_queue):
+ try:
+ with grpc.secure_channel(target,
+ composite_credentials) as channel:
+ stub = channel.unary_unary(_UNARY_UNARY)
+ wait_group.done()
+ wait_group.wait()
+ for i in range(_RPC_COUNT):
+ response = stub(_REQUEST, wait_for_ready=True)
+ self.assertEqual(_REQUEST, response)
+ except Exception as e: # pylint: disable=broad-except
+ exception_queue.put(e)
+
+ threads = []
+ for _ in range(_RPC_COUNT):
+ q = queue.Queue()
+ thread = threading.Thread(target=_run_on_thread, args=(q,))
+ thread.setDaemon(True)
+ thread.start()
+ threads.append((thread, q))
+
+ for thread, q in threads:
+ thread.join()
+ if not q.empty():
+ raise q.get()
+
if __name__ == '__main__':
logging.basicConfig()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_credentials_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_credentials_test.py
index 187a6f03881..5b420eb73ae 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_credentials_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_credentials_test.py
@@ -13,11 +13,11 @@
# limitations under the License.
"""Tests of credentials."""
-import unittest
import logging
-import six
+import unittest
import grpc
+import six
class CredentialsTest(unittest.TestCase):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
index c84dff614ab..3ca0d686d61 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_cancel_many_calls_test.py
@@ -18,8 +18,9 @@ import unittest
from grpc._cython import cygrpc
from grpc.framework.foundation import logging_pool
-from tests.unit.framework.common import test_constants
+
from tests.unit._cython import test_utilities
+from tests.unit.framework.common import test_constants
_EMPTY_FLAGS = 0
_EMPTY_METADATA = ()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py
index 54f620523ea..8f0b6fedc02 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_channel_test.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import time
import threading
+import time
import unittest
from grpc._cython import cygrpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py
index 4aad924427b..701ebcee5c2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/_read_some_but_not_all_responses_test.py
@@ -17,6 +17,7 @@ import threading
import unittest
from grpc._cython import cygrpc
+
from tests.unit._cython import test_utilities
_EMPTY_FLAGS = 0
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
index 30cd5078ffa..9021dc08d1e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py
@@ -12,15 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import time
+import platform
import threading
+import time
import unittest
-import platform
from grpc._cython import cygrpc
-from tests.unit._cython import test_utilities
-from tests.unit import test_common
+
from tests.unit import resources
+from tests.unit import test_common
+from tests.unit._cython import test_utilities
_SSL_HOST_OVERRIDE = b'foo.test.google.fr'
_CALL_CREDENTIALS_METADATA_KEY = 'call-creds-key'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
index 43141255f1c..f38a83b349c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dns_resolver_test.py
@@ -13,11 +13,12 @@
# limitations under the License.
"""Tests for an actual dns resolution."""
-import unittest
import logging
-import six
+import unittest
import grpc
+import six
+
from tests.unit import test_common
from tests.unit.framework.common import test_constants
@@ -48,7 +49,7 @@ class DNSResolverTest(unittest.TestCase):
def test_connect_loopback(self):
# NOTE(https://github.com/grpc/grpc/issues/18422)
# In short, Gevent + C-Ares = Segfault. The C-Ares driver is not
- # supported by custom io manager like "gevent" or "libuv".
+ # supported by custom io manager like "gevent"
with grpc.insecure_channel('loopback4.unittest.grpc.io:%d' %
self._port) as channel:
self.assertEqual(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
index 5d4819dd170..e505c563d89 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_dynamic_stubs_test.py
@@ -21,6 +21,8 @@ import os
import sys
import unittest
+from tests.unit import test_common
+
_DATA_DIR = os.path.join("tests", "unit", "data")
@@ -124,6 +126,8 @@ def _test_grpc_tools_unimportable():
# when they do not come from the "__main__" module, so this test passes
# if run directly on Windows, but not if started by the test runner.
@unittest.skipIf(os.name == "nt", "Windows multiprocessing unsupported")
+@unittest.skipIf(test_common.running_under_gevent(),
+ "Import paths do not work with gevent runner.")
class DynamicStubTest(unittest.TestCase):
@unittest.skip('grpcio-tools package required')
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_empty_message_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_empty_message_test.py
index f27ea422d0c..918dbe73d1a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_empty_message_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_empty_message_test.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest
import logging
+import unittest
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
index 48ea054d2d7..301afb6c27c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_scenarios.py
@@ -14,9 +14,9 @@
"""Defines a number of module-scope gRPC scenarios to test clean exit."""
import argparse
+import logging
import threading
import time
-import logging
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
index 190b289fa91..eaf32278898 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_exit_test.py
@@ -18,16 +18,17 @@ test is considered successful if it doesn't freeze/timeout.
"""
import atexit
+import datetime
+import logging
import os
import signal
-import six
import subprocess
import sys
import threading
-import datetime
import time
import unittest
-import logging
+
+import six
from tests.unit import _exit_scenarios
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_grpc_shutdown_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_grpc_shutdown_test.py
index 1c4890b97f1..b1f43e061b0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_grpc_shutdown_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_grpc_shutdown_test.py
@@ -13,10 +13,10 @@
# limitations under the License.
"""Tests the gRPC Core shutdown path."""
-import time
+import datetime
import threading
+import time
import unittest
-import datetime
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
index 619db7b3ffd..d8f3c90f415 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_interceptor_test.py
@@ -14,12 +14,12 @@
"""Test of gRPC Python interceptors."""
import collections
+from concurrent import futures
import itertools
-import threading
-import unittest
import logging
import os
-from concurrent import futures
+import threading
+import unittest
import grpc
from grpc.framework.foundation import logging_pool
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
index d1f1499d8cd..c56b719c408 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invalid_metadata_test.py
@@ -13,8 +13,8 @@
# limitations under the License.
"""Test of RPCs made against gRPC Python's application-layer API."""
-import unittest
import logging
+import unittest
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
index a0208b51df4..cacb028c3b4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_invocation_defects_test.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import unittest
import logging
+import unittest
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
index cd1f71dbeed..5351a2b4cc1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_local_credentials_test.py
@@ -13,11 +13,14 @@
# limitations under the License.
"""Test of RPCs made using local credentials."""
-import unittest
-import os
from concurrent.futures import ThreadPoolExecutor
+import os
+import unittest
+
import grpc
+from tests.unit import test_common
+
class _GenericHandler(grpc.GenericRpcHandler):
@@ -55,6 +58,8 @@ class LocalCredentialsTest(unittest.TestCase):
@unittest.skipIf(os.name == 'nt',
'Unix Domain Socket is not supported on Windows')
+ @unittest.skipIf(test_common.running_under_gevent(),
+ 'UDS not supported under gevent.')
def test_uds(self):
server_addr = 'unix:/tmp/grpc_fullstack_test'
channel_creds = grpc.local_channel_credentials(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
index 1304bb55879..933d2e6212f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_logging_test.py
@@ -13,12 +13,13 @@
# limitations under the License.
"""Test of gRPC Python's interaction with the python logging module"""
-import unittest
import logging
-import grpc
-import os
import subprocess
import sys
+import unittest
+
+import grpc
+import os
INTERPRETER = sys.executable
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
index 5b06eb2bfe8..87441833c17 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py
@@ -13,9 +13,9 @@
# limitations under the License.
"""Tests application-provided metadata, status code, and details."""
+import logging
import threading
import unittest
-import logging
import grpc
@@ -188,6 +188,8 @@ def _generic_handler(servicer):
return grpc.method_handlers_generic_handler(_SERVICE, method_handlers)
+@unittest.skipIf(test_common.running_under_gevent(),
+ "Causes deadlock in gevent.")
class MetadataCodeDetailsTest(unittest.TestCase):
def setUp(self):
@@ -658,6 +660,64 @@ class MetadataCodeDetailsTest(unittest.TestCase):
self.assertEqual(_DETAILS, exception_context.exception.details())
+class _InspectServicer(_Servicer):
+
+ def __init__(self):
+ super(_InspectServicer, self).__init__()
+ self.actual_code = None
+ self.actual_details = None
+ self.actual_trailing_metadata = None
+
+ def unary_unary(self, request, context):
+ super(_InspectServicer, self).unary_unary(request, context)
+
+ self.actual_code = context.code()
+ self.actual_details = context.details()
+ self.actual_trailing_metadata = context.trailing_metadata()
+
+
+class InspectContextTest(unittest.TestCase):
+
+ def setUp(self):
+ self._servicer = _InspectServicer()
+ self._server = test_common.test_server()
+ self._server.add_generic_rpc_handlers(
+ (_generic_handler(self._servicer),))
+ port = self._server.add_insecure_port('[::]:0')
+ self._server.start()
+
+ self._channel = grpc.insecure_channel('localhost:{}'.format(port))
+ self._unary_unary = self._channel.unary_unary(
+ '/'.join((
+ '',
+ _SERVICE,
+ _UNARY_UNARY,
+ )),
+ request_serializer=_REQUEST_SERIALIZER,
+ response_deserializer=_RESPONSE_DESERIALIZER,
+ )
+
+ def tearDown(self):
+ self._server.stop(None)
+ self._channel.close()
+
+ def testCodeDetailsInContext(self):
+ self._servicer.set_code(_NON_OK_CODE)
+ self._servicer.set_details(_DETAILS)
+
+ with self.assertRaises(grpc.RpcError) as exc_info:
+ self._unary_unary.with_call(object(), metadata=_CLIENT_METADATA)
+
+ err = exc_info.exception
+ self.assertEqual(_NON_OK_CODE, err.code())
+
+ self.assertEqual(self._servicer.actual_code, _NON_OK_CODE)
+ self.assertEqual(self._servicer.actual_details.decode('utf-8'),
+ _DETAILS)
+ self.assertEqual(self._servicer.actual_trailing_metadata,
+ _SERVER_TRAILING_METADATA)
+
+
if __name__ == '__main__':
logging.basicConfig()
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
index 0dafc9e9825..982ec903334 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_flags_test.py
@@ -13,20 +13,20 @@
# limitations under the License.
"""Tests metadata flags feature by testing wait-for-ready semantics"""
-import time
-import weakref
-import unittest
-import threading
import logging
import socket
-from six.moves import queue
+import threading
+import time
+import unittest
+import weakref
import grpc
+from six.moves import queue
from tests.unit import test_common
-from tests.unit.framework.common import test_constants
import tests.unit.framework.common
from tests.unit.framework.common import get_socket
+from tests.unit.framework.common import test_constants
_UNARY_UNARY = '/test/UnaryUnary'
_UNARY_STREAM = '/test/UnaryStream'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
index 3e7717b04c7..d975228d3b0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_metadata_test.py
@@ -13,9 +13,9 @@
# limitations under the License.
"""Tests server and client side metadata API."""
+import logging
import unittest
import weakref
-import logging
import grpc
from grpc import _channel
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
index 16feb4b1ff4..62ab5a58fc6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_reconnect_test.py
@@ -13,16 +13,17 @@
# limitations under the License.
"""Tests that a channel will reconnect if a connection is dropped"""
+import logging
import socket
import time
-import logging
import unittest
import grpc
from grpc.framework.foundation import logging_pool
-from tests.unit.framework.common import test_constants
+from tests.unit import test_common
from tests.unit.framework.common import bound_socket
+from tests.unit.framework.common import test_constants
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x00\x00\x01'
@@ -34,6 +35,8 @@ def _handle_unary_unary(unused_request, unused_servicer_context):
return _RESPONSE
+@unittest.skipIf(test_common.running_under_gevent(),
+ "Test is nondeterministic under gevent.")
class ReconnectTest(unittest.TestCase):
def test_reconnect(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py
index ecd2ccadbde..bd3272176ef 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_resource_exhausted_test.py
@@ -13,9 +13,9 @@
# limitations under the License.
"""Tests server responding with RESOURCE_EXHAUSTED."""
+import logging
import threading
import unittest
-import logging
import grpc
from grpc import _channel
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
index 9b0cb29a0d5..0ffa9eff94f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
@@ -13,23 +13,32 @@
# limitations under the License.
"""Test of RPCs made against gRPC Python's application-layer API."""
+from concurrent import futures
import itertools
+import logging
import threading
import unittest
-import logging
-from concurrent import futures
import grpc
from grpc.framework.foundation import logging_pool
-from tests.unit._rpc_test_helpers import (
- TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
- unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
- stream_unary_multi_callable, stream_stream_multi_callable,
- stream_stream_non_blocking_multi_callable, BaseRPCTest)
+from tests.unit import test_common
+from tests.unit._rpc_test_helpers import BaseRPCTest
+from tests.unit._rpc_test_helpers import Callback
+from tests.unit._rpc_test_helpers import TIMEOUT_SHORT
+from tests.unit._rpc_test_helpers import \
+ stream_stream_non_blocking_multi_callable
+from tests.unit._rpc_test_helpers import \
+ unary_stream_non_blocking_multi_callable
+from tests.unit._rpc_test_helpers import stream_stream_multi_callable
+from tests.unit._rpc_test_helpers import stream_unary_multi_callable
+from tests.unit._rpc_test_helpers import unary_stream_multi_callable
+from tests.unit._rpc_test_helpers import unary_unary_multi_callable
from tests.unit.framework.common import test_constants
+@unittest.skipIf(test_common.running_under_gevent(),
+ "This test is nondeterministic under gevent.")
class RPCPart1Test(BaseRPCTest, unittest.TestCase):
def testExpiredStreamRequestBlockingUnaryResponse(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
index 0e559efec2a..6a82a9588f6 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_rpc_part_2_test.py
@@ -13,23 +13,32 @@
# limitations under the License.
"""Test of RPCs made against gRPC Python's application-layer API."""
+from concurrent import futures
import itertools
+import logging
import threading
import unittest
-import logging
-from concurrent import futures
import grpc
from grpc.framework.foundation import logging_pool
-from tests.unit._rpc_test_helpers import (
- TIMEOUT_SHORT, Callback, unary_unary_multi_callable,
- unary_stream_multi_callable, unary_stream_non_blocking_multi_callable,
- stream_unary_multi_callable, stream_stream_multi_callable,
- stream_stream_non_blocking_multi_callable, BaseRPCTest)
+from tests.unit import test_common
+from tests.unit._rpc_test_helpers import BaseRPCTest
+from tests.unit._rpc_test_helpers import Callback
+from tests.unit._rpc_test_helpers import TIMEOUT_SHORT
+from tests.unit._rpc_test_helpers import \
+ stream_stream_non_blocking_multi_callable
+from tests.unit._rpc_test_helpers import \
+ unary_stream_non_blocking_multi_callable
+from tests.unit._rpc_test_helpers import stream_stream_multi_callable
+from tests.unit._rpc_test_helpers import stream_unary_multi_callable
+from tests.unit._rpc_test_helpers import unary_stream_multi_callable
+from tests.unit._rpc_test_helpers import unary_unary_multi_callable
from tests.unit.framework.common import test_constants
+@unittest.skipIf(test_common.running_under_gevent(),
+ "Causes deadlock under gevent.")
class RPCPart2Test(BaseRPCTest, unittest.TestCase):
def testDefaultThreadPoolIsUsed(self):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_scenarios.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_scenarios.py
index 1d1fdba11ee..42f69ebe88b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_scenarios.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_scenarios.py
@@ -14,17 +14,17 @@
"""Defines a number of module-scope gRPC scenarios to test server shutdown."""
import argparse
+from concurrent import futures
+import logging
import os
import threading
import time
-import logging
import grpc
-from tests.unit import test_common
-
-from concurrent import futures
from six.moves import queue
+from tests.unit import test_common
+
WAIT_TIME = 1000
REQUEST = b'request'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_test.py
index 1d203f63b30..31f45d6f3b2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_shutdown_test.py
@@ -18,12 +18,12 @@ test is considered successful if it doesn't freeze/timeout.
"""
import atexit
+import logging
import os
import subprocess
import sys
import threading
import unittest
-import logging
from tests.unit import _server_shutdown_scenarios
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
index 35d992a33d6..c20226830b3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_ssl_cert_config_test.py
@@ -31,20 +31,20 @@ Core by extension, support for server certificate rotation.
import abc
import collections
+from concurrent import futures
+import logging
import os
-import six
import threading
import unittest
-import logging
-
-from concurrent import futures
import grpc
-from tests.unit import resources
-from tests.unit import test_common
+import six
+
from tests.testing import _application_common
from tests.testing import _server_application
from tests.testing.proto import services_pb2_grpc
+from tests.unit import resources
+from tests.unit import test_common
CA_1_PEM = resources.cert_hier_1_root_ca_cert()
CA_2_PEM = resources.cert_hier_2_root_ca_cert()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
index 3c519219d59..2cddaf4b81f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_test.py
@@ -13,8 +13,8 @@
# limitations under the License.
from concurrent import futures
-import unittest
import logging
+import unittest
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
index 3dd95ea8bf6..065285a83c2 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_server_wait_for_termination_test.py
@@ -14,14 +14,15 @@
from __future__ import division
-import datetime
from concurrent import futures
-import unittest
-import time
+import datetime
import threading
-import six
+import time
+import unittest
import grpc
+import six
+
from tests.unit.framework.common import test_constants
_WAIT_FOR_BLOCKING = datetime.timedelta(seconds=1)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
index 9bff4d2af00..60912191263 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_session_cache_test.py
@@ -13,16 +13,16 @@
# limitations under the License.
"""Tests experimental TLS Session Resumption API"""
+import logging
import pickle
import unittest
-import logging
import grpc
from grpc import _channel
from grpc.experimental import session_cache
-from tests.unit import test_common
from tests.unit import resources
+from tests.unit import test_common
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x00\x00\x00'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_handling_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_handling_test.py
index a05e42d5a31..f45b049aa5c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_handling_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_signal_handling_test.py
@@ -17,15 +17,15 @@ import logging
import os
import signal
import subprocess
+import sys
import tempfile
import threading
import unittest
-import sys
import grpc
-from tests.unit import test_common
from tests.unit import _signal_client
+from tests.unit import test_common
_CLIENT_PATH = None
if sys.executable is not None:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_version_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_version_test.py
index 3d37b319e5a..a81e51e56c5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_version_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_version_test.py
@@ -13,9 +13,10 @@
# limitations under the License.
"""Test for grpc.__version__"""
+import logging
import unittest
+
import grpc
-import logging
from grpc import _grpcio_metadata
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_xds_credentials_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_xds_credentials_test.py
index 91d30c68ad5..64594061c01 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_xds_credentials_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/_xds_credentials_test.py
@@ -13,16 +13,16 @@
# limitations under the License.
"""Tests xDS server and channel credentials."""
-import unittest
-
-import logging
from concurrent import futures
import contextlib
+import logging
+import unittest
import grpc
import grpc.experimental
-from tests.unit import test_common
+
from tests.unit import resources
+from tests.unit import test_common
class _GenericHandler(grpc.GenericRpcHandler):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
index a111d687641..0ce3a127392 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_beta_features_test.py
@@ -20,6 +20,7 @@ from grpc.beta import implementations
from grpc.beta import interfaces
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities
+
from tests.unit import resources
from tests.unit.beta import test_utilities
from tests.unit.framework.common import test_constants
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
index 75a615eeffb..cc2a2ea0a87 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_implementations_test.py
@@ -16,9 +16,9 @@
import datetime
import unittest
+from grpc.beta import implementations
from oauth2client import client as oauth2client_client
-from grpc.beta import implementations
from tests.unit import resources
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
index 837d2bbebf2..27fdecb8b7b 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_not_found_test.py
@@ -18,6 +18,7 @@ import unittest
from grpc.beta import implementations
from grpc.beta import interfaces
from grpc.framework.interfaces.face import face
+
from tests.unit.framework.common import test_constants
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_utilities_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_utilities_test.py
index e0422627962..25773036f16 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_utilities_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/beta/_utilities_test.py
@@ -20,6 +20,7 @@ import unittest
from grpc.beta import implementations
from grpc.beta import utilities
from grpc.framework.foundation import future
+
from tests.unit.framework.common import test_constants
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
index 8b58a0c46af..709f6175b2e 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/framework/common/__init__.py
@@ -13,9 +13,9 @@
# limitations under the License.
import contextlib
+import errno
import os
import socket
-import errno
_DEFAULT_SOCK_OPTIONS = (socket.SO_REUSEADDR,
socket.SO_REUSEPORT) if os.name != 'nt' else (
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
index 59ded0752fd..dae69cbcebc 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/test_common.py
@@ -14,9 +14,9 @@
"""Common code used throughout tests of gRPC."""
import collections
+from concurrent import futures
import threading
-from concurrent import futures
import grpc
import six
@@ -132,3 +132,14 @@ class WaitGroup(object):
while self.count > 0:
self.cv.wait()
self.cv.release()
+
+
+def running_under_gevent():
+ try:
+ from gevent import monkey
+ import gevent.socket
+ except ImportError:
+ return False
+ else:
+ import socket
+ return socket.socket is gevent.socket.socket
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/thread_pool.py b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/thread_pool.py
index 094e203cd95..971806fd93f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/thread_pool.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests/unit/thread_pool.py
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import threading
from concurrent import futures
+import threading
class RecordingThreadPool(futures.ThreadPoolExecutor):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
index 1f925ba3cd7..301dba4bae8 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_client.py
@@ -15,15 +15,16 @@
import abc
import asyncio
-import time
import logging
import random
+import time
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
- messages_pb2)
+from src.proto.grpc.testing import benchmark_service_pb2_grpc
+from src.proto.grpc.testing import control_pb2
+from src.proto.grpc.testing import messages_pb2
from tests.qps import histogram
from tests.unit import resources
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
index 50d3065cd19..b519554a56c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/benchmark_servicer.py
@@ -19,7 +19,8 @@ import unittest
from grpc.experimental import aio
-from src.proto.grpc.testing import benchmark_service_pb2_grpc, messages_pb2
+from src.proto.grpc.testing import benchmark_service_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
class BenchmarkServicer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
index 1893bb9f19b..684beddb4ab 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/benchmark/worker_servicer.py
@@ -24,12 +24,15 @@ from typing import Tuple
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import (benchmark_service_pb2_grpc, control_pb2,
- stats_pb2, worker_service_pb2_grpc)
+from src.proto.grpc.testing import benchmark_service_pb2_grpc
+from src.proto.grpc.testing import control_pb2
+from src.proto.grpc.testing import stats_pb2
+from src.proto.grpc.testing import worker_service_pb2_grpc
from tests.qps import histogram
from tests.unit import resources
from tests.unit.framework.common import get_socket
-from tests_aio.benchmark import benchmark_client, benchmark_servicer
+from tests_aio.benchmark import benchmark_client
+from tests_aio.benchmark import benchmark_servicer
_NUM_CORES = multiprocessing.cpu_count()
_WORKER_ENTRY_FILE = os.path.join(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
index d6e9fd42791..e400dc87dc4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/channelz/channelz_servicer_test.py
@@ -13,13 +13,12 @@
# limitations under the License.
"""Tests of grpc_channelz.v1.channelz."""
-import unittest
-import logging
import asyncio
+import logging
+import unittest
import grpc
from grpc.experimental import aio
-
from grpc_channelz.v1 import channelz
from grpc_channelz.v1 import channelz_pb2
from grpc_channelz.v1 import channelz_pb2_grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
index a539dbf1409..7c6776ecd75 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/health_check/health_servicer_test.py
@@ -15,19 +15,17 @@
import asyncio
import logging
-import time
import random
+import time
import unittest
import grpc
-
+from grpc.experimental import aio
from grpc_health.v1 import health
from grpc_health.v1 import health_pb2
from grpc_health.v1 import health_pb2_grpc
-from grpc.experimental import aio
from tests.unit.framework.common import test_constants
-
from tests_aio.unit._test_base import AioTestBase
_SERVING_SERVICE = 'grpc.test.TestServiceServing'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
index 24681aa6985..6524a5ed0b0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/methods.py
@@ -25,14 +25,16 @@ import threading
import time
from typing import Any, Optional, Union
-import grpc
from google import auth as google_auth
from google.auth import environment_vars as google_auth_environment_vars
from google.auth.transport import grpc as google_auth_transport_grpc
from google.auth.transport import requests as google_auth_transport_requests
+import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import empty_pb2
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
_TRAILING_METADATA_KEY = "x-grpc-test-echo-trailing-bin"
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
index 509abdf0b2f..e40c831a876 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/interop/server.py
@@ -13,8 +13,8 @@
# limitations under the License.
"""The gRPC interoperability test server using AsyncIO stack."""
-import asyncio
import argparse
+import asyncio
import logging
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
index edd2d79eabe..8e5c9df6647 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/reflection/reflection_servicer_test.py
@@ -16,12 +16,13 @@
import logging
import unittest
-import grpc
from google.protobuf import descriptor_pb2
+import grpc
from grpc.experimental import aio
+from grpc_reflection.v1alpha import reflection
+from grpc_reflection.v1alpha import reflection_pb2
+from grpc_reflection.v1alpha import reflection_pb2_grpc
-from grpc_reflection.v1alpha import (reflection, reflection_pb2,
- reflection_pb2_grpc)
from src.proto.grpc.testing import empty_pb2
from src.proto.grpc.testing.proto2 import empty2_extensions_pb2
from tests_aio.unit._test_base import AioTestBase
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
index 980cf5a67e7..df5b75b9cd9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/status/grpc_status_test.py
@@ -17,12 +17,14 @@ import logging
import traceback
import unittest
-import grpc
from google.protobuf import any_pb2
-from google.rpc import code_pb2, error_details_pb2, status_pb2
+from google.rpc import code_pb2
+from google.rpc import error_details_pb2
+from google.rpc import status_pb2
+import grpc
from grpc.experimental import aio
-
from grpc_status import rpc_status
+
from tests_aio.unit._test_base import AioTestBase
_STATUS_OK = '/test/StatusOK'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
index 11513a722c0..05947733a08 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_common.py
@@ -13,11 +13,14 @@
# limitations under the License.
import asyncio
-import grpc
from typing import AsyncIterable
-from grpc.experimental import aio
-from grpc.aio._typing import MetadatumType, MetadataKey, MetadataValue
+
+import grpc
from grpc.aio._metadata import Metadata
+from grpc.aio._typing import MetadataKey
+from grpc.aio._typing import MetadataValue
+from grpc.aio._typing import MetadatumType
+from grpc.experimental import aio
from tests.unit.framework.common import test_constants
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
index 986a6f9d842..ab7e06f8fca 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_constants.py
@@ -12,5 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-UNREACHABLE_TARGET = '0.0.0.1:1111'
+# If we use an unreachable IP, depending on the network stack, we might not get
+# with an RST fast enough. This used to cause tests to flake under different
+# platforms.
+UNREACHABLE_TARGET = 'foo/bar'
UNARY_CALL_WITH_SLEEP_VALUE = 0.2
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
index ec5f2112da0..fcd1e90a5a0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_base.py
@@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import logging
-import functools
import asyncio
+import functools
+import logging
from typing import Callable
import unittest
+
from grpc.experimental import aio
__all__ = 'AioTestBase'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
index ee137dedb68..0119fda37c5 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/_test_server.py
@@ -17,9 +17,11 @@ import datetime
import grpc
from grpc.experimental import aio
-from tests.unit import resources
-from src.proto.grpc.testing import empty_pb2, messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import empty_pb2
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests.unit import resources
from tests_aio.unit import _constants
_INITIAL_METADATA_KEY = "x-grpc-test-echo-initial"
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
index 487c8c972e1..45ef9481a8c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/abort_test.py
@@ -13,15 +13,16 @@
# limitations under the License.
import asyncio
+import gc
import logging
-import unittest
import time
-import gc
+import unittest
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
+
from tests.unit.framework.common import test_constants
+from tests_aio.unit._test_base import AioTestBase
_UNARY_UNARY_ABORT = '/test/UnaryUnaryAbort'
_SUPPRESS_ABORT = '/test/SuppressAbort'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
index b7b18e08f6e..730871d1be3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/aio_rpc_error_test.py
@@ -17,9 +17,9 @@ import logging
import unittest
import grpc
-
-from grpc.experimental import aio
from grpc.aio._call import AioRpcError
+from grpc.experimental import aio
+
from tests_aio.unit._test_base import AioTestBase
_TEST_INITIAL_METADATA = aio.Metadata(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
index fb303714682..698f94b48ea 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/auth_context_test.py
@@ -13,9 +13,9 @@
# limitations under the License.
"""Porting auth context tests from sync stack."""
+import logging
import pickle
import unittest
-import logging
import grpc
from grpc.experimental import aio
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
index c7d99a20c48..ab8dc19f483 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/call_test.py
@@ -14,17 +14,18 @@
"""Tests behavior of the Call classes."""
import asyncio
+import datetime
import logging
import unittest
-import datetime
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests_aio.unit._constants import UNREACHABLE_TARGET
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
-from tests_aio.unit._constants import UNREACHABLE_TARGET
_SHORT_TIMEOUT_S = datetime.timedelta(seconds=1).total_seconds()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
index 8bf2dc8b1f1..6eb4c3c2d57 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_argument_test.py
@@ -14,16 +14,17 @@
"""Tests behavior around the Core channel arguments."""
import asyncio
+import errno
import logging
import platform
import random
-import errno
import unittest
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests.unit.framework import common
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
@@ -97,6 +98,8 @@ class TestChannelArgument(AioTestBase):
@unittest.skipIf(platform.system() == 'Windows',
'SO_REUSEPORT only available in Linux-like OS.')
+ @unittest.skipIf('aarch64' in platform.machine(),
+ 'SO_REUSEPORT needs to be enabled in Core\'s port.h.')
async def test_server_so_reuse_port_is_set_properly(self):
async def test_body():
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
index 75e4703d869..46e4d208ccf 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_ready_test.py
@@ -23,7 +23,8 @@ import unittest
import grpc
from grpc.experimental import aio
-from tests.unit.framework.common import get_socket, test_constants
+from tests.unit.framework.common import get_socket
+from tests.unit.framework.common import test_constants
from tests_aio.unit import _common
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
index 58cd555491d..699fe798f82 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/channel_test.py
@@ -20,10 +20,11 @@ import unittest
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests.unit.framework.common import test_constants
-from tests_aio.unit._constants import (UNARY_CALL_WITH_SLEEP_VALUE,
- UNREACHABLE_TARGET)
+from tests_aio.unit._constants import UNARY_CALL_WITH_SLEEP_VALUE
+from tests_aio.unit._constants import UNREACHABLE_TARGET
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
index ce6a7bc04d6..13ad9b075db 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_stream_interceptor_test.py
@@ -15,12 +15,14 @@ import logging
import unittest
import grpc
-
from grpc.experimental import aio
-from tests_aio.unit._common import CountingResponseIterator, CountingRequestIterator
-from tests_aio.unit._test_server import start_test_server
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests_aio.unit._common import CountingRequestIterator
+from tests_aio.unit._common import CountingResponseIterator
from tests_aio.unit._test_base import AioTestBase
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import start_test_server
_NUM_STREAM_RESPONSES = 5
_NUM_STREAM_REQUESTS = 5
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
index b9a04af00dc..ff99920c7f0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_stream_unary_interceptor_test.py
@@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import asyncio
+import datetime
import logging
import unittest
-import datetime
import grpc
-
from grpc.experimental import aio
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-from tests_aio.unit._common import inject_callbacks
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests.unit.framework.common import test_constants
from tests_aio.unit._common import CountingRequestIterator
-from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit._common import inject_callbacks
+from tests_aio.unit._constants import UNREACHABLE_TARGET
from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import start_test_server
_SHORT_TIMEOUT_S = 1.0
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
index fd542fd16e9..f0c0cba8eb9 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_stream_interceptor_test.py
@@ -12,20 +12,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import asyncio
+import datetime
import logging
import unittest
-import datetime
import grpc
-
from grpc.experimental import aio
-from tests_aio.unit._constants import UNREACHABLE_TARGET
-from tests_aio.unit._common import inject_callbacks
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests.unit.framework.common import test_constants
from tests_aio.unit._common import CountingResponseIterator
-from tests_aio.unit._test_server import start_test_server
+from tests_aio.unit._common import inject_callbacks
+from tests_aio.unit._constants import UNREACHABLE_TARGET
from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import start_test_server
_SHORT_TIMEOUT_S = 1.0
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
index e64daec7df4..7367c454fad 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/client_unary_unary_interceptor_test.py
@@ -16,13 +16,16 @@ import logging
import unittest
import grpc
-
from grpc.experimental import aio
-from tests_aio.unit._test_server import start_test_server, _INITIAL_METADATA_KEY, _TRAILING_METADATA_KEY
-from tests_aio.unit import _constants
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit import _common
+from tests_aio.unit import _constants
from tests_aio.unit._test_base import AioTestBase
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from tests_aio.unit._test_server import _INITIAL_METADATA_KEY
+from tests_aio.unit._test_server import _TRAILING_METADATA_KEY
+from tests_aio.unit._test_server import start_test_server
_LOCAL_CANCEL_DETAILS_EXPECTATION = 'Locally cancelled by application!'
_INITIAL_METADATA_TO_INJECT = aio.Metadata(
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
index 20543e95bf7..8d481a9a3b0 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/close_channel_test.py
@@ -18,10 +18,11 @@ import logging
import unittest
import grpc
-from grpc.experimental import aio
from grpc.aio import _base_call
+from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
index e1f0f4d5845..4749f39d035 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compatibility_test.py
@@ -14,22 +14,24 @@
"""Testing the compatibility between AsyncIO stack and the old stack."""
import asyncio
+from concurrent.futures import ThreadPoolExecutor
import logging
import os
import random
import threading
-import unittest
-from concurrent.futures import ThreadPoolExecutor
from typing import Callable, Iterable, Sequence, Tuple
+import unittest
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests.unit.framework.common import test_constants
from tests_aio.unit import _common
from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import TestServiceServicer, start_test_server
+from tests_aio.unit._test_server import TestServiceServicer
+from tests_aio.unit._test_server import start_test_server
_NUM_STREAM_RESPONSES = 5
_REQUEST_PAYLOAD_SIZE = 7
@@ -76,7 +78,7 @@ class TestCompatibility(AioTestBase):
await self._async_server.stop(None)
async def _run_in_another_thread(self, func: Callable[[], None]):
- work_done = asyncio.Event(loop=self.loop)
+ work_done = asyncio.Event()
def thread_work():
func()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
index 9d93885ea23..eb28a93f58c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/compression_test.py
@@ -22,8 +22,8 @@ import unittest
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
_GZIP_CHANNEL_ARGUMENT = ('grpc.default_compression_algorithm', 2)
_GZIP_DISABLED_CHANNEL_ARGUMENT = ('grpc.compression_enabled_algorithms_bitset',
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
index 7f98329070b..8ed2689cb83 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/connectivity_test.py
@@ -15,6 +15,7 @@
import asyncio
import logging
+import platform
import threading
import time
import unittest
@@ -37,6 +38,8 @@ class TestConnectivityState(AioTestBase):
async def tearDown(self):
await self._server.stop(None)
+ @unittest.skipIf('aarch64' in platform.machine(),
+ 'The transient failure propagation is slower on aarch64')
async def test_unavailable_backend(self):
async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
self.assertEqual(grpc.ChannelConnectivity.IDLE,
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
index ea5f4621afb..743d6599ef3 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/context_peer_test.py
@@ -16,17 +16,19 @@
import asyncio
import logging
import os
-import unittest
from typing import Callable, Iterable, Sequence, Tuple
+import unittest
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests.unit.framework.common import test_constants
from tests_aio.unit import _common
from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import TestServiceServicer, start_test_server
+from tests_aio.unit._test_server import TestServiceServicer
+from tests_aio.unit._test_server import start_test_server
_REQUEST = b'\x03\x07'
_TEST_METHOD = '/test/UnaryUnary'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
index 481bafd5679..42a070f2e81 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/done_callback_test.py
@@ -16,23 +16,26 @@
import asyncio
import logging
import unittest
-import time
-import gc
import grpc
from grpc.experimental import aio
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit._common import inject_callbacks
from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
from tests_aio.unit._test_server import start_test_server
_NUM_STREAM_RESPONSES = 5
_REQUEST_PAYLOAD_SIZE = 7
_RESPONSE_PAYLOAD_SIZE = 42
+_REQUEST = b'\x01\x02\x03'
+_RESPONSE = b'\x04\x05\x06'
+_TEST_METHOD = '/test/Test'
+_FAKE_METHOD = '/test/Fake'
-class TestDoneCallback(AioTestBase):
+class TestClientSideDoneCallback(AioTestBase):
async def setUp(self):
address, self._server = await start_test_server()
@@ -119,6 +122,155 @@ class TestDoneCallback(AioTestBase):
await validation
+class TestServerSideDoneCallback(AioTestBase):
+
+ async def setUp(self):
+ self._server = aio.server()
+ port = self._server.add_insecure_port('[::]:0')
+ self._channel = aio.insecure_channel('localhost:%d' % port)
+
+ async def tearDown(self):
+ await self._channel.close()
+ await self._server.stop(None)
+
+ async def _register_method_handler(self, method_handler):
+ """Registers method handler and starts the server"""
+ generic_handler = grpc.method_handlers_generic_handler(
+ 'test',
+ dict(Test=method_handler),
+ )
+ self._server.add_generic_rpc_handlers((generic_handler,))
+ await self._server.start()
+
+ async def test_unary_unary(self):
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request: bytes, context: aio.ServicerContext):
+ self.assertEqual(_REQUEST, request)
+ validation_future.set_result(inject_callbacks(context))
+ return _RESPONSE
+
+ await self._register_method_handler(
+ grpc.unary_unary_rpc_method_handler(test_handler))
+ response = await self._channel.unary_unary(_TEST_METHOD)(_REQUEST)
+ self.assertEqual(_RESPONSE, response)
+
+ validation = await validation_future
+ await validation
+
+ async def test_unary_stream(self):
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request: bytes, context: aio.ServicerContext):
+ self.assertEqual(_REQUEST, request)
+ validation_future.set_result(inject_callbacks(context))
+ for _ in range(_NUM_STREAM_RESPONSES):
+ yield _RESPONSE
+
+ await self._register_method_handler(
+ grpc.unary_stream_rpc_method_handler(test_handler))
+ call = self._channel.unary_stream(_TEST_METHOD)(_REQUEST)
+ async for response in call:
+ self.assertEqual(_RESPONSE, response)
+
+ validation = await validation_future
+ await validation
+
+ async def test_stream_unary(self):
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request_iterator, context: aio.ServicerContext):
+ validation_future.set_result(inject_callbacks(context))
+
+ async for request in request_iterator:
+ self.assertEqual(_REQUEST, request)
+ return _RESPONSE
+
+ await self._register_method_handler(
+ grpc.stream_unary_rpc_method_handler(test_handler))
+ call = self._channel.stream_unary(_TEST_METHOD)()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(_REQUEST)
+ await call.done_writing()
+ self.assertEqual(_RESPONSE, await call)
+
+ validation = await validation_future
+ await validation
+
+ async def test_stream_stream(self):
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request_iterator, context: aio.ServicerContext):
+ validation_future.set_result(inject_callbacks(context))
+
+ async for request in request_iterator:
+ self.assertEqual(_REQUEST, request)
+ return _RESPONSE
+
+ await self._register_method_handler(
+ grpc.stream_stream_rpc_method_handler(test_handler))
+ call = self._channel.stream_stream(_TEST_METHOD)()
+ for _ in range(_NUM_STREAM_RESPONSES):
+ await call.write(_REQUEST)
+ await call.done_writing()
+ async for response in call:
+ self.assertEqual(_RESPONSE, response)
+
+ validation = await validation_future
+ await validation
+
+ async def test_error_in_handler(self):
+ """Errors in the handler still triggers callbacks."""
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request: bytes, context: aio.ServicerContext):
+ self.assertEqual(_REQUEST, request)
+ validation_future.set_result(inject_callbacks(context))
+ raise RuntimeError('A test RuntimeError')
+
+ await self._register_method_handler(
+ grpc.unary_unary_rpc_method_handler(test_handler))
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channel.unary_unary(_TEST_METHOD)(_REQUEST)
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNKNOWN, rpc_error.code())
+
+ validation = await validation_future
+ await validation
+
+ async def test_error_in_callback(self):
+ """Errors in the callback won't be propagated to client."""
+ validation_future = self.loop.create_future()
+
+ async def test_handler(request: bytes, context: aio.ServicerContext):
+ self.assertEqual(_REQUEST, request)
+
+ def exception_raiser(unused_context):
+ raise RuntimeError('A test RuntimeError')
+
+ context.add_done_callback(exception_raiser)
+ validation_future.set_result(inject_callbacks(context))
+ return _RESPONSE
+
+ await self._register_method_handler(
+ grpc.unary_unary_rpc_method_handler(test_handler))
+
+ response = await self._channel.unary_unary(_TEST_METHOD)(_REQUEST)
+ self.assertEqual(_RESPONSE, response)
+
+ # Following callbacks won't be invoked, if one of the callback crashed.
+ validation = await validation_future
+ with self.assertRaises(asyncio.TimeoutError):
+ await validation
+
+ # Invoke RPC one more time to ensure the toxic callback won't break the
+ # server.
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await self._channel.unary_unary(_FAKE_METHOD)(_REQUEST)
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNIMPLEMENTED, rpc_error.code())
+
+
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
index 2261446b3ea..4043d19e317 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/metadata_test.py
@@ -22,8 +22,8 @@ import unittest
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
_TEST_CLIENT_TO_SERVER = '/test/TestClientToServer'
_TEST_SERVER_TO_CLIENT = '/test/TestServerToClient'
@@ -33,6 +33,7 @@ _TEST_GENERIC_HANDLER = '/test/TestGenericHandler'
_TEST_UNARY_STREAM = '/test/TestUnaryStream'
_TEST_STREAM_UNARY = '/test/TestStreamUnary'
_TEST_STREAM_STREAM = '/test/TestStreamStream'
+_TEST_INSPECT_CONTEXT = '/test/TestInspectContext'
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x01\x01\x01'
@@ -75,6 +76,9 @@ _INVALID_METADATA_TEST_CASES = (
),
)
+_NON_OK_CODE = grpc.StatusCode.NOT_FOUND
+_DETAILS = 'Test details!'
+
class _TestGenericHandlerForMethods(grpc.GenericRpcHandler):
@@ -95,6 +99,8 @@ class _TestGenericHandlerForMethods(grpc.GenericRpcHandler):
grpc.stream_unary_rpc_method_handler(self._test_stream_unary),
_TEST_STREAM_STREAM:
grpc.stream_stream_rpc_method_handler(self._test_stream_stream),
+ _TEST_INSPECT_CONTEXT:
+ grpc.unary_unary_rpc_method_handler(self._test_inspect_context),
}
@staticmethod
@@ -153,6 +159,19 @@ class _TestGenericHandlerForMethods(grpc.GenericRpcHandler):
yield _RESPONSE
context.set_trailing_metadata(_TRAILING_METADATA)
+ @staticmethod
+ async def _test_inspect_context(request, context):
+ assert _REQUEST == request
+ context.set_code(_NON_OK_CODE)
+ context.set_details(_DETAILS)
+ context.set_trailing_metadata(_TRAILING_METADATA)
+
+ # ensure that we can read back the data we set on the context
+ assert context.get_code() == _NON_OK_CODE
+ assert context.get_details() == _DETAILS
+ assert context.get_trailing_metadata() == _TRAILING_METADATA
+ return _RESPONSE
+
def service(self, handler_call_details):
return self._routing_table.get(handler_call_details.method)
@@ -291,6 +310,15 @@ class TestMetadata(AioTestBase):
self.assertEqual(expected_sum, metadata_obj + aio.Metadata(
('third', '3')))
+ async def test_inspect_context(self):
+ multicallable = self._client.unary_unary(_TEST_INSPECT_CONTEXT)
+ call = multicallable(_REQUEST)
+ with self.assertRaises(grpc.RpcError) as exc_data:
+ await call
+
+ err = exc_data.exception
+ self.assertEqual(_NON_OK_CODE, err.code())
+
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
index 879796cf0f5..79a7518585f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/outside_init_test.py
@@ -16,11 +16,13 @@
import asyncio
import logging
import unittest
-from grpc.experimental import aio
+
import grpc
+from grpc.experimental import aio
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit._test_server import start_test_server
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
_NUM_OF_LOOPS = 50
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
index 7efaddd607e..a5b03f43ae4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/secure_call_test.py
@@ -13,15 +13,17 @@
# limitations under the License.
"""Tests the behaviour of the Call classes under a secure channel."""
-import unittest
import logging
+import unittest
import grpc
from grpc.experimental import aio
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests.unit import resources
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
-from tests.unit import resources
_SERVER_HOST_OVERRIDE = 'foo.test.google.fr'
_NUM_STREAM_RESPONSES = 5
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
index 8eb846201a8..18f5df09de1 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_interceptor_test.py
@@ -16,13 +16,15 @@
import asyncio
import functools
import logging
-import unittest
from typing import Any, Awaitable, Callable, Tuple
+import unittest
import grpc
-from grpc.experimental import aio, wrap_server_method_handler
+from grpc.experimental import aio
+from grpc.experimental import wrap_server_method_handler
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit._test_server import start_test_server
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
index 8ba3ce1901e..2f0f6de1100 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_test.py
@@ -13,9 +13,7 @@
# limitations under the License.
import asyncio
-import gc
import logging
-import socket
import time
import unittest
@@ -40,8 +38,10 @@ _STREAM_STREAM_READER_WRITER = '/test/StreamStreamReaderWriter'
_STREAM_STREAM_EVILLY_MIXED = '/test/StreamStreamEvillyMixed'
_UNIMPLEMENTED_METHOD = '/test/UnimplementedMethod'
_ERROR_IN_STREAM_STREAM = '/test/ErrorInStreamStream'
+_ERROR_IN_STREAM_UNARY = '/test/ErrorInStreamUnary'
_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY = '/test/ErrorWithoutRaiseInUnaryUnary'
_ERROR_WITHOUT_RAISE_IN_STREAM_STREAM = '/test/ErrorWithoutRaiseInStreamStream'
+_INVALID_TRAILING_METADATA = '/test/InvalidTrailingMetadata'
_REQUEST = b'\x00\x00\x00'
_RESPONSE = b'\x01\x01\x01'
@@ -91,12 +91,18 @@ class _GenericHandler(grpc.GenericRpcHandler):
_ERROR_IN_STREAM_STREAM:
grpc.stream_stream_rpc_method_handler(
self._error_in_stream_stream),
+ _ERROR_IN_STREAM_UNARY:
+ grpc.stream_unary_rpc_method_handler(
+ self._value_error_in_stream_unary),
_ERROR_WITHOUT_RAISE_IN_UNARY_UNARY:
grpc.unary_unary_rpc_method_handler(
self._error_without_raise_in_unary_unary),
_ERROR_WITHOUT_RAISE_IN_STREAM_STREAM:
grpc.stream_stream_rpc_method_handler(
self._error_without_raise_in_stream_stream),
+ _INVALID_TRAILING_METADATA:
+ grpc.unary_unary_rpc_method_handler(
+ self._invalid_trailing_metadata),
}
@staticmethod
@@ -179,6 +185,14 @@ class _GenericHandler(grpc.GenericRpcHandler):
raise RuntimeError('A testing RuntimeError!')
yield _RESPONSE
+ async def _value_error_in_stream_unary(self, request_iterator, context):
+ request_count = 0
+ async for request in request_iterator:
+ assert _REQUEST == request
+ request_count += 1
+ if request_count >= 1:
+ raise ValueError('A testing RuntimeError!')
+
async def _error_without_raise_in_unary_unary(self, request, context):
assert _REQUEST == request
context.set_code(grpc.StatusCode.INTERNAL)
@@ -189,6 +203,30 @@ class _GenericHandler(grpc.GenericRpcHandler):
assert _REQUEST == request
context.set_code(grpc.StatusCode.INTERNAL)
+ async def _invalid_trailing_metadata(self, request, context):
+ assert _REQUEST == request
+ for invalid_metadata in [
+ 42, {}, {
+ 'error': 'error'
+ }, [{
+ 'error': "error"
+ }]
+ ]:
+ try:
+ context.set_trailing_metadata(invalid_metadata)
+ except TypeError:
+ pass
+ else:
+ raise ValueError(
+ f'No TypeError raised for invalid metadata: {invalid_metadata}'
+ )
+
+ await context.abort(grpc.StatusCode.DATA_LOSS,
+ details="invalid abort",
+ trailing_metadata=({
+ 'error': ('error1', 'error2')
+ }))
+
def service(self, handler_details):
if not self._called.done():
self._called.set_result(None)
@@ -270,6 +308,24 @@ class TestServer(AioTestBase):
self.assertEqual(_RESPONSE, response)
self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ async def test_stream_unary_async_generator_with_request_iter(self):
+ stream_unary_call = self._channel.stream_unary(_STREAM_UNARY_ASYNC_GEN)
+
+ finished = False
+
+ def request_gen():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield _REQUEST
+ nonlocal finished
+ finished = True
+
+ call = stream_unary_call(request_gen())
+
+ response = await call
+ self.assertEqual(_RESPONSE, response)
+ self.assertEqual(await call.code(), grpc.StatusCode.OK)
+ self.assertEqual(finished, True)
+
async def test_stream_unary_reader_writer(self):
stream_unary_call = self._channel.stream_unary(
_STREAM_UNARY_READER_WRITER)
@@ -468,6 +524,20 @@ class TestServer(AioTestBase):
self.assertEqual(grpc.StatusCode.INTERNAL, await call.code())
+ async def test_error_in_stream_unary(self):
+ stream_unary_call = self._channel.stream_unary(_ERROR_IN_STREAM_UNARY)
+
+ async def request_gen():
+ for _ in range(_NUM_STREAM_REQUESTS):
+ yield _REQUEST
+
+ call = stream_unary_call(request_gen())
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNKNOWN, rpc_error.code())
+
async def test_port_binding_exception(self):
server = aio.server(options=(('grpc.so_reuseport', 0),))
port = server.add_insecure_port('localhost:0')
@@ -506,6 +576,16 @@ class TestServer(AioTestBase):
await channel.close()
await server.stop(0)
+ async def test_invalid_trailing_metadata(self):
+ call = self._channel.unary_unary(_INVALID_TRAILING_METADATA)(_REQUEST)
+
+ with self.assertRaises(aio.AioRpcError) as exception_context:
+ await call
+
+ rpc_error = exception_context.exception
+ self.assertEqual(grpc.StatusCode.UNKNOWN, rpc_error.code())
+ self.assertIn('trailing', rpc_error.details())
+
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py
index 0de87b532fb..340e4cc350a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/server_time_remaining_test.py
@@ -14,14 +14,15 @@
"""Test the time_remaining() method of async ServicerContext."""
import asyncio
+import datetime
import logging
import unittest
-import datetime
import grpc
from grpc import aio
-from tests_aio.unit._common import ADHOC_METHOD, AdhocGenericHandler
+from tests_aio.unit._common import ADHOC_METHOD
+from tests_aio.unit._common import AdhocGenericHandler
from tests_aio.unit._test_base import AioTestBase
_REQUEST = b'\x09\x05'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
index b5bcc027ec1..dab0f5113f4 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/timeout_test.py
@@ -14,17 +14,17 @@
"""Tests behavior of the timeout mechanism on client side."""
import asyncio
+import datetime
import logging
import platform
import random
import unittest
-import datetime
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
_SLEEP_TIME_UNIT_S = datetime.timedelta(seconds=1).total_seconds()
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
index 4fbe074740e..a49a1241c4f 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_connection_test.py
@@ -14,19 +14,20 @@
"""Tests behavior of the wait for connection API on client side."""
import asyncio
-import logging
-import unittest
import datetime
+import logging
from typing import Callable, Tuple
+import unittest
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
-from tests_aio.unit._test_server import start_test_server
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit import _common
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
from tests_aio.unit._constants import UNREACHABLE_TARGET
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
_REQUEST = b'\x01\x02\x03'
_TEST_METHOD = '/test/Test'
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
index 5bcfd54856b..303c138642a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_aio/unit/wait_for_ready_test.py
@@ -14,19 +14,22 @@
"""Testing the done callbacks mechanism."""
import asyncio
+import gc
import logging
-import unittest
+import platform
import time
-import gc
+import unittest
import grpc
from grpc.experimental import aio
-from tests_aio.unit._test_base import AioTestBase
-from tests.unit.framework.common import test_constants
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
from tests.unit.framework.common import get_socket
-from src.proto.grpc.testing import messages_pb2, test_pb2_grpc
-from tests_aio.unit._test_server import start_test_server
+from tests.unit.framework.common import test_constants
from tests_aio.unit import _common
+from tests_aio.unit._test_base import AioTestBase
+from tests_aio.unit._test_server import start_test_server
_NUM_STREAM_RESPONSES = 5
_REQUEST_PAYLOAD_SIZE = 7
@@ -119,6 +122,8 @@ class TestWaitForReady(AioTestBase):
"""RPC should fail immediately after connection failed."""
await self._connection_fails_fast(False)
+ @unittest.skipIf(platform.system() == 'Windows',
+ 'https://github.com/grpc/grpc/pull/26729')
async def test_call_wait_for_ready_enabled(self):
"""RPC will wait until the connection is ready."""
for action in _RPC_ACTIONS:
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/__init__.py
new file mode 100644
index 00000000000..712a2e1de2a
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/__init__.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/__init__.py
new file mode 100644
index 00000000000..712a2e1de2a
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/_test_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/_test_server.py
new file mode 100644
index 00000000000..82327aa7098
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/_test_server.py
@@ -0,0 +1,61 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from concurrent import futures
+from typing import Any, Tuple
+
+import gevent
+import grpc
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+
+LONG_UNARY_CALL_WITH_SLEEP_VALUE = 1
+
+
+class TestServiceServicer(test_pb2_grpc.TestServiceServicer):
+
+ def UnaryCall(self, request, context):
+ return messages_pb2.SimpleResponse()
+
+ def UnaryCallWithSleep(self, unused_request, unused_context):
+ gevent.sleep(LONG_UNARY_CALL_WITH_SLEEP_VALUE)
+ return messages_pb2.SimpleResponse()
+
+
+def start_test_server(port: int = 0) -> Tuple[str, Any]:
+ server = grpc.server(futures.ThreadPoolExecutor())
+ servicer = TestServiceServicer()
+ test_pb2_grpc.add_TestServiceServicer_to_server(TestServiceServicer(),
+ server)
+
+ server.add_generic_rpc_handlers((_create_extra_generic_handler(servicer),))
+ port = server.add_insecure_port('[::]:%d' % port)
+ server.start()
+ return 'localhost:%d' % port, server
+
+
+def _create_extra_generic_handler(servicer: TestServiceServicer) -> Any:
+ # Add programatically extra methods not provided by the proto file
+ # that are used during the tests
+ rpc_method_handlers = {
+ 'UnaryCallWithSleep':
+ grpc.unary_unary_rpc_method_handler(
+ servicer.UnaryCallWithSleep,
+ request_deserializer=messages_pb2.SimpleRequest.FromString,
+ response_serializer=messages_pb2.SimpleResponse.
+ SerializeToString)
+ }
+ return grpc.method_handlers_generic_handler('grpc.testing.TestService',
+ rpc_method_handlers)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py
new file mode 100644
index 00000000000..ca73fd685d5
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_gevent/unit/close_channel_test.py
@@ -0,0 +1,105 @@
+# Copyright 2021 The gRPC Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import sys
+import unittest
+
+import gevent
+from gevent.pool import Group
+import grpc
+
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+from tests_gevent.unit._test_server import start_test_server
+
+_UNARY_CALL_METHOD_WITH_SLEEP = '/grpc.testing.TestService/UnaryCallWithSleep'
+
+
+class CloseChannelTest(unittest.TestCase):
+
+ def setUp(self):
+ self._server_target, self._server = start_test_server()
+ self._channel = grpc.insecure_channel(self._server_target)
+ self._unhandled_exception = False
+ sys.excepthook = self._global_exception_handler
+
+ def tearDown(self):
+ self._channel.close()
+ self._server.stop(None)
+
+ def test_graceful_close(self):
+ stub = test_pb2_grpc.TestServiceStub(self._channel)
+ _, response = stub.UnaryCall.with_call(messages_pb2.SimpleRequest())
+
+ self._channel.close()
+
+ self.assertEqual(grpc.StatusCode.OK, response.code())
+
+ def test_graceful_close_in_greenlet(self):
+ group = Group()
+ stub = test_pb2_grpc.TestServiceStub(self._channel)
+ greenlet = group.spawn(self._run_client, stub.UnaryCall)
+ # release loop so that greenlet can take control
+ gevent.sleep()
+ self._channel.close()
+ group.killone(greenlet)
+ self.assertFalse(self._unhandled_exception, "Unhandled GreenletExit")
+ try:
+ greenlet.get()
+ except Exception as e: # pylint: disable=broad-except
+ self.fail(f"Unexpected exception in greenlet: {e}")
+
+ def test_ungraceful_close_in_greenlet(self):
+ group = Group()
+ UnaryCallWithSleep = self._channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+ greenlet = group.spawn(self._run_client, UnaryCallWithSleep)
+ # release loop so that greenlet can take control
+ gevent.sleep()
+ group.killone(greenlet)
+ self.assertFalse(self._unhandled_exception, "Unhandled GreenletExit")
+
+ def test_kill_greenlet_with_generic_exception(self):
+ group = Group()
+ UnaryCallWithSleep = self._channel.unary_unary(
+ _UNARY_CALL_METHOD_WITH_SLEEP,
+ request_serializer=messages_pb2.SimpleRequest.SerializeToString,
+ response_deserializer=messages_pb2.SimpleResponse.FromString,
+ )
+ greenlet = group.spawn(self._run_client, UnaryCallWithSleep)
+ # release loop so that greenlet can take control
+ gevent.sleep()
+ group.killone(greenlet, exception=Exception)
+ self.assertFalse(self._unhandled_exception, "Unhandled exception")
+ self.assertRaises(Exception, greenlet.get)
+
+ def _run_client(self, call):
+ try:
+ call.with_call(messages_pb2.SimpleRequest())
+ except grpc.RpcError as e:
+ if e.code() != grpc.StatusCode.CANCELLED:
+ raise
+
+ def _global_exception_handler(self, exctype, value, tb):
+ if exctype == gevent.GreenletExit:
+ self._unhandled_exception = True
+ return
+ sys.__excepthook__(exctype, value, tb)
+
+
+if __name__ == '__main__':
+ unittest.main(verbosity=2)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
index fa953e5ac09..c98bba39a5a 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_client.py
@@ -14,24 +14,23 @@
import argparse
import collections
+from concurrent import futures
import datetime
import logging
import signal
+import sys
import threading
import time
-import sys
-
-from typing import DefaultDict, Dict, List, Mapping, Set, Sequence, Tuple
-import collections
-
-from concurrent import futures
+from typing import DefaultDict, Dict, List, Mapping, Sequence, Set, Tuple
import grpc
+import grpc_admin
+from grpc_channelz.v1 import channelz
+from src.proto.grpc.testing import empty_pb2
+from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import test_pb2
from src.proto.grpc.testing import test_pb2_grpc
-from src.proto.grpc.testing import messages_pb2
-from src.proto.grpc.testing import empty_pb2
logger = logging.getLogger()
console_handler = logging.StreamHandler()
@@ -124,6 +123,7 @@ _global_rpc_statuses: Mapping[str, Mapping[int, int]] = collections.defaultdict(
def _handle_sigint(sig, frame) -> None:
+ logger.warning("Received SIGINT")
_stop_event.set()
_global_server.stop(None)
@@ -257,9 +257,9 @@ class _ChannelConfiguration:
When accessing any of its members, the lock member should be held.
"""
- def __init__(self, method: str, metadata: Sequence[Tuple[str,
- str]], qps: int,
- server: str, rpc_timeout_sec: int, print_response: bool):
+ def __init__(self, method: str, metadata: Sequence[Tuple[str, str]],
+ qps: int, server: str, rpc_timeout_sec: int,
+ print_response: bool, secure_mode: bool):
# condition is signalled when a change is made to the config.
self.condition = threading.Condition()
@@ -269,13 +269,21 @@ class _ChannelConfiguration:
self.server = server
self.rpc_timeout_sec = rpc_timeout_sec
self.print_response = print_response
+ self.secure_mode = secure_mode
def _run_single_channel(config: _ChannelConfiguration) -> None:
global _global_rpc_id # pylint: disable=global-statement
with config.condition:
server = config.server
- with grpc.insecure_channel(server) as channel:
+ channel = None
+ if config.secure_mode:
+ fallback_creds = grpc.experimental.insecure_channel_credentials()
+ channel_creds = grpc.xds_channel_credentials(fallback_creds)
+ channel = grpc.secure_channel(server, channel_creds)
+ else:
+ channel = grpc.insecure_channel(server)
+ with channel:
stub = test_pb2_grpc.TestServiceStub(channel)
futures: Dict[int, Tuple[grpc.Future, str]] = {}
while not _stop_event.is_set():
@@ -320,7 +328,7 @@ class _XdsUpdateClientConfigureServicer(
context: grpc.ServicerContext
) -> messages_pb2.ClientConfigureResponse:
logger.info("Received Configure RPC: %s", request)
- method_strs = (_METHOD_ENUM_TO_STR[t] for t in request.types)
+ method_strs = [_METHOD_ENUM_TO_STR[t] for t in request.types]
for method in _SUPPORTED_METHODS:
method_enum = _METHOD_STR_TO_ENUM[method]
channel_config = self._per_method_configs[method]
@@ -382,7 +390,7 @@ def _run(args: argparse.Namespace, methods: Sequence[str],
qps = 0
channel_config = _ChannelConfiguration(
method, per_method_metadata.get(method, []), qps, args.server,
- args.rpc_timeout_sec, args.print_response)
+ args.rpc_timeout_sec, args.print_response, args.secure_mode)
channel_configs[method] = channel_config
method_handles.append(_MethodHandle(args.num_channels, channel_config))
_global_server = grpc.server(futures.ThreadPoolExecutor())
@@ -392,6 +400,8 @@ def _run(args: argparse.Namespace, methods: Sequence[str],
test_pb2_grpc.add_XdsUpdateClientConfigureServiceServicer_to_server(
_XdsUpdateClientConfigureServicer(channel_configs, args.qps),
_global_server)
+ channelz.add_channelz_servicer(_global_server)
+ grpc_admin.add_admin_servicers(_global_server)
_global_server.start()
_global_server.wait_for_termination()
for method_handle in method_handles:
@@ -420,6 +430,15 @@ def parse_rpc_arg(rpc_arg: str) -> Sequence[str]:
return methods
+def bool_arg(arg: str) -> bool:
+ if arg.lower() in ("true", "yes", "y"):
+ return True
+ elif arg.lower() in ("false", "no", "n"):
+ return False
+ else:
+ raise argparse.ArgumentTypeError(f"Could not parse '{arg}' as a bool.")
+
+
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Run Python XDS interop client.')
@@ -429,8 +448,8 @@ if __name__ == "__main__":
type=int,
help="The number of channels from which to send requests.")
parser.add_argument("--print_response",
- default=False,
- action="store_true",
+ default="False",
+ type=bool_arg,
help="Write RPC response to STDOUT.")
parser.add_argument(
"--qps",
@@ -449,6 +468,11 @@ if __name__ == "__main__":
default=50052,
type=int,
help="The port on which to expose the peer distribution stats service.")
+ parser.add_argument(
+ "--secure_mode",
+ default="False",
+ type=bool_arg,
+ help="If specified, uses xDS credentials to connect to the server.")
parser.add_argument('--verbose',
help='verbose log output',
default=False,
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py
new file mode 100644
index 00000000000..2c44b42e2ec
--- /dev/null
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/interop/xds_interop_server.py
@@ -0,0 +1,177 @@
+# Copyright 2021 The gRPC authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import argparse
+import collections
+from concurrent import futures
+import logging
+import signal
+import socket
+import sys
+import threading
+import time
+from typing import DefaultDict, Dict, List, Mapping, Sequence, Set, Tuple
+
+import grpc
+from grpc_channelz.v1 import channelz
+from grpc_channelz.v1 import channelz_pb2
+from grpc_health.v1 import health as grpc_health
+from grpc_health.v1 import health_pb2
+from grpc_health.v1 import health_pb2_grpc
+from grpc_reflection.v1alpha import reflection
+
+from src.proto.grpc.testing import empty_pb2
+from src.proto.grpc.testing import messages_pb2
+from src.proto.grpc.testing import test_pb2
+from src.proto.grpc.testing import test_pb2_grpc
+
+# NOTE: This interop server is not fully compatible with all xDS interop tests.
+# It currently only implements enough functionality to pass the xDS security
+# tests.
+
+_LISTEN_HOST = "0.0.0.0"
+
+_THREAD_POOL_SIZE = 256
+
+logger = logging.getLogger()
+console_handler = logging.StreamHandler()
+formatter = logging.Formatter(fmt='%(asctime)s: %(levelname)-8s %(message)s')
+console_handler.setFormatter(formatter)
+logger.addHandler(console_handler)
+
+
+class TestService(test_pb2_grpc.TestServiceServicer):
+
+ def __init__(self, server_id, hostname):
+ self._server_id = server_id
+ self._hostname = hostname
+
+ def EmptyCall(self, _: empty_pb2.Empty,
+ context: grpc.ServicerContext) -> empty_pb2.Empty:
+ return empty_pb2.Empty()
+
+ def UnaryCall(self, request: messages_pb2.SimpleRequest,
+ context: grpc.ServicerContext) -> messages_pb2.SimpleResponse:
+ response = messages_pb2.SimpleResponse()
+ response.server_id = self._server_id
+ response.hostname = self._hostname
+ return response
+
+
+def _configure_maintenance_server(server: grpc.Server,
+ maintenance_port: int) -> None:
+ channelz.add_channelz_servicer(server)
+ listen_address = f"{_LISTEN_HOST}:{maintenance_port}"
+ server.add_insecure_port(listen_address)
+ health_servicer = grpc_health.HealthServicer(
+ experimental_non_blocking=True,
+ experimental_thread_pool=futures.ThreadPoolExecutor(
+ max_workers=_THREAD_POOL_SIZE))
+
+ health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
+ SERVICE_NAMES = (
+ test_pb2.DESCRIPTOR.services_by_name["TestService"].full_name,
+ health_pb2.DESCRIPTOR.services_by_name["Health"].full_name,
+ channelz_pb2.DESCRIPTOR.services_by_name["Channelz"].full_name,
+ reflection.SERVICE_NAME,
+ )
+ for service in SERVICE_NAMES:
+ health_servicer.set(service, health_pb2.HealthCheckResponse.SERVING)
+ reflection.enable_server_reflection(SERVICE_NAMES, server)
+
+
+def _configure_test_server(server: grpc.Server, port: int, secure_mode: bool,
+ server_id: str) -> None:
+ test_pb2_grpc.add_TestServiceServicer_to_server(
+ TestService(server_id, socket.gethostname()), server)
+ listen_address = f"{_LISTEN_HOST}:{port}"
+ if not secure_mode:
+ server.add_insecure_port(listen_address)
+ else:
+ logger.info("Running with xDS Server credentials")
+ server_fallback_creds = grpc.insecure_server_credentials()
+ server_creds = grpc.xds_server_credentials(server_fallback_creds)
+ server.add_secure_port(listen_address, server_creds)
+
+
+def _run(port: int, maintenance_port: int, secure_mode: bool,
+ server_id: str) -> None:
+ if port == maintenance_port:
+ server = grpc.server(
+ futures.ThreadPoolExecutor(max_workers=_THREAD_POOL_SIZE))
+ _configure_test_server(server, port, secure_mode, server_id)
+ _configure_maintenance_server(server, maintenance_port)
+ server.start()
+ logger.info("Test server listening on port %d", port)
+ logger.info("Maintenance server listening on port %d", maintenance_port)
+ server.wait_for_termination()
+ else:
+ test_server = grpc.server(
+ futures.ThreadPoolExecutor(max_workers=_THREAD_POOL_SIZE),
+ xds=secure_mode)
+ _configure_test_server(test_server, port, secure_mode, server_id)
+ test_server.start()
+ logger.info("Test server listening on port %d", port)
+ maintenance_server = grpc.server(
+ futures.ThreadPoolExecutor(max_workers=_THREAD_POOL_SIZE))
+ _configure_maintenance_server(maintenance_server, maintenance_port)
+ maintenance_server.start()
+ logger.info("Maintenance server listening on port %d", maintenance_port)
+ test_server.wait_for_termination()
+ maintenance_server.wait_for_termination()
+
+
+def bool_arg(arg: str) -> bool:
+ if arg.lower() in ("true", "yes", "y"):
+ return True
+ elif arg.lower() in ("false", "no", "n"):
+ return False
+ else:
+ raise argparse.ArgumentTypeError(f"Could not parse '{arg}' as a bool.")
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(
+ description="Run Python xDS interop server.")
+ parser.add_argument("--port",
+ type=int,
+ default=8080,
+ help="Port for test server.")
+ parser.add_argument("--maintenance_port",
+ type=int,
+ default=8080,
+ help="Port for servers besides test server.")
+ parser.add_argument(
+ "--secure_mode",
+ type=bool_arg,
+ default="False",
+ help="If specified, uses xDS to retrieve server credentials.")
+ parser.add_argument("--server_id",
+ type=str,
+ default="python_server",
+ help="The server ID to return in responses..")
+ parser.add_argument('--verbose',
+ help='verbose log output',
+ default=False,
+ action='store_true')
+ args = parser.parse_args()
+ if args.verbose:
+ logger.setLevel(logging.DEBUG)
+ else:
+ logger.setLevel(logging.INFO)
+ if args.secure_mode and args.port == args.maintenance_port:
+ raise ValueError(
+ "--port and --maintenance_port must not be the same when --secure_mode is set."
+ )
+ _run(args.port, args.maintenance_port, args.secure_mode, args.server_id)
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
index 3b3f12fa1f9..f8b8382e31c 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_leak_test.py
@@ -18,12 +18,12 @@ explicitly invoked. The recommended way of using Channel object is using `with`
clause, and let context manager automatically close the channel.
"""
+from concurrent.futures import ThreadPoolExecutor
import logging
import os
import resource
import sys
import unittest
-from concurrent.futures import ThreadPoolExecutor
import grpc
diff --git a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
index 08d5a882eb9..f0365e15e78 100644
--- a/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
+++ b/contrib/libs/grpc/src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py
@@ -29,18 +29,19 @@ import contextlib
import datetime
import inspect
import logging
-import threading
-import unittest
import sys
+import threading
import time
from typing import Callable, Optional
+import unittest
-from tests.unit import test_common
-from tests.unit.framework.common import get_socket
-from tests.unit import resources
import grpc
import grpc.experimental
+from tests.unit import resources
+from tests.unit import test_common
+from tests.unit.framework.common import get_socket
+
_REQUEST = b"0000"
_CACHE_EPOCHS = 8
diff --git a/contrib/libs/grpc/test/core/util/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/test/core/util/.yandex_meta/licenses.list.txt
index 8082dbe9c6a..b31c8995b87 100644
--- a/contrib/libs/grpc/test/core/util/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/test/core/util/.yandex_meta/licenses.list.txt
@@ -66,3 +66,7 @@
====================COPYRIGHT====================
* Copyright 2020 the gRPC authors.
+
+
+====================COPYRIGHT====================
+// Copyright 2021 gRPC authors.
diff --git a/contrib/libs/grpc/test/core/util/build.cc b/contrib/libs/grpc/test/core/util/build.cc
new file mode 100644
index 00000000000..04d39e9574d
--- /dev/null
+++ b/contrib/libs/grpc/test/core/util/build.cc
@@ -0,0 +1,77 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+bool BuiltUnderValgrind() {
+#ifdef RUNNING_ON_VALGRIND
+ return true;
+#else
+ return false;
+#endif
+}
+
+bool BuiltUnderTsan() {
+#if defined(__has_feature)
+#if __has_feature(thread_sanitizer)
+ return true;
+#else
+ return false;
+#endif
+#else
+#ifdef THREAD_SANITIZER
+ return true;
+#else
+ return false;
+#endif
+#endif
+}
+
+bool BuiltUnderAsan() {
+#if defined(__has_feature)
+#if __has_feature(address_sanitizer)
+ return true;
+#else
+ return false;
+#endif
+#else
+#ifdef ADDRESS_SANITIZER
+ return true;
+#else
+ return false;
+#endif
+#endif
+}
+
+bool BuiltUnderMsan() {
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+ return true;
+#else
+ return false;
+#endif
+#else
+#ifdef MEMORY_SANITIZER
+ return true;
+#else
+ return false;
+#endif
+#endif
+}
+
+bool BuiltUnderUbsan() {
+#ifdef GRPC_UBSAN
+ return true;
+#else
+ return false;
+#endif
+}
diff --git a/contrib/libs/grpc/test/core/util/build.h b/contrib/libs/grpc/test/core/util/build.h
new file mode 100644
index 00000000000..9cdab0ced78
--- /dev/null
+++ b/contrib/libs/grpc/test/core/util/build.h
@@ -0,0 +1,33 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_TEST_CORE_UTIL_BUILD_H
+#define GRPC_TEST_CORE_UTIL_BUILD_H
+
+// Returns whether this is built using our Valgrind config
+bool BuiltUnderValgrind();
+
+// Returns whether this is built under ThreadSanitizer
+bool BuiltUnderTsan();
+
+// Returns whether this is built under AddressSanitizer
+bool BuiltUnderAsan();
+
+// Returns whether this is built under MemorySanitizer
+bool BuiltUnderMsan();
+
+// Returns whether this is built under UndefinedBehaviorSanitizer
+bool BuiltUnderUbsan();
+
+#endif
diff --git a/contrib/libs/grpc/test/core/util/cmdline.cc b/contrib/libs/grpc/test/core/util/cmdline.cc
index 350d4bc046a..c031ef8b4c0 100644
--- a/contrib/libs/grpc/test/core/util/cmdline.cc
+++ b/contrib/libs/grpc/test/core/util/cmdline.cc
@@ -31,7 +31,9 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+
#include "src/core/lib/gpr/string.h"
+#include "src/core/lib/gprpp/memory.h"
typedef enum { ARGTYPE_INT, ARGTYPE_BOOL, ARGTYPE_STRING } argtype;
@@ -62,7 +64,7 @@ struct gpr_cmdline {
static int normal_state(gpr_cmdline* cl, char* str);
gpr_cmdline* gpr_cmdline_create(const char* description) {
- gpr_cmdline* cl = static_cast<gpr_cmdline*>(gpr_zalloc(sizeof(gpr_cmdline)));
+ gpr_cmdline* cl = grpc_core::Zalloc<gpr_cmdline>();
cl->description = description;
cl->state = normal_state;
diff --git a/contrib/libs/grpc/test/core/util/cmdline_test.cc b/contrib/libs/grpc/test/core/util/cmdline_test.cc
index 6831684bf66..32f9a156a11 100644
--- a/contrib/libs/grpc/test/core/util/cmdline_test.cc
+++ b/contrib/libs/grpc/test/core/util/cmdline_test.cc
@@ -16,13 +16,14 @@
*
*/
+#include "test/core/util/cmdline.h"
+
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gpr/useful.h"
-#include "test/core/util/cmdline.h"
#include "test/core/util/test_config.h"
#define LOG_TEST() gpr_log(GPR_INFO, "test at %s:%d", __FILE__, __LINE__)
diff --git a/contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.cc b/contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.cc
deleted file mode 100644
index cc8758da7f2..00000000000
--- a/contrib/libs/grpc/test/core/util/eval_args_mock_endpoint.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include <grpc/support/port_platform.h>
-
-#include "test/core/util/eval_args_mock_endpoint.h"
-
-#include <inttypes.h>
-
-#include <util/generic/string.h>
-
-#include "y_absl/strings/str_format.h"
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
-
-namespace grpc_core {
-
-class EvalArgsMockEndpoint {
- public:
- EvalArgsMockEndpoint(y_absl::string_view local_uri, y_absl::string_view peer_uri)
- : local_address_(local_uri), peer_(peer_uri) {
- base_.vtable = &vtable_;
- }
- grpc_endpoint* base() const { return const_cast<grpc_endpoint*>(&base_); }
- static void Read(grpc_endpoint* /*ep*/, grpc_slice_buffer* /*slices*/,
- grpc_closure* /*cb*/, bool /*unused*/) {}
- static void Write(grpc_endpoint* /*ep*/, grpc_slice_buffer* /*slices*/,
- grpc_closure* /*cb*/, void* /*unused*/) {}
- static void AddToPollset(grpc_endpoint* /*ep*/, grpc_pollset* /*unused*/) {}
- static void AddToPollsetSet(grpc_endpoint* /*ep*/,
- grpc_pollset_set* /*unused*/) {}
- static void DeleteFromPollsetSet(grpc_endpoint* /*ep*/,
- grpc_pollset_set* /*unused*/) {}
- static void Shutdown(grpc_endpoint* /*ep*/, grpc_error* /*why*/) {}
- static void Destroy(grpc_endpoint* ep) {
- EvalArgsMockEndpoint* m = reinterpret_cast<EvalArgsMockEndpoint*>(ep);
- delete m;
- }
-
- static y_absl::string_view GetPeer(grpc_endpoint* ep) {
- EvalArgsMockEndpoint* m = reinterpret_cast<EvalArgsMockEndpoint*>(ep);
- return m->peer_;
- }
-
- static y_absl::string_view GetLocalAddress(grpc_endpoint* ep) {
- EvalArgsMockEndpoint* m = reinterpret_cast<EvalArgsMockEndpoint*>(ep);
- return m->local_address_;
- }
-
- static grpc_resource_user* GetResourceUser(grpc_endpoint* /*ep*/) {
- return nullptr;
- }
-
- static int GetFd(grpc_endpoint* /*unused*/) { return -1; }
- static bool CanTrackErr(grpc_endpoint* /*unused*/) { return false; }
-
- private:
- static constexpr grpc_endpoint_vtable vtable_ = {
- EvalArgsMockEndpoint::Read,
- EvalArgsMockEndpoint::Write,
- EvalArgsMockEndpoint::AddToPollset,
- EvalArgsMockEndpoint::AddToPollsetSet,
- EvalArgsMockEndpoint::DeleteFromPollsetSet,
- EvalArgsMockEndpoint::Shutdown,
- EvalArgsMockEndpoint::Destroy,
- EvalArgsMockEndpoint::GetResourceUser,
- EvalArgsMockEndpoint::GetPeer,
- EvalArgsMockEndpoint::GetLocalAddress,
- EvalArgsMockEndpoint::GetFd,
- EvalArgsMockEndpoint::CanTrackErr};
- grpc_endpoint base_;
- TString local_address_;
- TString peer_;
-};
-
-constexpr grpc_endpoint_vtable EvalArgsMockEndpoint::vtable_;
-
-namespace {
-
-TString NameAndPortToURI(const char* addr, const int port) {
- grpc_sockaddr_in address;
- memset(&address, 0, sizeof(address));
- address.sin_family = AF_INET;
- address.sin_port = htons(port);
- inet_pton(AF_INET, addr, &address.sin_addr);
- grpc_resolved_address resolved;
- memset(&resolved, 0, sizeof(resolved));
- memcpy(resolved.addr, &address, sizeof(address));
- resolved.len = sizeof(address);
- return grpc_sockaddr_to_uri(&resolved);
-}
-
-} // namespace
-
-grpc_endpoint* CreateEvalArgsMockEndpoint(const char* local_address,
- const int local_port,
- const char* peer_address,
- const int peer_port) {
- EvalArgsMockEndpoint* m =
- new EvalArgsMockEndpoint(NameAndPortToURI(local_address, local_port),
- NameAndPortToURI(peer_address, peer_port));
- return m->base();
-}
-
-} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/evaluate_args_test_util.h b/contrib/libs/grpc/test/core/util/evaluate_args_test_util.h
new file mode 100644
index 00000000000..37541c89f4f
--- /dev/null
+++ b/contrib/libs/grpc/test/core/util/evaluate_args_test_util.h
@@ -0,0 +1,68 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
+#define GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
+
+#include <grpc/support/port_platform.h>
+
+#include <list>
+
+#include <gtest/gtest.h>
+
+#include "src/core/lib/security/authorization/evaluate_args.h"
+#include "test/core/util/mock_authorization_endpoint.h"
+
+namespace grpc_core {
+
+class EvaluateArgsTestUtil {
+ public:
+ EvaluateArgsTestUtil() = default;
+
+ ~EvaluateArgsTestUtil() { delete channel_args_; }
+
+ void AddPairToMetadata(const char* key, const char* value) {
+ metadata_.Append(
+ key, Slice(grpc_slice_intern(grpc_slice_from_static_string(value))));
+ }
+
+ void SetLocalEndpoint(y_absl::string_view local_uri) {
+ endpoint_.SetLocalAddress(local_uri);
+ }
+
+ void SetPeerEndpoint(y_absl::string_view peer_uri) {
+ endpoint_.SetPeer(peer_uri);
+ }
+
+ void AddPropertyToAuthContext(const char* name, const char* value) {
+ auth_context_.add_cstring_property(name, value);
+ }
+
+ EvaluateArgs MakeEvaluateArgs() {
+ channel_args_ =
+ new EvaluateArgs::PerChannelArgs(&auth_context_, &endpoint_);
+ return EvaluateArgs(&metadata_, channel_args_);
+ }
+
+ private:
+ ScopedArenaPtr arena_ = MakeScopedArena(1024);
+ grpc_metadata_batch metadata_{arena_.get()};
+ MockAuthorizationEndpoint endpoint_{/*local_uri=*/"", /*peer_uri=*/""};
+ grpc_auth_context auth_context_{nullptr};
+ EvaluateArgs::PerChannelArgs* channel_args_ = nullptr;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_TEST_CORE_UTIL_EVALUATE_ARGS_TEST_UTIL_H
diff --git a/contrib/libs/grpc/test/core/util/fuzzer_corpus_test.cc b/contrib/libs/grpc/test/core/util/fuzzer_corpus_test.cc
index 5b3d728f8e9..8037e68aca2 100644
--- a/contrib/libs/grpc/test/core/util/fuzzer_corpus_test.cc
+++ b/contrib/libs/grpc/test/core/util/fuzzer_corpus_test.cc
@@ -17,15 +17,18 @@
*/
#include <dirent.h>
-#include <grpc/grpc.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <gtest/gtest.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
+#include <gtest/gtest.h>
+
#include "y_absl/flags/flag.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/load_file.h"
#include "test/core/util/test_config.h"
@@ -46,7 +49,7 @@ TEST_P(FuzzerCorpusTest, RunOneExample) {
// implementations of that function will initialize and shutdown gRPC
// internally.
grpc_init();
- gpr_log(GPR_DEBUG, "Example file: %s", GetParam().c_str());
+ gpr_log(GPR_INFO, "Example file: %s", GetParam().c_str());
grpc_slice buffer;
squelch = false;
leak_check = false;
diff --git a/contrib/libs/grpc/test/core/util/fuzzer_util.cc b/contrib/libs/grpc/test/core/util/fuzzer_util.cc
index 29c9b8875fd..ffd8832a515 100644
--- a/contrib/libs/grpc/test/core/util/fuzzer_util.cc
+++ b/contrib/libs/grpc/test/core/util/fuzzer_util.cc
@@ -18,6 +18,8 @@
#include "test/core/util/fuzzer_util.h"
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include "src/core/lib/gpr/useful.h"
@@ -39,7 +41,7 @@ char* grpc_fuzzer_get_next_string(input_stream* inp, bool* special) {
char c;
do {
if (cap == sz) {
- cap = GPR_MAX(3 * cap / 2, cap + 8);
+ cap = std::max(3 * cap / 2, cap + 8);
str = static_cast<char*>(gpr_realloc(str, cap));
}
c = static_cast<char>(grpc_fuzzer_get_next_byte(inp));
diff --git a/contrib/libs/grpc/test/core/util/grpc_fuzzer.bzl b/contrib/libs/grpc/test/core/util/grpc_fuzzer.bzl
index 99594b29e1d..8ae71b61f35 100644
--- a/contrib/libs/grpc/test/core/util/grpc_fuzzer.bzl
+++ b/contrib/libs/grpc/test/core/util/grpc_fuzzer.bzl
@@ -12,18 +12,91 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+"""
+Includes fuzzer rules.
+"""
+
load("//bazel:grpc_build_system.bzl", "grpc_cc_test")
+load("@rules_proto//proto:defs.bzl", "proto_library")
+load("@rules_cc//cc:defs.bzl", "cc_proto_library")
def grpc_fuzzer(name, corpus, srcs = [], deps = [], data = [], size = "large", **kwargs):
+ """Instantiates a fuzzer test.
+
+ Args:
+ name: The name of the test.
+ corpus: The corpus for the test.
+ srcs: The source files for the test.
+ deps: The dependencies of the test.
+ data: The data dependencies of the test.
+ size: The size of the test.
+ **kwargs: Other arguments to supply to the test.
+ """
+ CORPUS_DIR = native.package_name() + "/" + corpus
+ grpc_cc_test(
+ name = name,
+ srcs = srcs,
+ deps = deps + select({
+ "//:grpc_build_fuzzers": [],
+ "//conditions:default": ["//test/core/util:fuzzer_corpus_test"],
+ }),
+ data = data + native.glob([corpus + "/**"]),
+ external_deps = [
+ "gtest",
+ ],
+ size = size,
+ args = select({
+ "//:grpc_build_fuzzers": [CORPUS_DIR],
+ "//conditions:default": ["--directory=" + CORPUS_DIR],
+ }),
+ **kwargs
+ )
+
+def grpc_proto_fuzzer(name, corpus, proto, srcs = [], deps = [], data = [], size = "large", **kwargs):
+ """Instantiates a protobuf mutator fuzzer test.
+
+ Args:
+ name: The name of the test.
+ corpus: The corpus for the test.
+ proto: The proto for the test.
+ srcs: The source files for the test.
+ deps: The dependencies of the test.
+ data: The data dependencies of the test.
+ size: The size of the test.
+ **kwargs: Other arguments to supply to the test.
+ """
+ PROTO_LIBRARY = "_%s_proto" % name
+ CC_PROTO_LIBRARY = "_%s_cc_proto" % name
+ CORPUS_DIR = native.package_name() + "/" + corpus
+
+ proto_library(
+ name = PROTO_LIBRARY,
+ srcs = [proto],
+ )
+
+ cc_proto_library(
+ name = CC_PROTO_LIBRARY,
+ deps = [PROTO_LIBRARY],
+ )
+
grpc_cc_test(
name = name,
srcs = srcs,
- deps = deps + ["//test/core/util:fuzzer_corpus_test"],
+ deps = deps + [
+ "@com_google_libprotobuf_mutator//:libprotobuf_mutator",
+ CC_PROTO_LIBRARY,
+ ] + select({
+ "//:grpc_build_fuzzers": [],
+ "//conditions:default": ["//test/core/util:fuzzer_corpus_test"],
+ }),
data = data + native.glob([corpus + "/**"]),
external_deps = [
"gtest",
],
size = size,
- args = ["--directory=" + native.package_name() + "/" + corpus],
+ args = select({
+ "//:grpc_build_fuzzers": [CORPUS_DIR],
+ "//conditions:default": ["--directory=" + CORPUS_DIR],
+ }),
**kwargs
)
diff --git a/contrib/libs/grpc/test/core/util/histogram.cc b/contrib/libs/grpc/test/core/util/histogram.cc
index afb2c16c91e..fc3e21c5b42 100644
--- a/contrib/libs/grpc/test/core/util/histogram.cc
+++ b/contrib/libs/grpc/test/core/util/histogram.cc
@@ -16,6 +16,8 @@
*
*/
+#include <grpc/support/port_platform.h>
+
#include "test/core/util/histogram.h"
#include <math.h>
@@ -24,7 +26,6 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include "src/core/lib/gpr/useful.h"
@@ -62,7 +63,8 @@ static size_t bucket_for_unchecked(grpc_histogram* h, double x) {
/* bounds checked version of the above */
static size_t bucket_for(grpc_histogram* h, double x) {
- size_t bucket = bucket_for_unchecked(h, GPR_CLAMP(x, 1.0, h->max_possible));
+ size_t bucket =
+ bucket_for_unchecked(h, grpc_core::Clamp(x, 1.0, h->max_possible));
GPR_ASSERT(bucket < h->num_buckets);
return bucket;
}
@@ -186,10 +188,10 @@ static double threshold_for_count_below(grpc_histogram* h, double count_below) {
should lie */
lower_bound = bucket_start(h, static_cast<double>(lower_idx));
upper_bound = bucket_start(h, static_cast<double>(lower_idx + 1));
- return GPR_CLAMP(upper_bound - (upper_bound - lower_bound) *
- (count_so_far - count_below) /
- h->buckets[lower_idx],
- h->min_seen, h->max_seen);
+ return grpc_core::Clamp(upper_bound - (upper_bound - lower_bound) *
+ (count_so_far - count_below) /
+ h->buckets[lower_idx],
+ h->min_seen, h->max_seen);
}
}
diff --git a/contrib/libs/grpc/test/core/util/histogram.h b/contrib/libs/grpc/test/core/util/histogram.h
index 9d4985e64fb..9e872869bf3 100644
--- a/contrib/libs/grpc/test/core/util/histogram.h
+++ b/contrib/libs/grpc/test/core/util/histogram.h
@@ -20,6 +20,7 @@
#define GRPC_SUPPORT_HISTOGRAM_H
#include <grpc/support/port_platform.h>
+
#include <stddef.h>
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/test/core/util/histogram_test.cc b/contrib/libs/grpc/test/core/util/histogram_test.cc
index b96ac7d8419..3ff92a31e1f 100644
--- a/contrib/libs/grpc/test/core/util/histogram_test.cc
+++ b/contrib/libs/grpc/test/core/util/histogram_test.cc
@@ -17,6 +17,7 @@
*/
#include "test/core/util/histogram.h"
+
#include <grpc/support/log.h>
#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x);
diff --git a/contrib/libs/grpc/test/core/util/memory_counters.cc b/contrib/libs/grpc/test/core/util/memory_counters.cc
index ddd8d2f283f..0deb1a4d37c 100644
--- a/contrib/libs/grpc/test/core/util/memory_counters.cc
+++ b/contrib/libs/grpc/test/core/util/memory_counters.cc
@@ -16,8 +16,11 @@
*
*/
+#include "test/core/util/memory_counters.h"
+
#include <inttypes.h>
#include <stdint.h>
+#include <stdio.h>
#include <string.h>
#include <grpc/grpc.h>
@@ -28,9 +31,6 @@
#include "src/core/lib/gpr/alloc.h"
#include "src/core/lib/surface/init.h"
-#include "test/core/util/memory_counters.h"
-
-#include <stdio.h>
static struct grpc_memory_counters g_memory_counters;
static bool g_memory_counter_enabled;
diff --git a/contrib/libs/grpc/test/core/util/mock_authorization_endpoint.h b/contrib/libs/grpc/test/core/util/mock_authorization_endpoint.h
new file mode 100644
index 00000000000..b0404f7f05d
--- /dev/null
+++ b/contrib/libs/grpc/test/core/util/mock_authorization_endpoint.h
@@ -0,0 +1,62 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef GRPC_TEST_CORE_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H
+#define GRPC_TEST_CORE_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H
+
+#include <grpc/support/port_platform.h>
+
+#include "src/core/lib/iomgr/endpoint.h"
+
+namespace grpc_core {
+
+class MockAuthorizationEndpoint : public grpc_endpoint {
+ public:
+ MockAuthorizationEndpoint(y_absl::string_view local_uri,
+ y_absl::string_view peer_uri)
+ : local_address_(local_uri), peer_address_(peer_uri) {
+ static constexpr grpc_endpoint_vtable vtable = {
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
+ nullptr, GetPeer, GetLocalAddress, nullptr, nullptr};
+ grpc_endpoint::vtable = &vtable;
+ }
+
+ static y_absl::string_view GetPeer(grpc_endpoint* ep) {
+ MockAuthorizationEndpoint* m =
+ reinterpret_cast<MockAuthorizationEndpoint*>(ep);
+ return m->peer_address_;
+ }
+
+ static y_absl::string_view GetLocalAddress(grpc_endpoint* ep) {
+ MockAuthorizationEndpoint* m =
+ reinterpret_cast<MockAuthorizationEndpoint*>(ep);
+ return m->local_address_;
+ }
+
+ void SetPeer(y_absl::string_view peer_address) {
+ peer_address_ = TString(peer_address);
+ }
+
+ void SetLocalAddress(y_absl::string_view local_address) {
+ local_address_ = TString(local_address);
+ }
+
+ private:
+ TString local_address_;
+ TString peer_address_;
+};
+
+} // namespace grpc_core
+
+#endif // GRPC_TEST_CORE_UTIL_MOCK_AUTHORIZATION_ENDPOINT_H
diff --git a/contrib/libs/grpc/test/core/util/mock_endpoint.cc b/contrib/libs/grpc/test/core/util/mock_endpoint.cc
index 35a0f6d9f71..34ce7ffbf7e 100644
--- a/contrib/libs/grpc/test/core/util/mock_endpoint.cc
+++ b/contrib/libs/grpc/test/core/util/mock_endpoint.cc
@@ -16,11 +16,7 @@
*
*/
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
- using that endpoint. Because of various transitive includes in uv.h,
- including windows.h on Windows, uv.h must be included before other system
- headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
+#include "test/core/util/mock_endpoint.h"
#include <inttypes.h>
@@ -28,10 +24,9 @@
#include "y_absl/strings/str_format.h"
-#include "test/core/util/mock_endpoint.h"
-
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
+
#include "src/core/lib/iomgr/sockaddr.h"
typedef struct mock_endpoint {
@@ -41,7 +36,6 @@ typedef struct mock_endpoint {
grpc_slice_buffer read_buffer;
grpc_slice_buffer* on_read_out;
grpc_closure* on_read;
- grpc_resource_user* resource_user;
} mock_endpoint;
static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
@@ -76,7 +70,7 @@ static void me_add_to_pollset_set(grpc_endpoint* /*ep*/,
static void me_delete_from_pollset_set(grpc_endpoint* /*ep*/,
grpc_pollset_set* /*pollset*/) {}
-static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
+static void me_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
mock_endpoint* m = reinterpret_cast<mock_endpoint*>(ep);
gpr_mu_lock(&m->mu);
if (m->on_read) {
@@ -86,14 +80,12 @@ static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
m->on_read = nullptr;
}
gpr_mu_unlock(&m->mu);
- grpc_resource_user_shutdown(m->resource_user);
GRPC_ERROR_UNREF(why);
}
static void me_destroy(grpc_endpoint* ep) {
mock_endpoint* m = reinterpret_cast<mock_endpoint*>(ep);
grpc_slice_buffer_destroy(&m->read_buffer);
- grpc_resource_user_unref(m->resource_user);
gpr_mu_destroy(&m->mu);
gpr_free(m);
}
@@ -106,11 +98,6 @@ static y_absl::string_view me_get_local_address(grpc_endpoint* /*ep*/) {
return "fake:mock_endpoint";
}
-static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) {
- mock_endpoint* m = reinterpret_cast<mock_endpoint*>(ep);
- return m->resource_user;
-}
-
static int me_get_fd(grpc_endpoint* /*ep*/) { return -1; }
static bool me_can_track_err(grpc_endpoint* /*ep*/) { return false; }
@@ -122,19 +109,14 @@ static const grpc_endpoint_vtable vtable = {me_read,
me_delete_from_pollset_set,
me_shutdown,
me_destroy,
- me_get_resource_user,
me_get_peer,
me_get_local_address,
me_get_fd,
me_can_track_err};
-grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
- grpc_resource_quota* resource_quota) {
+grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice)) {
mock_endpoint* m = static_cast<mock_endpoint*>(gpr_malloc(sizeof(*m)));
m->base.vtable = &vtable;
- TString name =
- y_absl::StrFormat("mock_endpoint_%" PRIxPTR, reinterpret_cast<intptr_t>(m));
- m->resource_user = grpc_resource_user_create(resource_quota, name.c_str());
grpc_slice_buffer_init(&m->read_buffer);
gpr_mu_init(&m->mu);
m->on_write = on_write;
diff --git a/contrib/libs/grpc/test/core/util/mock_endpoint.h b/contrib/libs/grpc/test/core/util/mock_endpoint.h
index 8e58d65bebb..6d52390e094 100644
--- a/contrib/libs/grpc/test/core/util/mock_endpoint.h
+++ b/contrib/libs/grpc/test/core/util/mock_endpoint.h
@@ -21,8 +21,7 @@
#include "src/core/lib/iomgr/endpoint.h"
-grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice),
- grpc_resource_quota* resource_quota);
+grpc_endpoint* grpc_mock_endpoint_create(void (*on_write)(grpc_slice slice));
void grpc_mock_endpoint_put_read(grpc_endpoint* ep, grpc_slice slice);
#endif
diff --git a/contrib/libs/grpc/test/core/util/one_corpus_entry_fuzzer.cc b/contrib/libs/grpc/test/core/util/one_corpus_entry_fuzzer.cc
index 2f376d6853f..fa0f04f0255 100644
--- a/contrib/libs/grpc/test/core/util/one_corpus_entry_fuzzer.cc
+++ b/contrib/libs/grpc/test/core/util/one_corpus_entry_fuzzer.cc
@@ -19,8 +19,8 @@
#include <stdbool.h>
#include <grpc/grpc.h>
-
#include <grpc/support/log.h>
+
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/iomgr/load_file.h"
diff --git a/contrib/libs/grpc/test/core/util/parse_hexstring.cc b/contrib/libs/grpc/test/core/util/parse_hexstring.cc
index cd64843bd32..a65ef999511 100644
--- a/contrib/libs/grpc/test/core/util/parse_hexstring.cc
+++ b/contrib/libs/grpc/test/core/util/parse_hexstring.cc
@@ -17,6 +17,7 @@
*/
#include "test/core/util/parse_hexstring.h"
+
#include <grpc/support/log.h>
grpc_slice parse_hexstring(const char* hexstring) {
diff --git a/contrib/libs/grpc/test/core/util/passthru_endpoint.cc b/contrib/libs/grpc/test/core/util/passthru_endpoint.cc
index 6db2b349b2d..080076bcb59 100644
--- a/contrib/libs/grpc/test/core/util/passthru_endpoint.cc
+++ b/contrib/libs/grpc/test/core/util/passthru_endpoint.cc
@@ -16,12 +16,6 @@
*
*/
-/* With the addition of a libuv endpoint, sockaddr.h now includes uv.h when
- using that endpoint. Because of various transitive includes in uv.h,
- including windows.h on Windows, uv.h must be included before other system
- headers. Therefore, sockaddr.h must always be included first */
-#include "src/core/lib/iomgr/sockaddr.h"
-
#include "test/core/util/passthru_endpoint.h"
#include <inttypes.h>
@@ -33,30 +27,85 @@
#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>
-#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/slice/slice_internal.h"
typedef struct passthru_endpoint passthru_endpoint;
typedef struct {
+ bool is_armed;
+ grpc_endpoint* ep;
+ grpc_slice_buffer* slices;
+ grpc_closure* cb;
+} pending_op;
+
+typedef struct {
+ grpc_timer timer;
+ uint64_t allowed_write_bytes;
+ uint64_t allowed_read_bytes;
+ std::vector<grpc_passthru_endpoint_channel_action> actions;
+ std::function<void()> on_complete;
+} grpc_passthru_endpoint_channel_effects;
+
+typedef struct {
grpc_endpoint base;
passthru_endpoint* parent;
grpc_slice_buffer read_buffer;
+ grpc_slice_buffer write_buffer;
grpc_slice_buffer* on_read_out;
grpc_closure* on_read;
- grpc_resource_user* resource_user;
+ pending_op pending_read_op;
+ pending_op pending_write_op;
+ uint64_t bytes_read_so_far;
+ uint64_t bytes_written_so_far;
} half;
struct passthru_endpoint {
gpr_mu mu;
int halves;
grpc_passthru_endpoint_stats* stats;
+ grpc_passthru_endpoint_channel_effects* channel_effects;
+ bool simulate_channel_actions;
bool shutdown;
half client;
half server;
};
+static void do_pending_read_op_locked(half* m, grpc_error_handle error) {
+ GPR_ASSERT(m->pending_read_op.is_armed);
+ GPR_ASSERT(m->bytes_read_so_far <=
+ m->parent->channel_effects->allowed_read_bytes);
+ if (m->parent->shutdown) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION, m->pending_read_op.cb,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
+ grpc_slice_buffer_reset_and_unref(&m->read_buffer);
+ m->pending_read_op.is_armed = false;
+ return;
+ }
+
+ if (m->bytes_read_so_far == m->parent->channel_effects->allowed_read_bytes) {
+ // Keep it in pending state.
+ return;
+ }
+ // This delayed processing should only be invoked when read_buffer has
+ // something in it.
+ GPR_ASSERT(m->read_buffer.count > 0);
+ uint64_t readable_length = std::min<uint64_t>(
+ m->read_buffer.length,
+ m->parent->channel_effects->allowed_read_bytes - m->bytes_read_so_far);
+ GPR_ASSERT(readable_length > 0);
+ grpc_slice_buffer_move_first_no_ref(&m->read_buffer, readable_length,
+ m->pending_read_op.slices);
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->pending_read_op.cb, error);
+ if (m->parent->simulate_channel_actions) {
+ m->bytes_read_so_far += readable_length;
+ }
+ m->pending_read_op.is_armed = false;
+}
+
static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, bool /*urgent*/) {
half* m = reinterpret_cast<half*>(ep);
@@ -66,42 +115,185 @@ static void me_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
DEBUG_LOCATION, cb,
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
} else if (m->read_buffer.count > 0) {
- grpc_slice_buffer_swap(&m->read_buffer, slices);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
+ GPR_ASSERT(!m->pending_read_op.is_armed);
+ GPR_ASSERT(!m->on_read);
+ m->pending_read_op.is_armed = true;
+ m->pending_read_op.cb = cb;
+ m->pending_read_op.ep = ep;
+ m->pending_read_op.slices = slices;
+ do_pending_read_op_locked(m, GRPC_ERROR_NONE);
} else {
+ GPR_ASSERT(!m->pending_read_op.is_armed);
m->on_read = cb;
m->on_read_out = slices;
}
gpr_mu_unlock(&m->parent->mu);
}
+// Copy src slice and split the copy at n bytes into two separate slices
+void grpc_slice_copy_split(grpc_slice src, uint64_t n, grpc_slice& split1,
+ grpc_slice& split2) {
+ GPR_ASSERT(n <= GRPC_SLICE_LENGTH(src));
+ if (n == GRPC_SLICE_LENGTH(src)) {
+ split1 = grpc_slice_copy(src);
+ split2 = grpc_empty_slice();
+ return;
+ }
+ split1 = GRPC_SLICE_MALLOC(n);
+ memcpy(GRPC_SLICE_START_PTR(split1), GRPC_SLICE_START_PTR(src), n);
+ split2 = GRPC_SLICE_MALLOC(GRPC_SLICE_LENGTH(src) - n);
+ memcpy(GRPC_SLICE_START_PTR(split2), GRPC_SLICE_START_PTR(src) + n,
+ GRPC_SLICE_LENGTH(src) - n);
+}
+
static half* other_half(half* h) {
if (h == &h->parent->client) return &h->parent->server;
return &h->parent->client;
}
+static void do_pending_write_op_locked(half* m, grpc_error_handle error) {
+ GPR_ASSERT(m->pending_write_op.is_armed);
+ GPR_ASSERT(m->bytes_written_so_far <=
+ m->parent->channel_effects->allowed_write_bytes);
+ if (m->parent->shutdown) {
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION, m->pending_write_op.cb,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Already shutdown"));
+ m->pending_write_op.is_armed = false;
+ grpc_slice_buffer_reset_and_unref(m->pending_write_op.slices);
+ return;
+ }
+ if (m->bytes_written_so_far ==
+ m->parent->channel_effects->allowed_write_bytes) {
+ // Keep it in pending state.
+ return;
+ }
+
+ half* other = other_half(m);
+ uint64_t max_writable =
+ std::min<uint64_t>(m->pending_write_op.slices->length,
+ m->parent->channel_effects->allowed_write_bytes -
+ m->bytes_written_so_far);
+ uint64_t max_readable = other->parent->channel_effects->allowed_read_bytes -
+ other->bytes_read_so_far;
+ uint64_t immediate_bytes_read =
+ other->on_read != nullptr ? std::min<uint64_t>(max_readable, max_writable)
+ : 0;
+
+ GPR_ASSERT(max_writable > 0);
+ GPR_ASSERT(max_readable >= 0);
+ // At the end of this process, we should have written max_writable bytes;
+ if (m->parent->simulate_channel_actions) {
+ m->bytes_written_so_far += max_writable;
+ }
+ // Estimate if the original write would still be pending at the end of this
+ // process
+ bool would_write_be_pending =
+ max_writable < m->pending_write_op.slices->length;
+ if (!m->parent->simulate_channel_actions) {
+ GPR_ASSERT(!would_write_be_pending);
+ }
+ grpc_slice_buffer* slices = m->pending_write_op.slices;
+ grpc_slice_buffer* dest =
+ other->on_read != nullptr ? other->on_read_out : &other->read_buffer;
+ while (max_writable > 0) {
+ grpc_slice slice = grpc_slice_buffer_take_first(slices);
+ uint64_t slice_length = GPR_SLICE_LENGTH(slice);
+ GPR_ASSERT(slice_length > 0);
+ grpc_slice split1, split2;
+ uint64_t split_length = 0;
+ if (slice_length <= max_readable) {
+ split_length = std::min<uint64_t>(slice_length, max_writable);
+ } else if (max_readable > 0) {
+ // slice_length > max_readable
+ split_length = std::min<uint64_t>(max_readable, max_writable);
+ } else {
+ // slice_length still > max_readable but max_readable is 0.
+ // In this case put the bytes into other->read_buffer. During a future
+ // read if max_readable still remains zero at the time of read, the
+ // pending read logic will kick in.
+ dest = &other->read_buffer;
+ split_length = std::min<uint64_t>(slice_length, max_writable);
+ }
+
+ grpc_slice_copy_split(slice, split_length, split1, split2);
+ grpc_slice_unref_internal(slice);
+ // Write a copy of the slice to the destination to be read
+ grpc_slice_buffer_add_indexed(dest, split1);
+ // Re-insert split2 into source for next iteration.
+ if (GPR_SLICE_LENGTH(split2) > 0) {
+ grpc_slice_buffer_undo_take_first(slices, split2);
+ } else {
+ grpc_slice_unref_internal(split2);
+ }
+
+ if (max_readable > 0) {
+ GPR_ASSERT(max_readable >= static_cast<uint64_t>(split_length));
+ max_readable -= split_length;
+ }
+
+ GPR_ASSERT(max_writable >= static_cast<uint64_t>(split_length));
+ max_writable -= split_length;
+ }
+
+ if (immediate_bytes_read > 0) {
+ GPR_ASSERT(!other->pending_read_op.is_armed);
+ if (m->parent->simulate_channel_actions) {
+ other->bytes_read_so_far += immediate_bytes_read;
+ }
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, other->on_read, error);
+ other->on_read = nullptr;
+ }
+
+ if (!would_write_be_pending) {
+ // No slices should be left
+ GPR_ASSERT(m->pending_write_op.slices->count == 0);
+ grpc_slice_buffer_reset_and_unref(m->pending_write_op.slices);
+ m->pending_write_op.is_armed = false;
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->pending_write_op.cb, error);
+ }
+}
+
static void me_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
grpc_closure* cb, void* /*arg*/) {
- half* m = other_half(reinterpret_cast<half*>(ep));
+ half* m = reinterpret_cast<half*>(ep);
gpr_mu_lock(&m->parent->mu);
- grpc_error* error = GRPC_ERROR_NONE;
gpr_atm_no_barrier_fetch_add(&m->parent->stats->num_writes, (gpr_atm)1);
if (m->parent->shutdown) {
- error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown");
- } else if (m->on_read != nullptr) {
- for (size_t i = 0; i < slices->count; i++) {
- grpc_slice_buffer_add(m->on_read_out, grpc_slice_copy(slices->slices[i]));
- }
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, m->on_read, GRPC_ERROR_NONE);
- m->on_read = nullptr;
+ grpc_core::ExecCtx::Run(
+ DEBUG_LOCATION, cb,
+ GRPC_ERROR_CREATE_FROM_STATIC_STRING("Endpoint already shutdown"));
} else {
- for (size_t i = 0; i < slices->count; i++) {
- grpc_slice_buffer_add(&m->read_buffer,
- grpc_slice_copy(slices->slices[i]));
+ GPR_ASSERT(!m->pending_write_op.is_armed);
+ // Copy slices into m->pending_write_op.slices
+ m->pending_write_op.slices = &m->write_buffer;
+ GPR_ASSERT(m->pending_write_op.slices->count == 0);
+ for (int i = 0; i < static_cast<int>(slices->count); i++) {
+ if (GPR_SLICE_LENGTH(slices->slices[i]) > 0) {
+ grpc_slice_buffer_add_indexed(m->pending_write_op.slices,
+ grpc_slice_copy(slices->slices[i]));
+ }
+ }
+ if (m->pending_write_op.slices->count > 0) {
+ m->pending_write_op.is_armed = true;
+ m->pending_write_op.cb = cb;
+ m->pending_write_op.ep = ep;
+ do_pending_write_op_locked(m, GRPC_ERROR_NONE);
+ } else {
+ // There is nothing to write. Schedule callback to be run right away.
+ grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
}
}
gpr_mu_unlock(&m->parent->mu);
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
+}
+
+void flush_pending_ops_locked(half* m, grpc_error_handle error) {
+ if (m->pending_read_op.is_armed) {
+ do_pending_read_op_locked(m, error);
+ }
+ if (m->pending_write_op.is_armed) {
+ do_pending_write_op_locked(m, error);
+ }
}
static void me_add_to_pollset(grpc_endpoint* /*ep*/,
@@ -113,10 +305,11 @@ static void me_add_to_pollset_set(grpc_endpoint* /*ep*/,
static void me_delete_from_pollset_set(grpc_endpoint* /*ep*/,
grpc_pollset_set* /*pollset*/) {}
-static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
+static void me_shutdown(grpc_endpoint* ep, grpc_error_handle why) {
half* m = reinterpret_cast<half*>(ep);
gpr_mu_lock(&m->parent->mu);
m->parent->shutdown = true;
+ flush_pending_ops_locked(m, GRPC_ERROR_NONE);
if (m->on_read) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, m->on_read,
@@ -124,6 +317,7 @@ static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
m->on_read = nullptr;
}
m = other_half(m);
+ flush_pending_ops_locked(m, GRPC_ERROR_NONE);
if (m->on_read) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, m->on_read,
@@ -131,23 +325,31 @@ static void me_shutdown(grpc_endpoint* ep, grpc_error* why) {
m->on_read = nullptr;
}
gpr_mu_unlock(&m->parent->mu);
- grpc_resource_user_shutdown(m->resource_user);
GRPC_ERROR_UNREF(why);
}
+void grpc_passthru_endpoint_destroy(passthru_endpoint* p) {
+ gpr_mu_destroy(&p->mu);
+ grpc_passthru_endpoint_stats_destroy(p->stats);
+ delete p->channel_effects;
+ grpc_slice_buffer_destroy_internal(&p->client.read_buffer);
+ grpc_slice_buffer_destroy_internal(&p->server.read_buffer);
+ grpc_slice_buffer_destroy_internal(&p->client.write_buffer);
+ grpc_slice_buffer_destroy_internal(&p->server.write_buffer);
+ gpr_free(p);
+}
+
static void me_destroy(grpc_endpoint* ep) {
passthru_endpoint* p = (reinterpret_cast<half*>(ep))->parent;
gpr_mu_lock(&p->mu);
- if (0 == --p->halves) {
+ if (0 == --p->halves && p->channel_effects->actions.empty()) {
+ // no pending channel actions exist
gpr_mu_unlock(&p->mu);
- gpr_mu_destroy(&p->mu);
- grpc_passthru_endpoint_stats_destroy(p->stats);
- grpc_slice_buffer_destroy_internal(&p->client.read_buffer);
- grpc_slice_buffer_destroy_internal(&p->server.read_buffer);
- grpc_resource_user_unref(p->client.resource_user);
- grpc_resource_user_unref(p->server.resource_user);
- gpr_free(p);
+ grpc_passthru_endpoint_destroy(p);
} else {
+ if (p->halves == 0 && p->simulate_channel_actions) {
+ grpc_timer_cancel(&p->channel_effects->timer);
+ }
gpr_mu_unlock(&p->mu);
}
}
@@ -170,11 +372,6 @@ static int me_get_fd(grpc_endpoint* /*ep*/) { return -1; }
static bool me_can_track_err(grpc_endpoint* /*ep*/) { return false; }
-static grpc_resource_user* me_get_resource_user(grpc_endpoint* ep) {
- half* m = reinterpret_cast<half*>(ep);
- return m->resource_user;
-}
-
static const grpc_endpoint_vtable vtable = {
me_read,
me_write,
@@ -183,7 +380,6 @@ static const grpc_endpoint_vtable vtable = {
me_delete_from_pollset_set,
me_shutdown,
me_destroy,
- me_get_resource_user,
me_get_peer,
me_get_local_address,
me_get_fd,
@@ -191,21 +387,25 @@ static const grpc_endpoint_vtable vtable = {
};
static void half_init(half* m, passthru_endpoint* parent,
- grpc_resource_quota* resource_quota,
const char* half_name) {
m->base.vtable = &vtable;
m->parent = parent;
grpc_slice_buffer_init(&m->read_buffer);
+ grpc_slice_buffer_init(&m->write_buffer);
+ m->pending_write_op.slices = nullptr;
m->on_read = nullptr;
+ m->bytes_read_so_far = 0;
+ m->bytes_written_so_far = 0;
+ m->pending_write_op.is_armed = false;
+ m->pending_read_op.is_armed = false;
TString name =
y_absl::StrFormat("passthru_endpoint_%s_%p", half_name, parent);
- m->resource_user = grpc_resource_user_create(resource_quota, name.c_str());
}
void grpc_passthru_endpoint_create(grpc_endpoint** client,
grpc_endpoint** server,
- grpc_resource_quota* resource_quota,
- grpc_passthru_endpoint_stats* stats) {
+ grpc_passthru_endpoint_stats* stats,
+ bool simulate_channel_actions) {
passthru_endpoint* m =
static_cast<passthru_endpoint*>(gpr_malloc(sizeof(*m)));
m->halves = 2;
@@ -216,8 +416,14 @@ void grpc_passthru_endpoint_create(grpc_endpoint** client,
gpr_ref(&stats->refs);
m->stats = stats;
}
- half_init(&m->client, m, resource_quota, "client");
- half_init(&m->server, m, resource_quota, "server");
+ m->channel_effects = new grpc_passthru_endpoint_channel_effects();
+ m->simulate_channel_actions = simulate_channel_actions;
+ if (!simulate_channel_actions) {
+ m->channel_effects->allowed_read_bytes = UINT64_MAX;
+ m->channel_effects->allowed_write_bytes = UINT64_MAX;
+ }
+ half_init(&m->client, m, "client");
+ half_init(&m->server, m, "server");
gpr_mu_init(&m->mu);
*client = &m->client.base;
*server = &m->server.base;
@@ -237,3 +443,55 @@ void grpc_passthru_endpoint_stats_destroy(grpc_passthru_endpoint_stats* stats) {
gpr_free(stats);
}
}
+
+static void sched_next_channel_action_locked(half* m);
+
+static void do_next_sched_channel_action(void* arg, grpc_error_handle error) {
+ half* m = reinterpret_cast<half*>(arg);
+ gpr_mu_lock(&m->parent->mu);
+ GPR_ASSERT(!m->parent->channel_effects->actions.empty());
+ if (m->parent->halves == 0) {
+ gpr_mu_unlock(&m->parent->mu);
+ grpc_passthru_endpoint_destroy(m->parent);
+ return;
+ }
+ auto curr_action = m->parent->channel_effects->actions[0];
+ m->parent->channel_effects->actions.erase(
+ m->parent->channel_effects->actions.begin());
+ m->parent->channel_effects->allowed_read_bytes +=
+ curr_action.add_n_readable_bytes;
+ m->parent->channel_effects->allowed_write_bytes +=
+ curr_action.add_n_writable_bytes;
+ flush_pending_ops_locked(m, error);
+ flush_pending_ops_locked(other_half(m), error);
+ sched_next_channel_action_locked(m);
+ gpr_mu_unlock(&m->parent->mu);
+}
+
+static void sched_next_channel_action_locked(half* m) {
+ if (m->parent->channel_effects->actions.empty()) {
+ m->parent->channel_effects->on_complete();
+ return;
+ }
+ grpc_timer_init(&m->parent->channel_effects->timer,
+ m->parent->channel_effects->actions[0].wait_ms +
+ grpc_core::ExecCtx::Get()->Now(),
+ GRPC_CLOSURE_CREATE(do_next_sched_channel_action, m,
+ grpc_schedule_on_exec_ctx));
+}
+
+void start_scheduling_grpc_passthru_endpoint_channel_effects(
+ grpc_endpoint* ep,
+ const std::vector<grpc_passthru_endpoint_channel_action>& actions,
+ std::function<void()> on_complete) {
+ half* m = reinterpret_cast<half*>(ep);
+ gpr_mu_lock(&m->parent->mu);
+ if (!m->parent->simulate_channel_actions || m->parent->shutdown) {
+ gpr_mu_unlock(&m->parent->mu);
+ return;
+ }
+ m->parent->channel_effects->actions = actions;
+ m->parent->channel_effects->on_complete = std::move(on_complete);
+ sched_next_channel_action_locked(m);
+ gpr_mu_unlock(&m->parent->mu);
+}
diff --git a/contrib/libs/grpc/test/core/util/passthru_endpoint.h b/contrib/libs/grpc/test/core/util/passthru_endpoint.h
index a46c775505e..b34cbc25f9d 100644
--- a/contrib/libs/grpc/test/core/util/passthru_endpoint.h
+++ b/contrib/libs/grpc/test/core/util/passthru_endpoint.h
@@ -16,8 +16,8 @@
*
*/
-#ifndef MOCK_ENDPOINT_H
-#define MOCK_ENDPOINT_H
+#ifndef PASSTHRU_ENDPOINT_H
+#define PASSTHRU_ENDPOINT_H
#include <grpc/support/atm.h>
@@ -31,13 +31,24 @@ typedef struct {
gpr_atm num_writes;
} grpc_passthru_endpoint_stats;
+typedef struct {
+ uint64_t wait_ms;
+ uint64_t add_n_writable_bytes;
+ uint64_t add_n_readable_bytes;
+} grpc_passthru_endpoint_channel_action;
+
void grpc_passthru_endpoint_create(grpc_endpoint** client,
grpc_endpoint** server,
- grpc_resource_quota* resource_quota,
- grpc_passthru_endpoint_stats* stats);
+ grpc_passthru_endpoint_stats* stats,
+ bool simulate_channel_actions = false);
grpc_passthru_endpoint_stats* grpc_passthru_endpoint_stats_create();
void grpc_passthru_endpoint_stats_destroy(grpc_passthru_endpoint_stats* stats);
-#endif
+void start_scheduling_grpc_passthru_endpoint_channel_effects(
+ grpc_endpoint* ep,
+ const std::vector<grpc_passthru_endpoint_channel_action>& actions,
+ std::function<void()> on_complete);
+
+#endif // PASSTHRU_ENDPOINT_H
diff --git a/contrib/libs/grpc/test/core/util/port.cc b/contrib/libs/grpc/test/core/util/port.cc
index eae4fbfb35a..5a2e06266e5 100644
--- a/contrib/libs/grpc/test/core/util/port.cc
+++ b/contrib/libs/grpc/test/core/util/port.cc
@@ -17,11 +17,10 @@
*/
#include "src/core/lib/iomgr/port.h"
+
#include "test/core/util/test_config.h"
#if defined(GRPC_TEST_PICK_PORT)
-#include "test/core/util/port.h"
-
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
@@ -31,9 +30,10 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
+#include "src/core/lib/address_utils/sockaddr_utils.h"
#include "src/core/lib/http/httpcli.h"
#include "src/core/lib/iomgr/resolve_address.h"
-#include "src/core/lib/iomgr/sockaddr_utils.h"
+#include "test/core/util/port.h"
#include "test/core/util/port_server_client.h"
static int* chosen_ports = nullptr;
diff --git a/contrib/libs/grpc/test/core/util/port_isolated_runtime_environment.cc b/contrib/libs/grpc/test/core/util/port_isolated_runtime_environment.cc
index 5e043e7f970..6d32aeb4cd1 100644
--- a/contrib/libs/grpc/test/core/util/port_isolated_runtime_environment.cc
+++ b/contrib/libs/grpc/test/core/util/port_isolated_runtime_environment.cc
@@ -20,10 +20,12 @@
* runs in a separate container) the framework takes a round-robin pick of a
* port within certain range. There is no need to recycle ports.
*/
+#include <stdlib.h>
+
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
-#include <stdlib.h>
+
#include "src/core/lib/iomgr/port.h"
#include "test/core/util/test_config.h"
#if defined(GRPC_PORT_ISOLATED_RUNTIME)
diff --git a/contrib/libs/grpc/test/core/util/port_server_client.cc b/contrib/libs/grpc/test/core/util/port_server_client.cc
index 973068dcda2..36124362c63 100644
--- a/contrib/libs/grpc/test/core/util/port_server_client.cc
+++ b/contrib/libs/grpc/test/core/util/port_server_client.cc
@@ -17,11 +17,10 @@
*/
#include <grpc/support/port_platform.h>
+
#include "test/core/util/test_config.h"
#ifdef GRPC_TEST_PICK_PORT
-#include "test/core/util/port_server_client.h"
-
#include <math.h>
#include <string.h>
@@ -33,6 +32,7 @@
#include <grpc/support/time.h>
#include "src/core/lib/http/httpcli.h"
+#include "test/core/util/port_server_client.h"
typedef struct freereq {
gpr_mu* mu = nullptr;
@@ -40,14 +40,14 @@ typedef struct freereq {
int done = 0;
} freereq;
-static void destroy_pops_and_shutdown(void* p, grpc_error* /*error*/) {
+static void destroy_pops_and_shutdown(void* p, grpc_error_handle /*error*/) {
grpc_pollset* pollset =
grpc_polling_entity_pollset(static_cast<grpc_polling_entity*>(p));
grpc_pollset_destroy(pollset);
gpr_free(pollset);
}
-static void freed_port_from_server(void* arg, grpc_error* /*error*/) {
+static void freed_port_from_server(void* arg, grpc_error_handle /*error*/) {
freereq* pr = static_cast<freereq*>(arg);
gpr_mu_lock(pr->mu);
pr->done = 1;
@@ -85,14 +85,12 @@ void grpc_free_port_using_server(int port) {
req.http.path = path;
grpc_httpcli_context_init(&context);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("port_server_client/free");
- grpc_httpcli_get(&context, &pr.pops, resource_quota, &req,
+ grpc_httpcli_get(&context, &pr.pops, grpc_core::ResourceQuota::Default(),
+ &req,
grpc_core::ExecCtx::Get()->Now() + 30 * GPR_MS_PER_SEC,
GRPC_CLOSURE_CREATE(freed_port_from_server, &pr,
grpc_schedule_on_exec_ctx),
&rsp);
- grpc_resource_quota_unref_internal(resource_quota);
grpc_core::ExecCtx::Get()->Flush();
gpr_mu_lock(pr.mu);
while (!pr.done) {
@@ -127,7 +125,7 @@ typedef struct portreq {
grpc_httpcli_response response = {};
} portreq;
-static void got_port_from_server(void* arg, grpc_error* error) {
+static void got_port_from_server(void* arg, grpc_error_handle error) {
size_t i;
int port = 0;
portreq* pr = static_cast<portreq*>(arg);
@@ -136,9 +134,8 @@ static void got_port_from_server(void* arg, grpc_error* error) {
if (error != GRPC_ERROR_NONE) {
failed = 1;
- const char* msg = grpc_error_string(error);
- gpr_log(GPR_DEBUG, "failed port pick from server: retrying [%s]", msg);
-
+ gpr_log(GPR_DEBUG, "failed port pick from server: retrying [%s]",
+ grpc_error_std_string(error).c_str());
} else if (response->status != 200) {
failed = 1;
gpr_log(GPR_DEBUG, "failed port pick from server: status=%d",
@@ -169,14 +166,12 @@ static void got_port_from_server(void* arg, grpc_error* error) {
req.http.path = const_cast<char*>("/get");
grpc_http_response_destroy(&pr->response);
pr->response = {};
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("port_server_client/pick_retry");
- grpc_httpcli_get(pr->ctx, &pr->pops, resource_quota, &req,
+ grpc_httpcli_get(pr->ctx, &pr->pops, grpc_core::ResourceQuota::Default(),
+ &req,
grpc_core::ExecCtx::Get()->Now() + 30 * GPR_MS_PER_SEC,
GRPC_CLOSURE_CREATE(got_port_from_server, pr,
grpc_schedule_on_exec_ctx),
&pr->response);
- grpc_resource_quota_unref_internal(resource_quota);
return;
}
GPR_ASSERT(response);
@@ -219,14 +214,12 @@ int grpc_pick_port_using_server(void) {
req.http.path = const_cast<char*>("/get");
grpc_httpcli_context_init(&context);
- grpc_resource_quota* resource_quota =
- grpc_resource_quota_create("port_server_client/pick");
- grpc_httpcli_get(&context, &pr.pops, resource_quota, &req,
+ grpc_httpcli_get(&context, &pr.pops, grpc_core::ResourceQuota::Default(),
+ &req,
grpc_core::ExecCtx::Get()->Now() + 30 * GPR_MS_PER_SEC,
GRPC_CLOSURE_CREATE(got_port_from_server, &pr,
grpc_schedule_on_exec_ctx),
&pr.response);
- grpc_resource_quota_unref_internal(resource_quota);
grpc_core::ExecCtx::Get()->Flush();
gpr_mu_lock(pr.mu);
while (pr.port == -1) {
diff --git a/contrib/libs/grpc/test/core/util/reconnect_server.cc b/contrib/libs/grpc/test/core/util/reconnect_server.cc
index 06d4c1e39e2..7ce4b6fbe85 100644
--- a/contrib/libs/grpc/test/core/util/reconnect_server.cc
+++ b/contrib/libs/grpc/test/core/util/reconnect_server.cc
@@ -18,15 +18,17 @@
#include "test/core/util/reconnect_server.h"
+#include <string.h>
+
+#include "y_absl/strings/string_view.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <string.h>
-#include "y_absl/strings/string_view.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/iomgr/tcp_server.h"
diff --git a/contrib/libs/grpc/test/core/util/reconnect_server.h b/contrib/libs/grpc/test/core/util/reconnect_server.h
index 5fd03821f7d..6f63f9293d4 100644
--- a/contrib/libs/grpc/test/core/util/reconnect_server.h
+++ b/contrib/libs/grpc/test/core/util/reconnect_server.h
@@ -21,6 +21,7 @@
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
+
#include "test/core/util/test_tcp_server.h"
typedef struct timestamp_list {
diff --git a/contrib/libs/grpc/test/core/util/resolve_localhost_ip46.cc b/contrib/libs/grpc/test/core/util/resolve_localhost_ip46.cc
index b465b754ba5..bf3f621c173 100644
--- a/contrib/libs/grpc/test/core/util/resolve_localhost_ip46.cc
+++ b/contrib/libs/grpc/test/core/util/resolve_localhost_ip46.cc
@@ -33,7 +33,7 @@ gpr_once g_resolve_localhost_ipv46 = GPR_ONCE_INIT;
void InitResolveLocalhost() {
grpc_resolved_addresses* addresses;
- grpc_error* err =
+ grpc_error_handle err =
grpc_blocking_resolve_address("localhost", "https", &addresses);
GPR_ASSERT(err == GRPC_ERROR_NONE);
for (size_t i = 0; i < addresses->naddrs; i++) {
diff --git a/contrib/libs/grpc/test/core/util/slice_splitter.cc b/contrib/libs/grpc/test/core/util/slice_splitter.cc
index 1f81d03d968..82864d6abf1 100644
--- a/contrib/libs/grpc/test/core/util/slice_splitter.cc
+++ b/contrib/libs/grpc/test/core/util/slice_splitter.cc
@@ -20,6 +20,8 @@
#include <string.h>
+#include <algorithm>
+
#include <grpc/support/alloc.h>
#include "src/core/lib/gpr/useful.h"
@@ -114,7 +116,7 @@ grpc_slice grpc_slice_merge(grpc_slice* slices, size_t nslices) {
for (i = 0; i < nslices; i++) {
if (GRPC_SLICE_LENGTH(slices[i]) + length > capacity) {
- capacity = GPR_MAX(capacity * 2, GRPC_SLICE_LENGTH(slices[i]) + length);
+ capacity = std::max(capacity * 2, GRPC_SLICE_LENGTH(slices[i]) + length);
out = static_cast<uint8_t*>(gpr_realloc(out, capacity));
}
memcpy(out + length, GRPC_SLICE_START_PTR(slices[i]),
diff --git a/contrib/libs/grpc/test/core/util/stack_tracer.cc b/contrib/libs/grpc/test/core/util/stack_tracer.cc
index c71dc142599..c91179a1658 100644
--- a/contrib/libs/grpc/test/core/util/stack_tracer.cc
+++ b/contrib/libs/grpc/test/core/util/stack_tracer.cc
@@ -30,12 +30,12 @@
namespace {
-static constexpr int kPrintfPointerFieldWidth = 2 + 2 * sizeof(void*);
+constexpr int kPrintfPointerFieldWidth = 2 + 2 * sizeof(void*);
-static void DumpPCAndFrameSizeAndSymbol(void (*writerfn)(const char*, void*),
- void* writerfn_arg, void* pc,
- void* symbolize_pc, int framesize,
- const char* const prefix) {
+void DumpPCAndFrameSizeAndSymbol(void (*writerfn)(const char*, void*),
+ void* writerfn_arg, void* pc,
+ void* symbolize_pc, int framesize,
+ const char* const prefix) {
char tmp[1024];
const char* symbol = "(unknown)";
if (y_absl::Symbolize(symbolize_pc, tmp, sizeof(tmp))) {
@@ -52,9 +52,9 @@ static void DumpPCAndFrameSizeAndSymbol(void (*writerfn)(const char*, void*),
writerfn(buf, writerfn_arg);
}
-static void DumpPCAndFrameSize(void (*writerfn)(const char*, void*),
- void* writerfn_arg, void* pc, int framesize,
- const char* const prefix) {
+void DumpPCAndFrameSize(void (*writerfn)(const char*, void*),
+ void* writerfn_arg, void* pc, int framesize,
+ const char* const prefix) {
char buf[100];
if (framesize <= 0) {
snprintf(buf, sizeof(buf), "%s@ %*p (unknown)\n", prefix,
@@ -66,10 +66,9 @@ static void DumpPCAndFrameSize(void (*writerfn)(const char*, void*),
writerfn(buf, writerfn_arg);
}
-static void DumpStackTrace(void* const stack[], int frame_sizes[], int depth,
- bool symbolize_stacktrace,
- void (*writerfn)(const char*, void*),
- void* writerfn_arg) {
+void DumpStackTrace(void* const stack[], int frame_sizes[], int depth,
+ bool symbolize_stacktrace,
+ void (*writerfn)(const char*, void*), void* writerfn_arg) {
for (int i = 0; i < depth; i++) {
if (symbolize_stacktrace) {
DumpPCAndFrameSizeAndSymbol(writerfn, writerfn_arg, stack[i],
@@ -82,7 +81,7 @@ static void DumpStackTrace(void* const stack[], int frame_sizes[], int depth,
}
}
-static void DebugWriteToString(const char* data, void* str) {
+void DebugWriteToString(const char* data, void* str) {
reinterpret_cast<TString*>(str)->append(data);
}
@@ -103,7 +102,7 @@ TString GetCurrentStackTrace() {
void InitializeStackTracer(const char* argv0) {
y_absl::InitializeSymbolizer(argv0);
- grpc_core::SetCurrentStackTraceProvider(&GetCurrentStackTrace);
+ SetCurrentStackTraceProvider(&GetCurrentStackTrace);
}
} // namespace testing
diff --git a/contrib/libs/grpc/test/core/util/stack_tracer_test.cc b/contrib/libs/grpc/test/core/util/stack_tracer_test.cc
index 6b577984d61..c610c96841a 100644
--- a/contrib/libs/grpc/test/core/util/stack_tracer_test.cc
+++ b/contrib/libs/grpc/test/core/util/stack_tracer_test.cc
@@ -18,9 +18,10 @@
#include "test/core/util/stack_tracer.h"
-#include <gtest/gtest.h>
#include <util/generic/string.h>
+#include <gtest/gtest.h>
+
#include "y_absl/debugging/symbolize.h"
#include "y_absl/strings/match.h"
diff --git a/contrib/libs/grpc/test/core/util/subprocess_posix.cc b/contrib/libs/grpc/test/core/util/subprocess_posix.cc
index ab288d777fc..61363142933 100644
--- a/contrib/libs/grpc/test/core/util/subprocess_posix.cc
+++ b/contrib/libs/grpc/test/core/util/subprocess_posix.cc
@@ -34,6 +34,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include "src/core/lib/gprpp/memory.h"
#include "test/core/util/subprocess.h"
struct gpr_subprocess {
@@ -60,9 +61,8 @@ gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) {
/* if we reach here, an error has occurred */
gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], strerror(errno));
_exit(1);
- return nullptr;
} else {
- r = static_cast<gpr_subprocess*>(gpr_zalloc(sizeof(gpr_subprocess)));
+ r = grpc_core::Zalloc<gpr_subprocess>();
r->pid = pid;
return r;
}
diff --git a/contrib/libs/grpc/test/core/util/subprocess_windows.cc b/contrib/libs/grpc/test/core/util/subprocess_windows.cc
index d3295244eac..7d69af1368f 100644
--- a/contrib/libs/grpc/test/core/util/subprocess_windows.cc
+++ b/contrib/libs/grpc/test/core/util/subprocess_windows.cc
@@ -26,6 +26,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/string.h"
#include "src/core/lib/gpr/string_windows.h"
#include "test/core/util/subprocess.h"
diff --git a/contrib/libs/grpc/test/core/util/test_config.cc b/contrib/libs/grpc/test/core/util/test_config.cc
index 274c5c04b34..46c1455aaf1 100644
--- a/contrib/libs/grpc/test/core/util/test_config.cc
+++ b/contrib/libs/grpc/test/core/util/test_config.cc
@@ -18,7 +18,6 @@
#include "test/core/util/test_config.h"
-#include <grpc/impl/codegen/gpr_types.h>
#include <inttypes.h>
#include <signal.h>
#include <stdbool.h>
@@ -26,7 +25,11 @@
#include <stdlib.h>
#include <string.h>
+#include "y_absl/debugging/failure_signal_handler.h"
+#include "y_absl/debugging/symbolize.h"
+
#include <grpc/grpc.h>
+#include <grpc/impl/codegen/gpr_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -34,11 +37,9 @@
#include "src/core/lib/gpr/useful.h"
#include "src/core/lib/gprpp/examine_stack.h"
#include "src/core/lib/surface/init.h"
+#include "test/core/util/build.h"
#include "test/core/util/stack_tracer.h"
-#include "y_absl/debugging/failure_signal_handler.h"
-#include "y_absl/debugging/symbolize.h"
-
int64_t g_fixture_slowdown_factor = 1;
int64_t g_poller_slowdown_factor = 1;
@@ -52,70 +53,6 @@ static unsigned seed(void) { return static_cast<unsigned>(getpid()); }
static unsigned seed(void) { return (unsigned)_getpid(); }
#endif
-bool BuiltUnderValgrind() {
-#ifdef RUNNING_ON_VALGRIND
- return true;
-#else
- return false;
-#endif
-}
-
-bool BuiltUnderTsan() {
-#if defined(__has_feature)
-#if __has_feature(thread_sanitizer)
- return true;
-#else
- return false;
-#endif
-#else
-#ifdef THREAD_SANITIZER
- return true;
-#else
- return false;
-#endif
-#endif
-}
-
-bool BuiltUnderAsan() {
-#if defined(__has_feature)
-#if __has_feature(address_sanitizer)
- return true;
-#else
- return false;
-#endif
-#else
-#ifdef ADDRESS_SANITIZER
- return true;
-#else
- return false;
-#endif
-#endif
-}
-
-bool BuiltUnderMsan() {
-#if defined(__has_feature)
-#if __has_feature(memory_sanitizer)
- return true;
-#else
- return false;
-#endif
-#else
-#ifdef MEMORY_SANITIZER
- return true;
-#else
- return false;
-#endif
-#endif
-}
-
-bool BuiltUnderUbsan() {
-#ifdef GRPC_UBSAN
- return true;
-#else
- return false;
-#endif
-}
-
int64_t grpc_test_sanitizer_slowdown_factor() {
int64_t sanitizer_multiplier = 1;
if (BuiltUnderValgrind()) {
diff --git a/contrib/libs/grpc/test/core/util/test_config.h b/contrib/libs/grpc/test/core/util/test_config.h
index 6ac43de2666..35da4d0f8e8 100644
--- a/contrib/libs/grpc/test/core/util/test_config.h
+++ b/contrib/libs/grpc/test/core/util/test_config.h
@@ -21,6 +21,8 @@
#include <grpc/support/time.h>
+#include "test/core/util/build.h"
+
extern int64_t g_fixture_slowdown_factor;
extern int64_t g_poller_slowdown_factor;
@@ -37,18 +39,6 @@ gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms);
#define GRPC_TEST_PICK_PORT
#endif
-// Returns whether this is built under ThreadSanitizer
-bool BuiltUnderTsan();
-
-// Returns whether this is built under AddressSanitizer
-bool BuiltUnderAsan();
-
-// Returns whether this is built under MemorySanitizer
-bool BuiltUnderMsan();
-
-// Returns whether this is built under UndefinedBehaviorSanitizer
-bool BuiltUnderUbsan();
-
// Prefer TestEnvironment below.
void grpc_test_init(int argc, char** argv);
diff --git a/contrib/libs/grpc/test/core/util/test_lb_policies.cc b/contrib/libs/grpc/test/core/util/test_lb_policies.cc
index f3734411402..17799626ae2 100644
--- a/contrib/libs/grpc/test/core/util/test_lb_policies.cc
+++ b/contrib/libs/grpc/test/core/util/test_lb_policies.cc
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include "test/core/util/test_lb_policies.h"
@@ -24,6 +22,7 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/ext/filters/client_channel/lb_policy_registry.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channelz.h"
#include "src/core/lib/debug/trace.h"
@@ -35,6 +34,7 @@
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/lib/json/json.h"
+#include "src/core/lib/json/json_util.h"
#include "src/core/lib/transport/connectivity_state.h"
namespace grpc_core {
@@ -50,14 +50,14 @@ class ForwardingLoadBalancingPolicy : public LoadBalancingPolicy {
public:
ForwardingLoadBalancingPolicy(
std::unique_ptr<ChannelControlHelper> delegating_helper, Args args,
- const TString& delegate_policy_name, intptr_t initial_refcount = 1)
+ const char* delegate_policy_name, intptr_t initial_refcount = 1)
: LoadBalancingPolicy(std::move(args), initial_refcount) {
Args delegate_args;
delegate_args.work_serializer = work_serializer();
delegate_args.channel_control_helper = std::move(delegating_helper);
delegate_args.args = args.args;
delegate_ = LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(
- delegate_policy_name.c_str(), std::move(delegate_args));
+ delegate_policy_name, std::move(delegate_args));
grpc_pollset_set_add_pollset_set(delegate_->interested_parties(),
interested_parties());
}
@@ -79,19 +79,6 @@ class ForwardingLoadBalancingPolicy : public LoadBalancingPolicy {
};
//
-// CopyMetadataToVector()
-//
-
-MetadataVector CopyMetadataToVector(
- LoadBalancingPolicy::MetadataInterface* metadata) {
- MetadataVector result;
- for (const auto& p : *metadata) {
- result.push_back({TString(p.first), TString(p.second)});
- }
- return result;
-}
-
-//
// TestPickArgsLb
//
@@ -99,11 +86,11 @@ constexpr char kTestPickArgsLbPolicyName[] = "test_pick_args_lb";
class TestPickArgsLb : public ForwardingLoadBalancingPolicy {
public:
- TestPickArgsLb(Args args, TestPickArgsCallback cb)
+ TestPickArgsLb(Args args, TestPickArgsCallback cb,
+ const char* delegate_policy_name)
: ForwardingLoadBalancingPolicy(
y_absl::make_unique<Helper>(RefCountedPtr<TestPickArgsLb>(this), cb),
- std::move(args),
- /*delegate_policy_name=*/"pick_first",
+ std::move(args), delegate_policy_name,
/*initial_refcount=*/2) {}
~TestPickArgsLb() override = default;
@@ -121,7 +108,7 @@ class TestPickArgsLb : public ForwardingLoadBalancingPolicy {
// Report args seen.
PickArgsSeen args_seen;
args_seen.path = TString(args.path);
- args_seen.metadata = CopyMetadataToVector(args.initial_metadata);
+ args_seen.metadata = args.initial_metadata->TestOnlyCopyToVector();
cb_(args_seen);
// Do pick.
return delegate_picker_->Pick(args);
@@ -153,6 +140,10 @@ class TestPickArgsLb : public ForwardingLoadBalancingPolicy {
parent_->channel_control_helper()->RequestReresolution();
}
+ y_absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message);
@@ -171,23 +162,26 @@ class TestPickArgsLbConfig : public LoadBalancingPolicy::Config {
class TestPickArgsLbFactory : public LoadBalancingPolicyFactory {
public:
- explicit TestPickArgsLbFactory(TestPickArgsCallback cb)
- : cb_(std::move(cb)) {}
+ explicit TestPickArgsLbFactory(TestPickArgsCallback cb,
+ const char* delegate_policy_name)
+ : cb_(std::move(cb)), delegate_policy_name_(delegate_policy_name) {}
OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
LoadBalancingPolicy::Args args) const override {
- return MakeOrphanable<TestPickArgsLb>(std::move(args), cb_);
+ return MakeOrphanable<TestPickArgsLb>(std::move(args), cb_,
+ delegate_policy_name_);
}
const char* name() const override { return kTestPickArgsLbPolicyName; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
+ const Json& /*json*/, grpc_error_handle* /*error*/) const override {
return MakeRefCounted<TestPickArgsLbConfig>();
}
private:
TestPickArgsCallback cb_;
+ const char* delegate_policy_name_;
};
//
@@ -228,10 +222,10 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy
// Do pick.
PickResult result = delegate_picker_->Pick(args);
// Intercept trailing metadata.
- if (result.type == PickResult::PICK_COMPLETE &&
- result.subchannel != nullptr) {
- new (args.call_state->Alloc(sizeof(TrailingMetadataHandler)))
- TrailingMetadataHandler(&result, cb_);
+ auto* complete_pick = y_absl::get_if<PickResult::Complete>(&result.result);
+ if (complete_pick != nullptr) {
+ complete_pick->subchannel_call_tracker =
+ y_absl::make_unique<SubchannelCallTracker>(cb_);
}
return result;
}
@@ -264,6 +258,10 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy
parent_->channel_control_helper()->RequestReresolution();
}
+ y_absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message);
@@ -274,30 +272,22 @@ class InterceptRecvTrailingMetadataLoadBalancingPolicy
InterceptRecvTrailingMetadataCallback cb_;
};
- class TrailingMetadataHandler {
+ class SubchannelCallTracker : public SubchannelCallTrackerInterface {
public:
- TrailingMetadataHandler(PickResult* result,
- InterceptRecvTrailingMetadataCallback cb)
- : cb_(std::move(cb)) {
- result->recv_trailing_metadata_ready = [this](grpc_error* error,
- MetadataInterface* metadata,
- CallState* call_state) {
- RecordRecvTrailingMetadata(error, metadata, call_state);
- };
- }
+ explicit SubchannelCallTracker(InterceptRecvTrailingMetadataCallback cb)
+ : cb_(std::move(cb)) {}
- private:
- void RecordRecvTrailingMetadata(grpc_error* /*error*/,
- MetadataInterface* recv_trailing_metadata,
- CallState* call_state) {
+ void Start() override {}
+
+ void Finish(FinishArgs args) override {
TrailingMetadataArgsSeen args_seen;
- args_seen.backend_metric_data = call_state->GetBackendMetricData();
- GPR_ASSERT(recv_trailing_metadata != nullptr);
- args_seen.metadata = CopyMetadataToVector(recv_trailing_metadata);
+ args_seen.backend_metric_data =
+ args.backend_metric_accessor->GetBackendMetricData();
+ args_seen.metadata = args.trailing_metadata->TestOnlyCopyToVector();
cb_(args_seen);
- this->~TrailingMetadataHandler();
}
+ private:
InterceptRecvTrailingMetadataCallback cb_;
};
};
@@ -325,7 +315,7 @@ class InterceptTrailingFactory : public LoadBalancingPolicyFactory {
}
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
+ const Json& /*json*/, grpc_error_handle* /*error*/) const override {
return MakeRefCounted<InterceptTrailingConfig>();
}
@@ -378,6 +368,10 @@ class AddressTestLoadBalancingPolicy : public ForwardingLoadBalancingPolicy {
parent_->channel_control_helper()->RequestReresolution();
}
+ y_absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
void AddTraceEvent(TraceSeverity severity,
y_absl::string_view message) override {
parent_->channel_control_helper()->AddTraceEvent(severity, message);
@@ -406,7 +400,7 @@ class AddressTestFactory : public LoadBalancingPolicyFactory {
const char* name() const override { return kAddressTestLbPolicyName; }
RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
- const Json& /*json*/, grpc_error** /*error*/) const override {
+ const Json& /*json*/, grpc_error_handle* /*error*/) const override {
return MakeRefCounted<AddressTestConfig>();
}
@@ -414,11 +408,126 @@ class AddressTestFactory : public LoadBalancingPolicyFactory {
AddressTestCallback cb_;
};
+//
+// FixedAddressLoadBalancingPolicy
+//
+
+constexpr char kFixedAddressLbPolicyName[] = "fixed_address_lb";
+
+class FixedAddressConfig : public LoadBalancingPolicy::Config {
+ public:
+ explicit FixedAddressConfig(TString address)
+ : address_(std::move(address)) {}
+
+ const char* name() const override { return kFixedAddressLbPolicyName; }
+
+ const TString& address() const { return address_; }
+
+ private:
+ TString address_;
+};
+
+class FixedAddressLoadBalancingPolicy : public ForwardingLoadBalancingPolicy {
+ public:
+ explicit FixedAddressLoadBalancingPolicy(Args args)
+ : ForwardingLoadBalancingPolicy(
+ y_absl::make_unique<Helper>(
+ RefCountedPtr<FixedAddressLoadBalancingPolicy>(this)),
+ std::move(args),
+ /*delegate_policy_name=*/"pick_first",
+ /*initial_refcount=*/2) {}
+
+ ~FixedAddressLoadBalancingPolicy() override = default;
+
+ const char* name() const override { return kFixedAddressLbPolicyName; }
+
+ void UpdateLocked(UpdateArgs args) override {
+ auto* config = static_cast<FixedAddressConfig*>(args.config.get());
+ gpr_log(GPR_INFO, "%s: update URI: %s", kFixedAddressLbPolicyName,
+ config->address().c_str());
+ auto uri = URI::Parse(config->address());
+ args.config.reset();
+ args.addresses.clear();
+ if (uri.ok()) {
+ grpc_resolved_address address;
+ GPR_ASSERT(grpc_parse_uri(*uri, &address));
+ args.addresses.emplace_back(address, /*args=*/nullptr);
+ } else {
+ gpr_log(GPR_ERROR,
+ "%s: could not parse URI (%s), using empty address list",
+ kFixedAddressLbPolicyName, uri.status().ToString().c_str());
+ }
+ ForwardingLoadBalancingPolicy::UpdateLocked(std::move(args));
+ }
+
+ private:
+ class Helper : public ChannelControlHelper {
+ public:
+ explicit Helper(RefCountedPtr<FixedAddressLoadBalancingPolicy> parent)
+ : parent_(std::move(parent)) {}
+
+ RefCountedPtr<SubchannelInterface> CreateSubchannel(
+ ServerAddress address, const grpc_channel_args& args) override {
+ return parent_->channel_control_helper()->CreateSubchannel(
+ std::move(address), args);
+ }
+
+ void UpdateState(grpc_connectivity_state state, const y_absl::Status& status,
+ std::unique_ptr<SubchannelPicker> picker) override {
+ parent_->channel_control_helper()->UpdateState(state, status,
+ std::move(picker));
+ }
+
+ void RequestReresolution() override {
+ parent_->channel_control_helper()->RequestReresolution();
+ }
+
+ y_absl::string_view GetAuthority() override {
+ return parent_->channel_control_helper()->GetAuthority();
+ }
+
+ void AddTraceEvent(TraceSeverity severity,
+ y_absl::string_view message) override {
+ parent_->channel_control_helper()->AddTraceEvent(severity, message);
+ }
+
+ private:
+ RefCountedPtr<FixedAddressLoadBalancingPolicy> parent_;
+ };
+};
+
+class FixedAddressFactory : public LoadBalancingPolicyFactory {
+ public:
+ FixedAddressFactory() = default;
+
+ OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
+ LoadBalancingPolicy::Args args) const override {
+ return MakeOrphanable<FixedAddressLoadBalancingPolicy>(std::move(args));
+ }
+
+ const char* name() const override { return kFixedAddressLbPolicyName; }
+
+ RefCountedPtr<LoadBalancingPolicy::Config> ParseLoadBalancingConfig(
+ const Json& json, grpc_error_handle* error) const override {
+ std::vector<grpc_error_handle> error_list;
+ TString address;
+ ParseJsonObjectField(json.object_value(), "address", &address, &error_list);
+ if (!error_list.empty()) {
+ *error = GRPC_ERROR_CREATE_FROM_VECTOR(
+ "errors parsing fixed_address_lb config", &error_list);
+ return nullptr;
+ }
+ return MakeRefCounted<FixedAddressConfig>(std::move(address));
+ }
+};
+
} // namespace
-void RegisterTestPickArgsLoadBalancingPolicy(TestPickArgsCallback cb) {
+void RegisterTestPickArgsLoadBalancingPolicy(TestPickArgsCallback cb,
+ const char* delegate_policy_name) {
LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
- y_absl::make_unique<TestPickArgsLbFactory>(std::move(cb)));
+ y_absl::make_unique<TestPickArgsLbFactory>(std::move(cb),
+ delegate_policy_name));
}
void RegisterInterceptRecvTrailingMetadataLoadBalancingPolicy(
@@ -432,4 +541,9 @@ void RegisterAddressTestLoadBalancingPolicy(AddressTestCallback cb) {
y_absl::make_unique<AddressTestFactory>(std::move(cb)));
}
+void RegisterFixedAddressLoadBalancingPolicy() {
+ LoadBalancingPolicyRegistry::Builder::RegisterLoadBalancingPolicyFactory(
+ y_absl::make_unique<FixedAddressFactory>());
+}
+
} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/test_lb_policies.h b/contrib/libs/grpc/test/core/util/test_lb_policies.h
index 9e14c707a31..fc6b054ad35 100644
--- a/contrib/libs/grpc/test/core/util/test_lb_policies.h
+++ b/contrib/libs/grpc/test/core/util/test_lb_policies.h
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2018 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2018 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#ifndef GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
#define GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
@@ -32,12 +30,14 @@ struct PickArgsSeen {
using TestPickArgsCallback = std::function<void(const PickArgsSeen&)>;
-// Registers an LB policy called "test_pick_args_lb" that checks the args
-// passed to SubchannelPicker::Pick().
-void RegisterTestPickArgsLoadBalancingPolicy(TestPickArgsCallback cb);
+// Registers an LB policy called "test_pick_args_lb" that passes the args
+// passed to SubchannelPicker::Pick() to cb.
+void RegisterTestPickArgsLoadBalancingPolicy(
+ TestPickArgsCallback cb, const char* delegate_policy_name = "pick_first");
struct TrailingMetadataArgsSeen {
- const LoadBalancingPolicy::BackendMetricData* backend_metric_data;
+ const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
+ backend_metric_data;
MetadataVector metadata;
};
@@ -55,6 +55,10 @@ using AddressTestCallback = std::function<void(const ServerAddress&)>;
// address used to create a subchannel.
void RegisterAddressTestLoadBalancingPolicy(AddressTestCallback cb);
+// Registers an LB policy called "fixed_address_lb" that provides a
+// single subchannel whose address is in its configuration.
+void RegisterFixedAddressLoadBalancingPolicy();
+
} // namespace grpc_core
#endif // GRPC_TEST_CORE_UTIL_TEST_LB_POLICIES_H
diff --git a/contrib/libs/grpc/test/core/util/test_tcp_server.cc b/contrib/libs/grpc/test/core/util/test_tcp_server.cc
index 9dd1e2af36a..57d6c213747 100644
--- a/contrib/libs/grpc/test/core/util/test_tcp_server.cc
+++ b/contrib/libs/grpc/test/core/util/test_tcp_server.cc
@@ -16,25 +16,26 @@
*
*/
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/iomgr/socket_utils.h"
-
#include "test/core/util/test_tcp_server.h"
+#include <string.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/time.h>
-#include <string.h>
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/resolve_address.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/iomgr/socket_utils.h"
#include "src/core/lib/iomgr/tcp_server.h"
+#include "src/core/lib/resource_quota/api.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-static void on_server_destroyed(void* data, grpc_error* /*error*/) {
+static void on_server_destroyed(void* data, grpc_error_handle /*error*/) {
test_tcp_server* server = static_cast<test_tcp_server*>(data);
server->shutdown = true;
}
@@ -63,9 +64,14 @@ void test_tcp_server_start(test_tcp_server* server, int port) {
addr->sin_family = GRPC_AF_INET;
addr->sin_port = grpc_htons(static_cast<uint16_t>(port));
memset(&addr->sin_addr, 0, sizeof(addr->sin_addr));
+ resolved_addr.len = static_cast<socklen_t>(sizeof(grpc_sockaddr_in));
- grpc_error* error = grpc_tcp_server_create(&server->shutdown_complete,
- nullptr, &server->tcp_server);
+ const grpc_channel_args* args = grpc_core::CoreConfiguration::Get()
+ .channel_args_preconditioning()
+ .PreconditionChannelArgs(nullptr);
+ grpc_error_handle error = grpc_tcp_server_create(&server->shutdown_complete,
+ args, &server->tcp_server);
+ grpc_channel_args_destroy(args);
GPR_ASSERT(error == GRPC_ERROR_NONE);
error =
grpc_tcp_server_add_port(server->tcp_server, &resolved_addr, &port_added);
@@ -88,8 +94,8 @@ void test_tcp_server_poll(test_tcp_server* server, int milliseconds) {
gpr_mu_unlock(server->mu);
}
-static void do_nothing(void* /*arg*/, grpc_error* /*error*/) {}
-static void finish_pollset(void* arg, grpc_error* /*error*/) {
+static void do_nothing(void* /*arg*/, grpc_error_handle /*error*/) {}
+static void finish_pollset(void* arg, grpc_error_handle /*error*/) {
grpc_pollset_destroy(static_cast<grpc_pollset*>(arg));
}
diff --git a/contrib/libs/grpc/test/core/util/test_tcp_server.h b/contrib/libs/grpc/test/core/util/test_tcp_server.h
index 549b47b259b..a06dde8ace8 100644
--- a/contrib/libs/grpc/test/core/util/test_tcp_server.h
+++ b/contrib/libs/grpc/test/core/util/test_tcp_server.h
@@ -22,6 +22,7 @@
#include <vector>
#include <grpc/support/sync.h>
+
#include "src/core/lib/iomgr/tcp_server.h"
// test_tcp_server should be stack-allocated or new'ed, never gpr_malloc'ed
diff --git a/contrib/libs/grpc/test/core/util/tls_utils.cc b/contrib/libs/grpc/test/core/util/tls_utils.cc
index cb812f12269..7f2fd0c1260 100644
--- a/contrib/libs/grpc/test/core/util/tls_utils.cc
+++ b/contrib/libs/grpc/test/core/util/tls_utils.cc
@@ -16,6 +16,8 @@
#include "test/core/util/tls_utils.h"
+#include <grpc/support/log.h>
+
#include "src/core/lib/gpr/tmpfile.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/slice/slice_internal.h"
@@ -24,16 +26,16 @@ namespace grpc_core {
namespace testing {
-TmpFile::TmpFile(y_absl::string_view credential_data) {
- name_ = CreateTmpFileAndWriteData(credential_data);
+TmpFile::TmpFile(y_absl::string_view data) {
+ name_ = CreateTmpFileAndWriteData(data);
GPR_ASSERT(!name_.empty());
}
TmpFile::~TmpFile() { GPR_ASSERT(remove(name_.c_str()) == 0); }
-void TmpFile::RewriteFile(y_absl::string_view credential_data) {
+void TmpFile::RewriteFile(y_absl::string_view data) {
// Create a new file containing new data.
- TString new_name = CreateTmpFileAndWriteData(credential_data);
+ TString new_name = CreateTmpFileAndWriteData(data);
GPR_ASSERT(!new_name.empty());
// Remove the old file.
GPR_ASSERT(remove(name_.c_str()) == 0);
@@ -41,12 +43,11 @@ void TmpFile::RewriteFile(y_absl::string_view credential_data) {
GPR_ASSERT(rename(new_name.c_str(), name_.c_str()) == 0);
}
-TString TmpFile::CreateTmpFileAndWriteData(
- y_absl::string_view credential_data) {
+TString TmpFile::CreateTmpFileAndWriteData(y_absl::string_view data) {
char* name = nullptr;
- FILE* file_descriptor = gpr_tmpfile("GrpcTlsCertificateProviderTest", &name);
- GPR_ASSERT(fwrite(credential_data.data(), 1, credential_data.size(),
- file_descriptor) == credential_data.size());
+ FILE* file_descriptor = gpr_tmpfile("test", &name);
+ GPR_ASSERT(fwrite(data.data(), 1, data.size(), file_descriptor) ==
+ data.size());
GPR_ASSERT(fclose(file_descriptor) == 0);
GPR_ASSERT(file_descriptor != nullptr);
GPR_ASSERT(name != nullptr);
@@ -66,9 +67,104 @@ PemKeyCertPairList MakeCertKeyPairs(y_absl::string_view private_key,
TString GetFileContents(const char* path) {
grpc_slice slice = grpc_empty_slice();
GPR_ASSERT(GRPC_LOG_IF_ERROR("load_file", grpc_load_file(path, 0, &slice)));
- TString credential = TString(StringViewFromSlice(slice));
+ TString data = TString(StringViewFromSlice(slice));
grpc_slice_unref(slice);
- return credential;
+ return data;
+}
+
+int SyncExternalVerifier::Verify(void* user_data,
+ grpc_tls_custom_verification_check_request*,
+ grpc_tls_on_custom_verification_check_done_cb,
+ void*, grpc_status_code* sync_status,
+ char** sync_error_details) {
+ auto* self = static_cast<SyncExternalVerifier*>(user_data);
+ if (self->success_) {
+ *sync_status = GRPC_STATUS_OK;
+ return true; // Synchronous call
+ }
+ *sync_status = GRPC_STATUS_UNAUTHENTICATED;
+ *sync_error_details = gpr_strdup("SyncExternalVerifier failed");
+ return true; // Synchronous call
+}
+
+void SyncExternalVerifier::Destruct(void* user_data) {
+ auto* self = static_cast<SyncExternalVerifier*>(user_data);
+ delete self;
+}
+
+AsyncExternalVerifier::~AsyncExternalVerifier() {
+ // Tell the thread to shut down.
+ {
+ MutexLock lock(&mu_);
+ queue_.push_back(Request{nullptr, nullptr, nullptr, true});
+ }
+ // Wait for thread to exit.
+ thread_.Join();
+ grpc_shutdown();
+}
+
+int AsyncExternalVerifier::Verify(
+ void* user_data, grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback, void* callback_arg,
+ grpc_status_code*, char**) {
+ auto* self = static_cast<AsyncExternalVerifier*>(user_data);
+ // Add request to queue to be picked up by worker thread.
+ MutexLock lock(&self->mu_);
+ self->queue_.push_back(Request{request, callback, callback_arg, false});
+ return false; // Asynchronous call
+}
+
+namespace {
+
+void DestroyExternalVerifier(void* arg) {
+ auto* verifier = static_cast<AsyncExternalVerifier*>(arg);
+ delete verifier;
+}
+
+} // namespace
+
+void AsyncExternalVerifier::Destruct(void* user_data) {
+ auto* self = static_cast<AsyncExternalVerifier*>(user_data);
+ // Spawn a detached thread to destroy the verifier, to make sure that we don't
+ // try to join the worker thread from within the worker thread.
+ Thread destroy_thread("DestroyExternalVerifier", DestroyExternalVerifier,
+ self, nullptr, Thread::Options().set_joinable(false));
+ destroy_thread.Start();
+}
+
+void AsyncExternalVerifier::WorkerThread(void* arg) {
+ auto* self = static_cast<AsyncExternalVerifier*>(arg);
+ while (true) {
+ // Check queue for work.
+ bool got_request = false;
+ Request request;
+ {
+ MutexLock lock(&self->mu_);
+ if (!self->queue_.empty()) {
+ got_request = true;
+ request = self->queue_.front();
+ self->queue_.pop_front();
+ }
+ }
+ // If nothing found in the queue, sleep for a bit and try again.
+ if (!got_request) {
+ gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
+ continue;
+ }
+ // If we're being told to shut down, return.
+ if (request.shutdown) {
+ return;
+ }
+ // Process the request.
+ if (self->success_) {
+ request.callback(request.request, request.callback_arg, GRPC_STATUS_OK,
+ "");
+ } else {
+ request.callback(request.request, request.callback_arg,
+ GRPC_STATUS_UNAUTHENTICATED,
+ "AsyncExternalVerifier failed");
+ }
+ }
}
} // namespace testing
diff --git a/contrib/libs/grpc/test/core/util/tls_utils.h b/contrib/libs/grpc/test/core/util/tls_utils.h
index e7ace3bf77a..be88a804e3a 100644
--- a/contrib/libs/grpc/test/core/util/tls_utils.h
+++ b/contrib/libs/grpc/test/core/util/tls_utils.h
@@ -14,7 +14,11 @@
// limitations under the License.
//
+#include <deque>
+
+#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/security/security_connector/ssl_utils.h"
+#include "test/core/util/test_config.h"
namespace grpc_core {
@@ -22,18 +26,18 @@ namespace testing {
class TmpFile {
public:
- // Create a temporary file with |credential_data| written in.
- explicit TmpFile(y_absl::string_view credential_data);
+ // Create a temporary file with |data| written in.
+ explicit TmpFile(y_absl::string_view data);
~TmpFile();
const TString& name() { return name_; }
- // Rewrite |credential_data| to the temporary file, in an atomic way.
- void RewriteFile(y_absl::string_view credential_data);
+ // Rewrite |data| to the temporary file, in an atomic way.
+ void RewriteFile(y_absl::string_view data);
private:
- TString CreateTmpFileAndWriteData(y_absl::string_view credential_data);
+ TString CreateTmpFileAndWriteData(y_absl::string_view data);
TString name_;
};
@@ -43,6 +47,90 @@ PemKeyCertPairList MakeCertKeyPairs(y_absl::string_view private_key,
TString GetFileContents(const char* path);
+// A synchronous external verifier implementation that simply returns
+// verification results based on users' inputs. Note that it will delete itself
+// in Destruct(), so create it like
+// ```
+// auto* sync_verifier_ = new SyncExternalVerifier(false);
+// ```
+// and no need to delete it later. This is basically to keep consistent with the
+// semantics in AsyncExternalVerifier.
+class SyncExternalVerifier {
+ public:
+ explicit SyncExternalVerifier(bool success)
+ : success_(success), base_{this, Verify, Cancel, Destruct} {}
+
+ grpc_tls_certificate_verifier_external* base() { return &base_; }
+
+ private:
+ static int Verify(void* user_data,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+
+ static void Cancel(void*, grpc_tls_custom_verification_check_request*) {}
+
+ static void Destruct(void* user_data);
+
+ bool success_ = false;
+ grpc_tls_certificate_verifier_external base_;
+};
+
+// An asynchronous external verifier implementation that runs a thread and
+// process each request received from the verifier sequentially. Note that it
+// will delete itself in Destruct(), so create it like
+// ```
+// auto* async_verifier = new AsyncExternalVerifier(true, &event);
+// auto* core_external_verifier =
+// new ExternalCertificateVerifier(async_verifier->base());
+// ```
+// and no need to delete it later.
+// We delete AsyncExternalVerifier in Destruct() instead of its dtor because we
+// wanted AsyncExternalVerifier to outlive the underlying core
+// ExternalCertificateVerifier implementation.
+class AsyncExternalVerifier {
+ public:
+ explicit AsyncExternalVerifier(bool success)
+ : success_(success),
+ thread_("AsyncExternalVerifierWorkerThread", WorkerThread, this),
+ base_{this, Verify, Cancel, Destruct} {
+ grpc_init();
+ thread_.Start();
+ }
+
+ ~AsyncExternalVerifier();
+
+ grpc_tls_certificate_verifier_external* base() { return &base_; }
+
+ private:
+ // A request to pass to the worker thread.
+ struct Request {
+ grpc_tls_custom_verification_check_request* request;
+ grpc_tls_on_custom_verification_check_done_cb callback;
+ void* callback_arg;
+ bool shutdown; // If true, thread will exit.
+ };
+
+ static int Verify(void* user_data,
+ grpc_tls_custom_verification_check_request* request,
+ grpc_tls_on_custom_verification_check_done_cb callback,
+ void* callback_arg, grpc_status_code* sync_status,
+ char** sync_error_details);
+
+ static void Cancel(void*, grpc_tls_custom_verification_check_request*) {}
+
+ static void Destruct(void* user_data);
+
+ static void WorkerThread(void* arg);
+
+ bool success_ = false;
+ Thread thread_;
+ grpc_tls_certificate_verifier_external base_;
+ Mutex mu_;
+ std::deque<Request> queue_ Y_ABSL_GUARDED_BY(mu_);
+};
+
} // namespace testing
} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/tracer_util.cc b/contrib/libs/grpc/test/core/util/tracer_util.cc
index dc5a45568cb..df42eb921ed 100644
--- a/contrib/libs/grpc/test/core/util/tracer_util.cc
+++ b/contrib/libs/grpc/test/core/util/tracer_util.cc
@@ -16,16 +16,13 @@
*
*/
-#include "test/core/util/test_config.h"
-
#include "src/core/lib/debug/trace.h"
+#include "test/core/util/test_config.h"
namespace grpc_core {
namespace testing {
-void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag) {
- flag->set_enabled(true);
-}
+void grpc_tracer_enable_flag(TraceFlag* flag) { flag->set_enabled(true); }
} // namespace testing
} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/tracer_util.h b/contrib/libs/grpc/test/core/util/tracer_util.h
index 0b432ffa46a..7f9aa151edf 100644
--- a/contrib/libs/grpc/test/core/util/tracer_util.h
+++ b/contrib/libs/grpc/test/core/util/tracer_util.h
@@ -24,7 +24,7 @@ class TraceFlag;
namespace testing {
// enables the TraceFlag passed to it. Used for testing purposes.
-void grpc_tracer_enable_flag(grpc_core::TraceFlag* flag);
+void grpc_tracer_enable_flag(TraceFlag* flag);
} // namespace testing
} // namespace grpc_core
diff --git a/contrib/libs/grpc/test/core/util/trickle_endpoint.cc b/contrib/libs/grpc/test/core/util/trickle_endpoint.cc
deleted file mode 100644
index 28ffb0e3e7a..00000000000
--- a/contrib/libs/grpc/test/core/util/trickle_endpoint.cc
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include "src/core/lib/iomgr/sockaddr.h"
-
-#include "test/core/util/passthru_endpoint.h"
-
-#include <inttypes.h>
-#include <string.h>
-
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/string_util.h>
-
-#include "src/core/lib/gpr/useful.h"
-#include "src/core/lib/slice/slice_internal.h"
-
-#define WRITE_BUFFER_SIZE (2 * 1024 * 1024)
-
-typedef struct {
- grpc_endpoint base;
- double bytes_per_second;
- grpc_endpoint* wrapped;
- gpr_timespec last_write;
-
- gpr_mu mu;
- grpc_slice_buffer write_buffer;
- grpc_slice_buffer writing_buffer;
- grpc_error* error;
- bool writing;
- grpc_closure* write_cb;
-} trickle_endpoint;
-
-static void te_read(grpc_endpoint* ep, grpc_slice_buffer* slices,
- grpc_closure* cb, bool urgent) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- grpc_endpoint_read(te->wrapped, slices, cb, urgent);
-}
-
-static void maybe_call_write_cb_locked(trickle_endpoint* te) {
- if (te->write_cb != nullptr &&
- (te->error != GRPC_ERROR_NONE ||
- te->write_buffer.length <= WRITE_BUFFER_SIZE)) {
- grpc_core::ExecCtx::Run(DEBUG_LOCATION, te->write_cb,
- GRPC_ERROR_REF(te->error));
- te->write_cb = nullptr;
- }
-}
-
-static void te_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
- grpc_closure* cb, void* /*arg*/) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- gpr_mu_lock(&te->mu);
- GPR_ASSERT(te->write_cb == nullptr);
- if (te->write_buffer.length == 0) {
- te->last_write = gpr_now(GPR_CLOCK_MONOTONIC);
- }
- for (size_t i = 0; i < slices->count; i++) {
- grpc_slice_buffer_add(&te->write_buffer,
- grpc_slice_copy(slices->slices[i]));
- }
- te->write_cb = cb;
- maybe_call_write_cb_locked(te);
- gpr_mu_unlock(&te->mu);
-}
-
-static void te_add_to_pollset(grpc_endpoint* ep, grpc_pollset* pollset) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- grpc_endpoint_add_to_pollset(te->wrapped, pollset);
-}
-
-static void te_add_to_pollset_set(grpc_endpoint* ep,
- grpc_pollset_set* pollset_set) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- grpc_endpoint_add_to_pollset_set(te->wrapped, pollset_set);
-}
-
-static void te_delete_from_pollset_set(grpc_endpoint* ep,
- grpc_pollset_set* pollset_set) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- grpc_endpoint_delete_from_pollset_set(te->wrapped, pollset_set);
-}
-
-static void te_shutdown(grpc_endpoint* ep, grpc_error* why) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- gpr_mu_lock(&te->mu);
- if (te->error == GRPC_ERROR_NONE) {
- te->error = GRPC_ERROR_REF(why);
- }
- maybe_call_write_cb_locked(te);
- gpr_mu_unlock(&te->mu);
- grpc_endpoint_shutdown(te->wrapped, why);
-}
-
-static void te_destroy(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- grpc_endpoint_destroy(te->wrapped);
- gpr_mu_destroy(&te->mu);
- grpc_slice_buffer_destroy_internal(&te->write_buffer);
- grpc_slice_buffer_destroy_internal(&te->writing_buffer);
- GRPC_ERROR_UNREF(te->error);
- gpr_free(te);
-}
-
-static grpc_resource_user* te_get_resource_user(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- return grpc_endpoint_get_resource_user(te->wrapped);
-}
-
-static y_absl::string_view te_get_peer(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- return grpc_endpoint_get_peer(te->wrapped);
-}
-
-static y_absl::string_view te_get_local_address(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- return grpc_endpoint_get_local_address(te->wrapped);
-}
-
-static int te_get_fd(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- return grpc_endpoint_get_fd(te->wrapped);
-}
-
-static bool te_can_track_err(grpc_endpoint* /*ep*/) { return false; }
-
-static void te_finish_write(void* arg, grpc_error* /*error*/) {
- trickle_endpoint* te = static_cast<trickle_endpoint*>(arg);
- gpr_mu_lock(&te->mu);
- te->writing = false;
- grpc_slice_buffer_reset_and_unref(&te->writing_buffer);
- gpr_mu_unlock(&te->mu);
-}
-
-static const grpc_endpoint_vtable vtable = {te_read,
- te_write,
- te_add_to_pollset,
- te_add_to_pollset_set,
- te_delete_from_pollset_set,
- te_shutdown,
- te_destroy,
- te_get_resource_user,
- te_get_peer,
- te_get_local_address,
- te_get_fd,
- te_can_track_err};
-
-grpc_endpoint* grpc_trickle_endpoint_create(grpc_endpoint* wrap,
- double bytes_per_second) {
- trickle_endpoint* te =
- static_cast<trickle_endpoint*>(gpr_malloc(sizeof(*te)));
- te->base.vtable = &vtable;
- te->wrapped = wrap;
- te->bytes_per_second = bytes_per_second;
- te->write_cb = nullptr;
- gpr_mu_init(&te->mu);
- grpc_slice_buffer_init(&te->write_buffer);
- grpc_slice_buffer_init(&te->writing_buffer);
- te->error = GRPC_ERROR_NONE;
- te->writing = false;
- return &te->base;
-}
-
-static double ts2dbl(gpr_timespec s) {
- return static_cast<double>(s.tv_sec) + 1e-9 * static_cast<double>(s.tv_nsec);
-}
-
-size_t grpc_trickle_endpoint_trickle(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- gpr_mu_lock(&te->mu);
- if (!te->writing && te->write_buffer.length > 0) {
- gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC);
- double elapsed = ts2dbl(gpr_time_sub(now, te->last_write));
- size_t bytes = static_cast<size_t>(te->bytes_per_second * elapsed);
- // gpr_log(GPR_DEBUG, "%lf elapsed --> %" PRIdPTR " bytes", elapsed, bytes);
- if (bytes > 0) {
- grpc_slice_buffer_move_first(&te->write_buffer,
- GPR_MIN(bytes, te->write_buffer.length),
- &te->writing_buffer);
- te->writing = true;
- te->last_write = now;
- grpc_endpoint_write(
- te->wrapped, &te->writing_buffer,
- GRPC_CLOSURE_CREATE(te_finish_write, te, grpc_schedule_on_exec_ctx),
- nullptr);
- maybe_call_write_cb_locked(te);
- }
- }
- size_t backlog = te->write_buffer.length;
- gpr_mu_unlock(&te->mu);
- return backlog;
-}
-
-size_t grpc_trickle_get_backlog(grpc_endpoint* ep) {
- trickle_endpoint* te = reinterpret_cast<trickle_endpoint*>(ep);
- gpr_mu_lock(&te->mu);
- size_t backlog = te->write_buffer.length;
- gpr_mu_unlock(&te->mu);
- return backlog;
-}
diff --git a/contrib/libs/grpc/test/core/util/tsan_suppressions.txt b/contrib/libs/grpc/test/core/util/tsan_suppressions.txt
index e0c79072288..ffafdea6f1e 100644
--- a/contrib/libs/grpc/test/core/util/tsan_suppressions.txt
+++ b/contrib/libs/grpc/test/core/util/tsan_suppressions.txt
@@ -7,7 +7,7 @@ race:ssleay_rand_add
race:ssleay_rand_bytes
race:__sleep_for
# protobuf has an idempotent write race in ByteSize/GetCachedSize
-# https://github.com/google/protobuf/issues/2169
+# https://github.com/protocolbuffers/protobuf/issues/2169
race:ByteSize
race:ByteSizeLong
race:GetCachedSize
diff --git a/contrib/libs/grpc/test/core/util/ubsan_suppressions.txt b/contrib/libs/grpc/test/core/util/ubsan_suppressions.txt
index ca233b8a281..f37807257f9 100644
--- a/contrib/libs/grpc/test/core/util/ubsan_suppressions.txt
+++ b/contrib/libs/grpc/test/core/util/ubsan_suppressions.txt
@@ -21,6 +21,7 @@ enum:grpc_op_string
signed-integer-overflow:chrono
enum:grpc_http2_error_to_grpc_status
enum:grpc_chttp2_cancel_stream
+enum:api_fuzzer
# TODO(juanlishen): Remove this supression after
# https://github.com/GoogleCloudPlatform/layer-definitions/issues/531 is
# addressed.
diff --git a/contrib/libs/grpc/test/cpp/end2end/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/test/cpp/end2end/.yandex_meta/licenses.list.txt
index ef0151141b2..4851cba93f4 100644
--- a/contrib/libs/grpc/test/cpp/end2end/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/test/cpp/end2end/.yandex_meta/licenses.list.txt
@@ -43,11 +43,11 @@
====================COPYRIGHT====================
- * Copyright 2020 gRPC authors.
+ * Copyright 2019 gRPC authors.
====================COPYRIGHT====================
-# Copyright 2019 gRPC authors.
+ * Copyright 2020 gRPC authors.
====================COPYRIGHT====================
diff --git a/contrib/libs/grpc/test/cpp/end2end/admin_services_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/admin_services_end2end_test.cc
index 50225f3baf7..79bac431aed 100644
--- a/contrib/libs/grpc/test/cpp/end2end/admin_services_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/admin_services_end2end_test.cc
@@ -21,6 +21,7 @@
#include "y_absl/strings/str_cat.h"
+#include <grpcpp/ext/admin_services.h>
#include <grpcpp/ext/proto_server_reflection_plugin.h>
#include <grpcpp/grpcpp.h>
@@ -28,9 +29,6 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-#ifndef DISABLED_XDS_PROTO_IN_CC
-#include <grpcpp/ext/admin_services.h>
-
namespace grpc {
namespace testing {
@@ -73,32 +71,28 @@ class AdminServicesTest : public ::testing::Test {
stream_;
};
-#ifndef GRPC_NO_XDS
-// The ifndef conflicts with TEST_F and EXPECT_THAT macros, so we better isolate
-// the condition at test case level.
-TEST_F(AdminServicesTest, XdsEnabled) {
+TEST_F(AdminServicesTest, ValidateRegisteredServices) {
+ // Using Contains here, because the server builder might register other
+ // services in certain environments.
+ EXPECT_THAT(
+ GetServiceList(),
+ ::testing::AllOf(
+ ::testing::Contains("grpc.channelz.v1.Channelz"),
+ ::testing::Contains("grpc.reflection.v1alpha.ServerReflection")));
+#if defined(GRPC_NO_XDS) || defined(DISABLED_XDS_PROTO_IN_CC)
EXPECT_THAT(GetServiceList(),
- ::testing::UnorderedElementsAre(
- "envoy.service.status.v3.ClientStatusDiscoveryService",
- "grpc.channelz.v1.Channelz",
- "grpc.reflection.v1alpha.ServerReflection"));
-}
-#endif // GRPC_NO_XDS
-
-#ifdef GRPC_NO_XDS
-TEST_F(AdminServicesTest, XdsDisabled) {
+ ::testing::Not(::testing::Contains(
+ "envoy.service.status.v3.ClientStatusDiscoveryService")));
+#else
EXPECT_THAT(GetServiceList(),
- ::testing::UnorderedElementsAre(
- "grpc.channelz.v1.Channelz",
- "grpc.reflection.v1alpha.ServerReflection"));
+ ::testing::Contains(
+ "envoy.service.status.v3.ClientStatusDiscoveryService"));
+#endif // GRPC_NO_XDS or DISABLED_XDS_PROTO_IN_CC
}
-#endif // GRPC_NO_XDS
} // namespace testing
} // namespace grpc
-#endif // DISABLED_XDS_PROTO_IN_CC
-
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
diff --git a/contrib/libs/grpc/test/cpp/end2end/async_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/async_end2end_test.cc
index 30f6d100924..24bc20fc17b 100644
--- a/contrib/libs/grpc/test/cpp/end2end/async_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/async_end2end_test.cc
@@ -20,6 +20,8 @@
#include <memory>
#include <thread>
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -32,8 +34,6 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/iomgr/port.h"
@@ -238,8 +238,7 @@ class TestScenario {
const TString message_content;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{inproc=" << (scenario.inproc ? "true" : "false")
<< ", credentials='" << scenario.credentials_type
<< ", health_check_service="
diff --git a/contrib/libs/grpc/test/cpp/end2end/cfstream_test.cc b/contrib/libs/grpc/test/cpp/end2end/cfstream_test.cc
index 2e258d03d48..8a8dcd48040 100644
--- a/contrib/libs/grpc/test/cpp/end2end/cfstream_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/cfstream_test.cc
@@ -16,14 +16,14 @@
*
*/
-#include "src/core/lib/iomgr/port.h"
-
#include <algorithm>
#include <memory>
#include <mutex>
#include <random>
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
@@ -36,11 +36,10 @@
#include <grpcpp/health_check_service_interface.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
-#include <gtest/gtest.h>
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/gpr/env.h"
-
+#include "src/core/lib/iomgr/port.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
diff --git a/contrib/libs/grpc/test/cpp/end2end/channelz_service_test.cc b/contrib/libs/grpc/test/cpp/end2end/channelz_service_test.cc
index e076d8cc5d3..a52533280ad 100644
--- a/contrib/libs/grpc/test/cpp/end2end/channelz_service_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/channelz_service_test.cc
@@ -18,6 +18,10 @@
#include <grpc/support/port_platform.h>
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpcpp/channel.h>
@@ -30,8 +34,6 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h"
@@ -45,8 +47,6 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/test_credentials_provider.h"
-#include <gtest/gtest.h>
-
using grpc::channelz::v1::Address;
using grpc::channelz::v1::GetChannelRequest;
using grpc::channelz::v1::GetChannelResponse;
@@ -67,7 +67,7 @@ namespace grpc {
namespace testing {
namespace {
-static bool ValidateAddress(const Address& address) {
+bool ValidateAddress(const Address& address) {
if (address.address_case() != Address::kTcpipAddress) {
return true;
}
diff --git a/contrib/libs/grpc/test/cpp/end2end/client_callback_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/client_callback_end2end_test.cc
index 1d81cdea70c..157dcfa94a9 100644
--- a/contrib/libs/grpc/test/cpp/end2end/client_callback_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/client_callback_end2end_test.cc
@@ -16,6 +16,17 @@
*
*/
+#include <algorithm>
+#include <condition_variable>
+#include <functional>
+#include <mutex>
+#include <sstream>
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
@@ -25,16 +36,7 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
#include <grpcpp/support/client_callback.h>
-#include <gtest/gtest.h>
-
-#include <algorithm>
-#include <condition_variable>
-#include <functional>
-#include <mutex>
-#include <sstream>
-#include <thread>
-#include "y_absl/memory/memory.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -67,8 +69,7 @@ class TestScenario {
const TString credentials_type;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{callback_server="
<< (scenario.callback_server ? "true" : "false") << ",protocol="
<< (scenario.protocol == Protocol::INPROC ? "INPROC" : "TCP")
@@ -121,10 +122,14 @@ class ClientCallbackEnd2endTest
is_server_started_ = true;
}
- void ResetStub() {
+ void ResetStub(
+ std::unique_ptr<experimental::ClientInterceptorFactoryInterface>
+ interceptor = nullptr) {
ChannelArguments args;
auto channel_creds = GetCredentialsProvider()->GetChannelCredentials(
GetParam().credentials_type, &args);
+ auto interceptors = CreatePhonyClientInterceptors();
+ if (interceptor != nullptr) interceptors.push_back(std::move(interceptor));
switch (GetParam().protocol) {
case Protocol::TCP:
if (!GetParam().use_interceptors) {
@@ -133,7 +138,7 @@ class ClientCallbackEnd2endTest
} else {
channel_ = CreateCustomChannelWithInterceptors(
server_address_.str(), channel_creds, args,
- CreatePhonyClientInterceptors());
+ std::move(interceptors));
}
break;
case Protocol::INPROC:
@@ -141,7 +146,7 @@ class ClientCallbackEnd2endTest
channel_ = server_->InProcessChannel(args);
} else {
channel_ = server_->experimental().InProcessChannelWithInterceptors(
- args, CreatePhonyClientInterceptors());
+ args, std::move(interceptors));
}
break;
default:
@@ -187,7 +192,7 @@ class ClientCallbackEnd2endTest
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
+ stub_->async()->Echo(
&cli_ctx, &request, &response,
[&cli_ctx, &request, &response, &done, &mu, &cv, val,
with_binary_metadata](Status s) {
@@ -212,7 +217,8 @@ class ClientCallbackEnd2endTest
}
}
- void SendRpcsGeneric(int num_rpcs, bool maybe_except) {
+ void SendRpcsGeneric(int num_rpcs, bool maybe_except,
+ const char* suffix_for_stats) {
const TString kMethodName("/grpc.testing.EchoTestService/Echo");
TString test_string("");
for (int i = 0; i < num_rpcs; i++) {
@@ -228,8 +234,9 @@ class ClientCallbackEnd2endTest
std::mutex mu;
std::condition_variable cv;
bool done = false;
- generic_stub_->experimental().UnaryCall(
- &cli_ctx, kMethodName, send_buf.get(), &recv_buf,
+ StubOptions options(suffix_for_stats);
+ generic_stub_->UnaryCall(
+ &cli_ctx, kMethodName, options, send_buf.get(), &recv_buf,
[&request, &recv_buf, &done, &mu, &cv, maybe_except](Status s) {
GPR_ASSERT(s.ok());
@@ -254,23 +261,25 @@ class ClientCallbackEnd2endTest
}
}
- void SendGenericEchoAsBidi(int num_rpcs, int reuses, bool do_writes_done) {
+ void SendGenericEchoAsBidi(int num_rpcs, int reuses, bool do_writes_done,
+ const char* suffix_for_stats) {
const TString kMethodName("/grpc.testing.EchoTestService/Echo");
TString test_string("");
for (int i = 0; i < num_rpcs; i++) {
test_string += "Hello world. ";
- class Client : public grpc::experimental::ClientBidiReactor<ByteBuffer,
- ByteBuffer> {
+ class Client : public grpc::ClientBidiReactor<ByteBuffer, ByteBuffer> {
public:
Client(ClientCallbackEnd2endTest* test, const TString& method_name,
- const TString& test_str, int reuses, bool do_writes_done)
+ const char* suffix_for_stats, const TString& test_str,
+ int reuses, bool do_writes_done)
: reuses_remaining_(reuses), do_writes_done_(do_writes_done) {
- activate_ = [this, test, method_name, test_str] {
+ activate_ = [this, test, method_name, suffix_for_stats, test_str] {
if (reuses_remaining_ > 0) {
cli_ctx_ = y_absl::make_unique<ClientContext>();
reuses_remaining_--;
- test->generic_stub_->experimental().PrepareBidiStreamingCall(
- cli_ctx_.get(), method_name, this);
+ StubOptions options(suffix_for_stats);
+ test->generic_stub_->PrepareBidiStreamingCall(
+ cli_ctx_.get(), method_name, options, this);
request_.set_message(test_str);
send_buf_ = SerializeToByteBuffer(&request_);
StartWrite(send_buf_.get());
@@ -317,7 +326,8 @@ class ClientCallbackEnd2endTest
const bool do_writes_done_;
};
- Client rpc(this, kMethodName, test_string, reuses, do_writes_done);
+ Client rpc(this, kMethodName, suffix_for_stats, test_string, reuses,
+ do_writes_done);
rpc.Await();
}
@@ -355,16 +365,16 @@ TEST_P(ClientCallbackEnd2endTest, SimpleRpcExpectedError) {
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
- &cli_ctx, &request, &response,
- [&response, &done, &mu, &cv, &error_status](Status s) {
- EXPECT_EQ("", response.message());
- EXPECT_EQ(error_status.code(), s.error_code());
- EXPECT_EQ(error_status.error_message(), s.error_message());
- std::lock_guard<std::mutex> l(mu);
- done = true;
- cv.notify_one();
- });
+ stub_->async()->Echo(&cli_ctx, &request, &response,
+ [&response, &done, &mu, &cv, &error_status](Status s) {
+ EXPECT_EQ("", response.message());
+ EXPECT_EQ(error_status.code(), s.error_code());
+ EXPECT_EQ(error_status.error_message(),
+ s.error_message());
+ std::lock_guard<std::mutex> l(mu);
+ done = true;
+ cv.notify_one();
+ });
std::unique_lock<std::mutex> l(mu);
while (!done) {
@@ -405,19 +415,18 @@ TEST_P(ClientCallbackEnd2endTest, SimpleRpcUnderLockNested) {
std::function<void(int)> nested_call = [this, &nested_call,
&rpc_state](int index) {
std::lock_guard<std::mutex> l(rpc_state[index].mu);
- stub_->experimental_async()->Echo(
- &rpc_state[index].cli_ctx, &rpc_state[index].request,
- &rpc_state[index].response,
- [index, &nested_call, &rpc_state](Status s) {
- std::lock_guard<std::mutex> l1(rpc_state[index].mu);
- EXPECT_TRUE(s.ok());
- rpc_state[index].done = true;
- rpc_state[index].cv.notify_all();
- // Call the next level of nesting if possible
- if (index + 1 < int(rpc_state.size())) {
- nested_call(index + 1);
- }
- });
+ stub_->async()->Echo(&rpc_state[index].cli_ctx, &rpc_state[index].request,
+ &rpc_state[index].response,
+ [index, &nested_call, &rpc_state](Status s) {
+ std::lock_guard<std::mutex> l1(rpc_state[index].mu);
+ EXPECT_TRUE(s.ok());
+ rpc_state[index].done = true;
+ rpc_state[index].cv.notify_all();
+ // Call the next level of nesting if possible
+ if (index + 1 < int(rpc_state.size())) {
+ nested_call(index + 1);
+ }
+ });
};
nested_call(0);
@@ -443,15 +452,14 @@ TEST_P(ClientCallbackEnd2endTest, SimpleRpcUnderLock) {
ClientContext cli_ctx;
{
std::lock_guard<std::mutex> l(mu);
- stub_->experimental_async()->Echo(
- &cli_ctx, &request, &response,
- [&mu, &cv, &done, &request, &response](Status s) {
- std::lock_guard<std::mutex> l(mu);
- EXPECT_TRUE(s.ok());
- EXPECT_EQ(request.message(), response.message());
- done = true;
- cv.notify_one();
- });
+ stub_->async()->Echo(&cli_ctx, &request, &response,
+ [&mu, &cv, &done, &request, &response](Status s) {
+ std::lock_guard<std::mutex> l(mu);
+ EXPECT_TRUE(s.ok());
+ EXPECT_EQ(request.message(), response.message());
+ done = true;
+ cv.notify_one();
+ });
}
std::unique_lock<std::mutex> l(mu);
while (!done) {
@@ -476,7 +484,7 @@ TEST_P(ClientCallbackEnd2endTest, SendClientInitialMetadata) {
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->CheckClientInitialMetadata(
+ stub_->async()->CheckClientInitialMetadata(
&cli_ctx, &request, &response, [&done, &mu, &cv](Status s) {
GPR_ASSERT(s.ok());
@@ -501,29 +509,46 @@ TEST_P(ClientCallbackEnd2endTest, SequentialRpcsWithVariedBinaryMetadataValue) {
}
TEST_P(ClientCallbackEnd2endTest, SequentialGenericRpcs) {
- ResetStub();
- SendRpcsGeneric(10, false);
+ ResetStub(y_absl::make_unique<TestInterceptorFactory>(
+ "/grpc.testing.EchoTestService/Echo", nullptr));
+ SendRpcsGeneric(10, false, /*suffix_for_stats=*/nullptr);
+}
+
+TEST_P(ClientCallbackEnd2endTest, SequentialGenericRpcsWithSuffix) {
+ ResetStub(y_absl::make_unique<TestInterceptorFactory>(
+ "/grpc.testing.EchoTestService/Echo", "TestSuffix"));
+ SendRpcsGeneric(10, false, "TestSuffix");
}
TEST_P(ClientCallbackEnd2endTest, SequentialGenericRpcsAsBidi) {
- ResetStub();
- SendGenericEchoAsBidi(10, 1, /*do_writes_done=*/true);
+ ResetStub(y_absl::make_unique<TestInterceptorFactory>(
+ "/grpc.testing.EchoTestService/Echo", nullptr));
+ SendGenericEchoAsBidi(10, 1, /*do_writes_done=*/true,
+ /*suffix_for_stats=*/nullptr);
+}
+
+TEST_P(ClientCallbackEnd2endTest, SequentialGenericRpcsAsBidiWithSuffix) {
+ ResetStub(y_absl::make_unique<TestInterceptorFactory>(
+ "/grpc.testing.EchoTestService/Echo", "TestSuffix"));
+ SendGenericEchoAsBidi(10, 1, /*do_writes_done=*/true, "TestSuffix");
}
TEST_P(ClientCallbackEnd2endTest, SequentialGenericRpcsAsBidiWithReactorReuse) {
ResetStub();
- SendGenericEchoAsBidi(10, 10, /*do_writes_done=*/true);
+ SendGenericEchoAsBidi(10, 10, /*do_writes_done=*/true,
+ /*suffix_for_stats=*/nullptr);
}
TEST_P(ClientCallbackEnd2endTest, GenericRpcNoWritesDone) {
ResetStub();
- SendGenericEchoAsBidi(1, 1, /*do_writes_done=*/false);
+ SendGenericEchoAsBidi(1, 1, /*do_writes_done=*/false,
+ /*suffix_for_stats=*/nullptr);
}
#if GRPC_ALLOW_EXCEPTIONS
TEST_P(ClientCallbackEnd2endTest, ExceptingRpc) {
ResetStub();
- SendRpcsGeneric(10, true);
+ SendRpcsGeneric(10, true, nullptr);
}
#endif
@@ -562,14 +587,14 @@ TEST_P(ClientCallbackEnd2endTest, CancelRpcBeforeStart) {
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
- &context, &request, &response, [&response, &done, &mu, &cv](Status s) {
- EXPECT_EQ("", response.message());
- EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
- std::lock_guard<std::mutex> l(mu);
- done = true;
- cv.notify_one();
- });
+ stub_->async()->Echo(&context, &request, &response,
+ [&response, &done, &mu, &cv](Status s) {
+ EXPECT_EQ("", response.message());
+ EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
+ std::lock_guard<std::mutex> l(mu);
+ done = true;
+ cv.notify_one();
+ });
std::unique_lock<std::mutex> l(mu);
while (!done) {
cv.wait(l);
@@ -591,14 +616,14 @@ TEST_P(ClientCallbackEnd2endTest, RequestEchoServerCancel) {
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
- &context, &request, &response, [&done, &mu, &cv](Status s) {
- EXPECT_FALSE(s.ok());
- EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
- std::lock_guard<std::mutex> l(mu);
- done = true;
- cv.notify_one();
- });
+ stub_->async()->Echo(&context, &request, &response,
+ [&done, &mu, &cv](Status s) {
+ EXPECT_FALSE(s.ok());
+ EXPECT_EQ(grpc::StatusCode::CANCELLED, s.error_code());
+ std::lock_guard<std::mutex> l(mu);
+ done = true;
+ cv.notify_one();
+ });
std::unique_lock<std::mutex> l(mu);
while (!done) {
cv.wait(l);
@@ -613,7 +638,7 @@ struct ClientCancelInfo {
explicit ClientCancelInfo(int ops) : cancel{true}, ops_before_cancel{ops} {}
};
-class WriteClient : public grpc::experimental::ClientWriteReactor<EchoRequest> {
+class WriteClient : public grpc::ClientWriteReactor<EchoRequest> {
public:
WriteClient(grpc::testing::EchoTestService::Stub* stub,
ServerTryCancelRequestPhase server_try_cancel,
@@ -631,7 +656,7 @@ class WriteClient : public grpc::experimental::ClientWriteReactor<EchoRequest> {
ToString(server_try_cancel));
}
context_.set_initial_metadata_corked(true);
- stub->experimental_async()->RequestStream(&context_, &response_, this);
+ stub->async()->RequestStream(&context_, &response_, this);
StartCall();
request_.set_message(msg);
MaybeWrite();
@@ -765,14 +790,14 @@ TEST_P(ClientCallbackEnd2endTest, RequestStreamServerCancelAfterReads) {
TEST_P(ClientCallbackEnd2endTest, UnaryReactor) {
ResetStub();
- class UnaryClient : public grpc::experimental::ClientUnaryReactor {
+ class UnaryClient : public grpc::ClientUnaryReactor {
public:
explicit UnaryClient(grpc::testing::EchoTestService::Stub* stub) {
cli_ctx_.AddMetadata("key1", "val1");
cli_ctx_.AddMetadata("key2", "val2");
request_.mutable_param()->set_echo_metadata_initially(true);
request_.set_message("Hello metadata");
- stub->experimental_async()->Echo(&cli_ctx_, &request_, &response_, this);
+ stub->async()->Echo(&cli_ctx_, &request_, &response_, this);
StartCall();
}
void OnReadInitialMetadataDone(bool ok) override {
@@ -822,19 +847,23 @@ TEST_P(ClientCallbackEnd2endTest, UnaryReactor) {
}
TEST_P(ClientCallbackEnd2endTest, GenericUnaryReactor) {
- ResetStub();
const TString kMethodName("/grpc.testing.EchoTestService/Echo");
- class UnaryClient : public grpc::experimental::ClientUnaryReactor {
+ constexpr char kSuffixForStats[] = "TestSuffixForStats";
+ ResetStub(
+ y_absl::make_unique<TestInterceptorFactory>(kMethodName, kSuffixForStats));
+ class UnaryClient : public grpc::ClientUnaryReactor {
public:
- UnaryClient(grpc::GenericStub* stub, const TString& method_name) {
+ UnaryClient(grpc::GenericStub* stub, const TString& method_name,
+ const char* suffix_for_stats) {
cli_ctx_.AddMetadata("key1", "val1");
cli_ctx_.AddMetadata("key2", "val2");
request_.mutable_param()->set_echo_metadata_initially(true);
request_.set_message("Hello metadata");
send_buf_ = SerializeToByteBuffer(&request_);
- stub->experimental().PrepareUnaryCall(&cli_ctx_, method_name,
- send_buf_.get(), &recv_buf_, this);
+ StubOptions options(suffix_for_stats);
+ stub->PrepareUnaryCall(&cli_ctx_, method_name, options, send_buf_.get(),
+ &recv_buf_, this);
StartCall();
}
void OnReadInitialMetadataDone(bool ok) override {
@@ -878,7 +907,7 @@ TEST_P(ClientCallbackEnd2endTest, GenericUnaryReactor) {
bool initial_metadata_done_{false};
};
- UnaryClient test{generic_stub_.get(), kMethodName};
+ UnaryClient test{generic_stub_.get(), kMethodName, kSuffixForStats};
test.Await();
// Make sure that the server interceptors were not notified of a cancel
if (GetParam().use_interceptors) {
@@ -886,7 +915,7 @@ TEST_P(ClientCallbackEnd2endTest, GenericUnaryReactor) {
}
}
-class ReadClient : public grpc::experimental::ClientReadReactor<EchoResponse> {
+class ReadClient : public grpc::ClientReadReactor<EchoResponse> {
public:
ReadClient(grpc::testing::EchoTestService::Stub* stub,
ServerTryCancelRequestPhase server_try_cancel,
@@ -898,7 +927,7 @@ class ReadClient : public grpc::experimental::ClientReadReactor<EchoResponse> {
ToString(server_try_cancel));
}
request_.set_message("Hello client ");
- stub->experimental_async()->ResponseStream(&context_, &request_, this);
+ stub->async()->ResponseStream(&context_, &request_, this);
if (client_cancel_.cancel &&
reads_complete_ == client_cancel_.ops_before_cancel) {
context_.TryCancel();
@@ -1038,8 +1067,7 @@ TEST_P(ClientCallbackEnd2endTest, ResponseStreamServerCancelAfter) {
}
}
-class BidiClient
- : public grpc::experimental::ClientBidiReactor<EchoRequest, EchoResponse> {
+class BidiClient : public grpc::ClientBidiReactor<EchoRequest, EchoResponse> {
public:
BidiClient(grpc::testing::EchoTestService::Stub* stub,
ServerTryCancelRequestPhase server_try_cancel,
@@ -1055,7 +1083,7 @@ class BidiClient
}
request_.set_message("Hello fren ");
context_.set_initial_metadata_corked(cork_metadata);
- stub->experimental_async()->BidiStream(&context_, this);
+ stub->async()->BidiStream(&context_, this);
MaybeAsyncWrite(first_write_async);
StartRead(&response_);
StartCall();
@@ -1294,12 +1322,11 @@ TEST_P(ClientCallbackEnd2endTest, BidiStreamServerCancelAfter) {
TEST_P(ClientCallbackEnd2endTest, SimultaneousReadAndWritesDone) {
ResetStub();
- class Client : public grpc::experimental::ClientBidiReactor<EchoRequest,
- EchoResponse> {
+ class Client : public grpc::ClientBidiReactor<EchoRequest, EchoResponse> {
public:
explicit Client(grpc::testing::EchoTestService::Stub* stub) {
request_.set_message("Hello bidi ");
- stub->experimental_async()->BidiStream(&context_, this);
+ stub->async()->BidiStream(&context_, this);
StartWrite(&request_);
StartCall();
}
@@ -1357,7 +1384,7 @@ TEST_P(ClientCallbackEnd2endTest, UnimplementedRpc) {
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub->experimental_async()->Unimplemented(
+ stub->async()->Unimplemented(
&cli_ctx, &request, &response, [&done, &mu, &cv](Status s) {
EXPECT_EQ(StatusCode::UNIMPLEMENTED, s.error_code());
EXPECT_EQ("", s.error_message());
@@ -1372,16 +1399,56 @@ TEST_P(ClientCallbackEnd2endTest, UnimplementedRpc) {
}
}
+TEST_P(ClientCallbackEnd2endTest, TestTrailersOnlyOnError) {
+ // Note that trailers-only is an HTTP/2 concept so we shouldn't do this test
+ // for any other transport such as inproc.
+ if (GetParam().protocol != Protocol::TCP) {
+ return;
+ }
+
+ ResetStub();
+ class Reactor : public grpc::ClientBidiReactor<EchoRequest, EchoResponse> {
+ public:
+ explicit Reactor(grpc::testing::EchoTestService::Stub* stub) {
+ stub->async()->UnimplementedBidi(&context_, this);
+ StartCall();
+ }
+ void Await() {
+ std::unique_lock<std::mutex> l(mu_);
+ while (!done_) {
+ done_cv_.wait(l);
+ }
+ }
+
+ private:
+ void OnReadInitialMetadataDone(bool ok) override { EXPECT_FALSE(ok); }
+ void OnDone(const Status& s) override {
+ EXPECT_EQ(s.error_code(), grpc::StatusCode::UNIMPLEMENTED);
+ EXPECT_EQ(s.error_message(), "");
+ std::unique_lock<std::mutex> l(mu_);
+ done_ = true;
+ done_cv_.notify_one();
+ }
+
+ ClientContext context_;
+ std::mutex mu_;
+ std::condition_variable done_cv_;
+ bool done_ = false;
+ } client(stub_.get());
+
+ client.Await();
+}
+
TEST_P(ClientCallbackEnd2endTest,
ResponseStreamExtraReactionFlowReadsUntilDone) {
ResetStub();
class ReadAllIncomingDataClient
- : public grpc::experimental::ClientReadReactor<EchoResponse> {
+ : public grpc::ClientReadReactor<EchoResponse> {
public:
explicit ReadAllIncomingDataClient(
grpc::testing::EchoTestService::Stub* stub) {
request_.set_message("Hello client ");
- stub->experimental_async()->ResponseStream(&context_, &request_, this);
+ stub->async()->ResponseStream(&context_, &request_, this);
}
bool WaitForReadDone() {
std::unique_lock<std::mutex> l(mu_);
diff --git a/contrib/libs/grpc/test/cpp/end2end/client_crash_test.cc b/contrib/libs/grpc/test/cpp/end2end/client_crash_test.cc
index 7fd8a224bb3..bdb10d476e6 100644
--- a/contrib/libs/grpc/test/cpp/end2end/client_crash_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/client_crash_test.cc
@@ -16,6 +16,10 @@
*
*/
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
@@ -26,16 +30,12 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/subprocess.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/client_crash_test_server.cc b/contrib/libs/grpc/test/cpp/end2end/client_crash_test_server.cc
index bf4ae9e0410..d08d296430c 100644
--- a/contrib/libs/grpc/test/cpp/end2end/client_crash_test_server.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/client_crash_test_server.cc
@@ -16,16 +16,17 @@
*
*/
-#include <grpc/support/log.h>
-#include <grpcpp/server.h>
-#include <grpcpp/server_builder.h>
-#include <grpcpp/server_context.h>
-
#include <iostream>
#include <memory>
#include <util/generic/string.h>
#include "y_absl/flags/flag.h"
+
+#include <grpc/support/log.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/server_context.h>
+
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/test_config.h"
diff --git a/contrib/libs/grpc/test/cpp/end2end/client_interceptors_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/client_interceptors_end2end_test.cc
index 9088d07f652..4b9a0302272 100644
--- a/contrib/libs/grpc/test/cpp/end2end/client_interceptors_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/client_interceptors_end2end_test.cc
@@ -19,6 +19,8 @@
#include <memory>
#include <vector>
+#include <gtest/gtest.h>
+
#include "y_absl/memory/memory.h"
#include <grpcpp/channel.h>
@@ -44,11 +46,10 @@
#ifdef GRPC_POSIX_SOCKET
#include <fcntl.h>
+
#include "src/core/lib/iomgr/socket_utils_posix.h"
#endif /* GRPC_POSIX_SOCKET */
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
namespace {
@@ -76,6 +77,7 @@ class HijackingInterceptor : public experimental::Interceptor {
info_ = info;
// Make sure it is the right method
EXPECT_EQ(strcmp("/grpc.testing.EchoTestService/Echo", info->method()), 0);
+ EXPECT_EQ(info->suffix_for_stats(), nullptr);
EXPECT_EQ(info->type(), experimental::ClientRpcInfo::Type::UNARY);
}
@@ -183,6 +185,7 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor {
info_ = info;
// Make sure it is the right method
EXPECT_EQ(strcmp("/grpc.testing.EchoTestService/Echo", info->method()), 0);
+ EXPECT_EQ(strcmp("TestSuffixForStats", info->suffix_for_stats()), 0);
}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
@@ -211,12 +214,11 @@ class HijackingInterceptorMakesAnotherCall : public experimental::Interceptor {
methods->GetInterceptedChannel());
ctx_.AddMetadata(metadata_map_.begin()->first,
metadata_map_.begin()->second);
- stub_->experimental_async()->Echo(&ctx_, &req_, &resp_,
- [this, methods](Status s) {
- EXPECT_EQ(s.ok(), true);
- EXPECT_EQ(resp_.message(), "Hello");
- methods->Hijack();
- });
+ stub_->async()->Echo(&ctx_, &req_, &resp_, [this, methods](Status s) {
+ EXPECT_EQ(s.ok(), true);
+ EXPECT_EQ(resp_.message(), "Hello");
+ methods->Hijack();
+ });
// This is a Unary RPC and we have got nothing interesting to do in the
// PRE_SEND_CLOSE interception hook point for this interceptor, so let's
// return here. (We do not want to call methods->Proceed(). When the new
@@ -304,6 +306,7 @@ class BidiStreamingRpcHijackingInterceptor : public experimental::Interceptor {
explicit BidiStreamingRpcHijackingInterceptor(
experimental::ClientRpcInfo* info) {
info_ = info;
+ EXPECT_EQ(info->suffix_for_stats(), nullptr);
}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
@@ -375,6 +378,10 @@ class ClientStreamingRpcHijackingInterceptor
explicit ClientStreamingRpcHijackingInterceptor(
experimental::ClientRpcInfo* info) {
info_ = info;
+ EXPECT_EQ(
+ strcmp("/grpc.testing.EchoTestService/RequestStream", info->method()),
+ 0);
+ EXPECT_EQ(strcmp("TestSuffixForStats", info->suffix_for_stats()), 0);
}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
bool hijack = false;
@@ -431,6 +438,7 @@ class ServerStreamingRpcHijackingInterceptor
experimental::ClientRpcInfo* info) {
info_ = info;
got_failed_message_ = false;
+ EXPECT_EQ(info->suffix_for_stats(), nullptr);
}
void Intercept(experimental::InterceptorBatchMethods* methods) override {
@@ -931,7 +939,7 @@ TEST_F(ClientInterceptorsEnd2endTest,
auto channel = server_->experimental().InProcessChannelWithInterceptors(
args, std::move(creators));
- MakeCall(channel);
+ MakeCall(channel, StubOptions("TestSuffixForStats"));
// Make sure all interceptors were run once, since the hijacking interceptor
// makes an RPC on the intercepted channel
EXPECT_EQ(PhonyInterceptor::GetNumTimesRun(), 12);
@@ -1059,7 +1067,8 @@ TEST_F(ClientInterceptorsStreamingEnd2endTest, ClientStreamingHijackingTest) {
auto channel = experimental::CreateCustomChannelWithInterceptors(
server_address_, InsecureChannelCredentials(), args, std::move(creators));
- auto stub = grpc::testing::EchoTestService::NewStub(channel);
+ auto stub = grpc::testing::EchoTestService::NewStub(
+ channel, StubOptions("TestSuffixForStats"));
ClientContext ctx;
EchoRequest req;
EchoResponse resp;
diff --git a/contrib/libs/grpc/test/cpp/end2end/client_lb_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/client_lb_end2end_test.cc
index 990bab043e2..31bac68e6d1 100644
--- a/contrib/libs/grpc/test/cpp/end2end/client_lb_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/client_lb_end2end_test.cc
@@ -24,8 +24,13 @@
#include <util/generic/string.h>
#include <thread>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
#include "y_absl/memory/memory.h"
#include "y_absl/strings/str_cat.h"
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
@@ -44,29 +49,25 @@
#include "src/core/ext/filters/client_channel/global_subchannel_pool.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/cpp/client/secure_credentials.h"
#include "src/cpp/server/secure_server_credentials.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/orca_load_report_for_test.pb.h"
+#include "src/proto/grpc/testing/xds/v3/orca_load_report.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/resolve_localhost_ip46.h"
#include "test/core/util/test_config.h"
#include "test/core/util/test_lb_policies.h"
#include "test/cpp/end2end/test_service_impl.h"
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
@@ -102,7 +103,7 @@ class MyTestServiceImpl : public TestServiceImpl {
public:
Status Echo(ServerContext* context, const EchoRequest* request,
EchoResponse* response) override {
- const udpa::data::orca::v1::OrcaLoadReport* load_report = nullptr;
+ const xds::data::orca::v3::OrcaLoadReport* load_report = nullptr;
{
grpc::internal::MutexLock lock(&mu_);
++request_count_;
@@ -133,7 +134,7 @@ class MyTestServiceImpl : public TestServiceImpl {
return clients_;
}
- void set_load_report(udpa::data::orca::v1::OrcaLoadReport* load_report) {
+ void set_load_report(xds::data::orca::v3::OrcaLoadReport* load_report) {
grpc::internal::MutexLock lock(&mu_);
load_report_ = load_report;
}
@@ -146,7 +147,7 @@ class MyTestServiceImpl : public TestServiceImpl {
grpc::internal::Mutex mu_;
int request_count_ = 0;
- const udpa::data::orca::v1::OrcaLoadReport* load_report_ = nullptr;
+ const xds::data::orca::v3::OrcaLoadReport* load_report_ = nullptr;
grpc::internal::Mutex clients_mu_;
std::set<TString> clients_;
};
@@ -355,32 +356,33 @@ class ClientLbEnd2endTest : public ::testing::Test {
}
struct ServerData {
- int port_;
+ const int port_;
std::unique_ptr<Server> server_;
MyTestServiceImpl service_;
std::unique_ptr<std::thread> thread_;
- bool server_ready_ = false;
- bool started_ = false;
- explicit ServerData(int port = 0) {
- port_ = port > 0 ? port : 5100; // grpc_pick_unused_port_or_die();
- }
+ grpc::internal::Mutex mu_;
+ grpc::internal::CondVar cond_;
+ bool server_ready_ Y_ABSL_GUARDED_BY(mu_) = false;
+ bool started_ Y_ABSL_GUARDED_BY(mu_) = false;
+
+ explicit ServerData(int port = 0)
+ : port_(port > 0 ? port : 5100) {}
void Start(const TString& server_host) {
gpr_log(GPR_INFO, "starting server on port %d", port_);
+ grpc::internal::MutexLock lock(&mu_);
started_ = true;
- grpc::internal::Mutex mu;
- grpc::internal::MutexLock lock(&mu);
- grpc::internal::CondVar cond;
thread_ = y_absl::make_unique<std::thread>(
- std::bind(&ServerData::Serve, this, server_host, &mu, &cond));
- grpc::internal::WaitUntil(&cond, &mu, [this] { return server_ready_; });
+ std::bind(&ServerData::Serve, this, server_host));
+ while (!server_ready_) {
+ cond_.Wait(&mu_);
+ }
server_ready_ = false;
gpr_log(GPR_INFO, "server startup complete");
}
- void Serve(const TString& server_host, grpc::internal::Mutex* mu,
- grpc::internal::CondVar* cond) {
+ void Serve(const TString& server_host) {
std::ostringstream server_address;
server_address << server_host << ":" << port_;
ServerBuilder builder;
@@ -389,12 +391,13 @@ class ClientLbEnd2endTest : public ::testing::Test {
builder.AddListeningPort(server_address.str(), std::move(creds));
builder.RegisterService(&service_);
server_ = builder.BuildAndStart();
- grpc::internal::MutexLock lock(mu);
+ grpc::internal::MutexLock lock(&mu_);
server_ready_ = true;
- cond->Signal();
+ cond_.Signal();
}
void Shutdown() {
+ grpc::internal::MutexLock lock(&mu_);
if (!started_) return;
server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0));
thread_->join();
@@ -1682,11 +1685,26 @@ class ClientLbPickArgsTest : public ClientLbEnd2endTest {
static void TearDownTestCase() { grpc_shutdown(); }
- const std::vector<grpc_core::PickArgsSeen>& args_seen_list() {
+ std::vector<grpc_core::PickArgsSeen> args_seen_list() {
grpc::internal::MutexLock lock(&mu_);
return args_seen_list_;
}
+ static TString ArgsSeenListString(
+ const std::vector<grpc_core::PickArgsSeen>& args_seen_list) {
+ std::vector<TString> entries;
+ for (const auto& args_seen : args_seen_list) {
+ std::vector<TString> metadata;
+ for (const auto& p : args_seen.metadata) {
+ metadata.push_back(y_absl::StrCat(p.first, "=", p.second));
+ }
+ entries.push_back(y_absl::StrFormat("{path=\"%s\", metadata=[%s]}",
+ args_seen.path,
+ y_absl::StrJoin(metadata, ", ")));
+ }
+ return y_absl::StrCat("[", y_absl::StrJoin(entries, ", "), "]");
+ }
+
private:
static void SavePickArgs(const grpc_core::PickArgsSeen& args_seen) {
ClientLbPickArgsTest* self = current_test_instance_;
@@ -1708,29 +1726,26 @@ TEST_F(ClientLbPickArgsTest, Basic) {
auto channel = BuildChannel("test_pick_args_lb", response_generator);
auto stub = BuildStub(channel);
response_generator.SetNextResolution(GetServersPorts());
- CheckRpcSendOk(stub, DEBUG_LOCATION, /*wait_for_ready=*/true);
+ // Proactively connect the channel, so that the LB policy will always
+ // be connected before it sees the pick. Otherwise, the test would be
+ // flaky because sometimes the pick would be seen twice (once in
+ // CONNECTING and again in READY) and other times only once (in READY).
+ ASSERT_TRUE(channel->WaitForConnected(gpr_inf_future(GPR_CLOCK_MONOTONIC)));
// Check LB policy name for the channel.
EXPECT_EQ("test_pick_args_lb", channel->GetLoadBalancingPolicyName());
- // There will be two entries, one for the pick tried in state
- // CONNECTING and another for the pick tried in state READY.
- EXPECT_THAT(args_seen_list(),
- ::testing::ElementsAre(
- ::testing::AllOf(
- ::testing::Field(&grpc_core::PickArgsSeen::path,
- "/grpc.testing.EchoTestService/Echo"),
- ::testing::Field(&grpc_core::PickArgsSeen::metadata,
- ::testing::UnorderedElementsAre(
- ::testing::Pair("foo", "1"),
- ::testing::Pair("bar", "2"),
- ::testing::Pair("baz", "3")))),
- ::testing::AllOf(
- ::testing::Field(&grpc_core::PickArgsSeen::path,
- "/grpc.testing.EchoTestService/Echo"),
- ::testing::Field(&grpc_core::PickArgsSeen::metadata,
- ::testing::UnorderedElementsAre(
- ::testing::Pair("foo", "1"),
- ::testing::Pair("bar", "2"),
- ::testing::Pair("baz", "3"))))));
+ // Now send an RPC and check that the picker sees the expected data.
+ CheckRpcSendOk(stub, DEBUG_LOCATION, /*wait_for_ready=*/true);
+ auto pick_args_seen_list = args_seen_list();
+ EXPECT_THAT(pick_args_seen_list,
+ ::testing::ElementsAre(::testing::AllOf(
+ ::testing::Field(&grpc_core::PickArgsSeen::path,
+ "/grpc.testing.EchoTestService/Echo"),
+ ::testing::Field(&grpc_core::PickArgsSeen::metadata,
+ ::testing::UnorderedElementsAre(
+ ::testing::Pair("foo", "1"),
+ ::testing::Pair("bar", "2"),
+ ::testing::Pair("baz", "3"))))))
+ << ArgsSeenListString(pick_args_seen_list);
}
class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest {
@@ -1758,7 +1773,7 @@ class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest {
return trailing_metadata_;
}
- const udpa::data::orca::v1::OrcaLoadReport* backend_load_report() {
+ const xds::data::orca::v3::OrcaLoadReport* backend_load_report() {
grpc::internal::MutexLock lock(&mu_);
return load_report_.get();
}
@@ -1773,7 +1788,7 @@ class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest {
self->trailing_metadata_ = args_seen.metadata;
if (backend_metric_data != nullptr) {
self->load_report_ =
- y_absl::make_unique<udpa::data::orca::v1::OrcaLoadReport>();
+ y_absl::make_unique<xds::data::orca::v3::OrcaLoadReport>();
self->load_report_->set_cpu_utilization(
backend_metric_data->cpu_utilization);
self->load_report_->set_mem_utilization(
@@ -1794,7 +1809,7 @@ class ClientLbInterceptTrailingMetadataTest : public ClientLbEnd2endTest {
grpc::internal::Mutex mu_;
int trailers_intercepted_ = 0;
grpc_core::MetadataVector trailing_metadata_;
- std::unique_ptr<udpa::data::orca::v1::OrcaLoadReport> load_report_;
+ std::unique_ptr<xds::data::orca::v3::OrcaLoadReport> load_report_;
};
ClientLbInterceptTrailingMetadataTest*
@@ -1872,7 +1887,7 @@ TEST_F(ClientLbInterceptTrailingMetadataTest, BackendMetricData) {
const int kNumServers = 1;
const int kNumRpcs = 10;
StartServers(kNumServers);
- udpa::data::orca::v1::OrcaLoadReport load_report;
+ xds::data::orca::v3::OrcaLoadReport load_report;
load_report.set_cpu_utilization(0.5);
load_report.set_mem_utilization(0.75);
load_report.set_rps(25);
diff --git a/contrib/libs/grpc/test/cpp/end2end/context_allocator_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/context_allocator_end2end_test.cc
index 7e207936788..0d9fa72f480 100644
--- a/contrib/libs/grpc/test/cpp/end2end/context_allocator_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/context_allocator_end2end_test.cc
@@ -16,6 +16,17 @@
*
*/
+#include <algorithm>
+#include <atomic>
+#include <condition_variable>
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <sstream>
+#include <thread>
+
+#include <gtest/gtest.h>
+
#include <grpc/impl/codegen/log.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
@@ -25,16 +36,6 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
-#include <gtest/gtest.h>
-
-#include <algorithm>
-#include <atomic>
-#include <condition_variable>
-#include <functional>
-#include <memory>
-#include <mutex>
-#include <sstream>
-#include <thread>
#include "src/core/lib/iomgr/iomgr.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -49,10 +50,6 @@ namespace {
enum class Protocol { INPROC, TCP };
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-using experimental::GenericCallbackServerContext;
-#endif
-
class TestScenario {
public:
TestScenario(Protocol protocol, const TString& creds_type)
@@ -62,8 +59,7 @@ class TestScenario {
const TString credentials_type;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{protocol="
<< (scenario.protocol == Protocol::INPROC ? "INPROC" : "TCP")
<< "," << scenario.credentials_type << "}";
@@ -96,7 +92,7 @@ class ContextAllocatorEnd2endTestBase
server_address_ << "localhost:" << picked_port_;
builder.AddListeningPort(server_address_.str(), server_creds);
}
- builder.experimental().SetContextAllocator(std::move(context_allocator));
+ builder.SetContextAllocator(std::move(context_allocator));
builder.RegisterService(&callback_service_);
server_ = builder.BuildAndStart();
@@ -149,7 +145,7 @@ class ContextAllocatorEnd2endTestBase
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
+ stub_->async()->Echo(
&cli_ctx, &request, &response,
[&request, &response, &done, &mu, &cv, val](Status s) {
GPR_ASSERT(s.ok());
diff --git a/contrib/libs/grpc/test/cpp/end2end/counted_service.h b/contrib/libs/grpc/test/cpp/end2end/counted_service.h
new file mode 100644
index 00000000000..81435214074
--- /dev/null
+++ b/contrib/libs/grpc/test/cpp/end2end/counted_service.h
@@ -0,0 +1,64 @@
+//
+// Copyright 2017 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
+#define GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
+
+#include "src/core/lib/gprpp/sync.h"
+
+namespace grpc {
+namespace testing {
+
+// A wrapper around an RPC service implementation that provides request and
+// response counting.
+template <typename ServiceType>
+class CountedService : public ServiceType {
+ public:
+ size_t request_count() {
+ grpc_core::MutexLock lock(&mu_);
+ return request_count_;
+ }
+
+ size_t response_count() {
+ grpc_core::MutexLock lock(&mu_);
+ return response_count_;
+ }
+
+ void IncreaseResponseCount() {
+ grpc_core::MutexLock lock(&mu_);
+ ++response_count_;
+ }
+ void IncreaseRequestCount() {
+ grpc_core::MutexLock lock(&mu_);
+ ++request_count_;
+ }
+
+ void ResetCounters() {
+ grpc_core::MutexLock lock(&mu_);
+ request_count_ = 0;
+ response_count_ = 0;
+ }
+
+ private:
+ grpc_core::Mutex mu_;
+ size_t request_count_ Y_ABSL_GUARDED_BY(mu_) = 0;
+ size_t response_count_ Y_ABSL_GUARDED_BY(mu_) = 0;
+};
+
+} // namespace testing
+} // namespace grpc
+
+#endif // GRPC_TEST_CPP_END2END_COUNTED_SERVICE_H
diff --git a/contrib/libs/grpc/test/cpp/end2end/delegating_channel_test.cc b/contrib/libs/grpc/test/cpp/end2end/delegating_channel_test.cc
index 424ef1979ed..bdc0df0fb14 100644
--- a/contrib/libs/grpc/test/cpp/end2end/delegating_channel_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/delegating_channel_test.cc
@@ -19,6 +19,8 @@
#include <memory>
#include <vector>
+#include <gtest/gtest.h>
+
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
@@ -37,8 +39,6 @@
#include "test/cpp/util/byte_buffer_proto_helper.h"
#include "test/cpp/util/string_ref_helper.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
namespace {
diff --git a/contrib/libs/grpc/test/cpp/end2end/end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/end2end_test.cc
index d8c20bd575e..3649f3bbc0a 100644
--- a/contrib/libs/grpc/test/cpp/end2end/end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/end2end_test.cc
@@ -16,6 +16,13 @@
*
*/
+#include <mutex>
+#include <thread>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/strings/match.h"
+#include "y_absl/strings/str_format.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -23,7 +30,6 @@
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
-#include <grpcpp/impl/codegen/status_code_enum.h>
#include <grpcpp/resource_quota.h>
#include <grpcpp/security/auth_metadata_processor.h>
#include <grpcpp/security/credentials.h>
@@ -34,13 +40,6 @@
#include <grpcpp/support/string_ref.h>
#include <grpcpp/test/channel_test_peer.h>
-#include <mutex>
-#include <thread>
-
-#include "y_absl/memory/memory.h"
-#include "y_absl/strings/match.h"
-#include "y_absl/strings/str_format.h"
-
#include "src/core/ext/filters/client_channel/backup_poller.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/iomgr.h"
@@ -291,8 +290,7 @@ class TestScenario {
bool callback_server;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{use_interceptors="
<< (scenario.use_interceptors ? "true" : "false")
<< ", use_proxy=" << (scenario.use_proxy ? "true" : "false")
@@ -469,8 +467,8 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> {
int first_picked_port_;
};
-static void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs,
- bool with_binary_metadata) {
+void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs,
+ bool with_binary_metadata) {
EchoRequest request;
EchoResponse response;
request.set_message("Hello hello hello hello");
@@ -1268,6 +1266,9 @@ TEST_P(End2endTest, ClientCancelsBidi) {
ClientContext context;
TString msg("hello");
+ // Send server_try_cancel value in the client metadata
+ context.AddMetadata(kClientTryCancelRequest, ToString(1));
+
auto stream = stub_->BidiStream(&context);
request.set_message(msg + "0");
@@ -1381,6 +1382,24 @@ TEST_P(End2endTest, ChannelStateTimeout) {
}
}
+TEST_P(End2endTest, ChannelStateOnLameChannel) {
+ if ((GetParam().credentials_type != kInsecureCredentialsType) ||
+ GetParam().inproc) {
+ return;
+ }
+ // Channel using invalid target URI. This creates a lame channel.
+ auto channel = grpc::CreateChannel("dns:///", InsecureChannelCredentials());
+ // Channel should immediately report TRANSIENT_FAILURE.
+ EXPECT_EQ(GRPC_CHANNEL_TRANSIENT_FAILURE, channel->GetState(true));
+ // And state will never change.
+ auto state = GRPC_CHANNEL_TRANSIENT_FAILURE;
+ for (int i = 0; i < 10; ++i) {
+ channel->WaitForStateChange(
+ state, std::chrono::system_clock::now() + std::chrono::seconds(1));
+ state = channel->GetState(false);
+ }
+}
+
// Talking to a non-existing service.
TEST_P(End2endTest, NonExistingService) {
ResetChannel();
@@ -1461,8 +1480,11 @@ TEST_P(End2endTest, ExpectErrorTest) {
EXPECT_EQ(iter->error_message(), s.error_message());
EXPECT_EQ(iter->binary_error_details(), s.error_details());
EXPECT_TRUE(y_absl::StrContains(context.debug_error_string(), "created"));
+#ifndef NDEBUG
+ // GRPC_ERROR_INT_FILE_LINE is for debug only
EXPECT_TRUE(y_absl::StrContains(context.debug_error_string(), "file"));
EXPECT_TRUE(y_absl::StrContains(context.debug_error_string(), "line"));
+#endif
EXPECT_TRUE(y_absl::StrContains(context.debug_error_string(), "status"));
EXPECT_TRUE(y_absl::StrContains(context.debug_error_string(), "13"));
}
@@ -1628,7 +1650,7 @@ TEST_P(ProxyEnd2endTest, ClientCancelsRpc) {
Status s = stub_->Echo(&context, request, &response);
cancel_thread.join();
EXPECT_EQ(StatusCode::CANCELLED, s.error_code());
- EXPECT_EQ(s.error_message(), "Cancelled");
+ EXPECT_EQ(s.error_message(), "CANCELLED");
}
// Server cancels rpc after 1ms
diff --git a/contrib/libs/grpc/test/cpp/end2end/exception_test.cc b/contrib/libs/grpc/test/cpp/end2end/exception_test.cc
index 404abfad376..1a4c418beda 100644
--- a/contrib/libs/grpc/test/cpp/end2end/exception_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/exception_test.cc
@@ -16,10 +16,13 @@
*
*/
+#include <grpc/impl/codegen/port_platform.h>
+
#include <exception>
#include <memory>
-#include <grpc/impl/codegen/port_platform.h>
+#include <gtest/gtest.h>
+
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/server.h>
@@ -29,8 +32,6 @@
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/test_config.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
diff --git a/contrib/libs/grpc/test/cpp/end2end/filter_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/filter_end2end_test.cc
index e0ac3d325ed..839d6d17d07 100644
--- a/contrib/libs/grpc/test/cpp/end2end/filter_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/filter_end2end_test.cc
@@ -20,6 +20,10 @@
#include <mutex>
#include <thread>
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/time.h>
#include <grpcpp/channel.h>
@@ -34,16 +38,12 @@
#include <grpcpp/support/config.h>
#include <grpcpp/support/slice.h>
-#include "y_absl/memory/memory.h"
-
#include "src/cpp/common/channel_filter.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
@@ -101,8 +101,8 @@ int GetCallCounterValue() {
class ChannelDataImpl : public ChannelData {
public:
- grpc_error* Init(grpc_channel_element* /*elem*/,
- grpc_channel_element_args* /*args*/) override {
+ grpc_error_handle Init(grpc_channel_element* /*elem*/,
+ grpc_channel_element_args* /*args*/) override {
IncrementConnectionCounter();
return GRPC_ERROR_NONE;
}
diff --git a/contrib/libs/grpc/test/cpp/end2end/flaky_network_test.cc b/contrib/libs/grpc/test/cpp/end2end/flaky_network_test.cc
index 8570b58a0e7..70d5b8f0a86 100644
--- a/contrib/libs/grpc/test/cpp/end2end/flaky_network_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/flaky_network_test.cc
@@ -16,11 +16,23 @@
*
*/
+#include <grpc/support/port_platform.h>
+
+#include <algorithm>
+#include <condition_variable>
+#include <memory>
+#include <mutex>
+#include <random>
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
-#include <grpc/support/port_platform.h>
#include <grpc/support/string_util.h>
#include <grpc/support/time.h>
#include <grpcpp/channel.h>
@@ -29,16 +41,6 @@
#include <grpcpp/health_check_service_interface.h>
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
-#include <gtest/gtest.h>
-
-#include <algorithm>
-#include <condition_variable>
-#include <memory>
-#include <mutex>
-#include <random>
-#include <thread>
-
-#include "y_absl/memory/memory.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/gpr/env.h"
diff --git a/contrib/libs/grpc/test/cpp/end2end/generic_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/generic_end2end_test.cc
index 4d9dcbade48..dae816531ee 100644
--- a/contrib/libs/grpc/test/cpp/end2end/generic_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/generic_end2end_test.cc
@@ -19,6 +19,10 @@
#include <memory>
#include <thread>
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/time.h>
#include <grpcpp/channel.h>
@@ -32,15 +36,11 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/slice.h>
-#include "y_absl/memory/memory.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/grpclb_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/grpclb_end2end_test.cc
index 8cd73aa9a91..1f71145b66d 100644
--- a/contrib/libs/grpc/test/cpp/end2end/grpclb_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/grpclb_end2end_test.cc
@@ -1,20 +1,18 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+// Copyright 2017 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
#include <deque>
#include <memory>
@@ -24,6 +22,9 @@
#include <util/generic/string.h>
#include <thread>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
#include "y_absl/memory/memory.h"
#include "y_absl/strings/str_cat.h"
#include "y_absl/strings/str_format.h"
@@ -40,29 +41,26 @@
#include <grpcpp/server_builder.h>
#include "src/core/ext/filters/client_channel/backup_poller.h"
+#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.h"
#include "src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_balancer_addresses.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/filters/client_channel/service_config.h"
+#include "src/core/ext/service_config/service_config.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/sockaddr.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/core/lib/transport/authority_override.h"
#include "src/cpp/client/secure_credentials.h"
#include "src/cpp/server/secure_server_credentials.h"
-
+#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h"
+#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/resolve_localhost_ip46.h"
#include "test/core/util/test_config.h"
+#include "test/cpp/end2end/counted_service.h"
#include "test/cpp/end2end/test_service_impl.h"
-
-#include "src/proto/grpc/lb/v1/load_balancer.grpc.pb.h"
-#include "src/proto/grpc/testing/echo.grpc.pb.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
+#include "test/cpp/util/test_config.h"
// TODO(dgq): Other scenarios in need of testing:
// - Send a serverlist with faulty ip:port addresses (port > 2^16, etc).
@@ -98,42 +96,6 @@ constexpr char kDefaultServiceConfig[] =
" ]\n"
"}";
-template <typename ServiceType>
-class CountedService : public ServiceType {
- public:
- size_t request_count() {
- grpc::internal::MutexLock lock(&mu_);
- return request_count_;
- }
-
- size_t response_count() {
- grpc::internal::MutexLock lock(&mu_);
- return response_count_;
- }
-
- void IncreaseResponseCount() {
- grpc::internal::MutexLock lock(&mu_);
- ++response_count_;
- }
- void IncreaseRequestCount() {
- grpc::internal::MutexLock lock(&mu_);
- ++request_count_;
- }
-
- void ResetCounters() {
- grpc::internal::MutexLock lock(&mu_);
- request_count_ = 0;
- response_count_ = 0;
- }
-
- protected:
- grpc::internal::Mutex mu_;
-
- private:
- size_t request_count_ = 0;
- size_t response_count_ = 0;
-};
-
using BackendService = CountedService<TestServiceImpl>;
using BalancerService = CountedService<LoadBalancer::Service>;
@@ -175,9 +137,8 @@ class BackendServiceImpl : public BackendService {
clients_.insert(client);
}
- grpc::internal::Mutex mu_;
grpc::internal::Mutex clients_mu_;
- std::set<TString> clients_;
+ std::set<TString> clients_ Y_ABSL_GUARDED_BY(&clients_mu_);
};
TString Ip4ToPackedString(const char* ip_str) {
@@ -274,8 +235,9 @@ class BalancerServiceImpl : public BalancerService {
}
{
grpc::internal::MutexLock lock(&mu_);
- grpc::internal::WaitUntil(&serverlist_cond_, &mu_,
- [this] { return serverlist_done_; });
+ while (!serverlist_done_) {
+ serverlist_cond_.Wait(&mu_);
+ }
}
if (client_load_reporting_interval_seconds_ > 0) {
@@ -304,7 +266,7 @@ class BalancerServiceImpl : public BalancerService {
// below from firing before its corresponding wait is executed.
grpc::internal::MutexLock lock(&mu_);
load_report_queue_.emplace_back(std::move(load_report));
- if (load_report_cond_ != nullptr) load_report_cond_->Signal();
+ load_report_cond_.Signal();
}
}
}
@@ -332,12 +294,10 @@ class BalancerServiceImpl : public BalancerService {
ClientStats WaitForLoadReport() {
grpc::internal::MutexLock lock(&mu_);
- grpc::internal::CondVar cv;
if (load_report_queue_.empty()) {
- load_report_cond_ = &cv;
- grpc::internal::WaitUntil(load_report_cond_, &mu_,
- [this] { return !load_report_queue_.empty(); });
- load_report_cond_ = nullptr;
+ while (load_report_queue_.empty()) {
+ load_report_cond_.Wait(&mu_);
+ }
}
ClientStats load_report = std::move(load_report_queue_.front());
load_report_queue_.pop_front();
@@ -376,9 +336,9 @@ class BalancerServiceImpl : public BalancerService {
grpc::internal::Mutex mu_;
grpc::internal::CondVar serverlist_cond_;
- bool serverlist_done_ = false;
- grpc::internal::CondVar* load_report_cond_ = nullptr;
- std::deque<ClientStats> load_report_queue_;
+ bool serverlist_done_ Y_ABSL_GUARDED_BY(mu_) = false;
+ grpc::internal::CondVar load_report_cond_;
+ std::deque<ClientStats> load_report_queue_ Y_ABSL_GUARDED_BY(mu_);
};
class GrpclbEnd2endTest : public ::testing::Test {
@@ -444,7 +404,8 @@ class GrpclbEnd2endTest : public ::testing::Test {
void ShutdownBackend(size_t index) { backends_[index]->Shutdown(); }
void ResetStub(int fallback_timeout = 0,
- const TString& expected_targets = "") {
+ const TString& expected_targets = "",
+ int subchannel_cache_delay_ms = 0) {
ChannelArguments args;
if (fallback_timeout > 0) args.SetGrpclbFallbackTimeout(fallback_timeout);
args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
@@ -452,6 +413,10 @@ class GrpclbEnd2endTest : public ::testing::Test {
if (!expected_targets.empty()) {
args.SetString(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_targets);
}
+ if (subchannel_cache_delay_ms > 0) {
+ args.SetInt(GRPC_ARG_GRPCLB_SUBCHANNEL_CACHE_INTERVAL_MS,
+ subchannel_cache_delay_ms);
+ }
std::ostringstream uri;
uri << "fake:///" << kApplicationTargetName_;
// TODO(dgq): templatize tests to run everything using both secure and
@@ -495,7 +460,7 @@ class GrpclbEnd2endTest : public ::testing::Test {
if (status.ok()) {
++*num_ok;
} else {
- if (status.error_message() == "Call dropped by load balancing policy") {
+ if (status.error_message() == "drop directed by grpclb balancer") {
++*num_drops;
} else {
++*num_failure;
@@ -548,8 +513,9 @@ class GrpclbEnd2endTest : public ::testing::Test {
GPR_ASSERT(lb_uri.ok());
grpc_resolved_address address;
GPR_ASSERT(grpc_parse_uri(*lb_uri, &address));
- grpc_arg arg = grpc_core::CreateAuthorityOverrideChannelArg(
- addr.balancer_name.c_str());
+ grpc_arg arg = grpc_channel_arg_string_create(
+ const_cast<char*>(GRPC_ARG_DEFAULT_AUTHORITY),
+ const_cast<char*>(addr.balancer_name.c_str()));
grpc_channel_args* args =
grpc_channel_args_copy_and_add(nullptr, &arg, 1);
addresses.emplace_back(address.addr, address.len, args);
@@ -564,7 +530,7 @@ class GrpclbEnd2endTest : public ::testing::Test {
grpc_core::Resolver::Result result;
result.addresses =
CreateLbAddressesFromAddressDataList(backend_address_data);
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
result.service_config =
grpc_core::ServiceConfig::Create(nullptr, service_config_json, &error);
GPR_ASSERT(error == GRPC_ERROR_NONE);
@@ -783,6 +749,52 @@ TEST_F(SingleBalancerTest, Vanilla) {
EXPECT_EQ("grpclb", channel_->GetLoadBalancingPolicyName());
}
+TEST_F(SingleBalancerTest, SubchannelCaching) {
+ ResetStub(/*fallback_timeout=*/0, /*expected_targets=*/"",
+ /*subchannel_cache_delay_ms=*/1500);
+ SetNextResolutionAllBalancers();
+ // Initially send all backends.
+ ScheduleResponseForBalancer(
+ 0, BuildResponseForBackends(GetBackendPorts(), {}), 0);
+ // Then remove backends 0 and 1.
+ ScheduleResponseForBalancer(
+ 0, BuildResponseForBackends(GetBackendPorts(2), {}), 1000);
+ // Now re-add backend 1.
+ ScheduleResponseForBalancer(
+ 0, BuildResponseForBackends(GetBackendPorts(1), {}), 1000);
+ // Wait for all backends to come online.
+ WaitForAllBackends();
+ // Send RPCs for long enough to get all responses.
+ gpr_timespec deadline = grpc_timeout_milliseconds_to_deadline(3000);
+ do {
+ CheckRpcSendOk();
+ } while (gpr_time_cmp(gpr_now(GPR_CLOCK_MONOTONIC), deadline) < 0);
+ // Backend 0 should have received less traffic than the others.
+ // Backend 1 would have received less traffic than 2 and 3.
+ gpr_log(GPR_INFO, "BACKEND 0: %" PRIuPTR " requests",
+ backends_[0]->service_.request_count());
+ EXPECT_GT(backends_[0]->service_.request_count(), 0);
+ for (size_t i = 1; i < backends_.size(); ++i) {
+ gpr_log(GPR_INFO, "BACKEND %" PRIuPTR ": %" PRIuPTR " requests", i,
+ backends_[i]->service_.request_count());
+ EXPECT_GT(backends_[i]->service_.request_count(),
+ backends_[0]->service_.request_count())
+ << "backend " << i;
+ if (i >= 2) {
+ EXPECT_GT(backends_[i]->service_.request_count(),
+ backends_[1]->service_.request_count())
+ << "backend " << i;
+ }
+ }
+ // Backend 1 should never have lost its connection from the client.
+ EXPECT_EQ(1UL, backends_[1]->service_.clients().size());
+ balancers_[0]->service_.NotifyDoneWithServerlists();
+ // The balancer got a single request.
+ EXPECT_EQ(1U, balancers_[0]->service_.request_count());
+ // And sent 3 responses.
+ EXPECT_EQ(3U, balancers_[0]->service_.response_count());
+}
+
TEST_F(SingleBalancerTest, ReturnServerStatus) {
SetNextResolutionAllBalancers();
ScheduleResponseForBalancer(
@@ -959,7 +971,7 @@ TEST_F(SingleBalancerTest, SecureNaming) {
}
TEST_F(SingleBalancerTest, SecureNamingDeathTest) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+ GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
// Make sure that we blow up (via abort() from the security connector) when
// the name from the balancer doesn't match expectations.
ASSERT_DEATH_IF_SUPPORTED(
@@ -1781,7 +1793,7 @@ TEST_F(SingleBalancerTest, Drop) {
EchoResponse response;
const Status status = SendRpc(&response);
if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
+ status.error_message() == "drop directed by grpclb balancer") {
++num_drops;
} else {
EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
@@ -1813,7 +1825,7 @@ TEST_F(SingleBalancerTest, DropAllFirst) {
0);
const Status status = SendRpc(nullptr, 1000, true);
EXPECT_FALSE(status.ok());
- EXPECT_EQ(status.error_message(), "Call dropped by load balancing policy");
+ EXPECT_EQ(status.error_message(), "drop directed by grpclb balancer");
}
TEST_F(SingleBalancerTest, DropAll) {
@@ -1838,7 +1850,7 @@ TEST_F(SingleBalancerTest, DropAll) {
status = SendRpc(nullptr, 1000, true);
} while (status.ok());
EXPECT_FALSE(status.ok());
- EXPECT_EQ(status.error_message(), "Call dropped by load balancing policy");
+ EXPECT_EQ(status.error_message(), "drop directed by grpclb balancer");
}
class SingleBalancerWithClientLoadReportingTest : public GrpclbEnd2endTest {
@@ -1970,7 +1982,7 @@ TEST_F(SingleBalancerWithClientLoadReportingTest, Drop) {
EchoResponse response;
const Status status = SendRpc(&response);
if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
+ status.error_message() == "drop directed by grpclb balancer") {
++num_drops;
} else {
EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
diff --git a/contrib/libs/grpc/test/cpp/end2end/health_service_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/health_service_end2end_test.cc
index 516b3a4c815..7fad60ddedd 100644
--- a/contrib/libs/grpc/test/cpp/end2end/health_service_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/health_service_end2end_test.cc
@@ -21,6 +21,8 @@
#include <thread>
#include <vector>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/channel.h>
@@ -40,8 +42,6 @@
#include "test/cpp/end2end/test_health_check_service_impl.h"
#include "test/cpp/end2end/test_service_impl.h"
-#include <gtest/gtest.h>
-
using grpc::health::v1::Health;
using grpc::health::v1::HealthCheckRequest;
using grpc::health::v1::HealthCheckResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/hybrid_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/hybrid_end2end_test.cc
index 4c9896522e5..72b3213bac3 100644
--- a/contrib/libs/grpc/test/cpp/end2end/hybrid_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/hybrid_end2end_test.cc
@@ -19,6 +19,8 @@
#include <memory>
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
@@ -37,18 +39,10 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
namespace {
-#ifndef GRPC_CALLBACK_API_NONEXPERIMENTAL
-using ::grpc::experimental::CallbackGenericService;
-using ::grpc::experimental::GenericCallbackServerContext;
-using ::grpc::experimental::ServerGenericBidiReactor;
-#endif
-
void* tag(int i) { return reinterpret_cast<void*>(i); }
bool VerifyReturnSuccess(CompletionQueue* cq, int i) {
@@ -273,12 +267,7 @@ class HybridEnd2endTest : public ::testing::TestWithParam<bool> {
builder.RegisterAsyncGenericService(generic_service);
}
if (callback_generic_service) {
-#ifdef GRPC_CALLBACK_API_NONEXPERIMENTAL
builder.RegisterCallbackGenericService(callback_generic_service);
-#else
- builder.experimental().RegisterCallbackGenericService(
- callback_generic_service);
-#endif
}
if (max_message_size != 0) {
diff --git a/contrib/libs/grpc/test/cpp/end2end/interceptors_util.cc b/contrib/libs/grpc/test/cpp/end2end/interceptors_util.cc
index ca22077a5c9..b6369347507 100644
--- a/contrib/libs/grpc/test/cpp/end2end/interceptors_util.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/interceptors_util.cc
@@ -29,8 +29,9 @@ std::atomic<int> PhonyInterceptor::num_times_run_;
std::atomic<int> PhonyInterceptor::num_times_run_reverse_;
std::atomic<int> PhonyInterceptor::num_times_cancel_;
-void MakeCall(const std::shared_ptr<Channel>& channel) {
- auto stub = grpc::testing::EchoTestService::NewStub(channel);
+void MakeCall(const std::shared_ptr<Channel>& channel,
+ const StubOptions& options) {
+ auto stub = grpc::testing::EchoTestService::NewStub(channel, options);
ClientContext ctx;
EchoRequest req;
req.mutable_param()->set_echo_metadata(true);
@@ -166,14 +167,13 @@ void MakeCallbackCall(const std::shared_ptr<Channel>& channel) {
ctx.AddMetadata("testkey", "testvalue");
req.set_message("Hello");
EchoResponse resp;
- stub->experimental_async()->Echo(&ctx, &req, &resp,
- [&resp, &mu, &done, &cv](Status s) {
- EXPECT_EQ(s.ok(), true);
- EXPECT_EQ(resp.message(), "Hello");
- std::lock_guard<std::mutex> l(mu);
- done = true;
- cv.notify_one();
- });
+ stub->async()->Echo(&ctx, &req, &resp, [&resp, &mu, &done, &cv](Status s) {
+ EXPECT_EQ(s.ok(), true);
+ EXPECT_EQ(resp.message(), "Hello");
+ std::lock_guard<std::mutex> l(mu);
+ done = true;
+ cv.notify_one();
+ });
std::unique_lock<std::mutex> l(mu);
while (!done) {
cv.wait(l);
diff --git a/contrib/libs/grpc/test/cpp/end2end/interceptors_util.h b/contrib/libs/grpc/test/cpp/end2end/interceptors_util.h
index d0c91ea9b7e..3603fa2a14b 100644
--- a/contrib/libs/grpc/test/cpp/end2end/interceptors_util.h
+++ b/contrib/libs/grpc/test/cpp/end2end/interceptors_util.h
@@ -18,13 +18,13 @@
#include <condition_variable>
+#include <gtest/gtest.h>
+
#include <grpcpp/channel.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/string_ref_helper.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
/* This interceptor does nothing. Just keeps a global count on the number of
@@ -82,6 +82,42 @@ class PhonyInterceptorFactory
}
};
+/* This interceptor can be used to test the interception mechanism. */
+class TestInterceptor : public experimental::Interceptor {
+ public:
+ TestInterceptor(const TString& method, const char* suffix_for_stats,
+ experimental::ClientRpcInfo* info) {
+ EXPECT_EQ(info->method(), method);
+
+ if (suffix_for_stats == nullptr || info->suffix_for_stats() == nullptr) {
+ EXPECT_EQ(info->suffix_for_stats(), suffix_for_stats);
+ } else {
+ EXPECT_EQ(strcmp(info->suffix_for_stats(), suffix_for_stats), 0);
+ }
+ }
+
+ void Intercept(experimental::InterceptorBatchMethods* methods) override {
+ methods->Proceed();
+ }
+};
+
+class TestInterceptorFactory
+ : public experimental::ClientInterceptorFactoryInterface {
+ public:
+ TestInterceptorFactory(const TString& method,
+ const char* suffix_for_stats)
+ : method_(method), suffix_for_stats_(suffix_for_stats) {}
+
+ experimental::Interceptor* CreateClientInterceptor(
+ experimental::ClientRpcInfo* info) override {
+ return new TestInterceptor(method_, suffix_for_stats_, info);
+ }
+
+ private:
+ TString method_;
+ const char* suffix_for_stats_;
+};
+
/* This interceptor factory returns nullptr on interceptor creation */
class NullInterceptorFactory
: public experimental::ClientInterceptorFactoryInterface,
@@ -164,7 +200,8 @@ class EchoTestServiceStreamingImpl : public EchoTestService::Service {
constexpr int kNumStreamingMessages = 10;
-void MakeCall(const std::shared_ptr<Channel>& channel);
+void MakeCall(const std::shared_ptr<Channel>& channel,
+ const StubOptions& options = StubOptions());
void MakeClientStreamingCall(const std::shared_ptr<Channel>& channel);
diff --git a/contrib/libs/grpc/test/cpp/end2end/message_allocator_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/message_allocator_end2end_test.cc
index d6a1444501d..04b8be75b87 100644
--- a/contrib/libs/grpc/test/cpp/end2end/message_allocator_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/message_allocator_end2end_test.cc
@@ -26,10 +26,9 @@
#include <thread>
#include <google/protobuf/arena.h>
-
-#include <grpc/impl/codegen/log.h>
#include <gtest/gtest.h>
+#include <grpc/impl/codegen/log.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
@@ -49,21 +48,20 @@ namespace grpc {
namespace testing {
namespace {
-class CallbackTestServiceImpl
- : public EchoTestService::ExperimentalCallbackService {
+class CallbackTestServiceImpl : public EchoTestService::CallbackService {
public:
explicit CallbackTestServiceImpl() {}
void SetAllocatorMutator(
- std::function<void(experimental::RpcAllocatorState* allocator_state,
+ std::function<void(RpcAllocatorState* allocator_state,
const EchoRequest* req, EchoResponse* resp)>
mutator) {
allocator_mutator_ = std::move(mutator);
}
- experimental::ServerUnaryReactor* Echo(
- experimental::CallbackServerContext* context, const EchoRequest* request,
- EchoResponse* response) override {
+ ServerUnaryReactor* Echo(CallbackServerContext* context,
+ const EchoRequest* request,
+ EchoResponse* response) override {
response->set_message(request->message());
if (allocator_mutator_) {
allocator_mutator_(context->GetRpcAllocatorState(), request, response);
@@ -74,8 +72,8 @@ class CallbackTestServiceImpl
}
private:
- std::function<void(experimental::RpcAllocatorState* allocator_state,
- const EchoRequest* req, EchoResponse* resp)>
+ std::function<void(RpcAllocatorState* allocator_state, const EchoRequest* req,
+ EchoResponse* resp)>
allocator_mutator_;
};
@@ -90,8 +88,7 @@ class TestScenario {
const TString credentials_type;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{protocol="
<< (scenario.protocol == Protocol::INPROC ? "INPROC" : "TCP")
<< "," << scenario.credentials_type << "}";
@@ -110,8 +107,7 @@ class MessageAllocatorEnd2endTestBase
~MessageAllocatorEnd2endTestBase() override = default;
- void CreateServer(
- experimental::MessageAllocator<EchoRequest, EchoResponse>* allocator) {
+ void CreateServer(MessageAllocator<EchoRequest, EchoResponse>* allocator) {
ServerBuilder builder;
auto server_creds = GetCredentialsProvider()->GetServerCredentials(
@@ -174,7 +170,7 @@ class MessageAllocatorEnd2endTestBase
std::mutex mu;
std::condition_variable cv;
bool done = false;
- stub_->experimental_async()->Echo(
+ stub_->async()->Echo(
&cli_ctx, &request, &response,
[&request, &response, &done, &mu, &cv, val](Status s) {
GPR_ASSERT(s.ok());
@@ -209,11 +205,9 @@ TEST_P(NullAllocatorTest, SimpleRpc) {
class SimpleAllocatorTest : public MessageAllocatorEnd2endTestBase {
public:
- class SimpleAllocator
- : public experimental::MessageAllocator<EchoRequest, EchoResponse> {
+ class SimpleAllocator : public MessageAllocator<EchoRequest, EchoResponse> {
public:
- class MessageHolderImpl
- : public experimental::MessageHolder<EchoRequest, EchoResponse> {
+ class MessageHolderImpl : public MessageHolder<EchoRequest, EchoResponse> {
public:
MessageHolderImpl(std::atomic_int* request_deallocation_count,
std::atomic_int* messages_deallocation_count)
@@ -244,8 +238,7 @@ class SimpleAllocatorTest : public MessageAllocatorEnd2endTestBase {
std::atomic_int* const request_deallocation_count_;
std::atomic_int* const messages_deallocation_count_;
};
- experimental::MessageHolder<EchoRequest, EchoResponse>* AllocateMessages()
- override {
+ MessageHolder<EchoRequest, EchoResponse>* AllocateMessages() override {
allocation_count++;
return new MessageHolderImpl(&request_deallocation_count,
&messages_deallocation_count);
@@ -273,8 +266,8 @@ TEST_P(SimpleAllocatorTest, SimpleRpc) {
TEST_P(SimpleAllocatorTest, RpcWithEarlyFreeRequest) {
const int kRpcCount = 10;
std::unique_ptr<SimpleAllocator> allocator(new SimpleAllocator);
- auto mutator = [](experimental::RpcAllocatorState* allocator_state,
- const EchoRequest* req, EchoResponse* resp) {
+ auto mutator = [](RpcAllocatorState* allocator_state, const EchoRequest* req,
+ EchoResponse* resp) {
auto* info =
static_cast<SimpleAllocator::MessageHolderImpl*>(allocator_state);
EXPECT_EQ(req, info->request());
@@ -298,9 +291,9 @@ TEST_P(SimpleAllocatorTest, RpcWithReleaseRequest) {
const int kRpcCount = 10;
std::unique_ptr<SimpleAllocator> allocator(new SimpleAllocator);
std::vector<EchoRequest*> released_requests;
- auto mutator = [&released_requests](
- experimental::RpcAllocatorState* allocator_state,
- const EchoRequest* req, EchoResponse* resp) {
+ auto mutator = [&released_requests](RpcAllocatorState* allocator_state,
+ const EchoRequest* req,
+ EchoResponse* resp) {
auto* info =
static_cast<SimpleAllocator::MessageHolderImpl*>(allocator_state);
EXPECT_EQ(req, info->request());
@@ -326,11 +319,9 @@ TEST_P(SimpleAllocatorTest, RpcWithReleaseRequest) {
class ArenaAllocatorTest : public MessageAllocatorEnd2endTestBase {
public:
- class ArenaAllocator
- : public experimental::MessageAllocator<EchoRequest, EchoResponse> {
+ class ArenaAllocator : public MessageAllocator<EchoRequest, EchoResponse> {
public:
- class MessageHolderImpl
- : public experimental::MessageHolder<EchoRequest, EchoResponse> {
+ class MessageHolderImpl : public MessageHolder<EchoRequest, EchoResponse> {
public:
MessageHolderImpl() {
set_request(
@@ -344,8 +335,7 @@ class ArenaAllocatorTest : public MessageAllocatorEnd2endTestBase {
private:
google::protobuf::Arena arena_;
};
- experimental::MessageHolder<EchoRequest, EchoResponse>* AllocateMessages()
- override {
+ MessageHolder<EchoRequest, EchoResponse>* AllocateMessages() override {
allocation_count++;
return new MessageHolderImpl;
}
diff --git a/contrib/libs/grpc/test/cpp/end2end/mock_test.cc b/contrib/libs/grpc/test/cpp/end2end/mock_test.cc
index da3f48fa64a..dc4b34e21de 100644
--- a/contrib/libs/grpc/test/cpp/end2end/mock_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/mock_test.cc
@@ -17,6 +17,12 @@
*/
#include <climits>
+#include <iostream>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "y_absl/types/optional.h"
#include <grpc/grpc.h>
#include <grpc/support/log.h>
@@ -28,6 +34,7 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
#include <grpcpp/test/default_reactor_test_peer.h>
+#include <grpcpp/test/mock_stream.h>
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -35,13 +42,6 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-#include <grpcpp/test/mock_stream.h>
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <iostream>
-
using grpc::testing::DefaultReactorTestPeer;
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
@@ -160,12 +160,11 @@ class FakeClient {
EchoTestService::StubInterface* stub_;
};
-class CallbackTestServiceImpl
- : public EchoTestService::ExperimentalCallbackService {
+class CallbackTestServiceImpl : public EchoTestService::CallbackService {
public:
- experimental::ServerUnaryReactor* Echo(
- experimental::CallbackServerContext* context, const EchoRequest* request,
- EchoResponse* response) override {
+ ServerUnaryReactor* Echo(CallbackServerContext* context,
+ const EchoRequest* request,
+ EchoResponse* response) override {
// Make the mock service explicitly treat empty input messages as invalid
// arguments so that we can test various results of status. In general, a
// mocked service should just use the original service methods, but we are
@@ -189,36 +188,38 @@ class MockCallbackTest : public ::testing::Test {
};
TEST_F(MockCallbackTest, MockedCallSucceedsWithWait) {
- experimental::CallbackServerContext ctx;
+ CallbackServerContext ctx;
EchoRequest req;
EchoResponse resp;
- grpc::internal::Mutex mu;
- grpc::internal::CondVar cv;
- grpc::Status status;
- bool status_set = false;
+ struct {
+ grpc::internal::Mutex mu;
+ grpc::internal::CondVar cv;
+ y_absl::optional<grpc::Status> Y_ABSL_GUARDED_BY(mu) status;
+ } status;
DefaultReactorTestPeer peer(&ctx, [&](::grpc::Status s) {
- grpc::internal::MutexLock l(&mu);
- status_set = true;
- status = std::move(s);
- cv.Signal();
+ grpc::internal::MutexLock l(&status.mu);
+ status.status = std::move(s);
+ status.cv.Signal();
});
req.set_message("mock 1");
auto* reactor = service_.Echo(&ctx, &req, &resp);
- grpc::internal::WaitUntil(&cv, &mu, [&] {
- grpc::internal::MutexLock l(&mu);
- return status_set;
- });
+
+ grpc::internal::MutexLock l(&status.mu);
+ while (!status.status.has_value()) {
+ status.cv.Wait(&status.mu);
+ }
+
EXPECT_EQ(reactor, peer.reactor());
EXPECT_TRUE(peer.test_status_set());
EXPECT_TRUE(peer.test_status().ok());
- EXPECT_TRUE(status_set);
- EXPECT_TRUE(status.ok());
+ EXPECT_TRUE(status.status.has_value());
+ EXPECT_TRUE(status.status.value().ok());
EXPECT_EQ(req.message(), resp.message());
}
TEST_F(MockCallbackTest, MockedCallSucceeds) {
- experimental::CallbackServerContext ctx;
+ CallbackServerContext ctx;
EchoRequest req;
EchoResponse resp;
DefaultReactorTestPeer peer(&ctx);
@@ -231,7 +232,7 @@ TEST_F(MockCallbackTest, MockedCallSucceeds) {
}
TEST_F(MockCallbackTest, MockedCallFails) {
- experimental::CallbackServerContext ctx;
+ CallbackServerContext ctx;
EchoRequest req;
EchoResponse resp;
DefaultReactorTestPeer peer(&ctx);
diff --git a/contrib/libs/grpc/test/cpp/end2end/nonblocking_test.cc b/contrib/libs/grpc/test/cpp/end2end/nonblocking_test.cc
index 73e8fa2e719..392e7de21e2 100644
--- a/contrib/libs/grpc/test/cpp/end2end/nonblocking_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/nonblocking_test.cc
@@ -18,6 +18,8 @@
#include <memory>
+#include "y_absl/memory/memory.h"
+
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
@@ -25,8 +27,6 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/lib/gpr/tls.h"
#include "src/core/lib/iomgr/port.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -44,7 +44,7 @@
// non-blocking (not polls from resolver, timer thread, etc), and only when the
// thread is waiting on polls caused by CompletionQueue::AsyncNext (not for
// picking a port or other reasons).
-GPR_TLS_DECL(g_is_nonblocking_poll);
+static GPR_THREAD_LOCAL(bool) g_is_nonblocking_poll;
namespace {
@@ -52,7 +52,7 @@ int maybe_assert_non_blocking_poll(struct pollfd* pfds, nfds_t nfds,
int timeout) {
// Only assert that this poll should have zero timeout if we're in the
// middle of a zero-timeout CQ Next.
- if (gpr_tls_get(&g_is_nonblocking_poll)) {
+ if (g_is_nonblocking_poll) {
GPR_ASSERT(timeout == 0);
}
return poll(pfds, nfds, timeout);
@@ -82,15 +82,15 @@ class NonblockingTest : public ::testing::Test {
bool LoopForTag(void** tag, bool* ok) {
// Temporarily set the thread-local nonblocking poll flag so that the polls
// caused by this loop are indeed sent by the library with zero timeout.
- intptr_t orig_val = gpr_tls_get(&g_is_nonblocking_poll);
- gpr_tls_set(&g_is_nonblocking_poll, static_cast<intptr_t>(true));
+ bool orig_val = g_is_nonblocking_poll;
+ g_is_nonblocking_poll = true;
for (;;) {
auto r = cq_->AsyncNext(tag, ok, gpr_time_0(GPR_CLOCK_REALTIME));
if (r == CompletionQueue::SHUTDOWN) {
- gpr_tls_set(&g_is_nonblocking_poll, orig_val);
+ g_is_nonblocking_poll = orig_val;
return false;
} else if (r == CompletionQueue::GOT_EVENT) {
- gpr_tls_set(&g_is_nonblocking_poll, orig_val);
+ g_is_nonblocking_poll = orig_val;
return true;
}
}
@@ -201,15 +201,14 @@ int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
- gpr_tls_init(&g_is_nonblocking_poll);
// Start the nonblocking poll thread-local variable as false because the
// thread that issues RPCs starts by picking a port (which has non-zero
// timeout).
- gpr_tls_set(&g_is_nonblocking_poll, static_cast<intptr_t>(false));
+ g_is_nonblocking_poll = false;
int ret = RUN_ALL_TESTS();
- gpr_tls_destroy(&g_is_nonblocking_poll);
+
return ret;
#else // GRPC_POSIX_SOCKET
(void)argc;
diff --git a/contrib/libs/grpc/test/cpp/end2end/port_sharing_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/port_sharing_end2end_test.cc
index b69d1dd2be7..96ecc4cc76b 100644
--- a/contrib/libs/grpc/test/cpp/end2end/port_sharing_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/port_sharing_end2end_test.cc
@@ -16,6 +16,11 @@
*
*/
+#include <mutex>
+#include <thread>
+
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -28,10 +33,6 @@
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include <gtest/gtest.h>
-
-#include <mutex>
-#include <thread>
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/endpoint.h"
@@ -70,8 +71,7 @@ class TestScenario {
const TString credentials_type;
};
-static std::ostream& operator<<(std::ostream& out,
- const TestScenario& scenario) {
+std::ostream& operator<<(std::ostream& out, const TestScenario& scenario) {
return out << "TestScenario{server_has_port="
<< (scenario.server_has_port ? "true" : "false")
<< ", queue_pending_data="
@@ -148,7 +148,7 @@ class TestTcpServer {
self->OnConnect(tcp, accepting_pollset, acceptor);
}
- static void OnFdReleased(void* arg, grpc_error* err) {
+ static void OnFdReleased(void* arg, grpc_error_handle err) {
auto* self = static_cast<TestTcpServer*>(arg);
self->OnFdReleased(err);
}
@@ -165,7 +165,7 @@ class TestTcpServer {
grpc_tcp_destroy_and_release_fd(tcp, &fd_, &on_fd_released_);
}
- void OnFdReleased(grpc_error* err) {
+ void OnFdReleased(grpc_error_handle err) {
EXPECT_EQ(GRPC_ERROR_NONE, err);
experimental::ExternalConnectionAcceptor::NewConnectionParameters p;
p.listener_fd = listener_fd_;
@@ -294,7 +294,7 @@ class PortSharingEnd2endTest : public ::testing::TestWithParam<TestScenario> {
int first_picked_port_;
};
-static void SendRpc(EchoTestService::Stub* stub, int num_rpcs) {
+void SendRpc(EchoTestService::Stub* stub, int num_rpcs) {
EchoRequest request;
EchoResponse response;
request.set_message("Hello hello hello hello");
diff --git a/contrib/libs/grpc/test/cpp/end2end/proto_server_reflection_test.cc b/contrib/libs/grpc/test/cpp/end2end/proto_server_reflection_test.cc
index 44b8f9211ed..b9a0c6e8b91 100644
--- a/contrib/libs/grpc/test/cpp/end2end/proto_server_reflection_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/proto_server_reflection_test.cc
@@ -16,6 +16,10 @@
*
*/
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
@@ -27,16 +31,12 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/proto_reflection_descriptor_database.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
diff --git a/contrib/libs/grpc/test/cpp/end2end/raw_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/raw_end2end_test.cc
index d6300ecad66..e0c29cd61bb 100644
--- a/contrib/libs/grpc/test/cpp/end2end/raw_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/raw_end2end_test.cc
@@ -20,6 +20,8 @@
#include <memory>
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -40,8 +42,6 @@
#include "test/cpp/util/byte_buffer_proto_helper.h"
#include "test/cpp/util/string_ref_helper.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/rls_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/rls_end2end_test.cc
new file mode 100644
index 00000000000..d383761a29b
--- /dev/null
+++ b/contrib/libs/grpc/test/cpp/end2end/rls_end2end_test.cc
@@ -0,0 +1,1458 @@
+//
+// Copyright 2020 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// FIXME: add tests:
+// - cache eviction via cleanup timer (based on age)
+// - RLS channel is down; wait_for_ready request is sent and RLS request fails
+// and goes into backoff; RLS channel comes back up before backoff timer
+// fires; request is processed at that point
+
+#include <deque>
+#include <map>
+#include <thread>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include "y_absl/strings/str_format.h"
+#include "y_absl/strings/str_join.h"
+#include "y_absl/types/optional.h"
+
+#include <grpcpp/channel.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/security/credentials.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/support/channel_arguments.h>
+
+#include "src/core/ext/filters/client_channel/backup_poller.h"
+#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
+#include "src/core/lib/address_utils/parse_address.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/gpr/env.h"
+#include "src/core/lib/gprpp/host_port.h"
+#include "src/core/lib/iomgr/sockaddr.h"
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/core/lib/uri/uri_parser.h"
+#include "src/cpp/client/secure_credentials.h"
+#include "src/cpp/server/secure_server_credentials.h"
+#include "src/proto/grpc/lookup/v1/rls.grpc.pb.h"
+#include "src/proto/grpc/lookup/v1/rls.pb.h"
+#include "src/proto/grpc/testing/echo.grpc.pb.h"
+#include "test/core/util/port.h"
+#include "test/core/util/resolve_localhost_ip46.h"
+#include "test/core/util/test_config.h"
+#include "test/core/util/test_lb_policies.h"
+#include "test/cpp/end2end/counted_service.h"
+#include "test/cpp/end2end/test_service_impl.h"
+#include "test/cpp/util/test_config.h"
+
+using ::grpc::lookup::v1::RouteLookupRequest;
+using ::grpc::lookup::v1::RouteLookupResponse;
+
+namespace grpc {
+namespace testing {
+namespace {
+
+const char* kServerName = "test.google.fr";
+const char* kRequestMessage = "Live long and prosper.";
+
+const char* kCallCredsMdKey = "call_cred_name";
+const char* kCallCredsMdValue = "call_cred_value";
+
+const char* kTestKey = "test_key";
+const char* kTestValue = "test_value";
+const char* kHostKey = "host_key";
+const char* kServiceKey = "service_key";
+const char* kServiceValue = "grpc.testing.EchoTestService";
+const char* kMethodKey = "method_key";
+const char* kMethodValue = "Echo";
+const char* kConstantKey = "constant_key";
+const char* kConstantValue = "constant_value";
+
+using BackendService = CountedService<TestServiceImpl>;
+using RlsService =
+ CountedService<grpc::lookup::v1::RouteLookupService::Service>;
+
+class RlsServiceImpl : public RlsService {
+ public:
+ ::grpc::Status RouteLookup(::grpc::ServerContext* context,
+ const RouteLookupRequest* request,
+ RouteLookupResponse* response) override {
+ gpr_log(GPR_INFO, "RLS: Received request: %s",
+ request->DebugString().c_str());
+ // RLS server should see call creds.
+ EXPECT_THAT(context->client_metadata(),
+ ::testing::Contains(
+ ::testing::Pair(kCallCredsMdKey, kCallCredsMdValue)));
+ IncreaseRequestCount();
+ EXPECT_EQ(request->target_type(), "grpc");
+ // See if we have a configured response for this request.
+ ResponseData res;
+ {
+ grpc::internal::MutexLock lock(&mu_);
+ auto it = responses_.find(*request);
+ if (it == responses_.end()) {
+ gpr_log(GPR_INFO, "RLS: no matching request, returning INTERNAL");
+ unmatched_requests_.push_back(*request);
+ return Status(StatusCode::INTERNAL, "no response entry");
+ }
+ res = it->second;
+ }
+ // Configured response found, so use it.
+ if (res.response_delay > 0) {
+ gpr_sleep_until(
+ grpc_timeout_milliseconds_to_deadline(res.response_delay));
+ }
+ IncreaseResponseCount();
+ *response = res.response;
+ gpr_log(GPR_INFO, "RLS: returning configured response: %s",
+ response->DebugString().c_str());
+ return Status::OK;
+ }
+
+ void Start() {}
+
+ void Shutdown() {}
+
+ void SetResponse(RouteLookupRequest request, RouteLookupResponse response,
+ grpc_millis response_delay = 0) {
+ grpc::internal::MutexLock lock(&mu_);
+ responses_[std::move(request)] = {std::move(response), response_delay};
+ }
+
+ void RemoveResponse(const RouteLookupRequest& request) {
+ grpc::internal::MutexLock lock(&mu_);
+ responses_.erase(request);
+ }
+
+ std::vector<RouteLookupRequest> GetUnmatchedRequests() {
+ grpc::internal::MutexLock lock(&mu_);
+ return std::move(unmatched_requests_);
+ }
+
+ private:
+ // Sorting thunk for RouteLookupRequest.
+ struct RlsRequestLessThan {
+ bool operator()(const RouteLookupRequest& req1,
+ const RouteLookupRequest& req2) const {
+ std::map<y_absl::string_view, y_absl::string_view> key_map1(
+ req1.key_map().begin(), req1.key_map().end());
+ std::map<y_absl::string_view, y_absl::string_view> key_map2(
+ req2.key_map().begin(), req2.key_map().end());
+ if (key_map1 < key_map2) return true;
+ if (req1.reason() < req2.reason()) return true;
+ if (req1.stale_header_data() < req2.stale_header_data()) return true;
+ return false;
+ }
+ };
+
+ struct ResponseData {
+ RouteLookupResponse response;
+ grpc_millis response_delay;
+ };
+
+ grpc::internal::Mutex mu_;
+ std::map<RouteLookupRequest, ResponseData, RlsRequestLessThan> responses_
+ Y_ABSL_GUARDED_BY(&mu_);
+ std::vector<RouteLookupRequest> unmatched_requests_ Y_ABSL_GUARDED_BY(&mu_);
+};
+
+// Subclass of TestServiceImpl that increments a request counter for
+// every call to the Echo Rpc.
+class MyTestServiceImpl : public BackendService {
+ public:
+ Status Echo(ServerContext* context, const EchoRequest* request,
+ EchoResponse* response) override {
+ // Backend should see call creds.
+ EXPECT_THAT(context->client_metadata(),
+ ::testing::Contains(
+ ::testing::Pair(kCallCredsMdKey, kCallCredsMdValue)));
+ IncreaseRequestCount();
+ auto client_metadata = context->client_metadata();
+ auto range = client_metadata.equal_range("X-Google-RLS-Data");
+ {
+ grpc::internal::MutexLock lock(&mu_);
+ for (auto it = range.first; it != range.second; ++it) {
+ rls_header_data_.insert(
+ TString(it->second.begin(), it->second.length()));
+ }
+ }
+ IncreaseResponseCount();
+ return TestServiceImpl::Echo(context, request, response);
+ }
+
+ std::set<TString> rls_data() {
+ grpc::internal::MutexLock lock(&mu_);
+ return std::move(rls_header_data_);
+ }
+
+ void Start() {}
+
+ void Shutdown() {}
+
+ private:
+ grpc::internal::Mutex mu_;
+ std::set<TString> rls_header_data_ Y_ABSL_GUARDED_BY(&mu_);
+};
+
+class FakeResolverResponseGeneratorWrapper {
+ public:
+ FakeResolverResponseGeneratorWrapper()
+ : response_generator_(grpc_core::MakeRefCounted<
+ grpc_core::FakeResolverResponseGenerator>()) {}
+
+ void SetNextResolution(y_absl::string_view service_config_json) {
+ grpc_core::ExecCtx exec_ctx;
+ response_generator_->SetResponse(BuildFakeResults(service_config_json));
+ }
+
+ grpc_core::FakeResolverResponseGenerator* Get() const {
+ return response_generator_.get();
+ }
+
+ private:
+ static grpc_core::Resolver::Result BuildFakeResults(
+ y_absl::string_view service_config_json) {
+ grpc_core::Resolver::Result result;
+ result.service_config_error = GRPC_ERROR_NONE;
+ result.service_config = grpc_core::ServiceConfig::Create(
+ result.args, service_config_json, &result.service_config_error);
+ EXPECT_EQ(result.service_config_error, GRPC_ERROR_NONE)
+ << "JSON: " << service_config_json
+ << "Error: " << grpc_error_std_string(result.service_config_error);
+ EXPECT_NE(result.service_config, nullptr);
+ return result;
+ }
+
+ grpc_core::RefCountedPtr<grpc_core::FakeResolverResponseGenerator>
+ response_generator_;
+};
+
+class RlsEnd2endTest : public ::testing::Test {
+ protected:
+ static void SetUpTestSuite() {
+ gpr_setenv("GRPC_EXPERIMENTAL_ENABLE_RLS_LB_POLICY", "true");
+ GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
+ grpc_init();
+ grpc_core::RegisterFixedAddressLoadBalancingPolicy();
+ }
+
+ static void TearDownTestSuite() {
+ grpc_shutdown_blocking();
+ gpr_unsetenv("GRPC_EXPERIMENTAL_ENABLE_RLS_LB_POLICY");
+ }
+
+ void SetUp() override {
+ bool localhost_resolves_to_ipv4 = false;
+ bool localhost_resolves_to_ipv6 = false;
+ grpc_core::LocalhostResolves(&localhost_resolves_to_ipv4,
+ &localhost_resolves_to_ipv6);
+ ipv6_only_ = !localhost_resolves_to_ipv4 && localhost_resolves_to_ipv6;
+ rls_server_ = y_absl::make_unique<ServerThread<RlsServiceImpl>>("rls");
+ rls_server_->Start();
+ resolver_response_generator_ =
+ y_absl::make_unique<FakeResolverResponseGeneratorWrapper>();
+ ResetStub();
+ }
+
+ void TearDown() override {
+ ShutdownBackends();
+ rls_server_->Shutdown();
+ }
+
+ void ResetStub(const char* expected_authority = kServerName) {
+ ChannelArguments args;
+ args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
+ resolver_response_generator_->Get());
+ args.SetString(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS, expected_authority);
+ grpc_channel_credentials* channel_creds =
+ grpc_fake_transport_security_credentials_create();
+ grpc_call_credentials* call_creds = grpc_md_only_test_credentials_create(
+ kCallCredsMdKey, kCallCredsMdValue, false);
+ auto creds = std::make_shared<SecureChannelCredentials>(
+ grpc_composite_channel_credentials_create(channel_creds, call_creds,
+ nullptr));
+ call_creds->Unref();
+ channel_creds->Unref();
+ channel_ = ::grpc::CreateCustomChannel(
+ y_absl::StrCat("fake:///", kServerName).c_str(), std::move(creds), args);
+ stub_ = grpc::testing::EchoTestService::NewStub(channel_);
+ }
+
+ void ShutdownBackends() {
+ for (auto& server : backends_) {
+ server->Shutdown();
+ }
+ }
+
+ void StartBackends(size_t num_servers) {
+ backends_.clear();
+ for (size_t i = 0; i < num_servers; ++i) {
+ backends_.push_back(
+ y_absl::make_unique<ServerThread<MyTestServiceImpl>>("backend"));
+ backends_.back()->Start();
+ }
+ }
+
+ TString TargetStringForPort(int port) {
+ if (ipv6_only_) return y_absl::StrCat("ipv6:[::1]:", port);
+ return y_absl::StrCat("ipv4:127.0.0.1:", port);
+ }
+
+ static RouteLookupRequest BuildRlsRequest(
+ std::map<TString, TString> key,
+ RouteLookupRequest::Reason reason = RouteLookupRequest::REASON_MISS,
+ const char* stale_header_data = "") {
+ RouteLookupRequest request;
+ request.set_target_type("grpc");
+ request.mutable_key_map()->insert(key.begin(), key.end());
+ request.set_reason(reason);
+ request.set_stale_header_data(stale_header_data);
+ return request;
+ }
+
+ static RouteLookupResponse BuildRlsResponse(std::vector<TString> targets,
+ const char* header_data = "") {
+ RouteLookupResponse response;
+ response.mutable_targets()->Add(targets.begin(), targets.end());
+ response.set_header_data(header_data);
+ return response;
+ }
+
+ struct RpcOptions {
+ int timeout_ms = 1000;
+ bool wait_for_ready = false;
+ std::vector<std::pair<TString, TString>> metadata;
+
+ RpcOptions() {}
+
+ RpcOptions& set_timeout_ms(int rpc_timeout_ms) {
+ timeout_ms = rpc_timeout_ms;
+ return *this;
+ }
+
+ RpcOptions& set_wait_for_ready(bool rpc_wait_for_ready) {
+ wait_for_ready = rpc_wait_for_ready;
+ return *this;
+ }
+
+ RpcOptions& set_metadata(
+ std::vector<std::pair<TString, TString>> rpc_metadata) {
+ metadata = std::move(rpc_metadata);
+ return *this;
+ }
+
+ // Populates context.
+ void SetupRpc(ClientContext* context) const {
+ for (const auto& item : metadata) {
+ context->AddMetadata(item.first, item.second);
+ }
+ if (timeout_ms != 0) {
+ context->set_deadline(
+ grpc_timeout_milliseconds_to_deadline(timeout_ms));
+ }
+ if (wait_for_ready) context->set_wait_for_ready(true);
+ }
+ };
+
+ Status SendRpc(const RpcOptions& rpc_options = RpcOptions(),
+ EchoResponse* response = nullptr) {
+ EchoResponse local_response;
+ if (response == nullptr) response = &local_response;
+ ClientContext context;
+ rpc_options.SetupRpc(&context);
+ EchoRequest request;
+ request.set_message(kRequestMessage);
+ return stub_->Echo(&context, request, response);
+ }
+
+ void CheckRpcSendOk(const grpc_core::DebugLocation& location,
+ const RpcOptions& rpc_options = RpcOptions()) {
+ EchoResponse response;
+ Status status = SendRpc(rpc_options, &response);
+ ASSERT_TRUE(status.ok()) << location.file() << ":" << location.line()
+ << ": RPC failed: " << status.error_code() << ": "
+ << status.error_message();
+ EXPECT_EQ(response.message(), kRequestMessage)
+ << location.file() << ":" << location.line();
+ }
+
+ void CheckRpcSendFailure(const grpc_core::DebugLocation& location,
+ const RpcOptions& rpc_options = RpcOptions()) {
+ Status status = SendRpc(rpc_options);
+ ASSERT_FALSE(status.ok()) << location.file() << ":" << location.line();
+ }
+
+ class ServiceConfigBuilder {
+ public:
+ explicit ServiceConfigBuilder(int rls_server_port)
+ : rls_server_port_(rls_server_port) {}
+
+ ServiceConfigBuilder& set_lookup_service_timeout(grpc_millis timeout) {
+ lookup_service_timeout_ = timeout * grpc_test_slowdown_factor();
+ return *this;
+ }
+
+ ServiceConfigBuilder& set_default_target(TString default_target) {
+ default_target_ = std::move(default_target);
+ return *this;
+ }
+
+ ServiceConfigBuilder& set_max_age(grpc_millis max_age) {
+ max_age_ = max_age * grpc_test_slowdown_factor();
+ return *this;
+ }
+
+ ServiceConfigBuilder& set_stale_age(grpc_millis stale_age) {
+ stale_age_ = stale_age * grpc_test_slowdown_factor();
+ return *this;
+ }
+
+ ServiceConfigBuilder& set_cache_size_bytes(int64_t size) {
+ cache_size_bytes_ = size;
+ return *this;
+ }
+
+ ServiceConfigBuilder& AddKeyBuilder(y_absl::string_view key_builder) {
+ key_builders_.push_back(y_absl::StrCat("{", key_builder, "}"));
+ return *this;
+ }
+
+ TString Build() {
+ // First build parts of routeLookupConfig.
+ std::vector<TString> route_lookup_config_parts;
+ route_lookup_config_parts.push_back(y_absl::StrFormat(
+ " \"lookupService\":\"localhost:%d\"", rls_server_port_));
+ if (lookup_service_timeout_ > 0) {
+ route_lookup_config_parts.push_back(y_absl::StrFormat(
+ " \"lookupServiceTimeout\":\"%d.%09ds\"",
+ lookup_service_timeout_ / 1000, lookup_service_timeout_ % 1000));
+ }
+ if (!default_target_.empty()) {
+ route_lookup_config_parts.push_back(y_absl::StrFormat(
+ " \"defaultTarget\":\"%s\"", default_target_));
+ }
+ route_lookup_config_parts.push_back(y_absl::StrFormat(
+ " \"cacheSizeBytes\":%" PRId64, cache_size_bytes_));
+ if (max_age_ > 0) {
+ route_lookup_config_parts.push_back(
+ y_absl::StrFormat(" \"maxAge\":\"%d.%09ds\"", max_age_ / 1000,
+ max_age_ % 1000));
+ }
+ if (stale_age_ > 0) {
+ route_lookup_config_parts.push_back(
+ y_absl::StrFormat(" \"staleAge\":\"%d.%09ds\"",
+ stale_age_ / 1000, stale_age_ % 1000));
+ }
+ if (!key_builders_.empty()) {
+ route_lookup_config_parts.push_back(
+ y_absl::StrFormat(" \"grpcKeybuilders\":[%s]",
+ y_absl::StrJoin(key_builders_, ",")));
+ }
+ // Now build parts of RLS LB policy config.
+ std::vector<TString> rls_config_parts;
+ if (!route_lookup_config_parts.empty()) {
+ rls_config_parts.push_back(y_absl::StrCat(
+ " \"routeLookupConfig\":{",
+ y_absl::StrJoin(route_lookup_config_parts, ","), " }"));
+ }
+ rls_config_parts.push_back(
+ " \"childPolicy\":[{"
+ " \"fixed_address_lb\":{}\n"
+ " }],\n"
+ " \"childPolicyConfigTargetFieldName\":\"address\"\n");
+ // Put it all together.
+ return y_absl::StrCat(
+ "{"
+ " \"loadBalancingConfig\":[{"
+ " \"rls\":{",
+ y_absl::StrJoin(rls_config_parts, ","),
+ " }"
+ " }]"
+ "}");
+ }
+
+ private:
+ int rls_server_port_;
+ grpc_millis lookup_service_timeout_ = 0;
+ TString default_target_;
+ grpc_millis max_age_ = 0;
+ grpc_millis stale_age_ = 0;
+ int64_t cache_size_bytes_ = 10485760;
+ std::vector<TString> key_builders_;
+ };
+
+ ServiceConfigBuilder MakeServiceConfigBuilder() {
+ return ServiceConfigBuilder(rls_server_->port_);
+ }
+
+ void SetNextResolution(y_absl::string_view service_config_json) {
+ resolver_response_generator_->SetNextResolution(service_config_json);
+ }
+
+ template <typename T>
+ struct ServerThread {
+ template <typename... Args>
+ explicit ServerThread(const grpc::string& type, Args&&... args)
+ : port_(grpc_pick_unused_port_or_die()),
+ type_(type),
+ service_(std::forward<Args>(args)...) {}
+
+ void Start() {
+ gpr_log(GPR_INFO, "starting %s server on port %d", type_.c_str(), port_);
+ GPR_ASSERT(!running_);
+ running_ = true;
+ service_.Start();
+ grpc::internal::Mutex mu;
+ // We need to acquire the lock here in order to prevent the notify_one
+ // by ServerThread::Serve from firing before the wait below is hit.
+ grpc::internal::MutexLock lock(&mu);
+ grpc::internal::CondVar cond;
+ thread_ = y_absl::make_unique<std::thread>(
+ std::bind(&ServerThread::Serve, this, &mu, &cond));
+ cond.Wait(&mu);
+ gpr_log(GPR_INFO, "%s server startup complete", type_.c_str());
+ }
+
+ void Serve(grpc::internal::Mutex* mu, grpc::internal::CondVar* cond) {
+ // We need to acquire the lock here in order to prevent the notify_one
+ // below from firing before its corresponding wait is executed.
+ grpc::internal::MutexLock lock(mu);
+ ServerBuilder builder;
+ auto creds = std::make_shared<SecureServerCredentials>(
+ grpc_fake_transport_security_server_credentials_create());
+ builder.AddListeningPort(y_absl::StrCat("localhost:", port_),
+ std::move(creds));
+ builder.RegisterService(&service_);
+ server_ = builder.BuildAndStart();
+ cond->Signal();
+ }
+
+ void Shutdown() {
+ if (!running_) return;
+ gpr_log(GPR_INFO, "%s about to shutdown", type_.c_str());
+ service_.Shutdown();
+ server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0));
+ thread_->join();
+ gpr_log(GPR_INFO, "%s shutdown completed", type_.c_str());
+ running_ = false;
+ }
+
+ const int port_;
+ grpc::string type_;
+ T service_;
+ std::unique_ptr<Server> server_;
+ std::unique_ptr<std::thread> thread_;
+ bool running_ = false;
+ };
+
+ bool ipv6_only_;
+ std::vector<std::unique_ptr<ServerThread<MyTestServiceImpl>>> backends_;
+ std::unique_ptr<ServerThread<RlsServiceImpl>> rls_server_;
+ std::unique_ptr<FakeResolverResponseGeneratorWrapper>
+ resolver_response_generator_;
+ std::shared_ptr<grpc::Channel> channel_;
+ std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
+};
+
+TEST_F(RlsEnd2endTest, Basic) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ // No RLS header seen by the backend, since the RLS response didn't set any.
+ EXPECT_THAT(backends_[0]->service_.rls_data(), ::testing::ElementsAre());
+}
+
+TEST_F(RlsEnd2endTest, DuplicateHeadersAreMerged) {
+ const char* kTestValue2 = "test_value_2";
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, y_absl::StrCat(kTestValue, ",", kTestValue2)}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Same header present twice in the request. Values should be merged.
+ CheckRpcSendOk(
+ DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}, {"key1", kTestValue2}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, SecondHeaderUsed) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\", \"key2\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key2", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, MultipleHeaderKeys) {
+ const char* kTestKey2 = "test_key_2";
+ const char* kTestValue2 = "test_value_2";
+ StartBackends(1);
+ SetNextResolution(MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat(
+ "\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " },"
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key2\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey, kTestKey2))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({
+ {kTestKey, kTestValue},
+ {kTestKey2, kTestValue2},
+ }),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(
+ DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}, {"key2", kTestValue2}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ // No RLS header seen by the backend, since the RLS response didn't set any.
+ EXPECT_THAT(backends_[0]->service_.rls_data(), ::testing::ElementsAre());
+}
+
+TEST_F(RlsEnd2endTest, NoHeaderMatch) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Request does not have header "key1", so kTestKey will not be added.
+ CheckRpcSendOk(DEBUG_LOCATION);
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, WildcardMethod) {
+ StartBackends(1);
+ SetNextResolution(MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, NoKeyBuilderForMethod) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"some_other_method\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION);
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, HeaderData) {
+ const char* kHeaderData = "header_data";
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)},
+ kHeaderData));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ EXPECT_THAT(backends_[0]->service_.rls_data(),
+ ::testing::ElementsAre(kHeaderData));
+}
+
+TEST_F(RlsEnd2endTest, ExtraKeysAndConstantKeys) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\",\"key2\",\"key3\""
+ " ]"
+ " }"
+ "],"
+ "\"extraKeys\":{"
+ " \"host\":\"%s\","
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "},"
+ "\"constantKeys\":{"
+ " \"%s\":\"%s\""
+ "}",
+ kServiceValue, kMethodValue, kTestKey,
+ kHostKey, kServiceKey, kMethodKey,
+ kConstantKey, kConstantValue))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({
+ {kTestKey, kTestValue},
+ {kHostKey, kServerName},
+ {kServiceKey, kServiceValue},
+ {kMethodKey, kMethodValue},
+ {kConstantKey, kConstantValue},
+ }),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, TwoCacheEntriesWithSameTarget) {
+ const char* kTestValue2 = "test_value2";
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue2}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue2}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 2);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+}
+
+TEST_F(RlsEnd2endTest, FailedRlsRequestWithoutDefaultTarget) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ // Send an RPC before we give the RLS server a response.
+ // The RLS request will fail, and thus so will the data plane RPC.
+ CheckRpcSendFailure(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_THAT(
+ rls_server_->service_.GetUnmatchedRequests(),
+ ::testing::ElementsAre(
+ // TODO(roth): Change this to use ::testing::ProtoEquals()
+ // once that becomes available in OSS.
+ ::testing::Property(
+ &RouteLookupRequest::DebugString,
+ BuildRlsRequest({{kTestKey, kTestValue}}).DebugString())));
+ // Now give the RLS server the right response.
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Sleep long enough for backoff to elapse, then try another RPC.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(3));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, FailedRlsRequestWithDefaultTarget) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_default_target(TargetStringForPort(backends_[0]->port_))
+ .Build());
+ // Don't give the RLS server a response, so the RLS request will fail.
+ // The data plane RPC should be sent to the default target.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_THAT(
+ rls_server_->service_.GetUnmatchedRequests(),
+ ::testing::ElementsAre(
+ // TODO(roth): Change this to use ::testing::ProtoEquals()
+ // once that becomes available in OSS.
+ ::testing::Property(
+ &RouteLookupRequest::DebugString,
+ BuildRlsRequest({{kTestKey, kTestValue}}).DebugString())));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 0);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, RlsRequestTimeout) {
+ StartBackends(2);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_default_target(TargetStringForPort(backends_[1]->port_))
+ .set_lookup_service_timeout(2000)
+ .Build());
+ // RLS server will send a response, but it's longer than the timeout.
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}),
+ /*response_delay=*/3000);
+ // The data plane RPC should be sent to the default target.
+ CheckRpcSendOk(DEBUG_LOCATION, RpcOptions().set_timeout_ms(4000).set_metadata(
+ {{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 0);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, UpdateConfig) {
+ StartBackends(2);
+ auto service_config_builder =
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_default_target(TargetStringForPort(backends_[0]->port_));
+ SetNextResolution(service_config_builder.Build());
+ // Don't give the RLS server a response, so the RLS request will fail.
+ // The data plane RPC should be sent to the default target.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_THAT(
+ rls_server_->service_.GetUnmatchedRequests(),
+ ::testing::ElementsAre(
+ // TODO(roth): Change this to use ::testing::ProtoEquals()
+ // once that becomes available in OSS.
+ ::testing::Property(
+ &RouteLookupRequest::DebugString,
+ BuildRlsRequest({{kTestKey, kTestValue}}).DebugString())));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 0);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 0);
+ // Now update the config to point to a new default target.
+ service_config_builder.set_default_target(
+ TargetStringForPort(backends_[1]->port_));
+ SetNextResolution(service_config_builder.Build());
+ // Send another RPC, which should go to the new default target.
+ // The RLS server will *not* see another request, because the cache
+ // entry is still in backoff.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 0);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, CachedResponse) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Send two RPCs.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ // The RLS server should have seen only one request.
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+}
+
+TEST_F(RlsEnd2endTest, StaleCacheEntry) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_max_age(5000)
+ .set_stale_age(1000)
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Send one RPC. RLS server gets a request, and RPC goes to backend.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ // Update RLS server to expect stale request.
+ rls_server_->service_.RemoveResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}));
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}},
+ RouteLookupRequest::REASON_STALE),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Wait longer than stale age.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ // Send another RPC. This should use the stale value but should
+ // dispatch a second RLS request.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+ // Wait for RLS server to receive the second request.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 2);
+}
+
+TEST_F(RlsEnd2endTest, StaleCacheEntryWithHeaderData) {
+ const char* kHeaderData = "header_data";
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_max_age(5000)
+ .set_stale_age(1000)
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)},
+ kHeaderData));
+ // Send one RPC. RLS server gets a request, and RPC goes to backend.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ // Update RLS server to expect stale request.
+ rls_server_->service_.RemoveResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}));
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}},
+ RouteLookupRequest::REASON_STALE, kHeaderData),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)},
+ kHeaderData));
+ // Wait longer than stale age.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ // Send another RPC. This should use the stale value but should
+ // dispatch a second RLS request.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+ // Wait for RLS server to receive the second request.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 2);
+}
+
+TEST_F(RlsEnd2endTest, ExpiredCacheEntry) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .set_max_age(1000)
+ .set_lookup_service_timeout(1000)
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ // Send one RPC. RLS server gets a request, and RPC goes to backend.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ // Remove response from RLS server so that the next RLS request fails.
+ rls_server_->service_.RemoveResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}));
+ // Wait for cache to be expired.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ // Send another RPC. This should trigger a second RLS request, but
+ // that fails, so the RPC fails.
+ CheckRpcSendFailure(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, CacheSizeLimit) {
+ const char* kTestValue2 = "test_value_2";
+ StartBackends(2);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue,
+ kTestKey))
+ .set_cache_size_bytes(1) // Not even big enough for one entry.
+ .Build());
+ // Set RLS responses for both kTestValue and kTestValue2.
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({TargetStringForPort(backends_[0]->port_)}));
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue2}}),
+ BuildRlsResponse({TargetStringForPort(backends_[1]->port_)}));
+ // Send an RPC for kTestValue.
+ // RLS server gets a request, and RPC goes to backend.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 0);
+ // A second RPC for kTestValue should not generate another RLS
+ // request, because the cache entry is held by min_eviction_time.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 0);
+ // Wait for min_eviction_time to elapse.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(6));
+ // Send a request for kTestValue2.
+ // RLS server gets a request, and RPC goes to backend.
+ // This causes the entry for kTestValue to be evicted.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue2}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 2);
+ EXPECT_EQ(rls_server_->service_.response_count(), 2);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 2);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 1);
+ // Send another RPC for kTestValue.
+ // This should now trigger a new RLS request.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 3);
+ EXPECT_EQ(rls_server_->service_.response_count(), 3);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 3);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 1);
+ // Another RPC for kTestValue2 should still work due to min_eviction_time.
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue2}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 3);
+ EXPECT_EQ(rls_server_->service_.response_count(), 3);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 3);
+ EXPECT_EQ(backends_[1]->service_.request_count(), 2);
+}
+
+TEST_F(RlsEnd2endTest, MultipleTargets) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse(
+ // First target will report TRANSIENT_FAILURE..
+ {"invalid_target", TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+}
+
+TEST_F(RlsEnd2endTest, ConnectivityStateReady) {
+ StartBackends(1);
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ EXPECT_EQ(GRPC_CHANNEL_IDLE, channel_->GetState(/*try_to_connect=*/false));
+ rls_server_->service_.SetResponse(
+ BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse(
+ // One target in TRANSIENT_FAILURE, the other in READY.
+ {"invalid_target", TargetStringForPort(backends_[0]->port_)}));
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(backends_[0]->service_.request_count(), 1);
+ EXPECT_EQ(GRPC_CHANNEL_READY, channel_->GetState(/*try_to_connect=*/false));
+}
+
+TEST_F(RlsEnd2endTest, ConnectivityStateIdle) {
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ EXPECT_EQ(GRPC_CHANNEL_IDLE, channel_->GetState(/*try_to_connect=*/false));
+ // RLS server not given any responses, so the request will fail.
+ CheckRpcSendFailure(DEBUG_LOCATION);
+ // No child policies, so should be IDLE.
+ EXPECT_EQ(GRPC_CHANNEL_IDLE, channel_->GetState(/*try_to_connect=*/false));
+}
+
+TEST_F(RlsEnd2endTest, ConnectivityStateTransientFailure) {
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ EXPECT_EQ(GRPC_CHANNEL_IDLE, channel_->GetState(/*try_to_connect=*/false));
+ rls_server_->service_.SetResponse(BuildRlsRequest({{kTestKey, kTestValue}}),
+ BuildRlsResponse({"invalid_target"}));
+ CheckRpcSendFailure(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ EXPECT_EQ(rls_server_->service_.request_count(), 1);
+ EXPECT_EQ(rls_server_->service_.response_count(), 1);
+ EXPECT_EQ(GRPC_CHANNEL_TRANSIENT_FAILURE,
+ channel_->GetState(/*try_to_connect=*/false));
+}
+
+TEST_F(RlsEnd2endTest, RlsAuthorityDeathTest) {
+ GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
+ ResetStub("incorrect_authority");
+ SetNextResolution(
+ MakeServiceConfigBuilder()
+ .AddKeyBuilder(y_absl::StrFormat("\"names\":[{"
+ " \"service\":\"%s\","
+ " \"method\":\"%s\""
+ "}],"
+ "\"headers\":["
+ " {"
+ " \"key\":\"%s\","
+ " \"names\":["
+ " \"key1\""
+ " ]"
+ " }"
+ "]",
+ kServiceValue, kMethodValue, kTestKey))
+ .Build());
+ // Make sure that we blow up (via abort() from the security connector) when
+ // the authority for the RLS channel doesn't match expectations.
+ ASSERT_DEATH_IF_SUPPORTED(
+ {
+ CheckRpcSendOk(DEBUG_LOCATION,
+ RpcOptions().set_metadata({{"key1", kTestValue}}));
+ },
+ "");
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/contrib/libs/grpc/test/cpp/end2end/sdk_authz_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/sdk_authz_end2end_test.cc
new file mode 100644
index 00000000000..e3e676a32a0
--- /dev/null
+++ b/contrib/libs/grpc/test/cpp/end2end/sdk_authz_end2end_test.cc
@@ -0,0 +1,763 @@
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <grpcpp/channel.h>
+#include <grpcpp/client_context.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/security/authorization_policy_provider.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+
+#include "src/core/lib/security/credentials/fake/fake_credentials.h"
+#include "src/cpp/client/secure_credentials.h"
+#include "src/cpp/server/secure_server_credentials.h"
+#include "src/proto/grpc/testing/echo.grpc.pb.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+#include "test/core/util/tls_utils.h"
+#include "test/cpp/end2end/test_service_impl.h"
+
+namespace grpc {
+namespace testing {
+namespace {
+
+constexpr char kMessage[] = "Hello";
+
+class SdkAuthzEnd2EndTest : public ::testing::Test {
+ protected:
+ SdkAuthzEnd2EndTest()
+ : server_address_(
+ y_absl::StrCat("localhost:", grpc_pick_unused_port_or_die())),
+ server_creds_(
+ std::shared_ptr<ServerCredentials>(new SecureServerCredentials(
+ grpc_fake_transport_security_server_credentials_create()))),
+ channel_creds_(
+ std::shared_ptr<ChannelCredentials>(new SecureChannelCredentials(
+ grpc_fake_transport_security_credentials_create()))) {}
+
+ ~SdkAuthzEnd2EndTest() override { server_->Shutdown(); }
+
+ // Replaces existing credentials with insecure credentials.
+ void UseInsecureCredentials() {
+ server_creds_ = InsecureServerCredentials();
+ channel_creds_ = InsecureChannelCredentials();
+ }
+
+ // Creates server with sdk authorization enabled when provider is not null.
+ void InitServer(
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ provider) {
+ ServerBuilder builder;
+ builder.AddListeningPort(server_address_, std::move(server_creds_));
+ builder.experimental().SetAuthorizationPolicyProvider(std::move(provider));
+ builder.RegisterService(&service_);
+ server_ = builder.BuildAndStart();
+ }
+
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ CreateStaticAuthzPolicyProvider(const TString& policy) {
+ grpc::Status status;
+ auto provider = experimental::StaticDataAuthorizationPolicyProvider::Create(
+ policy, &status);
+ EXPECT_TRUE(status.ok());
+ return provider;
+ }
+
+ std::shared_ptr<experimental::AuthorizationPolicyProviderInterface>
+ CreateFileWatcherAuthzPolicyProvider(const TString& policy_path,
+ unsigned int refresh_interval_sec) {
+ grpc::Status status;
+ auto provider =
+ experimental::FileWatcherAuthorizationPolicyProvider::Create(
+ policy_path, refresh_interval_sec, &status);
+ EXPECT_TRUE(status.ok());
+ return provider;
+ }
+
+ std::shared_ptr<Channel> BuildChannel() {
+ ChannelArguments args;
+ return ::grpc::CreateCustomChannel(server_address_, channel_creds_, args);
+ }
+
+ grpc::Status SendRpc(const std::shared_ptr<Channel>& channel,
+ ClientContext* context,
+ grpc::testing::EchoResponse* response = nullptr) {
+ auto stub = grpc::testing::EchoTestService::NewStub(channel);
+ grpc::testing::EchoRequest request;
+ request.set_message(kMessage);
+ return stub->Echo(context, request, response);
+ }
+
+ TString server_address_;
+ TestServiceImpl service_;
+ std::unique_ptr<Server> server_;
+ std::shared_ptr<ServerCredentials> server_creds_;
+ std::shared_ptr<ChannelCredentials> channel_creds_;
+};
+
+TEST_F(SdkAuthzEnd2EndTest,
+ StaticInitAllowsRpcRequestNoMatchInDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\", \"foo2\"]"
+ " },"
+ " {"
+ " \"key\": \"key-bar\","
+ " \"values\": [\"bar1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_clientstreamingecho\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/ClientStreamingEcho\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-foo", "foo2");
+ context.AddMetadata("key-bar", "bar1");
+ context.AddMetadata("key-baz", "baz1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp.message(), kMessage);
+}
+
+TEST_F(SdkAuthzEnd2EndTest, StaticInitDeniesRpcRequestNoMatchInAllowAndDeny) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_foo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/foo\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_bar\","
+ " \"source\": {"
+ " \"principals\": ["
+ " \"bar\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest, StaticInitDeniesRpcRequestMatchInDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_all\""
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ StaticInitDeniesRpcRequestMatchInDenyNoMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_clientstreamingecho\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/ClientStreamingEcho\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest, StaticInitAllowsRpcRequestEmptyDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\", \"foo2\"]"
+ " },"
+ " {"
+ " \"key\": \"key-bar\","
+ " \"values\": [\"bar1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-foo", "foo2");
+ context.AddMetadata("key-bar", "bar1");
+ context.AddMetadata("key-baz", "baz1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp.message(), kMessage);
+}
+
+TEST_F(SdkAuthzEnd2EndTest, StaticInitDeniesRpcRequestEmptyDenyNoMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-bar", "bar1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(
+ SdkAuthzEnd2EndTest,
+ StaticInitDeniesRpcRequestWithPrincipalsFieldOnUnauthenticatedConnection) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"source\": {"
+ " \"principals\": ["
+ " \"foo\""
+ " ]"
+ " },"
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ UseInsecureCredentials();
+ InitServer(CreateStaticAuthzPolicyProvider(policy));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitAllowsRpcRequestNoMatchInDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\", \"foo2\"]"
+ " },"
+ " {"
+ " \"key\": \"key-bar\","
+ " \"values\": [\"bar1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_clientstreamingecho\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/ClientStreamingEcho\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-foo", "foo2");
+ context.AddMetadata("key-bar", "bar1");
+ context.AddMetadata("key-baz", "baz1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp.message(), kMessage);
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitDeniesRpcRequestNoMatchInAllowAndDeny) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_foo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/foo\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_bar\","
+ " \"source\": {"
+ " \"principals\": ["
+ " \"bar\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitDeniesRpcRequestMatchInDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_all\""
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitDeniesRpcRequestMatchInDenyNoMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_clientstreamingecho\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/ClientStreamingEcho\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitAllowsRpcRequestEmptyDenyMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\", \"foo2\"]"
+ " },"
+ " {"
+ " \"key\": \"key-bar\","
+ " \"values\": [\"bar1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-foo", "foo2");
+ context.AddMetadata("key-bar", "bar1");
+ context.AddMetadata("key-baz", "baz1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp.message(), kMessage);
+}
+
+TEST_F(SdkAuthzEnd2EndTest,
+ FileWatcherInitDeniesRpcRequestEmptyDenyNoMatchInAllow) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ],"
+ " \"headers\": ["
+ " {"
+ " \"key\": \"key-foo\","
+ " \"values\": [\"foo1\"]"
+ " }"
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 5));
+ auto channel = BuildChannel();
+ ClientContext context;
+ context.AddMetadata("key-bar", "bar1");
+ grpc::testing::EchoResponse resp;
+ grpc::Status status = SendRpc(channel, &context, &resp);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest, FileWatcherValidPolicyRefresh) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 1));
+ auto channel = BuildChannel();
+ ClientContext context1;
+ grpc::testing::EchoResponse resp1;
+ grpc::Status status = SendRpc(channel, &context1, &resp1);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp1.message(), kMessage);
+ // Replace the existing policy with a new authorization policy.
+ policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_foo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/foo\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ tmp_policy.RewriteFile(policy);
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ ClientContext context2;
+ grpc::testing::EchoResponse resp2;
+ status = SendRpc(channel, &context2, &resp2);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp2.message().empty());
+}
+
+TEST_F(SdkAuthzEnd2EndTest, FileWatcherInvalidPolicyRefreshSkipsReload) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 1));
+ auto channel = BuildChannel();
+ ClientContext context1;
+ grpc::testing::EchoResponse resp1;
+ grpc::Status status = SendRpc(channel, &context1, &resp1);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp1.message(), kMessage);
+ // Replaces existing policy with an invalid authorization policy.
+ policy = "{}";
+ tmp_policy.RewriteFile(policy);
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ ClientContext context2;
+ grpc::testing::EchoResponse resp2;
+ status = SendRpc(channel, &context2, &resp2);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp2.message(), kMessage);
+}
+
+TEST_F(SdkAuthzEnd2EndTest, FileWatcherRecoversFromFailure) {
+ TString policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ grpc_core::testing::TmpFile tmp_policy(policy);
+ InitServer(CreateFileWatcherAuthzPolicyProvider(tmp_policy.name(), 1));
+ auto channel = BuildChannel();
+ ClientContext context1;
+ grpc::testing::EchoResponse resp1;
+ grpc::Status status = SendRpc(channel, &context1, &resp1);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp1.message(), kMessage);
+ // Replaces existing policy with an invalid authorization policy.
+ policy = "{}";
+ tmp_policy.RewriteFile(policy);
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ ClientContext context2;
+ grpc::testing::EchoResponse resp2;
+ status = SendRpc(channel, &context2, &resp2);
+ EXPECT_TRUE(status.ok());
+ EXPECT_EQ(resp2.message(), kMessage);
+ // Replace the existing invalid policy with a valid authorization policy.
+ policy =
+ "{"
+ " \"name\": \"authz\","
+ " \"allow_rules\": ["
+ " {"
+ " \"name\": \"allow_foo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/foo\""
+ " ]"
+ " }"
+ " }"
+ " ],"
+ " \"deny_rules\": ["
+ " {"
+ " \"name\": \"deny_echo\","
+ " \"request\": {"
+ " \"paths\": ["
+ " \"*/Echo\""
+ " ]"
+ " }"
+ " }"
+ " ]"
+ "}";
+ tmp_policy.RewriteFile(policy);
+ // Wait 2 seconds for the provider's refresh thread to read the updated files.
+ gpr_sleep_until(grpc_timeout_seconds_to_deadline(2));
+ ClientContext context3;
+ grpc::testing::EchoResponse resp3;
+ status = SendRpc(channel, &context3, &resp3);
+ EXPECT_EQ(status.error_code(), grpc::StatusCode::PERMISSION_DENIED);
+ EXPECT_EQ(status.error_message(), "Unauthorized RPC request rejected.");
+ EXPECT_TRUE(resp3.message().empty());
+}
+
+} // namespace
+} // namespace testing
+} // namespace grpc
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ grpc::testing::TestEnvironment env(argc, argv);
+ const auto result = RUN_ALL_TESTS();
+ return result;
+}
diff --git a/contrib/libs/grpc/test/cpp/end2end/server_builder_plugin_test.cc b/contrib/libs/grpc/test/cpp/end2end/server_builder_plugin_test.cc
index cf47dade7cf..56c32b65da0 100644
--- a/contrib/libs/grpc/test/cpp/end2end/server_builder_plugin_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/server_builder_plugin_test.cc
@@ -18,6 +18,10 @@
#include <thread>
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
@@ -31,15 +35,11 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
-#include <gtest/gtest.h>
-
#define PLUGIN_NAME "TestServerBuilderPlugin"
namespace grpc {
diff --git a/contrib/libs/grpc/test/cpp/end2end/server_crash_test.cc b/contrib/libs/grpc/test/cpp/end2end/server_crash_test.cc
index 1f5103cb515..9ac41f9b63a 100644
--- a/contrib/libs/grpc/test/cpp/end2end/server_crash_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/server_crash_test.cc
@@ -16,6 +16,10 @@
*
*/
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
@@ -26,16 +30,12 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
#include "test/cpp/util/subprocess.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/server_crash_test_client.cc b/contrib/libs/grpc/test/cpp/end2end/server_crash_test_client.cc
index ee9b3d7b886..8ecdaf56bb0 100644
--- a/contrib/libs/grpc/test/cpp/end2end/server_crash_test_client.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/server_crash_test_client.cc
@@ -16,17 +16,18 @@
*
*/
-#include <grpc/support/log.h>
-#include <grpcpp/channel.h>
-#include <grpcpp/client_context.h>
-#include <grpcpp/create_channel.h>
-
#include <iostream>
#include <memory>
#include <sstream>
#include <util/generic/string.h>
#include "y_absl/flags/flag.h"
+
+#include <grpc/support/log.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/client_context.h>
+#include <grpcpp/create_channel.h>
+
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/test_config.h"
@@ -68,6 +69,4 @@ int main(int argc, char** argv) {
y_absl::GetFlag(FLAGS_mode).c_str());
return 1;
}
-
- return 0;
}
diff --git a/contrib/libs/grpc/test/cpp/end2end/server_early_return_test.cc b/contrib/libs/grpc/test/cpp/end2end/server_early_return_test.cc
index 543dcf64e4a..b33c708295c 100644
--- a/contrib/libs/grpc/test/cpp/end2end/server_early_return_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/server_early_return_test.cc
@@ -16,6 +16,8 @@
*
*/
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@@ -34,8 +36,6 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/string_ref_helper.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
namespace {
diff --git a/contrib/libs/grpc/test/cpp/end2end/server_interceptors_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/server_interceptors_end2end_test.cc
index a57f4712806..5b631a1359e 100644
--- a/contrib/libs/grpc/test/cpp/end2end/server_interceptors_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/server_interceptors_end2end_test.cc
@@ -19,6 +19,11 @@
#include <memory>
#include <vector>
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+#include "y_absl/strings/match.h"
+
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
@@ -29,9 +34,6 @@
#include <grpcpp/server_context.h>
#include <grpcpp/support/server_interceptor.h>
-#include "y_absl/memory/memory.h"
-#include "y_absl/strings/match.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@@ -39,8 +41,6 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/byte_buffer_proto_helper.h"
-#include <gtest/gtest.h>
-
namespace grpc {
namespace testing {
namespace {
diff --git a/contrib/libs/grpc/test/cpp/end2end/service_config_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/service_config_end2end_test.cc
index 12dde9f35ef..b974befd493 100644
--- a/contrib/libs/grpc/test/cpp/end2end/service_config_end2end_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/service_config_end2end_test.cc
@@ -24,6 +24,9 @@
#include <util/generic/string.h>
#include <thread>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
#include "y_absl/memory/memory.h"
#include "y_absl/strings/str_cat.h"
@@ -45,25 +48,21 @@
#include "src/core/ext/filters/client_channel/global_subchannel_pool.h"
#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
#include "src/core/ext/filters/client_channel/server_address.h"
+#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/iomgr/parse_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include "src/cpp/client/secure_credentials.h"
#include "src/cpp/server/secure_server_credentials.h"
-
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
#include "test/core/util/resolve_localhost_ip46.h"
#include "test/core/util/test_config.h"
#include "test/cpp/end2end/test_service_impl.h"
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
@@ -300,32 +299,33 @@ class ServiceConfigEnd2endTest : public ::testing::Test {
}
struct ServerData {
- int port_;
+ const int port_;
std::unique_ptr<Server> server_;
MyTestServiceImpl service_;
std::unique_ptr<std::thread> thread_;
- bool server_ready_ = false;
- bool started_ = false;
- explicit ServerData(int port = 0) {
- port_ = port > 0 ? port : grpc_pick_unused_port_or_die();
- }
+ grpc::internal::Mutex mu_;
+ grpc::internal::CondVar cond_;
+ bool server_ready_ Y_ABSL_GUARDED_BY(mu_) = false;
+ bool started_ Y_ABSL_GUARDED_BY(mu_) = false;
+
+ explicit ServerData(int port = 0)
+ : port_(port > 0 ? port : grpc_pick_unused_port_or_die()) {}
void Start(const TString& server_host) {
gpr_log(GPR_INFO, "starting server on port %d", port_);
+ grpc::internal::MutexLock lock(&mu_);
started_ = true;
- grpc::internal::Mutex mu;
- grpc::internal::MutexLock lock(&mu);
- grpc::internal::CondVar cond;
thread_ = y_absl::make_unique<std::thread>(
- std::bind(&ServerData::Serve, this, server_host, &mu, &cond));
- grpc::internal::WaitUntil(&cond, &mu, [this] { return server_ready_; });
+ std::bind(&ServerData::Serve, this, server_host));
+ while (!server_ready_) {
+ cond_.Wait(&mu_);
+ }
server_ready_ = false;
gpr_log(GPR_INFO, "server startup complete");
}
- void Serve(const TString& server_host, grpc::internal::Mutex* mu,
- grpc::internal::CondVar* cond) {
+ void Serve(const TString& server_host) {
std::ostringstream server_address;
server_address << server_host << ":" << port_;
ServerBuilder builder;
@@ -334,12 +334,13 @@ class ServiceConfigEnd2endTest : public ::testing::Test {
builder.AddListeningPort(server_address.str(), std::move(creds));
builder.RegisterService(&service_);
server_ = builder.BuildAndStart();
- grpc::internal::MutexLock lock(mu);
+ grpc::internal::MutexLock lock(&mu_);
server_ready_ = true;
- cond->Signal();
+ cond_.Signal();
}
void Shutdown() {
+ grpc::internal::MutexLock lock(&mu_);
if (!started_) return;
server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0));
thread_->join();
diff --git a/contrib/libs/grpc/test/cpp/end2end/shutdown_test.cc b/contrib/libs/grpc/test/cpp/end2end/shutdown_test.cc
index 734b9344ddc..01d32fc3bf2 100644
--- a/contrib/libs/grpc/test/cpp/end2end/shutdown_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/shutdown_test.cc
@@ -18,6 +18,8 @@
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
@@ -34,8 +36,6 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/test_credentials_provider.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/streaming_throughput_test.cc b/contrib/libs/grpc/test/cpp/end2end/streaming_throughput_test.cc
index bfc0d1e370c..41721957e5f 100644
--- a/contrib/libs/grpc/test/cpp/end2end/streaming_throughput_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/streaming_throughput_test.cc
@@ -17,9 +17,12 @@
*/
#include <time.h>
+
#include <mutex>
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/atm.h>
#include <grpc/support/log.h>
@@ -38,8 +41,6 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/test_service_impl.cc b/contrib/libs/grpc/test/cpp/end2end/test_service_impl.cc
index 078977e8243..7a5856806e5 100644
--- a/contrib/libs/grpc/test/cpp/end2end/test_service_impl.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/test_service_impl.cc
@@ -18,14 +18,15 @@
#include "test/cpp/end2end/test_service_impl.h"
+#include <util/generic/string.h>
+#include <thread>
+
+#include <gtest/gtest.h>
+
#include <grpc/support/log.h>
#include <grpcpp/alarm.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/server_context.h>
-#include <gtest/gtest.h>
-
-#include <util/generic/string.h>
-#include <thread>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/string_ref_helper.h"
@@ -38,8 +39,8 @@ namespace internal {
// When echo_deadline is requested, deadline seen in the ServerContext is set in
// the response in seconds.
-void MaybeEchoDeadline(experimental::ServerContextBase* context,
- const EchoRequest* request, EchoResponse* response) {
+void MaybeEchoDeadline(ServerContextBase* context, const EchoRequest* request,
+ EchoResponse* response) {
if (request->has_param() && request->param().echo_deadline()) {
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_REALTIME);
if (context->deadline() != system_clock::time_point::max()) {
@@ -49,7 +50,7 @@ void MaybeEchoDeadline(experimental::ServerContextBase* context,
}
}
-void CheckServerAuthContext(const experimental::ServerContextBase* context,
+void CheckServerAuthContext(const ServerContextBase* context,
const TString& expected_transport_security_type,
const TString& expected_client_identity) {
std::shared_ptr<const AuthContext> auth_ctx = context->auth_context();
@@ -115,7 +116,7 @@ void ServerTryCancel(ServerContext* context) {
}
}
-void ServerTryCancelNonblocking(experimental::CallbackServerContext* context) {
+void ServerTryCancelNonblocking(CallbackServerContext* context) {
EXPECT_FALSE(context->IsCancelled());
context->TryCancel();
gpr_log(GPR_INFO,
@@ -124,13 +125,12 @@ void ServerTryCancelNonblocking(experimental::CallbackServerContext* context) {
} // namespace internal
-experimental::ServerUnaryReactor* CallbackTestServiceImpl::Echo(
- experimental::CallbackServerContext* context, const EchoRequest* request,
+ServerUnaryReactor* CallbackTestServiceImpl::Echo(
+ CallbackServerContext* context, const EchoRequest* request,
EchoResponse* response) {
- class Reactor : public ::grpc::experimental::ServerUnaryReactor {
+ class Reactor : public ::grpc::ServerUnaryReactor {
public:
- Reactor(CallbackTestServiceImpl* service,
- experimental::CallbackServerContext* ctx,
+ Reactor(CallbackTestServiceImpl* service, CallbackServerContext* ctx,
const EchoRequest* request, EchoResponse* response)
: service_(service), ctx_(ctx), req_(request), resp_(response) {
// It should be safe to call IsCancelled here, even though we don't know
@@ -159,7 +159,7 @@ experimental::ServerUnaryReactor* CallbackTestServiceImpl::Echo(
void StartRpc() {
if (req_->has_param() && req_->param().server_sleep_us() > 0) {
// Set an alarm for that much time
- alarm_.experimental().Set(
+ alarm_.Set(
gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_micros(req_->param().server_sleep_us(),
GPR_TIMESPAN)),
@@ -241,12 +241,11 @@ experimental::ServerUnaryReactor* CallbackTestServiceImpl::Echo(
FinishWhenCancelledAsync();
return;
} else if (req_->has_param() && req_->param().server_cancel_after_us()) {
- alarm_.experimental().Set(
- gpr_time_add(
- gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_micros(req_->param().server_cancel_after_us(),
- GPR_TIMESPAN)),
- [this](bool) { Finish(Status::CANCELLED); });
+ alarm_.Set(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
+ gpr_time_from_micros(
+ req_->param().server_cancel_after_us(),
+ GPR_TIMESPAN)),
+ [this](bool) { Finish(Status::CANCELLED); });
return;
} else if (!req_->has_param() || !req_->param().skip_cancelled_check()) {
EXPECT_FALSE(ctx_->IsCancelled());
@@ -305,7 +304,7 @@ experimental::ServerUnaryReactor* CallbackTestServiceImpl::Echo(
}
CallbackTestServiceImpl* const service_;
- experimental::CallbackServerContext* const ctx_;
+ CallbackServerContext* const ctx_;
const EchoRequest* const req_;
EchoResponse* const resp_;
Alarm alarm_;
@@ -322,13 +321,11 @@ experimental::ServerUnaryReactor* CallbackTestServiceImpl::Echo(
return new Reactor(this, context, request, response);
}
-experimental::ServerUnaryReactor*
-CallbackTestServiceImpl::CheckClientInitialMetadata(
- experimental::CallbackServerContext* context, const SimpleRequest42*,
- SimpleResponse42*) {
- class Reactor : public ::grpc::experimental::ServerUnaryReactor {
+ServerUnaryReactor* CallbackTestServiceImpl::CheckClientInitialMetadata(
+ CallbackServerContext* context, const SimpleRequest42*, SimpleResponse42*) {
+ class Reactor : public ::grpc::ServerUnaryReactor {
public:
- explicit Reactor(experimental::CallbackServerContext* ctx) {
+ explicit Reactor(CallbackServerContext* ctx) {
EXPECT_EQ(internal::MetadataMatchCount(ctx->client_metadata(),
kCheckClientInitialMetadataKey,
kCheckClientInitialMetadataVal),
@@ -343,9 +340,8 @@ CallbackTestServiceImpl::CheckClientInitialMetadata(
return new Reactor(context);
}
-experimental::ServerReadReactor<EchoRequest>*
-CallbackTestServiceImpl::RequestStream(
- experimental::CallbackServerContext* context, EchoResponse* response) {
+ServerReadReactor<EchoRequest>* CallbackTestServiceImpl::RequestStream(
+ CallbackServerContext* context, EchoResponse* response) {
// If 'server_try_cancel' is set in the metadata, the RPC is cancelled by
// the server by calling ServerContext::TryCancel() depending on the
// value:
@@ -362,9 +358,9 @@ CallbackTestServiceImpl::RequestStream(
return nullptr;
}
- class Reactor : public ::grpc::experimental::ServerReadReactor<EchoRequest> {
+ class Reactor : public ::grpc::ServerReadReactor<EchoRequest> {
public:
- Reactor(experimental::CallbackServerContext* ctx, EchoResponse* response,
+ Reactor(CallbackServerContext* ctx, EchoResponse* response,
int server_try_cancel)
: ctx_(ctx),
response_(response),
@@ -414,7 +410,7 @@ CallbackTestServiceImpl::RequestStream(
}
}
- experimental::CallbackServerContext* const ctx_;
+ CallbackServerContext* const ctx_;
EchoResponse* const response_;
EchoRequest request_;
int num_msgs_read_{0};
@@ -429,9 +425,8 @@ CallbackTestServiceImpl::RequestStream(
// Return 'kNumResponseStreamMsgs' messages.
// TODO(yangg) make it generic by adding a parameter into EchoRequest
-experimental::ServerWriteReactor<EchoResponse>*
-CallbackTestServiceImpl::ResponseStream(
- experimental::CallbackServerContext* context, const EchoRequest* request) {
+ServerWriteReactor<EchoResponse>* CallbackTestServiceImpl::ResponseStream(
+ CallbackServerContext* context, const EchoRequest* request) {
// If 'server_try_cancel' is set in the metadata, the RPC is cancelled by
// the server by calling ServerContext::TryCancel() depending on the
// value:
@@ -446,11 +441,10 @@ CallbackTestServiceImpl::ResponseStream(
internal::ServerTryCancelNonblocking(context);
}
- class Reactor
- : public ::grpc::experimental::ServerWriteReactor<EchoResponse> {
+ class Reactor : public ::grpc::ServerWriteReactor<EchoResponse> {
public:
- Reactor(experimental::CallbackServerContext* ctx,
- const EchoRequest* request, int server_try_cancel)
+ Reactor(CallbackServerContext* ctx, const EchoRequest* request,
+ int server_try_cancel)
: ctx_(ctx), request_(request), server_try_cancel_(server_try_cancel) {
server_coalescing_api_ = internal::GetIntValueFromMetadata(
kServerUseCoalescingApi, ctx->client_metadata(), 0);
@@ -518,7 +512,7 @@ CallbackTestServiceImpl::ResponseStream(
}
}
}
- experimental::CallbackServerContext* const ctx_;
+ CallbackServerContext* const ctx_;
const EchoRequest* const request_;
EchoResponse response_;
int num_msgs_sent_{0};
@@ -532,13 +526,11 @@ CallbackTestServiceImpl::ResponseStream(
return new Reactor(context, request, server_try_cancel);
}
-experimental::ServerBidiReactor<EchoRequest, EchoResponse>*
-CallbackTestServiceImpl::BidiStream(
- experimental::CallbackServerContext* context) {
- class Reactor : public ::grpc::experimental::ServerBidiReactor<EchoRequest,
- EchoResponse> {
+ServerBidiReactor<EchoRequest, EchoResponse>*
+CallbackTestServiceImpl::BidiStream(CallbackServerContext* context) {
+ class Reactor : public ::grpc::ServerBidiReactor<EchoRequest, EchoResponse> {
public:
- explicit Reactor(experimental::CallbackServerContext* ctx) : ctx_(ctx) {
+ explicit Reactor(CallbackServerContext* ctx) : ctx_(ctx) {
// If 'server_try_cancel' is set in the metadata, the RPC is cancelled by
// the server by calling ServerContext::TryCancel() depending on the
// value:
@@ -551,6 +543,8 @@ CallbackTestServiceImpl::BidiStream(
kServerTryCancelRequest, ctx->client_metadata(), DO_NOT_CANCEL);
server_write_last_ = internal::GetIntValueFromMetadata(
kServerFinishAfterNReads, ctx->client_metadata(), 0);
+ client_try_cancel_ = static_cast<bool>(internal::GetIntValueFromMetadata(
+ kClientTryCancelRequest, ctx->client_metadata(), 0));
if (server_try_cancel_ == CANCEL_BEFORE_PROCESSING) {
internal::ServerTryCancelNonblocking(ctx);
} else {
@@ -589,6 +583,8 @@ CallbackTestServiceImpl::BidiStream(
return;
}
}
+ } else if (client_try_cancel_) {
+ EXPECT_TRUE(ctx_->IsCancelled());
}
if (server_try_cancel_ == CANCEL_DURING_PROCESSING) {
@@ -619,7 +615,7 @@ CallbackTestServiceImpl::BidiStream(
}
}
- experimental::CallbackServerContext* const ctx_;
+ CallbackServerContext* const ctx_;
EchoRequest request_;
EchoResponse response_;
int num_msgs_read_{0};
@@ -629,6 +625,7 @@ CallbackTestServiceImpl::BidiStream(
bool finished_{false};
bool setup_done_{false};
std::thread finish_thread_;
+ bool client_try_cancel_ = false;
};
return new Reactor(context);
diff --git a/contrib/libs/grpc/test/cpp/end2end/test_service_impl.h b/contrib/libs/grpc/test/cpp/end2end/test_service_impl.h
index eb4583ff878..9983b70ac41 100644
--- a/contrib/libs/grpc/test/cpp/end2end/test_service_impl.h
+++ b/contrib/libs/grpc/test/cpp/end2end/test_service_impl.h
@@ -22,16 +22,16 @@
#include <condition_variable>
#include <memory>
#include <mutex>
+#include <util/generic/string.h>
+#include <thread>
+
+#include <gtest/gtest.h>
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/alarm.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/server_context.h>
-#include <gtest/gtest.h>
-
-#include <util/generic/string.h>
-#include <thread>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/cpp/util/string_ref_helper.h"
@@ -44,6 +44,7 @@ namespace testing {
const int kServerDefaultResponseStreamsToSend = 3;
const char* const kServerResponseStreamsToSend = "server_responses_to_send";
const char* const kServerTryCancelRequest = "server_try_cancel";
+const char* const kClientTryCancelRequest = "client_try_cancel";
const char* const kDebugInfoTrailerKey = "debug-info-bin";
const char* const kServerFinishAfterNReads = "server_finish_after_n_reads";
const char* const kServerUseCoalescingApi = "server_use_coalescing_api";
@@ -60,10 +61,10 @@ typedef enum {
namespace internal {
// When echo_deadline is requested, deadline seen in the ServerContext is set in
// the response in seconds.
-void MaybeEchoDeadline(experimental::ServerContextBase* context,
- const EchoRequest* request, EchoResponse* response);
+void MaybeEchoDeadline(ServerContextBase* context, const EchoRequest* request,
+ EchoResponse* response);
-void CheckServerAuthContext(const experimental::ServerContextBase* context,
+void CheckServerAuthContext(const ServerContextBase* context,
const TString& expected_transport_security_type,
const TString& expected_client_identity);
@@ -378,6 +379,9 @@ class TestMultipleServiceImpl : public RpcService {
int server_try_cancel = internal::GetIntValueFromMetadata(
kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
+ int client_try_cancel = static_cast<bool>(internal::GetIntValueFromMetadata(
+ kClientTryCancelRequest, context->client_metadata(), 0));
+
EchoRequest request;
EchoResponse response;
@@ -404,11 +408,16 @@ class TestMultipleServiceImpl : public RpcService {
response.set_message(request.message());
if (read_counts == server_write_last) {
stream->WriteLast(response, WriteOptions());
+ break;
} else {
stream->Write(response);
}
}
+ if (client_try_cancel) {
+ EXPECT_TRUE(context->IsCancelled());
+ }
+
if (server_try_cancel_thd != nullptr) {
server_try_cancel_thd->join();
delete server_try_cancel_thd;
@@ -444,30 +453,28 @@ class TestMultipleServiceImpl : public RpcService {
};
class CallbackTestServiceImpl
- : public ::grpc::testing::EchoTestService::ExperimentalCallbackService {
+ : public ::grpc::testing::EchoTestService::CallbackService {
public:
CallbackTestServiceImpl() : signal_client_(false), host_() {}
explicit CallbackTestServiceImpl(const TString& host)
: signal_client_(false), host_(new TString(host)) {}
- experimental::ServerUnaryReactor* Echo(
- experimental::CallbackServerContext* context, const EchoRequest* request,
- EchoResponse* response) override;
+ ServerUnaryReactor* Echo(CallbackServerContext* context,
+ const EchoRequest* request,
+ EchoResponse* response) override;
- experimental::ServerUnaryReactor* CheckClientInitialMetadata(
- experimental::CallbackServerContext* context, const SimpleRequest42*,
- SimpleResponse42*) override;
+ ServerUnaryReactor* CheckClientInitialMetadata(CallbackServerContext* context,
+ const SimpleRequest42*,
+ SimpleResponse42*) override;
- experimental::ServerReadReactor<EchoRequest>* RequestStream(
- experimental::CallbackServerContext* context,
- EchoResponse* response) override;
+ ServerReadReactor<EchoRequest>* RequestStream(
+ CallbackServerContext* context, EchoResponse* response) override;
- experimental::ServerWriteReactor<EchoResponse>* ResponseStream(
- experimental::CallbackServerContext* context,
- const EchoRequest* request) override;
+ ServerWriteReactor<EchoResponse>* ResponseStream(
+ CallbackServerContext* context, const EchoRequest* request) override;
- experimental::ServerBidiReactor<EchoRequest, EchoResponse>* BidiStream(
- experimental::CallbackServerContext* context) override;
+ ServerBidiReactor<EchoRequest, EchoResponse>* BidiStream(
+ CallbackServerContext* context) override;
// Unimplemented is left unimplemented to test the returned error.
bool signal_client() {
diff --git a/contrib/libs/grpc/test/cpp/end2end/thread_stress_test.cc b/contrib/libs/grpc/test/cpp/end2end/thread_stress_test.cc
index 1a0ca6c0ab4..15740cc2cef 100644
--- a/contrib/libs/grpc/test/cpp/end2end/thread_stress_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/thread_stress_test.cc
@@ -20,6 +20,8 @@
#include <mutex>
#include <thread>
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/time.h>
#include <grpcpp/channel.h>
@@ -38,8 +40,6 @@
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
-#include <gtest/gtest.h>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/time_change_test.cc b/contrib/libs/grpc/test/cpp/end2end/time_change_test.cc
index ef879f899c7..c058b62d61c 100644
--- a/contrib/libs/grpc/test/cpp/end2end/time_change_test.cc
+++ b/contrib/libs/grpc/test/cpp/end2end/time_change_test.cc
@@ -16,6 +16,14 @@
*
*/
+#include <sys/time.h>
+
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include "y_absl/memory/memory.h"
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
@@ -26,8 +34,6 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include "y_absl/memory/memory.h"
-
#include "src/core/lib/iomgr/timer.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
@@ -35,10 +41,6 @@
#include "test/cpp/end2end/test_service_impl.h"
#include "test/cpp/util/subprocess.h"
-#include <gtest/gtest.h>
-#include <sys/time.h>
-#include <thread>
-
using grpc::testing::EchoRequest;
using grpc::testing::EchoResponse;
diff --git a/contrib/libs/grpc/test/cpp/end2end/xds_credentials_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/xds_credentials_end2end_test.cc
deleted file mode 100644
index fb5cfc9f4a5..00000000000
--- a/contrib/libs/grpc/test/cpp/end2end/xds_credentials_end2end_test.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-//
-// Copyright 2020 gRPC authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <grpc/grpc.h>
-#include <grpcpp/server_builder.h>
-
-#include "test/core/util/port.h"
-#include "test/core/util/test_config.h"
-#include "test/cpp/end2end/test_service_impl.h"
-#include "test/cpp/util/test_credentials_provider.h"
-
-namespace grpc {
-namespace testing {
-namespace {
-
-class XdsCredentialsEnd2EndFallbackTest
- : public ::testing::TestWithParam<const char*> {
- protected:
- XdsCredentialsEnd2EndFallbackTest() {
- int port = grpc_pick_unused_port_or_die();
- ServerBuilder builder;
- server_address_ = "localhost:" + ToString(port);
- builder.AddListeningPort(
- server_address_,
- GetCredentialsProvider()->GetServerCredentials(GetParam()));
- builder.RegisterService(&service_);
- server_ = builder.BuildAndStart();
- }
-
- TString server_address_;
- TestServiceImpl service_;
- std::unique_ptr<Server> server_;
-};
-
-TEST_P(XdsCredentialsEnd2EndFallbackTest, NoXdsSchemeInTarget) {
- // Target does not use 'xds:///' scheme and should result in using fallback
- // credentials.
- ChannelArguments args;
- auto channel = grpc::CreateCustomChannel(
- server_address_,
- grpc::experimental::XdsCredentials(
- GetCredentialsProvider()->GetChannelCredentials(GetParam(), &args)),
- args);
- auto stub = grpc::testing::EchoTestService::NewStub(channel);
- ClientContext ctx;
- EchoRequest req;
- req.set_message("Hello");
- EchoResponse resp;
- Status s = stub->Echo(&ctx, req, &resp);
- EXPECT_EQ(s.ok(), true);
- EXPECT_EQ(resp.message(), "Hello");
-}
-
-class XdsServerCredentialsEnd2EndFallbackTest
- : public ::testing::TestWithParam<const char*> {
- protected:
- XdsServerCredentialsEnd2EndFallbackTest() {
- int port = grpc_pick_unused_port_or_die();
- // Build a server that is not xDS enabled but uses XdsServerCredentials.
- ServerBuilder builder;
- server_address_ = "localhost:" + ToString(port);
- builder.AddListeningPort(
- server_address_,
- grpc::experimental::XdsServerCredentials(
- GetCredentialsProvider()->GetServerCredentials(GetParam())));
- builder.RegisterService(&service_);
- server_ = builder.BuildAndStart();
- }
-
- TString server_address_;
- TestServiceImpl service_;
- std::unique_ptr<Server> server_;
-};
-
-TEST_P(XdsServerCredentialsEnd2EndFallbackTest, Basic) {
- ChannelArguments args;
- auto channel = grpc::CreateCustomChannel(
- server_address_,
- GetCredentialsProvider()->GetChannelCredentials(GetParam(), &args), args);
- auto stub = grpc::testing::EchoTestService::NewStub(channel);
- ClientContext ctx;
- EchoRequest req;
- req.set_message("Hello");
- EchoResponse resp;
- Status s = stub->Echo(&ctx, req, &resp);
- EXPECT_EQ(s.ok(), true);
- EXPECT_EQ(resp.message(), "Hello");
-}
-
-INSTANTIATE_TEST_SUITE_P(XdsCredentialsEnd2EndFallback,
- XdsCredentialsEnd2EndFallbackTest,
- ::testing::ValuesIn(std::vector<const char*>(
- {kInsecureCredentialsType, kTlsCredentialsType})));
-
-INSTANTIATE_TEST_SUITE_P(XdsServerCredentialsEnd2EndFallback,
- XdsServerCredentialsEnd2EndFallbackTest,
- ::testing::ValuesIn(std::vector<const char*>(
- {kInsecureCredentialsType, kTlsCredentialsType})));
-
-} // namespace
-} // namespace testing
-} // namespace grpc
-
-int main(int argc, char** argv) {
- ::testing::InitGoogleTest(&argc, argv);
- grpc::testing::TestEnvironment env(argc, argv);
- const auto result = RUN_ALL_TESTS();
- return result;
-}
diff --git a/contrib/libs/grpc/test/cpp/end2end/xds_end2end_test.cc b/contrib/libs/grpc/test/cpp/end2end/xds_end2end_test.cc
deleted file mode 100644
index 8ca7f8e6f20..00000000000
--- a/contrib/libs/grpc/test/cpp/end2end/xds_end2end_test.cc
+++ /dev/null
@@ -1,11355 +0,0 @@
-/*
- *
- * Copyright 2017 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <deque>
-#include <memory>
-#include <mutex>
-#include <numeric>
-#include <set>
-#include <sstream>
-#include <util/generic/string.h>
-#include <thread>
-#include <vector>
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include "y_absl/functional/bind_front.h"
-#include "y_absl/memory/memory.h"
-#include "y_absl/strings/str_cat.h"
-#include "y_absl/strings/str_join.h"
-#include "y_absl/types/optional.h"
-
-#include <grpc/grpc.h>
-#include <grpc/grpc_security.h>
-#include <grpc/support/alloc.h>
-#include <grpc/support/log.h>
-#include <grpc/support/time.h>
-#include <grpcpp/channel.h>
-#include <grpcpp/client_context.h>
-#include <grpcpp/create_channel.h>
-#include <grpcpp/security/tls_certificate_provider.h>
-#include <grpcpp/server.h>
-#include <grpcpp/server_builder.h>
-#include <grpcpp/xds_server_builder.h>
-
-#include "src/core/ext/filters/client_channel/backup_poller.h"
-#include "src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_args.h"
-#include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h"
-#include "src/core/ext/filters/client_channel/server_address.h"
-#include "src/core/ext/xds/certificate_provider_registry.h"
-#include "src/core/ext/xds/xds_api.h"
-#include "src/core/ext/xds/xds_channel_args.h"
-#include "src/core/ext/xds/xds_client.h"
-#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/env.h"
-#include "src/core/lib/gpr/string.h"
-#include "src/core/lib/gpr/time_precise.h"
-#include "src/core/lib/gpr/tmpfile.h"
-#include "src/core/lib/gprpp/ref_counted_ptr.h"
-#include "src/core/lib/gprpp/sync.h"
-#include "src/core/lib/gprpp/time_util.h"
-#include "src/core/lib/iomgr/load_file.h"
-#include "src/core/lib/iomgr/parse_address.h"
-#include "src/core/lib/iomgr/sockaddr.h"
-#include "src/core/lib/security/credentials/fake/fake_credentials.h"
-#include "src/cpp/client/secure_credentials.h"
-#include "src/cpp/server/secure_server_credentials.h"
-#include "src/proto/grpc/testing/echo.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/ads_for_test.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/cds_for_test.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/eds_for_test.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/lds_rds_for_test.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/lrs_for_test.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/ads.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/aggregate_cluster.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/cluster.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/discovery.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/endpoint.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/fault.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/http_connection_manager.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/listener.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/lrs.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/route.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/router.grpc.pb.h"
-#include "src/proto/grpc/testing/xds/v3/tls.grpc.pb.h"
-#include "test/core/util/port.h"
-#include "test/core/util/resolve_localhost_ip46.h"
-#include "test/core/util/test_config.h"
-#include "test/cpp/end2end/test_service_impl.h"
-
-#ifndef DISABLED_XDS_PROTO_IN_CC
-#include "src/cpp/server/csds/csds.h"
-#include "src/proto/grpc/testing/xds/v3/csds.grpc.pb.h"
-#endif // DISABLED_XDS_PROTO_IN_CC
-
-namespace grpc {
-namespace testing {
-namespace {
-
-using std::chrono::system_clock;
-
-#ifndef DISABLED_XDS_PROTO_IN_CC
-using ::envoy::admin::v3::ClientResourceStatus;
-#endif // DISABLED_XDS_PROTO_IN_CC
-using ::envoy::config::cluster::v3::CircuitBreakers;
-using ::envoy::config::cluster::v3::Cluster;
-using ::envoy::config::cluster::v3::CustomClusterType;
-using ::envoy::config::cluster::v3::RoutingPriority;
-using ::envoy::config::endpoint::v3::ClusterLoadAssignment;
-using ::envoy::config::endpoint::v3::HealthStatus;
-using ::envoy::config::listener::v3::FilterChainMatch;
-using ::envoy::config::listener::v3::Listener;
-using ::envoy::config::route::v3::RouteConfiguration;
-using ::envoy::extensions::clusters::aggregate::v3::ClusterConfig;
-using ::envoy::extensions::filters::http::fault::v3::HTTPFault;
-using ::envoy::extensions::filters::network::http_connection_manager::v3::
- HttpConnectionManager;
-using ::envoy::extensions::filters::network::http_connection_manager::v3::
- HttpFilter;
-using ::envoy::extensions::transport_sockets::tls::v3::DownstreamTlsContext;
-using ::envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext;
-using ::envoy::type::matcher::v3::StringMatcher;
-using ::envoy::type::v3::FractionalPercent;
-
-constexpr char kLdsTypeUrl[] =
- "type.googleapis.com/envoy.config.listener.v3.Listener";
-constexpr char kRdsTypeUrl[] =
- "type.googleapis.com/envoy.config.route.v3.RouteConfiguration";
-constexpr char kCdsTypeUrl[] =
- "type.googleapis.com/envoy.config.cluster.v3.Cluster";
-constexpr char kEdsTypeUrl[] =
- "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment";
-
-constexpr char kLdsV2TypeUrl[] = "type.googleapis.com/envoy.api.v2.Listener";
-constexpr char kRdsV2TypeUrl[] =
- "type.googleapis.com/envoy.api.v2.RouteConfiguration";
-constexpr char kCdsV2TypeUrl[] = "type.googleapis.com/envoy.api.v2.Cluster";
-constexpr char kEdsV2TypeUrl[] =
- "type.googleapis.com/envoy.api.v2.ClusterLoadAssignment";
-
-constexpr char kDefaultLocalityRegion[] = "xds_default_locality_region";
-constexpr char kDefaultLocalityZone[] = "xds_default_locality_zone";
-constexpr char kLbDropType[] = "lb";
-constexpr char kThrottleDropType[] = "throttle";
-constexpr char kServerName[] = "server.example.com";
-constexpr char kDefaultRouteConfigurationName[] = "route_config_name";
-constexpr char kDefaultClusterName[] = "cluster_name";
-constexpr char kDefaultEdsServiceName[] = "eds_service_name";
-constexpr int kDefaultLocalityWeight = 3;
-constexpr int kDefaultLocalityPriority = 0;
-
-constexpr char kRequestMessage[] = "Live long and prosper.";
-constexpr char kDefaultServiceConfig[] =
- "{\n"
- " \"loadBalancingConfig\":[\n"
- " { \"does_not_exist\":{} },\n"
- " { \"xds_cluster_resolver_experimental\":{\n"
- " \"discoveryMechanisms\": [\n"
- " { \"clusterName\": \"server.example.com\",\n"
- " \"type\": \"EDS\",\n"
- " \"lrsLoadReportingServerName\": \"\"\n"
- " } ]\n"
- " } }\n"
- " ]\n"
- "}";
-constexpr char kDefaultServiceConfigWithoutLoadReporting[] =
- "{\n"
- " \"loadBalancingConfig\":[\n"
- " { \"does_not_exist\":{} },\n"
- " { \"xds_cluster_resolver_experimental\":{\n"
- " \"discoveryMechanisms\": [\n"
- " { \"clusterName\": \"server.example.com\",\n"
- " \"type\": \"EDS\"\n"
- " } ]\n"
- " } }\n"
- " ]\n"
- "}";
-
-constexpr char kBootstrapFileV3[] =
- "{\n"
- " \"xds_servers\": [\n"
- " {\n"
- " \"server_uri\": \"fake:///xds_server\",\n"
- " \"channel_creds\": [\n"
- " {\n"
- " \"type\": \"fake\"\n"
- " }\n"
- " ],\n"
- " \"server_features\": [\"xds_v3\"]\n"
- " }\n"
- " ],\n"
- " \"node\": {\n"
- " \"id\": \"xds_end2end_test\",\n"
- " \"cluster\": \"test\",\n"
- " \"metadata\": {\n"
- " \"foo\": \"bar\"\n"
- " },\n"
- " \"locality\": {\n"
- " \"region\": \"corp\",\n"
- " \"zone\": \"svl\",\n"
- " \"sub_zone\": \"mp3\"\n"
- " }\n"
- " },\n"
- " \"server_listener_resource_name_template\": "
- "\"grpc/server?xds.resource.listening_address=%s\",\n"
- " \"certificate_providers\": {\n"
- " \"fake_plugin1\": {\n"
- " \"plugin_name\": \"fake1\"\n"
- " },\n"
- " \"fake_plugin2\": {\n"
- " \"plugin_name\": \"fake2\"\n"
- " },\n"
- " \"file_plugin\": {\n"
- " \"plugin_name\": \"file_watcher\",\n"
- " \"config\": {\n"
- " \"certificate_file\": \"src/core/tsi/test_creds/client.pem\",\n"
- " \"private_key_file\": \"src/core/tsi/test_creds/client.key\",\n"
- " \"ca_certificate_file\": \"src/core/tsi/test_creds/ca.pem\"\n"
- " }"
- " }\n"
- " }\n"
- "}\n";
-
-constexpr char kBootstrapFileV2[] =
- "{\n"
- " \"xds_servers\": [\n"
- " {\n"
- " \"server_uri\": \"fake:///xds_server\",\n"
- " \"channel_creds\": [\n"
- " {\n"
- " \"type\": \"fake\"\n"
- " }\n"
- " ]\n"
- " }\n"
- " ],\n"
- " \"node\": {\n"
- " \"id\": \"xds_end2end_test\",\n"
- " \"cluster\": \"test\",\n"
- " \"metadata\": {\n"
- " \"foo\": \"bar\"\n"
- " },\n"
- " \"locality\": {\n"
- " \"region\": \"corp\",\n"
- " \"zone\": \"svl\",\n"
- " \"sub_zone\": \"mp3\"\n"
- " }\n"
- " }\n"
- "}\n";
-constexpr char kCaCertPath[] = "src/core/tsi/test_creds/ca.pem";
-constexpr char kServerCertPath[] = "src/core/tsi/test_creds/server1.pem";
-constexpr char kServerKeyPath[] = "src/core/tsi/test_creds/server1.key";
-constexpr char kClientCertPath[] = "src/core/tsi/test_creds/client.pem";
-constexpr char kClientKeyPath[] = "src/core/tsi/test_creds/client.key";
-constexpr char kBadClientCertPath[] = "src/core/tsi/test_creds/badclient.pem";
-constexpr char kBadClientKeyPath[] = "src/core/tsi/test_creds/badclient.key";
-
-char* g_bootstrap_file_v3;
-char* g_bootstrap_file_v2;
-
-void WriteBootstrapFiles() {
- char* bootstrap_file;
- FILE* out = gpr_tmpfile("xds_bootstrap_v3", &bootstrap_file);
- fputs(kBootstrapFileV3, out);
- fclose(out);
- g_bootstrap_file_v3 = bootstrap_file;
- out = gpr_tmpfile("xds_bootstrap_v2", &bootstrap_file);
- fputs(kBootstrapFileV2, out);
- fclose(out);
- g_bootstrap_file_v2 = bootstrap_file;
-}
-
-template <typename ServiceType>
-class CountedService : public ServiceType {
- public:
- size_t request_count() {
- grpc_core::MutexLock lock(&mu_);
- return request_count_;
- }
-
- size_t response_count() {
- grpc_core::MutexLock lock(&mu_);
- return response_count_;
- }
-
- void IncreaseResponseCount() {
- grpc_core::MutexLock lock(&mu_);
- ++response_count_;
- }
- void IncreaseRequestCount() {
- grpc_core::MutexLock lock(&mu_);
- ++request_count_;
- }
-
- void ResetCounters() {
- grpc_core::MutexLock lock(&mu_);
- request_count_ = 0;
- response_count_ = 0;
- }
-
- private:
- grpc_core::Mutex mu_;
- size_t request_count_ = 0;
- size_t response_count_ = 0;
-};
-
-template <typename RpcService>
-class BackendServiceImpl
- : public CountedService<TestMultipleServiceImpl<RpcService>> {
- public:
- BackendServiceImpl() {}
-
- Status Echo(ServerContext* context, const EchoRequest* request,
- EchoResponse* response) override {
- auto peer_identity = context->auth_context()->GetPeerIdentity();
- CountedService<TestMultipleServiceImpl<RpcService>>::IncreaseRequestCount();
- const auto status =
- TestMultipleServiceImpl<RpcService>::Echo(context, request, response);
- CountedService<
- TestMultipleServiceImpl<RpcService>>::IncreaseResponseCount();
- {
- grpc_core::MutexLock lock(&mu_);
- clients_.insert(context->peer());
- last_peer_identity_.clear();
- for (const auto& entry : peer_identity) {
- last_peer_identity_.emplace_back(entry.data(), entry.size());
- }
- }
- return status;
- }
-
- Status Echo1(ServerContext* context, const EchoRequest* request,
- EchoResponse* response) override {
- return Echo(context, request, response);
- }
-
- Status Echo2(ServerContext* context, const EchoRequest* request,
- EchoResponse* response) override {
- return Echo(context, request, response);
- }
-
- void Start() {}
- void Shutdown() {}
-
- std::set<TString> clients() {
- grpc_core::MutexLock lock(&mu_);
- return clients_;
- }
-
- const std::vector<TString>& last_peer_identity() {
- grpc_core::MutexLock lock(&mu_);
- return last_peer_identity_;
- }
-
- private:
- grpc_core::Mutex mu_;
- std::set<TString> clients_;
- std::vector<TString> last_peer_identity_;
-};
-
-class ClientStats {
- public:
- struct LocalityStats {
- LocalityStats() {}
-
- // Converts from proto message class.
- template <class UpstreamLocalityStats>
- explicit LocalityStats(const UpstreamLocalityStats& upstream_locality_stats)
- : total_successful_requests(
- upstream_locality_stats.total_successful_requests()),
- total_requests_in_progress(
- upstream_locality_stats.total_requests_in_progress()),
- total_error_requests(upstream_locality_stats.total_error_requests()),
- total_issued_requests(
- upstream_locality_stats.total_issued_requests()) {}
-
- LocalityStats& operator+=(const LocalityStats& other) {
- total_successful_requests += other.total_successful_requests;
- total_requests_in_progress += other.total_requests_in_progress;
- total_error_requests += other.total_error_requests;
- total_issued_requests += other.total_issued_requests;
- return *this;
- }
-
- uint64_t total_successful_requests = 0;
- uint64_t total_requests_in_progress = 0;
- uint64_t total_error_requests = 0;
- uint64_t total_issued_requests = 0;
- };
-
- ClientStats() {}
-
- // Converts from proto message class.
- template <class ClusterStats>
- explicit ClientStats(const ClusterStats& cluster_stats)
- : cluster_name_(cluster_stats.cluster_name()),
- total_dropped_requests_(cluster_stats.total_dropped_requests()) {
- for (const auto& input_locality_stats :
- cluster_stats.upstream_locality_stats()) {
- locality_stats_.emplace(input_locality_stats.locality().sub_zone(),
- LocalityStats(input_locality_stats));
- }
- for (const auto& input_dropped_requests :
- cluster_stats.dropped_requests()) {
- dropped_requests_.emplace(input_dropped_requests.category(),
- input_dropped_requests.dropped_count());
- }
- }
-
- const TString& cluster_name() const { return cluster_name_; }
-
- const std::map<TString, LocalityStats>& locality_stats() const {
- return locality_stats_;
- }
- uint64_t total_successful_requests() const {
- uint64_t sum = 0;
- for (auto& p : locality_stats_) {
- sum += p.second.total_successful_requests;
- }
- return sum;
- }
- uint64_t total_requests_in_progress() const {
- uint64_t sum = 0;
- for (auto& p : locality_stats_) {
- sum += p.second.total_requests_in_progress;
- }
- return sum;
- }
- uint64_t total_error_requests() const {
- uint64_t sum = 0;
- for (auto& p : locality_stats_) {
- sum += p.second.total_error_requests;
- }
- return sum;
- }
- uint64_t total_issued_requests() const {
- uint64_t sum = 0;
- for (auto& p : locality_stats_) {
- sum += p.second.total_issued_requests;
- }
- return sum;
- }
-
- uint64_t total_dropped_requests() const { return total_dropped_requests_; }
-
- uint64_t dropped_requests(const TString& category) const {
- auto iter = dropped_requests_.find(category);
- GPR_ASSERT(iter != dropped_requests_.end());
- return iter->second;
- }
-
- ClientStats& operator+=(const ClientStats& other) {
- for (const auto& p : other.locality_stats_) {
- locality_stats_[p.first] += p.second;
- }
- total_dropped_requests_ += other.total_dropped_requests_;
- for (const auto& p : other.dropped_requests_) {
- dropped_requests_[p.first] += p.second;
- }
- return *this;
- }
-
- private:
- TString cluster_name_;
- std::map<TString, LocalityStats> locality_stats_;
- uint64_t total_dropped_requests_ = 0;
- std::map<TString, uint64_t> dropped_requests_;
-};
-
-class AdsServiceImpl : public std::enable_shared_from_this<AdsServiceImpl> {
- public:
- struct ResponseState {
- enum State { NOT_SENT, SENT, ACKED, NACKED };
- State state = NOT_SENT;
- TString error_message;
- };
-
- struct EdsResourceArgs {
- struct Locality {
- Locality(TString sub_zone, std::vector<int> ports,
- int lb_weight = kDefaultLocalityWeight,
- int priority = kDefaultLocalityPriority,
- std::vector<HealthStatus> health_statuses = {})
- : sub_zone(std::move(sub_zone)),
- ports(std::move(ports)),
- lb_weight(lb_weight),
- priority(priority),
- health_statuses(std::move(health_statuses)) {}
-
- const TString sub_zone;
- std::vector<int> ports;
- int lb_weight;
- int priority;
- std::vector<HealthStatus> health_statuses;
- };
-
- EdsResourceArgs() = default;
- explicit EdsResourceArgs(std::vector<Locality> locality_list)
- : locality_list(std::move(locality_list)) {}
-
- std::vector<Locality> locality_list;
- std::map<TString, uint32_t> drop_categories;
- FractionalPercent::DenominatorType drop_denominator =
- FractionalPercent::MILLION;
- };
-
- AdsServiceImpl()
- : v2_rpc_service_(this, /*is_v2=*/true),
- v3_rpc_service_(this, /*is_v2=*/false) {}
-
- bool seen_v2_client() const { return seen_v2_client_; }
- bool seen_v3_client() const { return seen_v3_client_; }
-
- ::envoy::service::discovery::v2::AggregatedDiscoveryService::Service*
- v2_rpc_service() {
- return &v2_rpc_service_;
- }
-
- ::envoy::service::discovery::v3::AggregatedDiscoveryService::Service*
- v3_rpc_service() {
- return &v3_rpc_service_;
- }
-
- ResponseState lds_response_state() {
- grpc_core::MutexLock lock(&ads_mu_);
- return resource_type_response_state_[kLdsTypeUrl];
- }
-
- ResponseState rds_response_state() {
- grpc_core::MutexLock lock(&ads_mu_);
- return resource_type_response_state_[kRdsTypeUrl];
- }
-
- ResponseState cds_response_state() {
- grpc_core::MutexLock lock(&ads_mu_);
- return resource_type_response_state_[kCdsTypeUrl];
- }
-
- ResponseState eds_response_state() {
- grpc_core::MutexLock lock(&ads_mu_);
- return resource_type_response_state_[kEdsTypeUrl];
- }
-
- void SetResourceIgnore(const TString& type_url) {
- grpc_core::MutexLock lock(&ads_mu_);
- resource_types_to_ignore_.emplace(type_url);
- }
-
- void SetResourceMinVersion(const TString& type_url, int version) {
- grpc_core::MutexLock lock(&ads_mu_);
- resource_type_min_versions_[type_url] = version;
- }
-
- void UnsetResource(const TString& type_url, const TString& name) {
- grpc_core::MutexLock lock(&ads_mu_);
- ResourceTypeState& resource_type_state = resource_map_[type_url];
- ++resource_type_state.resource_type_version;
- ResourceState& resource_state = resource_type_state.resource_name_map[name];
- resource_state.resource_type_version =
- resource_type_state.resource_type_version;
- resource_state.resource.reset();
- gpr_log(GPR_INFO,
- "ADS[%p]: Unsetting %s resource %s; resource_type_version now %u",
- this, type_url.c_str(), name.c_str(),
- resource_type_state.resource_type_version);
- for (SubscriptionState* subscription : resource_state.subscriptions) {
- subscription->update_queue->emplace_back(type_url, name);
- }
- }
-
- void SetResource(google::protobuf::Any resource, const TString& type_url,
- const TString& name) {
- grpc_core::MutexLock lock(&ads_mu_);
- ResourceTypeState& resource_type_state = resource_map_[type_url];
- ++resource_type_state.resource_type_version;
- ResourceState& resource_state = resource_type_state.resource_name_map[name];
- resource_state.resource_type_version =
- resource_type_state.resource_type_version;
- resource_state.resource = std::move(resource);
- gpr_log(GPR_INFO,
- "ADS[%p]: Updating %s resource %s; resource_type_version now %u",
- this, type_url.c_str(), name.c_str(),
- resource_type_state.resource_type_version);
- for (SubscriptionState* subscription : resource_state.subscriptions) {
- subscription->update_queue->emplace_back(type_url, name);
- }
- }
-
- void SetLdsResource(const Listener& listener) {
- google::protobuf::Any resource;
- resource.PackFrom(listener);
- SetResource(std::move(resource), kLdsTypeUrl, listener.name());
- }
-
- void SetRdsResource(const RouteConfiguration& route) {
- google::protobuf::Any resource;
- resource.PackFrom(route);
- SetResource(std::move(resource), kRdsTypeUrl, route.name());
- }
-
- void SetCdsResource(const Cluster& cluster) {
- google::protobuf::Any resource;
- resource.PackFrom(cluster);
- SetResource(std::move(resource), kCdsTypeUrl, cluster.name());
- }
-
- void SetEdsResource(const ClusterLoadAssignment& assignment) {
- google::protobuf::Any resource;
- resource.PackFrom(assignment);
- SetResource(std::move(resource), kEdsTypeUrl, assignment.cluster_name());
- }
-
- void Start() {
- grpc_core::MutexLock lock(&ads_mu_);
- ads_done_ = false;
- }
-
- void Shutdown() {
- {
- grpc_core::MutexLock lock(&ads_mu_);
- NotifyDoneWithAdsCallLocked();
- resource_type_response_state_.clear();
- }
- gpr_log(GPR_INFO, "ADS[%p]: shut down", this);
- }
-
- void NotifyDoneWithAdsCall() {
- grpc_core::MutexLock lock(&ads_mu_);
- NotifyDoneWithAdsCallLocked();
- }
-
- void NotifyDoneWithAdsCallLocked() {
- if (!ads_done_) {
- ads_done_ = true;
- ads_cond_.SignalAll();
- }
- }
-
- std::set<TString> clients() {
- grpc_core::MutexLock lock(&clients_mu_);
- return clients_;
- }
-
- private:
- // A queue of resource type/name pairs that have changed since the client
- // subscribed to them.
- using UpdateQueue = std::deque<
- std::pair<TString /* type url */, TString /* resource name */>>;
-
- // A struct representing a client's subscription to a particular resource.
- struct SubscriptionState {
- // The queue upon which to place updates when the resource is updated.
- UpdateQueue* update_queue;
- };
-
- // A struct representing the a client's subscription to all the resources.
- using SubscriptionNameMap =
- std::map<TString /* resource_name */, SubscriptionState>;
- using SubscriptionMap =
- std::map<TString /* type_url */, SubscriptionNameMap>;
-
- // Sent state for a given resource type.
- struct SentState {
- int nonce = 0;
- int resource_type_version = 0;
- };
-
- // A struct representing the current state for an individual resource.
- struct ResourceState {
- // The resource itself, if present.
- y_absl::optional<google::protobuf::Any> resource;
- // The resource type version that this resource was last updated in.
- int resource_type_version = 0;
- // A list of subscriptions to this resource.
- std::set<SubscriptionState*> subscriptions;
- };
-
- // The current state for all individual resources of a given type.
- using ResourceNameMap =
- std::map<TString /* resource_name */, ResourceState>;
-
- struct ResourceTypeState {
- int resource_type_version = 0;
- ResourceNameMap resource_name_map;
- };
-
- using ResourceMap = std::map<TString /* type_url */, ResourceTypeState>;
-
- template <class RpcApi, class DiscoveryRequest, class DiscoveryResponse>
- class RpcService : public RpcApi::Service {
- public:
- using Stream = ServerReaderWriter<DiscoveryResponse, DiscoveryRequest>;
-
- RpcService(AdsServiceImpl* parent, bool is_v2)
- : parent_(parent), is_v2_(is_v2) {}
-
- Status StreamAggregatedResources(ServerContext* context,
- Stream* stream) override {
- gpr_log(GPR_INFO, "ADS[%p]: StreamAggregatedResources starts", this);
- parent_->AddClient(context->peer());
- if (is_v2_) {
- parent_->seen_v2_client_ = true;
- } else {
- parent_->seen_v3_client_ = true;
- }
- // Take a reference of the AdsServiceImpl object, which will go
- // out of scope when this request handler returns. This ensures
- // that the parent won't be destroyed until this stream is complete.
- std::shared_ptr<AdsServiceImpl> ads_service_impl =
- parent_->shared_from_this();
- // Resources (type/name pairs) that have changed since the client
- // subscribed to them.
- UpdateQueue update_queue;
- // Resources that the client will be subscribed to keyed by resource type
- // url.
- SubscriptionMap subscription_map;
- // Sent state for each resource type.
- std::map<TString /*type_url*/, SentState> sent_state_map;
- // Spawn a thread to read requests from the stream.
- // Requests will be delivered to this thread in a queue.
- std::deque<DiscoveryRequest> requests;
- bool stream_closed = false;
- std::thread reader(std::bind(&RpcService::BlockingRead, this, stream,
- &requests, &stream_closed));
- // Main loop to process requests and updates.
- while (true) {
- // Boolean to keep track if the loop received any work to do: a
- // request or an update; regardless whether a response was actually
- // sent out.
- bool did_work = false;
- // Look for new requests and and decide what to handle.
- y_absl::optional<DiscoveryResponse> response;
- {
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- // If the stream has been closed or our parent is being shut
- // down, stop immediately.
- if (stream_closed || parent_->ads_done_) break;
- // Otherwise, see if there's a request to read from the queue.
- if (!requests.empty()) {
- DiscoveryRequest request = std::move(requests.front());
- requests.pop_front();
- did_work = true;
- gpr_log(GPR_INFO,
- "ADS[%p]: Received request for type %s with content %s",
- this, request.type_url().c_str(),
- request.DebugString().c_str());
- const TString v3_resource_type =
- TypeUrlToV3(request.type_url());
- SentState& sent_state = sent_state_map[v3_resource_type];
- // Process request.
- ProcessRequest(request, v3_resource_type, &update_queue,
- &subscription_map, &sent_state, &response);
- }
- }
- if (response.has_value()) {
- gpr_log(GPR_INFO, "ADS[%p]: Sending response: %s", this,
- response->DebugString().c_str());
- stream->Write(response.value());
- }
- response.reset();
- // Look for updates and decide what to handle.
- {
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- if (!update_queue.empty()) {
- const TString resource_type =
- std::move(update_queue.front().first);
- const TString resource_name =
- std::move(update_queue.front().second);
- update_queue.pop_front();
- did_work = true;
- SentState& sent_state = sent_state_map[resource_type];
- ProcessUpdate(resource_type, resource_name, &subscription_map,
- &sent_state, &response);
- }
- }
- if (response.has_value()) {
- gpr_log(GPR_INFO, "ADS[%p]: Sending update response: %s", this,
- response->DebugString().c_str());
- stream->Write(response.value());
- }
- // If we didn't find anything to do, delay before the next loop
- // iteration; otherwise, check whether we should exit and then
- // immediately continue.
- gpr_timespec deadline =
- grpc_timeout_milliseconds_to_deadline(did_work ? 0 : 10);
- {
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- if (!grpc_core::WaitUntilWithDeadline(
- &parent_->ads_cond_, &parent_->ads_mu_,
- [this] { return parent_->ads_done_; },
- grpc_core::ToAbslTime(deadline))) {
- break;
- }
- }
- }
- // Done with main loop. Clean up before returning.
- // Join reader thread.
- reader.join();
- // Clean up any subscriptions that were still active when the call
- // finished.
- {
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- for (auto& p : subscription_map) {
- const TString& type_url = p.first;
- SubscriptionNameMap& subscription_name_map = p.second;
- for (auto& q : subscription_name_map) {
- const TString& resource_name = q.first;
- SubscriptionState& subscription_state = q.second;
- ResourceNameMap& resource_name_map =
- parent_->resource_map_[type_url].resource_name_map;
- ResourceState& resource_state = resource_name_map[resource_name];
- resource_state.subscriptions.erase(&subscription_state);
- }
- }
- }
- gpr_log(GPR_INFO, "ADS[%p]: StreamAggregatedResources done", this);
- parent_->RemoveClient(context->peer());
- return Status::OK;
- }
-
- private:
- // Processes a response read from the client.
- // Populates response if needed.
- void ProcessRequest(const DiscoveryRequest& request,
- const TString& v3_resource_type,
- UpdateQueue* update_queue,
- SubscriptionMap* subscription_map,
- SentState* sent_state,
- y_absl::optional<DiscoveryResponse>* response) {
- // Check the nonce sent by the client, if any.
- // (This will be absent on the first request on a stream.)
- if (request.response_nonce().empty()) {
- int client_resource_type_version = 0;
- if (!request.version_info().empty()) {
- GPR_ASSERT(y_absl::SimpleAtoi(request.version_info(),
- &client_resource_type_version));
- }
- EXPECT_GE(client_resource_type_version,
- parent_->resource_type_min_versions_[v3_resource_type])
- << "resource_type: " << v3_resource_type;
- } else {
- int client_nonce;
- GPR_ASSERT(y_absl::SimpleAtoi(request.response_nonce(), &client_nonce));
- // Ignore requests with stale nonces.
- if (client_nonce < sent_state->nonce) return;
- // Check for ACK or NACK.
- auto it = parent_->resource_type_response_state_.find(v3_resource_type);
- if (it != parent_->resource_type_response_state_.end()) {
- if (!request.has_error_detail()) {
- it->second.state = ResponseState::ACKED;
- it->second.error_message.clear();
- gpr_log(GPR_INFO,
- "ADS[%p]: client ACKed resource_type=%s version=%s", this,
- request.type_url().c_str(), request.version_info().c_str());
- } else {
- it->second.state = ResponseState::NACKED;
- EXPECT_EQ(request.error_detail().code(),
- GRPC_STATUS_INVALID_ARGUMENT);
- it->second.error_message = request.error_detail().message();
- gpr_log(GPR_INFO,
- "ADS[%p]: client NACKed resource_type=%s version=%s: %s",
- this, request.type_url().c_str(),
- request.version_info().c_str(),
- it->second.error_message.c_str());
- }
- }
- }
- // Ignore resource types as requested by tests.
- if (parent_->resource_types_to_ignore_.find(v3_resource_type) !=
- parent_->resource_types_to_ignore_.end()) {
- return;
- }
- // Look at all the resource names in the request.
- auto& subscription_name_map = (*subscription_map)[v3_resource_type];
- auto& resource_type_state = parent_->resource_map_[v3_resource_type];
- auto& resource_name_map = resource_type_state.resource_name_map;
- std::set<TString> resources_in_current_request;
- std::set<TString> resources_added_to_response;
- for (const TString& resource_name : request.resource_names()) {
- resources_in_current_request.emplace(resource_name);
- auto& subscription_state = subscription_name_map[resource_name];
- auto& resource_state = resource_name_map[resource_name];
- // Subscribe if needed.
- // Send the resource in the response if either (a) this is
- // a new subscription or (b) there is an updated version of
- // this resource to send.
- if (parent_->MaybeSubscribe(v3_resource_type, resource_name,
- &subscription_state, &resource_state,
- update_queue) ||
- ClientNeedsResourceUpdate(resource_type_state, resource_state,
- sent_state->resource_type_version)) {
- gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this,
- request.type_url().c_str(), resource_name.c_str());
- resources_added_to_response.emplace(resource_name);
- if (!response->has_value()) response->emplace();
- if (resource_state.resource.has_value()) {
- auto* resource = (*response)->add_resources();
- resource->CopyFrom(resource_state.resource.value());
- if (is_v2_) {
- resource->set_type_url(request.type_url());
- }
- }
- } else {
- gpr_log(GPR_INFO,
- "ADS[%p]: client does not need update for type=%s name=%s",
- this, request.type_url().c_str(), resource_name.c_str());
- }
- }
- // Process unsubscriptions for any resource no longer
- // present in the request's resource list.
- parent_->ProcessUnsubscriptions(
- v3_resource_type, resources_in_current_request,
- &subscription_name_map, &resource_name_map);
- // Construct response if needed.
- if (!resources_added_to_response.empty()) {
- CompleteBuildingDiscoveryResponse(
- v3_resource_type, request.type_url(),
- resource_type_state.resource_type_version, subscription_name_map,
- resources_added_to_response, sent_state, &response->value());
- }
- }
-
- // Processes a resource update from the test.
- // Populates response if needed.
- void ProcessUpdate(const TString& resource_type,
- const TString& resource_name,
- SubscriptionMap* subscription_map, SentState* sent_state,
- y_absl::optional<DiscoveryResponse>* response) {
- const TString v2_resource_type = TypeUrlToV2(resource_type);
- gpr_log(GPR_INFO, "ADS[%p]: Received update for type=%s name=%s", this,
- resource_type.c_str(), resource_name.c_str());
- auto& subscription_name_map = (*subscription_map)[resource_type];
- auto& resource_type_state = parent_->resource_map_[resource_type];
- auto& resource_name_map = resource_type_state.resource_name_map;
- auto it = subscription_name_map.find(resource_name);
- if (it != subscription_name_map.end()) {
- ResourceState& resource_state = resource_name_map[resource_name];
- if (ClientNeedsResourceUpdate(resource_type_state, resource_state,
- sent_state->resource_type_version)) {
- gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this,
- resource_type.c_str(), resource_name.c_str());
- response->emplace();
- if (resource_state.resource.has_value()) {
- auto* resource = (*response)->add_resources();
- resource->CopyFrom(resource_state.resource.value());
- if (is_v2_) {
- resource->set_type_url(v2_resource_type);
- }
- }
- CompleteBuildingDiscoveryResponse(
- resource_type, v2_resource_type,
- resource_type_state.resource_type_version, subscription_name_map,
- {resource_name}, sent_state, &response->value());
- }
- }
- }
-
- // Starting a thread to do blocking read on the stream until cancel.
- void BlockingRead(Stream* stream, std::deque<DiscoveryRequest>* requests,
- bool* stream_closed) {
- DiscoveryRequest request;
- bool seen_first_request = false;
- while (stream->Read(&request)) {
- if (!seen_first_request) {
- EXPECT_TRUE(request.has_node());
- ASSERT_FALSE(request.node().client_features().empty());
- EXPECT_EQ(request.node().client_features(0),
- "envoy.lb.does_not_support_overprovisioning");
- CheckBuildVersion(request);
- seen_first_request = true;
- }
- {
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- requests->emplace_back(std::move(request));
- }
- }
- gpr_log(GPR_INFO, "ADS[%p]: Null read, stream closed", this);
- grpc_core::MutexLock lock(&parent_->ads_mu_);
- *stream_closed = true;
- }
-
- // Completing the building a DiscoveryResponse by adding common information
- // for all resources and by adding all subscribed resources for LDS and CDS.
- void CompleteBuildingDiscoveryResponse(
- const TString& resource_type, const TString& v2_resource_type,
- const int version, const SubscriptionNameMap& subscription_name_map,
- const std::set<TString>& resources_added_to_response,
- SentState* sent_state, DiscoveryResponse* response) {
- auto& response_state =
- parent_->resource_type_response_state_[resource_type];
- if (response_state.state == ResponseState::NOT_SENT) {
- response_state.state = ResponseState::SENT;
- }
- response->set_type_url(is_v2_ ? v2_resource_type : resource_type);
- response->set_version_info(ToString(version));
- response->set_nonce(ToString(++sent_state->nonce));
- if (resource_type == kLdsTypeUrl || resource_type == kCdsTypeUrl) {
- // For LDS and CDS we must send back all subscribed resources
- // (even the unchanged ones)
- for (const auto& p : subscription_name_map) {
- const TString& resource_name = p.first;
- if (resources_added_to_response.find(resource_name) ==
- resources_added_to_response.end()) {
- ResourceNameMap& resource_name_map =
- parent_->resource_map_[resource_type].resource_name_map;
- const ResourceState& resource_state =
- resource_name_map[resource_name];
- if (resource_state.resource.has_value()) {
- auto* resource = response->add_resources();
- resource->CopyFrom(resource_state.resource.value());
- if (is_v2_) {
- resource->set_type_url(v2_resource_type);
- }
- }
- }
- }
- }
- sent_state->resource_type_version = version;
- }
-
- static TString TypeUrlToV2(const TString& resource_type) {
- if (resource_type == kLdsTypeUrl) return kLdsV2TypeUrl;
- if (resource_type == kRdsTypeUrl) return kRdsV2TypeUrl;
- if (resource_type == kCdsTypeUrl) return kCdsV2TypeUrl;
- if (resource_type == kEdsTypeUrl) return kEdsV2TypeUrl;
- return resource_type;
- }
-
- static TString TypeUrlToV3(const TString& resource_type) {
- if (resource_type == kLdsV2TypeUrl) return kLdsTypeUrl;
- if (resource_type == kRdsV2TypeUrl) return kRdsTypeUrl;
- if (resource_type == kCdsV2TypeUrl) return kCdsTypeUrl;
- if (resource_type == kEdsV2TypeUrl) return kEdsTypeUrl;
- return resource_type;
- }
-
- static void CheckBuildVersion(
- const ::envoy::api::v2::DiscoveryRequest& request) {
- EXPECT_FALSE(request.node().build_version().empty());
- }
-
- static void CheckBuildVersion(
- const ::envoy::service::discovery::v3::DiscoveryRequest& /*request*/) {}
-
- AdsServiceImpl* parent_;
- const bool is_v2_;
- };
-
- // Checks whether the client needs to receive a newer version of
- // the resource.
- static bool ClientNeedsResourceUpdate(
- const ResourceTypeState& resource_type_state,
- const ResourceState& resource_state, int client_resource_type_version) {
- return client_resource_type_version <
- resource_type_state.resource_type_version &&
- resource_state.resource_type_version <=
- resource_type_state.resource_type_version;
- }
-
- // Subscribes to a resource if not already subscribed:
- // 1. Sets the update_queue field in subscription_state.
- // 2. Adds subscription_state to resource_state->subscriptions.
- bool MaybeSubscribe(const TString& resource_type,
- const TString& resource_name,
- SubscriptionState* subscription_state,
- ResourceState* resource_state,
- UpdateQueue* update_queue) {
- // The update_queue will be null if we were not previously subscribed.
- if (subscription_state->update_queue != nullptr) return false;
- subscription_state->update_queue = update_queue;
- resource_state->subscriptions.emplace(subscription_state);
- gpr_log(GPR_INFO, "ADS[%p]: subscribe to resource type %s name %s state %p",
- this, resource_type.c_str(), resource_name.c_str(),
- &subscription_state);
- return true;
- }
-
- // Removes subscriptions for resources no longer present in the
- // current request.
- void ProcessUnsubscriptions(
- const TString& resource_type,
- const std::set<TString>& resources_in_current_request,
- SubscriptionNameMap* subscription_name_map,
- ResourceNameMap* resource_name_map) {
- for (auto it = subscription_name_map->begin();
- it != subscription_name_map->end();) {
- const TString& resource_name = it->first;
- SubscriptionState& subscription_state = it->second;
- if (resources_in_current_request.find(resource_name) !=
- resources_in_current_request.end()) {
- ++it;
- continue;
- }
- gpr_log(GPR_INFO, "ADS[%p]: Unsubscribe to type=%s name=%s state=%p",
- this, resource_type.c_str(), resource_name.c_str(),
- &subscription_state);
- auto resource_it = resource_name_map->find(resource_name);
- GPR_ASSERT(resource_it != resource_name_map->end());
- auto& resource_state = resource_it->second;
- resource_state.subscriptions.erase(&subscription_state);
- if (resource_state.subscriptions.empty() &&
- !resource_state.resource.has_value()) {
- resource_name_map->erase(resource_it);
- }
- it = subscription_name_map->erase(it);
- }
- }
-
- void AddClient(const TString& client) {
- grpc_core::MutexLock lock(&clients_mu_);
- clients_.insert(client);
- }
-
- void RemoveClient(const TString& client) {
- grpc_core::MutexLock lock(&clients_mu_);
- clients_.erase(client);
- }
-
- RpcService<::envoy::service::discovery::v2::AggregatedDiscoveryService,
- ::envoy::api::v2::DiscoveryRequest,
- ::envoy::api::v2::DiscoveryResponse>
- v2_rpc_service_;
- RpcService<::envoy::service::discovery::v3::AggregatedDiscoveryService,
- ::envoy::service::discovery::v3::DiscoveryRequest,
- ::envoy::service::discovery::v3::DiscoveryResponse>
- v3_rpc_service_;
-
- std::atomic_bool seen_v2_client_{false};
- std::atomic_bool seen_v3_client_{false};
-
- grpc_core::CondVar ads_cond_;
- // Protect the members below.
- grpc_core::Mutex ads_mu_;
- bool ads_done_ = false;
- std::map<TString /* type_url */, ResponseState>
- resource_type_response_state_;
- std::set<TString /*resource_type*/> resource_types_to_ignore_;
- std::map<TString /*resource_type*/, int> resource_type_min_versions_;
- // An instance data member containing the current state of all resources.
- // Note that an entry will exist whenever either of the following is true:
- // - The resource exists (i.e., has been created by SetResource() and has not
- // yet been destroyed by UnsetResource()).
- // - There is at least one subscription for the resource.
- ResourceMap resource_map_;
-
- grpc_core::Mutex clients_mu_;
- std::set<TString> clients_;
-};
-
-class LrsServiceImpl : public std::enable_shared_from_this<LrsServiceImpl> {
- public:
- explicit LrsServiceImpl(int client_load_reporting_interval_seconds)
- : v2_rpc_service_(this),
- v3_rpc_service_(this),
- client_load_reporting_interval_seconds_(
- client_load_reporting_interval_seconds),
- cluster_names_({kDefaultClusterName}) {}
-
- ::envoy::service::load_stats::v2::LoadReportingService::Service*
- v2_rpc_service() {
- return &v2_rpc_service_;
- }
-
- ::envoy::service::load_stats::v3::LoadReportingService::Service*
- v3_rpc_service() {
- return &v3_rpc_service_;
- }
-
- size_t request_count() {
- return v2_rpc_service_.request_count() + v3_rpc_service_.request_count();
- }
-
- size_t response_count() {
- return v2_rpc_service_.response_count() + v3_rpc_service_.response_count();
- }
-
- // Must be called before the LRS call is started.
- void set_send_all_clusters(bool send_all_clusters) {
- send_all_clusters_ = send_all_clusters;
- }
- void set_cluster_names(const std::set<TString>& cluster_names) {
- cluster_names_ = cluster_names;
- }
-
- void Start() {
- lrs_done_ = false;
- result_queue_.clear();
- }
-
- void Shutdown() {
- {
- grpc_core::MutexLock lock(&lrs_mu_);
- NotifyDoneWithLrsCallLocked();
- }
- gpr_log(GPR_INFO, "LRS[%p]: shut down", this);
- }
-
- std::vector<ClientStats> WaitForLoadReport() {
- grpc_core::MutexLock lock(&load_report_mu_);
- grpc_core::CondVar cv;
- if (result_queue_.empty()) {
- load_report_cond_ = &cv;
- grpc_core::WaitUntil(load_report_cond_, &load_report_mu_,
- [this] { return !result_queue_.empty(); });
- load_report_cond_ = nullptr;
- }
- std::vector<ClientStats> result = std::move(result_queue_.front());
- result_queue_.pop_front();
- return result;
- }
-
- void NotifyDoneWithLrsCall() {
- grpc_core::MutexLock lock(&lrs_mu_);
- NotifyDoneWithLrsCallLocked();
- }
-
- private:
- template <class RpcApi, class LoadStatsRequest, class LoadStatsResponse>
- class RpcService : public CountedService<typename RpcApi::Service> {
- public:
- using Stream = ServerReaderWriter<LoadStatsResponse, LoadStatsRequest>;
-
- explicit RpcService(LrsServiceImpl* parent) : parent_(parent) {}
-
- Status StreamLoadStats(ServerContext* /*context*/,
- Stream* stream) override {
- gpr_log(GPR_INFO, "LRS[%p]: StreamLoadStats starts", this);
- EXPECT_GT(parent_->client_load_reporting_interval_seconds_, 0);
- // Take a reference of the LrsServiceImpl object, reference will go
- // out of scope after this method exits.
- std::shared_ptr<LrsServiceImpl> lrs_service_impl =
- parent_->shared_from_this();
- // Read initial request.
- LoadStatsRequest request;
- if (stream->Read(&request)) {
- CountedService<typename RpcApi::Service>::IncreaseRequestCount();
- // Verify client features.
- EXPECT_THAT(
- request.node().client_features(),
- ::testing::Contains("envoy.lrs.supports_send_all_clusters"));
- // Send initial response.
- LoadStatsResponse response;
- if (parent_->send_all_clusters_) {
- response.set_send_all_clusters(true);
- } else {
- for (const TString& cluster_name : parent_->cluster_names_) {
- response.add_clusters(cluster_name);
- }
- }
- response.mutable_load_reporting_interval()->set_seconds(
- parent_->client_load_reporting_interval_seconds_);
- stream->Write(response);
- CountedService<typename RpcApi::Service>::IncreaseResponseCount();
- // Wait for report.
- request.Clear();
- while (stream->Read(&request)) {
- gpr_log(GPR_INFO, "LRS[%p]: received client load report message: %s",
- this, request.DebugString().c_str());
- std::vector<ClientStats> stats;
- for (const auto& cluster_stats : request.cluster_stats()) {
- stats.emplace_back(cluster_stats);
- }
- grpc_core::MutexLock lock(&parent_->load_report_mu_);
- parent_->result_queue_.emplace_back(std::move(stats));
- if (parent_->load_report_cond_ != nullptr) {
- parent_->load_report_cond_->Signal();
- }
- }
- // Wait until notified done.
- grpc_core::MutexLock lock(&parent_->lrs_mu_);
- grpc_core::WaitUntil(&parent_->lrs_cv_, &parent_->lrs_mu_,
- [this] { return parent_->lrs_done_; });
- }
- gpr_log(GPR_INFO, "LRS[%p]: StreamLoadStats done", this);
- return Status::OK;
- }
-
- private:
- LrsServiceImpl* parent_;
- };
-
- void NotifyDoneWithLrsCallLocked() {
- if (!lrs_done_) {
- lrs_done_ = true;
- lrs_cv_.SignalAll();
- }
- }
-
- RpcService<::envoy::service::load_stats::v2::LoadReportingService,
- ::envoy::service::load_stats::v2::LoadStatsRequest,
- ::envoy::service::load_stats::v2::LoadStatsResponse>
- v2_rpc_service_;
- RpcService<::envoy::service::load_stats::v3::LoadReportingService,
- ::envoy::service::load_stats::v3::LoadStatsRequest,
- ::envoy::service::load_stats::v3::LoadStatsResponse>
- v3_rpc_service_;
-
- const int client_load_reporting_interval_seconds_;
- bool send_all_clusters_ = false;
- std::set<TString> cluster_names_;
-
- grpc_core::CondVar lrs_cv_;
- grpc_core::Mutex lrs_mu_; // Protects lrs_done_.
- bool lrs_done_ = false;
-
- grpc_core::Mutex load_report_mu_; // Protects the members below.
- grpc_core::CondVar* load_report_cond_ = nullptr;
- std::deque<std::vector<ClientStats>> result_queue_;
-};
-
-class TestType {
- public:
- enum FilterConfigSetup {
- // Set the fault injection filter directly from LDS
- kHTTPConnectionManagerOriginal,
- // Enable the fault injection filter in LDS, but override the filter config
- // in route.
- kRouteOverride,
- };
-
- TestType& set_use_fake_resolver() {
- use_fake_resolver_ = true;
- return *this;
- }
-
- TestType& set_enable_load_reporting() {
- enable_load_reporting_ = true;
- return *this;
- }
-
- TestType& set_enable_rds_testing() {
- enable_rds_testing_ = true;
- return *this;
- }
-
- TestType& set_use_v2() {
- use_v2_ = true;
- return *this;
- }
-
- TestType& set_use_xds_credentials() {
- use_xds_credentials_ = true;
- return *this;
- }
-
- TestType& set_use_csds_streaming() {
- use_csds_streaming_ = true;
- return *this;
- }
-
- TestType& set_filter_config_setup(const FilterConfigSetup& setup) {
- filter_config_setup_ = setup;
- return *this;
- }
-
- bool use_fake_resolver() const { return use_fake_resolver_; }
- bool enable_load_reporting() const { return enable_load_reporting_; }
- bool enable_rds_testing() const { return enable_rds_testing_; }
- bool use_v2() const { return use_v2_; }
- bool use_xds_credentials() const { return use_xds_credentials_; }
- bool use_csds_streaming() const { return use_csds_streaming_; }
- const FilterConfigSetup& filter_config_setup() const {
- return filter_config_setup_;
- }
-
- TString AsString() const {
- TString retval = (use_fake_resolver_ ? "FakeResolver" : "XdsResolver");
- retval += (use_v2_ ? "V2" : "V3");
- if (enable_load_reporting_) retval += "WithLoadReporting";
- if (enable_rds_testing_) retval += "Rds";
- if (use_xds_credentials_) retval += "XdsCreds";
- if (use_csds_streaming_) retval += "CsdsStreaming";
- if (filter_config_setup_ == kRouteOverride) {
- retval += "FilterPerRouteOverride";
- }
- return retval;
- }
-
- private:
- bool use_fake_resolver_ = false;
- bool enable_load_reporting_ = false;
- bool enable_rds_testing_ = false;
- bool use_v2_ = false;
- bool use_xds_credentials_ = false;
- bool use_csds_streaming_ = false;
- FilterConfigSetup filter_config_setup_ = kHTTPConnectionManagerOriginal;
-};
-
-TString ReadFile(const char* file_path) {
- grpc_slice slice;
- GPR_ASSERT(
- GRPC_LOG_IF_ERROR("load_file", grpc_load_file(file_path, 0, &slice)));
- TString file_contents(grpc_core::StringViewFromSlice(slice));
- grpc_slice_unref(slice);
- return file_contents;
-}
-
-grpc_core::PemKeyCertPairList ReadTlsIdentityPair(const char* key_path,
- const char* cert_path) {
- return grpc_core::PemKeyCertPairList{
- grpc_core::PemKeyCertPair(ReadFile(key_path), ReadFile(cert_path))};
-}
-
-// Based on StaticDataCertificateProvider, but provides alternate certificates
-// if the certificate name is not empty.
-class FakeCertificateProvider final : public grpc_tls_certificate_provider {
- public:
- struct CertData {
- TString root_certificate;
- grpc_core::PemKeyCertPairList identity_key_cert_pairs;
- };
-
- using CertDataMap = std::map<TString /*cert_name */, CertData>;
-
- explicit FakeCertificateProvider(CertDataMap cert_data_map)
- : distributor_(
- grpc_core::MakeRefCounted<grpc_tls_certificate_distributor>()),
- cert_data_map_(std::move(cert_data_map)) {
- distributor_->SetWatchStatusCallback([this](TString cert_name,
- bool root_being_watched,
- bool identity_being_watched) {
- if (!root_being_watched && !identity_being_watched) return;
- auto it = cert_data_map_.find(cert_name);
- if (it == cert_data_map_.end()) {
- grpc_error* error = GRPC_ERROR_CREATE_FROM_COPIED_STRING(
- y_absl::StrCat("No certificates available for cert_name \"",
- cert_name, "\"")
- .c_str());
- distributor_->SetErrorForCert(cert_name, GRPC_ERROR_REF(error),
- GRPC_ERROR_REF(error));
- GRPC_ERROR_UNREF(error);
- } else {
- y_absl::optional<TString> root_certificate;
- y_absl::optional<grpc_core::PemKeyCertPairList> pem_key_cert_pairs;
- if (root_being_watched) {
- root_certificate = it->second.root_certificate;
- }
- if (identity_being_watched) {
- pem_key_cert_pairs = it->second.identity_key_cert_pairs;
- }
- distributor_->SetKeyMaterials(cert_name, std::move(root_certificate),
- std::move(pem_key_cert_pairs));
- }
- });
- }
-
- ~FakeCertificateProvider() override {
- distributor_->SetWatchStatusCallback(nullptr);
- }
-
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor()
- const override {
- return distributor_;
- }
-
- private:
- grpc_core::RefCountedPtr<grpc_tls_certificate_distributor> distributor_;
- CertDataMap cert_data_map_;
-};
-
-class FakeCertificateProviderFactory
- : public grpc_core::CertificateProviderFactory {
- public:
- class Config : public grpc_core::CertificateProviderFactory::Config {
- public:
- explicit Config(const char* name) : name_(name) {}
-
- const char* name() const override { return name_; }
-
- TString ToString() const override { return "{}"; }
-
- private:
- const char* name_;
- };
-
- FakeCertificateProviderFactory(
- const char* name, FakeCertificateProvider::CertDataMap** cert_data_map)
- : name_(name), cert_data_map_(cert_data_map) {
- GPR_ASSERT(cert_data_map != nullptr);
- }
-
- const char* name() const override { return name_; }
-
- grpc_core::RefCountedPtr<grpc_core::CertificateProviderFactory::Config>
- CreateCertificateProviderConfig(const grpc_core::Json& /*config_json*/,
- grpc_error** /*error*/) override {
- return grpc_core::MakeRefCounted<Config>(name_);
- }
-
- grpc_core::RefCountedPtr<grpc_tls_certificate_provider>
- CreateCertificateProvider(
- grpc_core::RefCountedPtr<grpc_core::CertificateProviderFactory::Config>
- /*config*/) override {
- if (*cert_data_map_ == nullptr) return nullptr;
- return grpc_core::MakeRefCounted<FakeCertificateProvider>(**cert_data_map_);
- }
-
- private:
- const char* name_;
- FakeCertificateProvider::CertDataMap** cert_data_map_;
-};
-
-// Global variables for each provider.
-FakeCertificateProvider::CertDataMap* g_fake1_cert_data_map = nullptr;
-FakeCertificateProvider::CertDataMap* g_fake2_cert_data_map = nullptr;
-
-int ServerAuthCheckSchedule(void* /* config_user_data */,
- grpc_tls_server_authorization_check_arg* arg) {
- arg->success = 1;
- arg->status = GRPC_STATUS_OK;
- return 0; /* synchronous check */
-}
-
-std::shared_ptr<ChannelCredentials> CreateTlsFallbackCredentials() {
- // TODO(yashykt): Switch to using C++ API once b/173823806 is fixed.
- grpc_tls_credentials_options* options = grpc_tls_credentials_options_create();
- grpc_tls_credentials_options_set_server_verification_option(
- options, GRPC_TLS_SKIP_HOSTNAME_VERIFICATION);
- grpc_tls_credentials_options_set_certificate_provider(
- options,
- grpc_core::MakeRefCounted<grpc_core::StaticDataCertificateProvider>(
- ReadFile(kCaCertPath),
- ReadTlsIdentityPair(kServerKeyPath, kServerCertPath))
- .get());
- grpc_tls_credentials_options_watch_root_certs(options);
- grpc_tls_credentials_options_watch_identity_key_cert_pairs(options);
- grpc_tls_server_authorization_check_config* check_config =
- grpc_tls_server_authorization_check_config_create(
- nullptr, ServerAuthCheckSchedule, nullptr, nullptr);
- grpc_tls_credentials_options_set_server_authorization_check_config(
- options, check_config);
- auto channel_creds = std::make_shared<SecureChannelCredentials>(
- grpc_tls_credentials_create(options));
- grpc_tls_server_authorization_check_config_release(check_config);
- return channel_creds;
-}
-
-// A No-op HTTP filter used for verifying parsing logic.
-class NoOpHttpFilter : public grpc_core::XdsHttpFilterImpl {
- public:
- NoOpHttpFilter(TString name, bool supported_on_clients,
- bool supported_on_servers)
- : name_(std::move(name)),
- supported_on_clients_(supported_on_clients),
- supported_on_servers_(supported_on_servers) {}
-
- void PopulateSymtab(upb_symtab* /* symtab */) const override {}
-
- y_absl::StatusOr<grpc_core::XdsHttpFilterImpl::FilterConfig>
- GenerateFilterConfig(upb_strview /* serialized_filter_config */,
- upb_arena* /* arena */) const override {
- return grpc_core::XdsHttpFilterImpl::FilterConfig{name_, grpc_core::Json()};
- }
-
- y_absl::StatusOr<grpc_core::XdsHttpFilterImpl::FilterConfig>
- GenerateFilterConfigOverride(upb_strview /*serialized_filter_config*/,
- upb_arena* /*arena*/) const override {
- return grpc_core::XdsHttpFilterImpl::FilterConfig{name_, grpc_core::Json()};
- }
-
- const grpc_channel_filter* channel_filter() const override { return nullptr; }
-
- y_absl::StatusOr<grpc_core::XdsHttpFilterImpl::ServiceConfigJsonEntry>
- GenerateServiceConfig(
- const FilterConfig& /*hcm_filter_config*/,
- const FilterConfig* /*filter_config_override*/) const override {
- return grpc_core::XdsHttpFilterImpl::ServiceConfigJsonEntry{name_, ""};
- }
-
- bool IsSupportedOnClients() const override { return supported_on_clients_; }
-
- bool IsSupportedOnServers() const override { return supported_on_servers_; }
-
- private:
- const TString name_;
- const bool supported_on_clients_;
- const bool supported_on_servers_;
-};
-
-namespace {
-
-void* response_generator_arg_copy(void* p) {
- auto* generator = static_cast<grpc_core::FakeResolverResponseGenerator*>(p);
- generator->Ref().release();
- return p;
-}
-
-void response_generator_arg_destroy(void* p) {
- auto* generator = static_cast<grpc_core::FakeResolverResponseGenerator*>(p);
- generator->Unref();
-}
-
-int response_generator_cmp(void* a, void* b) { return GPR_ICMP(a, b); }
-
-const grpc_arg_pointer_vtable
- kLogicalDnsClusterResolverResponseGeneratorVtable = {
- response_generator_arg_copy, response_generator_arg_destroy,
- response_generator_cmp};
-
-// There is slight difference between time fetched by GPR and by C++ system
-// clock API. It's unclear if they are using the same syscall, but we do know
-// GPR round the number at millisecond-level. This creates a 1ms difference,
-// which could cause flake.
-grpc_millis NowFromCycleCounter() {
- gpr_cycle_counter now = gpr_get_cycle_counter();
- return grpc_cycle_counter_to_millis_round_up(now);
-}
-
-} // namespace
-
-class XdsEnd2endTest : public ::testing::TestWithParam<TestType> {
- protected:
- // TODO(roth): We currently set the number of backends and number of
- // balancers on a per-test-suite basis, not a per-test-case basis.
- // However, not every individual test case in a given test suite uses
- // the same number of backends or balancers, so we wind up having to
- // set the numbers for the test suite to the max number needed by any
- // one test case in that test suite. This results in starting more
- // servers (and using more ports) than we actually need. When we have
- // time, change each test to directly start the number of backends and
- // balancers that it needs, so that we aren't wasting resources.
- XdsEnd2endTest(size_t num_backends, size_t num_balancers,
- int client_load_reporting_interval_seconds = 100,
- bool use_xds_enabled_server = false,
- bool bootstrap_contents_from_env_var = false)
- : num_backends_(num_backends),
- num_balancers_(num_balancers),
- client_load_reporting_interval_seconds_(
- client_load_reporting_interval_seconds),
- use_xds_enabled_server_(use_xds_enabled_server),
- bootstrap_contents_from_env_var_(bootstrap_contents_from_env_var) {}
-
- void SetUp() override {
- if (bootstrap_contents_from_env_var_) {
- gpr_setenv("GRPC_XDS_BOOTSTRAP_CONFIG",
- GetParam().use_v2() ? kBootstrapFileV2 : kBootstrapFileV3);
- } else {
- gpr_setenv("GRPC_XDS_BOOTSTRAP", GetParam().use_v2()
- ? g_bootstrap_file_v2
- : g_bootstrap_file_v3);
- }
- bool localhost_resolves_to_ipv4 = false;
- bool localhost_resolves_to_ipv6 = false;
- grpc_core::LocalhostResolves(&localhost_resolves_to_ipv4,
- &localhost_resolves_to_ipv6);
- ipv6_only_ = !localhost_resolves_to_ipv4 && localhost_resolves_to_ipv6;
- // Initialize default xDS resources.
- // Construct LDS resource.
- default_listener_.set_name(kServerName);
- HttpConnectionManager http_connection_manager;
- if (!GetParam().use_v2()) {
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("router");
- filter->mutable_typed_config()->PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- }
- default_listener_.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- // Construct RDS resource.
- default_route_config_.set_name(kDefaultRouteConfigurationName);
- auto* virtual_host = default_route_config_.add_virtual_hosts();
- virtual_host->add_domains("*");
- auto* route = virtual_host->add_routes();
- route->mutable_match()->set_prefix("");
- route->mutable_route()->set_cluster(kDefaultClusterName);
- // Construct CDS resource.
- default_cluster_.set_name(kDefaultClusterName);
- default_cluster_.set_type(Cluster::EDS);
- auto* eds_config = default_cluster_.mutable_eds_cluster_config();
- eds_config->mutable_eds_config()->mutable_ads();
- eds_config->set_service_name(kDefaultEdsServiceName);
- default_cluster_.set_lb_policy(Cluster::ROUND_ROBIN);
- if (GetParam().enable_load_reporting()) {
- default_cluster_.mutable_lrs_server()->mutable_self();
- }
- // Start the load balancers.
- for (size_t i = 0; i < num_balancers_; ++i) {
- balancers_.emplace_back(
- new BalancerServerThread(GetParam().enable_load_reporting()
- ? client_load_reporting_interval_seconds_
- : 0));
- balancers_.back()->Start();
- // Initialize resources.
- SetListenerAndRouteConfiguration(i, default_listener_,
- default_route_config_);
- balancers_.back()->ads_service()->SetCdsResource(default_cluster_);
- }
- // Initialize XdsClient state.
- response_generator_ =
- grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>();
- // Inject xDS channel response generator.
- lb_channel_response_generator_ =
- grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>();
- xds_channel_args_to_add_.emplace_back(
- grpc_core::FakeResolverResponseGenerator::MakeChannelArg(
- lb_channel_response_generator_.get()));
- // Inject xDS logical cluster resolver response generator.
- logical_dns_cluster_resolver_response_generator_ =
- grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>();
- if (xds_resource_does_not_exist_timeout_ms_ > 0) {
- xds_channel_args_to_add_.emplace_back(grpc_channel_arg_integer_create(
- const_cast<char*>(GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS),
- xds_resource_does_not_exist_timeout_ms_));
- }
- xds_channel_args_.num_args = xds_channel_args_to_add_.size();
- xds_channel_args_.args = xds_channel_args_to_add_.data();
- grpc_core::internal::SetXdsChannelArgsForTest(&xds_channel_args_);
- // Make sure each test creates a new XdsClient instance rather than
- // reusing the one from the previous test. This avoids spurious failures
- // caused when a load reporting test runs after a non-load reporting test
- // and the XdsClient is still talking to the old LRS server, which fails
- // because it's not expecting the client to connect. It also
- // ensures that each test can independently set the global channel
- // args for the xDS channel.
- grpc_core::internal::UnsetGlobalXdsClientForTest();
- // Start the backends.
- for (size_t i = 0; i < num_backends_; ++i) {
- backends_.emplace_back(new BackendServerThread(use_xds_enabled_server_));
- backends_.back()->Start();
- }
- // Create channel and stub.
- ResetStub();
- }
-
- const char* DefaultEdsServiceName() const {
- return GetParam().use_fake_resolver() ? kServerName
- : kDefaultEdsServiceName;
- }
-
- void TearDown() override {
- ShutdownAllBackends();
- for (auto& balancer : balancers_) balancer->Shutdown();
- // Clear global xDS channel args, since they will go out of scope
- // when this test object is destroyed.
- grpc_core::internal::SetXdsChannelArgsForTest(nullptr);
- gpr_unsetenv("GRPC_XDS_BOOTSTRAP");
- gpr_unsetenv("GRPC_XDS_BOOTSTRAP_CONFIG");
- }
-
- void StartAllBackends() {
- for (auto& backend : backends_) backend->Start();
- }
-
- void StartBackend(size_t index) { backends_[index]->Start(); }
-
- void ShutdownAllBackends() {
- for (auto& backend : backends_) backend->Shutdown();
- }
-
- void ShutdownBackend(size_t index) { backends_[index]->Shutdown(); }
-
- void ResetStub(int failover_timeout = 0) {
- channel_ = CreateChannel(failover_timeout);
- stub_ = grpc::testing::EchoTestService::NewStub(channel_);
- stub1_ = grpc::testing::EchoTest1Service::NewStub(channel_);
- stub2_ = grpc::testing::EchoTest2Service::NewStub(channel_);
- }
-
- std::shared_ptr<Channel> CreateChannel(
- int failover_timeout = 0, const char* server_name = kServerName,
- grpc_core::FakeResolverResponseGenerator* response_generator = nullptr) {
- ChannelArguments args;
- if (failover_timeout > 0) {
- args.SetInt(GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS, failover_timeout);
- }
- // If the parent channel is using the fake resolver, we inject the
- // response generator here.
- if (GetParam().use_fake_resolver()) {
- if (response_generator == nullptr) {
- response_generator = response_generator_.get();
- }
- args.SetPointer(GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR,
- response_generator);
- }
- args.SetPointerWithVtable(
- GRPC_ARG_XDS_LOGICAL_DNS_CLUSTER_FAKE_RESOLVER_RESPONSE_GENERATOR,
- logical_dns_cluster_resolver_response_generator_.get(),
- &kLogicalDnsClusterResolverResponseGeneratorVtable);
- TString uri = y_absl::StrCat(
- GetParam().use_fake_resolver() ? "fake" : "xds", ":///", server_name);
- std::shared_ptr<ChannelCredentials> channel_creds =
- GetParam().use_xds_credentials()
- ? experimental::XdsCredentials(CreateTlsFallbackCredentials())
- : std::make_shared<SecureChannelCredentials>(
- grpc_fake_transport_security_credentials_create());
- return ::grpc::CreateCustomChannel(uri, channel_creds, args);
- }
-
- enum RpcService {
- SERVICE_ECHO,
- SERVICE_ECHO1,
- SERVICE_ECHO2,
- };
-
- enum RpcMethod {
- METHOD_ECHO,
- METHOD_ECHO1,
- METHOD_ECHO2,
- };
-
- struct RpcOptions {
- RpcService service = SERVICE_ECHO;
- RpcMethod method = METHOD_ECHO;
- int timeout_ms = 1000;
- bool wait_for_ready = false;
- bool server_fail = false;
- std::vector<std::pair<TString, TString>> metadata;
- int client_cancel_after_us = 0;
- bool skip_cancelled_check = false;
-
- RpcOptions() {}
-
- RpcOptions& set_rpc_service(RpcService rpc_service) {
- service = rpc_service;
- return *this;
- }
-
- RpcOptions& set_rpc_method(RpcMethod rpc_method) {
- method = rpc_method;
- return *this;
- }
-
- RpcOptions& set_timeout_ms(int rpc_timeout_ms) {
- timeout_ms = rpc_timeout_ms;
- return *this;
- }
-
- RpcOptions& set_wait_for_ready(bool rpc_wait_for_ready) {
- wait_for_ready = rpc_wait_for_ready;
- return *this;
- }
-
- RpcOptions& set_server_fail(bool rpc_server_fail) {
- server_fail = rpc_server_fail;
- return *this;
- }
-
- RpcOptions& set_skip_cancelled_check(bool rpc_skip_cancelled_check) {
- skip_cancelled_check = rpc_skip_cancelled_check;
- return *this;
- }
-
- RpcOptions& set_metadata(
- std::vector<std::pair<TString, TString>> rpc_metadata) {
- metadata = std::move(rpc_metadata);
- return *this;
- }
-
- RpcOptions& set_client_cancel_after_us(int rpc_client_cancel_after_us) {
- client_cancel_after_us = rpc_client_cancel_after_us;
- return *this;
- }
-
- // Populates context and request.
- void SetupRpc(ClientContext* context, EchoRequest* request) const {
- for (const auto& item : metadata) {
- context->AddMetadata(item.first, item.second);
- }
- if (timeout_ms != 0) {
- context->set_deadline(
- grpc_timeout_milliseconds_to_deadline(timeout_ms));
- }
- if (wait_for_ready) context->set_wait_for_ready(true);
- request->set_message(kRequestMessage);
- if (server_fail) {
- request->mutable_param()->mutable_expected_error()->set_code(
- GRPC_STATUS_FAILED_PRECONDITION);
- }
- if (client_cancel_after_us != 0) {
- request->mutable_param()->set_client_cancel_after_us(
- client_cancel_after_us);
- }
- if (skip_cancelled_check) {
- request->mutable_param()->set_skip_cancelled_check(true);
- }
- }
- };
-
- template <typename Stub>
- Status SendRpcMethod(Stub* stub, const RpcOptions& rpc_options,
- ClientContext* context, EchoRequest& request,
- EchoResponse* response) {
- switch (rpc_options.method) {
- case METHOD_ECHO:
- return (*stub)->Echo(context, request, response);
- case METHOD_ECHO1:
- return (*stub)->Echo1(context, request, response);
- case METHOD_ECHO2:
- return (*stub)->Echo2(context, request, response);
- }
- GPR_UNREACHABLE_CODE();
- }
-
- void ResetBackendCounters(size_t start_index = 0, size_t stop_index = 0) {
- if (stop_index == 0) stop_index = backends_.size();
- for (size_t i = start_index; i < stop_index; ++i) {
- backends_[i]->backend_service()->ResetCounters();
- backends_[i]->backend_service1()->ResetCounters();
- backends_[i]->backend_service2()->ResetCounters();
- }
- }
-
- bool SeenAllBackends(size_t start_index = 0, size_t stop_index = 0,
- const RpcOptions& rpc_options = RpcOptions()) {
- if (stop_index == 0) stop_index = backends_.size();
- for (size_t i = start_index; i < stop_index; ++i) {
- switch (rpc_options.service) {
- case SERVICE_ECHO:
- if (backends_[i]->backend_service()->request_count() == 0) {
- return false;
- }
- break;
- case SERVICE_ECHO1:
- if (backends_[i]->backend_service1()->request_count() == 0) {
- return false;
- }
- break;
- case SERVICE_ECHO2:
- if (backends_[i]->backend_service2()->request_count() == 0) {
- return false;
- }
- break;
- }
- }
- return true;
- }
-
- void SendRpcAndCount(int* num_total, int* num_ok, int* num_failure,
- int* num_drops,
- const RpcOptions& rpc_options = RpcOptions(),
- const char* drop_error_message =
- "Call dropped by load balancing policy") {
- const Status status = SendRpc(rpc_options);
- if (status.ok()) {
- ++*num_ok;
- } else {
- if (status.error_message() == drop_error_message) {
- ++*num_drops;
- } else {
- ++*num_failure;
- }
- }
- ++*num_total;
- }
-
- std::tuple<int, int, int> WaitForAllBackends(
- size_t start_index = 0, size_t stop_index = 0, bool reset_counters = true,
- const RpcOptions& rpc_options = RpcOptions(),
- bool allow_failures = false) {
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- int num_total = 0;
- while (!SeenAllBackends(start_index, stop_index, rpc_options)) {
- SendRpcAndCount(&num_total, &num_ok, &num_failure, &num_drops,
- rpc_options);
- }
- if (reset_counters) ResetBackendCounters();
- gpr_log(GPR_INFO,
- "Performed %d warm up requests against the backends. "
- "%d succeeded, %d failed, %d dropped.",
- num_total, num_ok, num_failure, num_drops);
- if (!allow_failures) EXPECT_EQ(num_failure, 0);
- return std::make_tuple(num_ok, num_failure, num_drops);
- }
-
- void WaitForBackend(size_t backend_idx, bool reset_counters = true,
- bool require_success = false) {
- gpr_log(GPR_INFO, "========= WAITING FOR BACKEND %lu ==========",
- static_cast<unsigned long>(backend_idx));
- do {
- Status status = SendRpc();
- if (require_success) {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- }
- } while (backends_[backend_idx]->backend_service()->request_count() == 0);
- if (reset_counters) ResetBackendCounters();
- gpr_log(GPR_INFO, "========= BACKEND %lu READY ==========",
- static_cast<unsigned long>(backend_idx));
- }
-
- grpc_core::ServerAddressList CreateAddressListFromPortList(
- const std::vector<int>& ports) {
- grpc_core::ServerAddressList addresses;
- for (int port : ports) {
- y_absl::StatusOr<grpc_core::URI> lb_uri = grpc_core::URI::Parse(
- y_absl::StrCat(ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", port));
- GPR_ASSERT(lb_uri.ok());
- grpc_resolved_address address;
- GPR_ASSERT(grpc_parse_uri(*lb_uri, &address));
- addresses.emplace_back(address.addr, address.len, nullptr);
- }
- return addresses;
- }
-
- void SetNextResolution(
- const std::vector<int>& ports,
- grpc_core::FakeResolverResponseGenerator* response_generator = nullptr) {
- if (!GetParam().use_fake_resolver()) return; // Not used with xds resolver.
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(ports);
- grpc_error* error = GRPC_ERROR_NONE;
- const char* service_config_json =
- GetParam().enable_load_reporting()
- ? kDefaultServiceConfig
- : kDefaultServiceConfigWithoutLoadReporting;
- result.service_config =
- grpc_core::ServiceConfig::Create(nullptr, service_config_json, &error);
- ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_string(error);
- ASSERT_NE(result.service_config.get(), nullptr);
- if (response_generator == nullptr) {
- response_generator = response_generator_.get();
- }
- response_generator->SetResponse(std::move(result));
- }
-
- void SetNextResolutionForLbChannelAllBalancers(
- const char* service_config_json = nullptr,
- const char* expected_targets = nullptr) {
- std::vector<int> ports;
- for (size_t i = 0; i < balancers_.size(); ++i) {
- ports.emplace_back(balancers_[i]->port());
- }
- SetNextResolutionForLbChannel(ports, service_config_json, expected_targets);
- }
-
- void SetNextResolutionForLbChannel(const std::vector<int>& ports,
- const char* service_config_json = nullptr,
- const char* expected_targets = nullptr) {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(ports);
- if (service_config_json != nullptr) {
- grpc_error* error = GRPC_ERROR_NONE;
- result.service_config = grpc_core::ServiceConfig::Create(
- nullptr, service_config_json, &error);
- ASSERT_NE(result.service_config.get(), nullptr);
- ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_string(error);
- }
- if (expected_targets != nullptr) {
- grpc_arg expected_targets_arg = grpc_channel_arg_string_create(
- const_cast<char*>(GRPC_ARG_FAKE_SECURITY_EXPECTED_TARGETS),
- const_cast<char*>(expected_targets));
- result.args =
- grpc_channel_args_copy_and_add(nullptr, &expected_targets_arg, 1);
- }
- lb_channel_response_generator_->SetResponse(std::move(result));
- }
-
- void SetNextReresolutionResponse(const std::vector<int>& ports) {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(ports);
- response_generator_->SetReresolutionResponse(std::move(result));
- }
-
- std::vector<int> GetBackendPorts(size_t start_index = 0,
- size_t stop_index = 0) const {
- if (stop_index == 0) stop_index = backends_.size();
- std::vector<int> backend_ports;
- for (size_t i = start_index; i < stop_index; ++i) {
- backend_ports.push_back(backends_[i]->port());
- }
- return backend_ports;
- }
-
- Status SendRpc(const RpcOptions& rpc_options = RpcOptions(),
- EchoResponse* response = nullptr) {
- const bool local_response = (response == nullptr);
- if (local_response) response = new EchoResponse;
- ClientContext context;
- EchoRequest request;
- rpc_options.SetupRpc(&context, &request);
- Status status;
- switch (rpc_options.service) {
- case SERVICE_ECHO:
- status =
- SendRpcMethod(&stub_, rpc_options, &context, request, response);
- break;
- case SERVICE_ECHO1:
- status =
- SendRpcMethod(&stub1_, rpc_options, &context, request, response);
- break;
- case SERVICE_ECHO2:
- status =
- SendRpcMethod(&stub2_, rpc_options, &context, request, response);
- break;
- }
- if (local_response) delete response;
- return status;
- }
-
- void CheckRpcSendOk(const size_t times = 1,
- const RpcOptions& rpc_options = RpcOptions()) {
- for (size_t i = 0; i < times; ++i) {
- EchoResponse response;
- const Status status = SendRpc(rpc_options, &response);
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
-
- void CheckRpcSendFailure(
- const size_t times = 1, const RpcOptions& rpc_options = RpcOptions(),
- const StatusCode expected_error_code = StatusCode::OK) {
- for (size_t i = 0; i < times; ++i) {
- const Status status = SendRpc(rpc_options);
- EXPECT_FALSE(status.ok());
- if (expected_error_code != StatusCode::OK) {
- EXPECT_EQ(expected_error_code, status.error_code());
- }
- }
- }
-
- static Listener BuildListener(const RouteConfiguration& route_config) {
- HttpConnectionManager http_connection_manager;
- *(http_connection_manager.mutable_route_config()) = route_config;
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("router");
- filter->mutable_typed_config()->PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- Listener listener;
- listener.set_name(kServerName);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- return listener;
- }
-
- ClusterLoadAssignment BuildEdsResource(
- const AdsServiceImpl::EdsResourceArgs& args,
- const char* eds_service_name = kDefaultEdsServiceName) {
- ClusterLoadAssignment assignment;
- assignment.set_cluster_name(eds_service_name);
- for (const auto& locality : args.locality_list) {
- auto* endpoints = assignment.add_endpoints();
- endpoints->mutable_load_balancing_weight()->set_value(locality.lb_weight);
- endpoints->set_priority(locality.priority);
- endpoints->mutable_locality()->set_region(kDefaultLocalityRegion);
- endpoints->mutable_locality()->set_zone(kDefaultLocalityZone);
- endpoints->mutable_locality()->set_sub_zone(locality.sub_zone);
- for (size_t i = 0; i < locality.ports.size(); ++i) {
- const int& port = locality.ports[i];
- auto* lb_endpoints = endpoints->add_lb_endpoints();
- if (locality.health_statuses.size() > i &&
- locality.health_statuses[i] != HealthStatus::UNKNOWN) {
- lb_endpoints->set_health_status(locality.health_statuses[i]);
- }
- auto* endpoint = lb_endpoints->mutable_endpoint();
- auto* address = endpoint->mutable_address();
- auto* socket_address = address->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(port);
- }
- }
- if (!args.drop_categories.empty()) {
- auto* policy = assignment.mutable_policy();
- for (const auto& p : args.drop_categories) {
- const TString& name = p.first;
- const uint32_t parts_per_million = p.second;
- auto* drop_overload = policy->add_drop_overloads();
- drop_overload->set_category(name);
- auto* drop_percentage = drop_overload->mutable_drop_percentage();
- drop_percentage->set_numerator(parts_per_million);
- drop_percentage->set_denominator(args.drop_denominator);
- }
- }
- return assignment;
- }
-
- void SetListenerAndRouteConfiguration(
- int idx, Listener listener, const RouteConfiguration& route_config) {
- auto* api_listener =
- listener.mutable_api_listener()->mutable_api_listener();
- HttpConnectionManager http_connection_manager;
- api_listener->UnpackTo(&http_connection_manager);
- if (GetParam().enable_rds_testing()) {
- auto* rds = http_connection_manager.mutable_rds();
- rds->set_route_config_name(kDefaultRouteConfigurationName);
- rds->mutable_config_source()->mutable_ads();
- balancers_[idx]->ads_service()->SetRdsResource(route_config);
- } else {
- *http_connection_manager.mutable_route_config() = route_config;
- }
- api_listener->PackFrom(http_connection_manager);
- balancers_[idx]->ads_service()->SetLdsResource(listener);
- }
-
- void SetRouteConfiguration(int idx, const RouteConfiguration& route_config) {
- if (GetParam().enable_rds_testing()) {
- balancers_[idx]->ads_service()->SetRdsResource(route_config);
- } else {
- balancers_[idx]->ads_service()->SetLdsResource(
- BuildListener(route_config));
- }
- }
-
- AdsServiceImpl::ResponseState RouteConfigurationResponseState(int idx) const {
- AdsServiceImpl* ads_service = balancers_[idx]->ads_service();
- if (GetParam().enable_rds_testing()) {
- return ads_service->rds_response_state();
- }
- return ads_service->lds_response_state();
- }
-
- public:
- // This method could benefit test subclasses; to make it accessible
- // via bind with a qualified name, it needs to be public.
- void SetEdsResourceWithDelay(size_t i,
- const ClusterLoadAssignment& assignment,
- int delay_ms) {
- GPR_ASSERT(delay_ms > 0);
- gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(delay_ms));
- balancers_[i]->ads_service()->SetEdsResource(assignment);
- }
-
- protected:
- class XdsServingStatusNotifier
- : public grpc::experimental::XdsServerServingStatusNotifierInterface {
- public:
- void OnServingStatusChange(TString uri, grpc::Status status) override {
- grpc_core::MutexLock lock(&mu_);
- status_map[uri] = status;
- cond_.Signal();
- }
-
- void WaitOnServingStatusChange(TString uri,
- grpc::StatusCode expected_status) {
- grpc_core::MutexLock lock(&mu_);
- std::map<TString, grpc::Status>::iterator it;
- while ((it = status_map.find(uri)) == status_map.end() ||
- it->second.error_code() != expected_status) {
- cond_.Wait(&mu_);
- }
- }
-
- private:
- grpc_core::Mutex mu_;
- grpc_core::CondVar cond_;
- std::map<TString, grpc::Status> status_map;
- };
-
- class ServerThread {
- public:
- explicit ServerThread(bool use_xds_enabled_server = false)
- : port_(grpc_pick_unused_port_or_die()),
- use_xds_enabled_server_(use_xds_enabled_server) {}
- virtual ~ServerThread(){};
-
- void Start() {
- gpr_log(GPR_INFO, "starting %s server on port %d", Type(), port_);
- GPR_ASSERT(!running_);
- running_ = true;
- StartAllServices();
- grpc_core::Mutex mu;
- // We need to acquire the lock here in order to prevent the notify_one
- // by ServerThread::Serve from firing before the wait below is hit.
- grpc_core::MutexLock lock(&mu);
- grpc_core::CondVar cond;
- thread_ = y_absl::make_unique<std::thread>(
- std::bind(&ServerThread::Serve, this, &mu, &cond));
- cond.Wait(&mu);
- gpr_log(GPR_INFO, "%s server startup complete", Type());
- }
-
- void Serve(grpc_core::Mutex* mu, grpc_core::CondVar* cond) {
- // We need to acquire the lock here in order to prevent the notify_one
- // below from firing before its corresponding wait is executed.
- grpc_core::MutexLock lock(mu);
- std::ostringstream server_address;
- server_address << "localhost:" << port_;
- if (use_xds_enabled_server_) {
- experimental::XdsServerBuilder builder;
- builder.set_status_notifier(&notifier_);
- builder.AddListeningPort(server_address.str(), Credentials());
- RegisterAllServices(&builder);
- server_ = builder.BuildAndStart();
- } else {
- ServerBuilder builder;
- builder.AddListeningPort(server_address.str(), Credentials());
- RegisterAllServices(&builder);
- server_ = builder.BuildAndStart();
- }
- cond->Signal();
- }
-
- void Shutdown() {
- if (!running_) return;
- gpr_log(GPR_INFO, "%s about to shutdown", Type());
- ShutdownAllServices();
- server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0));
- thread_->join();
- gpr_log(GPR_INFO, "%s shutdown completed", Type());
- running_ = false;
- }
-
- virtual std::shared_ptr<ServerCredentials> Credentials() {
- return std::make_shared<SecureServerCredentials>(
- grpc_fake_transport_security_server_credentials_create());
- }
-
- int port() const { return port_; }
-
- bool use_xds_enabled_server() const { return use_xds_enabled_server_; }
-
- XdsServingStatusNotifier* notifier() { return &notifier_; }
-
- private:
- virtual void RegisterAllServices(ServerBuilder* builder) = 0;
- virtual void StartAllServices() = 0;
- virtual void ShutdownAllServices() = 0;
-
- virtual const char* Type() = 0;
-
- const int port_;
- std::unique_ptr<Server> server_;
- XdsServingStatusNotifier notifier_;
- std::unique_ptr<std::thread> thread_;
- bool running_ = false;
- const bool use_xds_enabled_server_;
- };
-
- class BackendServerThread : public ServerThread {
- public:
- explicit BackendServerThread(bool use_xds_enabled_server)
- : ServerThread(use_xds_enabled_server) {}
-
- BackendServiceImpl<::grpc::testing::EchoTestService::Service>*
- backend_service() {
- return &backend_service_;
- }
- BackendServiceImpl<::grpc::testing::EchoTest1Service::Service>*
- backend_service1() {
- return &backend_service1_;
- }
- BackendServiceImpl<::grpc::testing::EchoTest2Service::Service>*
- backend_service2() {
- return &backend_service2_;
- }
-
- std::shared_ptr<ServerCredentials> Credentials() override {
- if (GetParam().use_xds_credentials()) {
- if (use_xds_enabled_server()) {
- // We are testing server's use of XdsServerCredentials
- return experimental::XdsServerCredentials(
- InsecureServerCredentials());
- } else {
- // We are testing client's use of XdsCredentials
- TString root_cert = ReadFile(kCaCertPath);
- TString identity_cert = ReadFile(kServerCertPath);
- TString private_key = ReadFile(kServerKeyPath);
- std::vector<experimental::IdentityKeyCertPair>
- identity_key_cert_pairs = {{private_key, identity_cert}};
- auto certificate_provider = std::make_shared<
- grpc::experimental::StaticDataCertificateProvider>(
- root_cert, identity_key_cert_pairs);
- grpc::experimental::TlsServerCredentialsOptions options(
- certificate_provider);
- options.watch_root_certs();
- options.watch_identity_key_cert_pairs();
- options.set_cert_request_type(
- GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY);
- return grpc::experimental::TlsServerCredentials(options);
- }
- }
- return ServerThread::Credentials();
- }
-
- private:
- void RegisterAllServices(ServerBuilder* builder) override {
- builder->RegisterService(&backend_service_);
- builder->RegisterService(&backend_service1_);
- builder->RegisterService(&backend_service2_);
- }
-
- void StartAllServices() override {
- backend_service_.Start();
- backend_service1_.Start();
- backend_service2_.Start();
- }
-
- void ShutdownAllServices() override {
- backend_service_.Shutdown();
- backend_service1_.Shutdown();
- backend_service2_.Shutdown();
- }
-
- const char* Type() override { return "Backend"; }
-
- BackendServiceImpl<::grpc::testing::EchoTestService::Service>
- backend_service_;
- BackendServiceImpl<::grpc::testing::EchoTest1Service::Service>
- backend_service1_;
- BackendServiceImpl<::grpc::testing::EchoTest2Service::Service>
- backend_service2_;
- };
-
- class BalancerServerThread : public ServerThread {
- public:
- explicit BalancerServerThread(int client_load_reporting_interval = 0)
- : ads_service_(new AdsServiceImpl()),
- lrs_service_(new LrsServiceImpl(client_load_reporting_interval)) {}
-
- AdsServiceImpl* ads_service() { return ads_service_.get(); }
- LrsServiceImpl* lrs_service() { return lrs_service_.get(); }
-
- private:
- void RegisterAllServices(ServerBuilder* builder) override {
- builder->RegisterService(ads_service_->v2_rpc_service());
- builder->RegisterService(ads_service_->v3_rpc_service());
- builder->RegisterService(lrs_service_->v2_rpc_service());
- builder->RegisterService(lrs_service_->v3_rpc_service());
- }
-
- void StartAllServices() override {
- ads_service_->Start();
- lrs_service_->Start();
- }
-
- void ShutdownAllServices() override {
- ads_service_->Shutdown();
- lrs_service_->Shutdown();
- }
-
- const char* Type() override { return "Balancer"; }
-
- std::shared_ptr<AdsServiceImpl> ads_service_;
- std::shared_ptr<LrsServiceImpl> lrs_service_;
- };
-
-#ifndef DISABLED_XDS_PROTO_IN_CC
- class AdminServerThread : public ServerThread {
- private:
- void RegisterAllServices(ServerBuilder* builder) override {
- builder->RegisterService(&csds_service_);
- }
- void StartAllServices() override {}
- void ShutdownAllServices() override {}
-
- const char* Type() override { return "Admin"; }
-
- grpc::xds::experimental::ClientStatusDiscoveryService csds_service_;
- };
-#endif // DISABLED_XDS_PROTO_IN_CC
-
- class LongRunningRpc {
- public:
- void StartRpc(grpc::testing::EchoTestService::Stub* stub,
- const RpcOptions& rpc_options =
- RpcOptions().set_client_cancel_after_us(1 * 1000 *
- 1000)) {
- sender_thread_ = std::thread([this, stub, rpc_options]() {
- EchoRequest request;
- EchoResponse response;
- rpc_options.SetupRpc(&context_, &request);
- status_ = stub->Echo(&context_, request, &response);
- });
- }
-
- void CancelRpc() {
- context_.TryCancel();
- if (sender_thread_.joinable()) sender_thread_.join();
- }
-
- Status GetStatus() {
- if (sender_thread_.joinable()) sender_thread_.join();
- return status_;
- }
-
- private:
- std::thread sender_thread_;
- ClientContext context_;
- Status status_;
- };
-
- const size_t num_backends_;
- const size_t num_balancers_;
- const int client_load_reporting_interval_seconds_;
- bool ipv6_only_ = false;
- std::shared_ptr<Channel> channel_;
- std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
- std::unique_ptr<grpc::testing::EchoTest1Service::Stub> stub1_;
- std::unique_ptr<grpc::testing::EchoTest2Service::Stub> stub2_;
- std::vector<std::unique_ptr<BackendServerThread>> backends_;
- std::vector<std::unique_ptr<BalancerServerThread>> balancers_;
- grpc_core::RefCountedPtr<grpc_core::FakeResolverResponseGenerator>
- response_generator_;
- grpc_core::RefCountedPtr<grpc_core::FakeResolverResponseGenerator>
- lb_channel_response_generator_;
- grpc_core::RefCountedPtr<grpc_core::FakeResolverResponseGenerator>
- logical_dns_cluster_resolver_response_generator_;
- int xds_resource_does_not_exist_timeout_ms_ = 0;
- y_absl::InlinedVector<grpc_arg, 2> xds_channel_args_to_add_;
- grpc_channel_args xds_channel_args_;
-
- Listener default_listener_;
- RouteConfiguration default_route_config_;
- Cluster default_cluster_;
- bool use_xds_enabled_server_;
- bool bootstrap_contents_from_env_var_;
-};
-
-class BasicTest : public XdsEnd2endTest {
- public:
- BasicTest() : XdsEnd2endTest(4, 1) {}
-};
-
-// Tests that the balancer sends the correct response to the client, and the
-// client sends RPCs to the backends using the default child policy.
-TEST_P(BasicTest, Vanilla) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcsPerAddress = 100;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Make sure that trying to connect works without a call.
- channel_->GetState(true /* try_to_connect */);
- // We need to wait for all backends to come online.
- WaitForAllBackends();
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * num_backends_);
- // Each backend should have gotten 100 requests.
- for (size_t i = 0; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress,
- backends_[i]->backend_service()->request_count());
- }
- // Check LB policy name for the channel.
- EXPECT_EQ(
- (GetParam().use_fake_resolver() ? "xds_cluster_resolver_experimental"
- : "xds_cluster_manager_experimental"),
- channel_->GetLoadBalancingPolicyName());
-}
-
-TEST_P(BasicTest, IgnoresUnhealthyEndpoints) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcsPerAddress = 100;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0",
- GetBackendPorts(),
- kDefaultLocalityWeight,
- kDefaultLocalityPriority,
- {HealthStatus::DRAINING}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Make sure that trying to connect works without a call.
- channel_->GetState(true /* try_to_connect */);
- // We need to wait for all backends to come online.
- WaitForAllBackends(/*start_index=*/1);
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * (num_backends_ - 1));
- // Each backend should have gotten 100 requests.
- for (size_t i = 1; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress,
- backends_[i]->backend_service()->request_count());
- }
-}
-
-// Tests that subchannel sharing works when the same backend is listed multiple
-// times.
-TEST_P(BasicTest, SameBackendListedMultipleTimes) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Same backend listed twice.
- std::vector<int> ports(2, backends_[0]->port());
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", ports},
- });
- const size_t kNumRpcsPerAddress = 10;
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // We need to wait for the backend to come online.
- WaitForBackend(0);
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * ports.size());
- // Backend should have gotten 20 requests.
- EXPECT_EQ(kNumRpcsPerAddress * ports.size(),
- backends_[0]->backend_service()->request_count());
- // And they should have come from a single client port, because of
- // subchannel sharing.
- EXPECT_EQ(1UL, backends_[0]->backend_service()->clients().size());
-}
-
-// Tests that RPCs will be blocked until a non-empty serverlist is received.
-TEST_P(BasicTest, InitiallyEmptyServerlist) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const int kServerlistDelayMs = 500 * grpc_test_slowdown_factor();
- const int kCallDeadlineMs = kServerlistDelayMs * 2;
- // First response is an empty serverlist, sent right away.
- AdsServiceImpl::EdsResourceArgs::Locality empty_locality("locality0", {});
- AdsServiceImpl::EdsResourceArgs args({
- empty_locality,
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Send non-empty serverlist only after kServerlistDelayMs.
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts()},
- });
- std::thread delayed_resource_setter(std::bind(
- &BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), kServerlistDelayMs));
- const auto t0 = system_clock::now();
- // Client will block: LB will initially send empty serverlist.
- CheckRpcSendOk(
- 1, RpcOptions().set_timeout_ms(kCallDeadlineMs).set_wait_for_ready(true));
- const auto ellapsed_ms =
- std::chrono::duration_cast<std::chrono::milliseconds>(
- system_clock::now() - t0);
- // but eventually, the LB sends a serverlist update that allows the call to
- // proceed. The call delay must be larger than the delay in sending the
- // populated serverlist but under the call's deadline (which is enforced by
- // the call's deadline).
- EXPECT_GT(ellapsed_ms.count(), kServerlistDelayMs);
- delayed_resource_setter.join();
-}
-
-// Tests that RPCs will fail with UNAVAILABLE instead of DEADLINE_EXCEEDED if
-// all the servers are unreachable.
-TEST_P(BasicTest, AllServersUnreachableFailFast) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumUnreachableServers = 5;
- std::vector<int> ports;
- for (size_t i = 0; i < kNumUnreachableServers; ++i) {
- ports.push_back(grpc_pick_unused_port_or_die());
- }
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", ports},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- const Status status = SendRpc();
- // The error shouldn't be DEADLINE_EXCEEDED.
- EXPECT_EQ(StatusCode::UNAVAILABLE, status.error_code());
-}
-
-// Tests that RPCs fail when the backends are down, and will succeed again after
-// the backends are restarted.
-TEST_P(BasicTest, BackendsRestart) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
- // Stop backends. RPCs should fail.
- ShutdownAllBackends();
- // Sending multiple failed requests instead of just one to ensure that the
- // client notices that all backends are down before we restart them. If we
- // didn't do this, then a single RPC could fail here due to the race condition
- // between the LB pick and the GOAWAY from the chosen backend being shut down,
- // which would not actually prove that the client noticed that all of the
- // backends are down. Then, when we send another request below (which we
- // expect to succeed), if the callbacks happen in the wrong order, the same
- // race condition could happen again due to the client not yet having noticed
- // that the backends were all down.
- CheckRpcSendFailure(num_backends_);
- // Restart all backends. RPCs should start succeeding again.
- StartAllBackends();
- CheckRpcSendOk(1, RpcOptions().set_timeout_ms(2000).set_wait_for_ready(true));
-}
-
-TEST_P(BasicTest, IgnoresDuplicateUpdates) {
- const size_t kNumRpcsPerAddress = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for all backends to come online.
- WaitForAllBackends();
- // Send kNumRpcsPerAddress RPCs per server, but send an EDS update in
- // between. If the update is not ignored, this will cause the
- // round_robin policy to see an update, which will randomly reset its
- // position in the address list.
- for (size_t i = 0; i < kNumRpcsPerAddress; ++i) {
- CheckRpcSendOk(2);
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- CheckRpcSendOk(2);
- }
- // Each backend should have gotten the right number of requests.
- for (size_t i = 1; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress,
- backends_[i]->backend_service()->request_count());
- }
-}
-
-using XdsResolverOnlyTest = BasicTest;
-
-TEST_P(XdsResolverOnlyTest, ResourceTypeVersionPersistsAcrossStreamRestarts) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // Wait for backends to come online.
- WaitForAllBackends(0, 1);
- // Stop balancer.
- balancers_[0]->Shutdown();
- // Tell balancer to require minimum version 1 for all resource types.
- balancers_[0]->ads_service()->SetResourceMinVersion(kLdsTypeUrl, 1);
- balancers_[0]->ads_service()->SetResourceMinVersion(kRdsTypeUrl, 1);
- balancers_[0]->ads_service()->SetResourceMinVersion(kCdsTypeUrl, 1);
- balancers_[0]->ads_service()->SetResourceMinVersion(kEdsTypeUrl, 1);
- // Update backend, just so we can be sure that the client has
- // reconnected to the balancer.
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args2));
- // Restart balancer.
- balancers_[0]->Start();
- // Make sure client has reconnected.
- WaitForAllBackends(1, 2);
-}
-
-// Tests switching over from one cluster to another.
-TEST_P(XdsResolverOnlyTest, ChangeClusters) {
- const char* kNewClusterName = "new_cluster_name";
- const char* kNewEdsServiceName = "new_eds_service_name";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // We need to wait for all backends to come online.
- WaitForAllBackends(0, 2);
- // Populate new EDS resource.
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsServiceName));
- // Populate new CDS resource.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Change RDS resource to point to new cluster.
- RouteConfiguration new_route_config = default_route_config_;
- new_route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->set_cluster(kNewClusterName);
- SetListenerAndRouteConfiguration(0, default_listener_, new_route_config);
- // Wait for all new backends to be used.
- std::tuple<int, int, int> counts = WaitForAllBackends(2, 4);
- // Make sure no RPCs failed in the transition.
- EXPECT_EQ(0, std::get<1>(counts));
-}
-
-// Tests that we go into TRANSIENT_FAILURE if the Cluster disappears.
-TEST_P(XdsResolverOnlyTest, ClusterRemoved) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // We need to wait for all backends to come online.
- WaitForAllBackends();
- // Unset CDS resource.
- balancers_[0]->ads_service()->UnsetResource(kCdsTypeUrl, kDefaultClusterName);
- // Wait for RPCs to start failing.
- do {
- } while (SendRpc(RpcOptions(), nullptr).ok());
- // Make sure RPCs are still failing.
- CheckRpcSendFailure(1000);
- // Make sure we ACK'ed the update.
- EXPECT_EQ(balancers_[0]->ads_service()->cds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that we restart all xDS requests when we reestablish the ADS call.
-TEST_P(XdsResolverOnlyTest, RestartsRequestsUponReconnection) {
- // Manually configure use of RDS.
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* rds = http_connection_manager.mutable_rds();
- rds->set_route_config_name(kDefaultRouteConfigurationName);
- rds->mutable_config_source()->mutable_ads();
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- balancers_[0]->ads_service()->SetRdsResource(default_route_config_);
- const char* kNewClusterName = "new_cluster_name";
- const char* kNewEdsServiceName = "new_eds_service_name";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // We need to wait for all backends to come online.
- WaitForAllBackends(0, 2);
- // Now shut down and restart the balancer. When the client
- // reconnects, it should automatically restart the requests for all
- // resource types.
- balancers_[0]->Shutdown();
- balancers_[0]->Start();
- // Make sure things are still working.
- CheckRpcSendOk(100);
- // Populate new EDS resource.
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsServiceName));
- // Populate new CDS resource.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Change RDS resource to point to new cluster.
- RouteConfiguration new_route_config = default_route_config_;
- new_route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->set_cluster(kNewClusterName);
- balancers_[0]->ads_service()->SetRdsResource(new_route_config);
- // Wait for all new backends to be used.
- std::tuple<int, int, int> counts = WaitForAllBackends(2, 4);
- // Make sure no RPCs failed in the transition.
- EXPECT_EQ(0, std::get<1>(counts));
-}
-
-TEST_P(XdsResolverOnlyTest, DefaultRouteSpecifiesSlashPrefix) {
- RouteConfiguration route_config = default_route_config_;
- route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_match()
- ->set_prefix("/");
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // We need to wait for all backends to come online.
- WaitForAllBackends();
-}
-
-TEST_P(XdsResolverOnlyTest, CircuitBreaking) {
- constexpr size_t kMaxConcurrentRequests = 10;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // Update CDS resource to set max concurrent request.
- CircuitBreakers circuit_breaks;
- Cluster cluster = default_cluster_;
- auto* threshold = cluster.mutable_circuit_breakers()->add_thresholds();
- threshold->set_priority(RoutingPriority::DEFAULT);
- threshold->mutable_max_requests()->set_value(kMaxConcurrentRequests);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Send exactly max_concurrent_requests long RPCs.
- LongRunningRpc rpcs[kMaxConcurrentRequests];
- for (size_t i = 0; i < kMaxConcurrentRequests; ++i) {
- rpcs[i].StartRpc(stub_.get());
- }
- // Wait for all RPCs to be in flight.
- while (backends_[0]->backend_service()->RpcsWaitingForClientCancel() <
- kMaxConcurrentRequests) {
- gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_micros(1 * 1000, GPR_TIMESPAN)));
- }
- // Sending a RPC now should fail, the error message should tell us
- // we hit the max concurrent requests limit and got dropped.
- Status status = SendRpc();
- EXPECT_FALSE(status.ok());
- EXPECT_EQ(status.error_message(), "Call dropped by load balancing policy");
- // Cancel one RPC to allow another one through
- rpcs[0].CancelRpc();
- status = SendRpc();
- EXPECT_TRUE(status.ok());
- for (size_t i = 1; i < kMaxConcurrentRequests; ++i) {
- rpcs[i].CancelRpc();
- }
- // Make sure RPCs go to the correct backend:
- EXPECT_EQ(kMaxConcurrentRequests + 1,
- backends_[0]->backend_service()->request_count());
-}
-
-TEST_P(XdsResolverOnlyTest, CircuitBreakingMultipleChannelsShareCallCounter) {
- constexpr size_t kMaxConcurrentRequests = 10;
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // Update CDS resource to set max concurrent request.
- CircuitBreakers circuit_breaks;
- Cluster cluster = default_cluster_;
- auto* threshold = cluster.mutable_circuit_breakers()->add_thresholds();
- threshold->set_priority(RoutingPriority::DEFAULT);
- threshold->mutable_max_requests()->set_value(kMaxConcurrentRequests);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Create second channel.
- auto response_generator2 =
- grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>();
- auto channel2 = CreateChannel(
- /*failover_timeout=*/0, /*server_name=*/kServerName,
- response_generator2.get());
- auto stub2 = grpc::testing::EchoTestService::NewStub(channel2);
- // Set resolution results for both channels and for the xDS channel.
- SetNextResolution({});
- SetNextResolution({}, response_generator2.get());
- SetNextResolutionForLbChannelAllBalancers();
- // Send exactly max_concurrent_requests long RPCs, alternating between
- // the two channels.
- LongRunningRpc rpcs[kMaxConcurrentRequests];
- for (size_t i = 0; i < kMaxConcurrentRequests; ++i) {
- rpcs[i].StartRpc(i % 2 == 0 ? stub_.get() : stub2.get());
- }
- // Wait for all RPCs to be in flight.
- while (backends_[0]->backend_service()->RpcsWaitingForClientCancel() <
- kMaxConcurrentRequests) {
- gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_micros(1 * 1000, GPR_TIMESPAN)));
- }
- // Sending a RPC now should fail, the error message should tell us
- // we hit the max concurrent requests limit and got dropped.
- Status status = SendRpc();
- EXPECT_FALSE(status.ok());
- EXPECT_EQ(status.error_message(), "Call dropped by load balancing policy");
- // Cancel one RPC to allow another one through
- rpcs[0].CancelRpc();
- status = SendRpc();
- EXPECT_TRUE(status.ok());
- for (size_t i = 1; i < kMaxConcurrentRequests; ++i) {
- rpcs[i].CancelRpc();
- }
- // Make sure RPCs go to the correct backend:
- EXPECT_EQ(kMaxConcurrentRequests + 1,
- backends_[0]->backend_service()->request_count());
-}
-
-TEST_P(XdsResolverOnlyTest, MultipleChannelsShareXdsClient) {
- const char* kNewServerName = "new-server.example.com";
- Listener listener = default_listener_;
- listener.set_name(kNewServerName);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- WaitForAllBackends();
- // Create second channel and tell it to connect to kNewServerName.
- auto channel2 = CreateChannel(/*failover_timeout=*/0, kNewServerName);
- channel2->GetState(/*try_to_connect=*/true);
- ASSERT_TRUE(
- channel2->WaitForConnected(grpc_timeout_milliseconds_to_deadline(100)));
- // Make sure there's only one client connected.
- EXPECT_EQ(1UL, balancers_[0]->ads_service()->clients().size());
-}
-
-class XdsResolverLoadReportingOnlyTest : public XdsEnd2endTest {
- public:
- XdsResolverLoadReportingOnlyTest() : XdsEnd2endTest(4, 1, 3) {}
-};
-
-// Tests load reporting when switching over from one cluster to another.
-TEST_P(XdsResolverLoadReportingOnlyTest, ChangeClusters) {
- const char* kNewClusterName = "new_cluster_name";
- const char* kNewEdsServiceName = "new_eds_service_name";
- balancers_[0]->lrs_service()->set_cluster_names(
- {kDefaultClusterName, kNewClusterName});
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // cluster kDefaultClusterName -> locality0 -> backends 0 and 1
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // cluster kNewClusterName -> locality1 -> backends 2 and 3
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality1", GetBackendPorts(2, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsServiceName));
- // CDS resource for kNewClusterName.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Wait for all backends to come online.
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends(0, 2);
- // The load report received at the balancer should be correct.
- std::vector<ClientStats> load_report =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- EXPECT_THAT(
- load_report,
- ::testing::ElementsAre(::testing::AllOf(
- ::testing::Property(&ClientStats::cluster_name, kDefaultClusterName),
- ::testing::Property(
- &ClientStats::locality_stats,
- ::testing::ElementsAre(::testing::Pair(
- "locality0",
- ::testing::AllOf(
- ::testing::Field(&ClientStats::LocalityStats::
- total_successful_requests,
- num_ok),
- ::testing::Field(&ClientStats::LocalityStats::
- total_requests_in_progress,
- 0UL),
- ::testing::Field(
- &ClientStats::LocalityStats::total_error_requests,
- num_failure),
- ::testing::Field(
- &ClientStats::LocalityStats::total_issued_requests,
- num_failure + num_ok))))),
- ::testing::Property(&ClientStats::total_dropped_requests,
- num_drops))));
- // Change RDS resource to point to new cluster.
- RouteConfiguration new_route_config = default_route_config_;
- new_route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->set_cluster(kNewClusterName);
- SetListenerAndRouteConfiguration(0, default_listener_, new_route_config);
- // Wait for all new backends to be used.
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends(2, 4);
- // The load report received at the balancer should be correct.
- load_report = balancers_[0]->lrs_service()->WaitForLoadReport();
- EXPECT_THAT(
- load_report,
- ::testing::ElementsAre(
- ::testing::AllOf(
- ::testing::Property(&ClientStats::cluster_name,
- kDefaultClusterName),
- ::testing::Property(
- &ClientStats::locality_stats,
- ::testing::ElementsAre(::testing::Pair(
- "locality0",
- ::testing::AllOf(
- ::testing::Field(&ClientStats::LocalityStats::
- total_successful_requests,
- ::testing::Lt(num_ok)),
- ::testing::Field(&ClientStats::LocalityStats::
- total_requests_in_progress,
- 0UL),
- ::testing::Field(
- &ClientStats::LocalityStats::total_error_requests,
- ::testing::Le(num_failure)),
- ::testing::Field(
- &ClientStats::LocalityStats::
- total_issued_requests,
- ::testing::Le(num_failure + num_ok)))))),
- ::testing::Property(&ClientStats::total_dropped_requests,
- num_drops)),
- ::testing::AllOf(
- ::testing::Property(&ClientStats::cluster_name, kNewClusterName),
- ::testing::Property(
- &ClientStats::locality_stats,
- ::testing::ElementsAre(::testing::Pair(
- "locality1",
- ::testing::AllOf(
- ::testing::Field(&ClientStats::LocalityStats::
- total_successful_requests,
- ::testing::Le(num_ok)),
- ::testing::Field(&ClientStats::LocalityStats::
- total_requests_in_progress,
- 0UL),
- ::testing::Field(
- &ClientStats::LocalityStats::total_error_requests,
- ::testing::Le(num_failure)),
- ::testing::Field(
- &ClientStats::LocalityStats::
- total_issued_requests,
- ::testing::Le(num_failure + num_ok)))))),
- ::testing::Property(&ClientStats::total_dropped_requests,
- num_drops))));
- int total_ok = 0;
- int total_failure = 0;
- for (const ClientStats& client_stats : load_report) {
- total_ok += client_stats.total_successful_requests();
- total_failure += client_stats.total_error_requests();
- }
- EXPECT_EQ(total_ok, num_ok);
- EXPECT_EQ(total_failure, num_failure);
- // The LRS service got a single request, and sent a single response.
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
-}
-
-using SecureNamingTest = BasicTest;
-
-// Tests that secure naming check passes if target name is expected.
-TEST_P(SecureNamingTest, TargetNameIsExpected) {
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()}, nullptr, "xds_server");
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- CheckRpcSendOk();
-}
-
-// Tests that secure naming check fails if target name is unexpected.
-TEST_P(SecureNamingTest, TargetNameIsUnexpected) {
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()}, nullptr,
- "incorrect_server_name");
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Make sure that we blow up (via abort() from the security connector) when
- // the name from the balancer doesn't match expectations.
- ASSERT_DEATH_IF_SUPPORTED({ CheckRpcSendOk(); }, "");
-}
-
-using LdsTest = BasicTest;
-
-// Tests that LDS client should send a NACK if there is no API listener in the
-// Listener in the LDS response.
-TEST_P(LdsTest, NoApiListener) {
- auto listener = default_listener_;
- listener.clear_api_listener();
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Listener has neither address nor ApiListener"));
-}
-
-// Tests that LDS client should send a NACK if the route_specifier in the
-// http_connection_manager is neither inlined route_config nor RDS.
-TEST_P(LdsTest, WrongRouteSpecifier) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- http_connection_manager.mutable_scoped_routes();
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "HttpConnectionManager neither has inlined route_config nor RDS."));
-}
-
-// Tests that LDS client should send a NACK if the rds message in the
-// http_connection_manager is missing the config_source field.
-TEST_P(LdsTest, RdsMissingConfigSource) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- http_connection_manager.mutable_rds()->set_route_config_name(
- kDefaultRouteConfigurationName);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "HttpConnectionManager missing config_source for RDS."));
-}
-
-// Tests that LDS client should send a NACK if the rds message in the
-// http_connection_manager has a config_source field that does not specify ADS.
-TEST_P(LdsTest, RdsConfigSourceDoesNotSpecifyAds) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* rds = http_connection_manager.mutable_rds();
- rds->set_route_config_name(kDefaultRouteConfigurationName);
- rds->mutable_config_source()->mutable_self();
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "HttpConnectionManager ConfigSource for RDS does not specify ADS."));
-}
-
-// Tests that the NACK for multiple bad LDS resources includes both errors.
-TEST_P(LdsTest, MultipleBadResources) {
- constexpr char kServerName2[] = "server.other.com";
- auto listener = default_listener_;
- listener.clear_api_listener();
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.set_name(kServerName2);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- // Need to create a second channel to subscribe to a second LDS resource.
- auto channel2 = CreateChannel(0, kServerName2);
- auto stub2 = grpc::testing::EchoTestService::NewStub(channel2);
- ClientContext context;
- EchoRequest request;
- request.set_message(kRequestMessage);
- EchoResponse response;
- grpc::Status status = stub2->Echo(&context, request, &response);
- EXPECT_FALSE(status.ok());
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::AllOf(
- ::testing::HasSubstr(y_absl::StrCat(
- kServerName, ": Listener has neither address nor ApiListener")),
- ::testing::HasSubstr(
- y_absl::StrCat(kServerName2,
- ": Listener has neither address nor ApiListener"))));
-}
-
-// Tests that we ignore filters after the router filter.
-TEST_P(LdsTest, IgnoresHttpFiltersAfterRouterFilter) {
- SetNextResolutionForLbChannelAllBalancers();
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->mutable_typed_config()->set_type_url(
- "grpc.testing.client_only_http_filter");
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
-}
-
-// Test that we fail RPCs if there is no router filter.
-TEST_P(LdsTest, FailRpcsIfNoHttpRouterFilter) {
- SetNextResolutionForLbChannelAllBalancers();
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- http_connection_manager.clear_http_filters();
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- Status status = SendRpc();
- EXPECT_EQ(status.error_code(), StatusCode::UNAVAILABLE);
- EXPECT_EQ(status.error_message(), "no xDS HTTP router filter configured");
- // Wait until xDS server sees ACK.
- while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT) {
- CheckRpcSendFailure();
- }
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK empty filter names.
-TEST_P(LdsTest, RejectsEmptyHttpFilterName) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->mutable_typed_config()->PackFrom(Listener());
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("empty filter name at index 1"));
-}
-
-// Test that we NACK duplicate HTTP filter names.
-TEST_P(LdsTest, RejectsDuplicateHttpFilterName) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- *http_connection_manager.add_http_filters() =
- http_connection_manager.http_filters(0);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("duplicate HTTP filter name: router"));
-}
-
-// Test that we NACK unknown filter types.
-TEST_P(LdsTest, RejectsUnknownHttpFilterType) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->mutable_typed_config()->PackFrom(Listener());
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("no filter registered for config type "
- "envoy.config.listener.v3.Listener"));
-}
-
-// Test that we ignore optional unknown filter types.
-TEST_P(LdsTest, IgnoresOptionalUnknownHttpFilterType) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->mutable_typed_config()->PackFrom(Listener());
- filter->set_is_optional(true);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK filters without configs.
-TEST_P(LdsTest, RejectsHttpFilterWithoutConfig) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we ignore optional filters without configs.
-TEST_P(LdsTest, IgnoresOptionalHttpFilterWithoutConfig) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->set_is_optional(true);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK unparseable filter configs.
-TEST_P(LdsTest, RejectsUnparseableHttpFilterType) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->mutable_typed_config()->PackFrom(listener);
- filter->mutable_typed_config()->set_type_url(
- "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router");
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "filter config for type "
- "envoy.extensions.filters.http.router.v3.Router failed to parse"));
-}
-
-// Test that we NACK HTTP filters unsupported on client-side.
-TEST_P(LdsTest, RejectsHttpFiltersNotSupportedOnClients) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("grpc.testing.server_only_http_filter");
- filter->mutable_typed_config()->set_type_url(
- "grpc.testing.server_only_http_filter");
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Filter grpc.testing.server_only_http_filter is not "
- "supported on clients"));
-}
-
-// Test that we ignore optional HTTP filters unsupported on client-side.
-TEST_P(LdsTest, IgnoresOptionalHttpFiltersNotSupportedOnClients) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("grpc.testing.server_only_http_filter");
- filter->mutable_typed_config()->set_type_url(
- "grpc.testing.server_only_http_filter");
- filter->set_is_optional(true);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForBackend(0);
- EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-using LdsV2Test = LdsTest;
-
-// Tests that we ignore the HTTP filter list in v2.
-// TODO(roth): The test framework is not set up to allow us to test
-// the server sending v2 resources when the client requests v3, so this
-// just tests a pure v2 setup. When we have time, fix this.
-TEST_P(LdsV2Test, IgnoresHttpFilters) {
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- auto* filter = http_connection_manager.add_http_filters();
- filter->set_name("unknown");
- filter->mutable_typed_config()->PackFrom(Listener());
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendOk();
-}
-
-using LdsRdsTest = BasicTest;
-
-// Tests that LDS client should send an ACK upon correct LDS response (with
-// inlined RDS result).
-TEST_P(LdsRdsTest, Vanilla) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- (void)SendRpc();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
- // Make sure we actually used the RPC service for the right version of xDS.
- EXPECT_EQ(balancers_[0]->ads_service()->seen_v2_client(),
- GetParam().use_v2());
- EXPECT_NE(balancers_[0]->ads_service()->seen_v3_client(),
- GetParam().use_v2());
-}
-
-// Tests that we go into TRANSIENT_FAILURE if the Listener is removed.
-TEST_P(LdsRdsTest, ListenerRemoved) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- // We need to wait for all backends to come online.
- WaitForAllBackends();
- // Unset LDS resource.
- balancers_[0]->ads_service()->UnsetResource(kLdsTypeUrl, kServerName);
- // Wait for RPCs to start failing.
- do {
- } while (SendRpc(RpcOptions(), nullptr).ok());
- // Make sure RPCs are still failing.
- CheckRpcSendFailure(1000);
- // Make sure we ACK'ed the update.
- EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that LDS client ACKs but fails if matching domain can't be found in
-// the LDS response.
-TEST_P(LdsRdsTest, NoMatchedDomain) {
- RouteConfiguration route_config = default_route_config_;
- route_config.mutable_virtual_hosts(0)->clear_domains();
- route_config.mutable_virtual_hosts(0)->add_domains("unmatched_domain");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- // Do a bit of polling, to allow the ACK to get to the ADS server.
- channel_->WaitForConnected(grpc_timeout_milliseconds_to_deadline(100));
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that LDS client should choose the virtual host with matching domain if
-// multiple virtual hosts exist in the LDS response.
-TEST_P(LdsRdsTest, ChooseMatchedDomain) {
- RouteConfiguration route_config = default_route_config_;
- *(route_config.add_virtual_hosts()) = route_config.virtual_hosts(0);
- route_config.mutable_virtual_hosts(0)->clear_domains();
- route_config.mutable_virtual_hosts(0)->add_domains("unmatched_domain");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- (void)SendRpc();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that LDS client should choose the last route in the virtual host if
-// multiple routes exist in the LDS response.
-TEST_P(LdsRdsTest, ChooseLastRoute) {
- RouteConfiguration route_config = default_route_config_;
- *(route_config.mutable_virtual_hosts(0)->add_routes()) =
- route_config.virtual_hosts(0).routes(0);
- route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_cluster_header();
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- (void)SendRpc();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that LDS client should ignore route which has query_parameters.
-TEST_P(LdsRdsTest, RouteMatchHasQueryParameters) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- route1->mutable_match()->add_query_parameters();
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should send a ACK if route match has a prefix
-// that is either empty or a single slash
-TEST_P(LdsRdsTest, RouteMatchHasValidPrefixEmptyOrSingleSlash) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("");
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("/");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- (void)SendRpc();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Tests that LDS client should ignore route which has a path
-// prefix string does not start with "/".
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixNoLeadingSlash) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("grpc.testing.EchoTest1Service/");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has a prefix
-// string with more than 2 slashes.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixExtraContent) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/Echo1/");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has a prefix
-// string "//".
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixDoubleSlash) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("//");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// but it's empty.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathEmptyPath) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// string does not start with "/".
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathNoLeadingSlash) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("grpc.testing.EchoTest1Service/Echo1");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// string that has too many slashes; for example, ends with "/".
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathTooManySlashes) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service/Echo1/");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// string that has only 1 slash: missing "/" between service and method.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathOnlyOneSlash) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service.Echo1");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// string that is missing service.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathMissingService) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("//Echo1");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Tests that LDS client should ignore route which has path
-// string that is missing method.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathMissingMethod) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service/");
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No valid routes specified."));
-}
-
-// Test that LDS client should reject route which has invalid path regex.
-TEST_P(LdsRdsTest, RouteMatchHasInvalidPathRegex) {
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->mutable_safe_regex()->set_regex("a[z-a]");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "path matcher: Invalid regex string specified in matcher."));
-}
-
-// Tests that LDS client should send a NACK if route has an action other than
-// RouteAction in the LDS response.
-TEST_P(LdsRdsTest, RouteHasNoRouteAction) {
- RouteConfiguration route_config = default_route_config_;
- route_config.mutable_virtual_hosts(0)->mutable_routes(0)->mutable_redirect();
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("No RouteAction found in route."));
-}
-
-TEST_P(LdsRdsTest, RouteActionClusterHasEmptyClusterName) {
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- route1->mutable_route()->set_cluster("");
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("RouteAction cluster contains empty cluster name."));
-}
-
-TEST_P(LdsRdsTest, RouteActionWeightedTargetHasIncorrectTotalWeightSet) {
- const size_t kWeight75 = 75;
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75 + 1);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "RouteAction weighted_cluster has incorrect total weight"));
-}
-
-TEST_P(LdsRdsTest, RouteActionWeightedClusterHasZeroTotalWeight) {
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(0);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(0);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "RouteAction weighted_cluster has no valid clusters specified."));
-}
-
-TEST_P(LdsRdsTest, RouteActionWeightedTargetClusterHasEmptyClusterName) {
- const size_t kWeight75 = 75;
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name("");
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "RouteAction weighted_cluster cluster contains empty cluster name."));
-}
-
-TEST_P(LdsRdsTest, RouteActionWeightedTargetClusterHasNoWeight) {
- const size_t kWeight75 = 75;
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "RouteAction weighted_cluster cluster missing weight"));
-}
-
-TEST_P(LdsRdsTest, RouteHeaderMatchInvalidRegex) {
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("header1");
- header_matcher1->mutable_safe_regex_match()->set_regex("a[z-a]");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "header matcher: Invalid regex string specified in matcher."));
-}
-
-TEST_P(LdsRdsTest, RouteHeaderMatchInvalidRange) {
- const char* kNewCluster1Name = "new_cluster_1";
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("header1");
- header_matcher1->mutable_range_match()->set_start(1001);
- header_matcher1->mutable_range_match()->set_end(1000);
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- SetRouteConfiguration(0, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "header matcher: Invalid range specifier specified: end cannot be "
- "smaller than start."));
-}
-
-// Tests that LDS client should choose the default route (with no matching
-// specified) after unable to find a match with previous routes.
-TEST_P(LdsRdsTest, XdsRoutingPathMatching) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEcho2Rpcs = 20;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service/Echo1");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_path("/grpc.testing.EchoTest2Service/Echo2");
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* route3 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route3->mutable_match()->set_path("/grpc.testing.EchoTest3Service/Echo3");
- route3->mutable_route()->set_cluster(kDefaultClusterName);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 2);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true));
- CheckRpcSendOk(kNumEcho2Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO2)
- .set_rpc_method(METHOD_ECHO2)
- .set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- for (size_t i = 0; i < 2; ++i) {
- EXPECT_EQ(kNumEchoRpcs / 2,
- backends_[i]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service2()->request_count());
- }
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service2()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- EXPECT_EQ(kNumEcho2Rpcs, backends_[3]->backend_service2()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingPathMatchingCaseInsensitive) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- // First route will not match, since it's case-sensitive.
- // Second route will match with same path.
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/GrPc.TeStInG.EcHoTeSt1SErViCe/EcHo1");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_path("/GrPc.TeStInG.EcHoTeSt1SErViCe/EcHo1");
- route2->mutable_match()->mutable_case_sensitive()->set_value(false);
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingPrefixMatching) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEcho2Rpcs = 20;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_prefix("/grpc.testing.EchoTest2Service/");
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 2);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(
- kNumEcho1Rpcs,
- RpcOptions().set_rpc_service(SERVICE_ECHO1).set_wait_for_ready(true));
- CheckRpcSendOk(
- kNumEcho2Rpcs,
- RpcOptions().set_rpc_service(SERVICE_ECHO2).set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- for (size_t i = 0; i < 2; ++i) {
- EXPECT_EQ(kNumEchoRpcs / 2,
- backends_[i]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service2()->request_count());
- }
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service2()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- EXPECT_EQ(kNumEcho2Rpcs, backends_[3]->backend_service2()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingPrefixMatchingCaseInsensitive) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- // First route will not match, since it's case-sensitive.
- // Second route will match with same path.
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/GrPc.TeStInG.EcHoTeSt1SErViCe");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_prefix("/GrPc.TeStInG.EcHoTeSt1SErViCe");
- route2->mutable_match()->mutable_case_sensitive()->set_value(false);
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingPathRegexMatching) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEcho2Rpcs = 20;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- // Will match "/grpc.testing.EchoTest1Service/"
- route1->mutable_match()->mutable_safe_regex()->set_regex(".*1.*");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- // Will match "/grpc.testing.EchoTest2Service/"
- route2->mutable_match()->mutable_safe_regex()->set_regex(".*2.*");
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 2);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(
- kNumEcho1Rpcs,
- RpcOptions().set_rpc_service(SERVICE_ECHO1).set_wait_for_ready(true));
- CheckRpcSendOk(
- kNumEcho2Rpcs,
- RpcOptions().set_rpc_service(SERVICE_ECHO2).set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- for (size_t i = 0; i < 2; ++i) {
- EXPECT_EQ(kNumEchoRpcs / 2,
- backends_[i]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service2()->request_count());
- }
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service2()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- EXPECT_EQ(kNumEcho2Rpcs, backends_[3]->backend_service2()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingPathRegexMatchingCaseInsensitive) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEcho1Rpcs = 10;
- const size_t kNumEchoRpcs = 30;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- // First route will not match, since it's case-sensitive.
- // Second route will match with same path.
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->mutable_safe_regex()->set_regex(
- ".*EcHoTeSt1SErViCe.*");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->mutable_safe_regex()->set_regex(
- ".*EcHoTeSt1SErViCe.*");
- route2->mutable_match()->mutable_case_sensitive()->set_value(false);
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_wait_for_ready(true));
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[2]->backend_service1()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingWeightedCluster) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kNotUsedClusterName = "not_used_cluster";
- const size_t kNumEcho1Rpcs = 1000;
- const size_t kNumEchoRpcs = 10;
- const size_t kWeight75 = 75;
- const size_t kWeight25 = 25;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- auto* weighted_cluster2 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster2->set_name(kNewCluster2Name);
- weighted_cluster2->mutable_weight()->set_value(kWeight25);
- // Cluster with weight 0 will not be used.
- auto* weighted_cluster3 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster3->set_name(kNotUsedClusterName);
- weighted_cluster3->mutable_weight()->set_value(0);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75 + kWeight25);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 1);
- WaitForAllBackends(1, 3, true, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const int weight_75_request_count =
- backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- const int weight_25_request_count =
- backends_[2]->backend_service1()->request_count();
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- weight_75_request_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 + kErrorTolerance))));
- // TODO(@donnadionne): Reduce tolerance: increased the tolerance to keep the
- // test from flaking while debugging potential root cause.
- const double kErrorToleranceSmallLoad = 0.3;
- gpr_log(GPR_INFO, "target_75 received %d rpcs and target_25 received %d rpcs",
- weight_75_request_count, weight_25_request_count);
- EXPECT_THAT(weight_25_request_count,
- ::testing::AllOf(
- ::testing::Ge(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 - kErrorToleranceSmallLoad)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 + kErrorToleranceSmallLoad))));
-}
-
-TEST_P(LdsRdsTest, RouteActionWeightedTargetDefaultRoute) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const size_t kNumEchoRpcs = 1000;
- const size_t kWeight75 = 75;
- const size_t kWeight25 = 25;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Populating Route Configurations for LDS.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- auto* weighted_cluster2 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster2->set_name(kNewCluster2Name);
- weighted_cluster2->mutable_weight()->set_value(kWeight25);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75 + kWeight25);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(1, 3);
- CheckRpcSendOk(kNumEchoRpcs);
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(0, backends_[0]->backend_service()->request_count());
- const int weight_75_request_count =
- backends_[1]->backend_service()->request_count();
- const int weight_25_request_count =
- backends_[2]->backend_service()->request_count();
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- weight_75_request_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEchoRpcs) *
- kWeight75 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEchoRpcs) *
- kWeight75 / 100 * (1 + kErrorTolerance))));
- // TODO(@donnadionne): Reduce tolerance: increased the tolerance to keep the
- // test from flaking while debugging potential root cause.
- const double kErrorToleranceSmallLoad = 0.3;
- gpr_log(GPR_INFO, "target_75 received %d rpcs and target_25 received %d rpcs",
- weight_75_request_count, weight_25_request_count);
- EXPECT_THAT(weight_25_request_count,
- ::testing::AllOf(
- ::testing::Ge(static_cast<double>(kNumEchoRpcs) * kWeight25 /
- 100 * (1 - kErrorToleranceSmallLoad)),
- ::testing::Le(static_cast<double>(kNumEchoRpcs) * kWeight25 /
- 100 * (1 + kErrorToleranceSmallLoad))));
-}
-
-TEST_P(LdsRdsTest, XdsRoutingWeightedClusterUpdateWeights) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kNewCluster3Name = "new_cluster_3";
- const char* kNewEdsService3Name = "new_eds_service_name_3";
- const size_t kNumEcho1Rpcs = 1000;
- const size_t kNumEchoRpcs = 10;
- const size_t kWeight75 = 75;
- const size_t kWeight25 = 25;
- const size_t kWeight50 = 50;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args3({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args3, kNewEdsService3Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- Cluster new_cluster3 = default_cluster_;
- new_cluster3.set_name(kNewCluster3Name);
- new_cluster3.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService3Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster3);
- // Populating Route Configurations.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- auto* weighted_cluster2 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster2->set_name(kNewCluster2Name);
- weighted_cluster2->mutable_weight()->set_value(kWeight25);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75 + kWeight25);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 1);
- WaitForAllBackends(1, 3, true, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const int weight_75_request_count =
- backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[1]->backend_service2()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- const int weight_25_request_count =
- backends_[2]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- weight_75_request_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 + kErrorTolerance))));
- // TODO(@donnadionne): Reduce tolerance: increased the tolerance to keep the
- // test from flaking while debugging potential root cause.
- const double kErrorToleranceSmallLoad = 0.3;
- gpr_log(GPR_INFO, "target_75 received %d rpcs and target_25 received %d rpcs",
- weight_75_request_count, weight_25_request_count);
- EXPECT_THAT(weight_25_request_count,
- ::testing::AllOf(
- ::testing::Ge(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 - kErrorToleranceSmallLoad)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 + kErrorToleranceSmallLoad))));
- // Change Route Configurations: same clusters different weights.
- weighted_cluster1->mutable_weight()->set_value(kWeight50);
- weighted_cluster2->mutable_weight()->set_value(kWeight50);
- // Change default route to a new cluster to help to identify when new polices
- // are seen by the client.
- default_route->mutable_route()->set_cluster(kNewCluster3Name);
- SetRouteConfiguration(0, new_route_config);
- ResetBackendCounters();
- WaitForAllBackends(3, 4);
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(0, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const int weight_50_request_count_1 =
- backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- const int weight_50_request_count_2 =
- backends_[2]->backend_service1()->request_count();
- EXPECT_EQ(kNumEchoRpcs, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- EXPECT_THAT(
- weight_50_request_count_1,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 + kErrorTolerance))));
- EXPECT_THAT(
- weight_50_request_count_2,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 + kErrorTolerance))));
-}
-
-TEST_P(LdsRdsTest, XdsRoutingWeightedClusterUpdateClusters) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kNewCluster3Name = "new_cluster_3";
- const char* kNewEdsService3Name = "new_eds_service_name_3";
- const size_t kNumEcho1Rpcs = 1000;
- const size_t kNumEchoRpcs = 10;
- const size_t kWeight75 = 75;
- const size_t kWeight25 = 25;
- const size_t kWeight50 = 50;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args3({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args3, kNewEdsService3Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- Cluster new_cluster3 = default_cluster_;
- new_cluster3.set_name(kNewCluster3Name);
- new_cluster3.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService3Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster3);
- // Populating Route Configurations.
- RouteConfiguration new_route_config = default_route_config_;
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* weighted_cluster1 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster1->set_name(kNewCluster1Name);
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- auto* weighted_cluster2 =
- route1->mutable_route()->mutable_weighted_clusters()->add_clusters();
- weighted_cluster2->set_name(kDefaultClusterName);
- weighted_cluster2->mutable_weight()->set_value(kWeight25);
- route1->mutable_route()
- ->mutable_weighted_clusters()
- ->mutable_total_weight()
- ->set_value(kWeight75 + kWeight25);
- auto* default_route = new_route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 1);
- WaitForAllBackends(1, 2, true, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- int weight_25_request_count =
- backends_[0]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- int weight_75_request_count =
- backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- weight_75_request_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 + kErrorTolerance))));
- // TODO(@donnadionne): Reduce tolerance: increased the tolerance to keep the
- // test from flaking while debugging potential root cause.
- const double kErrorToleranceSmallLoad = 0.3;
- gpr_log(GPR_INFO, "target_75 received %d rpcs and target_25 received %d rpcs",
- weight_75_request_count, weight_25_request_count);
- EXPECT_THAT(weight_25_request_count,
- ::testing::AllOf(
- ::testing::Ge(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 - kErrorToleranceSmallLoad)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 + kErrorToleranceSmallLoad))));
- // Change Route Configurations: new set of clusters with different weights.
- weighted_cluster1->mutable_weight()->set_value(kWeight50);
- weighted_cluster2->set_name(kNewCluster2Name);
- weighted_cluster2->mutable_weight()->set_value(kWeight50);
- SetRouteConfiguration(0, new_route_config);
- ResetBackendCounters();
- WaitForAllBackends(2, 3, true, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const int weight_50_request_count_1 =
- backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- const int weight_50_request_count_2 =
- backends_[2]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service1()->request_count());
- EXPECT_THAT(
- weight_50_request_count_1,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 + kErrorTolerance))));
- EXPECT_THAT(
- weight_50_request_count_2,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight50 / 100 * (1 + kErrorTolerance))));
- // Change Route Configurations.
- weighted_cluster1->mutable_weight()->set_value(kWeight75);
- weighted_cluster2->set_name(kNewCluster3Name);
- weighted_cluster2->mutable_weight()->set_value(kWeight25);
- SetRouteConfiguration(0, new_route_config);
- ResetBackendCounters();
- WaitForAllBackends(3, 4, true, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- weight_75_request_count = backends_[1]->backend_service1()->request_count();
- EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[2]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[3]->backend_service()->request_count());
- weight_25_request_count = backends_[3]->backend_service1()->request_count();
- EXPECT_THAT(
- weight_75_request_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) *
- kWeight75 / 100 * (1 + kErrorTolerance))));
- // TODO(@donnadionne): Reduce tolerance: increased the tolerance to keep the
- // test from flaking while debugging potential root cause.
- gpr_log(GPR_INFO, "target_75 received %d rpcs and target_25 received %d rpcs",
- weight_75_request_count, weight_25_request_count);
- EXPECT_THAT(weight_25_request_count,
- ::testing::AllOf(
- ::testing::Ge(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 - kErrorToleranceSmallLoad)),
- ::testing::Le(static_cast<double>(kNumEcho1Rpcs) * kWeight25 /
- 100 * (1 + kErrorToleranceSmallLoad))));
-}
-
-TEST_P(LdsRdsTest, XdsRoutingClusterUpdateClusters) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- const size_t kNumEchoRpcs = 5;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Send Route Configuration.
- RouteConfiguration new_route_config = default_route_config_;
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(0, 1);
- CheckRpcSendOk(kNumEchoRpcs);
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- // Change Route Configurations: new default cluster.
- auto* default_route =
- new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- default_route->mutable_route()->set_cluster(kNewClusterName);
- SetRouteConfiguration(0, new_route_config);
- WaitForAllBackends(1, 2);
- CheckRpcSendOk(kNumEchoRpcs);
- // Make sure RPCs all go to the correct backend.
- EXPECT_EQ(kNumEchoRpcs, backends_[1]->backend_service()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingClusterUpdateClustersWithPickingDelays) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Bring down the current backend: 0, this will delay route picking time,
- // resulting in un-committed RPCs.
- ShutdownBackend(0);
- // Send a RouteConfiguration with a default route that points to
- // backend 0.
- RouteConfiguration new_route_config = default_route_config_;
- SetRouteConfiguration(0, new_route_config);
- // Send exactly one RPC with no deadline and with wait_for_ready=true.
- // This RPC will not complete until after backend 0 is started.
- std::thread sending_rpc([this]() {
- CheckRpcSendOk(1, RpcOptions().set_wait_for_ready(true).set_timeout_ms(0));
- });
- // Send a non-wait_for_ready RPC which should fail, this will tell us
- // that the client has received the update and attempted to connect.
- const Status status = SendRpc(RpcOptions().set_timeout_ms(0));
- EXPECT_FALSE(status.ok());
- // Send a update RouteConfiguration to use backend 1.
- auto* default_route =
- new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- default_route->mutable_route()->set_cluster(kNewClusterName);
- SetRouteConfiguration(0, new_route_config);
- // Wait for RPCs to go to the new backend: 1, this ensures that the client has
- // processed the update.
- WaitForAllBackends(1, 2, false, RpcOptions(), true);
- // Bring up the previous backend: 0, this will allow the delayed RPC to
- // finally call on_call_committed upon completion.
- StartBackend(0);
- sending_rpc.join();
- // Make sure RPCs go to the correct backend:
- EXPECT_EQ(1, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(1, backends_[1]->backend_service()->request_count());
-}
-
-TEST_P(LdsRdsTest, XdsRoutingApplyXdsTimeout) {
- const int64_t kTimeoutMillis = 500;
- const int64_t kTimeoutNano = kTimeoutMillis * 1000000;
- const int64_t kTimeoutGrpcTimeoutHeaderMaxSecond = 1;
- const int64_t kTimeoutMaxStreamDurationSecond = 2;
- const int64_t kTimeoutHttpMaxStreamDurationSecond = 3;
- const int64_t kTimeoutApplicationSecond = 4;
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kNewCluster3Name = "new_cluster_3";
- const char* kNewEdsService3Name = "new_eds_service_name_3";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- AdsServiceImpl::EdsResourceArgs args3({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args3, kNewEdsService3Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- Cluster new_cluster3 = default_cluster_;
- new_cluster3.set_name(kNewCluster3Name);
- new_cluster3.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService3Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster3);
- // Construct listener.
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- // Set up HTTP max_stream_duration of 3.5 seconds
- auto* duration =
- http_connection_manager.mutable_common_http_protocol_options()
- ->mutable_max_stream_duration();
- duration->set_seconds(kTimeoutHttpMaxStreamDurationSecond);
- duration->set_nanos(kTimeoutNano);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- // Construct route config.
- RouteConfiguration new_route_config = default_route_config_;
- // route 1: Set max_stream_duration of 2.5 seconds, Set
- // grpc_timeout_header_max of 1.5
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service/Echo1");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* max_stream_duration =
- route1->mutable_route()->mutable_max_stream_duration();
- duration = max_stream_duration->mutable_max_stream_duration();
- duration->set_seconds(kTimeoutMaxStreamDurationSecond);
- duration->set_nanos(kTimeoutNano);
- duration = max_stream_duration->mutable_grpc_timeout_header_max();
- duration->set_seconds(kTimeoutGrpcTimeoutHeaderMaxSecond);
- duration->set_nanos(kTimeoutNano);
- // route 2: Set max_stream_duration of 2.5 seconds
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_path("/grpc.testing.EchoTest2Service/Echo2");
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- max_stream_duration = route2->mutable_route()->mutable_max_stream_duration();
- duration = max_stream_duration->mutable_max_stream_duration();
- duration->set_seconds(kTimeoutMaxStreamDurationSecond);
- duration->set_nanos(kTimeoutNano);
- // route 3: No timeout values in route configuration
- auto* route3 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route3->mutable_match()->set_path("/grpc.testing.EchoTestService/Echo");
- route3->mutable_route()->set_cluster(kNewCluster3Name);
- // Set listener and route config.
- SetListenerAndRouteConfiguration(0, std::move(listener), new_route_config);
- // Test grpc_timeout_header_max of 1.5 seconds applied
- grpc_millis t0 = NowFromCycleCounter();
- grpc_millis t1 =
- t0 + kTimeoutGrpcTimeoutHeaderMaxSecond * 1000 + kTimeoutMillis;
- grpc_millis t2 = t0 + kTimeoutMaxStreamDurationSecond * 1000 + kTimeoutMillis;
- CheckRpcSendFailure(1,
- RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true)
- .set_timeout_ms(kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- t0 = NowFromCycleCounter();
- EXPECT_GE(t0, t1);
- EXPECT_LT(t0, t2);
- // Test max_stream_duration of 2.5 seconds applied
- t0 = NowFromCycleCounter();
- t1 = t0 + kTimeoutMaxStreamDurationSecond * 1000 + kTimeoutMillis;
- t2 = t0 + kTimeoutHttpMaxStreamDurationSecond * 1000 + kTimeoutMillis;
- CheckRpcSendFailure(1,
- RpcOptions()
- .set_rpc_service(SERVICE_ECHO2)
- .set_rpc_method(METHOD_ECHO2)
- .set_wait_for_ready(true)
- .set_timeout_ms(kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- t0 = NowFromCycleCounter();
- EXPECT_GE(t0, t1);
- EXPECT_LT(t0, t2);
- // Test http_stream_duration of 3.5 seconds applied
- t0 = NowFromCycleCounter();
- t1 = t0 + kTimeoutHttpMaxStreamDurationSecond * 1000 + kTimeoutMillis;
- t2 = t0 + kTimeoutApplicationSecond * 1000 + kTimeoutMillis;
- CheckRpcSendFailure(1,
- RpcOptions().set_wait_for_ready(true).set_timeout_ms(
- kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- t0 = NowFromCycleCounter();
- EXPECT_GE(t0, t1);
- EXPECT_LT(t0, t2);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenXdsTimeoutExplicit0) {
- const int64_t kTimeoutNano = 500000000;
- const int64_t kTimeoutMaxStreamDurationSecond = 2;
- const int64_t kTimeoutHttpMaxStreamDurationSecond = 3;
- const int64_t kTimeoutApplicationSecond = 4;
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Construct listener.
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- // Set up HTTP max_stream_duration of 3.5 seconds
- auto* duration =
- http_connection_manager.mutable_common_http_protocol_options()
- ->mutable_max_stream_duration();
- duration->set_seconds(kTimeoutHttpMaxStreamDurationSecond);
- duration->set_nanos(kTimeoutNano);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- // Construct route config.
- RouteConfiguration new_route_config = default_route_config_;
- // route 1: Set max_stream_duration of 2.5 seconds, Set
- // grpc_timeout_header_max of 0
- auto* route1 = new_route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_path("/grpc.testing.EchoTest1Service/Echo1");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* max_stream_duration =
- route1->mutable_route()->mutable_max_stream_duration();
- duration = max_stream_duration->mutable_max_stream_duration();
- duration->set_seconds(kTimeoutMaxStreamDurationSecond);
- duration->set_nanos(kTimeoutNano);
- duration = max_stream_duration->mutable_grpc_timeout_header_max();
- duration->set_seconds(0);
- duration->set_nanos(0);
- // route 2: Set max_stream_duration to 0
- auto* route2 = new_route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_path("/grpc.testing.EchoTest2Service/Echo2");
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- max_stream_duration = route2->mutable_route()->mutable_max_stream_duration();
- duration = max_stream_duration->mutable_max_stream_duration();
- duration->set_seconds(0);
- duration->set_nanos(0);
- // Set listener and route config.
- SetListenerAndRouteConfiguration(0, std::move(listener), new_route_config);
- // Test application timeout is applied for route 1
- auto t0 = system_clock::now();
- CheckRpcSendFailure(1,
- RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_wait_for_ready(true)
- .set_timeout_ms(kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- auto ellapsed_nano_seconds =
- std::chrono::duration_cast<std::chrono::nanoseconds>(system_clock::now() -
- t0);
- EXPECT_GT(ellapsed_nano_seconds.count(),
- kTimeoutApplicationSecond * 1000000000);
- // Test application timeout is applied for route 2
- t0 = system_clock::now();
- CheckRpcSendFailure(1,
- RpcOptions()
- .set_rpc_service(SERVICE_ECHO2)
- .set_rpc_method(METHOD_ECHO2)
- .set_wait_for_ready(true)
- .set_timeout_ms(kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- ellapsed_nano_seconds = std::chrono::duration_cast<std::chrono::nanoseconds>(
- system_clock::now() - t0);
- EXPECT_GT(ellapsed_nano_seconds.count(),
- kTimeoutApplicationSecond * 1000000000);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenHttpTimeoutExplicit0) {
- const int64_t kTimeoutApplicationSecond = 4;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- auto listener = default_listener_;
- HttpConnectionManager http_connection_manager;
- listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
- &http_connection_manager);
- // Set up HTTP max_stream_duration to be explicit 0
- auto* duration =
- http_connection_manager.mutable_common_http_protocol_options()
- ->mutable_max_stream_duration();
- duration->set_seconds(0);
- duration->set_nanos(0);
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- // Set listener and route config.
- SetListenerAndRouteConfiguration(0, std::move(listener),
- default_route_config_);
- // Test application timeout is applied for route 1
- auto t0 = system_clock::now();
- CheckRpcSendFailure(1,
- RpcOptions().set_wait_for_ready(true).set_timeout_ms(
- kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- auto ellapsed_nano_seconds =
- std::chrono::duration_cast<std::chrono::nanoseconds>(system_clock::now() -
- t0);
- EXPECT_GT(ellapsed_nano_seconds.count(),
- kTimeoutApplicationSecond * 1000000000);
-}
-
-// Test to ensure application-specified deadline won't be affected when
-// the xDS config does not specify a timeout.
-TEST_P(LdsRdsTest, XdsRoutingWithOnlyApplicationTimeout) {
- const int64_t kTimeoutApplicationSecond = 4;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {grpc_pick_unused_port_or_die()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- auto t0 = system_clock::now();
- CheckRpcSendFailure(1,
- RpcOptions().set_wait_for_ready(true).set_timeout_ms(
- kTimeoutApplicationSecond * 1000),
- StatusCode::DEADLINE_EXCEEDED);
- auto ellapsed_nano_seconds =
- std::chrono::duration_cast<std::chrono::nanoseconds>(system_clock::now() -
- t0);
- EXPECT_GT(ellapsed_nano_seconds.count(),
- kTimeoutApplicationSecond * 1000000000);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingHeadersMatching) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- const size_t kNumEcho1Rpcs = 100;
- const size_t kNumEchoRpcs = 5;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("header1");
- header_matcher1->set_exact_match("POST,PUT,GET");
- auto* header_matcher2 = route1->mutable_match()->add_headers();
- header_matcher2->set_name("header2");
- header_matcher2->mutable_safe_regex_match()->set_regex("[a-z]*");
- auto* header_matcher3 = route1->mutable_match()->add_headers();
- header_matcher3->set_name("header3");
- header_matcher3->mutable_range_match()->set_start(1);
- header_matcher3->mutable_range_match()->set_end(1000);
- auto* header_matcher4 = route1->mutable_match()->add_headers();
- header_matcher4->set_name("header4");
- header_matcher4->set_present_match(false);
- auto* header_matcher5 = route1->mutable_match()->add_headers();
- header_matcher5->set_name("header5");
- header_matcher5->set_present_match(true);
- auto* header_matcher6 = route1->mutable_match()->add_headers();
- header_matcher6->set_name("header6");
- header_matcher6->set_prefix_match("/grpc");
- auto* header_matcher7 = route1->mutable_match()->add_headers();
- header_matcher7->set_name("header7");
- header_matcher7->set_suffix_match(".cc");
- header_matcher7->set_invert_match(true);
- route1->mutable_route()->set_cluster(kNewClusterName);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- std::vector<std::pair<TString, TString>> metadata = {
- {"header1", "POST"},
- {"header2", "blah"},
- {"header3", "1"},
- {"header5", "anything"},
- {"header6", "/grpc.testing.EchoTest1Service/"},
- {"header1", "PUT"},
- {"header7", "grpc.java"},
- {"header1", "GET"},
- };
- const auto header_match_rpc_options = RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_metadata(std::move(metadata));
- // Make sure all backends are up.
- WaitForAllBackends(0, 1);
- WaitForAllBackends(1, 2, true, header_match_rpc_options);
- // Send RPCs.
- CheckRpcSendOk(kNumEchoRpcs);
- CheckRpcSendOk(kNumEcho1Rpcs, header_match_rpc_options);
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service2()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service2()->request_count());
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialHeaderContentType) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- const size_t kNumEchoRpcs = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("content-type");
- header_matcher1->set_exact_match("notapplication/grpc");
- route1->mutable_route()->set_cluster(kNewClusterName);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- auto* header_matcher2 = default_route->mutable_match()->add_headers();
- header_matcher2->set_name("content-type");
- header_matcher2->set_exact_match("application/grpc");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- // Make sure the backend is up.
- WaitForAllBackends(0, 1);
- // Send RPCs.
- CheckRpcSendOk(kNumEchoRpcs);
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialCasesToIgnore) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const size_t kNumEchoRpcs = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("grpc-foo-bin");
- header_matcher1->set_present_match(true);
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- // Send headers which will mismatch each route
- std::vector<std::pair<TString, TString>> metadata = {
- {"grpc-foo-bin", "grpc-foo-bin"},
- };
- WaitForAllBackends(0, 1);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_metadata(metadata));
- // Verify that only the default backend got RPCs since all previous routes
- // were mismatched.
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingRuntimeFractionMatching) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- const size_t kNumRpcs = 1000;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()
- ->mutable_runtime_fraction()
- ->mutable_default_value()
- ->set_numerator(25);
- route1->mutable_route()->set_cluster(kNewClusterName);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- WaitForAllBackends(0, 2);
- CheckRpcSendOk(kNumRpcs);
- const int default_backend_count =
- backends_[0]->backend_service()->request_count();
- const int matched_backend_count =
- backends_[1]->backend_service()->request_count();
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- default_backend_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumRpcs) * 75 / 100 *
- (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumRpcs) * 75 / 100 *
- (1 + kErrorTolerance))));
- EXPECT_THAT(
- matched_backend_count,
- ::testing::AllOf(::testing::Ge(static_cast<double>(kNumRpcs) * 25 / 100 *
- (1 - kErrorTolerance)),
- ::testing::Le(static_cast<double>(kNumRpcs) * 25 / 100 *
- (1 + kErrorTolerance))));
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingUnmatchCases) {
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kNewCluster3Name = "new_cluster_3";
- const char* kNewEdsService3Name = "new_eds_service_name_3";
- const size_t kNumEcho1Rpcs = 100;
- const size_t kNumEchoRpcs = 5;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- AdsServiceImpl::EdsResourceArgs args3({
- {"locality0", GetBackendPorts(3, 4)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args3, kNewEdsService3Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- Cluster new_cluster3 = default_cluster_;
- new_cluster3.set_name(kNewCluster3Name);
- new_cluster3.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService3Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster3);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher1 = route1->mutable_match()->add_headers();
- header_matcher1->set_name("header1");
- header_matcher1->set_exact_match("POST");
- route1->mutable_route()->set_cluster(kNewCluster1Name);
- auto route2 = route_config.mutable_virtual_hosts(0)->add_routes();
- route2->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher2 = route2->mutable_match()->add_headers();
- header_matcher2->set_name("header2");
- header_matcher2->mutable_range_match()->set_start(1);
- header_matcher2->mutable_range_match()->set_end(1000);
- route2->mutable_route()->set_cluster(kNewCluster2Name);
- auto route3 = route_config.mutable_virtual_hosts(0)->add_routes();
- route3->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- auto* header_matcher3 = route3->mutable_match()->add_headers();
- header_matcher3->set_name("header3");
- header_matcher3->mutable_safe_regex_match()->set_regex("[a-z]*");
- route3->mutable_route()->set_cluster(kNewCluster3Name);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- // Send headers which will mismatch each route
- std::vector<std::pair<TString, TString>> metadata = {
- {"header1", "POST"},
- {"header2", "1000"},
- {"header3", "123"},
- {"header1", "GET"},
- };
- WaitForAllBackends(0, 1);
- CheckRpcSendOk(kNumEchoRpcs, RpcOptions().set_metadata(metadata));
- CheckRpcSendOk(kNumEcho1Rpcs, RpcOptions()
- .set_rpc_service(SERVICE_ECHO1)
- .set_rpc_method(METHOD_ECHO1)
- .set_metadata(metadata));
- // Verify that only the default backend got RPCs since all previous routes
- // were mismatched.
- for (size_t i = 1; i < 4; ++i) {
- EXPECT_EQ(0, backends_[i]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[i]->backend_service2()->request_count());
- }
- EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(kNumEcho1Rpcs, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service2()->request_count());
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(LdsRdsTest, XdsRoutingChangeRoutesWithoutChangingClusters) {
- const char* kNewClusterName = "new_cluster";
- const char* kNewEdsServiceName = "new_eds_service_name";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsServiceName));
- // Populate new CDS resources.
- Cluster new_cluster = default_cluster_;
- new_cluster.set_name(kNewClusterName);
- new_cluster.mutable_eds_cluster_config()->set_service_name(
- kNewEdsServiceName);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster);
- // Populating Route Configurations for LDS.
- RouteConfiguration route_config = default_route_config_;
- auto* route1 = route_config.mutable_virtual_hosts(0)->mutable_routes(0);
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest1Service/");
- route1->mutable_route()->set_cluster(kNewClusterName);
- auto* default_route = route_config.mutable_virtual_hosts(0)->add_routes();
- default_route->mutable_match()->set_prefix("");
- default_route->mutable_route()->set_cluster(kDefaultClusterName);
- SetRouteConfiguration(0, route_config);
- // Make sure all backends are up and that requests for each RPC
- // service go to the right backends.
- WaitForAllBackends(0, 1, false);
- WaitForAllBackends(1, 2, false, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- WaitForAllBackends(0, 1, false, RpcOptions().set_rpc_service(SERVICE_ECHO2));
- // Requests for services Echo and Echo2 should have gone to backend 0.
- EXPECT_EQ(1, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(1, backends_[0]->backend_service2()->request_count());
- // Requests for service Echo1 should have gone to backend 1.
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(1, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service2()->request_count());
- // Now send an update that changes the first route to match a
- // different RPC service, and wait for the client to make the change.
- route1->mutable_match()->set_prefix("/grpc.testing.EchoTest2Service/");
- SetRouteConfiguration(0, route_config);
- WaitForAllBackends(1, 2, true, RpcOptions().set_rpc_service(SERVICE_ECHO2));
- // Now repeat the earlier test, making sure all traffic goes to the
- // right place.
- WaitForAllBackends(0, 1, false);
- WaitForAllBackends(0, 1, false, RpcOptions().set_rpc_service(SERVICE_ECHO1));
- WaitForAllBackends(1, 2, false, RpcOptions().set_rpc_service(SERVICE_ECHO2));
- // Requests for services Echo and Echo1 should have gone to backend 0.
- EXPECT_EQ(1, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(1, backends_[0]->backend_service1()->request_count());
- EXPECT_EQ(0, backends_[0]->backend_service2()->request_count());
- // Requests for service Echo2 should have gone to backend 1.
- EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
- EXPECT_EQ(0, backends_[1]->backend_service1()->request_count());
- EXPECT_EQ(1, backends_[1]->backend_service2()->request_count());
-}
-
-// Test that we NACK unknown filter types in VirtualHost.
-TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(Listener());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("no filter registered for config type "
- "envoy.config.listener.v3.Listener"));
-}
-
-// Test that we ignore optional unknown filter types in VirtualHost.
-TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.mutable_config()->PackFrom(Listener());
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK filters without configs in VirtualHost.
-TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"];
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we NACK filters without configs in FilterConfig in VirtualHost.
-TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- ::envoy::config::route::v3::FilterConfig());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we ignore optional filters without configs in VirtualHost.
-TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK unparseable filter types in VirtualHost.
-TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInVirtualHost) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config =
- route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("router filter does not support config override"));
-}
-
-// Test that we NACK unknown filter types in Route.
-TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(Listener());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("no filter registered for config type "
- "envoy.config.listener.v3.Listener"));
-}
-
-// Test that we ignore optional unknown filter types in Route.
-TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.mutable_config()->PackFrom(Listener());
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK filters without configs in Route.
-TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"];
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we NACK filters without configs in FilterConfig in Route.
-TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInFilterConfigInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- ::envoy::config::route::v3::FilterConfig());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we ignore optional filters without configs in Route.
-TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK unparseable filter types in Route.
-TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInRoute) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* per_filter_config = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("router filter does not support config override"));
-}
-
-// Test that we NACK unknown filter types in ClusterWeight.
-TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(Listener());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("no filter registered for config type "
- "envoy.config.listener.v3.Listener"));
-}
-
-// Test that we ignore optional unknown filter types in ClusterWeight.
-TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.mutable_config()->PackFrom(Listener());
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK filters without configs in ClusterWeight.
-TEST_P(LdsRdsTest, RejectsHttpFilterWithoutConfigInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"];
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we NACK filters without configs in FilterConfig in ClusterWeight.
-TEST_P(LdsRdsTest,
- RejectsHttpFilterWithoutConfigInFilterConfigInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- ::envoy::config::route::v3::FilterConfig());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "no filter config specified for filter name unknown"));
-}
-
-// Test that we ignore optional filters without configs in ClusterWeight.
-TEST_P(LdsRdsTest, IgnoresOptionalHttpFilterWithoutConfigInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- ::envoy::config::route::v3::FilterConfig filter_config;
- filter_config.set_is_optional(true);
- (*per_filter_config)["unknown"].PackFrom(filter_config);
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- WaitForAllBackends();
- EXPECT_EQ(RouteConfigurationResponseState(0).state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Test that we NACK unparseable filter types in ClusterWeight.
-TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInClusterWeight) {
- if (GetParam().use_v2()) return; // Filters supported in v3 only.
- RouteConfiguration route_config = default_route_config_;
- auto* cluster_weight = route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_route()
- ->mutable_weighted_clusters()
- ->add_clusters();
- cluster_weight->set_name(kDefaultClusterName);
- cluster_weight->mutable_weight()->set_value(100);
- auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
- (*per_filter_config)["unknown"].PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- SetListenerAndRouteConfiguration(0, default_listener_, route_config);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Wait until xDS server sees NACK.
- do {
- CheckRpcSendFailure();
- } while (RouteConfigurationResponseState(0).state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state = RouteConfigurationResponseState(0);
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("router filter does not support config override"));
-}
-
-using CdsTest = BasicTest;
-
-// Tests that CDS client should send an ACK upon correct CDS response.
-TEST_P(CdsTest, Vanilla) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- (void)SendRpc();
- EXPECT_EQ(balancers_[0]->ads_service()->cds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
-}
-
-TEST_P(CdsTest, LogicalDNSClusterType) {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER",
- "true");
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create Logical DNS Cluster
- auto cluster = default_cluster_;
- cluster.set_type(Cluster::LOGICAL_DNS);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Set Logical DNS result
- {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(GetBackendPorts(1, 2));
- logical_dns_cluster_resolver_response_generator_->SetResponse(
- std::move(result));
- }
- // Wait for traffic to go to backend 1.
- WaitForBackend(1);
- gpr_unsetenv(
- "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
-}
-
-TEST_P(CdsTest, AggregateClusterType) {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER",
- "true");
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Create Aggregate Cluster
- auto cluster = default_cluster_;
- CustomClusterType* custom_cluster = cluster.mutable_cluster_type();
- custom_cluster->set_name("envoy.clusters.aggregate");
- ClusterConfig cluster_config;
- cluster_config.add_clusters(kNewCluster1Name);
- cluster_config.add_clusters(kNewCluster2Name);
- custom_cluster->mutable_typed_config()->PackFrom(cluster_config);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Wait for traffic to go to backend 1.
- WaitForBackend(1);
- // Shutdown backend 1 and wait for all traffic to go to backend 2.
- ShutdownBackend(1);
- WaitForBackend(2);
- EXPECT_EQ(balancers_[0]->ads_service()->cds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
- // Bring backend 1 back and ensure all traffic go back to it.
- StartBackend(1);
- WaitForBackend(1);
- gpr_unsetenv(
- "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
-}
-
-TEST_P(CdsTest, AggregateClusterEdsToLogicalDns) {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER",
- "true");
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const char* kNewCluster1Name = "new_cluster_1";
- const char* kNewEdsService1Name = "new_eds_service_name_1";
- const char* kLogicalDNSClusterName = "logical_dns_cluster";
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args1({
- {"locality0", GetBackendPorts(1, 2)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args1, kNewEdsService1Name));
- // Populate new CDS resources.
- Cluster new_cluster1 = default_cluster_;
- new_cluster1.set_name(kNewCluster1Name);
- new_cluster1.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService1Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster1);
- // Create Logical DNS Cluster
- auto logical_dns_cluster = default_cluster_;
- logical_dns_cluster.set_name(kLogicalDNSClusterName);
- logical_dns_cluster.set_type(Cluster::LOGICAL_DNS);
- balancers_[0]->ads_service()->SetCdsResource(logical_dns_cluster);
- // Create Aggregate Cluster
- auto cluster = default_cluster_;
- CustomClusterType* custom_cluster = cluster.mutable_cluster_type();
- custom_cluster->set_name("envoy.clusters.aggregate");
- ClusterConfig cluster_config;
- cluster_config.add_clusters(kNewCluster1Name);
- cluster_config.add_clusters(kLogicalDNSClusterName);
- custom_cluster->mutable_typed_config()->PackFrom(cluster_config);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Set Logical DNS result
- {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(GetBackendPorts(2, 3));
- logical_dns_cluster_resolver_response_generator_->SetResponse(
- std::move(result));
- }
- // Wait for traffic to go to backend 1.
- WaitForBackend(1);
- // Shutdown backend 1 and wait for all traffic to go to backend 2.
- ShutdownBackend(1);
- WaitForBackend(2);
- EXPECT_EQ(balancers_[0]->ads_service()->cds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
- // Bring backend 1 back and ensure all traffic go back to it.
- StartBackend(1);
- WaitForBackend(1);
- gpr_unsetenv(
- "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
-}
-
-TEST_P(CdsTest, AggregateClusterLogicalDnsToEds) {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER",
- "true");
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const char* kNewCluster2Name = "new_cluster_2";
- const char* kNewEdsService2Name = "new_eds_service_name_2";
- const char* kLogicalDNSClusterName = "logical_dns_cluster";
- // Populate new EDS resources.
- AdsServiceImpl::EdsResourceArgs args2({
- {"locality0", GetBackendPorts(2, 3)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args2, kNewEdsService2Name));
- // Populate new CDS resources.
- Cluster new_cluster2 = default_cluster_;
- new_cluster2.set_name(kNewCluster2Name);
- new_cluster2.mutable_eds_cluster_config()->set_service_name(
- kNewEdsService2Name);
- balancers_[0]->ads_service()->SetCdsResource(new_cluster2);
- // Create Logical DNS Cluster
- auto logical_dns_cluster = default_cluster_;
- logical_dns_cluster.set_name(kLogicalDNSClusterName);
- logical_dns_cluster.set_type(Cluster::LOGICAL_DNS);
- balancers_[0]->ads_service()->SetCdsResource(logical_dns_cluster);
- // Create Aggregate Cluster
- auto cluster = default_cluster_;
- CustomClusterType* custom_cluster = cluster.mutable_cluster_type();
- custom_cluster->set_name("envoy.clusters.aggregate");
- ClusterConfig cluster_config;
- cluster_config.add_clusters(kLogicalDNSClusterName);
- cluster_config.add_clusters(kNewCluster2Name);
- custom_cluster->mutable_typed_config()->PackFrom(cluster_config);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Set Logical DNS result
- {
- grpc_core::ExecCtx exec_ctx;
- grpc_core::Resolver::Result result;
- result.addresses = CreateAddressListFromPortList(GetBackendPorts(1, 2));
- logical_dns_cluster_resolver_response_generator_->SetResponse(
- std::move(result));
- }
- // Wait for traffic to go to backend 1.
- WaitForBackend(1);
- // Shutdown backend 1 and wait for all traffic to go to backend 2.
- ShutdownBackend(1);
- WaitForBackend(2);
- EXPECT_EQ(balancers_[0]->ads_service()->cds_response_state().state,
- AdsServiceImpl::ResponseState::ACKED);
- // Bring backend 1 back and ensure all traffic go back to it.
- StartBackend(1);
- WaitForBackend(1);
- gpr_unsetenv(
- "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER");
-}
-
-// Test that CDS client should send a NACK if cluster type is Logical DNS but
-// the feature is not yet supported.
-TEST_P(CdsTest, LogicalDNSClusterTypeDisabled) {
- auto cluster = default_cluster_;
- cluster.set_type(Cluster::LOGICAL_DNS);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("DiscoveryType is not valid."));
-}
-
-// Test that CDS client should send a NACK if cluster type is AGGREGATE but
-// the feature is not yet supported.
-TEST_P(CdsTest, AggregateClusterTypeDisabled) {
- auto cluster = default_cluster_;
- CustomClusterType* custom_cluster = cluster.mutable_cluster_type();
- custom_cluster->set_name("envoy.clusters.aggregate");
- ClusterConfig cluster_config;
- cluster_config.add_clusters("cluster1");
- cluster_config.add_clusters("cluster2");
- custom_cluster->mutable_typed_config()->PackFrom(cluster_config);
- cluster.set_type(Cluster::LOGICAL_DNS);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("DiscoveryType is not valid."));
-}
-
-// Tests that CDS client should send a NACK if the cluster type in CDS response
-// is unsupported.
-TEST_P(CdsTest, UnsupportedClusterType) {
- auto cluster = default_cluster_;
- cluster.set_type(Cluster::STATIC);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("DiscoveryType is not valid."));
-}
-
-// Tests that the NACK for multiple bad resources includes both errors.
-TEST_P(CdsTest, MultipleBadResources) {
- constexpr char kClusterName2[] = "cluster_name_2";
- // Use unsupported type for default cluster.
- auto cluster = default_cluster_;
- cluster.set_type(Cluster::STATIC);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Add second cluster with the same error.
- cluster.set_name(kClusterName2);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // Change RouteConfig to point to both clusters.
- RouteConfiguration route_config = default_route_config_;
- auto* route = route_config.mutable_virtual_hosts(0)->add_routes();
- route->mutable_match()->set_prefix("");
- route->mutable_route()->set_cluster(kClusterName2);
- SetRouteConfiguration(0, route_config);
- // Send RPC.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::AllOf(
- ::testing::HasSubstr(y_absl::StrCat(
- kDefaultClusterName, ": DiscoveryType is not valid.")),
- ::testing::HasSubstr(y_absl::StrCat(
- kClusterName2, ": DiscoveryType is not valid."))));
-}
-
-// Tests that CDS client should send a NACK if the eds_config in CDS response is
-// other than ADS.
-TEST_P(CdsTest, WrongEdsConfig) {
- auto cluster = default_cluster_;
- cluster.mutable_eds_cluster_config()->mutable_eds_config()->mutable_self();
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("EDS ConfigSource is not ADS."));
-}
-
-// Tests that CDS client should send a NACK if the lb_policy in CDS response is
-// other than ROUND_ROBIN.
-TEST_P(CdsTest, WrongLbPolicy) {
- auto cluster = default_cluster_;
- cluster.set_lb_policy(Cluster::LEAST_REQUEST);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("LB policy is not supported."));
-}
-
-// Tests that CDS client should send a NACK if the lrs_server in CDS response is
-// other than SELF.
-TEST_P(CdsTest, WrongLrsServer) {
- auto cluster = default_cluster_;
- cluster.mutable_lrs_server()->mutable_ads();
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("LRS ConfigSource is not self."));
-}
-
-class XdsSecurityTest : public BasicTest {
- protected:
- static void SetUpTestCase() {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT", "true");
- BasicTest::SetUpTestCase();
- }
-
- static void TearDownTestCase() {
- BasicTest::TearDownTestCase();
- gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT");
- }
-
- void SetUp() override {
- BasicTest::SetUp();
- root_cert_ = ReadFile(kCaCertPath);
- bad_root_cert_ = ReadFile(kBadClientCertPath);
- identity_pair_ = ReadTlsIdentityPair(kClientKeyPath, kClientCertPath);
- // TODO(yashykt): Use different client certs here instead of reusing server
- // certs after https://github.com/grpc/grpc/pull/24876 is merged
- fallback_identity_pair_ =
- ReadTlsIdentityPair(kServerKeyPath, kServerCertPath);
- bad_identity_pair_ =
- ReadTlsIdentityPair(kBadClientKeyPath, kBadClientCertPath);
- server_san_exact_.set_exact("*.test.google.fr");
- server_san_prefix_.set_prefix("waterzooi.test.google");
- server_san_suffix_.set_suffix("google.fr");
- server_san_contains_.set_contains("google");
- server_san_regex_.mutable_safe_regex()->mutable_google_re2();
- server_san_regex_.mutable_safe_regex()->set_regex(
- "(foo|waterzooi).test.google.(fr|be)");
- bad_san_1_.set_exact("192.168.1.4");
- bad_san_2_.set_exact("foo.test.google.in");
- authenticated_identity_ = {"testclient"};
- fallback_authenticated_identity_ = {"*.test.google.fr",
- "waterzooi.test.google.be",
- "*.test.youtube.com", "192.168.1.3"};
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolutionForLbChannelAllBalancers();
- }
-
- void TearDown() override {
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
- BasicTest::TearDown();
- }
-
- // Sends CDS updates with the new security configuration and verifies that
- // after propagation, this new configuration is used for connections. If \a
- // identity_instance_name and \a root_instance_name are both empty,
- // connections are expected to use fallback credentials.
- void UpdateAndVerifyXdsSecurityConfiguration(
- y_absl::string_view root_instance_name,
- y_absl::string_view root_certificate_name,
- y_absl::string_view identity_instance_name,
- y_absl::string_view identity_certificate_name,
- const std::vector<StringMatcher>& san_matchers,
- const std::vector<TString>& expected_authenticated_identity,
- bool test_expects_failure = false) {
- auto cluster = default_cluster_;
- if (!identity_instance_name.empty() || !root_instance_name.empty()) {
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- if (!identity_instance_name.empty()) {
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_instance_name(TString(identity_instance_name));
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_certificate_name(TString(identity_certificate_name));
- }
- if (!root_instance_name.empty()) {
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_instance_name(TString(root_instance_name));
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_certificate_name(TString(root_certificate_name));
- }
- if (!san_matchers.empty()) {
- auto* validation_context =
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_default_validation_context();
- for (const auto& san_matcher : san_matchers) {
- *validation_context->add_match_subject_alt_names() = san_matcher;
- }
- }
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- }
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // The updates might take time to have an effect, so use a retry loop.
- constexpr int kRetryCount = 100;
- int num_tries = 0;
- for (; num_tries < kRetryCount; num_tries++) {
- // Give some time for the updates to propagate.
- gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
- if (test_expects_failure) {
- // Restart the servers to force a reconnection so that previously
- // connected subchannels are not used for the RPC.
- ShutdownBackend(0);
- StartBackend(0);
- if (SendRpc().ok()) {
- gpr_log(GPR_ERROR, "RPC succeeded. Failure expected. Trying again.");
- continue;
- }
- } else {
- WaitForBackend(0);
- Status status = SendRpc();
- if (!status.ok()) {
- gpr_log(GPR_ERROR, "RPC failed. code=%d message=%s Trying again.",
- status.error_code(), status.error_message().c_str());
- continue;
- }
- if (backends_[0]->backend_service()->last_peer_identity() !=
- expected_authenticated_identity) {
- gpr_log(
- GPR_ERROR,
- "Expected client identity does not match. (actual) %s vs "
- "(expected) %s Trying again.",
- y_absl::StrJoin(
- backends_[0]->backend_service()->last_peer_identity(), ",")
- .c_str(),
- y_absl::StrJoin(expected_authenticated_identity, ",").c_str());
- continue;
- }
- }
- break;
- }
- EXPECT_LT(num_tries, kRetryCount);
- }
-
- TString root_cert_;
- TString bad_root_cert_;
- grpc_core::PemKeyCertPairList identity_pair_;
- grpc_core::PemKeyCertPairList fallback_identity_pair_;
- grpc_core::PemKeyCertPairList bad_identity_pair_;
- StringMatcher server_san_exact_;
- StringMatcher server_san_prefix_;
- StringMatcher server_san_suffix_;
- StringMatcher server_san_contains_;
- StringMatcher server_san_regex_;
- StringMatcher bad_san_1_;
- StringMatcher bad_san_2_;
- std::vector<TString> authenticated_identity_;
- std::vector<TString> fallback_authenticated_identity_;
-};
-
-TEST_P(XdsSecurityTest,
- TLSConfigurationWithoutValidationContextCertificateProviderInstance) {
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "TLS configuration provided but no "
- "validation_context_certificate_provider_instance found."));
-}
-
-TEST_P(
- XdsSecurityTest,
- MatchSubjectAltNamesProvidedWithoutValidationContextCertificateProviderInstance) {
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- auto* validation_context = upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_default_validation_context();
- *validation_context->add_match_subject_alt_names() = server_san_exact_;
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "TLS configuration provided but no "
- "validation_context_certificate_provider_instance found."));
-}
-
-TEST_P(
- XdsSecurityTest,
- TlsCertificateCertificateProviderInstanceWithoutValidationContextCertificateProviderInstance) {
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_instance_name(TString("instance_name"));
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "TLS configuration provided but no "
- "validation_context_certificate_provider_instance found."));
-}
-
-TEST_P(XdsSecurityTest, RegexSanMatcherDoesNotAllowIgnoreCase) {
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_instance_name(TString("fake_plugin1"));
- auto* validation_context = upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_default_validation_context();
- StringMatcher matcher;
- matcher.mutable_safe_regex()->mutable_google_re2();
- matcher.mutable_safe_regex()->set_regex(
- "(foo|waterzooi).test.google.(fr|be)");
- matcher.set_ignore_case(true);
- *validation_context->add_match_subject_alt_names() = matcher;
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->cds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "StringMatcher: ignore_case has no effect for SAFE_REGEX."));
-}
-
-TEST_P(XdsSecurityTest, UnknownRootCertificateProvider) {
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_instance_name("unknown");
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure(1, RpcOptions(), StatusCode::UNAVAILABLE);
-}
-
-TEST_P(XdsSecurityTest, UnknownIdentityCertificateProvider) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- auto cluster = default_cluster_;
- auto* transport_socket = cluster.mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- UpstreamTlsContext upstream_tls_context;
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_instance_name("unknown");
- upstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_instance_name("fake_plugin1");
- transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- CheckRpcSendFailure(1, RpcOptions(), StatusCode::UNAVAILABLE);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithNoSanMatchers) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {}, authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithExactSanMatcher) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithPrefixSanMatcher) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_prefix_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithSuffixSanMatcher) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_suffix_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithContainsSanMatcher) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_contains_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithRegexSanMatcher) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_regex_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithSanMatchersUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "fake_plugin1", "",
- {server_san_exact_, server_san_prefix_}, authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {bad_san_1_, bad_san_2_}, {},
- true /* failure */);
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "fake_plugin1", "",
- {server_san_prefix_, server_san_regex_}, authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithRootPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {bad_root_cert_, bad_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin2" /* bad root */, "",
- "fake_plugin1", "", {}, {},
- true /* failure */);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithIdentityPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {root_cert_, fallback_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin2",
- "", {server_san_exact_},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithBothPluginsUpdated) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {bad_root_cert_, bad_identity_pair_}},
- {"good", {root_cert_, fallback_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin2", "", "fake_plugin2",
- "", {}, {}, true /* failure */);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_prefix_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin2", "good", "fake_plugin2", "good", {server_san_prefix_},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithRootCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"bad", {bad_root_cert_, bad_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_regex_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "bad", "fake_plugin1",
- "", {server_san_regex_}, {},
- true /* failure */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest,
- TestMtlsConfigurationWithIdentityCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"bad", {bad_root_cert_, bad_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "bad", {server_san_exact_}, {},
- true /* failure */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest,
- TestMtlsConfigurationWithIdentityCertificateNameUpdateGoodCerts) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"good", {root_cert_, fallback_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "good", {server_san_exact_},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsConfigurationWithBothCertificateNamesUpdated) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"bad", {bad_root_cert_, bad_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "bad", "fake_plugin1",
- "bad", {server_san_prefix_}, {},
- true /* failure */);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_prefix_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsConfigurationWithNoSanMatchers) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "", {},
- {} /* unauthenticated */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsConfigurationWithSanMatchers) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "", "",
- {server_san_exact_, server_san_prefix_, server_san_regex_},
- {} /* unauthenticated */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsConfigurationWithSanMatchersUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "", "", {server_san_exact_, server_san_prefix_},
- {} /* unauthenticated */);
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "", "", {bad_san_1_, bad_san_2_},
- {} /* unauthenticated */, true /* failure */);
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin1", "", "", "", {server_san_prefix_, server_san_regex_},
- {} /* unauthenticated */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsConfigurationWithRootCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"bad", {bad_root_cert_, bad_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "bad", "", "",
- {server_san_exact_}, {},
- true /* failure */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsConfigurationWithRootPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {bad_root_cert_, bad_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- UpdateAndVerifyXdsSecurityConfiguration(
- "fake_plugin2", "", "", "", {server_san_exact_}, {}, true /* failure */);
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestFallbackConfiguration) {
- UpdateAndVerifyXdsSecurityConfiguration("", "", "", "", {},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsToTls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestMtlsToFallback) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("", "", "", "", {},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsToMtls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestTlsToFallback) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- UpdateAndVerifyXdsSecurityConfiguration("", "", "", "", {},
- fallback_authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestFallbackToMtls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("", "", "", "", {},
- fallback_authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "fake_plugin1",
- "", {server_san_exact_},
- authenticated_identity_);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestFallbackToTls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- UpdateAndVerifyXdsSecurityConfiguration("", "", "", "", {},
- fallback_authenticated_identity_);
- UpdateAndVerifyXdsSecurityConfiguration("fake_plugin1", "", "", "",
- {server_san_exact_},
- {} /* unauthenticated */);
- g_fake1_cert_data_map = nullptr;
-}
-
-TEST_P(XdsSecurityTest, TestFileWatcherCertificateProvider) {
- UpdateAndVerifyXdsSecurityConfiguration("file_plugin", "", "file_plugin", "",
- {server_san_exact_},
- authenticated_identity_);
-}
-
-class XdsEnabledServerTest : public XdsEnd2endTest {
- protected:
- XdsEnabledServerTest()
- : XdsEnd2endTest(1, 1, 100, true /* use_xds_enabled_server */) {}
-
- void SetUp() override {
- XdsEnd2endTest::SetUp();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- }
-};
-
-TEST_P(XdsEnabledServerTest, Basic) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- WaitForBackend(0);
-}
-
-TEST_P(XdsEnabledServerTest, BadLdsUpdateNoApiListenerNorAddress) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Listener has neither address nor ApiListener"));
-}
-
-TEST_P(XdsEnabledServerTest, BadLdsUpdateBothApiListenerAndAddress) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- listener.mutable_api_listener();
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Listener has both address and ApiListener"));
-}
-
-TEST_P(XdsEnabledServerTest, UnsupportedL4Filter) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(default_listener_ /* any proto object other than HttpConnectionManager */);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("Unsupported filter type"));
-}
-
-TEST_P(XdsEnabledServerTest, UnsupportedHttpFilter) {
- // Set env var to enable filters parsing.
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- HttpConnectionManager http_connection_manager;
- auto* http_filter = http_connection_manager.add_http_filters();
- http_filter->set_name("grpc.testing.unsupported_http_filter");
- http_filter->mutable_typed_config()->set_type_url(
- "grpc.testing.unsupported_http_filter");
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:",
- backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("no filter registered for config type "
- "grpc.testing.unsupported_http_filter"));
-}
-
-TEST_P(XdsEnabledServerTest, HttpFilterNotSupportedOnServer) {
- // Set env var to enable filters parsing.
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- HttpConnectionManager http_connection_manager;
- auto* http_filter = http_connection_manager.add_http_filters();
- http_filter->set_name("grpc.testing.client_only_http_filter");
- http_filter->mutable_typed_config()->set_type_url(
- "grpc.testing.client_only_http_filter");
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:",
- backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Filter grpc.testing.client_only_http_filter is not "
- "supported on servers"));
-}
-
-TEST_P(XdsEnabledServerTest,
- HttpFilterNotSupportedOnServerIgnoredWhenOptional) {
- // Set env var to enable filters parsing.
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- HttpConnectionManager http_connection_manager;
- auto* http_filter = http_connection_manager.add_http_filters();
- http_filter->set_name("grpc.testing.client_only_http_filter");
- http_filter->mutable_typed_config()->set_type_url(
- "grpc.testing.client_only_http_filter");
- http_filter->set_is_optional(true);
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- http_connection_manager);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:",
- backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- WaitForBackend(0);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
-}
-
-// Verify that a mismatch of listening address results in "not serving" status.
-TEST_P(XdsEnabledServerTest, ListenerAddressMismatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- WaitForBackend(0);
- // Set a different listening address in the LDS update
- listener.mutable_address()->mutable_socket_address()->set_address(
- "192.168.1.1");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::FAILED_PRECONDITION);
-}
-
-TEST_P(XdsEnabledServerTest, UseOriginalDstNotSupported) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.mutable_address()->mutable_socket_address()->set_address(
- ipv6_only_ ? "::1" : "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- listener.add_filter_chains()->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- listener.mutable_use_original_dst()->set_value(true);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Field \'use_original_dst\' is not supported."));
-}
-
-class XdsServerSecurityTest : public XdsEnd2endTest {
- protected:
- XdsServerSecurityTest()
- : XdsEnd2endTest(1, 1, 100, true /* use_xds_enabled_server */) {}
-
- static void SetUpTestCase() {
- gpr_setenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT", "true");
- XdsEnd2endTest::SetUpTestCase();
- }
-
- static void TearDownTestCase() {
- XdsEnd2endTest::TearDownTestCase();
- gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT");
- }
-
- void SetUp() override {
- XdsEnd2endTest::SetUp();
- root_cert_ = ReadFile(kCaCertPath);
- bad_root_cert_ = ReadFile(kBadClientCertPath);
- identity_pair_ = ReadTlsIdentityPair(kServerKeyPath, kServerCertPath);
- bad_identity_pair_ =
- ReadTlsIdentityPair(kBadClientKeyPath, kBadClientCertPath);
- identity_pair_2_ = ReadTlsIdentityPair(kClientKeyPath, kClientCertPath);
- server_authenticated_identity_ = {"*.test.google.fr",
- "waterzooi.test.google.be",
- "*.test.youtube.com", "192.168.1.3"};
- server_authenticated_identity_2_ = {"testclient"};
- client_authenticated_identity_ = {"*.test.google.fr",
- "waterzooi.test.google.be",
- "*.test.youtube.com", "192.168.1.3"};
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- }
-
- void TearDown() override {
- g_fake1_cert_data_map = nullptr;
- g_fake2_cert_data_map = nullptr;
- XdsEnd2endTest::TearDown();
- }
-
- void SetLdsUpdate(y_absl::string_view root_instance_name,
- y_absl::string_view root_certificate_name,
- y_absl::string_view identity_instance_name,
- y_absl::string_view identity_certificate_name,
- bool require_client_certificates) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=127.0.0.1:",
- backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address(
- "127.0.0.1");
- listener.mutable_address()->mutable_socket_address()->set_port_value(
- backends_[0]->port());
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- if (!identity_instance_name.empty()) {
- auto* transport_socket = filter_chain->mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- DownstreamTlsContext downstream_tls_context;
- downstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_instance_name(TString(identity_instance_name));
- downstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_certificate_name(TString(identity_certificate_name));
- if (!root_instance_name.empty()) {
- downstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_instance_name(TString(root_instance_name));
- downstream_tls_context.mutable_common_tls_context()
- ->mutable_combined_validation_context()
- ->mutable_validation_context_certificate_provider_instance()
- ->set_certificate_name(TString(root_certificate_name));
- downstream_tls_context.mutable_require_client_certificate()->set_value(
- require_client_certificates);
- }
- transport_socket->mutable_typed_config()->PackFrom(
- downstream_tls_context);
- }
- balancers_[0]->ads_service()->SetLdsResource(listener);
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=[::1]:",
- backends_[0]->port()));
- listener.mutable_address()->mutable_socket_address()->set_address("[::1]");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- }
-
- std::shared_ptr<grpc::Channel> CreateMtlsChannel() {
- ChannelArguments args;
- // Override target name for host name check
- args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
- ipv6_only_ ? "::1" : "127.0.0.1");
- args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1);
- TString uri = y_absl::StrCat(
- ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port());
- // TODO(yashykt): Switch to using C++ API once b/173823806 is fixed.
- grpc_tls_credentials_options* options =
- grpc_tls_credentials_options_create();
- grpc_tls_credentials_options_set_server_verification_option(
- options, GRPC_TLS_SKIP_HOSTNAME_VERIFICATION);
- grpc_tls_credentials_options_set_certificate_provider(
- options,
- grpc_core::MakeRefCounted<grpc_core::StaticDataCertificateProvider>(
- ReadFile(kCaCertPath),
- ReadTlsIdentityPair(kServerKeyPath, kServerCertPath))
- .get());
- grpc_tls_credentials_options_watch_root_certs(options);
- grpc_tls_credentials_options_watch_identity_key_cert_pairs(options);
- grpc_tls_server_authorization_check_config* check_config =
- grpc_tls_server_authorization_check_config_create(
- nullptr, ServerAuthCheckSchedule, nullptr, nullptr);
- grpc_tls_credentials_options_set_server_authorization_check_config(
- options, check_config);
- auto channel_creds = std::make_shared<SecureChannelCredentials>(
- grpc_tls_credentials_create(options));
- grpc_tls_server_authorization_check_config_release(check_config);
- return CreateCustomChannel(uri, channel_creds, args);
- }
-
- std::shared_ptr<grpc::Channel> CreateTlsChannel() {
- ChannelArguments args;
- // Override target name for host name check
- args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
- ipv6_only_ ? "::1" : "127.0.0.1");
- args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1);
- TString uri = y_absl::StrCat(
- ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port());
- // TODO(yashykt): Switch to using C++ API once b/173823806 is fixed.
- grpc_tls_credentials_options* options =
- grpc_tls_credentials_options_create();
- grpc_tls_credentials_options_set_server_verification_option(
- options, GRPC_TLS_SKIP_HOSTNAME_VERIFICATION);
- grpc_tls_credentials_options_set_certificate_provider(
- options,
- grpc_core::MakeRefCounted<grpc_core::StaticDataCertificateProvider>(
- ReadFile(kCaCertPath),
- ReadTlsIdentityPair(kServerKeyPath, kServerCertPath))
- .get());
- grpc_tls_credentials_options_watch_root_certs(options);
- grpc_tls_server_authorization_check_config* check_config =
- grpc_tls_server_authorization_check_config_create(
- nullptr, ServerAuthCheckSchedule, nullptr, nullptr);
- grpc_tls_credentials_options_set_server_authorization_check_config(
- options, check_config);
- auto channel_creds = std::make_shared<SecureChannelCredentials>(
- grpc_tls_credentials_create(options));
- grpc_tls_server_authorization_check_config_release(check_config);
- return CreateCustomChannel(uri, channel_creds, args);
- }
-
- std::shared_ptr<grpc::Channel> CreateInsecureChannel() {
- ChannelArguments args;
- // Override target name for host name check
- args.SetString(GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
- ipv6_only_ ? "::1" : "127.0.0.1");
- args.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1);
- TString uri = y_absl::StrCat(
- ipv6_only_ ? "ipv6:[::1]:" : "ipv4:127.0.0.1:", backends_[0]->port());
- return CreateCustomChannel(uri, InsecureChannelCredentials(), args);
- }
-
- void SendRpc(std::function<std::shared_ptr<grpc::Channel>()> channel_creator,
- std::vector<TString> expected_server_identity,
- std::vector<TString> expected_client_identity,
- bool test_expects_failure = false) {
- gpr_log(GPR_INFO, "Sending RPC");
- int num_tries = 0;
- constexpr int kRetryCount = 10;
- for (; num_tries < kRetryCount; num_tries++) {
- auto channel = channel_creator();
- auto stub = grpc::testing::EchoTestService::NewStub(channel);
- ClientContext context;
- context.set_wait_for_ready(true);
- context.set_deadline(grpc_timeout_milliseconds_to_deadline(2000));
- EchoRequest request;
- request.set_message(kRequestMessage);
- EchoResponse response;
- Status status = stub->Echo(&context, request, &response);
- if (test_expects_failure) {
- if (status.ok()) {
- gpr_log(GPR_ERROR, "RPC succeeded. Failure expected. Trying again.");
- continue;
- }
- } else {
- if (!status.ok()) {
- gpr_log(GPR_ERROR, "RPC failed. code=%d message=%s Trying again.",
- status.error_code(), status.error_message().c_str());
- continue;
- }
- EXPECT_EQ(response.message(), kRequestMessage);
- std::vector<TString> peer_identity;
- for (const auto& entry : context.auth_context()->GetPeerIdentity()) {
- peer_identity.emplace_back(
- TString(entry.data(), entry.size()).c_str());
- }
- if (peer_identity != expected_server_identity) {
- gpr_log(GPR_ERROR,
- "Expected server identity does not match. (actual) %s vs "
- "(expected) %s Trying again.",
- y_absl::StrJoin(peer_identity, ",").c_str(),
- y_absl::StrJoin(expected_server_identity, ",").c_str());
- continue;
- }
- if (backends_[0]->backend_service()->last_peer_identity() !=
- expected_client_identity) {
- gpr_log(
- GPR_ERROR,
- "Expected client identity does not match. (actual) %s vs "
- "(expected) %s Trying again.",
- y_absl::StrJoin(
- backends_[0]->backend_service()->last_peer_identity(), ",")
- .c_str(),
- y_absl::StrJoin(expected_client_identity, ",").c_str());
- continue;
- }
- }
- break;
- }
- EXPECT_LT(num_tries, kRetryCount);
- }
-
- TString root_cert_;
- TString bad_root_cert_;
- grpc_core::PemKeyCertPairList identity_pair_;
- grpc_core::PemKeyCertPairList bad_identity_pair_;
- grpc_core::PemKeyCertPairList identity_pair_2_;
- std::vector<TString> server_authenticated_identity_;
- std::vector<TString> server_authenticated_identity_2_;
- std::vector<TString> client_authenticated_identity_;
-};
-
-TEST_P(XdsServerSecurityTest, TlsConfigurationWithoutRootProviderInstance) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- balancers_[0]->ads_service()->SetLdsResource(listener);
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* transport_socket = filter_chain->mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- DownstreamTlsContext downstream_tls_context;
- transport_socket->mutable_typed_config()->PackFrom(downstream_tls_context);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- CheckRpcSendFailure(1, RpcOptions().set_wait_for_ready(true));
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr(
- "TLS configuration provided but no "
- "tls_certificate_certificate_provider_instance found."));
-}
-
-TEST_P(XdsServerSecurityTest, UnknownIdentityCertificateProvider) {
- SetLdsUpdate("", "", "unknown", "", false);
- SendRpc([this]() { return CreateTlsChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerSecurityTest, UnknownRootCertificateProvider) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- SetLdsUpdate("unknown", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithRootPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {bad_root_cert_, bad_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin2", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithIdentityPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {root_cert_, identity_pair_2_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin1", "", "fake_plugin2", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_2_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithBothPluginsUpdated) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"good", {root_cert_, identity_pair_2_}},
- {"", {bad_root_cert_, bad_identity_pair_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- SetLdsUpdate("fake_plugin2", "", "fake_plugin2", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); }, {}, {},
- true /* test_expects_failure */);
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin2", "good", "fake_plugin2", "good", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_2_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithRootCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"bad", {bad_root_cert_, bad_identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin1", "bad", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithIdentityCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"good", {root_cert_, identity_pair_2_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "good", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_2_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsWithBothCertificateNamesUpdated) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"good", {root_cert_, identity_pair_2_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("fake_plugin1", "good", "fake_plugin1", "good", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_2_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsNotRequiringButProvidingClientCerts) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsNotRequiringAndNotProvidingClientCerts) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestTls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestTlsWithIdentityPluginUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- FakeCertificateProvider::CertDataMap fake2_cert_map = {
- {"", {root_cert_, identity_pair_2_}}};
- g_fake2_cert_data_map = &fake2_cert_map;
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
- SetLdsUpdate("", "", "fake_plugin2", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_2_, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestTlsWithIdentityCertificateNameUpdate) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}},
- {"good", {root_cert_, identity_pair_2_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
- SetLdsUpdate("", "", "fake_plugin1", "good", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_2_, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestFallback) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "", "", false);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsToTls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateTlsChannel(); }, {}, {},
- true /* test_expects_failure */);
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestTlsToMtls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateTlsChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerSecurityTest, TestMtlsToFallback) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
- SetLdsUpdate("", "", "", "", false);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestFallbackToMtls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "", "", false);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- SetLdsUpdate("fake_plugin1", "", "fake_plugin1", "", true);
- SendRpc([this]() { return CreateMtlsChannel(); },
- server_authenticated_identity_, client_authenticated_identity_);
-}
-
-TEST_P(XdsServerSecurityTest, TestTlsToFallback) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
- SetLdsUpdate("", "", "", "", false);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerSecurityTest, TestFallbackToTls) {
- FakeCertificateProvider::CertDataMap fake1_cert_map = {
- {"", {root_cert_, identity_pair_}}};
- g_fake1_cert_data_map = &fake1_cert_map;
- SetLdsUpdate("", "", "", "", false);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- SetLdsUpdate("", "", "fake_plugin1", "", false);
- SendRpc([this]() { return CreateTlsChannel(); },
- server_authenticated_identity_, {});
-}
-
-class XdsEnabledServerStatusNotificationTest : public XdsServerSecurityTest {
- protected:
- void SetValidLdsUpdate() { SetLdsUpdate("", "", "", "", false); }
-
- void SetInvalidLdsUpdate() {
- Listener listener;
- listener.set_name(y_absl::StrCat(
- "grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- }
-
- void UnsetLdsUpdate() {
- balancers_[0]->ads_service()->UnsetResource(
- kLdsTypeUrl, y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:",
- backends_[0]->port()));
- }
-};
-
-TEST_P(XdsEnabledServerStatusNotificationTest, ServingStatus) {
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsEnabledServerStatusNotificationTest, NotServingStatus) {
- SetInvalidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::UNAVAILABLE);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsEnabledServerStatusNotificationTest, ErrorUpdateWhenAlreadyServing) {
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- // Invalid update does not lead to a change in the serving status.
- SetInvalidLdsUpdate();
- do {
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsEnabledServerStatusNotificationTest,
- NotServingStatusToServingStatusTransition) {
- SetInvalidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::UNAVAILABLE);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
- // Send a valid LDS update to change to serving status
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-// This test verifies that the resource getting deleted when already serving
-// results in future connections being dropped.
-TEST_P(XdsEnabledServerStatusNotificationTest,
- ServingStatusToNonServingStatusTransition) {
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- // Deleting the resource should result in a non-serving status.
- UnsetLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::NOT_FOUND);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsEnabledServerStatusNotificationTest, RepeatedServingStatusChanges) {
- for (int i = 0; i < 5; i++) {
- // Send a valid LDS update to get the server to start listening
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:",
- backends_[0]->port()),
- grpc::StatusCode::OK);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
- // Deleting the resource will make the server start rejecting connections
- UnsetLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:",
- backends_[0]->port()),
- grpc::StatusCode::NOT_FOUND);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
- }
-}
-
-TEST_P(XdsEnabledServerStatusNotificationTest, ExistingRpcsOnResourceDeletion) {
- // Send a valid LDS update to get the server to start listening
- SetValidLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::OK);
- constexpr int kNumChannels = 10;
- struct StreamingRpc {
- std::shared_ptr<Channel> channel;
- std::unique_ptr<grpc::testing::EchoTestService::Stub> stub;
- ClientContext context;
- std::unique_ptr<ClientWriter<EchoRequest>> writer;
- } streaming_rpcs[kNumChannels];
- EchoRequest request;
- EchoResponse response;
- request.set_message("Hello");
- for (int i = 0; i < kNumChannels; i++) {
- streaming_rpcs[i].channel = CreateInsecureChannel();
- streaming_rpcs[i].stub =
- grpc::testing::EchoTestService::NewStub(streaming_rpcs[i].channel);
- streaming_rpcs[i].context.set_wait_for_ready(true);
- streaming_rpcs[i].writer = streaming_rpcs[i].stub->RequestStream(
- &streaming_rpcs[i].context, &response);
- EXPECT_TRUE(streaming_rpcs[i].writer->Write(request));
- }
- // Deleting the resource will make the server start rejecting connections
- UnsetLdsUpdate();
- backends_[0]->notifier()->WaitOnServingStatusChange(
- y_absl::StrCat(ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()),
- grpc::StatusCode::NOT_FOUND);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
- for (int i = 0; i < kNumChannels; i++) {
- EXPECT_TRUE(streaming_rpcs[i].writer->Write(request));
- EXPECT_TRUE(streaming_rpcs[i].writer->WritesDone());
- EXPECT_TRUE(streaming_rpcs[i].writer->Finish().ok());
- // New RPCs on the existing channels should fail.
- ClientContext new_context;
- new_context.set_deadline(grpc_timeout_milliseconds_to_deadline(1000));
- EXPECT_FALSE(
- streaming_rpcs[i].stub->Echo(&new_context, request, &response).ok());
- }
-}
-
-using XdsServerFilterChainMatchTest = XdsServerSecurityTest;
-
-TEST_P(XdsServerFilterChainMatchTest,
- DefaultFilterChainUsedWhenNoFilterChainMentioned) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- listener.mutable_default_filter_chain()
- ->add_filters()
- ->mutable_typed_config()
- ->PackFrom(HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- DefaultFilterChainUsedWhenOtherFilterChainsDontMatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add a filter chain that will never get matched
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()
- ->mutable_destination_port()
- ->set_value(8080);
- // Add default filter chain that should get used
- listener.mutable_default_filter_chain()
- ->add_filters()
- ->mutable_typed_config()
- ->PackFrom(HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithDestinationPortDontMatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with destination port that should never get matched
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()
- ->mutable_destination_port()
- ->set_value(8080);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // RPC should fail since no matching filter chain was found and no default
- // filter chain is configured.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerFilterChainMatchTest, FilterChainsWithServerNamesDontMatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with server name that should never get matched
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_server_names("server_name");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // RPC should fail since no matching filter chain was found and no default
- // filter chain is configured.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithTransportProtocolsOtherThanRawBufferDontMatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with transport protocol "tls" that should never match
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_transport_protocol("tls");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // RPC should fail since no matching filter chain was found and no default
- // filter chain is configured.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithApplicationProtocolsDontMatch) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with application protocol that should never get matched
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_application_protocols("h2");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // RPC should fail since no matching filter chain was found and no default
- // filter chain is configured.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {},
- true /* test_expects_failure */);
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithTransportProtocolRawBufferIsPreferred) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with "raw_buffer" transport protocol
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_transport_protocol(
- "raw_buffer");
- // Add another filter chain with no transport protocol set but application
- // protocol set (fails match)
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_application_protocols("h2");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // A successful RPC proves that filter chains that mention "raw_buffer" as the
- // transport protocol are chosen as the best match in the round.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithMoreSpecificDestinationPrefixRangesArePreferred) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with prefix range (length 4 and 16) but with server name
- // mentioned. (Prefix range is matched first.)
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(4);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(16);
- filter_chain->mutable_filter_chain_match()->add_server_names("server_name");
- // Add filter chain with two prefix ranges (length 8 and 24). Since 24 is the
- // highest match, it should be chosen.
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(8);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(24);
- // Add another filter chain with a non-matching prefix range (with length 30)
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix("192.168.1.1");
- prefix_range->mutable_prefix_len()->set_value(30);
- filter_chain->mutable_filter_chain_match()->add_server_names("server_name");
- // Add another filter chain with no prefix range mentioned
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_server_names("server_name");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // A successful RPC proves that the filter chain with the longest matching
- // prefix range was the best match.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsThatMentionSourceTypeArePreferred) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with the local source type (best match)
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::SAME_IP_OR_LOOPBACK);
- // Add filter chain with the external source type but bad source port.
- // Note that backends_[0]->port() will never be a match for the source port
- // because it is already being used by a backend.
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::EXTERNAL);
- filter_chain->mutable_filter_chain_match()->add_source_ports(
- backends_[0]->port());
- // Add filter chain with the default source type (ANY) but bad source port.
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_source_ports(
- backends_[0]->port());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // A successful RPC proves that the filter chain with the longest matching
- // prefix range was the best match.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithMoreSpecificSourcePrefixRangesArePreferred) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with source prefix range (length 16) but with a bad source
- // port mentioned. (Prefix range is matched first.)
- // Note that backends_[0]->port() will never be a match for the source port
- // because it is already being used by a backend.
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* source_prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- source_prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- source_prefix_range->mutable_prefix_len()->set_value(4);
- source_prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- source_prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- source_prefix_range->mutable_prefix_len()->set_value(16);
- filter_chain->mutable_filter_chain_match()->add_source_ports(
- backends_[0]->port());
- // Add filter chain with two source prefix ranges (length 8 and 24). Since 24
- // is the highest match, it should be chosen.
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- source_prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- source_prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- source_prefix_range->mutable_prefix_len()->set_value(8);
- source_prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- source_prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- source_prefix_range->mutable_prefix_len()->set_value(24);
- // Add another filter chain with a non-matching source prefix range (with
- // length 30) and bad source port
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- source_prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- source_prefix_range->set_address_prefix("192.168.1.1");
- source_prefix_range->mutable_prefix_len()->set_value(30);
- filter_chain->mutable_filter_chain_match()->add_source_ports(
- backends_[0]->port());
- // Add another filter chain with no source prefix range mentioned and bad
- // source port
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_source_ports(
- backends_[0]->port());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // A successful RPC proves that the filter chain with the longest matching
- // source prefix range was the best match.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- FilterChainsWithMoreSpecificSourcePortArePreferred) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- // Since we don't know which port will be used by the channel, just add all
- // ports except for 0.
- for (int i = 1; i < 65536; i++) {
- filter_chain->mutable_filter_chain_match()->add_source_ports(i);
- }
- // Add another filter chain with no source prefix range mentioned with a bad
- // DownstreamTlsContext configuration.
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* transport_socket = filter_chain->mutable_transport_socket();
- transport_socket->set_name("envoy.transport_sockets.tls");
- DownstreamTlsContext downstream_tls_context;
- downstream_tls_context.mutable_common_tls_context()
- ->mutable_tls_certificate_certificate_provider_instance()
- ->set_instance_name("unknown");
- transport_socket->mutable_typed_config()->PackFrom(downstream_tls_context);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // A successful RPC proves that the filter chain with matching source port
- // was chosen.
- SendRpc([this]() { return CreateInsecureChannel(); }, {}, {});
-}
-
-TEST_P(XdsServerFilterChainMatchTest, DuplicateMatchNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- // Add a duplicate filter chain
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "Duplicate matching rules detected when adding filter chain: {}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest, DuplicateMatchOnPrefixRangesNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with prefix range
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(16);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(24);
- // Add a filter chain with a duplicate prefix range entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(16);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(32);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "Duplicate matching rules detected when adding filter chain: "
- "{prefix_ranges={{address_prefix=127.0.0.0:0, prefix_len=16}, "
- "{address_prefix=127.0.0.1:0, prefix_len=32}}}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest, DuplicateMatchOnTransportProtocolNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with "raw_buffer" transport protocol
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_transport_protocol(
- "raw_buffer");
- // Add a duplicate filter chain with the same "raw_buffer" transport protocol
- // entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_transport_protocol(
- "raw_buffer");
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Duplicate matching rules detected when adding "
- "filter chain: {transport_protocol=raw_buffer}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest, DuplicateMatchOnLocalSourceTypeNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with the local source type
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::SAME_IP_OR_LOOPBACK);
- // Add a duplicate filter chain with the same local source type entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::SAME_IP_OR_LOOPBACK);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Duplicate matching rules detected when adding "
- "filter chain: {source_type=SAME_IP_OR_LOOPBACK}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- DuplicateMatchOnExternalSourceTypeNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with the external source type
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::EXTERNAL);
- // Add a duplicate filter chain with the same external source type entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->set_source_type(
- FilterChainMatch::EXTERNAL);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Duplicate matching rules detected when adding "
- "filter chain: {source_type=EXTERNAL}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest,
- DuplicateMatchOnSourcePrefixRangesNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with source prefix range
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- auto* prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(16);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(24);
- // Add a filter chain with a duplicate source prefix range entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(16);
- prefix_range =
- filter_chain->mutable_filter_chain_match()->add_source_prefix_ranges();
- prefix_range->set_address_prefix(ipv6_only_ ? "[::1]" : "127.0.0.1");
- prefix_range->mutable_prefix_len()->set_value(32);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr(
- "Duplicate matching rules detected when adding filter chain: "
- "{source_prefix_ranges={{address_prefix=127.0.0.0:0, prefix_len=16}, "
- "{address_prefix=127.0.0.1:0, prefix_len=32}}}"));
-}
-
-TEST_P(XdsServerFilterChainMatchTest, DuplicateMatchOnSourcePortNacked) {
- Listener listener;
- listener.set_name(
- y_absl::StrCat("grpc/server?xds.resource.listening_address=",
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", backends_[0]->port()));
- auto* socket_address = listener.mutable_address()->mutable_socket_address();
- socket_address->set_address(ipv6_only_ ? "::1" : "127.0.0.1");
- socket_address->set_port_value(backends_[0]->port());
- // Add filter chain with the external source type
- auto* filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_source_ports(8080);
- // Add a duplicate filter chain with the same source port entry
- filter_chain = listener.add_filter_chains();
- filter_chain->add_filters()->mutable_typed_config()->PackFrom(
- HttpConnectionManager());
- filter_chain->mutable_filter_chain_match()->add_source_ports(8080);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- do {
- CheckRpcSendFailure();
- } while (balancers_[0]->ads_service()->lds_response_state().state ==
- AdsServiceImpl::ResponseState::SENT);
- const auto response_state =
- balancers_[0]->ads_service()->lds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(
- response_state.error_message,
- ::testing::HasSubstr("Duplicate matching rules detected when adding "
- "filter chain: {source_ports={8080}}"));
-}
-
-using EdsTest = BasicTest;
-
-// Tests that EDS client should send a NACK if the EDS update contains
-// sparse priorities.
-TEST_P(EdsTest, NacksSparsePriorityList) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(), kDefaultLocalityWeight, 1},
- });
- balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
- CheckRpcSendFailure();
- const auto response_state =
- balancers_[0]->ads_service()->eds_response_state();
- EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
- EXPECT_THAT(response_state.error_message,
- ::testing::HasSubstr("sparse priority list"));
-}
-
-// In most of our tests, we use different names for different resource
-// types, to make sure that there are no cut-and-paste errors in the code
-// that cause us to look at data for the wrong resource type. So we add
-// this test to make sure that the EDS resource name defaults to the
-// cluster name if not specified in the CDS resource.
-TEST_P(EdsTest, EdsServiceNameDefaultsToClusterName) {
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, kDefaultClusterName));
- Cluster cluster = default_cluster_;
- cluster.mutable_eds_cluster_config()->clear_service_name();
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendOk();
-}
-
-class TimeoutTest : public BasicTest {
- protected:
- void SetUp() override {
- xds_resource_does_not_exist_timeout_ms_ = 500;
- BasicTest::SetUp();
- }
-};
-
-// Tests that LDS client times out when no response received.
-TEST_P(TimeoutTest, Lds) {
- balancers_[0]->ads_service()->SetResourceIgnore(kLdsTypeUrl);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
-}
-
-TEST_P(TimeoutTest, Rds) {
- balancers_[0]->ads_service()->SetResourceIgnore(kRdsTypeUrl);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
-}
-
-// Tests that CDS client times out when no response received.
-TEST_P(TimeoutTest, Cds) {
- balancers_[0]->ads_service()->SetResourceIgnore(kCdsTypeUrl);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
-}
-
-TEST_P(TimeoutTest, Eds) {
- balancers_[0]->ads_service()->SetResourceIgnore(kEdsTypeUrl);
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendFailure();
-}
-
-using LocalityMapTest = BasicTest;
-
-// Tests that the localities in a locality map are picked according to their
-// weights.
-TEST_P(LocalityMapTest, WeightedRoundRobin) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 5000;
- const int kLocalityWeight0 = 2;
- const int kLocalityWeight1 = 8;
- const int kTotalLocalityWeight = kLocalityWeight0 + kLocalityWeight1;
- const double kLocalityWeightRate0 =
- static_cast<double>(kLocalityWeight0) / kTotalLocalityWeight;
- const double kLocalityWeightRate1 =
- static_cast<double>(kLocalityWeight1) / kTotalLocalityWeight;
- // ADS response contains 2 localities, each of which contains 1 backend.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kLocalityWeight0},
- {"locality1", GetBackendPorts(1, 2), kLocalityWeight1},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for both backends to be ready.
- WaitForAllBackends(0, 2);
- // Send kNumRpcs RPCs.
- CheckRpcSendOk(kNumRpcs);
- // The locality picking rates should be roughly equal to the expectation.
- const double locality_picked_rate_0 =
- static_cast<double>(backends_[0]->backend_service()->request_count()) /
- kNumRpcs;
- const double locality_picked_rate_1 =
- static_cast<double>(backends_[1]->backend_service()->request_count()) /
- kNumRpcs;
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(locality_picked_rate_0,
- ::testing::AllOf(
- ::testing::Ge(kLocalityWeightRate0 * (1 - kErrorTolerance)),
- ::testing::Le(kLocalityWeightRate0 * (1 + kErrorTolerance))));
- EXPECT_THAT(locality_picked_rate_1,
- ::testing::AllOf(
- ::testing::Ge(kLocalityWeightRate1 * (1 - kErrorTolerance)),
- ::testing::Le(kLocalityWeightRate1 * (1 + kErrorTolerance))));
-}
-
-// Tests that we correctly handle a locality containing no endpoints.
-TEST_P(LocalityMapTest, LocalityContainingNoEndpoints) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 5000;
- // EDS response contains 2 localities, one with no endpoints.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- {"locality1", {}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for both backends to be ready.
- WaitForAllBackends();
- // Send kNumRpcs RPCs.
- CheckRpcSendOk(kNumRpcs);
- // All traffic should go to the reachable locality.
- EXPECT_EQ(backends_[0]->backend_service()->request_count(),
- kNumRpcs / backends_.size());
- EXPECT_EQ(backends_[1]->backend_service()->request_count(),
- kNumRpcs / backends_.size());
- EXPECT_EQ(backends_[2]->backend_service()->request_count(),
- kNumRpcs / backends_.size());
- EXPECT_EQ(backends_[3]->backend_service()->request_count(),
- kNumRpcs / backends_.size());
-}
-
-// EDS update with no localities.
-TEST_P(LocalityMapTest, NoLocalities) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource({}, DefaultEdsServiceName()));
- Status status = SendRpc();
- EXPECT_FALSE(status.ok());
- EXPECT_EQ(status.error_code(), StatusCode::UNAVAILABLE);
-}
-
-// Tests that the locality map can work properly even when it contains a large
-// number of localities.
-TEST_P(LocalityMapTest, StressTest) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumLocalities = 100;
- // The first ADS response contains kNumLocalities localities, each of which
- // contains backend 0.
- AdsServiceImpl::EdsResourceArgs args;
- for (size_t i = 0; i < kNumLocalities; ++i) {
- TString name = y_absl::StrCat("locality", i);
- AdsServiceImpl::EdsResourceArgs::Locality locality(name,
- {backends_[0]->port()});
- args.locality_list.emplace_back(std::move(locality));
- }
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // The second ADS response contains 1 locality, which contains backend 1.
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts(1, 2)},
- });
- std::thread delayed_resource_setter(
- std::bind(&BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), 60 * 1000));
- // Wait until backend 0 is ready, before which kNumLocalities localities are
- // received and handled by the xds policy.
- WaitForBackend(0, /*reset_counters=*/false);
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- // Wait until backend 1 is ready, before which kNumLocalities localities are
- // removed by the xds policy.
- WaitForBackend(1);
- delayed_resource_setter.join();
-}
-
-// Tests that the localities in a locality map are picked correctly after update
-// (addition, modification, deletion).
-TEST_P(LocalityMapTest, UpdateMap) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 3000;
- // The locality weight for the first 3 localities.
- const std::vector<int> kLocalityWeights0 = {2, 3, 4};
- const double kTotalLocalityWeight0 =
- std::accumulate(kLocalityWeights0.begin(), kLocalityWeights0.end(), 0);
- std::vector<double> locality_weight_rate_0;
- locality_weight_rate_0.reserve(kLocalityWeights0.size());
- for (int weight : kLocalityWeights0) {
- locality_weight_rate_0.push_back(weight / kTotalLocalityWeight0);
- }
- // Delete the first locality, keep the second locality, change the third
- // locality's weight from 4 to 2, and add a new locality with weight 6.
- const std::vector<int> kLocalityWeights1 = {3, 2, 6};
- const double kTotalLocalityWeight1 =
- std::accumulate(kLocalityWeights1.begin(), kLocalityWeights1.end(), 0);
- std::vector<double> locality_weight_rate_1 = {
- 0 /* placeholder for locality 0 */};
- for (int weight : kLocalityWeights1) {
- locality_weight_rate_1.push_back(weight / kTotalLocalityWeight1);
- }
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), 2},
- {"locality1", GetBackendPorts(1, 2), 3},
- {"locality2", GetBackendPorts(2, 3), 4},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for the first 3 backends to be ready.
- WaitForAllBackends(0, 3);
- gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");
- // Send kNumRpcs RPCs.
- CheckRpcSendOk(kNumRpcs);
- gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
- // The picking rates of the first 3 backends should be roughly equal to the
- // expectation.
- std::vector<double> locality_picked_rates;
- for (size_t i = 0; i < 3; ++i) {
- locality_picked_rates.push_back(
- static_cast<double>(backends_[i]->backend_service()->request_count()) /
- kNumRpcs);
- }
- const double kErrorTolerance = 0.2;
- for (size_t i = 0; i < 3; ++i) {
- gpr_log(GPR_INFO, "Locality %" PRIuPTR " rate %f", i,
- locality_picked_rates[i]);
- EXPECT_THAT(
- locality_picked_rates[i],
- ::testing::AllOf(
- ::testing::Ge(locality_weight_rate_0[i] * (1 - kErrorTolerance)),
- ::testing::Le(locality_weight_rate_0[i] * (1 + kErrorTolerance))));
- }
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality1", GetBackendPorts(1, 2), 3},
- {"locality2", GetBackendPorts(2, 3), 2},
- {"locality3", GetBackendPorts(3, 4), 6},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Backend 3 hasn't received any request.
- EXPECT_EQ(0U, backends_[3]->backend_service()->request_count());
- // Wait until the locality update has been processed, as signaled by backend 3
- // receiving a request.
- WaitForAllBackends(3, 4);
- gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH ==========");
- // Send kNumRpcs RPCs.
- CheckRpcSendOk(kNumRpcs);
- gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH ==========");
- // Backend 0 no longer receives any request.
- EXPECT_EQ(0U, backends_[0]->backend_service()->request_count());
- // The picking rates of the last 3 backends should be roughly equal to the
- // expectation.
- locality_picked_rates = {0 /* placeholder for backend 0 */};
- for (size_t i = 1; i < 4; ++i) {
- locality_picked_rates.push_back(
- static_cast<double>(backends_[i]->backend_service()->request_count()) /
- kNumRpcs);
- }
- for (size_t i = 1; i < 4; ++i) {
- gpr_log(GPR_INFO, "Locality %" PRIuPTR " rate %f", i,
- locality_picked_rates[i]);
- EXPECT_THAT(
- locality_picked_rates[i],
- ::testing::AllOf(
- ::testing::Ge(locality_weight_rate_1[i] * (1 - kErrorTolerance)),
- ::testing::Le(locality_weight_rate_1[i] * (1 + kErrorTolerance))));
- }
-}
-
-// Tests that we don't fail RPCs when replacing all of the localities in
-// a given priority.
-TEST_P(LocalityMapTest, ReplaceAllLocalitiesInPriority) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality1", GetBackendPorts(1, 2)},
- });
- std::thread delayed_resource_setter(
- std::bind(&BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), 5000));
- // Wait for the first backend to be ready.
- WaitForBackend(0);
- // Keep sending RPCs until we switch over to backend 1, which tells us
- // that we received the update. No RPCs should fail during this
- // transition.
- WaitForBackend(1, /*reset_counters=*/true, /*require_success=*/true);
- delayed_resource_setter.join();
-}
-
-class FailoverTest : public BasicTest {
- public:
- void SetUp() override {
- BasicTest::SetUp();
- ResetStub(500);
- }
-};
-
-// Localities with the highest priority are used when multiple priority exist.
-TEST_P(FailoverTest, ChooseHighestPriority) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 2},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 3},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 0},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForBackend(3, false);
- for (size_t i = 0; i < 3; ++i) {
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
-}
-
-// Does not choose priority with no endpoints.
-TEST_P(FailoverTest, DoesNotUsePriorityWithNoEndpoints) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 2},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 3},
- {"locality3", {}, kDefaultLocalityWeight, 0},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForBackend(0, false);
- for (size_t i = 1; i < 3; ++i) {
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
-}
-
-// Does not choose locality with no endpoints.
-TEST_P(FailoverTest, DoesNotUseLocalityWithNoEndpoints) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {}, kDefaultLocalityWeight, 0},
- {"locality1", GetBackendPorts(), kDefaultLocalityWeight, 0},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for all backends to be used.
- std::tuple<int, int, int> counts = WaitForAllBackends();
- // Make sure no RPCs failed in the transition.
- EXPECT_EQ(0, std::get<1>(counts));
-}
-
-// If the higher priority localities are not reachable, failover to the highest
-// priority among the rest.
-TEST_P(FailoverTest, Failover) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 2},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 3},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 0},
- });
- ShutdownBackend(3);
- ShutdownBackend(0);
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForBackend(1, false);
- for (size_t i = 0; i < 4; ++i) {
- if (i == 1) continue;
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
-}
-
-// If a locality with higher priority than the current one becomes ready,
-// switch to it.
-TEST_P(FailoverTest, SwitchBackToHigherPriority) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 100;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 2},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 3},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 0},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForBackend(3);
- ShutdownBackend(3);
- ShutdownBackend(0);
- WaitForBackend(1, false);
- for (size_t i = 0; i < 4; ++i) {
- if (i == 1) continue;
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
- StartBackend(0);
- WaitForBackend(0);
- CheckRpcSendOk(kNumRpcs);
- EXPECT_EQ(kNumRpcs, backends_[0]->backend_service()->request_count());
-}
-
-// The first update only contains unavailable priorities. The second update
-// contains available priorities.
-TEST_P(FailoverTest, UpdateInitialUnavailable) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 0},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 1},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 0},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 1},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 2},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 3},
- });
- ShutdownBackend(0);
- ShutdownBackend(1);
- std::thread delayed_resource_setter(
- std::bind(&BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), 1000));
- gpr_timespec deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_millis(500, GPR_TIMESPAN));
- // Send 0.5 second worth of RPCs.
- do {
- CheckRpcSendFailure();
- } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0);
- WaitForBackend(2, false);
- for (size_t i = 0; i < 4; ++i) {
- if (i == 2) continue;
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
- delayed_resource_setter.join();
-}
-
-// Tests that after the localities' priorities are updated, we still choose the
-// highest READY priority with the updated localities.
-TEST_P(FailoverTest, UpdatePriority) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 100;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 1},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 2},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 3},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 0},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 2},
- {"locality1", GetBackendPorts(1, 2), kDefaultLocalityWeight, 0},
- {"locality2", GetBackendPorts(2, 3), kDefaultLocalityWeight, 1},
- {"locality3", GetBackendPorts(3, 4), kDefaultLocalityWeight, 3},
- });
- std::thread delayed_resource_setter(
- std::bind(&BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), 1000));
- WaitForBackend(3, false);
- for (size_t i = 0; i < 3; ++i) {
- EXPECT_EQ(0U, backends_[i]->backend_service()->request_count());
- }
- WaitForBackend(1);
- CheckRpcSendOk(kNumRpcs);
- EXPECT_EQ(kNumRpcs, backends_[1]->backend_service()->request_count());
- delayed_resource_setter.join();
-}
-
-// Moves all localities in the current priority to a higher priority.
-TEST_P(FailoverTest, MoveAllLocalitiesInCurrentPriorityToHigherPriority) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // First update:
- // - Priority 0 is locality 0, containing backend 0, which is down.
- // - Priority 1 is locality 1, containing backends 1 and 2, which are up.
- ShutdownBackend(0);
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 0},
- {"locality1", GetBackendPorts(1, 3), kDefaultLocalityWeight, 1},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Second update:
- // - Priority 0 contains both localities 0 and 1.
- // - Priority 1 is not present.
- // - We add backend 3 to locality 1, just so we have a way to know
- // when the update has been seen by the client.
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts(0, 1), kDefaultLocalityWeight, 0},
- {"locality1", GetBackendPorts(1, 4), kDefaultLocalityWeight, 0},
- });
- std::thread delayed_resource_setter(
- std::bind(&BasicTest::SetEdsResourceWithDelay, this, 0,
- BuildEdsResource(args, DefaultEdsServiceName()), 1000));
- // When we get the first update, all backends in priority 0 are down,
- // so we will create priority 1. Backends 1 and 2 should have traffic,
- // but backend 3 should not.
- WaitForAllBackends(1, 3, false);
- EXPECT_EQ(0UL, backends_[3]->backend_service()->request_count());
- // When backend 3 gets traffic, we know the second update has been seen.
- WaitForBackend(3);
- // The ADS service of balancer 0 got at least 1 response.
- EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- delayed_resource_setter.join();
-}
-
-using DropTest = BasicTest;
-
-// Tests that RPCs are dropped according to the drop config.
-TEST_P(DropTest, Vanilla) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 5000;
- const uint32_t kDropPerMillionForLb = 100000;
- const uint32_t kDropPerMillionForThrottle = 200000;
- const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
- const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
- const double KDropRateForLbAndThrottle =
- kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle;
- // The ADS response contains two drop categories.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- args.drop_categories = {{kLbDropType, kDropPerMillionForLb},
- {kThrottleDropType, kDropPerMillionForThrottle}};
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
- // Send kNumRpcs RPCs and count the drops.
- size_t num_drops = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- // The drop rate should be roughly equal to the expectation.
- const double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(
- ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)),
- ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance))));
-}
-
-// Tests that drop config is converted correctly from per hundred.
-TEST_P(DropTest, DropPerHundred) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 5000;
- const uint32_t kDropPerHundredForLb = 10;
- const double kDropRateForLb = kDropPerHundredForLb / 100.0;
- // The ADS response contains one drop category.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- args.drop_categories = {{kLbDropType, kDropPerHundredForLb}};
- args.drop_denominator = FractionalPercent::HUNDRED;
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
- // Send kNumRpcs RPCs and count the drops.
- size_t num_drops = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- // The drop rate should be roughly equal to the expectation.
- const double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)),
- ::testing::Le(kDropRateForLb * (1 + kErrorTolerance))));
-}
-
-// Tests that drop config is converted correctly from per ten thousand.
-TEST_P(DropTest, DropPerTenThousand) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 5000;
- const uint32_t kDropPerTenThousandForLb = 1000;
- const double kDropRateForLb = kDropPerTenThousandForLb / 10000.0;
- // The ADS response contains one drop category.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- args.drop_categories = {{kLbDropType, kDropPerTenThousandForLb}};
- args.drop_denominator = FractionalPercent::TEN_THOUSAND;
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
- // Send kNumRpcs RPCs and count the drops.
- size_t num_drops = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- // The drop rate should be roughly equal to the expectation.
- const double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)),
- ::testing::Le(kDropRateForLb * (1 + kErrorTolerance))));
-}
-
-// Tests that drop is working correctly after update.
-TEST_P(DropTest, Update) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 3000;
- const uint32_t kDropPerMillionForLb = 100000;
- const uint32_t kDropPerMillionForThrottle = 200000;
- const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
- const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
- const double KDropRateForLbAndThrottle =
- kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle;
- // The first ADS response contains one drop category.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- args.drop_categories = {{kLbDropType, kDropPerMillionForLb}};
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
- // Send kNumRpcs RPCs and count the drops.
- size_t num_drops = 0;
- gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
- // The drop rate should be roughly equal to the expectation.
- double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- gpr_log(GPR_INFO, "First batch drop rate %f", seen_drop_rate);
- const double kErrorTolerance = 0.3;
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)),
- ::testing::Le(kDropRateForLb * (1 + kErrorTolerance))));
- // The second ADS response contains two drop categories, send an update EDS
- // response.
- args.drop_categories = {{kLbDropType, kDropPerMillionForLb},
- {kThrottleDropType, kDropPerMillionForThrottle}};
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until the drop rate increases to the middle of the two configs, which
- // implies that the update has been in effect.
- const double kDropRateThreshold =
- (kDropRateForLb + KDropRateForLbAndThrottle) / 2;
- size_t num_rpcs = kNumRpcs;
- while (seen_drop_rate < kDropRateThreshold) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- ++num_rpcs;
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- seen_drop_rate = static_cast<double>(num_drops) / num_rpcs;
- }
- // Send kNumRpcs RPCs and count the drops.
- num_drops = 0;
- gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH ==========");
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH ==========");
- // The new drop rate should be roughly equal to the expectation.
- seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- gpr_log(GPR_INFO, "Second batch drop rate %f", seen_drop_rate);
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(
- ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)),
- ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance))));
-}
-
-// Tests that all the RPCs are dropped if any drop category drops 100%.
-TEST_P(DropTest, DropAll) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 1000;
- const uint32_t kDropPerMillionForLb = 100000;
- const uint32_t kDropPerMillionForThrottle = 1000000;
- // The ADS response contains two drop categories.
- AdsServiceImpl::EdsResourceArgs args;
- args.drop_categories = {{kLbDropType, kDropPerMillionForLb},
- {kThrottleDropType, kDropPerMillionForThrottle}};
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Send kNumRpcs RPCs and all of them are dropped.
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- EXPECT_EQ(status.error_code(), StatusCode::UNAVAILABLE);
- EXPECT_EQ(status.error_message(), "Call dropped by load balancing policy");
- }
-}
-
-class BalancerUpdateTest : public XdsEnd2endTest {
- public:
- BalancerUpdateTest() : XdsEnd2endTest(4, 3) {}
-};
-
-// Tests that the old LB call is still used after the balancer address update as
-// long as that call is still alive.
-TEST_P(BalancerUpdateTest, UpdateBalancersButKeepUsingOriginalBalancer) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", {backends_[1]->port()}},
- });
- balancers_[1]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until the first backend is ready.
- WaitForBackend(0);
- // Send 10 requests.
- gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");
- CheckRpcSendOk(10);
- gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
- // All 10 requests should have gone to the first backend.
- EXPECT_EQ(10U, backends_[0]->backend_service()->request_count());
- // The ADS service of balancer 0 sent at least 1 response.
- EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[1]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
- gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 ==========");
- SetNextResolutionForLbChannel({balancers_[1]->port()});
- gpr_log(GPR_INFO, "========= UPDATE 1 DONE ==========");
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- gpr_timespec deadline = gpr_time_add(
- gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(10000, GPR_TIMESPAN));
- // Send 10 seconds worth of RPCs
- do {
- CheckRpcSendOk();
- } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0);
- // The current LB call is still working, so xds continued using it to the
- // first balancer, which doesn't assign the second backend.
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- // The ADS service of balancer 0 sent at least 1 response.
- EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[1]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
-}
-
-// Tests that the old LB call is still used after multiple balancer address
-// updates as long as that call is still alive. Send an update with the same set
-// of LBs as the one in SetUp() in order to verify that the LB channel inside
-// xds keeps the initial connection (which by definition is also present in the
-// update).
-TEST_P(BalancerUpdateTest, Repeated) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", {backends_[1]->port()}},
- });
- balancers_[1]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until the first backend is ready.
- WaitForBackend(0);
- // Send 10 requests.
- gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");
- CheckRpcSendOk(10);
- gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
- // All 10 requests should have gone to the first backend.
- EXPECT_EQ(10U, backends_[0]->backend_service()->request_count());
- // The ADS service of balancer 0 sent at least 1 response.
- EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[1]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
- std::vector<int> ports;
- ports.emplace_back(balancers_[0]->port());
- ports.emplace_back(balancers_[1]->port());
- ports.emplace_back(balancers_[2]->port());
- gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 ==========");
- SetNextResolutionForLbChannel(ports);
- gpr_log(GPR_INFO, "========= UPDATE 1 DONE ==========");
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- gpr_timespec deadline = gpr_time_add(
- gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(10000, GPR_TIMESPAN));
- // Send 10 seconds worth of RPCs
- do {
- CheckRpcSendOk();
- } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0);
- // xds continued using the original LB call to the first balancer, which
- // doesn't assign the second backend.
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- ports.clear();
- ports.emplace_back(balancers_[0]->port());
- ports.emplace_back(balancers_[1]->port());
- gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 2 ==========");
- SetNextResolutionForLbChannel(ports);
- gpr_log(GPR_INFO, "========= UPDATE 2 DONE ==========");
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- deadline = gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
- gpr_time_from_millis(10000, GPR_TIMESPAN));
- // Send 10 seconds worth of RPCs
- do {
- CheckRpcSendOk();
- } while (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), deadline) < 0);
- // xds continued using the original LB call to the first balancer, which
- // doesn't assign the second backend.
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
-}
-
-// Tests that if the balancer is down, the RPCs will still be sent to the
-// backends according to the last balancer response, until a new balancer is
-// reachable.
-TEST_P(BalancerUpdateTest, DeadUpdate) {
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()});
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", {backends_[1]->port()}},
- });
- balancers_[1]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Start servers and send 10 RPCs per server.
- gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");
- CheckRpcSendOk(10);
- gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
- // All 10 requests should have gone to the first backend.
- EXPECT_EQ(10U, backends_[0]->backend_service()->request_count());
- // The ADS service of balancer 0 sent at least 1 response.
- EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[1]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
- // Kill balancer 0
- gpr_log(GPR_INFO, "********** ABOUT TO KILL BALANCER 0 *************");
- balancers_[0]->Shutdown();
- gpr_log(GPR_INFO, "********** KILLED BALANCER 0 *************");
- // This is serviced by the existing child policy.
- gpr_log(GPR_INFO, "========= BEFORE SECOND BATCH ==========");
- CheckRpcSendOk(10);
- gpr_log(GPR_INFO, "========= DONE WITH SECOND BATCH ==========");
- // All 10 requests should again have gone to the first backend.
- EXPECT_EQ(20U, backends_[0]->backend_service()->request_count());
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- // The ADS service of no balancers sent anything
- EXPECT_EQ(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[0]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[1]->ads_service()->eds_response_state().error_message;
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
- gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 ==========");
- SetNextResolutionForLbChannel({balancers_[1]->port()});
- gpr_log(GPR_INFO, "========= UPDATE 1 DONE ==========");
- // Wait until update has been processed, as signaled by the second backend
- // receiving a request. In the meantime, the client continues to be serviced
- // (by the first backend) without interruption.
- EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
- WaitForBackend(1);
- // This is serviced by the updated RR policy
- backends_[1]->backend_service()->ResetCounters();
- gpr_log(GPR_INFO, "========= BEFORE THIRD BATCH ==========");
- CheckRpcSendOk(10);
- gpr_log(GPR_INFO, "========= DONE WITH THIRD BATCH ==========");
- // All 10 requests should have gone to the second backend.
- EXPECT_EQ(10U, backends_[1]->backend_service()->request_count());
- // The ADS service of balancer 1 sent at least 1 response.
- EXPECT_EQ(balancers_[0]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[0]->ads_service()->eds_response_state().error_message;
- EXPECT_GT(balancers_[1]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT);
- EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
- AdsServiceImpl::ResponseState::NOT_SENT)
- << "Error Message:"
- << balancers_[2]->ads_service()->eds_response_state().error_message;
-}
-
-class ClientLoadReportingTest : public XdsEnd2endTest {
- public:
- ClientLoadReportingTest() : XdsEnd2endTest(4, 1, 3) {}
-};
-
-// Tests that the load report received at the balancer is correct.
-TEST_P(ClientLoadReportingTest, Vanilla) {
- if (GetParam().use_fake_resolver()) {
- balancers_[0]->lrs_service()->set_cluster_names({kServerName});
- }
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()});
- const size_t kNumRpcsPerAddress = 10;
- const size_t kNumFailuresPerAddress = 3;
- // TODO(juanlishen): Partition the backends after multiple localities is
- // tested.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until all backends are ready.
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends();
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * num_backends_);
- CheckRpcSendFailure(kNumFailuresPerAddress * num_backends_,
- RpcOptions().set_server_fail(true));
- // Check that each backend got the right number of requests.
- for (size_t i = 0; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress + kNumFailuresPerAddress,
- backends_[i]->backend_service()->request_count());
- }
- // The load report received at the balancer should be correct.
- std::vector<ClientStats> load_report =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- ASSERT_EQ(load_report.size(), 1UL);
- ClientStats& client_stats = load_report.front();
- EXPECT_EQ(kNumRpcsPerAddress * num_backends_ + num_ok,
- client_stats.total_successful_requests());
- EXPECT_EQ(0U, client_stats.total_requests_in_progress());
- EXPECT_EQ((kNumRpcsPerAddress + kNumFailuresPerAddress) * num_backends_ +
- num_ok + num_failure,
- client_stats.total_issued_requests());
- EXPECT_EQ(kNumFailuresPerAddress * num_backends_ + num_failure,
- client_stats.total_error_requests());
- EXPECT_EQ(0U, client_stats.total_dropped_requests());
- // The LRS service got a single request, and sent a single response.
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
-}
-
-// Tests send_all_clusters.
-TEST_P(ClientLoadReportingTest, SendAllClusters) {
- balancers_[0]->lrs_service()->set_send_all_clusters(true);
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()});
- const size_t kNumRpcsPerAddress = 10;
- const size_t kNumFailuresPerAddress = 3;
- // TODO(juanlishen): Partition the backends after multiple localities is
- // tested.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until all backends are ready.
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends();
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * num_backends_);
- CheckRpcSendFailure(kNumFailuresPerAddress * num_backends_,
- RpcOptions().set_server_fail(true));
- // Check that each backend got the right number of requests.
- for (size_t i = 0; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress + kNumFailuresPerAddress,
- backends_[i]->backend_service()->request_count());
- }
- // The load report received at the balancer should be correct.
- std::vector<ClientStats> load_report =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- ASSERT_EQ(load_report.size(), 1UL);
- ClientStats& client_stats = load_report.front();
- EXPECT_EQ(kNumRpcsPerAddress * num_backends_ + num_ok,
- client_stats.total_successful_requests());
- EXPECT_EQ(0U, client_stats.total_requests_in_progress());
- EXPECT_EQ((kNumRpcsPerAddress + kNumFailuresPerAddress) * num_backends_ +
- num_ok + num_failure,
- client_stats.total_issued_requests());
- EXPECT_EQ(kNumFailuresPerAddress * num_backends_ + num_failure,
- client_stats.total_error_requests());
- EXPECT_EQ(0U, client_stats.total_dropped_requests());
- // The LRS service got a single request, and sent a single response.
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
-}
-
-// Tests that we don't include stats for clusters that are not requested
-// by the LRS server.
-TEST_P(ClientLoadReportingTest, HonorsClustersRequestedByLrsServer) {
- balancers_[0]->lrs_service()->set_cluster_names({"bogus"});
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()});
- const size_t kNumRpcsPerAddress = 100;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until all backends are ready.
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends();
- // Send kNumRpcsPerAddress RPCs per server.
- CheckRpcSendOk(kNumRpcsPerAddress * num_backends_);
- // Each backend should have gotten 100 requests.
- for (size_t i = 0; i < backends_.size(); ++i) {
- EXPECT_EQ(kNumRpcsPerAddress,
- backends_[i]->backend_service()->request_count());
- }
- // The LRS service got a single request, and sent a single response.
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
- EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
- // The load report received at the balancer should be correct.
- std::vector<ClientStats> load_report =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- ASSERT_EQ(load_report.size(), 0UL);
-}
-
-// Tests that if the balancer restarts, the client load report contains the
-// stats before and after the restart correctly.
-TEST_P(ClientLoadReportingTest, BalancerRestart) {
- if (GetParam().use_fake_resolver()) {
- balancers_[0]->lrs_service()->set_cluster_names({kServerName});
- }
- SetNextResolution({});
- SetNextResolutionForLbChannel({balancers_[0]->port()});
- const size_t kNumBackendsFirstPass = backends_.size() / 2;
- const size_t kNumBackendsSecondPass =
- backends_.size() - kNumBackendsFirstPass;
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts(0, kNumBackendsFirstPass)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait until all backends returned by the balancer are ready.
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) =
- WaitForAllBackends(/* start_index */ 0,
- /* stop_index */ kNumBackendsFirstPass);
- std::vector<ClientStats> load_report =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- ASSERT_EQ(load_report.size(), 1UL);
- ClientStats client_stats = std::move(load_report.front());
- EXPECT_EQ(static_cast<size_t>(num_ok),
- client_stats.total_successful_requests());
- EXPECT_EQ(0U, client_stats.total_requests_in_progress());
- EXPECT_EQ(0U, client_stats.total_error_requests());
- EXPECT_EQ(0U, client_stats.total_dropped_requests());
- // Shut down the balancer.
- balancers_[0]->Shutdown();
- // We should continue using the last EDS response we received from the
- // balancer before it was shut down.
- // Note: We need to use WaitForAllBackends() here instead of just
- // CheckRpcSendOk(kNumBackendsFirstPass), because when the balancer
- // shuts down, the XdsClient will generate an error to the
- // ServiceConfigWatcher, which will cause the xds resolver to send a
- // no-op update to the LB policy. When this update gets down to the
- // round_robin child policy for the locality, it will generate a new
- // subchannel list, which resets the start index randomly. So we need
- // to be a little more permissive here to avoid spurious failures.
- ResetBackendCounters();
- int num_started = std::get<0>(WaitForAllBackends(
- /* start_index */ 0, /* stop_index */ kNumBackendsFirstPass));
- // Now restart the balancer, this time pointing to the new backends.
- balancers_[0]->Start();
- args = AdsServiceImpl::EdsResourceArgs({
- {"locality0", GetBackendPorts(kNumBackendsFirstPass)},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Wait for queries to start going to one of the new backends.
- // This tells us that we're now using the new serverlist.
- std::tie(num_ok, num_failure, num_drops) =
- WaitForAllBackends(/* start_index */ kNumBackendsFirstPass);
- num_started += num_ok + num_failure + num_drops;
- // Send one RPC per backend.
- CheckRpcSendOk(kNumBackendsSecondPass);
- num_started += kNumBackendsSecondPass;
- // Check client stats.
- load_report = balancers_[0]->lrs_service()->WaitForLoadReport();
- ASSERT_EQ(load_report.size(), 1UL);
- client_stats = std::move(load_report.front());
- EXPECT_EQ(num_started, client_stats.total_successful_requests());
- EXPECT_EQ(0U, client_stats.total_requests_in_progress());
- EXPECT_EQ(0U, client_stats.total_error_requests());
- EXPECT_EQ(0U, client_stats.total_dropped_requests());
-}
-
-class ClientLoadReportingWithDropTest : public XdsEnd2endTest {
- public:
- ClientLoadReportingWithDropTest() : XdsEnd2endTest(4, 1, 20) {}
-};
-
-// Tests that the drop stats are correctly reported by client load reporting.
-TEST_P(ClientLoadReportingWithDropTest, Vanilla) {
- if (GetParam().use_fake_resolver()) {
- balancers_[0]->lrs_service()->set_cluster_names({kServerName});
- }
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- const size_t kNumRpcs = 3000;
- const uint32_t kDropPerMillionForLb = 100000;
- const uint32_t kDropPerMillionForThrottle = 200000;
- const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;
- const double kDropRateForThrottle = kDropPerMillionForThrottle / 1000000.0;
- const double KDropRateForLbAndThrottle =
- kDropRateForLb + (1 - kDropRateForLb) * kDropRateForThrottle;
- // The ADS response contains two drop categories.
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- args.drop_categories = {{kLbDropType, kDropPerMillionForLb},
- {kThrottleDropType, kDropPerMillionForThrottle}};
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- int num_ok = 0;
- int num_failure = 0;
- int num_drops = 0;
- std::tie(num_ok, num_failure, num_drops) = WaitForAllBackends();
- const size_t num_warmup = num_ok + num_failure + num_drops;
- // Send kNumRpcs RPCs and count the drops.
- for (size_t i = 0; i < kNumRpcs; ++i) {
- EchoResponse response;
- const Status status = SendRpc(RpcOptions(), &response);
- if (!status.ok() &&
- status.error_message() == "Call dropped by load balancing policy") {
- ++num_drops;
- } else {
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- EXPECT_EQ(response.message(), kRequestMessage);
- }
- }
- // The drop rate should be roughly equal to the expectation.
- const double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
- const double kErrorTolerance = 0.2;
- EXPECT_THAT(
- seen_drop_rate,
- ::testing::AllOf(
- ::testing::Ge(KDropRateForLbAndThrottle * (1 - kErrorTolerance)),
- ::testing::Le(KDropRateForLbAndThrottle * (1 + kErrorTolerance))));
- // Check client stats.
- const size_t total_rpc = num_warmup + kNumRpcs;
- ClientStats client_stats;
- do {
- std::vector<ClientStats> load_reports =
- balancers_[0]->lrs_service()->WaitForLoadReport();
- for (const auto& load_report : load_reports) {
- client_stats += load_report;
- }
- } while (client_stats.total_issued_requests() +
- client_stats.total_dropped_requests() <
- total_rpc);
- EXPECT_EQ(num_drops, client_stats.total_dropped_requests());
- EXPECT_THAT(
- client_stats.dropped_requests(kLbDropType),
- ::testing::AllOf(
- ::testing::Ge(total_rpc * kDropRateForLb * (1 - kErrorTolerance)),
- ::testing::Le(total_rpc * kDropRateForLb * (1 + kErrorTolerance))));
- EXPECT_THAT(client_stats.dropped_requests(kThrottleDropType),
- ::testing::AllOf(
- ::testing::Ge(total_rpc * (1 - kDropRateForLb) *
- kDropRateForThrottle * (1 - kErrorTolerance)),
- ::testing::Le(total_rpc * (1 - kDropRateForLb) *
- kDropRateForThrottle * (1 + kErrorTolerance))));
-}
-
-class FaultInjectionTest : public XdsEnd2endTest {
- public:
- FaultInjectionTest() : XdsEnd2endTest(1, 1) {}
-
- // Builds a Listener with Fault Injection filter config. If the http_fault is
- // nullptr, then assign an empty filter config. This filter config is required
- // to enable the fault injection features.
- static Listener BuildListenerWithFaultInjection(
- const HTTPFault& http_fault = HTTPFault()) {
- HttpConnectionManager http_connection_manager;
- Listener listener;
- listener.set_name(kServerName);
- HttpFilter* fault_filter = http_connection_manager.add_http_filters();
- fault_filter->set_name("envoy.fault");
- fault_filter->mutable_typed_config()->PackFrom(http_fault);
- HttpFilter* router_filter = http_connection_manager.add_http_filters();
- router_filter->set_name("router");
- router_filter->mutable_typed_config()->PackFrom(
- envoy::extensions::filters::http::router::v3::Router());
- listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
- http_connection_manager);
- return listener;
- }
-
- RouteConfiguration BuildRouteConfigurationWithFaultInjection(
- const HTTPFault& http_fault) {
- // Package as Any
- google::protobuf::Any filter_config;
- filter_config.PackFrom(http_fault);
- // Plug into the RouteConfiguration
- RouteConfiguration new_route_config = default_route_config_;
- auto* config_map = new_route_config.mutable_virtual_hosts(0)
- ->mutable_routes(0)
- ->mutable_typed_per_filter_config();
- (*config_map)["envoy.fault"] = std::move(filter_config);
- return new_route_config;
- }
-
- void SetFilterConfig(HTTPFault& http_fault) {
- switch (GetParam().filter_config_setup()) {
- case TestType::FilterConfigSetup::kRouteOverride: {
- Listener listener = BuildListenerWithFaultInjection();
- RouteConfiguration route =
- BuildRouteConfigurationWithFaultInjection(http_fault);
- SetListenerAndRouteConfiguration(0, listener, route);
- break;
- }
- case TestType::FilterConfigSetup::kHTTPConnectionManagerOriginal: {
- Listener listener = BuildListenerWithFaultInjection(http_fault);
- SetListenerAndRouteConfiguration(0, listener, default_route_config_);
- }
- };
- }
-};
-
-// Test to ensure the most basic fault injection config works.
-TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysAbort) {
- const uint32_t kAbortPercentagePerHundred = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
- abort_percentage->set_numerator(kAbortPercentagePerHundred);
- abort_percentage->set_denominator(FractionalPercent::HUNDRED);
- http_fault.mutable_abort()->set_grpc_status(
- static_cast<uint32_t>(StatusCode::ABORTED));
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Fire several RPCs, and expect all of them to be aborted.
- CheckRpcSendFailure(5, RpcOptions().set_wait_for_ready(true),
- StatusCode::ABORTED);
-}
-
-// Without the listener config, the fault injection won't be enabled.
-TEST_P(FaultInjectionTest, XdsFaultInjectionWithoutListenerFilter) {
- const uint32_t kAbortPercentagePerHundred = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
- abort_percentage->set_numerator(kAbortPercentagePerHundred);
- abort_percentage->set_denominator(FractionalPercent::HUNDRED);
- http_fault.mutable_abort()->set_grpc_status(
- static_cast<uint32_t>(StatusCode::ABORTED));
- // Turn on fault injection
- RouteConfiguration route =
- BuildRouteConfigurationWithFaultInjection(http_fault);
- SetListenerAndRouteConfiguration(0, default_listener_, route);
- // Fire several RPCs, and expect all of them to be pass.
- CheckRpcSendOk(5, RpcOptions().set_wait_for_ready(true));
-}
-
-TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbort) {
- const size_t kNumRpcs = 100;
- const uint32_t kAbortPercentagePerHundred = 50;
- const double kAbortRate = kAbortPercentagePerHundred / 100.0;
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
- abort_percentage->set_numerator(kAbortPercentagePerHundred);
- abort_percentage->set_denominator(FractionalPercent::HUNDRED);
- http_fault.mutable_abort()->set_grpc_status(
- static_cast<uint32_t>(StatusCode::ABORTED));
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the aborts.
- int num_total = 0, num_ok = 0, num_failure = 0, num_aborted = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- SendRpcAndCount(&num_total, &num_ok, &num_failure, &num_aborted,
- RpcOptions(), "Fault injected");
- }
- EXPECT_EQ(kNumRpcs, num_total);
- EXPECT_EQ(0, num_failure);
- // The abort rate should be roughly equal to the expectation.
- const double seen_abort_rate = static_cast<double>(num_aborted) / kNumRpcs;
- EXPECT_THAT(seen_abort_rate,
- ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
- ::testing::Le(kAbortRate + kErrorTolerance)));
-}
-
-TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageAbortViaHeaders) {
- const size_t kNumRpcs = 100;
- const uint32_t kAbortPercentageCap = 100;
- const uint32_t kAbortPercentage = 50;
- const double kAbortRate = kAbortPercentage / 100.0;
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- http_fault.mutable_abort()->mutable_header_abort();
- http_fault.mutable_abort()->mutable_percentage()->set_numerator(
- kAbortPercentageCap);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the aborts.
- std::vector<std::pair<TString, TString>> metadata = {
- {"x-envoy-fault-abort-grpc-request", "10"},
- {"x-envoy-fault-abort-percentage", ToString(kAbortPercentage)},
- };
- int num_total = 0, num_ok = 0, num_failure = 0, num_aborted = 0;
- RpcOptions options = RpcOptions().set_metadata(metadata);
- for (size_t i = 0; i < kNumRpcs; ++i) {
- SendRpcAndCount(&num_total, &num_ok, &num_failure, &num_aborted, options,
- "Fault injected");
- }
- EXPECT_EQ(kNumRpcs, num_total);
- EXPECT_EQ(0, num_failure);
- // The abort rate should be roughly equal to the expectation.
- const double seen_abort_rate = static_cast<double>(num_aborted) / kNumRpcs;
- EXPECT_THAT(seen_abort_rate,
- ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
- ::testing::Le(kAbortRate + kErrorTolerance)));
-}
-
-// TODO(lidiz) reduce the error tolerance to a lower level without dramatically
-// increase the duration of fault injection tests.
-TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelay) {
- const size_t kNumRpcs = 100;
- const uint32_t kFixedDelaySeconds = 100;
- const uint32_t kRpcTimeoutMilliseconds = 10; // 10 ms
- const uint32_t kDelayPercentagePerHundred = 95;
- const double kDelayRate = kDelayPercentagePerHundred / 100.0;
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* delay_percentage = http_fault.mutable_delay()->mutable_percentage();
- delay_percentage->set_numerator(kDelayPercentagePerHundred);
- delay_percentage->set_denominator(FractionalPercent::HUNDRED);
- auto* fixed_delay = http_fault.mutable_delay()->mutable_fixed_delay();
- fixed_delay->set_seconds(kFixedDelaySeconds);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the delays.
- int num_total = 0, num_ok = 0, num_delayed = 0, num_dropped = 0;
- RpcOptions options = RpcOptions()
- .set_timeout_ms(kRpcTimeoutMilliseconds)
- .set_skip_cancelled_check(true);
- for (size_t i = 0; i < kNumRpcs; ++i) {
- SendRpcAndCount(&num_total, &num_ok, &num_delayed, &num_dropped, options);
- }
- EXPECT_EQ(kNumRpcs, num_total);
- EXPECT_EQ(0, num_dropped);
- // The delay rate should be roughly equal to the expectation.
- const double seen_delay_rate = static_cast<double>(num_delayed) / kNumRpcs;
- EXPECT_THAT(seen_delay_rate,
- ::testing::AllOf(::testing::Ge(kDelayRate - kErrorTolerance),
- ::testing::Le(kDelayRate + kErrorTolerance)));
-}
-
-TEST_P(FaultInjectionTest, XdsFaultInjectionPercentageDelayViaHeaders) {
- const size_t kNumRpcs = 100;
- const uint32_t kFixedDelayMilliseconds = 100000; // 100 seconds
- const uint32_t kRpcTimeoutMilliseconds = 10; // 10 ms
- const uint32_t kDelayPercentageCap = 100;
- const uint32_t kDelayPercentage = 50;
- const double kDelayRate = kDelayPercentage / 100.0;
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- http_fault.mutable_delay()->mutable_header_delay();
- http_fault.mutable_delay()->mutable_percentage()->set_numerator(
- kDelayPercentageCap);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the delays.
- std::vector<std::pair<TString, TString>> metadata = {
- {"x-envoy-fault-delay-request", ToString(kFixedDelayMilliseconds)},
- {"x-envoy-fault-delay-request-percentage",
- ToString(kDelayPercentage)},
- };
- int num_total = 0, num_ok = 0, num_delayed = 0, num_dropped = 0;
- RpcOptions options = RpcOptions()
- .set_metadata(metadata)
- .set_timeout_ms(kRpcTimeoutMilliseconds)
- .set_skip_cancelled_check(true);
- for (size_t i = 0; i < kNumRpcs; ++i) {
- SendRpcAndCount(&num_total, &num_ok, &num_delayed, &num_dropped, options);
- }
- // The delay rate should be roughly equal to the expectation.
- const double seen_delay_rate = static_cast<double>(num_delayed) / kNumRpcs;
- EXPECT_THAT(seen_delay_rate,
- ::testing::AllOf(::testing::Ge(kDelayRate - kErrorTolerance),
- ::testing::Le(kDelayRate + kErrorTolerance)));
-}
-
-TEST_P(FaultInjectionTest, XdsFaultInjectionAlwaysDelayPercentageAbort) {
- const size_t kNumRpcs = 100;
- const uint32_t kAbortPercentagePerHundred = 50;
- const double kAbortRate = kAbortPercentagePerHundred / 100.0;
- const uint32_t kFixedDelayNanos = 10 * 1000 * 1000; // 10 ms
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
- abort_percentage->set_numerator(kAbortPercentagePerHundred);
- abort_percentage->set_denominator(FractionalPercent::HUNDRED);
- http_fault.mutable_abort()->set_grpc_status(
- static_cast<uint32_t>(StatusCode::ABORTED));
- auto* delay_percentage = http_fault.mutable_delay()->mutable_percentage();
- delay_percentage->set_numerator(1000000); // Always inject DELAY!
- delay_percentage->set_denominator(FractionalPercent::MILLION);
- auto* fixed_delay = http_fault.mutable_delay()->mutable_fixed_delay();
- fixed_delay->set_nanos(kFixedDelayNanos);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the aborts.
- int num_total = 0, num_ok = 0, num_failure = 0, num_aborted = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- grpc_millis t0 = NowFromCycleCounter();
- SendRpcAndCount(&num_total, &num_ok, &num_failure, &num_aborted,
- RpcOptions(), "Fault injected");
- grpc_millis t1 = NowFromCycleCounter();
- EXPECT_GE(t1, t0 + kFixedDelayNanos / 1000 / 1000);
- }
- EXPECT_EQ(kNumRpcs, num_total);
- EXPECT_EQ(0, num_failure);
- // The abort rate should be roughly equal to the expectation.
- const double seen_abort_rate = static_cast<double>(num_aborted) / kNumRpcs;
- EXPECT_THAT(seen_abort_rate,
- ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
- ::testing::Le(kAbortRate + kErrorTolerance)));
-}
-
-// This test and the above test apply different denominators to delay and abort.
-// This ensures that we are using the right denominator for each injected fault
-// in our code.
-TEST_P(FaultInjectionTest,
- XdsFaultInjectionAlwaysDelayPercentageAbortSwitchDenominator) {
- const size_t kNumRpcs = 100;
- const uint32_t kAbortPercentagePerMillion = 500000;
- const double kAbortRate = kAbortPercentagePerMillion / 1000000.0;
- const uint32_t kFixedDelayNanos = 10 * 1000 * 1000; // 10 ms
- const double kErrorTolerance = 0.2;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* abort_percentage = http_fault.mutable_abort()->mutable_percentage();
- abort_percentage->set_numerator(kAbortPercentagePerMillion);
- abort_percentage->set_denominator(FractionalPercent::MILLION);
- http_fault.mutable_abort()->set_grpc_status(
- static_cast<uint32_t>(StatusCode::ABORTED));
- auto* delay_percentage = http_fault.mutable_delay()->mutable_percentage();
- delay_percentage->set_numerator(100); // Always inject DELAY!
- delay_percentage->set_denominator(FractionalPercent::HUNDRED);
- auto* fixed_delay = http_fault.mutable_delay()->mutable_fixed_delay();
- fixed_delay->set_nanos(kFixedDelayNanos);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Send kNumRpcs RPCs and count the aborts.
- int num_total = 0, num_ok = 0, num_failure = 0, num_aborted = 0;
- for (size_t i = 0; i < kNumRpcs; ++i) {
- grpc_millis t0 = NowFromCycleCounter();
- SendRpcAndCount(&num_total, &num_ok, &num_failure, &num_aborted,
- RpcOptions(), "Fault injected");
- grpc_millis t1 = NowFromCycleCounter();
- EXPECT_GE(t1, t0 + kFixedDelayNanos / 1000 / 1000);
- }
- EXPECT_EQ(kNumRpcs, num_total);
- EXPECT_EQ(0, num_failure);
- // The abort rate should be roughly equal to the expectation.
- const double seen_abort_rate = static_cast<double>(num_aborted) / kNumRpcs;
- EXPECT_THAT(seen_abort_rate,
- ::testing::AllOf(::testing::Ge(kAbortRate - kErrorTolerance),
- ::testing::Le(kAbortRate + kErrorTolerance)));
-}
-
-TEST_P(FaultInjectionTest, XdsFaultInjectionMaxFault) {
- const uint32_t kMaxFault = 10;
- const uint32_t kNumRpcs = 30; // kNumRpcs should be bigger than kMaxFault
- const uint32_t kRpcTimeoutMs = 2000; // 2 seconds
- const uint32_t kLongDelaySeconds = 100; // 100 seconds
- const uint32_t kAlwaysDelayPercentage = 100;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create an EDS resource
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Construct the fault injection filter config
- HTTPFault http_fault;
- auto* delay_percentage = http_fault.mutable_delay()->mutable_percentage();
- delay_percentage->set_numerator(
- kAlwaysDelayPercentage); // Always inject DELAY!
- delay_percentage->set_denominator(FractionalPercent::HUNDRED);
- auto* fixed_delay = http_fault.mutable_delay()->mutable_fixed_delay();
- fixed_delay->set_seconds(kLongDelaySeconds);
- http_fault.mutable_max_active_faults()->set_value(kMaxFault);
- // Config fault injection via different setup
- SetFilterConfig(http_fault);
- // Sends a batch of long running RPCs with long timeout to consume all
- // active faults quota.
- int num_ok = 0, num_delayed = 0;
- LongRunningRpc rpcs[kNumRpcs];
- RpcOptions rpc_options = RpcOptions().set_timeout_ms(kRpcTimeoutMs);
- for (size_t i = 0; i < kNumRpcs; ++i) {
- rpcs[i].StartRpc(stub_.get(), rpc_options);
- }
- for (size_t i = 0; i < kNumRpcs; ++i) {
- Status status = rpcs[i].GetStatus();
- if (status.ok()) {
- ++num_ok;
- } else {
- EXPECT_EQ(StatusCode::DEADLINE_EXCEEDED, status.error_code());
- ++num_delayed;
- }
- }
- // Only kMaxFault number of RPC should be fault injected..
- EXPECT_EQ(kMaxFault, num_delayed);
- // Other RPCs should be ok.
- EXPECT_EQ(kNumRpcs - kMaxFault, num_ok);
-}
-
-class BootstrapContentsFromEnvVarTest : public XdsEnd2endTest {
- public:
- BootstrapContentsFromEnvVarTest() : XdsEnd2endTest(4, 1, 100, false, true) {}
-};
-
-TEST_P(BootstrapContentsFromEnvVarTest, Vanilla) {
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", GetBackendPorts()},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- WaitForAllBackends();
-}
-
-#ifndef DISABLED_XDS_PROTO_IN_CC
-class ClientStatusDiscoveryServiceTest : public XdsEnd2endTest {
- public:
- ClientStatusDiscoveryServiceTest() : XdsEnd2endTest(1, 1) {}
-
- void SetUp() override {
- XdsEnd2endTest::SetUp();
- admin_server_thread_ = y_absl::make_unique<AdminServerThread>();
- admin_server_thread_->Start();
- TString admin_server_address = y_absl::StrCat(
- ipv6_only_ ? "[::1]:" : "127.0.0.1:", admin_server_thread_->port());
- admin_channel_ = grpc::CreateChannel(
- admin_server_address,
- std::make_shared<SecureChannelCredentials>(
- grpc_fake_transport_security_credentials_create()));
- csds_stub_ =
- envoy::service::status::v3::ClientStatusDiscoveryService::NewStub(
- admin_channel_);
- if (GetParam().use_csds_streaming()) {
- stream_ = csds_stub_->StreamClientStatus(&stream_context_);
- }
- }
-
- void TearDown() override {
- if (stream_ != nullptr) {
- EXPECT_TRUE(stream_->WritesDone());
- Status status = stream_->Finish();
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- }
- admin_server_thread_->Shutdown();
- XdsEnd2endTest::TearDown();
- }
-
- envoy::service::status::v3::ClientStatusResponse FetchCsdsResponse() {
- envoy::service::status::v3::ClientStatusResponse response;
- if (!GetParam().use_csds_streaming()) {
- // Fetch through unary pulls
- ClientContext context;
- Status status = csds_stub_->FetchClientStatus(
- &context, envoy::service::status::v3::ClientStatusRequest(),
- &response);
- EXPECT_TRUE(status.ok()) << "code=" << status.error_code()
- << " message=" << status.error_message();
- } else {
- // Fetch through streaming pulls
- EXPECT_TRUE(
- stream_->Write(envoy::service::status::v3::ClientStatusRequest()));
- EXPECT_TRUE(stream_->Read(&response));
- }
- return response;
- }
-
- private:
- std::unique_ptr<AdminServerThread> admin_server_thread_;
- std::shared_ptr<Channel> admin_channel_;
- std::unique_ptr<
- envoy::service::status::v3::ClientStatusDiscoveryService::Stub>
- csds_stub_;
- ClientContext stream_context_;
- std::unique_ptr<
- ClientReaderWriter<envoy::service::status::v3::ClientStatusRequest,
- envoy::service::status::v3::ClientStatusResponse>>
- stream_;
-};
-
-MATCHER_P4(EqNode, id, user_agent_name, user_agent_version, client_features,
- "equals Node") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(id, arg.id(), result_listener);
- ok &= ::testing::ExplainMatchResult(user_agent_name, arg.user_agent_name(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(
- user_agent_version, arg.user_agent_version(), result_listener);
- ok &= ::testing::ExplainMatchResult(client_features, arg.client_features(),
- result_listener);
- return ok;
-}
-
-MATCHER_P2(EqListenersConfigDump, version_info, dynamic_listeners,
- "equals ListenerConfigDump") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(::testing::ElementsAre(),
- arg.static_listeners(), result_listener);
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(dynamic_listeners,
- arg.dynamic_listeners(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqDynamicListenerState, version_info, listener,
- "equals DynamicListenerState") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- ok &=
- ::testing::ExplainMatchResult(listener, arg.listener(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqListener, name, api_listener, "equals Listener") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(name, arg.name(), result_listener);
- ok &= ::testing::ExplainMatchResult(
- api_listener, arg.api_listener().api_listener(), result_listener);
- return ok;
-}
-
-MATCHER_P(EqHttpConnectionManagerNotRds, route_config,
- "equals HttpConnectionManager") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(route_config, arg.route_config(),
- result_listener);
- return ok;
-}
-
-MATCHER_P(EqRouteConfigurationName, name, "equals RouteConfiguration") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(name, arg.name(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqRouteConfiguration, name, cluster_name,
- "equals RouteConfiguration") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(name, arg.name(), result_listener);
- ok &= ::testing::ExplainMatchResult(
- ::testing::ElementsAre(::testing::Property(
- &envoy::config::route::v3::VirtualHost::routes,
- ::testing::ElementsAre(::testing::Property(
- &envoy::config::route::v3::Route::route,
- ::testing::Property(
- &envoy::config::route::v3::RouteAction::cluster,
- cluster_name))))),
- arg.virtual_hosts(), result_listener);
- return ok;
-}
-
-MATCHER_P(EqRoutesConfigDump, dynamic_route_configs,
- "equals RoutesConfigDump") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(
- ::testing::ElementsAre(), arg.static_route_configs(), result_listener);
- ok &= ::testing::ExplainMatchResult(
- dynamic_route_configs, arg.dynamic_route_configs(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqClustersConfigDump, version_info, dynamic_active_clusters,
- "equals ClustersConfigDump") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(::testing::ElementsAre(),
- arg.static_clusters(), result_listener);
- ok &= ::testing::ExplainMatchResult(::testing::ElementsAre(),
- arg.dynamic_warming_clusters(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(
- dynamic_active_clusters, arg.dynamic_active_clusters(), result_listener);
- return ok;
-}
-
-MATCHER_P(EqCluster, name, "equals Cluster") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(name, arg.name(), result_listener);
- return ok;
-}
-
-MATCHER_P(EqEndpointsConfigDump, dynamic_endpoint_configs,
- "equals EndpointsConfigDump") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(dynamic_endpoint_configs,
- arg.dynamic_endpoint_configs(),
- result_listener);
- return ok;
-}
-
-MATCHER_P(EqEndpoint, port, "equals Endpoint") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(
- port, arg.address().socket_address().port_value(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqLocalityLbEndpoints, port, weight, "equals LocalityLbEndpoints") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(
- ::testing::ElementsAre(::testing::Property(
- &envoy::config::endpoint::v3::LbEndpoint::endpoint,
- EqEndpoint(port))),
- arg.lb_endpoints(), result_listener);
- ok &= ::testing::ExplainMatchResult(
- weight, arg.load_balancing_weight().value(), result_listener);
- return ok;
-}
-
-MATCHER_P(EqClusterLoadAssignmentName, cluster_name,
- "equals ClusterLoadAssignment") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(cluster_name, arg.cluster_name(),
- result_listener);
- return ok;
-}
-
-MATCHER_P3(EqClusterLoadAssignment, cluster_name, port, weight,
- "equals ClusterLoadAssignment") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(cluster_name, arg.cluster_name(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(
- ::testing::ElementsAre(EqLocalityLbEndpoints(port, weight)),
- arg.endpoints(), result_listener);
- return ok;
-}
-
-MATCHER_P2(EqUpdateFailureState, details, version_info,
- "equals UpdateFailureState") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(details, arg.details(), result_listener);
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- return ok;
-}
-
-MATCHER_P(UnpackListener, matcher, "is a Listener") {
- Listener config;
- if (!::testing::ExplainMatchResult(true, arg.UnpackTo(&config),
- result_listener)) {
- return false;
- }
- return ::testing::ExplainMatchResult(matcher, config, result_listener);
-}
-
-MATCHER_P(UnpackRouteConfiguration, matcher, "is a RouteConfiguration") {
- RouteConfiguration config;
- if (!::testing::ExplainMatchResult(true, arg.UnpackTo(&config),
- result_listener)) {
- return false;
- }
- return ::testing::ExplainMatchResult(matcher, config, result_listener);
-}
-
-MATCHER_P(UnpackHttpConnectionManager, matcher, "is a HttpConnectionManager") {
- HttpConnectionManager config;
- if (!::testing::ExplainMatchResult(true, arg.UnpackTo(&config),
- result_listener)) {
- return false;
- }
- return ::testing::ExplainMatchResult(matcher, config, result_listener);
-}
-
-MATCHER_P(UnpackCluster, matcher, "is a Cluster") {
- Cluster config;
- if (!::testing::ExplainMatchResult(true, arg.UnpackTo(&config),
- result_listener)) {
- return false;
- }
- return ::testing::ExplainMatchResult(matcher, config, result_listener);
-}
-
-MATCHER_P(UnpackClusterLoadAssignment, matcher, "is a ClusterLoadAssignment") {
- ClusterLoadAssignment config;
- if (!::testing::ExplainMatchResult(true, arg.UnpackTo(&config),
- result_listener)) {
- return false;
- }
- return ::testing::ExplainMatchResult(matcher, config, result_listener);
-}
-
-MATCHER_P5(EqDynamicListener, name, version_info, client_status,
- api_listener_matcher, error_state, "equals DynamicListener") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(false, arg.has_warming_state(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(false, arg.has_draining_state(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(name, arg.name(), result_listener);
- ok &= ::testing::ExplainMatchResult(client_status, arg.client_status(),
- result_listener);
- if (client_status == ClientResourceStatus::ACKED ||
- client_status == ClientResourceStatus::NACKED) {
- ok &= ::testing::ExplainMatchResult(
- EqDynamicListenerState(version_info, UnpackListener(EqListener(
- name, api_listener_matcher))),
- arg.active_state(), result_listener);
- }
- ok &= ::testing::ExplainMatchResult(error_state, arg.error_state(),
- result_listener);
- return ok;
-}
-
-MATCHER_P5(EqDynamicRouteConfig, name, version_info, client_status,
- cluster_name, error_state, "equals DynamicRouteConfig") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- if (client_status == ClientResourceStatus::REQUESTED ||
- client_status == ClientResourceStatus::DOES_NOT_EXIST) {
- ok &= ::testing::ExplainMatchResult(
- UnpackRouteConfiguration(EqRouteConfigurationName(name)),
- arg.route_config(), result_listener);
- } else {
- ok &= ::testing::ExplainMatchResult(
- UnpackRouteConfiguration(EqRouteConfiguration(name, cluster_name)),
- arg.route_config(), result_listener);
- }
- ok &= ::testing::ExplainMatchResult(error_state, arg.error_state(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(client_status, arg.client_status(),
- result_listener);
- return ok;
-}
-
-MATCHER_P4(EqDynamicCluster, name, version_info, client_status, error_state,
- "equals DynamicCluster") {
- bool ok = true;
- ok &= ::testing::ExplainMatchResult(UnpackCluster(EqCluster(name)),
- arg.cluster(), result_listener);
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(client_status, arg.client_status(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(error_state, arg.error_state(),
- result_listener);
- return ok;
-}
-
-MATCHER_P6(EqDynamicEndpointConfig, name, version_info, client_status, port,
- weight, error_state, "equals DynamicEndpointConfig") {
- bool ok = true;
- if (client_status == ClientResourceStatus::REQUESTED ||
- client_status == ClientResourceStatus::DOES_NOT_EXIST) {
- ok &= ::testing::ExplainMatchResult(
- UnpackClusterLoadAssignment(EqClusterLoadAssignmentName(name)),
- arg.endpoint_config(), result_listener);
- } else {
- ok &= ::testing::ExplainMatchResult(
- UnpackClusterLoadAssignment(
- EqClusterLoadAssignment(name, port, weight)),
- arg.endpoint_config(), result_listener);
- }
- ok &= ::testing::ExplainMatchResult(version_info, arg.version_info(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(client_status, arg.client_status(),
- result_listener);
- ok &= ::testing::ExplainMatchResult(error_state, arg.error_state(),
- result_listener);
- return ok;
-}
-
-MATCHER(IsRdsEnabledHCM, "is a RDS enabled HttpConnectionManager") {
- return ::testing::ExplainMatchResult(
- UnpackHttpConnectionManager(
- ::testing::Property(&HttpConnectionManager::has_rds, true)),
- arg, result_listener);
-}
-
-MATCHER_P2(EqNoRdsHCM, route_configuration_name, cluster_name,
- "equals RDS disabled HttpConnectionManager") {
- return ::testing::ExplainMatchResult(
- UnpackHttpConnectionManager(EqHttpConnectionManagerNotRds(
- EqRouteConfiguration(route_configuration_name, cluster_name))),
- arg, result_listener);
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpVanilla) {
- const size_t kNumRpcs = 5;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Send several RPCs to ensure the xDS setup works
- CheckRpcSendOk(kNumRpcs);
- // Fetches the client config
- auto csds_response = FetchCsdsResponse();
- gpr_log(GPR_INFO, "xDS config dump: %s", csds_response.DebugString().c_str());
- EXPECT_EQ(1, csds_response.config_size());
- const auto& client_config = csds_response.config(0);
- // Validate the Node information
- EXPECT_THAT(client_config.node(),
- EqNode("xds_end2end_test", ::testing::HasSubstr("C-core"),
- ::testing::HasSubstr(grpc_version_string()),
- ::testing::ElementsAre(
- "envoy.lb.does_not_support_overprovisioning")));
- // Prepare matches for RDS on or off
- ::testing::Matcher<google::protobuf::Any> api_listener_matcher;
- ::testing::Matcher<envoy::admin::v3::RoutesConfigDump>
- route_config_dump_matcher;
- if (GetParam().enable_rds_testing()) {
- api_listener_matcher = IsRdsEnabledHCM();
- route_config_dump_matcher =
- EqRoutesConfigDump(::testing::ElementsAre(EqDynamicRouteConfig(
- kDefaultRouteConfigurationName, "1", ClientResourceStatus::ACKED,
- kDefaultClusterName, ::testing::_)));
- } else {
- api_listener_matcher =
- EqNoRdsHCM(kDefaultRouteConfigurationName, kDefaultClusterName);
- route_config_dump_matcher = EqRoutesConfigDump(::testing::ElementsAre());
- }
- // Validate the dumped xDS configs
- EXPECT_THAT(
- client_config.xds_config(),
- ::testing::UnorderedElementsAre(
- ::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::listener_config,
- EqListenersConfigDump(
- "1", ::testing::ElementsAre(EqDynamicListener(
- kServerName, "1", ClientResourceStatus::ACKED,
- api_listener_matcher, ::testing::_)))),
- ::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::route_config,
- route_config_dump_matcher),
- ::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::cluster_config,
- EqClustersConfigDump(
- "1", ::testing::ElementsAre(EqDynamicCluster(
- kDefaultClusterName, "1",
- ClientResourceStatus::ACKED, ::testing::_)))),
- ::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::endpoint_config,
- EqEndpointsConfigDump(
- ::testing::ElementsAre(EqDynamicEndpointConfig(
- kDefaultEdsServiceName, "1", ClientResourceStatus::ACKED,
- backends_[0]->port(), kDefaultLocalityWeight,
- ::testing::_))))));
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpEmpty) {
- // The CSDS service should not fail if XdsClient is not initialized or there
- // is no working xDS configs.
- FetchCsdsResponse();
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerError) {
- int kFetchConfigRetries = 3;
- int kFetchIntervalMilliseconds = 200;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Ensure the xDS resolver has working configs.
- CheckRpcSendOk();
- // Bad Listener should be rejected.
- Listener listener;
- listener.set_name(kServerName);
- balancers_[0]->ads_service()->SetLdsResource(listener);
- // The old xDS configs should still be effective.
- CheckRpcSendOk();
- ::testing::Matcher<google::protobuf::Any> api_listener_matcher;
- if (GetParam().enable_rds_testing()) {
- api_listener_matcher = IsRdsEnabledHCM();
- } else {
- api_listener_matcher =
- EqNoRdsHCM(kDefaultRouteConfigurationName, kDefaultClusterName);
- }
- for (int o = 0; o < kFetchConfigRetries; o++) {
- auto csds_response = FetchCsdsResponse();
- // Check if error state is propagated
- bool ok = ::testing::Value(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::listener_config,
- EqListenersConfigDump(
- "1",
- ::testing::ElementsAre(EqDynamicListener(
- kServerName, "1", ClientResourceStatus::NACKED,
- api_listener_matcher,
- EqUpdateFailureState(
- ::testing::HasSubstr(
- "Listener has neither address nor ApiListener"),
- "2")))))));
- if (ok) return; // TEST PASSED!
- gpr_sleep_until(
- grpc_timeout_milliseconds_to_deadline(kFetchIntervalMilliseconds));
- }
- FAIL() << "error_state not seen in CSDS responses";
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpRouteError) {
- int kFetchConfigRetries = 3;
- int kFetchIntervalMilliseconds = 200;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Ensure the xDS resolver has working configs.
- CheckRpcSendOk();
- // Bad route config will be rejected.
- RouteConfiguration route_config;
- route_config.set_name(kDefaultRouteConfigurationName);
- route_config.add_virtual_hosts();
- SetRouteConfiguration(0, route_config);
- // The old xDS configs should still be effective.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendOk();
- for (int o = 0; o < kFetchConfigRetries; o++) {
- auto csds_response = FetchCsdsResponse();
- bool ok = false;
- if (GetParam().enable_rds_testing()) {
- ok = ::testing::Value(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::route_config,
- EqRoutesConfigDump(::testing::ElementsAre(EqDynamicRouteConfig(
- kDefaultRouteConfigurationName, "1",
- ClientResourceStatus::NACKED, kDefaultClusterName,
- EqUpdateFailureState(
- ::testing::HasSubstr("VirtualHost has no domains"),
- "2")))))));
- } else {
- ok = ::testing::Value(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::listener_config,
- EqListenersConfigDump(
- "1",
- ::testing::ElementsAre(EqDynamicListener(
- kServerName, "1", ClientResourceStatus::NACKED,
- EqNoRdsHCM(kDefaultRouteConfigurationName,
- kDefaultClusterName),
- EqUpdateFailureState(
- ::testing::HasSubstr("VirtualHost has no domains"),
- "2")))))));
- }
- if (ok) return; // TEST PASSED!
- gpr_sleep_until(
- grpc_timeout_milliseconds_to_deadline(kFetchIntervalMilliseconds));
- }
- FAIL() << "error_state not seen in CSDS responses";
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterError) {
- int kFetchConfigRetries = 3;
- int kFetchIntervalMilliseconds = 200;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Ensure the xDS resolver has working configs.
- CheckRpcSendOk();
- // Listener without any route, will be rejected.
- Cluster cluster;
- cluster.set_name(kDefaultClusterName);
- balancers_[0]->ads_service()->SetCdsResource(cluster);
- // The old xDS configs should still be effective.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendOk();
- for (int o = 0; o < kFetchConfigRetries; o++) {
- auto csds_response = FetchCsdsResponse();
- // Check if error state is propagated
- bool ok = ::testing::Value(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::cluster_config,
- EqClustersConfigDump(
- "1", ::testing::ElementsAre(EqDynamicCluster(
- kDefaultClusterName, "1", ClientResourceStatus::NACKED,
- EqUpdateFailureState(
- ::testing::HasSubstr("DiscoveryType not found"),
- "2")))))));
- if (ok) return; // TEST PASSED!
- gpr_sleep_until(
- grpc_timeout_milliseconds_to_deadline(kFetchIntervalMilliseconds));
- }
- FAIL() << "error_state not seen in CSDS responses";
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpEndpointError) {
- int kFetchConfigRetries = 3;
- int kFetchIntervalMilliseconds = 200;
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- AdsServiceImpl::EdsResourceArgs args({
- {"locality0", {backends_[0]->port()}},
- });
- balancers_[0]->ads_service()->SetEdsResource(
- BuildEdsResource(args, DefaultEdsServiceName()));
- // Ensure the xDS resolver has working configs.
- CheckRpcSendOk();
- // Bad endpoint config will be rejected.
- ClusterLoadAssignment cluster_load_assignment;
- cluster_load_assignment.set_cluster_name(kDefaultEdsServiceName);
- auto* endpoints = cluster_load_assignment.add_endpoints();
- endpoints->mutable_load_balancing_weight()->set_value(1);
- auto* endpoint = endpoints->add_lb_endpoints()->mutable_endpoint();
- endpoint->mutable_address()->mutable_socket_address()->set_port_value(1 << 1);
- balancers_[0]->ads_service()->SetEdsResource(cluster_load_assignment);
- // The old xDS configs should still be effective.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- CheckRpcSendOk();
- for (int o = 0; o < kFetchConfigRetries; o++) {
- auto csds_response = FetchCsdsResponse();
-
- // Check if error state is propagated
- bool ok = ::testing::Value(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::endpoint_config,
- EqEndpointsConfigDump(
- ::testing::ElementsAre(EqDynamicEndpointConfig(
- kDefaultEdsServiceName, "1", ClientResourceStatus::NACKED,
- backends_[0]->port(), kDefaultLocalityWeight,
- EqUpdateFailureState(::testing::HasSubstr("Empty locality"),
- "2")))))));
- if (ok) return; // TEST PASSED!
- gpr_sleep_until(
- grpc_timeout_milliseconds_to_deadline(kFetchIntervalMilliseconds));
- }
- FAIL() << "error_state not seen in CSDS responses";
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerRequested) {
- int kTimeoutMillisecond = 1000;
- balancers_[0]->ads_service()->UnsetResource(kLdsTypeUrl, kServerName);
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::DEADLINE_EXCEEDED);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::listener_config,
- EqListenersConfigDump(
- ::testing::_, ::testing::ElementsAre(EqDynamicListener(
- kServerName, ::testing::_,
- ClientResourceStatus::REQUESTED,
- ::testing::_, ::testing::_))))));
-}
-
-TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterRequested) {
- int kTimeoutMillisecond = 1000;
- TString kClusterName1 = "cluster-1";
- TString kClusterName2 = "cluster-2";
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- // Create a route config requesting two non-existing clusters
- RouteConfiguration route_config;
- route_config.set_name(kDefaultRouteConfigurationName);
- auto* vh = route_config.add_virtual_hosts();
- // The VirtualHost must match the domain name, otherwise will cause resolver
- // transient failure.
- vh->add_domains("*");
- auto* routes1 = vh->add_routes();
- routes1->mutable_match()->set_prefix("");
- routes1->mutable_route()->set_cluster(kClusterName1);
- auto* routes2 = vh->add_routes();
- routes2->mutable_match()->set_prefix("");
- routes2->mutable_route()->set_cluster(kClusterName2);
- SetRouteConfiguration(0, route_config);
- // Try to get the configs plumb through
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::DEADLINE_EXCEEDED);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::cluster_config,
- EqClustersConfigDump(
- ::testing::_,
- ::testing::UnorderedElementsAre(
- EqDynamicCluster(kClusterName1, ::testing::_,
- ClientResourceStatus::REQUESTED,
- ::testing::_),
- EqDynamicCluster(kClusterName2, ::testing::_,
- ClientResourceStatus::REQUESTED,
- ::testing::_))))));
-}
-
-class CsdsShortAdsTimeoutTest : public ClientStatusDiscoveryServiceTest {
- void SetUp() override {
- // Shorten the ADS subscription timeout to speed up the test run.
- xds_resource_does_not_exist_timeout_ms_ = 500;
- ClientStatusDiscoveryServiceTest::SetUp();
- }
-};
-
-TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpListenerDoesNotExist) {
- int kTimeoutMillisecond = 1000000; // 1000s wait for the transient failure.
- balancers_[0]->ads_service()->UnsetResource(kLdsTypeUrl, kServerName);
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::UNAVAILABLE);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::listener_config,
- EqListenersConfigDump(
- ::testing::_, ::testing::ElementsAre(EqDynamicListener(
- kServerName, ::testing::_,
- ClientResourceStatus::DOES_NOT_EXIST,
- ::testing::_, ::testing::_))))));
-}
-
-TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpRouteConfigDoesNotExist) {
- if (!GetParam().enable_rds_testing()) return;
- int kTimeoutMillisecond = 1000000; // 1000s wait for the transient failure.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- balancers_[0]->ads_service()->UnsetResource(kRdsTypeUrl,
- kDefaultRouteConfigurationName);
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::UNAVAILABLE);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::route_config,
- EqRoutesConfigDump(::testing::ElementsAre(
- EqDynamicRouteConfig(kDefaultRouteConfigurationName, ::testing::_,
- ClientResourceStatus::DOES_NOT_EXIST,
- ::testing::_, ::testing::_))))));
-}
-
-TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpClusterDoesNotExist) {
- int kTimeoutMillisecond = 1000000; // 1000s wait for the transient failure.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- balancers_[0]->ads_service()->UnsetResource(kCdsTypeUrl, kDefaultClusterName);
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::UNAVAILABLE);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::cluster_config,
- EqClustersConfigDump(::testing::_,
- ::testing::ElementsAre(EqDynamicCluster(
- kDefaultClusterName, ::testing::_,
- ClientResourceStatus::DOES_NOT_EXIST,
- ::testing::_))))));
-}
-
-TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpEndpointDoesNotExist) {
- int kTimeoutMillisecond = 1000000; // 1000s wait for the transient failure.
- SetNextResolution({});
- SetNextResolutionForLbChannelAllBalancers();
- balancers_[0]->ads_service()->UnsetResource(kEdsTypeUrl,
- kDefaultEdsServiceName);
- CheckRpcSendFailure(1, RpcOptions().set_timeout_ms(kTimeoutMillisecond),
- grpc::UNAVAILABLE);
- auto csds_response = FetchCsdsResponse();
- EXPECT_THAT(
- csds_response.config(0).xds_config(),
- ::testing::Contains(::testing::Property(
- &envoy::service::status::v3::PerXdsConfig::endpoint_config,
- EqEndpointsConfigDump(::testing::ElementsAre(EqDynamicEndpointConfig(
- kDefaultEdsServiceName, ::testing::_,
- ClientResourceStatus::DOES_NOT_EXIST, ::testing::_, ::testing::_,
- ::testing::_))))));
-}
-#endif // DISABLED_XDS_PROTO_IN_CC
-
-TString TestTypeName(const ::testing::TestParamInfo<TestType>& info) {
- return info.param.AsString();
-}
-
-// Run with all combinations of xds/fake resolver and enabling load reporting.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, BasicTest,
- ::testing::Values(
- TestType(), TestType().set_enable_load_reporting(),
- TestType().set_use_fake_resolver(),
- TestType().set_use_fake_resolver().set_enable_load_reporting()),
- &TestTypeName);
-
-// Run with both fake resolver and xds resolver.
-// Don't run with load reporting or v2 or RDS, since they are irrelevant to
-// the tests.
-INSTANTIATE_TEST_SUITE_P(XdsTest, SecureNamingTest,
- ::testing::Values(TestType(),
- TestType().set_use_fake_resolver()),
- &TestTypeName);
-
-// LDS depends on XdsResolver.
-INSTANTIATE_TEST_SUITE_P(XdsTest, LdsTest, ::testing::Values(TestType()),
- &TestTypeName);
-INSTANTIATE_TEST_SUITE_P(XdsTest, LdsV2Test,
- ::testing::Values(TestType().set_use_v2()),
- &TestTypeName);
-
-// LDS/RDS commmon tests depend on XdsResolver.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, LdsRdsTest,
- ::testing::Values(TestType(), TestType().set_enable_rds_testing(),
- // Also test with xDS v2.
- TestType().set_enable_rds_testing().set_use_v2()),
- &TestTypeName);
-
-// CDS depends on XdsResolver.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, CdsTest,
- ::testing::Values(TestType(), TestType().set_enable_load_reporting()),
- &TestTypeName);
-
-// CDS depends on XdsResolver.
-// Security depends on v3.
-// Not enabling load reporting or RDS, since those are irrelevant to these
-// tests.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, XdsSecurityTest,
- ::testing::Values(TestType().set_use_xds_credentials()), &TestTypeName);
-
-// We are only testing the server here.
-INSTANTIATE_TEST_SUITE_P(XdsTest, XdsEnabledServerTest,
- ::testing::Values(TestType()), &TestTypeName);
-
-// We are only testing the server here.
-INSTANTIATE_TEST_SUITE_P(XdsTest, XdsServerSecurityTest,
- ::testing::Values(TestType()
- .set_use_fake_resolver()
- .set_use_xds_credentials()),
- &TestTypeName);
-
-// We are only testing the server here.
-INSTANTIATE_TEST_SUITE_P(XdsTest, XdsEnabledServerStatusNotificationTest,
- ::testing::Values(TestType()
- .set_use_fake_resolver()
- .set_use_xds_credentials()),
- &TestTypeName);
-
-// We are only testing the server here.
-INSTANTIATE_TEST_SUITE_P(XdsTest, XdsServerFilterChainMatchTest,
- ::testing::Values(TestType()
- .set_use_fake_resolver()
- .set_use_xds_credentials()),
- &TestTypeName);
-
-// EDS could be tested with or without XdsResolver, but the tests would
-// be the same either way, so we test it only with XdsResolver.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, EdsTest,
- ::testing::Values(TestType(), TestType().set_enable_load_reporting()),
- &TestTypeName);
-
-// Test initial resource timeouts for each resource type.
-// Do this only for XdsResolver with RDS enabled, so that we can test
-// all resource types.
-// Run with V3 only, since the functionality is no different in V2.
-INSTANTIATE_TEST_SUITE_P(XdsTest, TimeoutTest,
- ::testing::Values(TestType().set_enable_rds_testing()),
- &TestTypeName);
-
-// XdsResolverOnlyTest depends on XdsResolver.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, XdsResolverOnlyTest,
- ::testing::Values(TestType(), TestType().set_enable_load_reporting()),
- &TestTypeName);
-
-// XdsResolverLoadReprtingOnlyTest depends on XdsResolver and load reporting.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, XdsResolverLoadReportingOnlyTest,
- ::testing::Values(TestType().set_enable_load_reporting()), &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, LocalityMapTest,
- ::testing::Values(
- TestType(), TestType().set_enable_load_reporting(),
- TestType().set_use_fake_resolver(),
- TestType().set_use_fake_resolver().set_enable_load_reporting()),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, FailoverTest,
- ::testing::Values(
- TestType(), TestType().set_enable_load_reporting(),
- TestType().set_use_fake_resolver(),
- TestType().set_use_fake_resolver().set_enable_load_reporting()),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, DropTest,
- ::testing::Values(
- TestType(), TestType().set_enable_load_reporting(),
- TestType().set_use_fake_resolver(),
- TestType().set_use_fake_resolver().set_enable_load_reporting()),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, BalancerUpdateTest,
- ::testing::Values(
- TestType().set_use_fake_resolver(),
- TestType().set_use_fake_resolver().set_enable_load_reporting(),
- TestType().set_enable_load_reporting()),
- &TestTypeName);
-
-// Load reporting tests are not run with load reporting disabled.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, ClientLoadReportingTest,
- ::testing::Values(
- TestType().set_enable_load_reporting(),
- TestType().set_enable_load_reporting().set_use_fake_resolver()),
- &TestTypeName);
-
-// Load reporting tests are not run with load reporting disabled.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, ClientLoadReportingWithDropTest,
- ::testing::Values(
- TestType().set_enable_load_reporting(),
- TestType().set_enable_load_reporting().set_use_fake_resolver()),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, FaultInjectionTest,
- ::testing::Values(
- TestType(), TestType().set_enable_rds_testing(),
- TestType().set_filter_config_setup(
- TestType::FilterConfigSetup::kRouteOverride),
- TestType().set_enable_rds_testing().set_filter_config_setup(
- TestType::FilterConfigSetup::kRouteOverride)),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(XdsTest, BootstrapContentsFromEnvVarTest,
- ::testing::Values(TestType()), &TestTypeName);
-
-#ifndef DISABLED_XDS_PROTO_IN_CC
-// Run CSDS tests with RDS enabled and disabled.
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, ClientStatusDiscoveryServiceTest,
- ::testing::Values(
- TestType(), TestType().set_enable_rds_testing(),
- TestType().set_use_csds_streaming(),
- TestType().set_enable_rds_testing().set_use_csds_streaming()),
- &TestTypeName);
-
-INSTANTIATE_TEST_SUITE_P(
- XdsTest, CsdsShortAdsTimeoutTest,
- ::testing::Values(
- TestType(), TestType().set_enable_rds_testing(),
- TestType().set_use_csds_streaming(),
- TestType().set_enable_rds_testing().set_use_csds_streaming()),
- &TestTypeName);
-#endif // DISABLED_XDS_PROTO_IN_CC
-
-} // namespace
-} // namespace testing
-} // namespace grpc
-
-int main(int argc, char** argv) {
- grpc::testing::TestEnvironment env(argc, argv);
- ::testing::InitGoogleTest(&argc, argv);
- grpc::testing::WriteBootstrapFiles();
- // Make the backup poller poll very frequently in order to pick up
- // updates from all the subchannels's FDs.
- GPR_GLOBAL_CONFIG_SET(grpc_client_channel_backup_poll_interval_ms, 1);
-#if TARGET_OS_IPHONE
- // Workaround Apple CFStream bug
- gpr_setenv("grpc_cfstream", "0");
-#endif
- grpc_core::CertificateProviderRegistry::RegisterCertificateProviderFactory(
- y_absl::make_unique<grpc::testing::FakeCertificateProviderFactory>(
- "fake1", &grpc::testing::g_fake1_cert_data_map));
- grpc_core::CertificateProviderRegistry::RegisterCertificateProviderFactory(
- y_absl::make_unique<grpc::testing::FakeCertificateProviderFactory>(
- "fake2", &grpc::testing::g_fake2_cert_data_map));
- grpc_init();
- grpc_core::XdsHttpFilterRegistry::RegisterFilter(
- y_absl::make_unique<grpc::testing::NoOpHttpFilter>(
- "grpc.testing.client_only_http_filter", true, false),
- {"grpc.testing.client_only_http_filter"});
- grpc_core::XdsHttpFilterRegistry::RegisterFilter(
- y_absl::make_unique<grpc::testing::NoOpHttpFilter>(
- "grpc.testing.server_only_http_filter", false, true),
- {"grpc.testing.server_only_http_filter"});
- const auto result = RUN_ALL_TESTS();
- grpc_shutdown();
- return result;
-}
diff --git a/contrib/libs/grpc/test/cpp/util/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/test/cpp/util/.yandex_meta/licenses.list.txt
index d2dadabed9e..c498b515e10 100644
--- a/contrib/libs/grpc/test/cpp/util/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/test/cpp/util/.yandex_meta/licenses.list.txt
@@ -12,6 +12,20 @@
* limitations under the License.
+====================Apache-2.0====================
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
====================COPYRIGHT====================
* Copyright 2015 gRPC authors.
@@ -30,3 +44,7 @@
====================COPYRIGHT====================
* Copyright 2018 gRPC authors.
+
+
+====================COPYRIGHT====================
+// Copyright 2021 gRPC authors.
diff --git a/contrib/libs/grpc/test/cpp/util/byte_buffer_test.cc b/contrib/libs/grpc/test/cpp/util/byte_buffer_test.cc
index c63f351a8f0..ab18b5ecc6b 100644
--- a/contrib/libs/grpc/test/cpp/util/byte_buffer_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/byte_buffer_test.cc
@@ -16,16 +16,16 @@
*
*/
-#include <grpc++/support/byte_buffer.h>
-#include <grpcpp/impl/grpc_library.h>
-
#include <cstring>
#include <vector>
+#include <gtest/gtest.h>
+
+#include <grpc++/support/byte_buffer.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
+#include <grpcpp/impl/grpc_library.h>
#include <grpcpp/support/slice.h>
-#include <gtest/gtest.h>
#include "test/core/util/test_config.h"
@@ -123,6 +123,35 @@ TEST_F(ByteBufferTest, SerializationMakesCopy) {
EXPECT_TRUE(send_buffer.Valid());
}
+TEST_F(ByteBufferTest, TrySingleSliceWithSingleSlice) {
+ std::vector<Slice> slices;
+ slices.emplace_back(kContent1);
+ ByteBuffer buffer(&slices[0], 1);
+ Slice slice;
+ EXPECT_TRUE(buffer.TrySingleSlice(&slice).ok());
+ EXPECT_EQ(slice.size(), slices[0].size());
+ EXPECT_EQ(memcmp(slice.begin(), slices[0].begin(), slice.size()), 0);
+}
+
+TEST_F(ByteBufferTest, TrySingleSliceWithMultipleSlices) {
+ std::vector<Slice> slices;
+ slices.emplace_back(kContent1);
+ slices.emplace_back(kContent2);
+ ByteBuffer buffer(&slices[0], 2);
+ Slice slice;
+ EXPECT_FALSE(buffer.TrySingleSlice(&slice).ok());
+}
+
+TEST_F(ByteBufferTest, DumpToSingleSlice) {
+ std::vector<Slice> slices;
+ slices.emplace_back(kContent1);
+ slices.emplace_back(kContent2);
+ ByteBuffer buffer(&slices[0], 2);
+ Slice slice;
+ EXPECT_TRUE(buffer.DumpToSingleSlice(&slice).ok());
+ EXPECT_EQ(strlen(kContent1) + strlen(kContent2), slice.size());
+}
+
} // namespace
} // namespace grpc
diff --git a/contrib/libs/grpc/test/cpp/util/channel_trace_proto_helper.cc b/contrib/libs/grpc/test/cpp/util/channel_trace_proto_helper.cc
index d4b4026774a..672e5c65447 100644
--- a/contrib/libs/grpc/test/cpp/util/channel_trace_proto_helper.cc
+++ b/contrib/libs/grpc/test/cpp/util/channel_trace_proto_helper.cc
@@ -20,11 +20,12 @@
#include "test/cpp/util/channel_trace_proto_helper.h"
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/config.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
-#include <gtest/gtest.h>
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/json/json.h"
@@ -58,10 +59,10 @@ void VaidateProtoJsonTranslation(const TString& json_str) {
EXPECT_TRUE(s.ok());
// Parse JSON and re-dump to string, to make sure formatting is the
// same as what would be generated by our JSON library.
- grpc_error* error = GRPC_ERROR_NONE;
+ grpc_error_handle error = GRPC_ERROR_NONE;
grpc_core::Json parsed_json =
grpc_core::Json::Parse(proto_json_str.c_str(), &error);
- ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_string(error);
+ ASSERT_EQ(error, GRPC_ERROR_NONE) << grpc_error_std_string(error);
ASSERT_EQ(parsed_json.type(), grpc_core::Json::Type::OBJECT);
proto_json_str = parsed_json.Dump();
// uncomment these to compare the json strings.
diff --git a/contrib/libs/grpc/test/cpp/util/channelz_sampler.cc b/contrib/libs/grpc/test/cpp/util/channelz_sampler.cc
index 3761fe73fc8..65d6a18a070 100644
--- a/contrib/libs/grpc/test/cpp/util/channelz_sampler.cc
+++ b/contrib/libs/grpc/test/cpp/util/channelz_sampler.cc
@@ -15,6 +15,8 @@
* limitations under the License.
*
*/
+#include <grpc/support/port_platform.h>
+
#include <unistd.h>
#include <cstdlib>
@@ -29,18 +31,19 @@
#include "y_absl/strings/str_format.h"
#include "y_absl/strings/str_join.h"
#include "google/protobuf/text_format.h"
-#include "grpc/grpc.h"
-#include "grpc/support/port_platform.h"
-#include "grpcpp/channel.h"
-#include "grpcpp/client_context.h"
-#include "grpcpp/create_channel.h"
-#include "grpcpp/ext/channelz_service_plugin.h"
-#include "grpcpp/grpcpp.h"
-#include "grpcpp/security/credentials.h"
-#include "grpcpp/security/server_credentials.h"
-#include "grpcpp/server.h"
-#include "grpcpp/server_builder.h"
-#include "grpcpp/server_context.h"
+
+#include <grpc/grpc.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/client_context.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/ext/channelz_service_plugin.h>
+#include <grpcpp/grpcpp.h>
+#include <grpcpp/security/credentials.h>
+#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/server_context.h>
+
#include "src/core/lib/json/json.h"
#include "src/cpp/server/channelz/channelz_service.h"
#include "src/proto/grpc/channelz/channelz.pb.h"
diff --git a/contrib/libs/grpc/test/cpp/util/channelz_sampler_test.cc b/contrib/libs/grpc/test/cpp/util/channelz_sampler_test.cc
index 1aa3adb3e1b..6d9f05e95c6 100644
--- a/contrib/libs/grpc/test/cpp/util/channelz_sampler_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/channelz_sampler_test.cc
@@ -15,6 +15,8 @@
* limitations under the License.
*
*/
+#include <grpc/support/port_platform.h>
+
#include <stdlib.h>
#include <unistd.h>
@@ -24,20 +26,21 @@
#include <util/generic/string.h>
#include <thread>
-#include "grpc/grpc.h"
-#include "grpc/support/alloc.h"
-#include "grpc/support/port_platform.h"
-#include "grpcpp/channel.h"
-#include "grpcpp/client_context.h"
-#include "grpcpp/create_channel.h"
-#include "grpcpp/ext/channelz_service_plugin.h"
-#include "grpcpp/grpcpp.h"
-#include "grpcpp/security/credentials.h"
-#include "grpcpp/security/server_credentials.h"
-#include "grpcpp/server.h"
-#include "grpcpp/server_builder.h"
-#include "grpcpp/server_context.h"
#include "gtest/gtest.h"
+
+#include <grpc/grpc.h>
+#include <grpc/support/alloc.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/client_context.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/ext/channelz_service_plugin.h>
+#include <grpcpp/grpcpp.h>
+#include <grpcpp/security/credentials.h>
+#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+#include <grpcpp/server_context.h>
+
#include "src/core/lib/gpr/env.h"
#include "src/cpp/server/channelz/channelz_service.h"
#include "src/proto/grpc/testing/test.grpc.pb.h"
diff --git a/contrib/libs/grpc/test/cpp/util/cli_call.cc b/contrib/libs/grpc/test/cpp/util/cli_call.cc
index ec3d2e9851c..575cc00c36f 100644
--- a/contrib/libs/grpc/test/cpp/util/cli_call.cc
+++ b/contrib/libs/grpc/test/cpp/util/cli_call.cc
@@ -18,6 +18,10 @@
#include "test/cpp/util/cli_call.h"
+#include <cmath>
+#include <iostream>
+#include <utility>
+
#include <grpc/grpc.h>
#include <grpc/slice.h>
#include <grpc/support/log.h>
@@ -25,29 +29,21 @@
#include <grpcpp/client_context.h>
#include <grpcpp/support/byte_buffer.h>
-#include <cmath>
-#include <iostream>
-#include <utility>
-
namespace grpc {
namespace testing {
namespace {
void* tag(intptr_t t) { return reinterpret_cast<void*>(t); }
} // namespace
-Status CliCall::Call(const std::shared_ptr<grpc::Channel>& channel,
- const TString& method, const TString& request,
- TString* response,
- const OutgoingMetadataContainer& metadata,
+Status CliCall::Call(const TString& request, TString* response,
IncomingMetadataContainer* server_initial_metadata,
IncomingMetadataContainer* server_trailing_metadata) {
- CliCall call(channel, method, metadata);
- call.Write(request);
- call.WritesDone();
- if (!call.Read(response, server_initial_metadata)) {
+ Write(request);
+ WritesDone();
+ if (!Read(response, server_initial_metadata)) {
fprintf(stderr, "Failed to read response.\n");
}
- return call.Finish(server_trailing_metadata);
+ return Finish(server_trailing_metadata);
}
CliCall::CliCall(const std::shared_ptr<grpc::Channel>& channel,
diff --git a/contrib/libs/grpc/test/cpp/util/cli_call.h b/contrib/libs/grpc/test/cpp/util/cli_call.h
index 79d00d99f4a..330c752f430 100644
--- a/contrib/libs/grpc/test/cpp/util/cli_call.h
+++ b/contrib/libs/grpc/test/cpp/util/cli_call.h
@@ -19,14 +19,14 @@
#ifndef GRPC_TEST_CPP_UTIL_CLI_CALL_H
#define GRPC_TEST_CPP_UTIL_CLI_CALL_H
+#include <map>
+
#include <grpcpp/channel.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/generic/generic_stub.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/string_ref.h>
-#include <map>
-
namespace grpc {
class ClientContext;
@@ -56,12 +56,9 @@ class CliCall final {
~CliCall();
// Perform an unary generic RPC.
- static Status Call(const std::shared_ptr<grpc::Channel>& channel,
- const TString& method, const TString& request,
- TString* response,
- const OutgoingMetadataContainer& metadata,
- IncomingMetadataContainer* server_initial_metadata,
- IncomingMetadataContainer* server_trailing_metadata);
+ Status Call(const TString& request, TString* response,
+ IncomingMetadataContainer* server_initial_metadata,
+ IncomingMetadataContainer* server_trailing_metadata);
// Send a generic request message in a synchronous manner. NOT thread-safe.
void Write(const TString& request);
diff --git a/contrib/libs/grpc/test/cpp/util/cli_call_test.cc b/contrib/libs/grpc/test/cpp/util/cli_call_test.cc
index 4f0544b2e53..4064899e0c7 100644
--- a/contrib/libs/grpc/test/cpp/util/cli_call_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/cli_call_test.cc
@@ -18,6 +18,8 @@
#include "test/cpp/util/cli_call.h"
+#include <gtest/gtest.h>
+
#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
@@ -25,7 +27,6 @@
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include <gtest/gtest.h>
#include "src/proto/grpc/testing/echo.grpc.pb.h"
#include "test/core/util/port.h"
@@ -108,9 +109,9 @@ TEST_F(CliCallTest, SimpleRpc) {
std::multimap<grpc::string_ref, grpc::string_ref> server_initial_metadata,
server_trailing_metadata;
client_metadata.insert(std::pair<TString, TString>("key1", "val1"));
- Status s2 = CliCall::Call(channel_, kMethod, request_bin, &response_bin,
- client_metadata, &server_initial_metadata,
- &server_trailing_metadata);
+ CliCall call(channel_, kMethod, client_metadata);
+ Status s2 = call.Call(request_bin, &response_bin, &server_initial_metadata,
+ &server_trailing_metadata);
EXPECT_TRUE(s2.ok());
EXPECT_EQ(expected_response_bin, response_bin);
diff --git a/contrib/libs/grpc/test/cpp/util/cli_credentials.cc b/contrib/libs/grpc/test/cpp/util/cli_credentials.cc
index 74c82bbe30c..0b28fe9d0ce 100644
--- a/contrib/libs/grpc/test/cpp/util/cli_credentials.cc
+++ b/contrib/libs/grpc/test/cpp/util/cli_credentials.cc
@@ -18,11 +18,12 @@
#include "test/cpp/util/cli_credentials.h"
+#include "y_absl/flags/flag.h"
+
#include <grpc/slice.h>
#include <grpc/support/log.h>
#include <grpcpp/impl/codegen/slice.h>
-#include "y_absl/flags/flag.h"
#include "src/core/lib/iomgr/load_file.h"
Y_ABSL_RETIRED_FLAG(bool, enable_ssl, false,
diff --git a/contrib/libs/grpc/test/cpp/util/create_test_channel.cc b/contrib/libs/grpc/test/cpp/util/create_test_channel.cc
index ee9ec27f749..be13bb4e554 100644
--- a/contrib/libs/grpc/test/cpp/util/create_test_channel.cc
+++ b/contrib/libs/grpc/test/cpp/util/create_test_channel.cc
@@ -18,11 +18,12 @@
#include "test/cpp/util/create_test_channel.h"
+#include "y_absl/flags/flag.h"
+
#include <grpc/support/log.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
-#include "y_absl/flags/flag.h"
#include "test/cpp/util/test_credentials_provider.h"
Y_ABSL_FLAG(TString, grpc_test_use_grpclb_with_child_policy, "",
diff --git a/contrib/libs/grpc/test/cpp/util/error_details_test.cc b/contrib/libs/grpc/test/cpp/util/error_details_test.cc
index 630ab1d98fa..9ce827038db 100644
--- a/contrib/libs/grpc/test/cpp/util/error_details_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/error_details_test.cc
@@ -16,9 +16,10 @@
*
*/
-#include <grpcpp/support/error_details.h>
#include <gtest/gtest.h>
+#include <grpcpp/support/error_details.h>
+
#include "src/proto/grpc/status/status.pb.h"
#include "src/proto/grpc/testing/echo_messages.pb.h"
#include "test/core/util/test_config.h"
diff --git a/contrib/libs/grpc/test/cpp/util/grpc_cli.cc b/contrib/libs/grpc/test/cpp/util/grpc_cli.cc
index ded3b92cbeb..9b587901bc0 100644
--- a/contrib/libs/grpc/test/cpp/util/grpc_cli.cc
+++ b/contrib/libs/grpc/test/cpp/util/grpc_cli.cc
@@ -60,13 +60,14 @@
address of the connection that each RPC is made on to stderr.
*/
-#include <grpcpp/support/config.h>
-
#include <fstream>
#include <functional>
#include <iostream>
#include "y_absl/flags/flag.h"
+
+#include <grpcpp/support/config.h>
+
#include "test/cpp/util/cli_credentials.h"
#include "test/cpp/util/grpc_tool.h"
#include "test/cpp/util/test_config.h"
diff --git a/contrib/libs/grpc/test/cpp/util/grpc_tool.cc b/contrib/libs/grpc/test/cpp/util/grpc_tool.cc
index 5cdae6b3eca..9ea30f32ede 100644
--- a/contrib/libs/grpc/test/cpp/util/grpc_tool.cc
+++ b/contrib/libs/grpc/test/cpp/util/grpc_tool.cc
@@ -16,15 +16,9 @@
*
*/
-#include "test/cpp/util/grpc_tool.h"
-
-#include <grpc/grpc.h>
#include <grpc/support/port_platform.h>
-#include <grpcpp/channel.h>
-#include <grpcpp/create_channel.h>
-#include <grpcpp/grpcpp.h>
-#include <grpcpp/security/credentials.h>
-#include <grpcpp/support/string_ref.h>
+
+#include "test/cpp/util/grpc_tool.h"
#include <cstdio>
#include <fstream>
@@ -36,6 +30,14 @@
#include "y_absl/flags/flag.h"
#include "y_absl/memory/memory.h"
+
+#include <grpc/grpc.h>
+#include <grpcpp/channel.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/grpcpp.h>
+#include <grpcpp/security/credentials.h>
+#include <grpcpp/support/string_ref.h>
+
#include "test/cpp/util/cli_call.h"
#include "test/cpp/util/proto_file_parser.h"
#include "test/cpp/util/proto_reflection_descriptor_database.h"
diff --git a/contrib/libs/grpc/test/cpp/util/grpc_tool_test.cc b/contrib/libs/grpc/test/cpp/util/grpc_tool_test.cc
index 54370727e22..e2798b8a2be 100644
--- a/contrib/libs/grpc/test/cpp/util/grpc_tool_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/grpc_tool_test.cc
@@ -18,6 +18,14 @@
#include "test/cpp/util/grpc_tool.h"
+#include <chrono>
+#include <sstream>
+
+#include <gtest/gtest.h>
+
+#include "y_absl/flags/declare.h"
+#include "y_absl/flags/flag.h"
+
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpcpp/channel.h>
@@ -27,13 +35,7 @@
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
-#include <gtest/gtest.h>
-#include <chrono>
-#include <sstream>
-
-#include "y_absl/flags/declare.h"
-#include "y_absl/flags/flag.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/load_file.h"
#include "src/proto/grpc/testing/echo.grpc.pb.h"
@@ -42,6 +44,7 @@
#include "test/core/util/test_config.h"
#include "test/cpp/util/cli_credentials.h"
#include "test/cpp/util/string_ref_helper.h"
+#include "test/cpp/util/test_config.h"
#define CA_CERT_PATH "src/core/tsi/test_creds/ca.pem"
#define SERVER_CERT_PATH "src/core/tsi/test_creds/server1.pem"
@@ -62,7 +65,8 @@ using grpc::testing::EchoResponse;
"RequestStream\n" \
"ResponseStream\n" \
"BidiStream\n" \
- "Unimplemented\n"
+ "Unimplemented\n" \
+ "UnimplementedBidi\n"
#define ECHO_TEST_SERVICE_DESCRIPTION \
"filename: src/proto/grpc/testing/echo.proto\n" \
@@ -88,6 +92,8 @@ using grpc::testing::EchoResponse;
"grpc.testing.EchoResponse) {}\n" \
" rpc Unimplemented(grpc.testing.EchoRequest) returns " \
"(grpc.testing.EchoResponse) {}\n" \
+ " rpc UnimplementedBidi(stream grpc.testing.EchoRequest) returns (stream " \
+ "grpc.testing.EchoResponse) {}\n" \
"}\n" \
"\n"
@@ -931,10 +937,11 @@ TEST_F(GrpcToolTest, CallCommandWithTimeoutDeadlineUpperBound) {
std::bind(PrintStream, &output_stream,
std::placeholders::_1)));
+ TString output = output_stream.str();
+
// Expected output: "message: "true""
// deadline not greater than timeout + current time
- EXPECT_TRUE(nullptr !=
- strstr(output_stream.str().c_str(), "message: \"true\""));
+ EXPECT_TRUE(nullptr != strstr(output.c_str(), "message: \"true\"")) << output;
ShutdownServer();
}
@@ -1342,6 +1349,6 @@ TEST_F(GrpcToolTest, ConfiguringDefaultServiceConfig) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+ GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
return RUN_ALL_TESTS();
}
diff --git a/contrib/libs/grpc/test/cpp/util/proto_reflection_descriptor_database.h b/contrib/libs/grpc/test/cpp/util/proto_reflection_descriptor_database.h
index 50e49d6741b..6b6f51de8b1 100644
--- a/contrib/libs/grpc/test/cpp/util/proto_reflection_descriptor_database.h
+++ b/contrib/libs/grpc/test/cpp/util/proto_reflection_descriptor_database.h
@@ -25,6 +25,7 @@
#include <grpcpp/grpcpp.h>
#include <grpcpp/impl/codegen/config_protobuf.h>
+
#include "src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h"
namespace grpc {
diff --git a/contrib/libs/grpc/test/cpp/util/service_describer.h b/contrib/libs/grpc/test/cpp/util/service_describer.h
index a473f03744a..a2b2a173203 100644
--- a/contrib/libs/grpc/test/cpp/util/service_describer.h
+++ b/contrib/libs/grpc/test/cpp/util/service_describer.h
@@ -20,6 +20,7 @@
#define GRPC_TEST_CPP_UTIL_SERVICE_DESCRIBER_H
#include <grpcpp/support/config.h>
+
#include "test/cpp/util/config_grpc_cli.h"
namespace grpc {
diff --git a/contrib/libs/grpc/test/cpp/util/slice_test.cc b/contrib/libs/grpc/test/cpp/util/slice_test.cc
index e6885fe4eec..c10319c5a2e 100644
--- a/contrib/libs/grpc/test/cpp/util/slice_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/slice_test.cc
@@ -16,12 +16,12 @@
*
*/
-#include <grpc++/support/slice.h>
-#include <grpcpp/impl/grpc_library.h>
+#include <gtest/gtest.h>
+#include <grpc++/support/slice.h>
#include <grpc/grpc.h>
#include <grpc/slice.h>
-#include <gtest/gtest.h>
+#include <grpcpp/impl/grpc_library.h>
#include "test/core/util/test_config.h"
@@ -124,6 +124,12 @@ TEST_F(SliceTest, Add) {
CheckSlice(spp, kContent);
}
+TEST_F(SliceTest, Sub) {
+ Slice spp("0123456789");
+ Slice sub = spp.sub(1, 9);
+ CheckSlice(sub, "12345678");
+}
+
TEST_F(SliceTest, Cslice) {
grpc_slice s = grpc_slice_from_copied_string(kContent);
Slice spp(s, Slice::STEAL_REF);
diff --git a/contrib/libs/grpc/test/cpp/util/string_ref_test.cc b/contrib/libs/grpc/test/cpp/util/string_ref_test.cc
index 8e3259b764b..1537e187e2e 100644
--- a/contrib/libs/grpc/test/cpp/util/string_ref_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/string_ref_test.cc
@@ -16,12 +16,12 @@
*
*/
-#include <grpcpp/support/string_ref.h>
-
#include <string.h>
#include <gtest/gtest.h>
+#include <grpcpp/support/string_ref.h>
+
#include "test/core/util/test_config.h"
namespace grpc {
diff --git a/contrib/libs/grpc/test/cpp/util/test_config.h b/contrib/libs/grpc/test/cpp/util/test_config.h
index 094ed44f632..fb2b257ddea 100644
--- a/contrib/libs/grpc/test/cpp/util/test_config.h
+++ b/contrib/libs/grpc/test/cpp/util/test_config.h
@@ -19,6 +19,11 @@
#ifndef GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
#define GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
+#ifndef GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
+#define GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE(style) \
+ ::testing::FLAGS_gtest_death_test_style = style
+#endif // GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
+
namespace grpc {
namespace testing {
diff --git a/contrib/libs/grpc/test/cpp/util/test_config_cc.cc b/contrib/libs/grpc/test/cpp/util/test_config_cc.cc
index 601213290c8..65b925751ec 100644
--- a/contrib/libs/grpc/test/cpp/util/test_config_cc.cc
+++ b/contrib/libs/grpc/test/cpp/util/test_config_cc.cc
@@ -19,6 +19,7 @@
#include <vector>
#include "y_absl/flags/parse.h"
+
#include "test/cpp/util/test_config.h"
namespace grpc {
diff --git a/contrib/libs/grpc/test/cpp/util/test_credentials_provider.cc b/contrib/libs/grpc/test/cpp/util/test_credentials_provider.cc
index 7e91618b3d3..6f339dd3f5e 100644
--- a/contrib/libs/grpc/test/cpp/util/test_credentials_provider.cc
+++ b/contrib/libs/grpc/test/cpp/util/test_credentials_provider.cc
@@ -19,10 +19,6 @@
#include "test/cpp/util/test_credentials_provider.h"
-#include <grpc/support/log.h>
-#include <grpc/support/sync.h>
-#include <grpcpp/security/server_credentials.h>
-
#include <cstdio>
#include <fstream>
#include <iostream>
@@ -30,6 +26,11 @@
#include <unordered_map>
#include "y_absl/flags/flag.h"
+
+#include <grpc/support/log.h>
+#include <grpc/support/sync.h>
+#include <grpcpp/security/server_credentials.h>
+
#include "test/core/end2end/data/ssl_test_data.h"
Y_ABSL_FLAG(TString, tls_cert_file, "",
diff --git a/contrib/libs/grpc/test/cpp/util/time_test.cc b/contrib/libs/grpc/test/cpp/util/time_test.cc
index a64bec7f7e3..4970f4b56b4 100644
--- a/contrib/libs/grpc/test/cpp/util/time_test.cc
+++ b/contrib/libs/grpc/test/cpp/util/time_test.cc
@@ -16,9 +16,10 @@
*
*/
+#include <gtest/gtest.h>
+
#include <grpc/support/time.h>
#include <grpcpp/support/time.h>
-#include <gtest/gtest.h>
#include "test/core/util/test_config.h"
diff --git a/contrib/libs/grpc/test/cpp/util/tls_test_utils.cc b/contrib/libs/grpc/test/cpp/util/tls_test_utils.cc
new file mode 100644
index 00000000000..6bf727c8cbe
--- /dev/null
+++ b/contrib/libs/grpc/test/cpp/util/tls_test_utils.cc
@@ -0,0 +1,99 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "test/cpp/util/tls_test_utils.h"
+
+#include <memory>
+
+#include "src/core/lib/gprpp/thd.h"
+#include "test/core/util/port.h"
+#include "test/core/util/test_config.h"
+
+using ::grpc::experimental::ExternalCertificateVerifier;
+using ::grpc::experimental::TlsCustomVerificationCheckRequest;
+
+namespace grpc {
+namespace testing {
+
+bool SyncCertificateVerifier::Verify(TlsCustomVerificationCheckRequest*,
+ std::function<void(grpc::Status)>,
+ grpc::Status* sync_status) {
+ if (!success_) {
+ *sync_status = grpc::Status(grpc::StatusCode::UNAUTHENTICATED,
+ "SyncCertificateVerifier failed");
+ } else {
+ *sync_status = grpc::Status(grpc::StatusCode::OK, "");
+ }
+ return true;
+}
+
+AsyncCertificateVerifier::AsyncCertificateVerifier(bool success)
+ : success_(success),
+ thread_("AsyncCertificateVerifierWorkerThread", WorkerThread, this) {
+ thread_.Start();
+}
+
+AsyncCertificateVerifier::~AsyncCertificateVerifier() {
+ // Tell the thread to shut down.
+ {
+ internal::MutexLock lock(&mu_);
+ queue_.push_back(Request{nullptr, nullptr, true});
+ }
+ // Wait for thread to exit.
+ thread_.Join();
+}
+
+bool AsyncCertificateVerifier::Verify(
+ TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback, grpc::Status*) {
+ internal::MutexLock lock(&mu_);
+ queue_.push_back(Request{request, std::move(callback), false});
+ return false; // Asynchronous call
+}
+
+void AsyncCertificateVerifier::WorkerThread(void* arg) {
+ auto* self = static_cast<AsyncCertificateVerifier*>(arg);
+ while (true) {
+ // Check queue for work.
+ bool got_request = false;
+ Request request;
+ {
+ internal::MutexLock lock(&self->mu_);
+ if (!self->queue_.empty()) {
+ got_request = true;
+ request = self->queue_.front();
+ self->queue_.pop_front();
+ }
+ }
+ // If nothing found in the queue, sleep for a bit and try again.
+ if (!got_request) {
+ gpr_sleep_until(grpc_timeout_milliseconds_to_deadline(100));
+ continue;
+ }
+ // If we're being told to shut down, return.
+ if (request.shutdown) return;
+ auto return_status = grpc::Status(grpc::StatusCode::OK, "");
+ // Process the request.
+ if (!self->success_) {
+ return_status = grpc::Status(grpc::StatusCode::UNAUTHENTICATED,
+ "AsyncCertificateVerifier failed");
+ }
+ request.callback(return_status);
+ }
+}
+
+} // namespace testing
+} // namespace grpc
diff --git a/contrib/libs/grpc/test/cpp/util/tls_test_utils.h b/contrib/libs/grpc/test/cpp/util/tls_test_utils.h
new file mode 100644
index 00000000000..3f8d3d5a5dc
--- /dev/null
+++ b/contrib/libs/grpc/test/cpp/util/tls_test_utils.h
@@ -0,0 +1,82 @@
+//
+// Copyright 2021 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#ifndef GRPC_TEST_CPP_UTIL_TLS_TEST_UTILS_H
+#define GRPC_TEST_CPP_UTIL_TLS_TEST_UTILS_H
+
+#include <deque>
+
+#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpcpp/security/server_credentials.h>
+
+#include "src/core/lib/gprpp/thd.h"
+
+namespace grpc {
+namespace testing {
+
+class SyncCertificateVerifier
+ : public ::grpc::experimental::ExternalCertificateVerifier {
+ public:
+ explicit SyncCertificateVerifier(bool success) : success_(success) {}
+
+ ~SyncCertificateVerifier() override {}
+
+ bool Verify(::grpc::experimental::TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) override;
+
+ void Cancel(
+ ::grpc::experimental::TlsCustomVerificationCheckRequest*) override {}
+
+ private:
+ bool success_ = false;
+};
+
+class AsyncCertificateVerifier
+ : public ::grpc::experimental::ExternalCertificateVerifier {
+ public:
+ explicit AsyncCertificateVerifier(bool success);
+
+ ~AsyncCertificateVerifier() override;
+
+ bool Verify(::grpc::experimental::TlsCustomVerificationCheckRequest* request,
+ std::function<void(grpc::Status)> callback,
+ grpc::Status* sync_status) override;
+
+ void Cancel(
+ ::grpc::experimental::TlsCustomVerificationCheckRequest*) override {}
+
+ private:
+ // A request to pass to the worker thread.
+ struct Request {
+ ::grpc::experimental::TlsCustomVerificationCheckRequest* request;
+ std::function<void(grpc::Status)> callback;
+ bool shutdown; // If true, thread will exit.
+ };
+
+ static void WorkerThread(void* arg);
+
+ bool success_ = false;
+ grpc_core::Thread thread_;
+ grpc::internal::Mutex mu_;
+ std::deque<Request> queue_ Y_ABSL_GUARDED_BY(mu_);
+};
+
+} // namespace testing
+} // namespace grpc
+
+#endif // GRPC_TEST_CPP_UTIL_TLS_TEST_UTILS_H
diff --git a/contrib/libs/grpc/third_party/ABSEIL_MANUAL.md b/contrib/libs/grpc/third_party/ABSEIL_MANUAL.md
index 0fd4181199b..911e92cc35e 100644
--- a/contrib/libs/grpc/third_party/ABSEIL_MANUAL.md
+++ b/contrib/libs/grpc/third_party/ABSEIL_MANUAL.md
@@ -19,9 +19,8 @@ because they're not going well yet on some of our test machinaries or
platforms it supports. The following is a list of targets that are NOT
ready to use.
-- `y_absl/synchronization:*`: This will be ready from the LTS version in 2021.
+- `y_absl/synchronization:*`: Blocked by b/186685878.
- `y_absl/random`: [WIP](https://github.com/grpc/grpc/pull/23346).
-- `y_absl/types:variant`: [WIP](https://github.com/grpc/grpc/pull/22961).
## Implemetation only
diff --git a/contrib/libs/grpc/third_party/README.md b/contrib/libs/grpc/third_party/README.md
index 473b5426449..19ab6d424e6 100644
--- a/contrib/libs/grpc/third_party/README.md
+++ b/contrib/libs/grpc/third_party/README.md
@@ -58,32 +58,32 @@ Updating some dependencies requires extra care.
### Updating third_party/boringssl-with-bazel
-- Update the `third_party/boringssl-with-bazel` submodule to the latest [`master-with-bazel`](https://github.com/google/boringssl/tree/master-with-bazel) branch
+- Update the `third_party/boringssl-with-bazel` submodule to the latest [`main-with-bazel`](https://github.com/google/boringssl/tree/main-with-bazel) branch
```
git submodule update --init # just to start in a clean state
cd third_party/boringssl-with-bazel
git fetch origin # fetch what's new in the boringssl repository
-git checkout origin/master-with-bazel # checkout the current state of master-with-bazel branch in the boringssl repo
-# Note the latest commit SHA on master-with-bazel-branch
+git checkout origin/main-with-bazel # checkout the current state of main-with-bazel branch in the boringssl repo
+# Note the latest commit SHA on main-with-bazel branch
cd ../.. # go back to grpc repo root
git status # will show that there are new commits in third_party/boringssl-with-bazel
git add third_party/boringssl-with-bazel # we actually want to update the changes to the submodule
-git commit -m "update submodule boringssl-with-bazel with origin/master-with-bazel" # commit
+git commit -m "update submodule boringssl-with-bazel with origin/main-with-bazel" # commit
```
-- Update boringssl dependency in `bazel/grpc_deps.bzl` to the same commit SHA as master-with-bazel branch
+- Update boringssl dependency in `bazel/grpc_deps.bzl` to the same commit SHA as main-with-bazel branch
- Update `http_archive(name = "boringssl",` section by updating the sha in `strip_prefix` and `urls` fields.
- Also, set `sha256` field to "" as the existing value is not valid. This will be added later once we know what that value is.
- Update `tools/run_tests/sanity/check_submodules.sh` with the same commit
-- Commit these changes `git commit -m "update boringssl dependency to master-with-bazel commit SHA"`
+- Commit these changes `git commit -m "update boringssl dependency to main-with-bazel commit SHA"`
- Run `tools/buildgen/generate_projects.sh` to regenerate the generated files
- Because `sha256` in `bazel/grpc_deps.bzl` was left empty, you will get a DEBUG msg like this one:
-```
-Rule 'boringssl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "SHA value"
-```
+ ```
+ Rule 'boringssl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "SHA value"
+ ```
- Commit the regenrated files `git commit -m "regenerate files"`
- Update `bazel/grpc_deps.bzl` with the SHA value shown in the above debug msg. Commit again `git commit -m "Updated sha256"`
@@ -105,3 +105,38 @@ Rule 'boringssl' indicated that a canonical reproducible form can be obtained by
### Updating third_party/protobuf
See http://go/grpc-third-party-protobuf-update-instructions (internal only)
+
+### Updating third_party/envoy-api
+
+Apart from the above steps, please perform the following two steps to generate the Python `xds-protos` package:
+
+1. Bump the version in the `tools/distrib/python/xds_protos/setup.py`;
+2. Run `tools/distrib/python/xds_protos/build_validate_upload.sh` to upload the built wheel.
+
+### Updating third_party/upb
+
+Since upb is vendored in the gRPC repo, you cannot use submodule to update it. Please follow the steps below.
+
+1. Update third_party/upb directory by running
+ `git subtree pull --squash --prefix=third_party/upb https://github.com/protocolbuffers/upb.git master`
+2. Update the dependency in `grpc_deps.bzl` to the same commit
+3. Populate the bazel download mirror by running `bazel/update_mirror.sh`
+4. Update `src/upb/gen_build_yaml.py` for newly added or removed upb files
+5. Run `tools/buildgen/generate_projects.sh` to regenerate the generated files
+6. Run `tools/codegen/core/gen_upb_api.sh` to regenerate upb files.
+ If you see breaking changes here, you may want to import upb into Google3 along with gRPC.
+
+### Updating third_party/xxhash
+
+TODO(https://github.com/Cyan4973/xxHash/issues/548): revisit LICENSE
+instructions if upstream splits library and CLI.
+
+The upstream xxhash repository contains a bunch of files that we don't want, so
+we employ a rather manual update flow to pick up just the bits we care about:
+
+```
+git remote add xxhash https://github.com/Cyan4973/xxHash.git
+git fetch xxhash
+git show xxhash/dev:xxhash.h > third_party/xxhash/xxhash.h
+git show xxhash/dev:LICENSE | sed -nE '/^-+$/q;p' > third_party/xxhash/LICENSE
+```
diff --git a/contrib/libs/grpc/third_party/address_sorting/address_sorting_posix.c b/contrib/libs/grpc/third_party/address_sorting/address_sorting_posix.c
index d0dfe124691..dd969559be5 100644
--- a/contrib/libs/grpc/third_party/address_sorting/address_sorting_posix.c
+++ b/contrib/libs/grpc/third_party/address_sorting/address_sorting_posix.c
@@ -54,6 +54,7 @@ static bool posix_source_addr_factory_get_source_addr(
address_sorting_source_addr_factory* factory,
const address_sorting_address* dest_addr,
address_sorting_address* source_addr) {
+ (void)factory;
bool source_addr_exists = false;
// Android sets SOCK_CLOEXEC. Don't set this here for portability.
int s = socket(((struct sockaddr*)dest_addr)->sa_family, SOCK_DGRAM, 0);
diff --git a/contrib/libs/grpc/third_party/upb/.yandex_meta/licenses.list.txt b/contrib/libs/grpc/third_party/upb/.yandex_meta/licenses.list.txt
index fb787bff114..5c188420127 100644
--- a/contrib/libs/grpc/third_party/upb/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/grpc/third_party/upb/.yandex_meta/licenses.list.txt
@@ -1,284 +1,52 @@
====================BSD-3-Clause====================
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Google Inc. nor the names of any other
- contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL GOOGLE INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
-IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-====================COPYRIGHT====================
-/* Copyright 2020 王一 Wang Yi <godspeed_china@yeah.net>
- This is free and unencumbered software released into the public domain. http://unlicense.org/
- See github.com/wangyi-fudan/wyhash/ LICENSE
-
-
-====================COPYRIGHT====================
-Copyright (c) 2009-2011, Google Inc.
-All rights reserved.
-
-
-====================File: AUTHORS====================
-Dropbox, Inc.
-Google Inc.
-Skyscanner Ltd.
-WeWork Companies Inc.
-
-
-====================File: LICENSE====================
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-
-====================File: third_party/address_sorting/LICENSE====================
-Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. Neither the name of the project nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-
-====================File: third_party/upb/LICENSE====================
+====================BSD-3-Clause====================
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-Copyright (c) 2009-2011, Google Inc.
-All rights reserved.
+====================BSD-3-Clause====================
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -287,14 +55,14 @@ modification, are permitted provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- * Neither the name of Google Inc. nor the names of any other
+ * Neither the name of Google LLC nor the names of any other
contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL GOOGLE INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+EVENT SHALL GOOGLE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
@@ -302,65 +70,30 @@ IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-
-====================File: third_party/upb/third_party/wyhash/LICENSE====================
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
+====================BSD-3-Clause AND BSD-3-Clause====================
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-====================Public-Domain====================
- This is free and unencumbered software released into the public domain. http://unlicense.org/
-
-
-====================Unlicense====================
- This is free and unencumbered software released into the public domain. http://unlicense.org/
-
-
-====================Unlicense====================
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
+====================COPYRIGHT====================
+Copyright (c) 2009-2021, Google LLC
+All rights reserved.
diff --git a/contrib/libs/grpc/third_party/upb/CONTRIBUTING.md b/contrib/libs/grpc/third_party/upb/CONTRIBUTING.md
index 2f866b4e291..df48bf6325e 100644
--- a/contrib/libs/grpc/third_party/upb/CONTRIBUTING.md
+++ b/contrib/libs/grpc/third_party/upb/CONTRIBUTING.md
@@ -1,7 +1,37 @@
-## <a name="cla"></a> Signing the CLA
-Please sign the [Google Contributor License Agreement
-(CLA)](https://cla.developers.google.com/)
-before sending pull requests. For any code changes to be
-accepted, the CLA must be signed. It's a quick process, I
-promise!
+# How to Contribute
+
+We'd love to accept your patches and contributions to this project. There are
+just a few small guidelines you need to follow.
+
+## Get in touch
+
+If your idea will take you more than, say, 30 minutes to
+implement, please get in touch first via the issue tracker
+to touch base about your plan. That will give an
+opportunity for early feedback and help avoid wasting your
+time.
+
+## Contributor License Agreement
+
+Contributions to this project must be accompanied by a Contributor License
+Agreement. You (or your employer) retain the copyright to your contribution;
+this simply gives us permission to use and redistribute your contributions as
+part of the project. Head over to <https://cla.developers.google.com/> to see
+your current agreements on file or to sign a new one.
+
+You generally only need to submit a CLA once, so if you've already submitted one
+(even if it was for a different project), you probably don't need to do it
+again.
+
+## Code Reviews
+
+All submissions, including submissions by project members, require review. We
+use GitHub pull requests for this purpose. Consult
+[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
+information on using pull requests.
+
+## Community Guidelines
+
+This project follows [Google's Open Source Community
+Guidelines](https://opensource.google/conduct/).
diff --git a/contrib/libs/grpc/third_party/upb/DESIGN.md b/contrib/libs/grpc/third_party/upb/DESIGN.md
index a7a8a284516..73388d037ad 100644
--- a/contrib/libs/grpc/third_party/upb/DESIGN.md
+++ b/contrib/libs/grpc/third_party/upb/DESIGN.md
@@ -1,72 +1,201 @@
-μpb Design
-----------
-
-μpb has the following design goals:
-
-- C89 compatible.
-- small code size (both for the core library and generated messages).
-- fast performance (hundreds of MB/s).
-- idiomatic for C programs.
-- easy to wrap in high-level languages (Python, Ruby, Lua, etc) with
- good performance and all standard protobuf features.
-- hands-off about memory management, allowing for easy integration
- with existing VMs and/or garbage collectors.
-- offers binary ABI compatibility between apps, generated messages, and
- the core library (doesn't require re-generating messages or recompiling
- your application when the core library changes).
-- provides all features that users expect from a protobuf library
- (generated messages in C, reflection, text format, etc.).
-- layered, so the core is small and doesn't require descriptors.
-- tidy about symbol references, so that any messages or features that
- aren't used by a C program can have their code GC'd by the linker.
-- possible to use protobuf binary format without leaking message/field
- names into the binary.
-
-μpb accomplishes these goals by keeping a very small core that does not contain
-descriptors. We need some way of knowing what fields are in each message and
-where they live, but instead of descriptors, we keep a small/lightweight summary
-of the .proto file. We call this a `upb_msglayout`. It contains the bare
-minimum of what we need to know to parse and serialize protobuf binary format
-into our internal representation for messages, `upb_msg`.
-
-The core then contains functions to parse/serialize a message, given a `upb_msg*`
-and a `const upb_msglayout*`.
-
-This approach is similar to [nanopb](https://github.com/nanopb/nanopb) which
-also compiles message definitions to a compact, internal representation without
-names. However nanopb does not aim to be a fully-featured library, and has no
-support for text format, JSON, or descriptors. μpb is unique in that it has a
-small core similar to nanopb (though not quite as small), but also offers a
-full-featured protobuf library for applications that want reflection, text
-format, JSON format, etc.
-
-Without descriptors, the core doesn't have access to field names, so it cannot
-parse/serialize to protobuf text format or JSON. Instead this functionality
-lives in separate modules that depend on the module implementing descriptors.
-With the descriptor module we can parse/serialize binary descriptors and
-validate that they follow all the rules of protobuf schemas.
-
-To provide binary compatibility, we version the structs that generated messages
-use to create a `upb_msglayout*`. The current initializers are
-`upb_msglayout_msginit_v1`, `upb_msglayout_fieldinit_v1`, etc. Then
-`upb_msglayout*` uses these as its internal representation. If upb changes its
-internal representation for a `upb_msglayout*`, it will also include code to
-convert the old representation to the new representation. This will use some
-more memory/CPU at runtime to convert between the two, but apps that statically
-link μpb will never need to worry about this.
-
-TODO
-----
-
-1. revise our generated code until it is in a state where we feel comfortable
- committing to API/ABI stability for it. In particular there is an open
- question of whether non-ABI-compatible field accesses should have a
- fastpath different from the ABI-compatible field access.
-1. Add missing features (maps, extensions, unknown fields).
-1. Flesh out C++ wrappers.
-1. *(lower-priority)*: revise all of the existing encoders/decoders and
- handlers. We probably will want to keep handlers, since they let us decouple
- encoders/decoders from `upb_msg`, but we need to simplify all of that a LOT.
- Likely we will want to make handlers only per-message instead of per-field,
- except for variable-length fields.
+# upb Design
+
+upb aims to be a minimal C protobuf kernel. It has a C API, but its primary
+goal is to be the core runtime for a higher-level API.
+
+## Design goals
+
+- Full protobuf conformance
+- Small code size
+- Fast performance (without compromising code size)
+- Easy to wrap in language runtimes
+- Easy to adapt to different memory management schemes (refcounting, GC, etc)
+
+## Design parameters
+
+- C99
+- 32 or 64-bit CPU (assumes 4 or 8 byte pointers)
+- Uses pointer tagging, but avoids other implementation-defined behavior
+- Aims to never invoke undefined behavior (tests with ASAN, UBSAN, etc)
+- No global state, fully re-entrant
+
+
+## Overall Structure
+
+The upb library is divided into two main parts:
+
+- A core message representation, which supports binary format parsing
+ and serialization.
+ - `upb/upb.h`: arena allocator (`upb_arena`)
+ - `upb/msg_internal.h`: core message representation and parse tables
+ - `upb/msg.h`: accessing metadata common to all messages, like unknown fields
+ - `upb/decode.h`: binary format parsing
+ - `upb/encode.h`: binary format serialization
+ - `upb/table_internal.h`: hash table (used for maps)
+ - `upbc/protoc-gen-upbc.cc`: compiler that generates `.upb.h`/`.upb.c` APIs for
+ accessing messages without reflection.
+- A reflection add-on library that supports JSON and text format.
+ - `upb/def.h`: schema representation and loading from descriptors
+ - `upb/reflection.h`: reflective access to message data.
+ - `upb/json_encode.h`: JSON encoding
+ - `upb/json_decode.h`: JSON decoding
+ - `upb/text_encode.h`: text format encoding
+ - `upbc/protoc-gen-upbdefs.cc`: compiler that generates `.upbdefs.h`/`.upbdefs.c`
+ APIs for loading reflection.
+
+## Core Message Representation
+
+The representation for each message consists of:
+- One pointer (`upb_msg_internaldata*`) for unknown fields and extensions. This
+ pointer is `NULL` when no unknown fields or extensions are present.
+- Hasbits for any optional/required fields.
+- Case integers for each oneof.
+- Data for each field.
+
+For example, a layout for a message with two `optional int32` fields would end
+up looking something like this:
+
+```c
+// For illustration only, upb does not actually generate structs.
+typedef struct {
+ upb_msg_internaldata* internal; // Unknown fields and extensions.
+ uint32_t hasbits; // We are only using two hasbits.
+ int32_t field1;
+ int32_t field2;
+} package_name_MessageName;
+```
+
+Note in particular that messages do *not* have:
+- A pointer to reflection or a parse table (upb messages are not self-describing).
+- A pointer to an arena (the arena must be expicitly passed into any function that
+ allocates).
+
+The upb compiler computes a layout for each message, and determines the offset for
+each field using normal alignment rules (each data member must be aligned to a
+multiple of its size). This layout is then embedded into the generated `.upb.h`
+and `.upb.c` headers in two different forms. First as inline accessors that expect
+the data at a given offset:
+
+```c
+// Example of a generated accessor, from foo.upb.h
+UPB_INLINE int32_t package_name_MessageName_field1(
+ const upb_test_MessageName *msg) {
+ return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
+}
+```
+
+Secondly, the layout is emitted as a table which is used by the parser and serializer.
+We call these tables "mini-tables" to distinguish them from the larger and more
+optimized "fast tables" used in `upb/decode_fast.c` (an experimental parser that is
+2-3x the speed of the main parser, though the main parser is already quite fast).
+
+```c
+// Definition of mini-table structure, from upb/msg_internal.h
+typedef struct {
+ uint32_t number;
+ uint16_t offset;
+ int16_t presence; /* If >0, hasbit_index. If <0, ~oneof_index. */
+ uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
+ uint8_t descriptortype;
+ int8_t mode; /* upb_fieldmode, with flags from upb_labelflags */
+} upb_msglayout_field;
+
+typedef enum {
+ _UPB_MODE_MAP = 0,
+ _UPB_MODE_ARRAY = 1,
+ _UPB_MODE_SCALAR = 2,
+} upb_fieldmode;
+
+typedef struct {
+ const struct upb_msglayout *const* submsgs;
+ const upb_msglayout_field *fields;
+ uint16_t size;
+ uint16_t field_count;
+ bool extendable;
+ uint8_t dense_below;
+ uint8_t table_mask;
+} upb_msglayout;
+
+// Example of a generated mini-table, from foo.upb.c
+static const upb_msglayout_field upb_test_MessageName__fields[2] = {
+ {1, UPB_SIZE(4, 4), 1, 0, 5, _UPB_MODE_SCALAR},
+ {2, UPB_SIZE(8, 8), 2, 0, 5, _UPB_MODE_SCALAR},
+};
+
+const upb_msglayout upb_test_MessageName_msginit = {
+ NULL,
+ &upb_test_MessageName__fields[0],
+ UPB_SIZE(16, 16), 2, false, 2, 255,
+};
+```
+
+The upb compiler computes separate layouts for 32 and 64 bit modes, since the
+pointer size will be 4 or 8 bytes respectively. The upb compiler embeds both
+sizes into the source code, using a `UPB_SIZE(size32, size64)` macro that can
+choose the appropriate size at build time based on the size of `UINTPTR_MAX`.
+
+Note that `.upb.c` files contain data tables only. There is no "generated code"
+except for the inline accessors in the `.upb.h` files: the entire footprint
+of `.upb.c` files is in `.rodata`, none in `.text` or `.data`.
+
+## Memory Management Model
+
+All memory management in upb is built around arenas. A message is never
+considered to "own" the strings or sub-messages contained within it. Instead a
+message and all of its sub-messages/strings/etc. are all owned by an arena and
+are freed when the arena is freed. An entire message tree will probably be
+owned by a single arena, but this is not required or enforced. As far as upb is
+concerned, it is up to the client how to partition its arenas. upb only requires
+that when you ask it to serialize a message, that all reachable messages are
+still alive.
+
+The arena supports both a user-supplied initial block and a custom allocation
+callback, so there is a lot of flexibility in memory allocation strategy. The
+allocation callback can even be `NULL` for heap-free operation. The main
+constraint of the arena is that all of the memory in each arena must be freed
+together.
+
+`upb_arena` supports a novel operation called "fuse". When two arenas are fused
+together, their lifetimes are irreversibly joined, such that none of the arena
+blocks in either arena will be freed until *both* arenas are freed with
+`upb_arena_free()`. This is useful when joining two messages from separate
+arenas (making one a sub-message of the other). Fuse is an a very cheap
+operation, and an unlimited number of arenas can be fused together efficiently.
+
+## Reflection and Descriptors
+
+upb offers a fully-featured reflection library. There are two main ways of
+using reflection:
+
+1. You can load descriptors from strings using `upb_symtab_addfile()`.
+ The upb runtime will dynamically create mini-tables like what the upb compiler
+ would have created if you had compiled this type into a `.upb.c` file.
+2. You can load descriptors using generated `.upbdefs.h` interfaces.
+ This will load reflection that references the corresponding `.upb.c`
+ mini-tables instead of building a new mini-table on the fly. This lets
+ you reflect on generated types that are linked into your program.
+
+upb's design for descriptors is similar to protobuf C++ in many ways, with
+the following correspondences:
+
+| C++ Type | upb type |
+| ---------| ---------|
+| `google::protobuf::DescriptorPool` | `upb_symtab`
+| `google::protobuf::Descriptor` | `upb_msgdef`
+| `google::protobuf::FieldDescriptor` | `upb_fielddef`
+| `google::protobuf::OneofDescriptor` | `upb_oneofdef`
+| `google::protobuf::EnumDescriptor` | `upb_enumdef`
+| `google::protobuf::FileDescriptor` | `upb_filedef`
+| `google::protobuf::ServiceDescriptor` | `upb_servicedef`
+| `google::protobuf::MethodDescriptor` | `upb_methoddef`
+
+Like in C++ descriptors (defs) are created by loading a
+`google_protobuf_FileDescriptorProto` into a `upb_symtab`. This creates and
+links all of the def objects corresponding to that `.proto` file, and inserts
+the names into a symbol table so they can be looked up by name.
+
+Once you have loaded some descriptors into a `upb_symtab`, you can create and
+manipulate messages using the interfaces defined in `upb/reflection.h`. If your
+descriptors are linked to your generated layouts using option (2) above, you can
+safely access the same messages using both reflection and generated interfaces.
diff --git a/contrib/libs/grpc/third_party/upb/LICENSE b/contrib/libs/grpc/third_party/upb/LICENSE
index da939845db6..7f3bd16837e 100644
--- a/contrib/libs/grpc/third_party/upb/LICENSE
+++ b/contrib/libs/grpc/third_party/upb/LICENSE
@@ -1,5 +1,5 @@
-Copyright (c) 2009-2011, Google Inc.
+Copyright (c) 2009-2021, Google LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -10,14 +10,14 @@ modification, are permitted provided that the following conditions are met:
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- * Neither the name of Google Inc. nor the names of any other
+ * Neither the name of Google LLC nor the names of any other
contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-EVENT SHALL GOOGLE INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+EVENT SHALL GOOGLE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
diff --git a/contrib/libs/grpc/third_party/upb/README.md b/contrib/libs/grpc/third_party/upb/README.md
index a08aa0e9092..92a081bbefa 100644
--- a/contrib/libs/grpc/third_party/upb/README.md
+++ b/contrib/libs/grpc/third_party/upb/README.md
@@ -1,134 +1,62 @@
-# μpb - a small protobuf implementation in C
-
-|Platform|Build Status|
-|--------|------------|
-|macOS|[![Build Status](https://storage.googleapis.com/upb-kokoro-results/status-badge/macos.png)](https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Aupb%2Fmacos%2Fcontinuous)|
-|ubuntu|[![Build Status](https://storage.googleapis.com/upb-kokoro-results/status-badge/ubuntu.png)](https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Aupb%2Fubuntu%2Fcontinuous)|
-
-μpb (often written 'upb') is a small protobuf implementation written in C.
-
-upb generates a C API for creating, parsing, and serializing messages
-as declared in `.proto` files. upb is heavily arena-based: all
-messages always live in an arena (note: the arena can live in stack or
-static memory if desired). Here is a simple example:
-
-```c
-#include "conformance/conformance.upb.h"
-
-void foo(const char* data, size_t size) {
- upb_arena *arena;
-
- /* Generated message type. */
- conformance_ConformanceRequest *request;
- conformance_ConformanceResponse *response;
-
- arena = upb_arena_new();
- request = conformance_ConformanceRequest_parse(data, size, arena);
- response = conformance_ConformanceResponse_new(arena);
-
- switch (conformance_ConformanceRequest_payload_case(request)) {
- case conformance_ConformanceRequest_payload_protobuf_payload: {
- upb_strview payload = conformance_ConformanceRequest_protobuf_payload(request);
- // ...
- break;
- }
-
- case conformance_ConformanceRequest_payload_NOT_SET:
- fprintf(stderr, "conformance_upb: Request didn't have payload.\n");
- break;
-
- default: {
- static const char msg[] = "Unsupported input format.";
- conformance_ConformanceResponse_set_skipped(
- response, upb_strview_make(msg, sizeof(msg)));
- break;
- }
- }
-
- /* Frees all messages on the arena. */
- upb_arena_free(arena);
-}
-```
+# μpb: small, fast C protos
-API and ABI are both subject to change! Please do not distribute
-as a shared library for this reason (for now at least).
+μpb (often written 'upb') is a small
+[protobuf](https://github.com/protocolbuffers/protobuf) implementation written
+in C.
-## Using upb in your project
+upb is the core runtime for protobuf languages extensions in
+[Ruby](https://github.com/protocolbuffers/protobuf/tree/master/ruby),
+[PHP](https://github.com/protocolbuffers/protobuf/tree/master/php), and (soon)
+Python.
-Currently only Bazel is supported (CMake support is partial and incomplete
-but full CMake support is an eventual goal).
+While upb offers a C API, the C API & ABI **are not stable**. For this reason,
+upb is not generally offered as a C library for direct consumption, and there
+are no releases.
-To use upb in your Bazel project, first add upb to your `WORKSPACE` file,
-either as a `git_repository()` or as a `new_local_repository()` with a
-Git Submodule. (For an example, see `examples/bazel/ in this repo).
+## Features
-```python
-# Add this to your WORKSPACE file.
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+upb has comparable speed to protobuf C++, but is an order of magnitude smaller
+in code size.
-git_repository(
- name = "upb",
- remote = "https://github.com/protocolbuffers/upb.git",
- commit = "d16bf99ac4658793748cda3251226059892b3b7b",
-)
+Like the main protobuf implementation in C++, it supports:
-load("@upb//bazel:workspace_deps.bzl", "upb_deps")
+- a generated API (in C)
+- reflection
+- binary & JSON wire formats
+- text format serialization
+- all standard features of protobufs (oneofs, maps, unknown fields, extensions,
+ etc.)
+- full conformance with the protobuf conformance tests
-upb_deps()
-```
+upb also supports some features that C++ does not:
-Then in your BUILD file you can add `upb_proto_library()` rules that
-generate code for a corresponding `proto_library()` rule. For
-example:
-
-```python
-# Add this to your BUILD file.
-load("@upb//bazel:upb_proto_library.bzl", "upb_proto_library")
-
-proto_library(
- name = "foo_proto",
- srcs = ["foo.proto"],
-)
-
-upb_proto_library(
- name = "foo_upbproto",
- deps = [":foo_proto"],
-)
-
-cc_binary(
- name = "test_binary",
- srcs = ["test_binary.c"],
- deps = [":foo_upbproto"],
-)
-```
+- **optional reflection:** generated messages are agnostic to whether
+ reflection will be linked in or not.
+- **no global state:** no pre-main registration or other global state.
+- **fast reflection-based parsing:** messages loaded at runtime parse
+ just as fast as compiled-in messages.
-Then in your `.c` file you can #include the generated header:
+However there are a few features it does not support:
-```c
-#include "foo.upb.h"
+- text format parsing
+- deep descriptor verification: upb's descriptor validation is not as exhaustive
+ as `protoc`.
-/* Insert code that uses generated types. */
-```
+## Install
-## Old "handlers" interfaces
+For Ruby, use [RubyGems](https://rubygems.org/gems/google-protobuf):
-This library contains several semi-deprecated interfaces (see BUILD
-file for more info about which interfaces are deprecated). These
-deprecated interfaces are still used in some significant projects,
-such as the Ruby and PHP C bindings for protobuf in the [main protobuf
-repo](https://github.com/protocolbuffers/protobuf). The goal is to
-migrate the Ruby/PHP bindings to use the newer, simpler interfaces
-instead. Please do not use the old interfaces in new code.
+```
+$ gem install google-protobuf
+```
-## Lua bindings
+For PHP, use [PECL](https://pecl.php.net/package/protobuf):
-This repo has some Lua bindings for the core library. These are
-experimental and very incomplete. These are currently included in
-order to validate that the C API is suitable for wrapping. As the
-project matures these Lua bindings may become publicly available.
+```
+$ sudo pecl install protobuf
+```
-## Contact
+## Contributing
-Author: Josh Haberman ([jhaberman@gmail.com](mailto:jhaberman@gmail.com),
-[haberman@google.com](mailto:haberman@google.com))
+Please see [CONTRIBUTING.md](CONTRIBUTING.md).
diff --git a/contrib/libs/grpc/third_party/upb/third_party/wyhash/LICENSE b/contrib/libs/grpc/third_party/upb/third_party/wyhash/LICENSE
deleted file mode 100644
index 471f09f4cfb..00000000000
--- a/contrib/libs/grpc/third_party/upb/third_party/wyhash/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-This is free and unencumbered software released into the public domain.
-
-Anyone is free to copy, modify, publish, use, compile, sell, or
-distribute this software, either in source code form or as a compiled
-binary, for any purpose, commercial or non-commercial, and by any
-means.
-
-In jurisdictions that recognize copyright laws, the author or authors
-of this software dedicate any and all copyright interest in the
-software to the public domain. We make this dedication for the benefit
-of the public at large and to the detriment of our heirs and
-successors. We intend this dedication to be an overt act of
-relinquishment in perpetuity of all present and future rights to this
-software under copyright law.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-For more information, please refer to <http://unlicense.org/>
-
diff --git a/contrib/libs/grpc/third_party/upb/third_party/wyhash/wyhash.h b/contrib/libs/grpc/third_party/upb/third_party/wyhash/wyhash.h
deleted file mode 100644
index 5658f02df3c..00000000000
--- a/contrib/libs/grpc/third_party/upb/third_party/wyhash/wyhash.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Copyright 2020 王一 Wang Yi <godspeed_china@yeah.net>
- This is free and unencumbered software released into the public domain. http://unlicense.org/
- See github.com/wangyi-fudan/wyhash/ LICENSE
- */
-#ifndef wyhash_final_version
-#define wyhash_final_version
-//defines that change behavior
-#ifndef WYHASH_CONDOM
-#define WYHASH_CONDOM 1 //0: read 8 bytes before and after boundaries, dangerous but fastest. 1: normal valid behavior 2: extra protection against entropy loss (probability=2^-63), aka. "blind multiplication"
-#endif
-#define WYHASH_32BIT_MUM 0 //faster on 32 bit system
-//includes
-#include <stdint.h>
-#include <string.h>
-#if defined(_MSC_VER) && defined(_M_X64)
- #include <intrin.h>
- #pragma intrinsic(_umul128)
-#endif
-#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
- #define _likely_(x) __builtin_expect(x,1)
- #define _unlikely_(x) __builtin_expect(x,0)
-#else
- #define _likely_(x) (x)
- #define _unlikely_(x) (x)
-#endif
-//mum function
-static inline uint64_t _wyrot(uint64_t x) { return (x>>32)|(x<<32); }
-static inline void _wymum(uint64_t *A, uint64_t *B){
-#if(WYHASH_32BIT_MUM)
- uint64_t hh=(*A>>32)*(*B>>32), hl=(*A>>32)*(unsigned)*B, lh=(unsigned)*A*(*B>>32), ll=(uint64_t)(unsigned)*A*(unsigned)*B;
- #if(WYHASH_CONDOM>1)
- *A^=_wyrot(hl)^hh; *B^=_wyrot(lh)^ll;
- #else
- *A=_wyrot(hl)^hh; *B=_wyrot(lh)^ll;
- #endif
-#elif defined(__SIZEOF_INT128__)
- __uint128_t r=*A; r*=*B;
- #if(WYHASH_CONDOM>1)
- *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
- #else
- *A=(uint64_t)r; *B=(uint64_t)(r>>64);
- #endif
-#elif defined(_MSC_VER) && defined(_M_X64)
- #if(WYHASH_CONDOM>1)
- uint64_t a, b;
- a=_umul128(*A,*B,&b);
- *A^=a; *B^=b;
- #else
- *A=_umul128(*A,*B,B);
- #endif
-#else
- uint64_t ha=*A>>32, hb=*B>>32, la=(uint32_t)*A, lb=(uint32_t)*B, hi, lo;
- uint64_t rh=ha*hb, rm0=ha*lb, rm1=hb*la, rl=la*lb, t=rl+(rm0<<32), c=t<rl;
- lo=t+(rm1<<32); c+=lo<t; hi=rh+(rm0>>32)+(rm1>>32)+c;
- #if(WYHASH_CONDOM>1)
- *A^=lo; *B^=hi;
- #else
- *A=lo; *B=hi;
- #endif
-#endif
-}
-static inline uint64_t _wymix(uint64_t A, uint64_t B){ _wymum(&A,&B); return A^B; }
-//read functions
-#ifndef WYHASH_LITTLE_ENDIAN
- #if defined(_WIN32) || defined(__LITTLE_ENDIAN__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
- #define WYHASH_LITTLE_ENDIAN 1
- #elif defined(__BIG_ENDIAN__) || (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
- #define WYHASH_LITTLE_ENDIAN 0
- #endif
-#endif
-#if (WYHASH_LITTLE_ENDIAN)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return v;}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return v;}
-#elif defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return __builtin_bswap64(v);}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return __builtin_bswap32(v);}
-#elif defined(_MSC_VER)
-static inline uint64_t _wyr8(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return _byteswap_uint64(v);}
-static inline uint64_t _wyr4(const uint8_t *p) { unsigned v; memcpy(&v, p, 4); return _byteswap_ulong(v);}
-#endif
-static inline uint64_t _wyr3(const uint8_t *p, unsigned k) { return (((uint64_t)p[0])<<16)|(((uint64_t)p[k>>1])<<8)|p[k-1];}
-//wyhash function
-static inline uint64_t _wyfinish16(const uint8_t *p, uint64_t len, uint64_t seed, const uint64_t *secret, uint64_t i){
-#if(WYHASH_CONDOM>0)
- uint64_t a, b;
- if(_likely_(i<=8)){
- if(_likely_(i>=4)){ a=_wyr4(p); b=_wyr4(p+i-4); }
- else if (_likely_(i)){ a=_wyr3(p,i); b=0; }
- else a=b=0;
- }
- else{ a=_wyr8(p); b=_wyr8(p+i-8); }
- return _wymix(secret[1]^len,_wymix(a^secret[1], b^seed));
-#else
- #define oneshot_shift ((i<8)*((8-i)<<3))
- return _wymix(secret[1]^len,_wymix((_wyr8(p)<<oneshot_shift)^secret[1],(_wyr8(p+i-8)>>oneshot_shift)^seed));
-#endif
-}
-
-static inline uint64_t _wyfinish(const uint8_t *p, uint64_t len, uint64_t seed, const uint64_t *secret, uint64_t i){
- if(_likely_(i<=16)) return _wyfinish16(p,len,seed,secret,i);
- return _wyfinish(p+16,len,_wymix(_wyr8(p)^secret[1],_wyr8(p+8)^seed),secret,i-16);
-}
-
-static inline uint64_t wyhash(const void *key, uint64_t len, uint64_t seed, const uint64_t *secret){
- const uint8_t *p=(const uint8_t *)key;
- uint64_t i=len; seed^=*secret;
- if(_unlikely_(i>64)){
- uint64_t see1=seed;
- do{
- seed=_wymix(_wyr8(p)^secret[1],_wyr8(p+8)^seed)^_wymix(_wyr8(p+16)^secret[2],_wyr8(p+24)^seed);
- see1=_wymix(_wyr8(p+32)^secret[3],_wyr8(p+40)^see1)^_wymix(_wyr8(p+48)^secret[4],_wyr8(p+56)^see1);
- p+=64; i-=64;
- }while(i>64);
- seed^=see1;
- }
- return _wyfinish(p,len,seed,secret,i);
-}
-//utility functions
-const uint64_t _wyp[5] = {0xa0761d6478bd642full, 0xe7037ed1a0b428dbull, 0x8ebc6af09c88c6e3ull, 0x589965cc75374cc3ull, 0x1d8e4e27c47d124full};
-static inline uint64_t wyhash64(uint64_t A, uint64_t B){ A^=_wyp[0]; B^=_wyp[1]; _wymum(&A,&B); return _wymix(A^_wyp[0],B^_wyp[1]);}
-static inline uint64_t wyrand(uint64_t *seed){ *seed+=_wyp[0]; return _wymix(*seed,*seed^_wyp[1]);}
-static inline double wy2u01(uint64_t r){ const double _wynorm=1.0/(1ull<<52); return (r>>12)*_wynorm;}
-static inline double wy2gau(uint64_t r){ const double _wynorm=1.0/(1ull<<20); return ((r&0x1fffff)+((r>>21)&0x1fffff)+((r>>42)&0x1fffff))*_wynorm-3.0;}
-static inline uint64_t wy2u0k(uint64_t r, uint64_t k){ _wymum(&r,&k); return k; }
-
-static inline void make_secret(uint64_t seed, uint64_t *secret){
- uint8_t c[] = {15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178, 180, 184, 195, 197, 198, 201, 202, 204, 209, 210, 212, 216, 225, 226, 228, 232, 240 };
- for(size_t i=0;i<5;i++){
- uint8_t ok;
- do{
- ok=1; secret[i]=0;
- for(size_t j=0;j<64;j+=8) secret[i]|=((uint64_t)c[wyrand(&seed)%sizeof(c)])<<j;
- if(secret[i]%2==0){ ok=0; continue; }
- for(size_t j=0;j<i;j++)
-#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
- if(__builtin_popcountll(secret[j]^secret[i])!=32){ ok=0; break; }
-#elif defined(_MSC_VER) && defined(_M_X64)
- if(_mm_popcnt_u64(secret[j]^secret[i])!=32){ ok=0; break; }
-#endif
- if(!ok)continue;
- for(uint64_t j=3;j<0x100000000ull;j+=2) if(secret[i]%j==0){ ok=0; break; }
- }while(!ok);
- }
-}
-#endif
diff --git a/contrib/libs/grpc/third_party/upb/upb/decode.c b/contrib/libs/grpc/third_party/upb/upb/decode.c
index a5f0666fa8b..fc074d6d52b 100644
--- a/contrib/libs/grpc/third_party/upb/upb/decode.c
+++ b/contrib/libs/grpc/third_party/upb/upb/decode.c
@@ -1,12 +1,38 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/decode.h"
#include <setjmp.h>
#include <string.h>
-#include "upb/decode.int.h"
+#include "upb/decode_internal.h"
#include "upb/upb.h"
-#include "upb/upb.int.h"
+#include "upb/upb_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
@@ -57,15 +83,23 @@ static const uint8_t desctype_to_mapsize[] = {
8, /* SINT64 */
};
-static const unsigned fixed32_ok = (1 << UPB_DTYPE_FLOAT) |
- (1 << UPB_DTYPE_FIXED32) |
- (1 << UPB_DTYPE_SFIXED32);
+static const unsigned FIXED32_OK_MASK = (1 << UPB_DTYPE_FLOAT) |
+ (1 << UPB_DTYPE_FIXED32) |
+ (1 << UPB_DTYPE_SFIXED32);
-static const unsigned fixed64_ok = (1 << UPB_DTYPE_DOUBLE) |
- (1 << UPB_DTYPE_FIXED64) |
- (1 << UPB_DTYPE_SFIXED64);
+static const unsigned FIXED64_OK_MASK = (1 << UPB_DTYPE_DOUBLE) |
+ (1 << UPB_DTYPE_FIXED64) |
+ (1 << UPB_DTYPE_SFIXED64);
+
+/* Three fake field types for MessageSet. */
+#define TYPE_MSGSET_ITEM 19
+#define TYPE_MSGSET_TYPE_ID 20
+#define TYPE_COUNT 20
/* Op: an action to be performed for a wire-type/field-type combination. */
+#define OP_UNKNOWN -1 /* Unknown field. */
+#define OP_MSGSET_ITEM -2
+#define OP_MSGSET_TYPEID -3
#define OP_SCALAR_LG2(n) (n) /* n in [0, 2, 3] => op in [0, 2, 3] */
#define OP_STRING 4
#define OP_BYTES 5
@@ -74,49 +108,53 @@ static const unsigned fixed64_ok = (1 << UPB_DTYPE_DOUBLE) |
#define OP_FIXPCK_LG2(n) (n + 5) /* n in [2, 3] => op in [7, 8] */
#define OP_VARPCK_LG2(n) (n + 9) /* n in [0, 2, 3] => op in [9, 11, 12] */
-static const int8_t varint_ops[19] = {
- -1, /* field not found */
- -1, /* DOUBLE */
- -1, /* FLOAT */
+static const int8_t varint_ops[] = {
+ OP_UNKNOWN, /* field not found */
+ OP_UNKNOWN, /* DOUBLE */
+ OP_UNKNOWN, /* FLOAT */
OP_SCALAR_LG2(3), /* INT64 */
OP_SCALAR_LG2(3), /* UINT64 */
OP_SCALAR_LG2(2), /* INT32 */
- -1, /* FIXED64 */
- -1, /* FIXED32 */
+ OP_UNKNOWN, /* FIXED64 */
+ OP_UNKNOWN, /* FIXED32 */
OP_SCALAR_LG2(0), /* BOOL */
- -1, /* STRING */
- -1, /* GROUP */
- -1, /* MESSAGE */
- -1, /* BYTES */
+ OP_UNKNOWN, /* STRING */
+ OP_UNKNOWN, /* GROUP */
+ OP_UNKNOWN, /* MESSAGE */
+ OP_UNKNOWN, /* BYTES */
OP_SCALAR_LG2(2), /* UINT32 */
OP_SCALAR_LG2(2), /* ENUM */
- -1, /* SFIXED32 */
- -1, /* SFIXED64 */
+ OP_UNKNOWN, /* SFIXED32 */
+ OP_UNKNOWN, /* SFIXED64 */
OP_SCALAR_LG2(2), /* SINT32 */
OP_SCALAR_LG2(3), /* SINT64 */
+ OP_UNKNOWN, /* MSGSET_ITEM */
+ OP_MSGSET_TYPEID, /* MSGSET TYPEID */
};
-static const int8_t delim_ops[37] = {
+static const int8_t delim_ops[] = {
/* For non-repeated field type. */
- -1, /* field not found */
- -1, /* DOUBLE */
- -1, /* FLOAT */
- -1, /* INT64 */
- -1, /* UINT64 */
- -1, /* INT32 */
- -1, /* FIXED64 */
- -1, /* FIXED32 */
- -1, /* BOOL */
- OP_STRING, /* STRING */
- -1, /* GROUP */
- OP_SUBMSG, /* MESSAGE */
- OP_BYTES, /* BYTES */
- -1, /* UINT32 */
- -1, /* ENUM */
- -1, /* SFIXED32 */
- -1, /* SFIXED64 */
- -1, /* SINT32 */
- -1, /* SINT64 */
+ OP_UNKNOWN, /* field not found */
+ OP_UNKNOWN, /* DOUBLE */
+ OP_UNKNOWN, /* FLOAT */
+ OP_UNKNOWN, /* INT64 */
+ OP_UNKNOWN, /* UINT64 */
+ OP_UNKNOWN, /* INT32 */
+ OP_UNKNOWN, /* FIXED64 */
+ OP_UNKNOWN, /* FIXED32 */
+ OP_UNKNOWN, /* BOOL */
+ OP_STRING, /* STRING */
+ OP_UNKNOWN, /* GROUP */
+ OP_SUBMSG, /* MESSAGE */
+ OP_BYTES, /* BYTES */
+ OP_UNKNOWN, /* UINT32 */
+ OP_UNKNOWN, /* ENUM */
+ OP_UNKNOWN, /* SFIXED32 */
+ OP_UNKNOWN, /* SFIXED64 */
+ OP_UNKNOWN, /* SINT32 */
+ OP_UNKNOWN, /* SINT64 */
+ OP_UNKNOWN, /* MSGSET_ITEM */
+ OP_UNKNOWN, /* MSGSET TYPEID */
/* For repeated field type. */
OP_FIXPCK_LG2(3), /* REPEATED DOUBLE */
OP_FIXPCK_LG2(2), /* REPEATED FLOAT */
@@ -136,6 +174,7 @@ static const int8_t delim_ops[37] = {
OP_FIXPCK_LG2(3), /* REPEATED SFIXED64 */
OP_VARPCK_LG2(2), /* REPEATED SINT32 */
OP_VARPCK_LG2(3), /* REPEATED SINT64 */
+ /* Omitting MSGSET_*, because we never emit a repeated msgset type */
};
typedef union {
@@ -148,13 +187,27 @@ typedef union {
static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout);
-UPB_NORETURN static void decode_err(upb_decstate *d) { UPB_LONGJMP(d->err, 1); }
+UPB_NORETURN static const char *decode_err(upb_decstate *d) {
+ UPB_LONGJMP(d->err, 1);
+}
+
+// We don't want to mark this NORETURN, see comment in .h.
+// Unfortunately this code to suppress the warning doesn't appear to be working.
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#pragma clang diagnostic ignored "-Wsuggest-attribute"
+#endif
const char *fastdecode_err(upb_decstate *d) {
longjmp(d->err, 1);
return NULL;
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
const uint8_t upb_utf8_offsets[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -212,7 +265,7 @@ static const char *decode_varint64(upb_decstate *d, const char *ptr,
return ptr + 1;
} else {
decode_vret res = decode_longvarint64(ptr, byte);
- if (!res.ptr) decode_err(d);
+ if (!res.ptr) return decode_err(d);
*val = res.val;
return res.ptr;
}
@@ -230,7 +283,7 @@ static const char *decode_tag(upb_decstate *d, const char *ptr,
decode_vret res = decode_longvarint64(ptr, byte);
ptr = res.ptr;
*val = res.val;
- if (!ptr || *val > UINT32_MAX || ptr - start > 5) decode_err(d);
+ if (!ptr || *val > UINT32_MAX || ptr - start > 5) return decode_err(d);
return ptr;
}
}
@@ -260,25 +313,9 @@ static void decode_munge(int type, wireval *val) {
}
}
-static const upb_msglayout_field *upb_find_field(const upb_msglayout *l,
- uint32_t field_number) {
- static upb_msglayout_field none = {0, 0, 0, 0, 0, 0};
-
- /* Lots of optimization opportunities here. */
- int i;
- if (l == NULL) return &none;
- for (i = 0; i < l->field_count; i++) {
- if (l->fields[i].number == field_number) {
- return &l->fields[i];
- }
- }
-
- return &none; /* Unknown field. */
-}
-
-static upb_msg *decode_newsubmsg(upb_decstate *d, const upb_msglayout *layout,
+static upb_msg *decode_newsubmsg(upb_decstate *d, const upb_msglayout_sub *subs,
const upb_msglayout_field *field) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
+ const upb_msglayout *subl = subs[field->submsg_index].submsg;
return _upb_msg_new_inl(subl, &d->arena);
}
@@ -287,7 +324,7 @@ const char *decode_isdonefallback(upb_decstate *d, const char *ptr,
int overrun) {
ptr = decode_isdonefallback_inl(d, ptr, overrun);
if (ptr == NULL) {
- decode_err(d);
+ return decode_err(d);
}
return ptr;
}
@@ -298,7 +335,7 @@ static const char *decode_readstr(upb_decstate *d, const char *ptr, int size,
str->data = ptr;
} else {
char *data = upb_arena_malloc(&d->arena, size);
- if (!data) decode_err(d);
+ if (!data) return decode_err(d);
memcpy(data, ptr, size);
str->data = data;
}
@@ -308,15 +345,16 @@ static const char *decode_readstr(upb_decstate *d, const char *ptr, int size,
UPB_FORCEINLINE
static const char *decode_tosubmsg(upb_decstate *d, const char *ptr,
- upb_msg *submsg, const upb_msglayout *layout,
+ upb_msg *submsg,
+ const upb_msglayout_sub *subs,
const upb_msglayout_field *field, int size) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
+ const upb_msglayout *subl = subs[field->submsg_index].submsg;
int saved_delta = decode_pushlimit(d, ptr, size);
- if (--d->depth < 0) decode_err(d);
+ if (--d->depth < 0) return decode_err(d);
if (!decode_isdone(d, &ptr)) {
ptr = decode_msg(d, ptr, submsg, subl);
}
- if (d->end_group != DECODE_NOGROUP) decode_err(d);
+ if (d->end_group != DECODE_NOGROUP) return decode_err(d);
decode_poplimit(d, ptr, saved_delta);
d->depth++;
return ptr;
@@ -326,12 +364,12 @@ UPB_FORCEINLINE
static const char *decode_group(upb_decstate *d, const char *ptr,
upb_msg *submsg, const upb_msglayout *subl,
uint32_t number) {
- if (--d->depth < 0) decode_err(d);
+ if (--d->depth < 0) return decode_err(d);
if (decode_isdone(d, &ptr)) {
- decode_err(d);
+ return decode_err(d);
}
ptr = decode_msg(d, ptr, submsg, subl);
- if (d->end_group != number) decode_err(d);
+ if (d->end_group != number) return decode_err(d);
d->end_group = DECODE_NOGROUP;
d->depth++;
return ptr;
@@ -339,15 +377,17 @@ static const char *decode_group(upb_decstate *d, const char *ptr,
UPB_FORCEINLINE
static const char *decode_togroup(upb_decstate *d, const char *ptr,
- upb_msg *submsg, const upb_msglayout *layout,
+ upb_msg *submsg,
+ const upb_msglayout_sub *subs,
const upb_msglayout_field *field) {
- const upb_msglayout *subl = layout->submsgs[field->submsg_index];
+ const upb_msglayout *subl = subs[field->submsg_index].submsg;
return decode_group(d, ptr, submsg, subl, field->number);
}
static const char *decode_toarray(upb_decstate *d, const char *ptr,
- upb_msg *msg, const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val,
+ upb_msg *msg,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *field, wireval *val,
int op) {
upb_array **arrp = UPB_PTR_AT(msg, field->offset, void);
upb_array *arr = *arrp;
@@ -358,7 +398,7 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
} else {
size_t lg2 = desctype_to_elem_size_lg2[field->descriptortype];
arr = _upb_array_new(&d->arena, 4, lg2);
- if (!arr) decode_err(d);
+ if (!arr) return decode_err(d);
*arrp = arr;
}
@@ -369,27 +409,27 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
/* Append scalar value. */
mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << op, void);
arr->len++;
- memcpy(mem, &val, 1 << op);
+ memcpy(mem, val, 1 << op);
return ptr;
case OP_STRING:
- decode_verifyutf8(d, ptr, val.size);
+ decode_verifyutf8(d, ptr, val->size);
/* Fallthrough. */
case OP_BYTES: {
/* Append bytes. */
upb_strview *str = (upb_strview*)_upb_array_ptr(arr) + arr->len;
arr->len++;
- return decode_readstr(d, ptr, val.size, str);
+ return decode_readstr(d, ptr, val->size, str);
}
case OP_SUBMSG: {
/* Append submessage / group. */
- upb_msg *submsg = decode_newsubmsg(d, layout, field);
+ upb_msg *submsg = decode_newsubmsg(d, subs, field);
*UPB_PTR_AT(_upb_array_ptr(arr), arr->len * sizeof(void *), upb_msg *) =
submsg;
arr->len++;
if (UPB_UNLIKELY(field->descriptortype == UPB_DTYPE_GROUP)) {
- return decode_togroup(d, ptr, submsg, layout, field);
+ return decode_togroup(d, ptr, submsg, subs, field);
} else {
- return decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
+ return decode_tosubmsg(d, ptr, submsg, subs, field, val->size);
}
}
case OP_FIXPCK_LG2(2):
@@ -397,15 +437,15 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
/* Fixed packed. */
int lg2 = op - OP_FIXPCK_LG2(0);
int mask = (1 << lg2) - 1;
- size_t count = val.size >> lg2;
- if ((val.size & mask) != 0) {
- decode_err(d); /* Length isn't a round multiple of elem size. */
+ size_t count = val->size >> lg2;
+ if ((val->size & mask) != 0) {
+ return decode_err(d); /* Length isn't a round multiple of elem size. */
}
decode_reserve(d, arr, count);
mem = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
arr->len += count;
- memcpy(mem, ptr, val.size); /* XXX: ptr boundary. */
- return ptr + val.size;
+ memcpy(mem, ptr, val->size); /* XXX: ptr boundary. */
+ return ptr + val->size;
}
case OP_VARPCK_LG2(0):
case OP_VARPCK_LG2(2):
@@ -413,7 +453,7 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
/* Varint packed. */
int lg2 = op - OP_VARPCK_LG2(0);
int scale = 1 << lg2;
- int saved_limit = decode_pushlimit(d, ptr, val.size);
+ int saved_limit = decode_pushlimit(d, ptr, val->size);
char *out = UPB_PTR_AT(_upb_array_ptr(arr), arr->len << lg2, void);
while (!decode_isdone(d, &ptr)) {
wireval elem;
@@ -435,16 +475,16 @@ static const char *decode_toarray(upb_decstate *d, const char *ptr,
}
static const char *decode_tomap(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val) {
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *field,
+ wireval *val) {
upb_map **map_p = UPB_PTR_AT(msg, field->offset, upb_map *);
upb_map *map = *map_p;
upb_map_entry ent;
- const upb_msglayout *entry = layout->submsgs[field->submsg_index];
+ const upb_msglayout *entry = subs[field->submsg_index].submsg;
if (!map) {
/* Lazily create map. */
- const upb_msglayout *entry = layout->submsgs[field->submsg_index];
const upb_msglayout_field *key_field = &entry->fields[0];
const upb_msglayout_field *val_field = &entry->fields[1];
char key_size = desctype_to_mapsize[key_field->descriptortype];
@@ -461,31 +501,31 @@ static const char *decode_tomap(upb_decstate *d, const char *ptr, upb_msg *msg,
if (entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
entry->fields[1].descriptortype == UPB_DESCRIPTOR_TYPE_GROUP) {
/* Create proactively to handle the case where it doesn't appear. */
- ent.v.val = upb_value_ptr(_upb_msg_new(entry->submsgs[0], &d->arena));
+ ent.v.val = upb_value_ptr(_upb_msg_new(entry->subs[0].submsg, &d->arena));
}
- ptr = decode_tosubmsg(d, ptr, &ent.k, layout, field, val.size);
+ ptr = decode_tosubmsg(d, ptr, &ent.k, subs, field, val->size);
_upb_map_set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena);
return ptr;
}
static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
- const upb_msglayout *layout,
- const upb_msglayout_field *field, wireval val,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *field, wireval *val,
int op) {
void *mem = UPB_PTR_AT(msg, field->offset, void);
int type = field->descriptortype;
/* Set presence if necessary. */
- if (field->presence < 0) {
+ if (field->presence > 0) {
+ _upb_sethas_field(msg, field);
+ } else if (field->presence < 0) {
/* Oneof case */
uint32_t *oneof_case = _upb_oneofcase_field(msg, field);
if (op == OP_SUBMSG && *oneof_case != field->number) {
memset(mem, 0, sizeof(void*));
}
*oneof_case = field->number;
- } else if (field->presence > 0) {
- _upb_sethas_field(msg, field);
}
/* Store into message. */
@@ -494,29 +534,29 @@ static const char *decode_tomsg(upb_decstate *d, const char *ptr, upb_msg *msg,
upb_msg **submsgp = mem;
upb_msg *submsg = *submsgp;
if (!submsg) {
- submsg = decode_newsubmsg(d, layout, field);
+ submsg = decode_newsubmsg(d, subs, field);
*submsgp = submsg;
}
if (UPB_UNLIKELY(type == UPB_DTYPE_GROUP)) {
- ptr = decode_togroup(d, ptr, submsg, layout, field);
+ ptr = decode_togroup(d, ptr, submsg, subs, field);
} else {
- ptr = decode_tosubmsg(d, ptr, submsg, layout, field, val.size);
+ ptr = decode_tosubmsg(d, ptr, submsg, subs, field, val->size);
}
break;
}
case OP_STRING:
- decode_verifyutf8(d, ptr, val.size);
+ decode_verifyutf8(d, ptr, val->size);
/* Fallthrough. */
case OP_BYTES:
- return decode_readstr(d, ptr, val.size, mem);
+ return decode_readstr(d, ptr, val->size, mem);
case OP_SCALAR_LG2(3):
- memcpy(mem, &val, 8);
+ memcpy(mem, val, 8);
break;
case OP_SCALAR_LG2(2):
- memcpy(mem, &val, 4);
+ memcpy(mem, val, 4);
break;
case OP_SCALAR_LG2(0):
- memcpy(mem, &val, 1);
+ memcpy(mem, val, 1);
break;
default:
UPB_UNREACHABLE();
@@ -539,9 +579,211 @@ static bool decode_tryfastdispatch(upb_decstate *d, const char **ptr,
return false;
}
+static const char *decode_msgset(upb_decstate *d, const char *ptr, upb_msg *msg,
+ const upb_msglayout *layout) {
+ // We create a temporary upb_msglayout here and abuse its fields as temporary
+ // storage, to avoid creating lots of MessageSet-specific parsing code-paths:
+ // 1. We store 'layout' in item_layout.subs. We will need this later as
+ // a key to look up extensions for this MessageSet.
+ // 2. We use item_layout.fields as temporary storage to store the extension we
+ // found when parsing the type id.
+ upb_msglayout item_layout = {
+ .subs = (const upb_msglayout_sub[]){{.submsg = layout}},
+ .fields = NULL,
+ .size = 0,
+ .field_count = 0,
+ .ext = _UPB_MSGEXT_MSGSET_ITEM,
+ .dense_below = 0,
+ .table_mask = -1};
+ return decode_group(d, ptr, msg, &item_layout, 1);
+}
+
+static const upb_msglayout_field *decode_findfield(upb_decstate *d,
+ const upb_msglayout *l,
+ uint32_t field_number,
+ int *last_field_index) {
+ static upb_msglayout_field none = {0, 0, 0, 0, 0, 0};
+ if (l == NULL) return &none;
+
+ size_t idx = ((size_t)field_number) - 1; // 0 wraps to SIZE_MAX
+ if (idx < l->dense_below) {
+ /* Fastest case: index into dense fields. */
+ goto found;
+ }
+
+ if (l->dense_below < l->field_count) {
+ /* Linear search non-dense fields. Resume scanning from last_field_index
+ * since fields are usually in order. */
+ int last = *last_field_index;
+ for (idx = last; idx < l->field_count; idx++) {
+ if (l->fields[idx].number == field_number) {
+ goto found;
+ }
+ }
+
+ for (idx = l->dense_below; idx < last; idx++) {
+ if (l->fields[idx].number == field_number) {
+ goto found;
+ }
+ }
+ }
+
+ if (d->extreg) {
+ switch (l->ext) {
+ case _UPB_MSGEXT_EXTENDABLE: {
+ const upb_msglayout_ext *ext =
+ _upb_extreg_get(d->extreg, l, field_number);
+ if (ext) return &ext->field;
+ break;
+ }
+ case _UPB_MSGEXT_MSGSET:
+ if (field_number == _UPB_MSGSET_ITEM) {
+ static upb_msglayout_field item = {0, 0, 0, 0, TYPE_MSGSET_ITEM, 0};
+ return &item;
+ }
+ break;
+ case _UPB_MSGEXT_MSGSET_ITEM:
+ switch (field_number) {
+ case _UPB_MSGSET_TYPEID: {
+ static upb_msglayout_field type_id = {
+ 0, 0, 0, 0, TYPE_MSGSET_TYPE_ID, 0};
+ return &type_id;
+ }
+ case _UPB_MSGSET_MESSAGE:
+ if (l->fields) {
+ // We saw type_id previously and succeeded in looking up msg.
+ return l->fields;
+ } else {
+ // TODO: out of order MessageSet.
+ // This is a very rare case: all serializers will emit in-order
+ // MessageSets. To hit this case there has to be some kind of
+ // re-ordering proxy. We should eventually handle this case, but
+ // not today.
+ }
+ break;
+ }
+ }
+ }
+
+ return &none; /* Unknown field. */
+
+ found:
+ UPB_ASSERT(l->fields[idx].number == field_number);
+ *last_field_index = idx;
+ return &l->fields[idx];
+ }
+
+UPB_FORCEINLINE
+static const char *decode_wireval(upb_decstate *d, const char *ptr,
+ const upb_msglayout_field *field,
+ int wire_type, wireval *val, int *op) {
+ switch (wire_type) {
+ case UPB_WIRE_TYPE_VARINT:
+ ptr = decode_varint64(d, ptr, &val->uint64_val);
+ *op = varint_ops[field->descriptortype];
+ decode_munge(field->descriptortype, val);
+ return ptr;
+ case UPB_WIRE_TYPE_32BIT:
+ memcpy(&val->uint32_val, ptr, 4);
+ val->uint32_val = _upb_be_swap32(val->uint32_val);
+ *op = OP_SCALAR_LG2(2);
+ if (((1 << field->descriptortype) & FIXED32_OK_MASK) == 0) {
+ *op = OP_UNKNOWN;
+ }
+ return ptr + 4;
+ case UPB_WIRE_TYPE_64BIT:
+ memcpy(&val->uint64_val, ptr, 8);
+ val->uint64_val = _upb_be_swap64(val->uint64_val);
+ *op = OP_SCALAR_LG2(3);
+ if (((1 << field->descriptortype) & FIXED64_OK_MASK) == 0) {
+ *op = OP_UNKNOWN;
+ }
+ return ptr + 8;
+ case UPB_WIRE_TYPE_DELIMITED: {
+ int ndx = field->descriptortype;
+ uint64_t size;
+ if (_upb_getmode(field) == _UPB_MODE_ARRAY) ndx += TYPE_COUNT;
+ ptr = decode_varint64(d, ptr, &size);
+ if (size >= INT32_MAX || ptr - d->end + (int32_t)size > d->limit) {
+ break; /* Length overflow. */
+ }
+ *op = delim_ops[ndx];
+ val->size = size;
+ return ptr;
+ }
+ case UPB_WIRE_TYPE_START_GROUP:
+ val->uint32_val = field->number;
+ if (field->descriptortype == UPB_DTYPE_GROUP) {
+ *op = OP_SUBMSG;
+ } else if (field->descriptortype == TYPE_MSGSET_ITEM) {
+ *op = OP_MSGSET_ITEM;
+ } else {
+ *op = OP_UNKNOWN;
+ }
+ return ptr;
+ default:
+ break;
+ }
+ return decode_err(d);
+}
+
+UPB_FORCEINLINE
+static const char *decode_known(upb_decstate *d, const char *ptr, upb_msg *msg,
+ const upb_msglayout *layout,
+ const upb_msglayout_field *field, int op,
+ wireval *val) {
+ const upb_msglayout_sub *subs = layout->subs;
+ uint8_t mode = field->mode;
+
+ if (UPB_UNLIKELY(mode & _UPB_MODE_IS_EXTENSION)) {
+ const upb_msglayout_ext *ext_layout = (const upb_msglayout_ext*)field;
+ upb_msg_ext *ext = _upb_msg_getorcreateext(msg, ext_layout, &d->arena);
+ if (UPB_UNLIKELY(!ext)) return decode_err(d);
+ msg = &ext->data;
+ subs = &ext->ext->sub;
+ }
+
+ switch (mode & _UPB_MODE_MASK) {
+ case _UPB_MODE_ARRAY:
+ return decode_toarray(d, ptr, msg, subs, field, val, op);
+ case _UPB_MODE_MAP:
+ return decode_tomap(d, ptr, msg, subs, field, val);
+ case _UPB_MODE_SCALAR:
+ return decode_tomsg(d, ptr, msg, subs, field, val, op);
+ default:
+ UPB_UNREACHABLE();
+ }
+}
+
+UPB_FORCEINLINE
+static const char *decode_unknown(upb_decstate *d, const char *ptr,
+ upb_msg *msg, int field_number, int wire_type,
+ wireval val, const char **field_start) {
+ if (field_number == 0) return decode_err(d);
+
+ if (wire_type == UPB_WIRE_TYPE_DELIMITED) ptr += val.size;
+ if (msg) {
+ if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
+ d->unknown = *field_start;
+ d->unknown_msg = msg;
+ ptr = decode_group(d, ptr, NULL, NULL, field_number);
+ d->unknown_msg = NULL;
+ *field_start = d->unknown;
+ }
+ if (!_upb_msg_addunknown(msg, *field_start, ptr - *field_start,
+ &d->arena)) {
+ return decode_err(d);
+ }
+ } else if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
+ ptr = decode_group(d, ptr, NULL, NULL, field_number);
+ }
+ return ptr;
+}
+
UPB_NOINLINE
static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
const upb_msglayout *layout) {
+ int last_field_index = 0;
while (true) {
uint32_t tag;
const upb_msglayout_field *field;
@@ -556,86 +798,32 @@ static const char *decode_msg(upb_decstate *d, const char *ptr, upb_msg *msg,
field_number = tag >> 3;
wire_type = tag & 7;
- field = upb_find_field(layout, field_number);
+ field = decode_findfield(d, layout, field_number, &last_field_index);
- switch (wire_type) {
- case UPB_WIRE_TYPE_VARINT:
- ptr = decode_varint64(d, ptr, &val.uint64_val);
- op = varint_ops[field->descriptortype];
- decode_munge(field->descriptortype, &val);
- break;
- case UPB_WIRE_TYPE_32BIT:
- memcpy(&val.uint32_val, ptr, 4);
- val.uint32_val = _upb_be_swap32(val.uint32_val);
- ptr += 4;
- op = OP_SCALAR_LG2(2);
- if (((1 << field->descriptortype) & fixed32_ok) == 0) goto unknown;
- break;
- case UPB_WIRE_TYPE_64BIT:
- memcpy(&val.uint64_val, ptr, 8);
- val.uint64_val = _upb_be_swap64(val.uint64_val);
- ptr += 8;
- op = OP_SCALAR_LG2(3);
- if (((1 << field->descriptortype) & fixed64_ok) == 0) goto unknown;
- break;
- case UPB_WIRE_TYPE_DELIMITED: {
- int ndx = field->descriptortype;
- uint64_t size;
- if (_upb_isrepeated(field)) ndx += 18;
- ptr = decode_varint64(d, ptr, &size);
- if (size >= INT32_MAX ||
- ptr - d->end + (int32_t)size > d->limit) {
- decode_err(d); /* Length overflow. */
- }
- op = delim_ops[ndx];
- val.size = size;
- break;
- }
- case UPB_WIRE_TYPE_START_GROUP:
- val.uint32_val = field_number;
- op = OP_SUBMSG;
- if (field->descriptortype != UPB_DTYPE_GROUP) goto unknown;
- break;
- case UPB_WIRE_TYPE_END_GROUP:
- d->end_group = field_number;
- return ptr;
- default:
- decode_err(d);
+ if (wire_type == UPB_WIRE_TYPE_END_GROUP) {
+ d->end_group = field_number;
+ return ptr;
}
+ ptr = decode_wireval(d, ptr, field, wire_type, &val, &op);
+
if (op >= 0) {
- /* Parse, using op for dispatch. */
- switch (field->label) {
- case UPB_LABEL_REPEATED:
- case _UPB_LABEL_PACKED:
- ptr = decode_toarray(d, ptr, msg, layout, field, val, op);
+ ptr = decode_known(d, ptr, msg, layout, field, op, &val);
+ } else {
+ switch (op) {
+ case OP_UNKNOWN:
+ ptr = decode_unknown(d, ptr, msg, field_number, wire_type, val,
+ &field_start);
break;
- case _UPB_LABEL_MAP:
- ptr = decode_tomap(d, ptr, msg, layout, field, val);
+ case OP_MSGSET_ITEM:
+ ptr = decode_msgset(d, ptr, msg, layout);
break;
- default:
- ptr = decode_tomsg(d, ptr, msg, layout, field, val, op);
+ case OP_MSGSET_TYPEID: {
+ const upb_msglayout_ext *ext = _upb_extreg_get(
+ d->extreg, layout->subs[0].submsg, val.uint64_val);
+ if (ext) ((upb_msglayout *)layout)->fields = &ext->field;
break;
- }
- } else {
- unknown:
- /* Skip unknown field. */
- if (field_number == 0) decode_err(d);
- if (wire_type == UPB_WIRE_TYPE_DELIMITED) ptr += val.size;
- if (msg) {
- if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
- d->unknown = field_start;
- d->unknown_msg = msg;
- ptr = decode_group(d, ptr, NULL, NULL, field_number);
- d->unknown_msg = NULL;
- field_start = d->unknown;
}
- if (!_upb_msg_addunknown(msg, field_start, ptr - field_start,
- &d->arena)) {
- decode_err(d);
- }
- } else if (wire_type == UPB_WIRE_TYPE_START_GROUP) {
- ptr = decode_group(d, ptr, NULL, NULL, field_number);
}
}
@@ -652,8 +840,17 @@ const char *fastdecode_generic(struct upb_decstate *d, const char *ptr,
return decode_msg(d, ptr, msg, decode_totablep(table));
}
+static bool decode_top(struct upb_decstate *d, const char *buf, void *msg,
+ const upb_msglayout *l) {
+ if (!decode_tryfastdispatch(d, &buf, msg, l)) {
+ decode_msg(d, buf, msg, l);
+ }
+ return d->end_group == DECODE_NOGROUP;
+}
+
bool _upb_decode(const char *buf, size_t size, void *msg,
- const upb_msglayout *l, upb_arena *arena, int options) {
+ const upb_msglayout *l, const upb_extreg *extreg, int options,
+ upb_arena *arena) {
bool ok;
upb_decstate state;
unsigned depth = (unsigned)options >> 16;
@@ -673,30 +870,33 @@ bool _upb_decode(const char *buf, size_t size, void *msg,
state.alias = options & UPB_DECODE_ALIAS;
}
+ state.extreg = extreg;
state.limit_ptr = state.end;
state.unknown_msg = NULL;
state.depth = depth ? depth : 64;
state.end_group = DECODE_NOGROUP;
state.arena.head = arena->head;
state.arena.last_size = arena->last_size;
+ state.arena.cleanup_metadata = arena->cleanup_metadata;
state.arena.parent = arena;
if (UPB_UNLIKELY(UPB_SETJMP(state.err))) {
ok = false;
} else {
- if (!decode_tryfastdispatch(&state, &buf, msg, l)) {
- decode_msg(&state, buf, msg, l);
- }
- ok = state.end_group == DECODE_NOGROUP;
+ ok = decode_top(&state, buf, msg, l);
}
arena->head.ptr = state.arena.head.ptr;
arena->head.end = state.arena.head.end;
+ arena->cleanup_metadata = state.arena.cleanup_metadata;
return ok;
}
+#undef OP_UNKNOWN
+#undef OP_SKIP
#undef OP_SCALAR_LG2
#undef OP_FIXPCK_LG2
#undef OP_VARPCK_LG2
#undef OP_STRING
+#undef OP_BYTES
#undef OP_SUBMSG
diff --git a/contrib/libs/grpc/third_party/upb/upb/decode.h b/contrib/libs/grpc/third_party/upb/upb/decode.h
index eff4b8bd3d8..24008910c0a 100644
--- a/contrib/libs/grpc/third_party/upb/upb/decode.h
+++ b/contrib/libs/grpc/third_party/upb/upb/decode.h
@@ -1,6 +1,33 @@
/*
-** upb_decode: parsing into a upb_msg using a upb_msglayout.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_decode: parsing into a upb_msg using a upb_msglayout.
+ */
#ifndef UPB_DECODE_H_
#define UPB_DECODE_H_
@@ -23,12 +50,13 @@ enum {
#define UPB_DECODE_MAXDEPTH(depth) ((depth) << 16)
bool _upb_decode(const char *buf, size_t size, upb_msg *msg,
- const upb_msglayout *l, upb_arena *arena, int options);
+ const upb_msglayout *l, const upb_extreg *extreg, int options,
+ upb_arena *arena);
UPB_INLINE
bool upb_decode(const char *buf, size_t size, upb_msg *msg,
const upb_msglayout *l, upb_arena *arena) {
- return _upb_decode(buf, size, msg, l, arena, 0);
+ return _upb_decode(buf, size, msg, l, NULL, 0, arena);
}
#ifdef __cplusplus
diff --git a/contrib/libs/grpc/third_party/upb/upb/decode_fast.c b/contrib/libs/grpc/third_party/upb/upb/decode_fast.c
index f628e6dbd44..d38136aa4c1 100644
--- a/contrib/libs/grpc/third_party/upb/upb/decode_fast.c
+++ b/contrib/libs/grpc/third_party/upb/upb/decode_fast.c
@@ -1,8 +1,35 @@
-// Fast decoder: ~3x the speed of decode.c, but x86-64 specific.
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Fast decoder: ~3x the speed of decode.c, but requires x86-64/ARM64.
// Also the table size grows by 2x.
//
-// Could potentially be ported to ARM64 or other 64-bit archs that pass at
-// least six arguments in registers.
+// Could potentially be ported to other 64-bit archs that pass at least six
+// arguments in registers and have 8 unused high bits in pointers.
//
// The overall design is to create specialized functions for every possible
// field type (eg. oneof boolean field with a 1 byte tag) and then dispatch
@@ -10,7 +37,7 @@
#include "upb/decode_fast.h"
-#include "upb/decode.int.h"
+#include "upb/decode_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
@@ -25,8 +52,10 @@
#define UPB_PARSE_ARGS d, ptr, msg, table, hasbits, data
-#define RETURN_GENERIC(m) \
- /* fprintf(stderr, m); */ \
+#define RETURN_GENERIC(m) \
+ /* Uncomment either of these for debugging purposes. */ \
+ /* fprintf(stderr, m); */ \
+ /*__builtin_trap(); */ \
return fastdecode_generic(d, ptr, msg, table, hasbits, 0);
typedef enum {
@@ -37,21 +66,18 @@ typedef enum {
} upb_card;
UPB_NOINLINE
-static const char *fastdecode_isdonefallback(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, int overrun) {
+static const char *fastdecode_isdonefallback(UPB_PARSE_PARAMS) {
+ int overrun = data;
ptr = decode_isdonefallback_inl(d, ptr, overrun);
if (ptr == NULL) {
return fastdecode_err(d);
}
- uint16_t tag = fastdecode_loadtag(ptr);
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, tag);
+ data = fastdecode_loadtag(ptr);
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS);
}
UPB_FORCEINLINE
-static const char *fastdecode_dispatch(upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits) {
+static const char *fastdecode_dispatch(UPB_PARSE_PARAMS) {
if (UPB_UNLIKELY(ptr >= d->limit_ptr)) {
int overrun = ptr - d->end;
if (UPB_LIKELY(overrun == d->limit)) {
@@ -59,21 +85,22 @@ static const char *fastdecode_dispatch(upb_decstate *d, const char *ptr,
*(uint32_t*)msg |= hasbits; // Sync hasbits.
return ptr;
} else {
- return fastdecode_isdonefallback(d, ptr, msg, table, hasbits, overrun);
+ data = overrun;
+ UPB_MUSTTAIL return fastdecode_isdonefallback(UPB_PARSE_ARGS);
}
}
// Read two bytes of tag data (for a one-byte tag, the high byte is junk).
- uint16_t tag = fastdecode_loadtag(ptr);
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, tag);
+ data = fastdecode_loadtag(ptr);
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS);
}
UPB_FORCEINLINE
-static bool fastdecode_checktag(uint64_t data, int tagbytes) {
+static bool fastdecode_checktag(uint16_t data, int tagbytes) {
if (tagbytes == 1) {
return (data & 0xff) == 0;
} else {
- return (data & 0xffff) == 0;
+ return data == 0;
}
}
@@ -297,6 +324,14 @@ static bool fastdecode_flippacked(uint64_t *data, int tagbytes) {
return fastdecode_checktag(*data, tagbytes);
}
+#define FASTDECODE_CHECKPACKED(tagbytes, card, func) \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) { \
+ UPB_MUSTTAIL return func(UPB_PARSE_ARGS); \
+ } \
+ RETURN_GENERIC("packed check tag mismatch\n"); \
+ }
+
/* varint fields **************************************************************/
UPB_FORCEINLINE
@@ -339,57 +374,50 @@ done:
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_unpackedvarint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- bool zigzag,
- _upb_field_parser *packed) {
- uint64_t val;
- void *dst;
- fastdecode_arr farr;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) {
- return packed(UPB_PARSE_ARGS);
- }
- RETURN_GENERIC("varint field tag mismatch\n");
- }
-
- dst =
- fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, card);
- if (card == CARD_r) {
- if (UPB_UNLIKELY(!dst)) {
- RETURN_GENERIC("need array resize\n");
- }
- }
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, valbytes);
- }
-
- ptr += tagbytes;
- ptr = fastdecode_varint64(ptr, &val);
- if (ptr == NULL) return fastdecode_err(d);
- val = fastdecode_munge(val, valbytes, zigzag);
- memcpy(dst, &val, valbytes);
-
- if (card == CARD_r) {
- fastdecode_nextret ret =
- fastdecode_nextrepeated(d, dst, &ptr, &farr, data, tagbytes, valbytes);
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
+#define FASTDECODE_UNPACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, packed) \
+ uint64_t val; \
+ void *dst; \
+ fastdecode_arr farr; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, card, packed); \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, \
+ card); \
+ if (card == CARD_r) { \
+ if (UPB_UNLIKELY(!dst)) { \
+ RETURN_GENERIC("need array resize\n"); \
+ } \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, valbytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_varint64(ptr, &val); \
+ if (ptr == NULL) \
+ return fastdecode_err(d); \
+ val = fastdecode_munge(val, valbytes, zigzag); \
+ memcpy(dst, &val, valbytes); \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, valbytes); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
typedef struct {
uint8_t valbytes;
@@ -418,49 +446,36 @@ static const char *fastdecode_topackedvarint(upb_decstate *d, const char *ptr,
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_packedvarint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, bool zigzag,
- _upb_field_parser *unpacked) {
- fastdecode_varintdata ctx = {valbytes, zigzag};
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (fastdecode_flippacked(&data, tagbytes)) {
- return unpacked(UPB_PARSE_ARGS);
- } else {
- RETURN_GENERIC("varint field tag mismatch\n");
- }
- }
-
- ctx.dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &ctx.farr,
- valbytes, CARD_r);
- if (UPB_UNLIKELY(!ctx.dst)) {
- RETURN_GENERIC("need array resize\n");
- }
-
- ptr += tagbytes;
- ptr = fastdecode_delimited(d, ptr, &fastdecode_topackedvarint, &ctx);
-
- if (UPB_UNLIKELY(ptr == NULL)) {
- return fastdecode_err(d);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_varint(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card, bool zigzag,
- _upb_field_parser *unpacked,
- _upb_field_parser *packed) {
- if (card == CARD_p) {
- return fastdecode_packedvarint(UPB_PARSE_ARGS, tagbytes, valbytes, zigzag,
- unpacked);
- } else {
- return fastdecode_unpackedvarint(UPB_PARSE_ARGS, tagbytes, valbytes, card,
- zigzag, packed);
+#define FASTDECODE_PACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, zigzag, unpacked) \
+ fastdecode_varintdata ctx = {valbytes, zigzag}; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, CARD_r, unpacked); \
+ \
+ ctx.dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &ctx.farr, \
+ valbytes, CARD_r); \
+ if (UPB_UNLIKELY(!ctx.dst)) { \
+ RETURN_GENERIC("need array resize\n"); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_delimited(d, ptr, &fastdecode_topackedvarint, &ctx); \
+ \
+ if (UPB_UNLIKELY(ptr == NULL)) { \
+ return fastdecode_err(d); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(d, ptr, msg, table, hasbits, 0);
+
+#define FASTDECODE_VARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, unpacked, packed) \
+ if (card == CARD_p) { \
+ FASTDECODE_PACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, zigzag, unpacked); \
+ } else { \
+ FASTDECODE_UNPACKEDVARINT(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, zigzag, packed); \
}
-}
#define z_ZZ true
#define b_ZZ false
@@ -472,10 +487,10 @@ static const char *fastdecode_varint(UPB_PARSE_PARAMS, int tagbytes,
#define F(card, type, valbytes, tagbytes) \
UPB_NOINLINE \
const char *upb_p##card##type##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_varint(UPB_PARSE_ARGS, tagbytes, valbytes, CARD_##card, \
- type##_ZZ, \
- &upb_pr##type##valbytes##_##tagbytes##bt, \
- &upb_pp##type##valbytes##_##tagbytes##bt); \
+ FASTDECODE_VARINT(d, ptr, msg, table, hasbits, data, tagbytes, valbytes, \
+ CARD_##card, type##_ZZ, \
+ upb_pr##type##valbytes##_##tagbytes##bt, \
+ upb_pp##type##valbytes##_##tagbytes##bt); \
}
#define TYPES(card, tagbytes) \
@@ -503,126 +518,110 @@ TAGBYTES(p)
#undef F
#undef TYPES
#undef TAGBYTES
+#undef FASTDECODE_UNPACKEDVARINT
+#undef FASTDECODE_PACKEDVARINT
+#undef FASTDECODE_VARINT
/* fixed fields ***************************************************************/
-UPB_FORCEINLINE
-static const char *fastdecode_unpackedfixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- _upb_field_parser *packed) {
- void *dst;
- fastdecode_arr farr;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (card == CARD_r && fastdecode_flippacked(&data, tagbytes)) {
- return packed(UPB_PARSE_ARGS);
- }
- RETURN_GENERIC("fixed field tag mismatch\n");
+#define FASTDECODE_UNPACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, packed) \
+ void *dst; \
+ fastdecode_arr farr; \
+ \
+ FASTDECODE_CHECKPACKED(tagbytes, card, packed) \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, \
+ card); \
+ if (card == CARD_r) { \
+ if (UPB_UNLIKELY(!dst)) { \
+ RETURN_GENERIC("couldn't allocate array in arena\n"); \
+ } \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, valbytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ memcpy(dst, ptr, valbytes); \
+ ptr += valbytes; \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, valbytes); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define FASTDECODE_PACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, unpacked) \
+ FASTDECODE_CHECKPACKED(tagbytes, CARD_r, unpacked) \
+ \
+ ptr += tagbytes; \
+ int size = (uint8_t)ptr[0]; \
+ ptr++; \
+ if (size & 0x80) { \
+ ptr = fastdecode_longsize(ptr, &size); \
+ } \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr) || \
+ (size % valbytes) != 0)) { \
+ return fastdecode_err(d); \
+ } \
+ \
+ upb_array **arr_p = fastdecode_fieldmem(msg, data); \
+ upb_array *arr = *arr_p; \
+ uint8_t elem_size_lg2 = __builtin_ctz(valbytes); \
+ int elems = size / valbytes; \
+ \
+ if (UPB_LIKELY(!arr)) { \
+ *arr_p = arr = _upb_array_new(&d->arena, elems, elem_size_lg2); \
+ if (!arr) { \
+ return fastdecode_err(d); \
+ } \
+ } else { \
+ _upb_array_resize(arr, elems, &d->arena); \
+ } \
+ \
+ char *dst = _upb_array_ptr(arr); \
+ memcpy(dst, ptr, size); \
+ arr->len = elems; \
+ \
+ ptr += size; \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define FASTDECODE_FIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, unpacked, packed) \
+ if (card == CARD_p) { \
+ FASTDECODE_PACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, unpacked); \
+ } else { \
+ FASTDECODE_UNPACKEDFIXED(d, ptr, msg, table, hasbits, data, tagbytes, \
+ valbytes, card, packed); \
}
- dst =
- fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, valbytes, card);
- if (card == CARD_r) {
- if (UPB_UNLIKELY(!dst)) {
- RETURN_GENERIC("couldn't allocate array in arena\n");
- }
- }
-
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, valbytes);
- }
-
- ptr += tagbytes;
- memcpy(dst, ptr, valbytes);
- ptr += valbytes;
-
- if (card == CARD_r) {
- fastdecode_nextret ret =
- fastdecode_nextrepeated(d, dst, &ptr, &farr, data, tagbytes, valbytes);
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_packedfixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes,
- _upb_field_parser *unpacked) {
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- if (fastdecode_flippacked(&data, tagbytes)) {
- return unpacked(UPB_PARSE_ARGS);
- } else {
- RETURN_GENERIC("varint field tag mismatch\n");
- }
- }
-
- ptr += tagbytes;
- int size = (uint8_t)ptr[0];
- ptr++;
- if (size & 0x80) {
- ptr = fastdecode_longsize(ptr, &size);
- }
-
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr)) ||
- (size % valbytes) != 0) {
- return fastdecode_err(d);
- }
-
- upb_array **arr_p = fastdecode_fieldmem(msg, data);
- upb_array *arr = *arr_p;
- uint8_t elem_size_lg2 = __builtin_ctz(valbytes);
- int elems = size / valbytes;
-
- if (UPB_LIKELY(!arr)) {
- *arr_p = arr = _upb_array_new(&d->arena, elems, elem_size_lg2);
- if (!arr) {
- return fastdecode_err(d);
- }
- } else {
- _upb_array_resize(arr, elems, &d->arena);
- }
-
- char *dst = _upb_array_ptr(arr);
- memcpy(dst, ptr, size);
- arr->len = elems;
-
- return fastdecode_dispatch(d, ptr + size, msg, table, hasbits);
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_fixed(UPB_PARSE_PARAMS, int tagbytes,
- int valbytes, upb_card card,
- _upb_field_parser *unpacked,
- _upb_field_parser *packed) {
- if (card == CARD_p) {
- return fastdecode_packedfixed(UPB_PARSE_ARGS, tagbytes, valbytes, unpacked);
- } else {
- return fastdecode_unpackedfixed(UPB_PARSE_ARGS, tagbytes, valbytes, card,
- packed);
- }
-}
-
/* Generate all combinations:
* {s,o,r,p} x {f4,f8} x {1bt,2bt} */
-#define F(card, valbytes, tagbytes) \
- UPB_NOINLINE \
- const char *upb_p##card##f##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_fixed(UPB_PARSE_ARGS, tagbytes, valbytes, CARD_##card, \
- &upb_ppf##valbytes##_##tagbytes##bt, \
- &upb_prf##valbytes##_##tagbytes##bt); \
+#define F(card, valbytes, tagbytes) \
+ UPB_NOINLINE \
+ const char *upb_p##card##f##valbytes##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_FIXED(d, ptr, msg, table, hasbits, data, tagbytes, valbytes, \
+ CARD_##card, upb_ppf##valbytes##_##tagbytes##bt, \
+ upb_prf##valbytes##_##tagbytes##bt); \
}
#define TYPES(card, tagbytes) \
@@ -641,6 +640,8 @@ TAGBYTES(p)
#undef F
#undef TYPES
#undef TAGBYTES
+#undef FASTDECODE_UNPACKEDFIXED
+#undef FASTDECODE_PACKEDFIXED
/* string fields **************************************************************/
@@ -652,56 +653,54 @@ typedef const char *fastdecode_copystr_func(struct upb_decstate *d,
UPB_NOINLINE
static const char *fastdecode_verifyutf8(upb_decstate *d, const char *ptr,
upb_msg *msg, intptr_t table,
- uint64_t hasbits, upb_strview *dst) {
+ uint64_t hasbits, uint64_t data) {
+ upb_strview *dst = (upb_strview*)data;
if (!decode_verifyutf8_inl(dst->data, dst->size)) {
return fastdecode_err(d);
}
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
}
-UPB_FORCEINLINE
-static const char *fastdecode_longstring(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- intptr_t table, uint64_t hasbits,
- upb_strview *dst,
- bool validate_utf8) {
- int size = (uint8_t)ptr[0]; // Could plumb through hasbits.
- ptr++;
- if (size & 0x80) {
- ptr = fastdecode_longsize(ptr, &size);
+#define FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, validate_utf8) \
+ int size = (uint8_t)ptr[0]; /* Could plumb through hasbits. */ \
+ ptr++; \
+ if (size & 0x80) { \
+ ptr = fastdecode_longsize(ptr, &size); \
+ } \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr))) { \
+ dst->size = 0; \
+ return fastdecode_err(d); \
+ } \
+ \
+ if (d->alias) { \
+ dst->data = ptr; \
+ dst->size = size; \
+ } else { \
+ char *data = upb_arena_malloc(&d->arena, size); \
+ if (!data) { \
+ return fastdecode_err(d); \
+ } \
+ memcpy(data, ptr, size); \
+ dst->data = data; \
+ dst->size = size; \
+ } \
+ \
+ ptr += size; \
+ if (validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } else { \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \
}
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->limit_ptr))) {
- dst->size = 0;
- return fastdecode_err(d);
- }
-
- if (d->alias) {
- dst->data = ptr;
- dst->size = size;
- } else {
- char *data = upb_arena_malloc(&d->arena, size);
- if (!data) {
- return fastdecode_err(d);
- }
- memcpy(data, ptr, size);
- dst->data = data;
- dst->size = size;
- }
-
- if (validate_utf8) {
- return fastdecode_verifyutf8(d, ptr + size, msg, table, hasbits, dst);
- } else {
- return fastdecode_dispatch(d, ptr + size, msg, table, hasbits);
- }
-}
-
UPB_NOINLINE
static const char *fastdecode_longstring_utf8(struct upb_decstate *d,
- const char *ptr, upb_msg *msg,
- intptr_t table, uint64_t hasbits,
- upb_strview *dst) {
- return fastdecode_longstring(d, ptr, msg, table, hasbits, dst, true);
+ const char *ptr, upb_msg *msg,
+ intptr_t table, uint64_t hasbits,
+ uint64_t data) {
+ upb_strview *dst = (upb_strview*)data;
+ FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, true);
}
UPB_NOINLINE
@@ -709,8 +708,9 @@ static const char *fastdecode_longstring_noutf8(struct upb_decstate *d,
const char *ptr, upb_msg *msg,
intptr_t table,
uint64_t hasbits,
- upb_strview *dst) {
- return fastdecode_longstring(d, ptr, msg, table, hasbits, dst, false);
+ uint64_t data) {
+ upb_strview *dst = (upb_strview*)data;
+ FASTDECODE_LONGSTRING(d, ptr, msg, table, hasbits, dst, false);
}
UPB_FORCEINLINE
@@ -723,156 +723,165 @@ static void fastdecode_docopy(upb_decstate *d, const char *ptr, uint32_t size,
UPB_POISON_MEMORY_REGION(data + size, copy - size);
}
-UPB_FORCEINLINE
-static const char *fastdecode_copystring(UPB_PARSE_PARAMS, int tagbytes,
- upb_card card, bool validate_utf8) {
- upb_strview *dst;
- fastdecode_arr farr;
- int64_t size;
- size_t arena_has;
- size_t common_has;
- char *buf;
-
- UPB_ASSERT(!d->alias);
- UPB_ASSERT(fastdecode_checktag(data, tagbytes));
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_strview), card);
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview));
- }
-
- size = (uint8_t)ptr[tagbytes];
- ptr += tagbytes + 1;
- dst->size = size;
-
- buf = d->arena.head.ptr;
- arena_has = _upb_arenahas(&d->arena);
- common_has = UPB_MIN(arena_has, (d->end - ptr) + 16);
-
- if (UPB_LIKELY(size <= 15 - tagbytes)) {
- if (arena_has < 16) goto longstr;
- d->arena.head.ptr += 16;
- memcpy(buf, ptr - tagbytes - 1, 16);
- dst->data = buf + tagbytes + 1;
- } else if (UPB_LIKELY(size <= 32)) {
- if (UPB_UNLIKELY(common_has < 32)) goto longstr;
- fastdecode_docopy(d, ptr, size, 32, buf, dst);
- } else if (UPB_LIKELY(size <= 64)) {
- if (UPB_UNLIKELY(common_has < 64)) goto longstr;
- fastdecode_docopy(d, ptr, size, 64, buf, dst);
- } else if (UPB_LIKELY(size < 128)) {
- if (UPB_UNLIKELY(common_has < 128)) goto longstr;
- fastdecode_docopy(d, ptr, size, 128, buf, dst);
- } else {
- goto longstr;
- }
-
- ptr += size;
-
- if (card == CARD_r) {
- if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) {
- return fastdecode_err(d);
- }
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- if (card != CARD_r && validate_utf8) {
- return fastdecode_verifyutf8(d, ptr, msg, table, hasbits, dst);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-
-longstr:
- ptr--;
- if (validate_utf8) {
- return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, dst);
- } else {
- return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, dst);
- }
-}
-
-UPB_FORCEINLINE
-static const char *fastdecode_string(UPB_PARSE_PARAMS, int tagbytes,
- upb_card card, _upb_field_parser *copyfunc,
- bool validate_utf8) {
- upb_strview *dst;
- fastdecode_arr farr;
- int64_t size;
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- RETURN_GENERIC("string field tag mismatch\n");
- }
-
- if (UPB_UNLIKELY(!d->alias)) {
- return copyfunc(UPB_PARSE_ARGS);
- }
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_strview), card);
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview));
+#define FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ card, validate_utf8) \
+ upb_strview *dst; \
+ fastdecode_arr farr; \
+ int64_t size; \
+ size_t arena_has; \
+ size_t common_has; \
+ char *buf; \
+ \
+ UPB_ASSERT(!d->alias); \
+ UPB_ASSERT(fastdecode_checktag(data, tagbytes)); \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_strview), card); \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview)); \
+ } \
+ \
+ size = (uint8_t)ptr[tagbytes]; \
+ ptr += tagbytes + 1; \
+ dst->size = size; \
+ \
+ buf = d->arena.head.ptr; \
+ arena_has = _upb_arenahas(&d->arena); \
+ common_has = UPB_MIN(arena_has, (d->end - ptr) + 16); \
+ \
+ if (UPB_LIKELY(size <= 15 - tagbytes)) { \
+ if (arena_has < 16) \
+ goto longstr; \
+ d->arena.head.ptr += 16; \
+ memcpy(buf, ptr - tagbytes - 1, 16); \
+ dst->data = buf + tagbytes + 1; \
+ } else if (UPB_LIKELY(size <= 32)) { \
+ if (UPB_UNLIKELY(common_has < 32)) \
+ goto longstr; \
+ fastdecode_docopy(d, ptr, size, 32, buf, dst); \
+ } else if (UPB_LIKELY(size <= 64)) { \
+ if (UPB_UNLIKELY(common_has < 64)) \
+ goto longstr; \
+ fastdecode_docopy(d, ptr, size, 64, buf, dst); \
+ } else if (UPB_LIKELY(size < 128)) { \
+ if (UPB_UNLIKELY(common_has < 128)) \
+ goto longstr; \
+ fastdecode_docopy(d, ptr, size, 128, buf, dst); \
+ } else { \
+ goto longstr; \
+ } \
+ \
+ ptr += size; \
+ \
+ if (card == CARD_r) { \
+ if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \
+ return fastdecode_err(d); \
+ } \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ if (card != CARD_r && validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS); \
+ \
+ longstr: \
+ ptr--; \
+ if (validate_utf8) { \
+ UPB_MUSTTAIL return fastdecode_longstring_utf8(d, ptr, msg, table, \
+ hasbits, (uint64_t)dst); \
+ } else { \
+ UPB_MUSTTAIL return fastdecode_longstring_noutf8(d, ptr, msg, table, \
+ hasbits, (uint64_t)dst); \
}
- size = (int8_t)ptr[tagbytes];
- ptr += tagbytes + 1;
- dst->data = ptr;
- dst->size = size;
-
- if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->end))) {
- ptr--;
- if (validate_utf8) {
- return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, dst);
- } else {
- return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, dst);
- }
- }
-
- ptr += size;
-
- if (card == CARD_r) {
- if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) {
- return fastdecode_err(d);
- }
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- if (UPB_UNLIKELY(!d->alias)) {
- // Buffer flipped and we can't alias any more. Bounce to copyfunc(),
- // but via dispatch since we need to reload table data also.
- fastdecode_commitarr(dst, &farr, sizeof(upb_strview));
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- }
- goto again;
- case FD_NEXT_OTHERFIELD:
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- return ptr;
- }
- }
-
- if (card != CARD_r && validate_utf8) {
- return fastdecode_verifyutf8(d, ptr, msg, table, hasbits, dst);
- }
-
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
+#define FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, card, \
+ copyfunc, validate_utf8) \
+ upb_strview *dst; \
+ fastdecode_arr farr; \
+ int64_t size; \
+ \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ RETURN_GENERIC("string field tag mismatch\n"); \
+ } \
+ \
+ if (UPB_UNLIKELY(!d->alias)) { \
+ UPB_MUSTTAIL return copyfunc(UPB_PARSE_ARGS); \
+ } \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_strview), card); \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_strview)); \
+ } \
+ \
+ size = (int8_t)ptr[tagbytes]; \
+ ptr += tagbytes + 1; \
+ dst->data = ptr; \
+ dst->size = size; \
+ \
+ if (UPB_UNLIKELY(fastdecode_boundscheck(ptr, size, d->end))) { \
+ ptr--; \
+ if (validate_utf8) { \
+ return fastdecode_longstring_utf8(d, ptr, msg, table, hasbits, \
+ (uint64_t)dst); \
+ } else { \
+ return fastdecode_longstring_noutf8(d, ptr, msg, table, hasbits, \
+ (uint64_t)dst); \
+ } \
+ } \
+ \
+ ptr += size; \
+ \
+ if (card == CARD_r) { \
+ if (validate_utf8 && !decode_verifyutf8_inl(dst->data, dst->size)) { \
+ return fastdecode_err(d); \
+ } \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_strview)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ if (UPB_UNLIKELY(!d->alias)) { \
+ /* Buffer flipped and we can't alias any more. Bounce to */ \
+ /* copyfunc(), but via dispatch since we need to reload table */ \
+ /* data also. */ \
+ fastdecode_commitarr(dst, &farr, sizeof(upb_strview)); \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ } \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ return ptr; \
+ } \
+ } \
+ \
+ if (card != CARD_r && validate_utf8) { \
+ data = (uint64_t)dst; \
+ UPB_MUSTTAIL return fastdecode_verifyutf8(UPB_PARSE_ARGS); \
+ } \
+ \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
/* Generate all combinations:
* {p,c} x {s,o,r} x {s, b} x {1bt,2bt} */
@@ -880,16 +889,16 @@ again:
#define s_VALIDATE true
#define b_VALIDATE false
-#define F(card, tagbytes, type) \
- UPB_NOINLINE \
- const char *upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_copystring(UPB_PARSE_ARGS, tagbytes, CARD_##card, \
- type##_VALIDATE); \
- } \
- const char *upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
- return fastdecode_string(UPB_PARSE_ARGS, tagbytes, CARD_##card, \
- &upb_c##card##type##_##tagbytes##bt, \
- type##_VALIDATE); \
+#define F(card, tagbytes, type) \
+ UPB_NOINLINE \
+ const char *upb_c##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_COPYSTRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ CARD_##card, type##_VALIDATE); \
+ } \
+ const char *upb_p##card##type##_##tagbytes##bt(UPB_PARSE_PARAMS) { \
+ FASTDECODE_STRING(d, ptr, msg, table, hasbits, data, tagbytes, \
+ CARD_##card, upb_c##card##type##_##tagbytes##bt, \
+ type##_VALIDATE); \
}
#define UTF8(card, tagbytes) \
@@ -908,6 +917,9 @@ TAGBYTES(r)
#undef b_VALIDATE
#undef F
#undef TAGBYTES
+#undef FASTDECODE_LONGSTRING
+#undef FASTDECODE_COPYSTRING
+#undef FASTDECODE_STRING
/* message fields *************************************************************/
@@ -940,82 +952,82 @@ UPB_FORCEINLINE
static const char *fastdecode_tosubmsg(upb_decstate *d, const char *ptr,
void *ctx) {
fastdecode_submsgdata *submsg = ctx;
- ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->table, 0);
+ ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->table, 0, 0);
UPB_ASSUME(ptr != NULL);
return ptr;
}
-UPB_FORCEINLINE
-static const char *fastdecode_submsg(UPB_PARSE_PARAMS, int tagbytes,
- int msg_ceil_bytes, upb_card card) {
-
- if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) {
- RETURN_GENERIC("submessage field tag mismatch\n");
- }
-
- if (--d->depth == 0) return fastdecode_err(d);
-
- upb_msg **dst;
- uint32_t submsg_idx = (data >> 16) & 0xff;
- const upb_msglayout *tablep = decode_totablep(table);
- const upb_msglayout *subtablep = tablep->submsgs[submsg_idx];
- fastdecode_submsgdata submsg = {decode_totable(subtablep)};
- fastdecode_arr farr;
-
- if (subtablep->table_mask == (uint8_t)-1) {
- RETURN_GENERIC("submessage doesn't have fast tables.");
- }
-
- dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr,
- sizeof(upb_msg *), card);
-
- if (card == CARD_s) {
- *(uint32_t*)msg |= hasbits;
- hasbits = 0;
- }
-
-again:
- if (card == CARD_r) {
- dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_msg*));
- }
-
- submsg.msg = *dst;
-
- if (card == CARD_r || UPB_LIKELY(!submsg.msg)) {
- *dst = submsg.msg = decode_newmsg_ceil(d, subtablep, msg_ceil_bytes);
- }
-
- ptr += tagbytes;
- ptr = fastdecode_delimited(d, ptr, fastdecode_tosubmsg, &submsg);
-
- if (UPB_UNLIKELY(ptr == NULL || d->end_group != DECODE_NOGROUP)) {
- return fastdecode_err(d);
- }
-
- if (card == CARD_r) {
- fastdecode_nextret ret = fastdecode_nextrepeated(
- d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_msg *));
- switch (ret.next) {
- case FD_NEXT_SAMEFIELD:
- dst = ret.dst;
- goto again;
- case FD_NEXT_OTHERFIELD:
- d->depth++;
- return fastdecode_tagdispatch(d, ptr, msg, table, hasbits, ret.tag);
- case FD_NEXT_ATLIMIT:
- d->depth++;
- return ptr;
- }
- }
-
- d->depth++;
- return fastdecode_dispatch(d, ptr, msg, table, hasbits);
-}
-
-#define F(card, tagbytes, size_ceil, ceil_arg) \
- const char *upb_p##card##m_##tagbytes##bt_max##size_ceil##b( \
- UPB_PARSE_PARAMS) { \
- return fastdecode_submsg(UPB_PARSE_ARGS, tagbytes, ceil_arg, CARD_##card); \
+#define FASTDECODE_SUBMSG(d, ptr, msg, table, hasbits, data, tagbytes, \
+ msg_ceil_bytes, card) \
+ \
+ if (UPB_UNLIKELY(!fastdecode_checktag(data, tagbytes))) { \
+ RETURN_GENERIC("submessage field tag mismatch\n"); \
+ } \
+ \
+ if (--d->depth == 0) return fastdecode_err(d); \
+ \
+ upb_msg **dst; \
+ uint32_t submsg_idx = (data >> 16) & 0xff; \
+ const upb_msglayout *tablep = decode_totablep(table); \
+ const upb_msglayout *subtablep = tablep->subs[submsg_idx].submsg; \
+ fastdecode_submsgdata submsg = {decode_totable(subtablep)}; \
+ fastdecode_arr farr; \
+ \
+ if (subtablep->table_mask == (uint8_t)-1) { \
+ RETURN_GENERIC("submessage doesn't have fast tables."); \
+ } \
+ \
+ dst = fastdecode_getfield(d, ptr, msg, &data, &hasbits, &farr, \
+ sizeof(upb_msg *), card); \
+ \
+ if (card == CARD_s) { \
+ *(uint32_t *)msg |= hasbits; \
+ hasbits = 0; \
+ } \
+ \
+ again: \
+ if (card == CARD_r) { \
+ dst = fastdecode_resizearr(d, dst, &farr, sizeof(upb_msg *)); \
+ } \
+ \
+ submsg.msg = *dst; \
+ \
+ if (card == CARD_r || UPB_LIKELY(!submsg.msg)) { \
+ *dst = submsg.msg = decode_newmsg_ceil(d, subtablep, msg_ceil_bytes); \
+ } \
+ \
+ ptr += tagbytes; \
+ ptr = fastdecode_delimited(d, ptr, fastdecode_tosubmsg, &submsg); \
+ \
+ if (UPB_UNLIKELY(ptr == NULL || d->end_group != DECODE_NOGROUP)) { \
+ return fastdecode_err(d); \
+ } \
+ \
+ if (card == CARD_r) { \
+ fastdecode_nextret ret = fastdecode_nextrepeated( \
+ d, dst, &ptr, &farr, data, tagbytes, sizeof(upb_msg *)); \
+ switch (ret.next) { \
+ case FD_NEXT_SAMEFIELD: \
+ dst = ret.dst; \
+ goto again; \
+ case FD_NEXT_OTHERFIELD: \
+ d->depth++; \
+ data = ret.tag; \
+ UPB_MUSTTAIL return fastdecode_tagdispatch(UPB_PARSE_ARGS); \
+ case FD_NEXT_ATLIMIT: \
+ d->depth++; \
+ return ptr; \
+ } \
+ } \
+ \
+ d->depth++; \
+ UPB_MUSTTAIL return fastdecode_dispatch(UPB_PARSE_ARGS);
+
+#define F(card, tagbytes, size_ceil, ceil_arg) \
+ const char *upb_p##card##m_##tagbytes##bt_max##size_ceil##b( \
+ UPB_PARSE_PARAMS) { \
+ FASTDECODE_SUBMSG(d, ptr, msg, table, hasbits, data, tagbytes, ceil_arg, \
+ CARD_##card); \
}
#define SIZES(card, tagbytes) \
@@ -1036,5 +1048,6 @@ TAGBYTES(r)
#undef TAGBYTES
#undef SIZES
#undef F
+#undef FASTDECODE_SUBMSG
#endif /* UPB_FASTTABLE */
diff --git a/contrib/libs/grpc/third_party/upb/upb/decode_fast.h b/contrib/libs/grpc/third_party/upb/upb/decode_fast.h
index 6d56d124770..a05cd80fe4b 100644
--- a/contrib/libs/grpc/third_party/upb/upb/decode_fast.h
+++ b/contrib/libs/grpc/third_party/upb/upb/decode_fast.h
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
// These are the specialized field parser functions for the fast parser.
// Generated tables will refer to these by name.
//
diff --git a/contrib/libs/grpc/third_party/upb/upb/decode.int.h b/contrib/libs/grpc/third_party/upb/upb/decode_internal.h
index e286b9cdd52..6d03084b373 100644
--- a/contrib/libs/grpc/third_party/upb/upb/decode.int.h
+++ b/contrib/libs/grpc/third_party/upb/upb/decode_internal.h
@@ -1,26 +1,54 @@
/*
-** Internal implementation details of the decoder that are shared between
-** decode.c and decode_fast.c.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Internal implementation details of the decoder that are shared between
+ * decode.c and decode_fast.c.
+ */
#ifndef UPB_DECODE_INT_H_
#define UPB_DECODE_INT_H_
#include <setjmp.h>
-#include "upb/msg.h"
-#include "upb/upb.int.h"
+#include "upb/msg_internal.h"
+#include "upb/upb_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
-#define DECODE_NOGROUP -1
+#define DECODE_NOGROUP (uint32_t)-1
typedef struct upb_decstate {
const char *end; /* Can read up to 16 bytes slop beyond this. */
const char *limit_ptr; /* = end + UPB_MIN(limit, 0) */
upb_msg *unknown_msg; /* If non-NULL, add unknown data at buffer flip. */
const char *unknown; /* Start of unknown data. */
+ const upb_extreg *extreg; /* For looking up extensions during the parse. */
int limit; /* Submessage limit relative to end. */
int depth;
uint32_t end_group; /* field number of END_GROUP tag, else DECODE_NOGROUP */
@@ -115,10 +143,11 @@ bool decode_isdone(upb_decstate *d, const char **ptr) {
}
}
+#if UPB_FASTTABLE
UPB_INLINE
const char *fastdecode_tagdispatch(upb_decstate *d, const char *ptr,
upb_msg *msg, intptr_t table,
- uint64_t hasbits, uint32_t tag) {
+ uint64_t hasbits, uint64_t tag) {
const upb_msglayout *table_p = decode_totablep(table);
uint8_t mask = table;
uint64_t data;
@@ -126,8 +155,10 @@ const char *fastdecode_tagdispatch(upb_decstate *d, const char *ptr,
UPB_ASSUME((idx & 7) == 0);
idx >>= 3;
data = table_p->fasttable[idx].field_data ^ tag;
- return table_p->fasttable[idx].field_parser(d, ptr, msg, table, hasbits, data);
+ UPB_MUSTTAIL return table_p->fasttable[idx].field_parser(d, ptr, msg, table,
+ hasbits, data);
}
+#endif
UPB_INLINE uint32_t fastdecode_loadtag(const char* ptr) {
uint16_t tag;
diff --git a/contrib/libs/grpc/third_party/upb/upb/def.c b/contrib/libs/grpc/third_party/upb/upb/def.c
index 4ba553a69cb..b92f6176ac9 100644
--- a/contrib/libs/grpc/third_party/upb/upb/def.c
+++ b/contrib/libs/grpc/third_party/upb/upb/def.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/def.h"
@@ -8,6 +34,9 @@
#include <string.h>
#include "google/protobuf/descriptor.upb.h"
+#include "upb/reflection.h"
+
+/* Must be last. */
#include "upb/port_def.inc"
typedef struct {
@@ -37,7 +66,6 @@ struct upb_fielddef {
uint32_t number_;
uint16_t index_;
uint16_t layout_index;
- uint32_t selector_base; /* Used to index into a upb::Handlers table. */
bool is_extension_;
bool lazy_;
bool packed_;
@@ -46,28 +74,34 @@ struct upb_fielddef {
upb_label_t label_;
};
+struct upb_extrange {
+ const google_protobuf_ExtensionRangeOptions *opts;
+ int32_t start;
+ int32_t end;
+};
+
struct upb_msgdef {
const upb_msglayout *layout;
const upb_filedef *file;
const char *full_name;
- uint32_t selector_count;
- uint32_t submsg_field_count;
/* Tables for looking up fields by number and name. */
upb_inttable itof;
upb_strtable ntof;
+ const upb_extrange *ext_ranges;
const upb_fielddef *fields;
const upb_oneofdef *oneofs;
int field_count;
int oneof_count;
int real_oneof_count;
+ int ext_range_count;
/* Is this a map-entry message? */
bool map_entry;
+ bool is_message_set;
upb_wellknowntype_t well_known_type;
-
- /* TODO(haberman): proper extension ranges (there can be multiple). */
+ const upb_fielddef *message_set_ext;
};
struct upb_enumdef {
@@ -75,9 +109,17 @@ struct upb_enumdef {
const char *full_name;
upb_strtable ntoi;
upb_inttable iton;
+ const upb_enumvaldef *values;
+ int value_count;
int32_t defaultval;
};
+struct upb_enumvaldef {
+ const upb_enumdef *enum_;
+ const char *full_name;
+ int32_t number;
+};
+
struct upb_oneofdef {
const upb_msgdef *parent;
const char *full_name;
@@ -98,6 +140,7 @@ struct upb_filedef {
const upb_msgdef *msgs;
const upb_enumdef *enums;
const upb_fielddef *exts;
+ const upb_msglayout_ext **ext_layouts;
const upb_symtab *symtab;
int dep_count;
@@ -111,29 +154,43 @@ struct upb_symtab {
upb_arena *arena;
upb_strtable syms; /* full_name -> packed def ptr */
upb_strtable files; /* file_name -> upb_filedef* */
+ upb_inttable exts; /* upb_msglayout_ext* -> upb_fielddef* */
+ upb_extreg *extreg;
size_t bytes_loaded;
};
/* Inside a symtab we store tagged pointers to specific def types. */
typedef enum {
+ UPB_DEFTYPE_MASK = 7,
+
UPB_DEFTYPE_FIELD = 0,
/* Only inside symtab table. */
UPB_DEFTYPE_MSG = 1,
UPB_DEFTYPE_ENUM = 2,
+ UPB_DEFTYPE_ENUMVAL = 3,
/* Only inside message table. */
UPB_DEFTYPE_ONEOF = 1,
UPB_DEFTYPE_FIELD_JSONNAME = 2
} upb_deftype_t;
+static upb_deftype_t deftype(upb_value v) {
+ uintptr_t num = (uintptr_t)upb_value_getconstptr(v);
+ return num & UPB_DEFTYPE_MASK;
+}
+
static const void *unpack_def(upb_value v, upb_deftype_t type) {
uintptr_t num = (uintptr_t)upb_value_getconstptr(v);
- return (num & 3) == type ? (const void*)(num & ~3) : NULL;
+ return (num & UPB_DEFTYPE_MASK) == type
+ ? (const void *)(num & ~UPB_DEFTYPE_MASK)
+ : NULL;
}
static upb_value pack_def(const void *ptr, upb_deftype_t type) {
- uintptr_t num = (uintptr_t)ptr | type;
+ uintptr_t num = (uintptr_t)ptr;
+ UPB_ASSERT((num & UPB_DEFTYPE_MASK) == 0);
+ num |= type;
return upb_value_constptr((const void*)num);
}
@@ -181,30 +238,6 @@ int cmp_fields(const void *p1, const void *p2) {
return field_rank(f1) - field_rank(f2);
}
-/* A few implementation details of handlers. We put these here to avoid
- * a def -> handlers dependency. */
-
-#define UPB_STATIC_SELECTOR_COUNT 3 /* Warning: also in upb/handlers.h. */
-
-static uint32_t upb_handlers_selectorbaseoffset(const upb_fielddef *f) {
- return upb_fielddef_isseq(f) ? 2 : 0;
-}
-
-static uint32_t upb_handlers_selectorcount(const upb_fielddef *f) {
- uint32_t ret = 1;
- if (upb_fielddef_isseq(f)) ret += 2; /* STARTSEQ/ENDSEQ */
- if (upb_fielddef_isstring(f)) ret += 2; /* [STRING]/STARTSTR/ENDSTR */
- if (upb_fielddef_issubmsg(f)) {
- /* ENDSUBMSG (STARTSUBMSG is at table beginning) */
- ret += 0;
- if (upb_fielddef_lazy(f)) {
- /* STARTSTR/ENDSTR/STRING (for lazy) */
- ret += 3;
- }
- }
- return ret;
-}
-
static void upb_status_setoom(upb_status *status) {
upb_status_seterrmsg(status, "out of memory");
}
@@ -268,10 +301,31 @@ const upb_filedef *upb_enumdef_file(const upb_enumdef *e) {
}
int32_t upb_enumdef_default(const upb_enumdef *e) {
- UPB_ASSERT(upb_enumdef_iton(e, e->defaultval));
+ UPB_ASSERT(upb_enumdef_lookupnum(e, e->defaultval));
return e->defaultval;
}
+const upb_enumvaldef *upb_enumdef_lookupname(const upb_enumdef *def,
+ const char *name, size_t len) {
+ upb_value v;
+ return upb_strtable_lookup2(&def->ntoi, name, len, &v)
+ ? upb_value_getconstptr(v)
+ : NULL;
+}
+
+const upb_enumvaldef *upb_enumdef_lookupnum(const upb_enumdef *def, int32_t num) {
+ upb_value v;
+ return upb_inttable_lookup(&def->iton, num, &v) ? upb_value_getconstptr(v)
+ : NULL;
+}
+
+const upb_enumvaldef *upb_enumdef_value(const upb_enumdef *e, int i) {
+ UPB_ASSERT(0 <= i && i < e->value_count);
+ return &e->values[i];
+}
+
+// Deprecated functions.
+
int upb_enumdef_numvals(const upb_enumdef *e) {
return (int)upb_strtable_count(&e->ntoi);
}
@@ -284,22 +338,6 @@ void upb_enum_begin(upb_enum_iter *i, const upb_enumdef *e) {
void upb_enum_next(upb_enum_iter *iter) { upb_strtable_next(iter); }
bool upb_enum_done(upb_enum_iter *iter) { return upb_strtable_done(iter); }
-bool upb_enumdef_ntoi(const upb_enumdef *def, const char *name,
- size_t len, int32_t *num) {
- upb_value v;
- if (!upb_strtable_lookup2(&def->ntoi, name, len, &v)) {
- return false;
- }
- if (num) *num = upb_value_getint32(v);
- return true;
-}
-
-const char *upb_enumdef_iton(const upb_enumdef *def, int32_t num) {
- upb_value v;
- return upb_inttable_lookup32(&def->iton, num, &v) ?
- upb_value_getcstr(v) : NULL;
-}
-
const char *upb_enum_iter_name(upb_enum_iter *iter) {
return upb_strtable_iter_key(iter).data;
}
@@ -309,6 +347,25 @@ int32_t upb_enum_iter_number(upb_enum_iter *iter) {
}
+/* upb_enumvaldef *************************************************************/
+
+const upb_enumdef *upb_enumvaldef_enum(const upb_enumvaldef *ev) {
+ return ev->enum_;
+}
+
+const char *upb_enumvaldef_fullname(const upb_enumvaldef *ev) {
+ return ev->full_name;
+}
+
+const char *upb_enumvaldef_name(const upb_enumvaldef *ev) {
+ return shortdefname(ev->full_name);
+}
+
+int32_t upb_enumvaldef_number(const upb_enumvaldef *ev) {
+ return ev->number;
+}
+
+
/* upb_fielddef ***************************************************************/
const char *upb_fielddef_fullname(const upb_fielddef *f) {
@@ -386,10 +443,6 @@ const char *upb_fielddef_jsonname(const upb_fielddef *f) {
return f->json_name;
}
-uint32_t upb_fielddef_selectorbase(const upb_fielddef *f) {
- return f->selector_base;
-}
-
const upb_filedef *upb_fielddef_file(const upb_fielddef *f) {
return f->file;
}
@@ -407,6 +460,23 @@ const upb_oneofdef *upb_fielddef_realcontainingoneof(const upb_fielddef *f) {
return f->oneof;
}
+upb_msgval upb_fielddef_default(const upb_fielddef *f) {
+ UPB_ASSERT(!upb_fielddef_issubmsg(f));
+ upb_msgval ret;
+ if (upb_fielddef_isstring(f)) {
+ str_t *str = f->defaultval.str;
+ if (str) {
+ ret.str_val.data = str->str;
+ ret.str_val.size = str->len;
+ } else {
+ ret.str_val.size = 0;
+ }
+ } else {
+ memcpy(&ret, &f->defaultval, 8);
+ }
+ return ret;
+}
+
static void chkdefaulttype(const upb_fielddef *f, int ctype) {
UPB_UNUSED(f);
UPB_UNUSED(ctype);
@@ -470,9 +540,15 @@ const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f) {
}
const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f) {
+ UPB_ASSERT(!upb_fielddef_isextension(f));
return &f->msgdef->layout->fields[f->layout_index];
}
+const upb_msglayout_ext *_upb_fielddef_extlayout(const upb_fielddef *f) {
+ UPB_ASSERT(upb_fielddef_isextension(f));
+ return f->file->ext_layouts[f->layout_index];
+}
+
bool upb_fielddef_issubmsg(const upb_fielddef *f) {
return upb_fielddef_type(f) == UPB_TYPE_MESSAGE;
}
@@ -535,18 +611,10 @@ upb_syntax_t upb_msgdef_syntax(const upb_msgdef *m) {
return m->file->syntax;
}
-size_t upb_msgdef_selectorcount(const upb_msgdef *m) {
- return m->selector_count;
-}
-
-uint32_t upb_msgdef_submsgfieldcount(const upb_msgdef *m) {
- return m->submsg_field_count;
-}
-
const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i) {
upb_value val;
- return upb_inttable_lookup32(&m->itof, i, &val) ?
- upb_value_getconstptr(val) : NULL;
+ return upb_inttable_lookup(&m->itof, i, &val) ? upb_value_getconstptr(val)
+ : NULL;
}
const upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name,
@@ -611,6 +679,10 @@ int upb_msgdef_numrealoneofs(const upb_msgdef *m) {
return m->real_oneof_count;
}
+int upb_msgdef_extrangecount(const upb_msgdef *m) {
+ return m->ext_range_count;
+}
+
int upb_msgdef_fieldcount(const upb_msgdef *m) {
return m->field_count;
}
@@ -627,6 +699,11 @@ const upb_msglayout *upb_msgdef_layout(const upb_msgdef *m) {
return m->layout;
}
+const upb_extrange *upb_msgdef_extrange(const upb_msgdef *m, int i) {
+ UPB_ASSERT(i >= 0 && i < m->ext_range_count);
+ return &m->ext_ranges[i];
+}
+
const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i) {
UPB_ASSERT(i >= 0 && i < m->field_count);
return &m->fields[i];
@@ -754,8 +831,8 @@ const upb_fielddef *upb_oneofdef_ntof(const upb_oneofdef *o,
const upb_fielddef *upb_oneofdef_itof(const upb_oneofdef *o, uint32_t num) {
upb_value val;
- return upb_inttable_lookup32(&o->itof, num, &val) ?
- upb_value_getptr(val) : NULL;
+ return upb_inttable_lookup(&o->itof, num, &val) ? upb_value_getptr(val)
+ : NULL;
}
void upb_oneof_begin(upb_oneof_iter *iter, const upb_oneofdef *o) {
@@ -835,7 +912,6 @@ void upb_symtab_free(upb_symtab *s) {
upb_symtab *upb_symtab_new(void) {
upb_symtab *s = upb_gmalloc(sizeof(*s));
- upb_alloc *alloc;
if (!s) {
return NULL;
@@ -843,15 +919,21 @@ upb_symtab *upb_symtab_new(void) {
s->arena = upb_arena_new();
s->bytes_loaded = 0;
- alloc = upb_arena_alloc(s->arena);
- if (!upb_strtable_init2(&s->syms, UPB_CTYPE_CONSTPTR, 32, alloc) ||
- !upb_strtable_init2(&s->files, UPB_CTYPE_CONSTPTR, 4, alloc)) {
- upb_arena_free(s->arena);
- upb_gfree(s);
- s = NULL;
+ if (!upb_strtable_init(&s->syms, 32, s->arena) ||
+ !upb_strtable_init(&s->files, 4, s->arena) ||
+ !upb_inttable_init(&s->exts, s->arena)) {
+ goto err;
}
+
+ s->extreg = upb_extreg_new(s->arena);
+ if (!s->extreg) goto err;
return s;
+
+err:
+ upb_arena_free(s->arena);
+ upb_gfree(s);
+ return NULL;
}
const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym) {
@@ -860,11 +942,16 @@ const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym) {
unpack_def(v, UPB_DEFTYPE_MSG) : NULL;
}
+static const void *symtab_lookup2(const upb_symtab *s, const char *sym,
+ size_t size, upb_deftype_t type) {
+ upb_value v;
+ return upb_strtable_lookup2(&s->syms, sym, size, &v) ? unpack_def(v, type)
+ : NULL;
+}
+
const upb_msgdef *upb_symtab_lookupmsg2(const upb_symtab *s, const char *sym,
size_t len) {
- upb_value v;
- return upb_strtable_lookup2(&s->syms, sym, len, &v) ?
- unpack_def(v, UPB_DEFTYPE_MSG) : NULL;
+ return symtab_lookup2(s, sym, len, UPB_DEFTYPE_MSG);
}
const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym) {
@@ -873,6 +960,37 @@ const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym) {
unpack_def(v, UPB_DEFTYPE_ENUM) : NULL;
}
+const upb_enumvaldef *upb_symtab_lookupenumval(const upb_symtab *s,
+ const char *sym) {
+ upb_value v;
+ return upb_strtable_lookup(&s->syms, sym, &v)
+ ? unpack_def(v, UPB_DEFTYPE_ENUMVAL)
+ : NULL;
+}
+
+const upb_fielddef *upb_symtab_lookupext2(const upb_symtab *s, const char *name,
+ size_t size) {
+ upb_value v;
+ if (!upb_strtable_lookup2(&s->syms, name, size, &v)) return NULL;
+
+ switch (deftype(v)) {
+ case UPB_DEFTYPE_FIELD:
+ return unpack_def(v, UPB_DEFTYPE_FIELD);
+ case UPB_DEFTYPE_MSG: {
+ const upb_msgdef *m = unpack_def(v, UPB_DEFTYPE_MSG);
+ return m->message_set_ext; /* May be NULL if not in MessageeSet. */
+ }
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+const upb_fielddef *upb_symtab_lookupext(const upb_symtab *s, const char *sym) {
+ return upb_symtab_lookupext2(s, sym, strlen(sym));
+}
+
const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name) {
upb_value v;
return upb_strtable_lookup(&s->files, name, &v) ? upb_value_getconstptr(v)
@@ -902,14 +1020,16 @@ int upb_symtab_filecount(const upb_symtab *s) {
typedef struct {
upb_symtab *symtab;
upb_filedef *file; /* File we are building. */
- upb_arena *file_arena; /* Allocate defs here. */
- upb_alloc *alloc; /* Alloc of file_arena, for tables. */
- const upb_msglayout **layouts; /* NULL if we should build layouts. */
+ upb_arena *arena; /* Allocate defs here. */
+ const upb_msglayout_file *layout; /* NULL if we should build layouts. */
+ int enum_count; /* Count of enums built so far. */
+ int msg_count; /* Count of messages built so far. */
+ int ext_count; /* Count of extensions built so far. */
upb_status *status; /* Record errors here. */
jmp_buf err; /* longjmp() on error. */
} symtab_addctx;
-UPB_NORETURN UPB_NOINLINE
+UPB_NORETURN UPB_NOINLINE UPB_PRINTF(2, 3)
static void symtab_errf(symtab_addctx *ctx, const char *fmt, ...) {
va_list argp;
va_start(argp, fmt);
@@ -925,7 +1045,7 @@ static void symtab_oomerr(symtab_addctx *ctx) {
}
void *symtab_alloc(symtab_addctx *ctx, size_t bytes) {
- void *ret = upb_arena_malloc(ctx->file_arena, bytes);
+ void *ret = upb_arena_malloc(ctx->arena, bytes);
if (!ret) symtab_oomerr(ctx);
return ret;
}
@@ -1015,13 +1135,71 @@ static int field_number_cmp(const void *p1, const void *p2) {
return f1->number - f2->number;
}
-static void assign_layout_indices(const upb_msgdef *m, upb_msglayout_field *fields) {
+static void assign_layout_indices(const upb_msgdef *m, upb_msglayout *l,
+ upb_msglayout_field *fields) {
int i;
int n = upb_msgdef_numfields(m);
+ int dense_below = 0;
for (i = 0; i < n; i++) {
upb_fielddef *f = (upb_fielddef*)upb_msgdef_itof(m, fields[i].number);
UPB_ASSERT(f);
f->layout_index = i;
+ if (i < UINT8_MAX && fields[i].number == i + 1 &&
+ (i == 0 || fields[i-1].number == i)) {
+ dense_below = i + 1;
+ }
+ }
+ l->dense_below = dense_below;
+}
+
+static void fill_fieldlayout(upb_msglayout_field *field, const upb_fielddef *f) {
+ field->number = upb_fielddef_number(f);
+ field->descriptortype = upb_fielddef_descriptortype(f);
+
+ if (field->descriptortype == UPB_DTYPE_STRING &&
+ f->file->syntax == UPB_SYNTAX_PROTO2) {
+ /* See TableDescriptorType() in upbc/generator.cc for details and
+ * rationale. */
+ field->descriptortype = UPB_DTYPE_BYTES;
+ }
+
+ if (upb_fielddef_ismap(f)) {
+ field->mode = _UPB_MODE_MAP | (_UPB_REP_PTR << _UPB_REP_SHIFT);
+ } else if (upb_fielddef_isseq(f)) {
+ field->mode = _UPB_MODE_ARRAY | (_UPB_REP_PTR << _UPB_REP_SHIFT);
+ } else {
+ /* Maps descriptor type -> elem_size_lg2. */
+ static const uint8_t sizes[] = {
+ -1, /* invalid descriptor type */
+ _UPB_REP_8BYTE, /* DOUBLE */
+ _UPB_REP_4BYTE, /* FLOAT */
+ _UPB_REP_8BYTE, /* INT64 */
+ _UPB_REP_8BYTE, /* UINT64 */
+ _UPB_REP_4BYTE, /* INT32 */
+ _UPB_REP_8BYTE, /* FIXED64 */
+ _UPB_REP_4BYTE, /* FIXED32 */
+ _UPB_REP_1BYTE, /* BOOL */
+ _UPB_REP_STRVIEW, /* STRING */
+ _UPB_REP_PTR, /* GROUP */
+ _UPB_REP_PTR, /* MESSAGE */
+ _UPB_REP_STRVIEW, /* BYTES */
+ _UPB_REP_4BYTE, /* UINT32 */
+ _UPB_REP_4BYTE, /* ENUM */
+ _UPB_REP_4BYTE, /* SFIXED32 */
+ _UPB_REP_8BYTE, /* SFIXED64 */
+ _UPB_REP_4BYTE, /* SINT32 */
+ _UPB_REP_8BYTE, /* SINT64 */
+ };
+ field->mode =
+ _UPB_MODE_SCALAR | (sizes[field->descriptortype] << _UPB_REP_SHIFT);
+ }
+
+ if (upb_fielddef_packed(f)) {
+ field->mode |= _UPB_MODE_IS_PACKED;
+ }
+
+ if (upb_fielddef_isextension(f)) {
+ field->mode |= _UPB_MODE_IS_EXTENSION;
}
}
@@ -1032,20 +1210,38 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
upb_msg_field_iter it;
upb_msg_oneof_iter oit;
size_t hasbit;
- size_t submsg_count = m->submsg_field_count;
- const upb_msglayout **submsgs;
+ size_t field_count = upb_msgdef_numfields(m);
+ size_t sublayout_count = 0;
+ upb_msglayout_sub *subs;
upb_msglayout_field *fields;
memset(l, 0, sizeof(*l) + sizeof(_upb_fasttable_entry));
- fields = symtab_alloc(ctx, upb_msgdef_numfields(m) * sizeof(*fields));
- submsgs = symtab_alloc(ctx, submsg_count * sizeof(*submsgs));
+ /* Count sub-messages. */
+ for (size_t i = 0; i < field_count; i++) {
+ if (upb_fielddef_issubmsg(&m->fields[i])) {
+ sublayout_count++;
+ }
+ }
+
+ fields = symtab_alloc(ctx, field_count * sizeof(*fields));
+ subs = symtab_alloc(ctx, sublayout_count * sizeof(*subs));
l->field_count = upb_msgdef_numfields(m);
l->fields = fields;
- l->submsgs = submsgs;
+ l->subs = subs;
l->table_mask = 0;
+ if (upb_msgdef_extrangecount(m) > 0) {
+ if (m->is_message_set) {
+ l->ext = _UPB_MSGEXT_MSGSET;
+ } else {
+ l->ext = _UPB_MSGEXT_EXTENDABLE;
+ }
+ } else {
+ l->ext = _UPB_MSGEXT_NONE;
+ }
+
/* TODO(haberman): initialize fast tables so that reflection-based parsing
* can get the same speeds as linked-in types. */
l->fasttable[0].field_parser = &fastdecode_generic;
@@ -1058,8 +1254,8 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
const upb_fielddef *val = upb_msgdef_itof(m, 2);
fields[0].number = 1;
fields[1].number = 2;
- fields[0].label = UPB_LABEL_OPTIONAL;
- fields[1].label = UPB_LABEL_OPTIONAL;
+ fields[0].mode = _UPB_MODE_SCALAR;
+ fields[1].mode = _UPB_MODE_SCALAR;
fields[0].presence = 0;
fields[1].presence = 0;
fields[0].descriptortype = upb_fielddef_descriptortype(key);
@@ -1069,7 +1265,7 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
fields[1].submsg_index = 0;
if (upb_fielddef_type(val) == UPB_TYPE_MESSAGE) {
- submsgs[0] = upb_fielddef_msgsubdef(val)->layout;
+ subs[0].submsg = upb_fielddef_msgsubdef(val)->layout;
}
l->field_count = 2;
@@ -1088,34 +1284,19 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
*/
/* Allocate hasbits and set basic field attributes. */
- submsg_count = 0;
+ sublayout_count = 0;
for (upb_msg_field_begin(&it, m), hasbit = 0;
!upb_msg_field_done(&it);
upb_msg_field_next(&it)) {
upb_fielddef* f = upb_msg_iter_field(&it);
upb_msglayout_field *field = &fields[upb_fielddef_index(f)];
- field->number = upb_fielddef_number(f);
- field->descriptortype = upb_fielddef_descriptortype(f);
- field->label = upb_fielddef_label(f);
-
- if (field->descriptortype == UPB_DTYPE_STRING &&
- f->file->syntax == UPB_SYNTAX_PROTO2) {
- /* See TableDescriptorType() in upbc/generator.cc for details and
- * rationale. */
- field->descriptortype = UPB_DTYPE_BYTES;
- }
-
- if (upb_fielddef_ismap(f)) {
- field->label = _UPB_LABEL_MAP;
- } else if (upb_fielddef_packed(f)) {
- field->label = _UPB_LABEL_PACKED;
- }
+ fill_fieldlayout(field, f);
if (upb_fielddef_issubmsg(f)) {
const upb_msgdef *subm = upb_fielddef_msgsubdef(f);
- field->submsg_index = submsg_count++;
- submsgs[field->submsg_index] = subm->layout;
+ field->submsg_index = sublayout_count++;
+ subs[field->submsg_index].submsg = subm->layout;
}
if (upb_fielddef_haspresence(f) && !upb_fielddef_realcontainingoneof(f)) {
@@ -1186,54 +1367,13 @@ static void make_layout(symtab_addctx *ctx, const upb_msgdef *m) {
/* Sort fields by number. */
qsort(fields, upb_msgdef_numfields(m), sizeof(*fields), field_number_cmp);
- assign_layout_indices(m, fields);
-}
-
-static void assign_msg_indices(symtab_addctx *ctx, upb_msgdef *m) {
- /* Sort fields. upb internally relies on UPB_TYPE_MESSAGE fields having the
- * lowest indexes, but we do not publicly guarantee this. */
- upb_msg_field_iter j;
- int i;
- uint32_t selector;
- int n = upb_msgdef_numfields(m);
- upb_fielddef **fields;
-
- if (n == 0) {
- m->selector_count = UPB_STATIC_SELECTOR_COUNT;
- m->submsg_field_count = 0;
- return;
- }
-
- fields = upb_gmalloc(n * sizeof(*fields));
-
- m->submsg_field_count = 0;
- for(i = 0, upb_msg_field_begin(&j, m);
- !upb_msg_field_done(&j);
- upb_msg_field_next(&j), i++) {
- upb_fielddef *f = upb_msg_iter_field(&j);
- UPB_ASSERT(f->msgdef == m);
- if (upb_fielddef_issubmsg(f)) {
- m->submsg_field_count++;
- }
- fields[i] = f;
- }
-
- qsort(fields, n, sizeof(*fields), cmp_fields);
-
- selector = UPB_STATIC_SELECTOR_COUNT + m->submsg_field_count;
- for (i = 0; i < n; i++) {
- upb_fielddef *f = fields[i];
- f->index_ = i;
- f->selector_base = selector + upb_handlers_selectorbaseoffset(f);
- selector += upb_handlers_selectorcount(f);
- }
- m->selector_count = selector;
-
- upb_gfree(fields);
+ assign_layout_indices(m, l, fields);
}
static char *strviewdup(symtab_addctx *ctx, upb_strview view) {
- return upb_strdup2(view.data, view.size, ctx->alloc);
+ char *ret = upb_strdup2(view.data, view.size, ctx->arena);
+ CHK_OOM(ret);
+ return ret;
}
static bool streql2(const char *a, size_t n, const char *b) {
@@ -1341,12 +1481,14 @@ static char* makejsonname(symtab_addctx *ctx, const char* name) {
}
static void symtab_add(symtab_addctx *ctx, const char *name, upb_value v) {
+ // TODO: table should support an operation "tryinsert" to avoid the double
+ // lookup.
if (upb_strtable_lookup(&ctx->symtab->syms, name, NULL)) {
symtab_errf(ctx, "duplicate symbol '%s'", name);
}
- upb_alloc *alloc = upb_arena_alloc(ctx->symtab->arena);
size_t len = strlen(name);
- CHK_OOM(upb_strtable_insert3(&ctx->symtab->syms, name, len, v, alloc));
+ CHK_OOM(upb_strtable_insert(&ctx->symtab->syms, name, len, v,
+ ctx->symtab->arena));
}
/* Given a symbol and the base symbol inside which it is defined, find the
@@ -1379,7 +1521,8 @@ static const void *symtab_resolve(symtab_addctx *ctx, const upb_fielddef *f,
}
notfound:
- symtab_errf(ctx, "couldn't resolve name '%s'", sym.data);
+ symtab_errf(ctx, "couldn't resolve name '" UPB_STRVIEW_FORMAT "'",
+ UPB_STRVIEW_ARGS(sym));
}
static void create_oneofdef(
@@ -1397,10 +1540,10 @@ static void create_oneofdef(
v = pack_def(o, UPB_DEFTYPE_ONEOF);
symtab_add(ctx, o->full_name, v);
- CHK_OOM(upb_strtable_insert3(&m->ntof, name.data, name.size, v, ctx->alloc));
+ CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, v, ctx->arena));
- CHK_OOM(upb_inttable_init2(&o->itof, UPB_CTYPE_CONSTPTR, ctx->alloc));
- CHK_OOM(upb_strtable_init2(&o->ntof, UPB_CTYPE_CONSTPTR, 4, ctx->alloc));
+ CHK_OOM(upb_inttable_init(&o->itof, ctx->arena));
+ CHK_OOM(upb_strtable_init(&o->ntof, 4, ctx->arena));
}
static str_t *newstr(symtab_addctx *ctx, const char *data, size_t len) {
@@ -1448,16 +1591,15 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
}
case UPB_TYPE_ENUM: {
const upb_enumdef *e = f->sub.enumdef;
- int32_t val;
- if (!upb_enumdef_ntoi(e, str, len, &val)) {
+ const upb_enumvaldef *ev = upb_enumdef_lookupname(e, str, len);
+ if (!ev) {
goto invalid;
}
- f->defaultval.sint = val;
+ f->defaultval.sint = ev->number;
break;
}
case UPB_TYPE_INT64: {
- /* XXX: Need to write our own strtoll, since it's not available in c89. */
- int64_t val = strtol(str, &end, 0);
+ long long val = strtoll(str, &end, 0);
if (val > INT64_MAX || val < INT64_MIN || errno == ERANGE || *end) {
goto invalid;
}
@@ -1473,8 +1615,7 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
break;
}
case UPB_TYPE_UINT64: {
- /* XXX: Need to write our own strtoull, since it's not available in c89. */
- uint64_t val = strtoul(str, &end, 0);
+ unsigned long long val = strtoull(str, &end, 0);
if (val > UINT64_MAX || errno == ERANGE || *end) {
goto invalid;
}
@@ -1490,8 +1631,7 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
break;
}
case UPB_TYPE_FLOAT: {
- /* XXX: Need to write our own strtof, since it's not available in c89. */
- float val = strtod(str, &end);
+ float val = strtof(str, &end);
if (errno == ERANGE || *end) {
goto invalid;
}
@@ -1523,7 +1663,7 @@ static void parse_default(symtab_addctx *ctx, const char *str, size_t len,
return;
invalid:
- symtab_errf(ctx, "Invalid default '%.*s' for field %f", (int)len, str,
+ symtab_errf(ctx, "Invalid default '%.*s' for field %s", (int)len, str,
upb_fielddef_fullname(f));
}
@@ -1557,7 +1697,6 @@ static void set_default_default(symtab_addctx *ctx, upb_fielddef *f) {
static void create_fielddef(
symtab_addctx *ctx, const char *prefix, upb_msgdef *m,
const google_protobuf_FieldDescriptorProto *field_proto) {
- upb_alloc *alloc = ctx->alloc;
upb_fielddef *f;
const google_protobuf_FieldOptions *options;
upb_strview name;
@@ -1593,7 +1732,8 @@ static void create_fielddef(
upb_value v, field_v, json_v;
size_t json_size;
- f = (upb_fielddef*)&m->fields[m->field_count++];
+ f = (upb_fielddef*)&m->fields[m->field_count];
+ f->index_ = m->field_count++;
f->msgdef = m;
f->is_extension_ = false;
@@ -1614,20 +1754,19 @@ static void create_fielddef(
v = upb_value_constptr(f);
json_size = strlen(json_name);
- CHK_OOM(
- upb_strtable_insert3(&m->ntof, name.data, name.size, field_v, alloc));
- CHK_OOM(upb_inttable_insert2(&m->itof, field_number, v, alloc));
+ CHK_OOM(upb_strtable_insert(&m->ntof, name.data, name.size, field_v,
+ ctx->arena));
+ CHK_OOM(upb_inttable_insert(&m->itof, field_number, v, ctx->arena));
if (strcmp(shortname, json_name) != 0) {
- upb_strtable_insert3(&m->ntof, json_name, json_size, json_v, alloc);
+ upb_strtable_insert(&m->ntof, json_name, json_size, json_v, ctx->arena);
}
- if (ctx->layouts) {
+ if (ctx->layout) {
const upb_msglayout_field *fields = m->layout->fields;
int count = m->layout->field_count;
bool found = false;
- int i;
- for (i = 0; i < count; i++) {
+ for (int i = 0; i < count; i++) {
if (fields[i].number == field_number) {
f->layout_index = i;
found = true;
@@ -1638,9 +1777,15 @@ static void create_fielddef(
}
} else {
/* extension field. */
- f = (upb_fielddef*)&ctx->file->exts[ctx->file->ext_count++];
+ uint16_t layout_index = ctx->ext_count++;
+ f = (upb_fielddef*)&ctx->file->exts[layout_index];
+ f->layout_index = layout_index;
f->is_extension_ = true;
symtab_add(ctx, full_name, pack_def(f, UPB_DEFTYPE_FIELD));
+ if (ctx->layout) {
+ UPB_ASSERT(ctx->file->ext_layouts[f->layout_index]->field.number ==
+ field_number);
+ }
}
f->full_name = full_name;
@@ -1682,15 +1827,16 @@ static void create_fielddef(
symtab_errf(ctx, "oneof_index out of range (%s)", f->full_name);
}
- oneof = (upb_oneofdef*)&m->oneofs[oneof_index];
+ oneof = (upb_oneofdef *)&m->oneofs[oneof_index];
f->oneof = oneof;
oneof->field_count++;
if (f->proto3_optional_) {
oneof->synthetic = true;
}
- CHK_OOM(upb_inttable_insert2(&oneof->itof, f->number_, v, alloc));
- CHK_OOM(upb_strtable_insert3(&oneof->ntof, name.data, name.size, v, alloc));
+ CHK_OOM(upb_inttable_insert(&oneof->itof, f->number_, v, ctx->arena));
+ CHK_OOM(
+ upb_strtable_insert(&oneof->ntof, name.data, name.size, v, ctx->arena));
} else {
f->oneof = NULL;
if (f->proto3_optional_) {
@@ -1728,16 +1874,18 @@ static void create_enumdef(
name = google_protobuf_EnumDescriptorProto_name(enum_proto);
check_ident(ctx, name, false);
- e = (upb_enumdef*)&ctx->file->enums[ctx->file->enum_count++];
+ e = (upb_enumdef*)&ctx->file->enums[ctx->enum_count++];
e->full_name = makefullname(ctx, prefix, name);
symtab_add(ctx, e->full_name, pack_def(e, UPB_DEFTYPE_ENUM));
values = google_protobuf_EnumDescriptorProto_value(enum_proto, &n);
- CHK_OOM(upb_strtable_init2(&e->ntoi, UPB_CTYPE_INT32, n, ctx->alloc));
- CHK_OOM(upb_inttable_init2(&e->iton, UPB_CTYPE_CSTR, ctx->alloc));
+ CHK_OOM(upb_strtable_init(&e->ntoi, n, ctx->arena));
+ CHK_OOM(upb_inttable_init(&e->iton, ctx->arena));
e->file = ctx->file;
e->defaultval = 0;
+ e->value_count = n;
+ e->values = symtab_alloc(ctx, sizeof(*e->values) * n);
if (n == 0) {
symtab_errf(ctx, "enums must contain at least one value (%s)",
@@ -1745,32 +1893,30 @@ static void create_enumdef(
}
for (i = 0; i < n; i++) {
- const google_protobuf_EnumValueDescriptorProto *value = values[i];
- upb_strview name = google_protobuf_EnumValueDescriptorProto_name(value);
- char *name2 = strviewdup(ctx, name);
- int32_t num = google_protobuf_EnumValueDescriptorProto_number(value);
- upb_value v = upb_value_int32(num);
+ const google_protobuf_EnumValueDescriptorProto *val_proto = values[i];
+ upb_enumvaldef *val = (upb_enumvaldef*)&e->values[i];
+ upb_strview name = google_protobuf_EnumValueDescriptorProto_name(val_proto);
+ upb_value v = upb_value_constptr(val);
+
+ val->enum_ = e;
+ val->full_name = makefullname(ctx, prefix, name);
+ val->number = google_protobuf_EnumValueDescriptorProto_number(val_proto);
+ symtab_add(ctx, val->full_name, pack_def(val, UPB_DEFTYPE_ENUMVAL));
- if (i == 0 && e->file->syntax == UPB_SYNTAX_PROTO3 && num != 0) {
+ if (i == 0 && e->file->syntax == UPB_SYNTAX_PROTO3 && val->number != 0) {
symtab_errf(ctx, "for proto3, the first enum value must be zero (%s)",
e->full_name);
}
- if (upb_strtable_lookup(&e->ntoi, name2, NULL)) {
- symtab_errf(ctx, "duplicate enum label '%s'", name2);
- }
-
- CHK_OOM(name2)
- CHK_OOM(
- upb_strtable_insert3(&e->ntoi, name2, strlen(name2), v, ctx->alloc));
+ CHK_OOM(upb_strtable_insert(&e->ntoi, name.data, name.size, v, ctx->arena));
- if (!upb_inttable_lookup(&e->iton, num, NULL)) {
- upb_value v = upb_value_cstr(name2);
- CHK_OOM(upb_inttable_insert2(&e->iton, num, v, ctx->alloc));
+ // Multiple enumerators can have the same number, first one wins.
+ if (!upb_inttable_lookup(&e->iton, val->number, NULL)) {
+ CHK_OOM(upb_inttable_insert(&e->iton, val->number, v, ctx->arena));
}
}
- upb_inttable_compact2(&e->iton, ctx->alloc);
+ upb_inttable_compact(&e->iton, ctx->arena);
}
static void create_msgdef(symtab_addctx *ctx, const char *prefix,
@@ -1781,35 +1927,44 @@ static void create_msgdef(symtab_addctx *ctx, const char *prefix,
const google_protobuf_FieldDescriptorProto *const *fields;
const google_protobuf_EnumDescriptorProto *const *enums;
const google_protobuf_DescriptorProto *const *msgs;
- size_t i, n_oneof, n_field, n;
+ const google_protobuf_DescriptorProto_ExtensionRange *const *ext_ranges;
+ size_t i, n_oneof, n_field, n_ext_range, n;
upb_strview name;
name = google_protobuf_DescriptorProto_name(msg_proto);
check_ident(ctx, name, false);
- m = (upb_msgdef*)&ctx->file->msgs[ctx->file->msg_count++];
+ int msg_index = ctx->msg_count;
+ m = (upb_msgdef*)&ctx->file->msgs[msg_index];
m->full_name = makefullname(ctx, prefix, name);
+ ctx->msg_count++;
symtab_add(ctx, m->full_name, pack_def(m, UPB_DEFTYPE_MSG));
oneofs = google_protobuf_DescriptorProto_oneof_decl(msg_proto, &n_oneof);
fields = google_protobuf_DescriptorProto_field(msg_proto, &n_field);
+ ext_ranges =
+ google_protobuf_DescriptorProto_extension_range(msg_proto, &n_ext_range);
- CHK_OOM(upb_inttable_init2(&m->itof, UPB_CTYPE_CONSTPTR, ctx->alloc));
- CHK_OOM(upb_strtable_init2(&m->ntof, UPB_CTYPE_CONSTPTR, n_oneof + n_field,
- ctx->alloc));
+ CHK_OOM(upb_inttable_init(&m->itof, ctx->arena));
+ CHK_OOM(upb_strtable_init(&m->ntof, n_oneof + n_field, ctx->arena));
m->file = ctx->file;
m->map_entry = false;
+ m->is_message_set = false;
+ m->message_set_ext = NULL;
options = google_protobuf_DescriptorProto_options(msg_proto);
if (options) {
m->map_entry = google_protobuf_MessageOptions_map_entry(options);
+ m->is_message_set =
+ google_protobuf_MessageOptions_message_set_wire_format(options);
}
- if (ctx->layouts) {
- m->layout = *ctx->layouts;
- ctx->layouts++;
+ if (ctx->layout) {
+ /* create_fielddef() below depends on this being set. */
+ m->layout = ctx->layout->msgs[msg_index];
+ UPB_ASSERT(n_field == m->layout->field_count);
} else {
/* Allocate now (to allow cross-linking), populate later. */
m->layout = symtab_alloc(
@@ -1828,10 +1983,18 @@ static void create_msgdef(symtab_addctx *ctx, const char *prefix,
create_fielddef(ctx, m->full_name, m, fields[i]);
}
- assign_msg_indices(ctx, m);
+ m->ext_range_count = n_ext_range;
+ m->ext_ranges = symtab_alloc(ctx, sizeof(*m->ext_ranges) * n_ext_range);
+ for (i = 0; i < n_ext_range; i++) {
+ const google_protobuf_DescriptorProto_ExtensionRange *r = ext_ranges[i];
+ upb_extrange *r_def = (upb_extrange*)&m->ext_ranges[i];
+ r_def->start = google_protobuf_DescriptorProto_ExtensionRange_start(r);
+ r_def->end = google_protobuf_DescriptorProto_ExtensionRange_end(r);
+ }
+
finalize_oneofs(ctx, m);
assign_msg_wellknowntype(m);
- upb_inttable_compact2(&m->itof, ctx->alloc);
+ upb_inttable_compact(&m->itof, ctx->arena);
/* This message is built. Now build nested messages and enums. */
@@ -1840,6 +2003,11 @@ static void create_msgdef(symtab_addctx *ctx, const char *prefix,
create_enumdef(ctx, m->full_name, enums[i]);
}
+ fields = google_protobuf_DescriptorProto_extension(msg_proto, &n);
+ for (i = 0; i < n; i++) {
+ create_fielddef(ctx, m->full_name, NULL, fields[i]);
+ }
+
msgs = google_protobuf_DescriptorProto_nested_type(msg_proto, &n);
for (i = 0; i < n; i++) {
create_msgdef(ctx, m->full_name, msgs[i]);
@@ -1896,6 +2064,22 @@ static void resolve_fielddef(symtab_addctx *ctx, const char *prefix,
name = google_protobuf_FieldDescriptorProto_extendee(field_proto);
f->msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG);
+
+ const upb_msglayout_ext *ext = ctx->file->ext_layouts[f->layout_index];
+ if (ctx->layout) {
+ UPB_ASSERT(upb_fielddef_number(f) == ext->field.number);
+ } else {
+ upb_msglayout_ext *mut_ext = (upb_msglayout_ext*)ext;
+ fill_fieldlayout(&mut_ext->field, f);
+ mut_ext->field.presence = 0;
+ mut_ext->field.offset = 0;
+ mut_ext->field.submsg_index = 0;
+ mut_ext->extendee = f->msgdef->layout;
+ mut_ext->sub.submsg = f->sub.msgdef->layout;
+ }
+
+ CHK_OOM(upb_inttable_insert(&ctx->symtab->exts, (uintptr_t)ext,
+ upb_value_constptr(f), ctx->arena));
}
if ((upb_fielddef_issubmsg(f) || f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) &&
@@ -1907,6 +2091,13 @@ static void resolve_fielddef(symtab_addctx *ctx, const char *prefix,
if (upb_fielddef_issubmsg(f)) {
f->sub.msgdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_MSG);
+ if (f->is_extension_ && f->msgdef->is_message_set &&
+ f->file == f->msgdef->file) {
+ // TODO: When defs are restructured to follow message nesting, we can make
+ // this check more robust. The actual rules for what make something
+ // qualify as a MessageSet item are more strict.
+ ((upb_msgdef*)f->sub.msgdef)->message_set_ext = f;
+ }
} else if (f->type_ == UPB_DESCRIPTOR_TYPE_ENUM) {
f->sub.enumdef = symtab_resolve(ctx, f, prefix, name, UPB_DEFTYPE_ENUM);
}
@@ -1943,16 +2134,37 @@ static void build_filedef(
const upb_strview* strs;
size_t i, n;
- count_types_in_file(file_proto, file);
+ file->symtab = ctx->symtab;
+ /* One pass to count and allocate. */
+ file->msg_count = 0;
+ file->enum_count = 0;
+ file->ext_count = 0;
+ count_types_in_file(file_proto, file);
file->msgs = symtab_alloc(ctx, sizeof(*file->msgs) * file->msg_count);
file->enums = symtab_alloc(ctx, sizeof(*file->enums) * file->enum_count);
file->exts = symtab_alloc(ctx, sizeof(*file->exts) * file->ext_count);
- /* We increment these as defs are added. */
- file->msg_count = 0;
- file->enum_count = 0;
- file->ext_count = 0;
+ ctx->msg_count = 0;
+ ctx->enum_count = 0;
+ ctx->ext_count = 0;
+
+ if (ctx->layout) {
+ /* We are using the ext layouts that were passed in. */
+ file->ext_layouts = ctx->layout->exts;
+ if (ctx->layout->ext_count != file->ext_count) {
+ symtab_errf(ctx, "Extension count did not match layout (%d vs %d)",
+ ctx->layout->ext_count, file->ext_count);
+ }
+ } else {
+ /* We are building ext layouts from scratch. */
+ file->ext_layouts =
+ symtab_alloc(ctx, sizeof(*file->ext_layouts) * file->ext_count);
+ upb_msglayout_ext *ext = symtab_alloc(ctx, sizeof(*ext) * file->ext_count);
+ for (int i = 0; i < file->ext_count; i++) {
+ file->ext_layouts[i] = &ext[i];
+ }
+ }
if (!google_protobuf_FileDescriptorProto_has_name(file_proto)) {
symtab_errf(ctx, "File has no name");
@@ -2033,11 +2245,12 @@ static void build_filedef(
/* Create extensions. */
exts = google_protobuf_FileDescriptorProto_extension(file_proto, &n);
- file->exts = symtab_alloc(ctx, sizeof(*file->exts) * n);
for (i = 0; i < n; i++) {
create_fielddef(ctx, file->package, NULL, exts[i]);
}
+ UPB_ASSERT(ctx->ext_count == file->ext_count);
+
/* Now that all names are in the table, build layouts and resolve refs. */
for (i = 0; i < (size_t)file->ext_count; i++) {
resolve_fielddef(ctx, file->package, (upb_fielddef*)&file->exts[i]);
@@ -2051,70 +2264,73 @@ static void build_filedef(
}
}
- if (!ctx->layouts) {
+ if (!ctx->layout) {
for (i = 0; i < (size_t)file->msg_count; i++) {
const upb_msgdef *m = &file->msgs[i];
make_layout(ctx, m);
}
}
+
+ CHK_OOM(
+ _upb_extreg_add(ctx->symtab->extreg, file->ext_layouts, file->ext_count));
}
-static void remove_filedef(upb_symtab *s, upb_filedef *file) {
- upb_alloc *alloc = upb_arena_alloc(s->arena);
+static void remove_filedef(symtab_addctx *ctx, upb_symtab *s, upb_filedef *file) {
int i;
- for (i = 0; i < file->msg_count; i++) {
+ for (i = 0; i < ctx->msg_count; i++) {
const char *name = file->msgs[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+ upb_strtable_remove(&s->syms, name, strlen(name), NULL);
}
- for (i = 0; i < file->enum_count; i++) {
+ for (i = 0; i < ctx->enum_count; i++) {
const char *name = file->enums[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+ upb_strtable_remove(&s->syms, name, strlen(name), NULL);
}
- for (i = 0; i < file->ext_count; i++) {
+ for (i = 0; i < ctx->ext_count; i++) {
const char *name = file->exts[i].full_name;
- upb_strtable_remove3(&s->syms, name, strlen(name), NULL, alloc);
+ upb_strtable_remove(&s->syms, name, strlen(name), NULL);
}
}
static const upb_filedef *_upb_symtab_addfile(
upb_symtab *s, const google_protobuf_FileDescriptorProto *file_proto,
- const upb_msglayout **layouts, upb_status *status) {
- upb_arena *file_arena = upb_arena_new();
- upb_filedef *file;
+ const upb_msglayout_file *layout, upb_status *status) {
symtab_addctx ctx;
+ upb_strview name = google_protobuf_FileDescriptorProto_name(file_proto);
- if (!file_arena) return NULL;
-
- file = upb_arena_malloc(file_arena, sizeof(*file));
- if (!file) goto done;
+ if (upb_strtable_lookup2(&s->files, name.data, name.size, NULL)) {
+ upb_status_seterrf(status, "duplicate file name (%.*s)",
+ UPB_STRVIEW_ARGS(name));
+ return NULL;
+ }
- ctx.file = file;
ctx.symtab = s;
- ctx.file_arena = file_arena;
- ctx.alloc = upb_arena_alloc(file_arena);
- ctx.layouts = layouts;
+ ctx.layout = layout;
ctx.status = status;
+ ctx.file = NULL;
+ ctx.arena = upb_arena_new();
- file->msg_count = 0;
- file->enum_count = 0;
- file->ext_count = 0;
- file->symtab = s;
+ if (!ctx.arena) {
+ upb_status_setoom(status);
+ return NULL;
+ }
if (UPB_UNLIKELY(UPB_SETJMP(ctx.err))) {
UPB_ASSERT(!upb_ok(status));
- remove_filedef(s, file);
- file = NULL;
+ if (ctx.file) {
+ remove_filedef(&ctx, s, ctx.file);
+ ctx.file = NULL;
+ }
} else {
- build_filedef(&ctx, file, file_proto);
- upb_strtable_insert3(&s->files, file->name, strlen(file->name),
- upb_value_constptr(file), ctx.alloc);
+ ctx.file = symtab_alloc(&ctx, sizeof(*ctx.file));
+ build_filedef(&ctx, ctx.file, file_proto);
+ upb_strtable_insert(&s->files, name.data, name.size,
+ upb_value_constptr(ctx.file), ctx.arena);
UPB_ASSERT(upb_ok(status));
- upb_arena_fuse(s->arena, file_arena);
+ upb_arena_fuse(s->arena, ctx.arena);
}
-done:
- upb_arena_free(file_arena);
- return file;
+ upb_arena_free(ctx.arena);
+ return ctx.file;
}
const upb_filedef *upb_symtab_addfile(
@@ -2147,7 +2363,8 @@ bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) {
}
file = google_protobuf_FileDescriptorProto_parse_ex(
- init->descriptor.data, init->descriptor.size, arena, UPB_DECODE_ALIAS);
+ init->descriptor.data, init->descriptor.size, NULL, UPB_DECODE_ALIAS,
+ arena);
s->bytes_loaded += init->descriptor.size;
if (!file) {
@@ -2159,14 +2376,16 @@ bool _upb_symtab_loaddefinit(upb_symtab *s, const upb_def_init *init) {
goto err;
}
- if (!_upb_symtab_addfile(s, file, init->layouts, &status)) goto err;
+ if (!_upb_symtab_addfile(s, file, init->layout, &status)) goto err;
upb_arena_free(arena);
return true;
err:
- fprintf(stderr, "Error loading compiled-in descriptor: %s\n",
- upb_status_errmsg(&status));
+ fprintf(stderr,
+ "Error loading compiled-in descriptor for file '%s' (this should "
+ "never happen): %s\n",
+ init->filename, upb_status_errmsg(&status));
upb_arena_free(arena);
return false;
}
@@ -2175,4 +2394,20 @@ size_t _upb_symtab_bytesloaded(const upb_symtab *s) {
return s->bytes_loaded;
}
+upb_arena *_upb_symtab_arena(const upb_symtab *s) {
+ return s->arena;
+}
+
+const upb_fielddef *_upb_symtab_lookupextfield(const upb_symtab *s,
+ const upb_msglayout_ext *ext) {
+ upb_value v;
+ bool ok = upb_inttable_lookup(&s->exts, (uintptr_t)ext, &v);
+ UPB_ASSERT(ok);
+ return upb_value_getconstptr(v);
+}
+
+const upb_extreg *upb_symtab_extreg(const upb_symtab *s) {
+ return s->extreg;
+}
+
#undef CHK_OOM
diff --git a/contrib/libs/grpc/third_party/upb/upb/def.h b/contrib/libs/grpc/third_party/upb/upb/def.h
index 7206ec0d3ef..b548e2b360d 100644
--- a/contrib/libs/grpc/third_party/upb/upb/def.h
+++ b/contrib/libs/grpc/third_party/upb/upb/def.h
@@ -1,23 +1,51 @@
/*
-** Defs are upb's internal representation of the constructs that can appear
-** in a .proto file:
-**
-** - upb_msgdef: describes a "message" construct.
-** - upb_fielddef: describes a message field.
-** - upb_filedef: describes a .proto file and its defs.
-** - upb_enumdef: describes an enum.
-** - upb_oneofdef: describes a oneof.
-**
-** TODO: definitions of services.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Defs are upb's internal representation of the constructs that can appear
+ * in a .proto file:
+ *
+ * - upb_msgdef: describes a "message" construct.
+ * - upb_fielddef: describes a message field.
+ * - upb_filedef: describes a .proto file and its defs.
+ * - upb_enumdef: describes an enum.
+ * - upb_oneofdef: describes a oneof.
+ *
+ * TODO: definitions of services.
+ */
#ifndef UPB_DEF_H_
#define UPB_DEF_H_
#include "upb/upb.h"
-#include "upb/table.int.h"
+#include "upb/table_internal.h"
#include "google/protobuf/descriptor.upb.h"
+/* Must be last. */
#include "upb/port_def.inc"
#ifdef __cplusplus
@@ -26,6 +54,10 @@ extern "C" {
struct upb_enumdef;
typedef struct upb_enumdef upb_enumdef;
+struct upb_enumvaldef;
+typedef struct upb_enumvaldef upb_enumvaldef;
+struct upb_extrange;
+typedef struct upb_extrange upb_extrange;
struct upb_fielddef;
typedef struct upb_fielddef upb_fielddef;
struct upb_filedef;
@@ -107,9 +139,7 @@ bool upb_fielddef_haspresence(const upb_fielddef *f);
const upb_msgdef *upb_fielddef_msgsubdef(const upb_fielddef *f);
const upb_enumdef *upb_fielddef_enumsubdef(const upb_fielddef *f);
const upb_msglayout_field *upb_fielddef_layout(const upb_fielddef *f);
-
-/* Internal only. */
-uint32_t upb_fielddef_selectorbase(const upb_fielddef *f);
+const upb_msglayout_ext *_upb_fielddef_extlayout(const upb_fielddef *f);
/* upb_oneofdef ***************************************************************/
@@ -174,8 +204,10 @@ bool upb_msgdef_mapentry(const upb_msgdef *m);
upb_wellknowntype_t upb_msgdef_wellknowntype(const upb_msgdef *m);
bool upb_msgdef_iswrapper(const upb_msgdef *m);
bool upb_msgdef_isnumberwrapper(const upb_msgdef *m);
+int upb_msgdef_extrangecount(const upb_msgdef *m);
int upb_msgdef_fieldcount(const upb_msgdef *m);
int upb_msgdef_oneofcount(const upb_msgdef *m);
+const upb_extrange *upb_msgdef_extrange(const upb_msgdef *m, int i);
const upb_fielddef *upb_msgdef_field(const upb_msgdef *m, int i);
const upb_oneofdef *upb_msgdef_oneof(const upb_msgdef *m, int i);
const upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i);
@@ -195,10 +227,6 @@ UPB_INLINE const upb_fielddef *upb_msgdef_ntofz(const upb_msgdef *m,
return upb_msgdef_ntof(m, name, strlen(name));
}
-/* Internal-only. */
-size_t upb_msgdef_selectorcount(const upb_msgdef *m);
-uint32_t upb_msgdef_submsgfieldcount(const upb_msgdef *m);
-
/* Lookup of either field or oneof by name. Returns whether either was found.
* If the return is true, then the found def will be set, and the non-found
* one set to NULL. */
@@ -235,6 +263,14 @@ bool upb_msg_oneof_iter_isequal(const upb_msg_oneof_iter *iter1,
const upb_msg_oneof_iter *iter2);
/* END DEPRECATED */
+/* upb_extrange ***************************************************************/
+
+const google_protobuf_ExtensionRangeOptions *upb_extrange_options(
+ const upb_extrange *r);
+bool upb_extrange_hasoptions(const upb_extrange *r);
+int32_t upb_extrange_start(const upb_extrange *r);
+int32_t upb_extrange_end(const upb_extrange *r);
+
/* upb_enumdef ****************************************************************/
typedef upb_strtable_iter upb_enum_iter;
@@ -243,26 +279,34 @@ const char *upb_enumdef_fullname(const upb_enumdef *e);
const char *upb_enumdef_name(const upb_enumdef *e);
const upb_filedef *upb_enumdef_file(const upb_enumdef *e);
int32_t upb_enumdef_default(const upb_enumdef *e);
-int upb_enumdef_numvals(const upb_enumdef *e);
+int upb_enumdef_valuecount(const upb_enumdef *e);
+const upb_enumvaldef *upb_enumdef_value(const upb_enumdef *e, int i);
-/* Enum lookups:
- * - ntoi: look up a name with specified length.
- * - ntoiz: look up a name provided as a null-terminated string.
- * - iton: look up an integer, returning the name as a null-terminated
- * string. */
-bool upb_enumdef_ntoi(const upb_enumdef *e, const char *name, size_t len,
- int32_t *num);
-UPB_INLINE bool upb_enumdef_ntoiz(const upb_enumdef *e,
- const char *name, int32_t *num) {
- return upb_enumdef_ntoi(e, name, strlen(name), num);
-}
-const char *upb_enumdef_iton(const upb_enumdef *e, int32_t num);
+const upb_enumvaldef *upb_enumdef_lookupname(const upb_enumdef *e,
+ const char *name, size_t len);
+const upb_enumvaldef *upb_enumdef_lookupnum(const upb_enumdef *e, int32_t num);
+/* DEPRECATED, slated for removal */
+int upb_enumdef_numvals(const upb_enumdef *e);
void upb_enum_begin(upb_enum_iter *iter, const upb_enumdef *e);
void upb_enum_next(upb_enum_iter *iter);
bool upb_enum_done(upb_enum_iter *iter);
const char *upb_enum_iter_name(upb_enum_iter *iter);
int32_t upb_enum_iter_number(upb_enum_iter *iter);
+/* END DEPRECATED */
+
+// Convenience wrapper.
+UPB_INLINE const upb_enumvaldef *upb_enumdef_lookupnamez(const upb_enumdef *e,
+ const char *name) {
+ return upb_enumdef_lookupname(e, name, strlen(name));
+}
+
+/* upb_enumvaldef *************************************************************/
+
+const char *upb_enumvaldef_fullname(const upb_enumvaldef *e);
+const char *upb_enumvaldef_name(const upb_enumvaldef *e);
+int32_t upb_enumvaldef_number(const upb_enumvaldef *e);
+const upb_enumdef *upb_enumvaldef_enum(const upb_enumvaldef *e);
/* upb_filedef ****************************************************************/
@@ -287,6 +331,11 @@ const upb_msgdef *upb_symtab_lookupmsg(const upb_symtab *s, const char *sym);
const upb_msgdef *upb_symtab_lookupmsg2(
const upb_symtab *s, const char *sym, size_t len);
const upb_enumdef *upb_symtab_lookupenum(const upb_symtab *s, const char *sym);
+const upb_enumvaldef *upb_symtab_lookupenumval(const upb_symtab *s,
+ const char *sym);
+const upb_fielddef *upb_symtab_lookupext(const upb_symtab *s, const char *sym);
+const upb_fielddef *upb_symtab_lookupext2(const upb_symtab *s, const char *sym,
+ size_t len);
const upb_filedef *upb_symtab_lookupfile(const upb_symtab *s, const char *name);
const upb_filedef *upb_symtab_lookupfile2(
const upb_symtab *s, const char *name, size_t len);
@@ -295,11 +344,15 @@ const upb_filedef *upb_symtab_addfile(
upb_symtab *s, const google_protobuf_FileDescriptorProto *file,
upb_status *status);
size_t _upb_symtab_bytesloaded(const upb_symtab *s);
+upb_arena *_upb_symtab_arena(const upb_symtab *s);
+const upb_fielddef *_upb_symtab_lookupextfield(const upb_symtab *s,
+ const upb_msglayout_ext *ext);
+const upb_extreg *upb_symtab_extreg(const upb_symtab *s);
/* For generated code only: loads a generated descriptor. */
typedef struct upb_def_init {
struct upb_def_init **deps; /* Dependencies of this file. */
- const upb_msglayout **layouts; /* Pre-order layouts of all messages. */
+ const upb_msglayout_file *layout;
const char *filename;
upb_strview descriptor; /* Serialized descriptor. */
} upb_def_init;
diff --git a/contrib/libs/grpc/third_party/upb/upb/def.hpp b/contrib/libs/grpc/third_party/upb/upb/def.hpp
index 7e304aae7c6..9be37b984ff 100644
--- a/contrib/libs/grpc/third_party/upb/upb/def.hpp
+++ b/contrib/libs/grpc/third_party/upb/upb/def.hpp
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef UPB_DEF_HPP_
#define UPB_DEF_HPP_
@@ -8,10 +32,13 @@
#include <vector>
#include "upb/def.h"
+#include "upb/reflection.h"
#include "upb/upb.hpp"
namespace upb {
+typedef upb_msgval MessageValue;
+
class EnumDefPtr;
class MessageDefPtr;
class OneofDefPtr;
@@ -106,6 +133,8 @@ class FieldDefPtr {
float default_float() const { return upb_fielddef_defaultfloat(ptr_); }
double default_double() const { return upb_fielddef_defaultdouble(ptr_); }
+ MessageValue default_value() const { return upb_fielddef_default(ptr_); }
+
// The resulting string is always NULL-terminated. If non-NULL, the length
// will be stored in *len.
const char* default_string(size_t* len) const {
@@ -283,6 +312,19 @@ class MessageDefPtr {
const upb_msgdef* ptr_;
};
+class EnumValDefPtr {
+ public:
+ EnumValDefPtr() : ptr_(nullptr) {}
+ explicit EnumValDefPtr(const upb_enumvaldef* ptr) : ptr_(ptr) {}
+
+ int32_t number() const { return upb_enumvaldef_number(ptr_); }
+ const char *full_name() const { return upb_enumvaldef_fullname(ptr_); }
+ const char *name() const { return upb_enumvaldef_name(ptr_); }
+
+ private:
+ const upb_enumvaldef* ptr_;
+};
+
class EnumDefPtr {
public:
EnumDefPtr() : ptr_(nullptr) {}
@@ -306,15 +348,15 @@ class EnumDefPtr {
int value_count() const { return upb_enumdef_numvals(ptr_); }
// Lookups from name to integer, returning true if found.
- bool FindValueByName(const char* name, int32_t* num) const {
- return upb_enumdef_ntoiz(ptr_, name, num);
+ EnumValDefPtr FindValueByName(const char* name) const {
+ return EnumValDefPtr(upb_enumdef_lookupnamez(ptr_, name));
}
// Finds the name corresponding to the given number, or NULL if none was
// found. If more than one name corresponds to this number, returns the
// first one that was added.
- const char* FindValueByNumber(int32_t num) const {
- return upb_enumdef_iton(ptr_, num);
+ EnumValDefPtr FindValueByNumber(int32_t num) const {
+ return EnumValDefPtr(upb_enumdef_lookupnum(ptr_, num));
}
// Iteration over name/value pairs. The order is undefined.
diff --git a/contrib/libs/grpc/third_party/upb/upb/encode.c b/contrib/libs/grpc/third_party/upb/upb/encode.c
index f73ff09f8e7..71a4ba07fa0 100644
--- a/contrib/libs/grpc/third_party/upb/upb/encode.c
+++ b/contrib/libs/grpc/third_party/upb/upb/encode.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
/* We encode backwards, to avoid pre-computing lengths (one-pass encode). */
#include "upb/encode.h"
@@ -5,7 +32,7 @@
#include <setjmp.h>
#include <string.h>
-#include "upb/msg.h"
+#include "upb/msg_internal.h"
#include "upb/upb.h"
/* Must be last. */
@@ -156,21 +183,18 @@ static void encode_fixedarray(upb_encstate *e, const upb_array *arr,
}
}
-static void encode_message(upb_encstate *e, const char *msg,
+static void encode_message(upb_encstate *e, const upb_msg *msg,
const upb_msglayout *m, size_t *size);
static void encode_scalar(upb_encstate *e, const void *_field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f,
- bool skip_zero_value) {
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *f) {
const char *field_mem = _field_mem;
int wire_type;
#define CASE(ctype, type, wtype, encodeval) \
{ \
ctype val = *(ctype *)field_mem; \
- if (skip_zero_value && val == 0) { \
- return; \
- } \
encode_##type(e, encodeval); \
wire_type = wtype; \
break; \
@@ -204,9 +228,6 @@ static void encode_scalar(upb_encstate *e, const void *_field_mem,
case UPB_DESCRIPTOR_TYPE_STRING:
case UPB_DESCRIPTOR_TYPE_BYTES: {
upb_strview view = *(upb_strview*)field_mem;
- if (skip_zero_value && view.size == 0) {
- return;
- }
encode_bytes(e, view.data, view.size);
encode_varint(e, view.size);
wire_type = UPB_WIRE_TYPE_DELIMITED;
@@ -215,7 +236,7 @@ static void encode_scalar(upb_encstate *e, const void *_field_mem,
case UPB_DESCRIPTOR_TYPE_GROUP: {
size_t size;
void *submsg = *(void **)field_mem;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ const upb_msglayout *subm = subs[f->submsg_index].submsg;
if (submsg == NULL) {
return;
}
@@ -229,7 +250,7 @@ static void encode_scalar(upb_encstate *e, const void *_field_mem,
case UPB_DESCRIPTOR_TYPE_MESSAGE: {
size_t size;
void *submsg = *(void **)field_mem;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ const upb_msglayout *subm = subs[f->submsg_index].submsg;
if (submsg == NULL) {
return;
}
@@ -248,10 +269,11 @@ static void encode_scalar(upb_encstate *e, const void *_field_mem,
encode_tag(e, f->number, wire_type);
}
-static void encode_array(upb_encstate *e, const char *field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f) {
- const upb_array *arr = *(const upb_array**)field_mem;
- bool packed = f->label == _UPB_LABEL_PACKED;
+static void encode_array(upb_encstate *e, const upb_msg *msg,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *f) {
+ const upb_array *arr = *UPB_PTR_AT(msg, f->offset, upb_array*);
+ bool packed = f->mode & _UPB_MODE_IS_PACKED;
size_t pre_len = e->limit - e->ptr;
if (arr == NULL || arr->len == 0) {
@@ -317,7 +339,7 @@ static void encode_array(upb_encstate *e, const char *field_mem,
case UPB_DESCRIPTOR_TYPE_GROUP: {
const void *const*start = _upb_array_constptr(arr);
const void *const*ptr = start + arr->len;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ const upb_msglayout *subm = subs[f->submsg_index].submsg;
if (--e->depth == 0) encode_err(e);
do {
size_t size;
@@ -332,7 +354,7 @@ static void encode_array(upb_encstate *e, const char *field_mem,
case UPB_DESCRIPTOR_TYPE_MESSAGE: {
const void *const*start = _upb_array_constptr(arr);
const void *const*ptr = start + arr->len;
- const upb_msglayout *subm = m->submsgs[f->submsg_index];
+ const upb_msglayout *subm = subs[f->submsg_index].submsg;
if (--e->depth == 0) encode_err(e);
do {
size_t size;
@@ -360,17 +382,18 @@ static void encode_mapentry(upb_encstate *e, uint32_t number,
const upb_msglayout_field *val_field = &layout->fields[1];
size_t pre_len = e->limit - e->ptr;
size_t size;
- encode_scalar(e, &ent->v, layout, val_field, false);
- encode_scalar(e, &ent->k, layout, key_field, false);
+ encode_scalar(e, &ent->v, layout->subs, val_field);
+ encode_scalar(e, &ent->k, layout->subs, key_field);
size = (e->limit - e->ptr) - pre_len;
encode_varint(e, size);
encode_tag(e, number, UPB_WIRE_TYPE_DELIMITED);
}
-static void encode_map(upb_encstate *e, const char *field_mem,
- const upb_msglayout *m, const upb_msglayout_field *f) {
- const upb_map *map = *(const upb_map**)field_mem;
- const upb_msglayout *layout = m->submsgs[f->submsg_index];
+static void encode_map(upb_encstate *e, const upb_msg *msg,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *f) {
+ const upb_map *map = *UPB_PTR_AT(msg, f->offset, const upb_map*);
+ const upb_msglayout *layout = subs[f->submsg_index].submsg;
UPB_ASSERT(layout->field_count == 2);
if (map == NULL) return;
@@ -398,28 +421,82 @@ static void encode_map(upb_encstate *e, const char *field_mem,
}
}
-static void encode_scalarfield(upb_encstate *e, const char *msg,
- const upb_msglayout *m,
- const upb_msglayout_field *f) {
- bool skip_empty = false;
+static bool encode_shouldencode(upb_encstate *e, const upb_msg *msg,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *f) {
if (f->presence == 0) {
- /* Proto3 presence. */
- skip_empty = true;
+ /* Proto3 presence or map/array. */
+ const void *mem = UPB_PTR_AT(msg, f->offset, void);
+ switch (f->mode >> _UPB_REP_SHIFT) {
+ case _UPB_REP_1BYTE: {
+ char ch;
+ memcpy(&ch, mem, 1);
+ return ch != 0;
+ }
+ case _UPB_REP_4BYTE: {
+ uint32_t u32;
+ memcpy(&u32, mem, 4);
+ return u32 != 0;
+ }
+ case _UPB_REP_8BYTE: {
+ uint64_t u64;
+ memcpy(&u64, mem, 8);
+ return u64 != 0;
+ }
+ case _UPB_REP_STRVIEW: {
+ const upb_strview *str = (const upb_strview*)mem;
+ return str->size != 0;
+ }
+ default:
+ UPB_UNREACHABLE();
+ }
} else if (f->presence > 0) {
/* Proto2 presence: hasbit. */
- if (!_upb_hasbit_field(msg, f)) return;
+ return _upb_hasbit_field(msg, f);
} else {
/* Field is in a oneof. */
- if (_upb_getoneofcase_field(msg, f) != f->number) return;
+ return _upb_getoneofcase_field(msg, f) == f->number;
}
- encode_scalar(e, msg + f->offset, m, f, skip_empty);
}
-static void encode_message(upb_encstate *e, const char *msg,
+static void encode_field(upb_encstate *e, const upb_msg *msg,
+ const upb_msglayout_sub *subs,
+ const upb_msglayout_field *field) {
+ switch (_upb_getmode(field)) {
+ case _UPB_MODE_ARRAY:
+ encode_array(e, msg, subs, field);
+ break;
+ case _UPB_MODE_MAP:
+ encode_map(e, msg, subs, field);
+ break;
+ case _UPB_MODE_SCALAR:
+ encode_scalar(e, UPB_PTR_AT(msg, field->offset, void), subs, field);
+ break;
+ default:
+ UPB_UNREACHABLE();
+ }
+}
+
+/* message MessageSet {
+ * repeated group Item = 1 {
+ * required int32 type_id = 2;
+ * required string message = 3;
+ * }
+ * } */
+static void encode_msgset_item(upb_encstate *e, const upb_msg_ext *ext) {
+ size_t size;
+ encode_tag(e, 1, UPB_WIRE_TYPE_END_GROUP);
+ encode_message(e, ext->data.ptr, ext->ext->sub.submsg, &size);
+ encode_varint(e, size);
+ encode_tag(e, 3, UPB_WIRE_TYPE_DELIMITED);
+ encode_varint(e, ext->ext->field.number);
+ encode_tag(e, 2, UPB_WIRE_TYPE_VARINT);
+ encode_tag(e, 1, UPB_WIRE_TYPE_START_GROUP);
+}
+
+static void encode_message(upb_encstate *e, const upb_msg *msg,
const upb_msglayout *m, size_t *size) {
size_t pre_len = e->limit - e->ptr;
- const upb_msglayout_field *f = &m->fields[m->field_count];
- const upb_msglayout_field *first = &m->fields[0];
if ((e->options & UPB_ENCODE_SKIPUNKNOWN) == 0) {
size_t unknown_size;
@@ -430,21 +507,37 @@ static void encode_message(upb_encstate *e, const char *msg,
}
}
+ if (m->ext != _UPB_MSGEXT_NONE) {
+ /* Encode all extensions together. Unlike C++, we do not attempt to keep
+ * these in field number order relative to normal fields or even to each
+ * other. */
+ size_t ext_count;
+ const upb_msg_ext *ext = _upb_msg_getexts(msg, &ext_count);
+ const upb_msg_ext *end = ext + ext_count;
+ if (ext_count) {
+ for (; ext != end; ext++) {
+ if (UPB_UNLIKELY(m->ext == _UPB_MSGEXT_MSGSET)) {
+ encode_msgset_item(e, ext);
+ } else {
+ encode_field(e, &ext->data, &ext->ext->sub, &ext->ext->field);
+ }
+ }
+ }
+ }
+
+ const upb_msglayout_field *f = &m->fields[m->field_count];
+ const upb_msglayout_field *first = &m->fields[0];
while (f != first) {
f--;
- if (_upb_isrepeated(f)) {
- encode_array(e, msg + f->offset, m, f);
- } else if (f->label == _UPB_LABEL_MAP) {
- encode_map(e, msg + f->offset, m, f);
- } else {
- encode_scalarfield(e, msg, m, f);
+ if (encode_shouldencode(e, msg, m->subs, f)) {
+ encode_field(e, msg, m->subs, f);
}
}
*size = (e->limit - e->ptr) - pre_len;
}
-char *upb_encode_ex(const void *msg, const upb_msglayout *m, int options,
+char *upb_encode_ex(const void *msg, const upb_msglayout *l, int options,
upb_arena *arena, size_t *size) {
upb_encstate e;
unsigned depth = (unsigned)options >> 16;
@@ -462,7 +555,7 @@ char *upb_encode_ex(const void *msg, const upb_msglayout *m, int options,
*size = 0;
ret = NULL;
} else {
- encode_message(&e, msg, m, size);
+ encode_message(&e, msg, l, size);
*size = e.limit - e.ptr;
if (*size == 0) {
static char ch;
diff --git a/contrib/libs/grpc/third_party/upb/upb/encode.h b/contrib/libs/grpc/third_party/upb/upb/encode.h
index d3c1dc96063..3ea2003d2d3 100644
--- a/contrib/libs/grpc/third_party/upb/upb/encode.h
+++ b/contrib/libs/grpc/third_party/upb/upb/encode.h
@@ -1,6 +1,33 @@
/*
-** upb_encode: parsing into a upb_msg using a upb_msglayout.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_encode: parsing into a upb_msg using a upb_msglayout.
+ */
#ifndef UPB_ENCODE_H_
#define UPB_ENCODE_H_
diff --git a/contrib/libs/grpc/third_party/upb/upb/msg.c b/contrib/libs/grpc/third_party/upb/upb/msg.c
index 876a06d6fa5..54426ec7217 100644
--- a/contrib/libs/grpc/third_party/upb/upb/msg.c
+++ b/contrib/libs/grpc/third_party/upb/upb/msg.c
@@ -1,13 +1,39 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/msg.h"
-#include "upb/table.int.h"
-
+#include "upb/msg_internal.h"
#include "upb/port_def.inc"
+#include "upb/table_internal.h"
/** upb_msg *******************************************************************/
-static const size_t overhead = sizeof(upb_msg_internal);
+static const size_t overhead = sizeof(upb_msg_internaldata);
static const upb_msg_internal *upb_msg_getinternal_const(const upb_msg *msg) {
ptrdiff_t size = sizeof(upb_msg_internal);
@@ -23,49 +49,119 @@ void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l) {
memset(mem, 0, upb_msg_sizeof(l));
}
+static bool realloc_internal(upb_msg *msg, size_t need, upb_arena *arena) {
+ upb_msg_internal *in = upb_msg_getinternal(msg);
+ if (!in->internal) {
+ /* No internal data, allocate from scratch. */
+ size_t size = UPB_MAX(128, _upb_lg2ceilsize(need + overhead));
+ upb_msg_internaldata *internal = upb_arena_malloc(arena, size);
+ if (!internal) return false;
+ internal->size = size;
+ internal->unknown_end = overhead;
+ internal->ext_begin = size;
+ in->internal = internal;
+ } else if (in->internal->ext_begin - in->internal->unknown_end < need) {
+ /* Internal data is too small, reallocate. */
+ size_t new_size = _upb_lg2ceilsize(in->internal->size + need);
+ size_t ext_bytes = in->internal->size - in->internal->ext_begin;
+ size_t new_ext_begin = new_size - ext_bytes;
+ upb_msg_internaldata *internal =
+ upb_arena_realloc(arena, in->internal, in->internal->size, new_size);
+ if (!internal) return false;
+ if (ext_bytes) {
+ /* Need to move extension data to the end. */
+ char *ptr = (char*)internal;
+ memmove(ptr + new_ext_begin, ptr + internal->ext_begin, ext_bytes);
+ }
+ internal->ext_begin = new_ext_begin;
+ internal->size = new_size;
+ in->internal = internal;
+ }
+ UPB_ASSERT(in->internal->ext_begin - in->internal->unknown_end >= need);
+ return true;
+}
+
bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
upb_arena *arena) {
-
+ if (!realloc_internal(msg, len, arena)) return false;
upb_msg_internal *in = upb_msg_getinternal(msg);
- if (!in->unknown) {
- size_t size = 128;
- while (size < len) size *= 2;
- in->unknown = upb_arena_malloc(arena, size + overhead);
- if (!in->unknown) return false;
- in->unknown->size = size;
- in->unknown->len = 0;
- } else if (in->unknown->size - in->unknown->len < len) {
- size_t need = in->unknown->len + len;
- size_t size = in->unknown->size;
- while (size < need) size *= 2;
- in->unknown = upb_arena_realloc(
- arena, in->unknown, in->unknown->size + overhead, size + overhead);
- if (!in->unknown) return false;
- in->unknown->size = size;
- }
- memcpy(UPB_PTR_AT(in->unknown + 1, in->unknown->len, char), data, len);
- in->unknown->len += len;
+ memcpy(UPB_PTR_AT(in->internal, in->internal->unknown_end, char), data, len);
+ in->internal->unknown_end += len;
return true;
}
void _upb_msg_discardunknown_shallow(upb_msg *msg) {
upb_msg_internal *in = upb_msg_getinternal(msg);
- if (in->unknown) {
- in->unknown->len = 0;
+ if (in->internal) {
+ in->internal->unknown_end = overhead;
}
}
const char *upb_msg_getunknown(const upb_msg *msg, size_t *len) {
const upb_msg_internal *in = upb_msg_getinternal_const(msg);
- if (in->unknown) {
- *len = in->unknown->len;
- return (char*)(in->unknown + 1);
+ if (in->internal) {
+ *len = in->internal->unknown_end - overhead;
+ return (char*)(in->internal + 1);
} else {
*len = 0;
return NULL;
}
}
+const upb_msg_ext *_upb_msg_getexts(const upb_msg *msg, size_t *count) {
+ const upb_msg_internal *in = upb_msg_getinternal_const(msg);
+ if (in->internal) {
+ *count =
+ (in->internal->size - in->internal->ext_begin) / sizeof(upb_msg_ext);
+ return UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ } else {
+ *count = 0;
+ return NULL;
+ }
+}
+
+const upb_msg_ext *_upb_msg_getext(const upb_msg *msg,
+ const upb_msglayout_ext *e) {
+ size_t n;
+ const upb_msg_ext *ext = _upb_msg_getexts(msg, &n);
+
+ /* For now we use linear search exclusively to find extensions. If this
+ * becomes an issue due to messages with lots of extensions, we can introduce
+ * a table of some sort. */
+ for (size_t i = 0; i < n; i++) {
+ if (ext[i].ext == e) {
+ return &ext[i];
+ }
+ }
+
+ return NULL;
+}
+
+void _upb_msg_clearext(upb_msg *msg, const upb_msglayout_ext *ext_l) {
+ upb_msg_internal *in = upb_msg_getinternal(msg);
+ if (!in->internal) return;
+ const upb_msg_ext *base =
+ UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ upb_msg_ext *ext = (upb_msg_ext*)_upb_msg_getext(msg, ext_l);
+ if (ext) {
+ *ext = *base;
+ in->internal->ext_begin += sizeof(upb_msg_ext);
+ }
+}
+
+upb_msg_ext *_upb_msg_getorcreateext(upb_msg *msg, const upb_msglayout_ext *e,
+ upb_arena *arena) {
+ upb_msg_ext *ext = (upb_msg_ext*)_upb_msg_getext(msg, e);
+ if (ext) return ext;
+ if (!realloc_internal(msg, sizeof(upb_msg_ext), arena)) return NULL;
+ upb_msg_internal *in = upb_msg_getinternal(msg);
+ in->internal->ext_begin -= sizeof(upb_msg_ext);
+ ext = UPB_PTR_AT(in->internal, in->internal->ext_begin, void);
+ memset(ext, 0, sizeof(upb_msg_ext));
+ ext->ext = e;
+ return ext;
+}
+
/** upb_array *****************************************************************/
bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena) {
@@ -133,7 +229,7 @@ upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size) {
return NULL;
}
- upb_strtable_init2(&map->table, UPB_CTYPE_INT32, 4, upb_arena_alloc(a));
+ upb_strtable_init(&map->table, 4, a);
map->key_size = key_size;
map->val_size = value_size;
@@ -254,3 +350,61 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
qsort(&s->entries[sorted->start], map_size, sizeof(*s->entries), compar);
return true;
}
+
+/** upb_extreg ****************************************************************/
+
+struct upb_extreg {
+ upb_arena *arena;
+ upb_strtable exts; /* Key is upb_msglayout* concatenated with fieldnum. */
+};
+
+#define EXTREG_KEY_SIZE (sizeof(upb_msglayout*) + sizeof(uint32_t))
+
+static void extreg_key(char *buf, const upb_msglayout *l, uint32_t fieldnum) {
+ memcpy(buf, &l, sizeof(l));
+ memcpy(buf + sizeof(l), &fieldnum, sizeof(fieldnum));
+}
+
+upb_extreg *upb_extreg_new(upb_arena *arena) {
+ upb_extreg *r = upb_arena_malloc(arena, sizeof(*r));
+ if (!r) return NULL;
+ r->arena = arena;
+ if (!upb_strtable_init(&r->exts, 8, arena)) return NULL;
+ return r;
+}
+
+bool _upb_extreg_add(upb_extreg *r, const upb_msglayout_ext **e, size_t count) {
+ char buf[EXTREG_KEY_SIZE];
+ const upb_msglayout_ext **start = e;
+ const upb_msglayout_ext **end = e + count;
+ for (; e < end; e++) {
+ const upb_msglayout_ext *ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ if (!upb_strtable_insert(&r->exts, buf, EXTREG_KEY_SIZE,
+ upb_value_constptr(ext), r->arena)) {
+ goto failure;
+ }
+ }
+ return true;
+
+failure:
+ /* Back out the entries previously added. */
+ for (end = e, e = start; e < end; e++) {
+ const upb_msglayout_ext *ext = *e;
+ extreg_key(buf, ext->extendee, ext->field.number);
+ upb_strtable_remove(&r->exts, buf, EXTREG_KEY_SIZE, NULL);
+ }
+ return false;
+}
+
+const upb_msglayout_ext *_upb_extreg_get(const upb_extreg *r,
+ const upb_msglayout *l, uint32_t num) {
+ char buf[EXTREG_KEY_SIZE];
+ upb_value v;
+ extreg_key(buf, l, num);
+ if (upb_strtable_lookup2(&r->exts, buf, EXTREG_KEY_SIZE, &v)) {
+ return upb_value_getconstptr(v);
+ } else {
+ return NULL;
+ }
+}
diff --git a/contrib/libs/grpc/third_party/upb/upb/msg.h b/contrib/libs/grpc/third_party/upb/upb/msg.h
index 9b4557ac183..497bd82b015 100644
--- a/contrib/libs/grpc/third_party/upb/upb/msg.h
+++ b/contrib/libs/grpc/third_party/upb/upb/msg.h
@@ -1,613 +1,108 @@
/*
-** Our memory representation for parsing tables and messages themselves.
-** Functions in this file are used by generated code and possibly reflection.
-**
-** The definitions in this file are internal to upb.
-**/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Public APIs for message operations that do not require descriptors.
+ * These functions can be used even in build that does not want to depend on
+ * reflection or descriptors.
+ *
+ * Descriptor-based reflection functionality lives in reflection.h.
+ */
#ifndef UPB_MSG_H_
#define UPB_MSG_H_
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
+#include <stddef.h>
-#include "upb/table.int.h"
#include "upb/upb.h"
-/* Must be last. */
-#include "upb/port_def.inc"
-
#ifdef __cplusplus
extern "C" {
#endif
-#define PTR_AT(msg, ofs, type) (type*)((const char*)msg + ofs)
-
typedef void upb_msg;
-/** upb_msglayout *************************************************************/
-
-/* upb_msglayout represents the memory layout of a given upb_msgdef. The
- * members are public so generated code can initialize them, but users MUST NOT
- * read or write any of its members. */
-
-/* These aren't real labels according to descriptor.proto, but in the table we
- * use these for map/packed fields instead of UPB_LABEL_REPEATED. */
-enum {
- _UPB_LABEL_MAP = 4,
- _UPB_LABEL_PACKED = 7 /* Low 3 bits are common with UPB_LABEL_REPEATED. */
-};
-
-typedef struct {
- uint32_t number;
- uint16_t offset;
- int16_t presence; /* If >0, hasbit_index. If <0, ~oneof_index. */
- uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
- uint8_t descriptortype;
- uint8_t label; /* google.protobuf.Label or _UPB_LABEL_* above. */
-} upb_msglayout_field;
-
-struct upb_decstate;
+/* For users these are opaque. They can be obtained from upb_msgdef_layout()
+ * but users cannot access any of the members. */
struct upb_msglayout;
-
-typedef const char *_upb_field_parser(struct upb_decstate *d, const char *ptr,
- upb_msg *msg, intptr_t table,
- uint64_t hasbits, uint64_t data);
-
-typedef struct {
- uint64_t field_data;
- _upb_field_parser *field_parser;
-} _upb_fasttable_entry;
-
-typedef struct upb_msglayout {
- const struct upb_msglayout *const* submsgs;
- const upb_msglayout_field *fields;
- /* Must be aligned to sizeof(void*). Doesn't include internal members like
- * unknown fields, extension dict, pointer to msglayout, etc. */
- uint16_t size;
- uint16_t field_count;
- bool extendable;
- uint8_t table_mask;
- /* To constant-initialize the tables of variable length, we need a flexible
- * array member, and we need to compile in C99 mode. */
- _upb_fasttable_entry fasttable[];
-} upb_msglayout;
-
-/** upb_msg *******************************************************************/
-
-/* Internal members of a upb_msg. We can change this without breaking binary
- * compatibility. We put these before the user's data. The user's upb_msg*
- * points after the upb_msg_internal. */
-
-typedef struct {
- uint32_t len;
- uint32_t size;
- /* Data follows. */
-} upb_msg_unknowndata;
-
-/* Used when a message is not extendable. */
-typedef struct {
- upb_msg_unknowndata *unknown;
-} upb_msg_internal;
-
-/* Maps upb_fieldtype_t -> memory size. */
-extern char _upb_fieldtype_to_size[12];
-
-UPB_INLINE size_t upb_msg_sizeof(const upb_msglayout *l) {
- return l->size + sizeof(upb_msg_internal);
-}
-
-UPB_INLINE upb_msg *_upb_msg_new_inl(const upb_msglayout *l, upb_arena *a) {
- size_t size = upb_msg_sizeof(l);
- void *mem = upb_arena_malloc(a, size);
- upb_msg *msg;
- if (UPB_UNLIKELY(!mem)) return NULL;
- msg = UPB_PTR_AT(mem, sizeof(upb_msg_internal), upb_msg);
- memset(mem, 0, size);
- return msg;
-}
-
-/* Creates a new messages with the given layout on the given arena. */
-upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a);
-
-UPB_INLINE upb_msg_internal *upb_msg_getinternal(upb_msg *msg) {
- ptrdiff_t size = sizeof(upb_msg_internal);
- return (upb_msg_internal*)((char*)msg - size);
-}
-
-/* Clears the given message. */
-void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l);
-
-/* Discards the unknown fields for this message only. */
-void _upb_msg_discardunknown_shallow(upb_msg *msg);
+typedef struct upb_msglayout upb_msglayout;
/* Adds unknown data (serialized protobuf data) to the given message. The data
* is copied into the message instance. */
-bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
- upb_arena *arena);
+void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
+ upb_arena *arena);
/* Returns a reference to the message's unknown data. */
const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
-/** Hasbit access *************************************************************/
-
-UPB_INLINE bool _upb_hasbit(const upb_msg *msg, size_t idx) {
- return (*PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
-}
-
-UPB_INLINE void _upb_sethas(const upb_msg *msg, size_t idx) {
- (*PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
-}
-
-UPB_INLINE void _upb_clearhas(const upb_msg *msg, size_t idx) {
- (*PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
-}
-
-UPB_INLINE size_t _upb_msg_hasidx(const upb_msglayout_field *f) {
- UPB_ASSERT(f->presence > 0);
- return f->presence;
-}
-
-UPB_INLINE bool _upb_hasbit_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_hasbit(msg, _upb_msg_hasidx(f));
-}
-
-UPB_INLINE void _upb_sethas_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- _upb_sethas(msg, _upb_msg_hasidx(f));
-}
-
-UPB_INLINE void _upb_clearhas_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- _upb_clearhas(msg, _upb_msg_hasidx(f));
-}
-
-/** Oneof case access *********************************************************/
-
-UPB_INLINE uint32_t *_upb_oneofcase(upb_msg *msg, size_t case_ofs) {
- return PTR_AT(msg, case_ofs, uint32_t);
-}
-
-UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs) {
- return *PTR_AT(msg, case_ofs, uint32_t);
-}
-
-UPB_INLINE size_t _upb_oneofcase_ofs(const upb_msglayout_field *f) {
- UPB_ASSERT(f->presence < 0);
- return ~(ptrdiff_t)f->presence;
-}
-
-UPB_INLINE uint32_t *_upb_oneofcase_field(upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
-}
-
-UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_msg *msg,
- const upb_msglayout_field *f) {
- return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
-}
-
-UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_msg *msg, size_t ofs) {
- return *PTR_AT(msg, ofs, const upb_msg*) != NULL;
-}
-
-UPB_INLINE bool _upb_isrepeated(const upb_msglayout_field *field) {
- return (field->label & 3) == UPB_LABEL_REPEATED;
-}
-
-UPB_INLINE bool _upb_repeated_or_map(const upb_msglayout_field *field) {
- return field->label >= UPB_LABEL_REPEATED;
-}
-
-/** upb_array *****************************************************************/
-
-/* Our internal representation for repeated fields. */
-typedef struct {
- uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
- size_t len; /* Measured in elements. */
- size_t size; /* Measured in elements. */
- uint64_t junk;
-} upb_array;
-
-UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) {
- UPB_ASSERT((arr->data & 7) <= 4);
- return (void*)(arr->data & ~(uintptr_t)7);
-}
-
-UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
- UPB_ASSERT(elem_size_lg2 <= 4);
- return (uintptr_t)ptr | elem_size_lg2;
-}
-
-UPB_INLINE void *_upb_array_ptr(upb_array *arr) {
- return (void*)_upb_array_constptr(arr);
-}
-
-UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
- UPB_ASSERT(elem_size_lg2 <= 4);
- UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
- return (uintptr_t)ptr | (unsigned)elem_size_lg2;
-}
-
-UPB_INLINE upb_array *_upb_array_new(upb_arena *a, size_t init_size,
- int elem_size_lg2) {
- const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_array), 8);
- const size_t bytes = sizeof(upb_array) + (init_size << elem_size_lg2);
- upb_array *arr = (upb_array*)upb_arena_malloc(a, bytes);
- if (!arr) return NULL;
- arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
- arr->len = 0;
- arr->size = init_size;
- return arr;
-}
+/** upb_extreg *******************************************************************/
-/* Resizes the capacity of the array to be at least min_size. */
-bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena);
-
-/* Fallback functions for when the accessors require a resize. */
-void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
- int elem_size_lg2, upb_arena *arena);
-bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
- int elem_size_lg2, upb_arena *arena);
-
-UPB_INLINE bool _upb_array_reserve(upb_array *arr, size_t size,
- upb_arena *arena) {
- if (arr->size < size) return _upb_array_realloc(arr, size, arena);
- return true;
-}
-
-UPB_INLINE bool _upb_array_resize(upb_array *arr, size_t size,
- upb_arena *arena) {
- if (!_upb_array_reserve(arr, size, arena)) return false;
- arr->len = size;
- return true;
-}
-
-UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
- size_t *size) {
- const upb_array *arr = *PTR_AT(msg, ofs, const upb_array*);
- if (arr) {
- if (size) *size = arr->len;
- return _upb_array_constptr(arr);
- } else {
- if (size) *size = 0;
- return NULL;
- }
-}
-
-UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
- size_t *size) {
- upb_array *arr = *PTR_AT(msg, ofs, upb_array*);
- if (arr) {
- if (size) *size = arr->len;
- return _upb_array_ptr(arr);
- } else {
- if (size) *size = 0;
- return NULL;
- }
-}
-
-UPB_INLINE void *_upb_array_resize_accessor2(void *msg, size_t ofs, size_t size,
- int elem_size_lg2,
- upb_arena *arena) {
- upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *);
- upb_array *arr = *arr_ptr;
- if (!arr || arr->size < size) {
- return _upb_array_resize_fallback(arr_ptr, size, elem_size_lg2, arena);
- }
- arr->len = size;
- return _upb_array_ptr(arr);
-}
-
-UPB_INLINE bool _upb_array_append_accessor2(void *msg, size_t ofs,
- int elem_size_lg2,
- const void *value,
- upb_arena *arena) {
- upb_array **arr_ptr = PTR_AT(msg, ofs, upb_array *);
- size_t elem_size = 1 << elem_size_lg2;
- upb_array *arr = *arr_ptr;
- void *ptr;
- if (!arr || arr->len == arr->size) {
- return _upb_array_append_fallback(arr_ptr, value, elem_size_lg2, arena);
- }
- ptr = _upb_array_ptr(arr);
- memcpy(PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
- arr->len++;
- return true;
-}
-
-/* Used by old generated code, remove once all code has been regenerated. */
-UPB_INLINE int _upb_sizelg2(upb_fieldtype_t type) {
- switch (type) {
- case UPB_TYPE_BOOL:
- return 0;
- case UPB_TYPE_FLOAT:
- case UPB_TYPE_INT32:
- case UPB_TYPE_UINT32:
- case UPB_TYPE_ENUM:
- return 2;
- case UPB_TYPE_MESSAGE:
- return UPB_SIZE(2, 3);
- case UPB_TYPE_DOUBLE:
- case UPB_TYPE_INT64:
- case UPB_TYPE_UINT64:
- return 3;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
- return UPB_SIZE(3, 4);
- }
- UPB_UNREACHABLE();
-}
-UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
- upb_fieldtype_t type,
- upb_arena *arena) {
- return _upb_array_resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena);
-}
-UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
- size_t elem_size, upb_fieldtype_t type,
- const void *value,
- upb_arena *arena) {
- (void)elem_size;
- return _upb_array_append_accessor2(msg, ofs, _upb_sizelg2(type), value,
- arena);
-}
-
-/** upb_map *******************************************************************/
-
-/* Right now we use strmaps for everything. We'll likely want to use
- * integer-specific maps for integer-keyed maps.*/
-typedef struct {
- /* Size of key and val, based on the map type. Strings are represented as '0'
- * because they must be handled specially. */
- char key_size;
- char val_size;
-
- upb_strtable table;
-} upb_map;
-
-/* Map entries aren't actually stored, they are only used during parsing. For
- * parsing, it helps a lot if all map entry messages have the same layout.
- * The compiler and def.c must ensure that all map entries have this layout. */
-typedef struct {
- upb_msg_internal internal;
- union {
- upb_strview str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } k;
- union {
- upb_strview str; /* For str/bytes. */
- upb_value val; /* For all other types. */
- } v;
-} upb_map_entry;
-
-/* Creates a new map on the given arena with this key/value type. */
-upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size);
-
-/* Converting between internal table representation and user values.
+/* Extension registry: a dynamic data structure that stores a map of:
+ * (upb_msglayout, number) -> extension info
+ *
+ * upb_decode() uses upb_extreg to look up extensions while parsing binary
+ * format.
+ *
+ * upb_extreg is part of the mini-table (msglayout) family of objects. Like all
+ * mini-table objects, it is suitable for reflection-less builds that do not
+ * want to expose names into the binary.
*
- * _upb_map_tokey() and _upb_map_fromkey() are inverses.
- * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
+ * Unlike most mini-table types, upb_extreg requires dynamic memory allocation
+ * and dynamic initialization:
+ * * If reflection is being used, then upb_symtab will construct an appropriate
+ * upb_extreg automatically.
+ * * For a mini-table only build, the user must manually construct the
+ * upb_extreg and populate it with all of the extensions the user cares about.
+ * * A third alternative is to manually unpack relevant extensions after the
+ * main parse is complete, similar to how Any works. This is perhaps the
+ * nicest solution from the perspective of reducing dependencies, avoiding
+ * dynamic memory allocation, and avoiding the need to parse uninteresting
+ * extensions. The downsides are:
+ * (1) parse errors are not caught during the main parse
+ * (2) the CPU hit of parsing comes during access, which could cause an
+ * undesirable stutter in application performance.
*
- * These functions account for the fact that strings are treated differently
- * from other types when stored in a map.
+ * Users cannot directly get or put into this map. Users can only add the
+ * extensions from a generated module and pass the extension registry to the
+ * binary decoder.
+ *
+ * A upb_symtab provides a upb_extreg, so any users who use reflection do not
+ * need to populate a upb_extreg directly.
*/
-UPB_INLINE upb_strview _upb_map_tokey(const void *key, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- return *(upb_strview*)key;
- } else {
- return upb_strview_make((const char*)key, size);
- }
-}
-
-UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- memcpy(out, &key, sizeof(key));
- } else {
- memcpy(out, key.data, size);
- }
-}
-
-UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval,
- upb_arena *a) {
- if (size == UPB_MAPTYPE_STRING) {
- upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp));
- if (!strp) return false;
- *strp = *(upb_strview*)val;
- *msgval = upb_value_ptr(strp);
- } else {
- memcpy(msgval, val, size);
- }
- return true;
-}
-
-UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
- if (size == UPB_MAPTYPE_STRING) {
- const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
- memcpy(out, strp, sizeof(upb_strview));
- } else {
- memcpy(out, &val, size);
- }
-}
-
-/* Map operations, shared by reflection and generated code. */
-
-UPB_INLINE size_t _upb_map_size(const upb_map *map) {
- return map->table.t.count;
-}
-
-UPB_INLINE bool _upb_map_get(const upb_map *map, const void *key,
- size_t key_size, void *val, size_t val_size) {
- upb_value tabval;
- upb_strview k = _upb_map_tokey(key, key_size);
- bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
- if (ret && val) {
- _upb_map_fromvalue(tabval, val, val_size);
- }
- return ret;
-}
-
-UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) {
- upb_strtable_iter it;
- it.t = &map->table;
- it.index = *iter;
- upb_strtable_next(&it);
- *iter = it.index;
- if (upb_strtable_done(&it)) return NULL;
- return (void*)str_tabent(&it);
-}
-
-UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size,
- void *val, size_t val_size, upb_arena *arena) {
- upb_strview strkey = _upb_map_tokey(key, key_size);
- upb_value tabval = {0};
- if (!_upb_map_tovalue(val, val_size, &tabval, arena)) return false;
- upb_alloc *a = upb_arena_alloc(arena);
+struct upb_extreg;
+typedef struct upb_extreg upb_extreg;
- /* TODO(haberman): add overwrite operation to minimize number of lookups. */
- upb_strtable_remove3(&map->table, strkey.data, strkey.size, NULL, a);
- return upb_strtable_insert3(&map->table, strkey.data, strkey.size, tabval, a);
-}
-
-UPB_INLINE bool _upb_map_delete(upb_map *map, const void *key, size_t key_size) {
- upb_strview k = _upb_map_tokey(key, key_size);
- return upb_strtable_remove3(&map->table, k.data, k.size, NULL, NULL);
-}
-
-UPB_INLINE void _upb_map_clear(upb_map *map) {
- upb_strtable_clear(&map->table);
-}
-
-/* Message map operations, these get the map from the message first. */
-
-UPB_INLINE size_t _upb_msg_map_size(const upb_msg *msg, size_t ofs) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- return map ? _upb_map_size(map) : 0;
-}
-
-UPB_INLINE bool _upb_msg_map_get(const upb_msg *msg, size_t ofs,
- const void *key, size_t key_size, void *val,
- size_t val_size) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return false;
- return _upb_map_get(map, key, key_size, val, val_size);
-}
-
-UPB_INLINE void *_upb_msg_map_next(const upb_msg *msg, size_t ofs,
- size_t *iter) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return NULL;
- return _upb_map_next(map, iter);
-}
-
-UPB_INLINE bool _upb_msg_map_set(upb_msg *msg, size_t ofs, const void *key,
- size_t key_size, void *val, size_t val_size,
- upb_arena *arena) {
- upb_map **map = PTR_AT(msg, ofs, upb_map *);
- if (!*map) {
- *map = _upb_map_new(arena, key_size, val_size);
- }
- return _upb_map_set(*map, key, key_size, val, val_size, arena);
-}
-
-UPB_INLINE bool _upb_msg_map_delete(upb_msg *msg, size_t ofs, const void *key,
- size_t key_size) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return false;
- return _upb_map_delete(map, key, key_size);
-}
-
-UPB_INLINE void _upb_msg_map_clear(upb_msg *msg, size_t ofs) {
- upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
- if (!map) return;
- _upb_map_clear(map);
-}
-
-/* Accessing map key/value from a pointer, used by generated code only. */
-
-UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
- const upb_tabent *ent = (const upb_tabent*)msg;
- uint32_t u32len;
- upb_strview k;
- k.data = upb_tabstr(ent->key, &u32len);
- k.size = u32len;
- _upb_map_fromkey(k, key, size);
-}
-
-UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
- const upb_tabent *ent = (const upb_tabent*)msg;
- upb_value v;
- _upb_value_setval(&v, ent->val.val);
- _upb_map_fromvalue(v, val, size);
-}
-
-UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
- upb_tabent *ent = (upb_tabent*)msg;
- /* This is like _upb_map_tovalue() except the entry already exists so we can
- * reuse the allocated upb_strview for string fields. */
- if (size == UPB_MAPTYPE_STRING) {
- upb_strview *strp = (upb_strview*)(uintptr_t)ent->val.val;
- memcpy(strp, val, sizeof(*strp));
- } else {
- memcpy(&ent->val.val, val, size);
- }
-}
-
-/** _upb_mapsorter *************************************************************/
-
-/* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
- * Since maps can be recursive (map values can be messages which contain other maps).
- * _upb_mapsorter can contain a stack of maps. */
-
-typedef struct {
- upb_tabent const**entries;
- int size;
- int cap;
-} _upb_mapsorter;
-
-typedef struct {
- int start;
- int pos;
- int end;
-} _upb_sortedmap;
-
-UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter *s) {
- s->entries = NULL;
- s->size = 0;
- s->cap = 0;
-}
-
-UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter *s) {
- if (s->entries) free(s->entries);
-}
-
-bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
- const upb_map *map, _upb_sortedmap *sorted);
-
-UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter *s, _upb_sortedmap *sorted) {
- s->size = sorted->start;
-}
-
-UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter *s, const upb_map *map,
- _upb_sortedmap *sorted,
- upb_map_entry *ent) {
- if (sorted->pos == sorted->end) return false;
- const upb_tabent *tabent = s->entries[sorted->pos++];
- upb_strview key = upb_tabstrview(tabent->key);
- _upb_map_fromkey(key, &ent->k, map->key_size);
- upb_value val = {tabent->val.val};
- _upb_map_fromvalue(val, &ent->v, map->val_size);
- return true;
-}
-
-#undef PTR_AT
+/* Creates a upb_extreg in the given arena. The arena must outlive any use of
+ * the extreg. */
+upb_extreg *upb_extreg_new(upb_arena *arena);
#ifdef __cplusplus
} /* extern "C" */
#endif
-#include "upb/port_undef.inc"
-
-#endif /* UPB_MSG_H_ */
+#endif /* UPB_MSG_INT_H_ */
diff --git a/contrib/libs/grpc/third_party/upb/upb/msg_internal.h b/contrib/libs/grpc/third_party/upb/upb/msg_internal.h
new file mode 100644
index 00000000000..7d024f7beb6
--- /dev/null
+++ b/contrib/libs/grpc/third_party/upb/upb/msg_internal.h
@@ -0,0 +1,769 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+** Our memory representation for parsing tables and messages themselves.
+** Functions in this file are used by generated code and possibly reflection.
+**
+** The definitions in this file are internal to upb.
+**/
+
+#ifndef UPB_MSG_INT_H_
+#define UPB_MSG_INT_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "upb/msg.h"
+#include "upb/table_internal.h"
+#include "upb/upb.h"
+
+/* Must be last. */
+#include "upb/port_def.inc"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** upb_msglayout *************************************************************/
+
+/* upb_msglayout represents the memory layout of a given upb_msgdef. The
+ * members are public so generated code can initialize them, but users MUST NOT
+ * read or write any of its members. */
+
+/* These aren't real labels according to descriptor.proto, but in the table we
+ * use these for map/packed fields instead of UPB_LABEL_REPEATED. */
+enum {
+ _UPB_LABEL_MAP = 4,
+ _UPB_LABEL_PACKED = 7 /* Low 3 bits are common with UPB_LABEL_REPEATED. */
+};
+
+typedef struct {
+ uint32_t number;
+ uint16_t offset;
+ int16_t presence; /* If >0, hasbit_index. If <0, ~oneof_index. */
+ uint16_t submsg_index; /* undefined if descriptortype != MESSAGE or GROUP. */
+ uint8_t descriptortype;
+ uint8_t mode; /* upb_fieldmode | upb_labelflags |
+ (upb_rep << _UPB_REP_SHIFT) */
+} upb_msglayout_field;
+
+typedef enum {
+ _UPB_MODE_MAP = 0,
+ _UPB_MODE_ARRAY = 1,
+ _UPB_MODE_SCALAR = 2,
+
+ _UPB_MODE_MASK = 3, /* Mask to isolate the mode from upb_rep. */
+} upb_fieldmode;
+
+/* Extra flags on the mode field. */
+enum upb_labelflags {
+ _UPB_MODE_IS_PACKED = 4,
+ _UPB_MODE_IS_EXTENSION = 8,
+};
+
+/* Representation in the message. Derivable from descriptortype and mode, but
+ * fast access helps the serializer. */
+enum upb_rep {
+ _UPB_REP_1BYTE = 0,
+ _UPB_REP_4BYTE = 1,
+ _UPB_REP_8BYTE = 2,
+ _UPB_REP_STRVIEW = 3,
+
+#if UINTPTR_MAX == 0xffffffff
+ _UPB_REP_PTR = _UPB_REP_4BYTE,
+#else
+ _UPB_REP_PTR = _UPB_REP_8BYTE,
+#endif
+
+ _UPB_REP_SHIFT = 6, /* Bit offset of the rep in upb_msglayout_field.mode */
+};
+
+UPB_INLINE upb_fieldmode _upb_getmode(const upb_msglayout_field *field) {
+ return (upb_fieldmode)(field->mode & 3);
+}
+
+UPB_INLINE bool _upb_repeated_or_map(const upb_msglayout_field *field) {
+ /* This works because upb_fieldmode has no value 3. */
+ return !(field->mode & _UPB_MODE_SCALAR);
+}
+
+UPB_INLINE bool _upb_issubmsg(const upb_msglayout_field *field) {
+ return field->descriptortype == UPB_DTYPE_MESSAGE ||
+ field->descriptortype == UPB_DTYPE_GROUP;
+}
+
+struct upb_decstate;
+struct upb_msglayout;
+
+typedef const char *_upb_field_parser(struct upb_decstate *d, const char *ptr,
+ upb_msg *msg, intptr_t table,
+ uint64_t hasbits, uint64_t data);
+
+typedef struct {
+ uint64_t field_data;
+ _upb_field_parser *field_parser;
+} _upb_fasttable_entry;
+
+typedef union {
+ const struct upb_msglayout *submsg;
+ // TODO: const upb_enumlayout *subenum;
+} upb_msglayout_sub;
+
+typedef enum {
+ _UPB_MSGEXT_NONE = 0, // Non-extendable message.
+ _UPB_MSGEXT_EXTENDABLE = 1, // Normal extendable message.
+ _UPB_MSGEXT_MSGSET = 2, // MessageSet message.
+ _UPB_MSGEXT_MSGSET_ITEM = 3, // MessageSet item (temporary only, see decode.c)
+} upb_msgext_mode;
+
+/* MessageSet wire format is:
+ * message MessageSet {
+ * repeated group Item = 1 {
+ * required int32 type_id = 2;
+ * required string message = 3;
+ * }
+ * }
+ */
+typedef enum {
+ _UPB_MSGSET_ITEM = 1,
+ _UPB_MSGSET_TYPEID = 2,
+ _UPB_MSGSET_MESSAGE = 3,
+} upb_msgext_fieldnum;
+
+struct upb_msglayout {
+ const upb_msglayout_sub *subs;
+ const upb_msglayout_field *fields;
+ /* Must be aligned to sizeof(void*). Doesn't include internal members like
+ * unknown fields, extension dict, pointer to msglayout, etc. */
+ uint16_t size;
+ uint16_t field_count;
+ uint8_t ext; // upb_msgext_mode, declared as uint8_t so sizeof(ext) == 1
+ uint8_t dense_below;
+ uint8_t table_mask;
+ /* To constant-initialize the tables of variable length, we need a flexible
+ * array member, and we need to compile in C99 mode. */
+ _upb_fasttable_entry fasttable[];
+};
+
+typedef struct {
+ upb_msglayout_field field;
+ const upb_msglayout *extendee;
+ upb_msglayout_sub sub; /* NULL unless submessage or proto2 enum */
+} upb_msglayout_ext;
+
+typedef struct {
+ const upb_msglayout **msgs;
+ const upb_msglayout_ext **exts;
+ int msg_count;
+ int ext_count;
+} upb_msglayout_file;
+
+/** upb_extreg ****************************************************************/
+
+/* Adds the given extension info for message type |l| and field number |num|
+ * into the registry. Returns false if this message type and field number were
+ * already in the map, or if memory allocation fails. */
+bool _upb_extreg_add(upb_extreg *r, const upb_msglayout_ext **e, size_t count);
+
+/* Looks up the extension (if any) defined for message type |l| and field
+ * number |num|. If an extension was found, copies the field info into |*ext|
+ * and returns true. Otherwise returns false. */
+const upb_msglayout_ext *_upb_extreg_get(const upb_extreg *r,
+ const upb_msglayout *l, uint32_t num);
+
+/** upb_msg *******************************************************************/
+
+/* Internal members of a upb_msg that track unknown fields and/or extensions.
+ * We can change this without breaking binary compatibility. We put these
+ * before the user's data. The user's upb_msg* points after the
+ * upb_msg_internal. */
+
+typedef struct {
+ /* Total size of this structure, including the data that follows.
+ * Must be aligned to 8, which is alignof(upb_msg_ext) */
+ uint32_t size;
+
+ /* Offsets relative to the beginning of this structure.
+ *
+ * Unknown data grows forward from the beginning to unknown_end.
+ * Extension data grows backward from size to ext_begin.
+ * When the two meet, we're out of data and have to realloc.
+ *
+ * If we imagine that the final member of this struct is:
+ * char data[size - overhead]; // overhead = sizeof(upb_msg_internaldata)
+ *
+ * Then we have:
+ * unknown data: data[0 .. (unknown_end - overhead)]
+ * extensions data: data[(ext_begin - overhead) .. (size - overhead)] */
+ uint32_t unknown_end;
+ uint32_t ext_begin;
+ /* Data follows, as if there were an array:
+ * char data[size - sizeof(upb_msg_internaldata)]; */
+} upb_msg_internaldata;
+
+typedef struct {
+ upb_msg_internaldata *internal;
+} upb_msg_internal;
+
+/* Maps upb_fieldtype_t -> memory size. */
+extern char _upb_fieldtype_to_size[12];
+
+UPB_INLINE size_t upb_msg_sizeof(const upb_msglayout *l) {
+ return l->size + sizeof(upb_msg_internal);
+}
+
+UPB_INLINE upb_msg *_upb_msg_new_inl(const upb_msglayout *l, upb_arena *a) {
+ size_t size = upb_msg_sizeof(l);
+ void *mem = upb_arena_malloc(a, size);
+ upb_msg *msg;
+ if (UPB_UNLIKELY(!mem)) return NULL;
+ msg = UPB_PTR_AT(mem, sizeof(upb_msg_internal), upb_msg);
+ memset(mem, 0, size);
+ return msg;
+}
+
+/* Creates a new messages with the given layout on the given arena. */
+upb_msg *_upb_msg_new(const upb_msglayout *l, upb_arena *a);
+
+UPB_INLINE upb_msg_internal *upb_msg_getinternal(upb_msg *msg) {
+ ptrdiff_t size = sizeof(upb_msg_internal);
+ return (upb_msg_internal*)((char*)msg - size);
+}
+
+/* Clears the given message. */
+void _upb_msg_clear(upb_msg *msg, const upb_msglayout *l);
+
+/* Discards the unknown fields for this message only. */
+void _upb_msg_discardunknown_shallow(upb_msg *msg);
+
+/* Adds unknown data (serialized protobuf data) to the given message. The data
+ * is copied into the message instance. */
+bool _upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
+ upb_arena *arena);
+
+/** upb_msg_ext ***************************************************************/
+
+/* The internal representation of an extension is self-describing: it contains
+ * enough information that we can serialize it to binary format without needing
+ * to look it up in a registry. */
+typedef struct {
+ const upb_msglayout_ext *ext;
+ union {
+ upb_strview str;
+ void *ptr;
+ double dbl;
+ char scalar_data[8];
+ } data;
+} upb_msg_ext;
+
+/* Adds the given extension data to the given message. The returned extension will
+ * have its "ext" member initialized according to |ext|. */
+upb_msg_ext *_upb_msg_getorcreateext(upb_msg *msg, const upb_msglayout_ext *ext,
+ upb_arena *arena);
+
+/* Returns an array of extensions for this message. Note: the array is
+ * ordered in reverse relative to the order of creation. */
+const upb_msg_ext *_upb_msg_getexts(const upb_msg *msg, size_t *count);
+
+/* Returns an extension for the given field number, or NULL if no extension
+ * exists for this field number. */
+const upb_msg_ext *_upb_msg_getext(const upb_msg *msg,
+ const upb_msglayout_ext *ext);
+
+void _upb_msg_clearext(upb_msg *msg, const upb_msglayout_ext *ext);
+
+/** Hasbit access *************************************************************/
+
+UPB_INLINE bool _upb_hasbit(const upb_msg *msg, size_t idx) {
+ return (*UPB_PTR_AT(msg, idx / 8, const char) & (1 << (idx % 8))) != 0;
+}
+
+UPB_INLINE void _upb_sethas(const upb_msg *msg, size_t idx) {
+ (*UPB_PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
+}
+
+UPB_INLINE void _upb_clearhas(const upb_msg *msg, size_t idx) {
+ (*UPB_PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
+}
+
+UPB_INLINE size_t _upb_msg_hasidx(const upb_msglayout_field *f) {
+ UPB_ASSERT(f->presence > 0);
+ return f->presence;
+}
+
+UPB_INLINE bool _upb_hasbit_field(const upb_msg *msg,
+ const upb_msglayout_field *f) {
+ return _upb_hasbit(msg, _upb_msg_hasidx(f));
+}
+
+UPB_INLINE void _upb_sethas_field(const upb_msg *msg,
+ const upb_msglayout_field *f) {
+ _upb_sethas(msg, _upb_msg_hasidx(f));
+}
+
+UPB_INLINE void _upb_clearhas_field(const upb_msg *msg,
+ const upb_msglayout_field *f) {
+ _upb_clearhas(msg, _upb_msg_hasidx(f));
+}
+
+/** Oneof case access *********************************************************/
+
+UPB_INLINE uint32_t *_upb_oneofcase(upb_msg *msg, size_t case_ofs) {
+ return UPB_PTR_AT(msg, case_ofs, uint32_t);
+}
+
+UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs) {
+ return *UPB_PTR_AT(msg, case_ofs, uint32_t);
+}
+
+UPB_INLINE size_t _upb_oneofcase_ofs(const upb_msglayout_field *f) {
+ UPB_ASSERT(f->presence < 0);
+ return ~(ptrdiff_t)f->presence;
+}
+
+UPB_INLINE uint32_t *_upb_oneofcase_field(upb_msg *msg,
+ const upb_msglayout_field *f) {
+ return _upb_oneofcase(msg, _upb_oneofcase_ofs(f));
+}
+
+UPB_INLINE uint32_t _upb_getoneofcase_field(const upb_msg *msg,
+ const upb_msglayout_field *f) {
+ return _upb_getoneofcase(msg, _upb_oneofcase_ofs(f));
+}
+
+UPB_INLINE bool _upb_has_submsg_nohasbit(const upb_msg *msg, size_t ofs) {
+ return *UPB_PTR_AT(msg, ofs, const upb_msg*) != NULL;
+}
+
+/** upb_array *****************************************************************/
+
+/* Our internal representation for repeated fields. */
+typedef struct {
+ uintptr_t data; /* Tagged ptr: low 3 bits of ptr are lg2(elem size). */
+ size_t len; /* Measured in elements. */
+ size_t size; /* Measured in elements. */
+ uint64_t junk;
+} upb_array;
+
+UPB_INLINE const void *_upb_array_constptr(const upb_array *arr) {
+ UPB_ASSERT((arr->data & 7) <= 4);
+ return (void*)(arr->data & ~(uintptr_t)7);
+}
+
+UPB_INLINE uintptr_t _upb_array_tagptr(void* ptr, int elem_size_lg2) {
+ UPB_ASSERT(elem_size_lg2 <= 4);
+ return (uintptr_t)ptr | elem_size_lg2;
+}
+
+UPB_INLINE void *_upb_array_ptr(upb_array *arr) {
+ return (void*)_upb_array_constptr(arr);
+}
+
+UPB_INLINE uintptr_t _upb_tag_arrptr(void* ptr, int elem_size_lg2) {
+ UPB_ASSERT(elem_size_lg2 <= 4);
+ UPB_ASSERT(((uintptr_t)ptr & 7) == 0);
+ return (uintptr_t)ptr | (unsigned)elem_size_lg2;
+}
+
+UPB_INLINE upb_array *_upb_array_new(upb_arena *a, size_t init_size,
+ int elem_size_lg2) {
+ const size_t arr_size = UPB_ALIGN_UP(sizeof(upb_array), 8);
+ const size_t bytes = sizeof(upb_array) + (init_size << elem_size_lg2);
+ upb_array *arr = (upb_array*)upb_arena_malloc(a, bytes);
+ if (!arr) return NULL;
+ arr->data = _upb_tag_arrptr(UPB_PTR_AT(arr, arr_size, void), elem_size_lg2);
+ arr->len = 0;
+ arr->size = init_size;
+ return arr;
+}
+
+/* Resizes the capacity of the array to be at least min_size. */
+bool _upb_array_realloc(upb_array *arr, size_t min_size, upb_arena *arena);
+
+/* Fallback functions for when the accessors require a resize. */
+void *_upb_array_resize_fallback(upb_array **arr_ptr, size_t size,
+ int elem_size_lg2, upb_arena *arena);
+bool _upb_array_append_fallback(upb_array **arr_ptr, const void *value,
+ int elem_size_lg2, upb_arena *arena);
+
+UPB_INLINE bool _upb_array_reserve(upb_array *arr, size_t size,
+ upb_arena *arena) {
+ if (arr->size < size) return _upb_array_realloc(arr, size, arena);
+ return true;
+}
+
+UPB_INLINE bool _upb_array_resize(upb_array *arr, size_t size,
+ upb_arena *arena) {
+ if (!_upb_array_reserve(arr, size, arena)) return false;
+ arr->len = size;
+ return true;
+}
+
+UPB_INLINE const void *_upb_array_accessor(const void *msg, size_t ofs,
+ size_t *size) {
+ const upb_array *arr = *UPB_PTR_AT(msg, ofs, const upb_array*);
+ if (arr) {
+ if (size) *size = arr->len;
+ return _upb_array_constptr(arr);
+ } else {
+ if (size) *size = 0;
+ return NULL;
+ }
+}
+
+UPB_INLINE void *_upb_array_mutable_accessor(void *msg, size_t ofs,
+ size_t *size) {
+ upb_array *arr = *UPB_PTR_AT(msg, ofs, upb_array*);
+ if (arr) {
+ if (size) *size = arr->len;
+ return _upb_array_ptr(arr);
+ } else {
+ if (size) *size = 0;
+ return NULL;
+ }
+}
+
+UPB_INLINE void *_upb_array_resize_accessor2(void *msg, size_t ofs, size_t size,
+ int elem_size_lg2,
+ upb_arena *arena) {
+ upb_array **arr_ptr = UPB_PTR_AT(msg, ofs, upb_array *);
+ upb_array *arr = *arr_ptr;
+ if (!arr || arr->size < size) {
+ return _upb_array_resize_fallback(arr_ptr, size, elem_size_lg2, arena);
+ }
+ arr->len = size;
+ return _upb_array_ptr(arr);
+}
+
+UPB_INLINE bool _upb_array_append_accessor2(void *msg, size_t ofs,
+ int elem_size_lg2,
+ const void *value,
+ upb_arena *arena) {
+ upb_array **arr_ptr = UPB_PTR_AT(msg, ofs, upb_array *);
+ size_t elem_size = 1 << elem_size_lg2;
+ upb_array *arr = *arr_ptr;
+ void *ptr;
+ if (!arr || arr->len == arr->size) {
+ return _upb_array_append_fallback(arr_ptr, value, elem_size_lg2, arena);
+ }
+ ptr = _upb_array_ptr(arr);
+ memcpy(UPB_PTR_AT(ptr, arr->len * elem_size, char), value, elem_size);
+ arr->len++;
+ return true;
+}
+
+/* Used by old generated code, remove once all code has been regenerated. */
+UPB_INLINE int _upb_sizelg2(upb_fieldtype_t type) {
+ switch (type) {
+ case UPB_TYPE_BOOL:
+ return 0;
+ case UPB_TYPE_FLOAT:
+ case UPB_TYPE_INT32:
+ case UPB_TYPE_UINT32:
+ case UPB_TYPE_ENUM:
+ return 2;
+ case UPB_TYPE_MESSAGE:
+ return UPB_SIZE(2, 3);
+ case UPB_TYPE_DOUBLE:
+ case UPB_TYPE_INT64:
+ case UPB_TYPE_UINT64:
+ return 3;
+ case UPB_TYPE_STRING:
+ case UPB_TYPE_BYTES:
+ return UPB_SIZE(3, 4);
+ }
+ UPB_UNREACHABLE();
+}
+UPB_INLINE void *_upb_array_resize_accessor(void *msg, size_t ofs, size_t size,
+ upb_fieldtype_t type,
+ upb_arena *arena) {
+ return _upb_array_resize_accessor2(msg, ofs, size, _upb_sizelg2(type), arena);
+}
+UPB_INLINE bool _upb_array_append_accessor(void *msg, size_t ofs,
+ size_t elem_size, upb_fieldtype_t type,
+ const void *value,
+ upb_arena *arena) {
+ (void)elem_size;
+ return _upb_array_append_accessor2(msg, ofs, _upb_sizelg2(type), value,
+ arena);
+}
+
+/** upb_map *******************************************************************/
+
+/* Right now we use strmaps for everything. We'll likely want to use
+ * integer-specific maps for integer-keyed maps.*/
+typedef struct {
+ /* Size of key and val, based on the map type. Strings are represented as '0'
+ * because they must be handled specially. */
+ char key_size;
+ char val_size;
+
+ upb_strtable table;
+} upb_map;
+
+/* Map entries aren't actually stored, they are only used during parsing. For
+ * parsing, it helps a lot if all map entry messages have the same layout.
+ * The compiler and def.c must ensure that all map entries have this layout. */
+typedef struct {
+ upb_msg_internal internal;
+ union {
+ upb_strview str; /* For str/bytes. */
+ upb_value val; /* For all other types. */
+ } k;
+ union {
+ upb_strview str; /* For str/bytes. */
+ upb_value val; /* For all other types. */
+ } v;
+} upb_map_entry;
+
+/* Creates a new map on the given arena with this key/value type. */
+upb_map *_upb_map_new(upb_arena *a, size_t key_size, size_t value_size);
+
+/* Converting between internal table representation and user values.
+ *
+ * _upb_map_tokey() and _upb_map_fromkey() are inverses.
+ * _upb_map_tovalue() and _upb_map_fromvalue() are inverses.
+ *
+ * These functions account for the fact that strings are treated differently
+ * from other types when stored in a map.
+ */
+
+UPB_INLINE upb_strview _upb_map_tokey(const void *key, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ return *(upb_strview*)key;
+ } else {
+ return upb_strview_make((const char*)key, size);
+ }
+}
+
+UPB_INLINE void _upb_map_fromkey(upb_strview key, void* out, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ memcpy(out, &key, sizeof(key));
+ } else {
+ memcpy(out, key.data, size);
+ }
+}
+
+UPB_INLINE bool _upb_map_tovalue(const void *val, size_t size, upb_value *msgval,
+ upb_arena *a) {
+ if (size == UPB_MAPTYPE_STRING) {
+ upb_strview *strp = (upb_strview*)upb_arena_malloc(a, sizeof(*strp));
+ if (!strp) return false;
+ *strp = *(upb_strview*)val;
+ *msgval = upb_value_ptr(strp);
+ } else {
+ memcpy(msgval, val, size);
+ }
+ return true;
+}
+
+UPB_INLINE void _upb_map_fromvalue(upb_value val, void* out, size_t size) {
+ if (size == UPB_MAPTYPE_STRING) {
+ const upb_strview *strp = (const upb_strview*)upb_value_getptr(val);
+ memcpy(out, strp, sizeof(upb_strview));
+ } else {
+ memcpy(out, &val, size);
+ }
+}
+
+/* Map operations, shared by reflection and generated code. */
+
+UPB_INLINE size_t _upb_map_size(const upb_map *map) {
+ return map->table.t.count;
+}
+
+UPB_INLINE bool _upb_map_get(const upb_map *map, const void *key,
+ size_t key_size, void *val, size_t val_size) {
+ upb_value tabval;
+ upb_strview k = _upb_map_tokey(key, key_size);
+ bool ret = upb_strtable_lookup2(&map->table, k.data, k.size, &tabval);
+ if (ret && val) {
+ _upb_map_fromvalue(tabval, val, val_size);
+ }
+ return ret;
+}
+
+UPB_INLINE void* _upb_map_next(const upb_map *map, size_t *iter) {
+ upb_strtable_iter it;
+ it.t = &map->table;
+ it.index = *iter;
+ upb_strtable_next(&it);
+ *iter = it.index;
+ if (upb_strtable_done(&it)) return NULL;
+ return (void*)str_tabent(&it);
+}
+
+UPB_INLINE bool _upb_map_set(upb_map *map, const void *key, size_t key_size,
+ void *val, size_t val_size, upb_arena *a) {
+ upb_strview strkey = _upb_map_tokey(key, key_size);
+ upb_value tabval = {0};
+ if (!_upb_map_tovalue(val, val_size, &tabval, a)) return false;
+
+ /* TODO(haberman): add overwrite operation to minimize number of lookups. */
+ upb_strtable_remove(&map->table, strkey.data, strkey.size, NULL);
+ return upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a);
+}
+
+UPB_INLINE bool _upb_map_delete(upb_map *map, const void *key, size_t key_size) {
+ upb_strview k = _upb_map_tokey(key, key_size);
+ return upb_strtable_remove(&map->table, k.data, k.size, NULL);
+}
+
+UPB_INLINE void _upb_map_clear(upb_map *map) {
+ upb_strtable_clear(&map->table);
+}
+
+/* Message map operations, these get the map from the message first. */
+
+UPB_INLINE size_t _upb_msg_map_size(const upb_msg *msg, size_t ofs) {
+ upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
+ return map ? _upb_map_size(map) : 0;
+}
+
+UPB_INLINE bool _upb_msg_map_get(const upb_msg *msg, size_t ofs,
+ const void *key, size_t key_size, void *val,
+ size_t val_size) {
+ upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
+ if (!map) return false;
+ return _upb_map_get(map, key, key_size, val, val_size);
+}
+
+UPB_INLINE void *_upb_msg_map_next(const upb_msg *msg, size_t ofs,
+ size_t *iter) {
+ upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
+ if (!map) return NULL;
+ return _upb_map_next(map, iter);
+}
+
+UPB_INLINE bool _upb_msg_map_set(upb_msg *msg, size_t ofs, const void *key,
+ size_t key_size, void *val, size_t val_size,
+ upb_arena *arena) {
+ upb_map **map = UPB_PTR_AT(msg, ofs, upb_map *);
+ if (!*map) {
+ *map = _upb_map_new(arena, key_size, val_size);
+ }
+ return _upb_map_set(*map, key, key_size, val, val_size, arena);
+}
+
+UPB_INLINE bool _upb_msg_map_delete(upb_msg *msg, size_t ofs, const void *key,
+ size_t key_size) {
+ upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
+ if (!map) return false;
+ return _upb_map_delete(map, key, key_size);
+}
+
+UPB_INLINE void _upb_msg_map_clear(upb_msg *msg, size_t ofs) {
+ upb_map *map = *UPB_PTR_AT(msg, ofs, upb_map *);
+ if (!map) return;
+ _upb_map_clear(map);
+}
+
+/* Accessing map key/value from a pointer, used by generated code only. */
+
+UPB_INLINE void _upb_msg_map_key(const void* msg, void* key, size_t size) {
+ const upb_tabent *ent = (const upb_tabent*)msg;
+ uint32_t u32len;
+ upb_strview k;
+ k.data = upb_tabstr(ent->key, &u32len);
+ k.size = u32len;
+ _upb_map_fromkey(k, key, size);
+}
+
+UPB_INLINE void _upb_msg_map_value(const void* msg, void* val, size_t size) {
+ const upb_tabent *ent = (const upb_tabent*)msg;
+ upb_value v = {ent->val.val};
+ _upb_map_fromvalue(v, val, size);
+}
+
+UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, size_t size) {
+ upb_tabent *ent = (upb_tabent*)msg;
+ /* This is like _upb_map_tovalue() except the entry already exists so we can
+ * reuse the allocated upb_strview for string fields. */
+ if (size == UPB_MAPTYPE_STRING) {
+ upb_strview *strp = (upb_strview*)(uintptr_t)ent->val.val;
+ memcpy(strp, val, sizeof(*strp));
+ } else {
+ memcpy(&ent->val.val, val, size);
+ }
+}
+
+/** _upb_mapsorter *************************************************************/
+
+/* _upb_mapsorter sorts maps and provides ordered iteration over the entries.
+ * Since maps can be recursive (map values can be messages which contain other maps).
+ * _upb_mapsorter can contain a stack of maps. */
+
+typedef struct {
+ upb_tabent const**entries;
+ int size;
+ int cap;
+} _upb_mapsorter;
+
+typedef struct {
+ int start;
+ int pos;
+ int end;
+} _upb_sortedmap;
+
+UPB_INLINE void _upb_mapsorter_init(_upb_mapsorter *s) {
+ s->entries = NULL;
+ s->size = 0;
+ s->cap = 0;
+}
+
+UPB_INLINE void _upb_mapsorter_destroy(_upb_mapsorter *s) {
+ if (s->entries) free(s->entries);
+}
+
+bool _upb_mapsorter_pushmap(_upb_mapsorter *s, upb_descriptortype_t key_type,
+ const upb_map *map, _upb_sortedmap *sorted);
+
+UPB_INLINE void _upb_mapsorter_popmap(_upb_mapsorter *s, _upb_sortedmap *sorted) {
+ s->size = sorted->start;
+}
+
+UPB_INLINE bool _upb_sortedmap_next(_upb_mapsorter *s, const upb_map *map,
+ _upb_sortedmap *sorted,
+ upb_map_entry *ent) {
+ if (sorted->pos == sorted->end) return false;
+ const upb_tabent *tabent = s->entries[sorted->pos++];
+ upb_strview key = upb_tabstrview(tabent->key);
+ _upb_map_fromkey(key, &ent->k, map->key_size);
+ upb_value val = {tabent->val.val};
+ _upb_map_fromvalue(val, &ent->v, map->val_size);
+ return true;
+}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#include "upb/port_undef.inc"
+
+#endif /* UPB_MSG_INT_H_ */
diff --git a/contrib/libs/grpc/third_party/upb/upb/port_def.inc b/contrib/libs/grpc/third_party/upb/upb/port_def.inc
index 2cd1bb6985d..75d416d1cec 100644
--- a/contrib/libs/grpc/third_party/upb/upb/port_def.inc
+++ b/contrib/libs/grpc/third_party/upb/upb/port_def.inc
@@ -1,25 +1,52 @@
/*
-* This is where we define macros used across upb.
-*
-* All of these macros are undef'd in port_undef.inc to avoid leaking them to
-* users.
-*
-* The correct usage is:
-*
-* #include "upb/foobar.h"
-* #include "upb/baz.h"
-*
-* // MUST be last included header.
-* #include "upb/port_def.inc"
-*
-* // Code for this file.
-* // <...>
-*
-* // Can be omitted for .c files, required for .h.
-* #include "upb/port_undef.inc"
-*
-* This file is private and must not be included by users!
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This is where we define macros used across upb.
+ *
+ * All of these macros are undef'd in port_undef.inc to avoid leaking them to
+ * users.
+ *
+ * The correct usage is:
+ *
+ * #include "upb/foobar.h"
+ * #include "upb/baz.h"
+ *
+ * // MUST be last included header.
+ * #include "upb/port_def.inc"
+ *
+ * // Code for this file.
+ * // <...>
+ *
+ * // Can be omitted for .c files, required for .h.
+ * #include "upb/port_undef.inc"
+ *
+ * This file is private and must not be included by users!
+ */
#if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(__cplusplus) && __cplusplus >= 201103L) || \
@@ -80,14 +107,17 @@
#define UPB_FORCEINLINE __inline__ __attribute__((always_inline))
#define UPB_NOINLINE __attribute__((noinline))
#define UPB_NORETURN __attribute__((__noreturn__))
+#define UPB_PRINTF(str, first_vararg) __attribute__((format (printf, str, first_vararg)))
#elif defined(_MSC_VER)
#define UPB_NOINLINE
#define UPB_FORCEINLINE
#define UPB_NORETURN __declspec(noreturn)
+#define UPB_PRINTF(str, first_vararg)
#else /* !defined(__GNUC__) */
#define UPB_FORCEINLINE
#define UPB_NOINLINE
#define UPB_NORETURN
+#define UPB_PRINTF(str, first_vararg)
#endif
#define UPB_MAX(x, y) ((x) > (y) ? (x) : (y))
@@ -132,9 +162,40 @@
#define UPB_LONGJMP(buf, val) longjmp(buf, val)
#endif
+/* UPB_PTRADD(ptr, ofs): add pointer while avoiding "NULL + 0" UB */
+#define UPB_PTRADD(ptr, ofs) ((ofs) ? (ptr) + (ofs) : (ptr))
+
/* Configure whether fasttable is switched on or not. *************************/
-#if defined(__x86_64__) && defined(__GNUC__)
+#ifdef __has_attribute
+#define UPB_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#define UPB_HAS_ATTRIBUTE(x) 0
+#endif
+
+#if UPB_HAS_ATTRIBUTE(musttail)
+#define UPB_MUSTTAIL __attribute__((musttail))
+#else
+#define UPB_MUSTTAIL
+#endif
+
+#undef UPB_HAS_ATTRIBUTE
+
+/* This check is not fully robust: it does not require that we have "musttail"
+ * support available. We need tail calls to avoid consuming arbitrary amounts
+ * of stack space.
+ *
+ * GCC/Clang can mostly be trusted to generate tail calls as long as
+ * optimization is enabled, but, debug builds will not generate tail calls
+ * unless "musttail" is available.
+ *
+ * We should probably either:
+ * 1. require that the compiler supports musttail.
+ * 2. add some fallback code for when musttail isn't available (ie. return
+ * instead of tail calling). This is safe and portable, but this comes at
+ * a CPU cost.
+ */
+#if (defined(__x86_64__) || defined(__aarch64__)) && defined(__GNUC__)
#define UPB_FASTTABLE_SUPPORTED 1
#else
#define UPB_FASTTABLE_SUPPORTED 0
@@ -145,7 +206,7 @@
* for example for testing or benchmarking. */
#if defined(UPB_ENABLE_FASTTABLE)
#if !UPB_FASTTABLE_SUPPORTED
-#error fasttable is x86-64 + Clang/GCC only
+#error fasttable is x86-64/ARM64 only and requires GCC or Clang.
#endif
#define UPB_FASTTABLE 1
/* Define UPB_TRY_ENABLE_FASTTABLE to use fasttable if possible.
@@ -189,4 +250,4 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
((void)(addr), (void)(size))
#define UPB_UNPOISON_MEMORY_REGION(addr, size) \
((void)(addr), (void)(size))
-#endif
+#endif
diff --git a/contrib/libs/grpc/third_party/upb/upb/port_undef.inc b/contrib/libs/grpc/third_party/upb/upb/port_undef.inc
index b7be52cc985..70956df25df 100644
--- a/contrib/libs/grpc/third_party/upb/upb/port_undef.inc
+++ b/contrib/libs/grpc/third_party/upb/upb/port_undef.inc
@@ -1,24 +1,61 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
/* See port_def.inc. This should #undef all macros #defined there. */
-#undef UPB_MAPTYPE_STRING
#undef UPB_SIZE
#undef UPB_PTR_AT
#undef UPB_READ_ONEOF
#undef UPB_WRITE_ONEOF
+#undef UPB_MAPTYPE_STRING
#undef UPB_INLINE
#undef UPB_ALIGN_UP
#undef UPB_ALIGN_DOWN
#undef UPB_ALIGN_MALLOC
#undef UPB_ALIGN_OF
+#undef UPB_LIKELY
+#undef UPB_UNLIKELY
#undef UPB_FORCEINLINE
#undef UPB_NOINLINE
#undef UPB_NORETURN
+#undef UPB_PRINTF
#undef UPB_MAX
#undef UPB_MIN
#undef UPB_UNUSED
#undef UPB_ASSUME
#undef UPB_ASSERT
#undef UPB_UNREACHABLE
+#undef UPB_SETJMP
+#undef UPB_LONGJMP
+#undef UPB_PTRADD
+#undef UPB_MUSTTAIL
+#undef UPB_FASTTABLE_SUPPORTED
+#undef UPB_FASTTABLE
+#undef UPB_FASTTABLE_INIT
#undef UPB_POISON_MEMORY_REGION
#undef UPB_UNPOISON_MEMORY_REGION
#undef UPB_ASAN
diff --git a/contrib/libs/grpc/third_party/upb/upb/reflection.c b/contrib/libs/grpc/third_party/upb/upb/reflection.c
index a233d964e92..2c3e7e8eeac 100644
--- a/contrib/libs/grpc/third_party/upb/upb/reflection.c
+++ b/contrib/libs/grpc/third_party/upb/upb/reflection.c
@@ -1,8 +1,34 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/reflection.h"
#include <string.h>
-#include "upb/table.int.h"
+#include "upb/table_internal.h"
#include "upb/msg.h"
#include "upb/port_def.inc"
@@ -82,15 +108,20 @@ static upb_msgval _upb_msg_getraw(const upb_msg *msg, const upb_fielddef *f) {
}
bool upb_msg_has(const upb_msg *msg, const upb_fielddef *f) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- if (in_oneof(field)) {
- return _upb_getoneofcase_field(msg, field) == field->number;
- } else if (field->presence > 0) {
- return _upb_hasbit_field(msg, field);
+ if (upb_fielddef_isextension(f)) {
+ const upb_msglayout_ext *ext = _upb_fielddef_extlayout(f);
+ return _upb_msg_getext(msg, ext) != NULL;
} else {
- UPB_ASSERT(field->descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
- field->descriptortype == UPB_DESCRIPTOR_TYPE_GROUP);
- return _upb_msg_getraw(msg, f).msg_val != NULL;
+ const upb_msglayout_field *field = upb_fielddef_layout(f);
+ if (in_oneof(field)) {
+ return _upb_getoneofcase_field(msg, field) == field->number;
+ } else if (field->presence > 0) {
+ return _upb_hasbit_field(msg, field);
+ } else {
+ UPB_ASSERT(field->descriptortype == UPB_DESCRIPTOR_TYPE_MESSAGE ||
+ field->descriptortype == UPB_DESCRIPTOR_TYPE_GROUP);
+ return _upb_msg_getraw(msg, f).msg_val != NULL;
+ }
}
}
@@ -110,106 +141,92 @@ const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg,
}
upb_msgval upb_msg_get(const upb_msg *msg, const upb_fielddef *f) {
- if (!upb_fielddef_haspresence(f) || upb_msg_has(msg, f)) {
- return _upb_msg_getraw(msg, f);
- } else {
- /* TODO(haberman): change upb_fielddef to not require this switch(). */
- upb_msgval val = {0};
- switch (upb_fielddef_type(f)) {
- case UPB_TYPE_INT32:
- case UPB_TYPE_ENUM:
- val.int32_val = upb_fielddef_defaultint32(f);
- break;
- case UPB_TYPE_INT64:
- val.int64_val = upb_fielddef_defaultint64(f);
- break;
- case UPB_TYPE_UINT32:
- val.uint32_val = upb_fielddef_defaultuint32(f);
- break;
- case UPB_TYPE_UINT64:
- val.uint64_val = upb_fielddef_defaultuint64(f);
- break;
- case UPB_TYPE_FLOAT:
- val.float_val = upb_fielddef_defaultfloat(f);
- break;
- case UPB_TYPE_DOUBLE:
- val.double_val = upb_fielddef_defaultdouble(f);
- break;
- case UPB_TYPE_BOOL:
- val.bool_val = upb_fielddef_defaultbool(f);
- break;
- case UPB_TYPE_STRING:
- case UPB_TYPE_BYTES:
- val.str_val.data = upb_fielddef_defaultstr(f, &val.str_val.size);
- break;
- case UPB_TYPE_MESSAGE:
- val.msg_val = NULL;
- break;
+ if (upb_fielddef_isextension(f)) {
+ const upb_msg_ext *ext = _upb_msg_getext(msg, _upb_fielddef_extlayout(f));
+ if (ext) {
+ upb_msgval val;
+ memcpy(&val, &ext->data, sizeof(val));
+ return val;
+ } else if (upb_fielddef_isseq(f)) {
+ return (upb_msgval){.array_val = NULL};
}
- return val;
+ } else if (!upb_fielddef_haspresence(f) || upb_msg_has(msg, f)) {
+ return _upb_msg_getraw(msg, f);
}
+ return upb_fielddef_default(f);
}
upb_mutmsgval upb_msg_mutable(upb_msg *msg, const upb_fielddef *f,
upb_arena *a) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- upb_mutmsgval ret;
- char *mem = UPB_PTR_AT(msg, field->offset, char);
- bool wrong_oneof =
- in_oneof(field) && _upb_getoneofcase_field(msg, field) != field->number;
+ UPB_ASSERT(upb_fielddef_issubmsg(f) || upb_fielddef_isseq(f));
+ if (upb_fielddef_haspresence(f) && !upb_msg_has(msg, f)) {
+ // We need to skip the upb_msg_get() call in this case.
+ goto make;
+ }
- memcpy(&ret, mem, sizeof(void*));
+ upb_msgval val = upb_msg_get(msg, f);
+ if (val.array_val) {
+ return (upb_mutmsgval){.array = (upb_array*)val.array_val};
+ }
- if (a && (!ret.msg || wrong_oneof)) {
- if (upb_fielddef_ismap(f)) {
- const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
- const upb_fielddef *key = upb_msgdef_itof(entry, UPB_MAPENTRY_KEY);
- const upb_fielddef *value = upb_msgdef_itof(entry, UPB_MAPENTRY_VALUE);
- ret.map = upb_map_new(a, upb_fielddef_type(key), upb_fielddef_type(value));
- } else if (upb_fielddef_isseq(f)) {
- ret.array = upb_array_new(a, upb_fielddef_type(f));
- } else {
- UPB_ASSERT(upb_fielddef_issubmsg(f));
- ret.msg = upb_msg_new(upb_fielddef_msgsubdef(f), a);
- }
+ upb_mutmsgval ret;
+make:
+ if (!a) return (upb_mutmsgval){.array = NULL};
+ if (upb_fielddef_ismap(f)) {
+ const upb_msgdef *entry = upb_fielddef_msgsubdef(f);
+ const upb_fielddef *key = upb_msgdef_itof(entry, UPB_MAPENTRY_KEY);
+ const upb_fielddef *value = upb_msgdef_itof(entry, UPB_MAPENTRY_VALUE);
+ ret.map = upb_map_new(a, upb_fielddef_type(key), upb_fielddef_type(value));
+ } else if (upb_fielddef_isseq(f)) {
+ ret.array = upb_array_new(a, upb_fielddef_type(f));
+ } else {
+ UPB_ASSERT(upb_fielddef_issubmsg(f));
+ ret.msg = upb_msg_new(upb_fielddef_msgsubdef(f), a);
+ }
- memcpy(mem, &ret, sizeof(void*));
+ val.array_val = ret.array;
+ upb_msg_set(msg, f, val, a);
- if (wrong_oneof) {
- *_upb_oneofcase_field(msg, field) = field->number;
- } else if (field->presence > 0) {
- _upb_sethas_field(msg, field);
- }
- }
return ret;
}
-void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
+bool upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
upb_arena *a) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- char *mem = UPB_PTR_AT(msg, field->offset, char);
- UPB_UNUSED(a); /* We reserve the right to make set insert into a map. */
- memcpy(mem, &val, get_field_size(field));
- if (field->presence > 0) {
- _upb_sethas_field(msg, field);
- } else if (in_oneof(field)) {
- *_upb_oneofcase_field(msg, field) = field->number;
+ if (upb_fielddef_isextension(f)) {
+ upb_msg_ext *ext =
+ _upb_msg_getorcreateext(msg, _upb_fielddef_extlayout(f), a);
+ if (!ext) return false;
+ memcpy(&ext->data, &val, sizeof(val));
+ } else {
+ const upb_msglayout_field *field = upb_fielddef_layout(f);
+ char *mem = UPB_PTR_AT(msg, field->offset, char);
+ memcpy(mem, &val, get_field_size(field));
+ if (field->presence > 0) {
+ _upb_sethas_field(msg, field);
+ } else if (in_oneof(field)) {
+ *_upb_oneofcase_field(msg, field) = field->number;
+ }
}
+ return true;
}
void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f) {
- const upb_msglayout_field *field = upb_fielddef_layout(f);
- char *mem = UPB_PTR_AT(msg, field->offset, char);
-
- if (field->presence > 0) {
- _upb_clearhas_field(msg, field);
- } else if (in_oneof(field)) {
- uint32_t *oneof_case = _upb_oneofcase_field(msg, field);
- if (*oneof_case != field->number) return;
- *oneof_case = 0;
- }
+ if (upb_fielddef_isextension(f)) {
+ _upb_msg_clearext(msg, _upb_fielddef_extlayout(f));
+ } else {
+ const upb_msglayout_field *field = upb_fielddef_layout(f);
+ char *mem = UPB_PTR_AT(msg, field->offset, char);
+
+ if (field->presence > 0) {
+ _upb_clearhas_field(msg, field);
+ } else if (in_oneof(field)) {
+ uint32_t *oneof_case = _upb_oneofcase_field(msg, field);
+ if (*oneof_case != field->number) return;
+ *oneof_case = 0;
+ }
- memset(mem, 0, get_field_size(field));
+ memset(mem, 0, get_field_size(field));
+ }
}
void upb_msg_clear(upb_msg *msg, const upb_msgdef *m) {
@@ -219,10 +236,12 @@ void upb_msg_clear(upb_msg *msg, const upb_msgdef *m) {
bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
const upb_symtab *ext_pool, const upb_fielddef **out_f,
upb_msgval *out_val, size_t *iter) {
- int i = *iter;
- int n = upb_msgdef_fieldcount(m);
+ size_t i = *iter;
+ size_t n = upb_msgdef_fieldcount(m);
const upb_msgval zero = {0};
UPB_UNUSED(ext_pool);
+
+ /* Iterate over normal fields, returning the first one that is set. */
while (++i < n) {
const upb_fielddef *f = upb_msgdef_field(m, i);
upb_msgval val = _upb_msg_getraw(msg, f);
@@ -252,6 +271,20 @@ bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
*iter = i;
return true;
}
+
+ if (ext_pool) {
+ /* Return any extensions that are set. */
+ size_t count;
+ const upb_msg_ext *ext = _upb_msg_getexts(msg, &count);
+ if (i - n < count) {
+ ext += count - 1 - (i - n);
+ memcpy(out_val, &ext->data, sizeof(*out_val));
+ *out_f = _upb_symtab_lookupextfield(ext_pool, ext->ext);
+ *iter = i;
+ return true;
+ }
+ }
+
*iter = i;
return false;
}
@@ -333,10 +366,9 @@ void upb_array_set(upb_array *arr, size_t i, upb_msgval val) {
}
bool upb_array_append(upb_array *arr, upb_msgval val, upb_arena *arena) {
- if (!_upb_array_realloc(arr, arr->len + 1, arena)) {
+ if (!upb_array_resize(arr, arr->len + 1, arena)) {
return false;
}
- arr->len++;
upb_array_set(arr, arr->len - 1, val);
return true;
}
diff --git a/contrib/libs/grpc/third_party/upb/upb/reflection.h b/contrib/libs/grpc/third_party/upb/upb/reflection.h
index 0133630c58d..3c99ff1c4b4 100644
--- a/contrib/libs/grpc/third_party/upb/upb/reflection.h
+++ b/contrib/libs/grpc/third_party/upb/upb/reflection.h
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_REFLECTION_H_
#define UPB_REFLECTION_H_
@@ -8,6 +34,10 @@
#include "upb/port_def.inc"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef union {
bool bool_val;
float float_val;
@@ -28,6 +58,8 @@ typedef union {
upb_array* array;
} upb_mutmsgval;
+upb_msgval upb_fielddef_default(const upb_fielddef *f);
+
/** upb_msg *******************************************************************/
/* Creates a new message of the given type in the given arena. */
@@ -49,10 +81,14 @@ const upb_fielddef *upb_msg_whichoneof(const upb_msg *msg,
const upb_oneofdef *o);
/* Sets the given field to the given value. For a msg/array/map/string, the
- * value must be in the same arena. */
-void upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
+ * caller must ensure that the target data outlives |msg| (by living either in
+ * the same arena or a different arena that outlives it).
+ *
+ * Returns false if allocation fails. */
+bool upb_msg_set(upb_msg *msg, const upb_fielddef *f, upb_msgval val,
upb_arena *a);
+
/* Clears any field presence and sets the value back to its default. */
void upb_msg_clearfield(upb_msg *msg, const upb_fielddef *f);
@@ -78,17 +114,9 @@ bool upb_msg_next(const upb_msg *msg, const upb_msgdef *m,
const upb_symtab *ext_pool, const upb_fielddef **f,
upb_msgval *val, size_t *iter);
-/* Adds unknown data (serialized protobuf data) to the given message. The data
- * is copied into the message instance. */
-void upb_msg_addunknown(upb_msg *msg, const char *data, size_t len,
- upb_arena *arena);
-
/* Clears all unknown field data from this message and all submessages. */
bool upb_msg_discardunknown(upb_msg *msg, const upb_msgdef *m, int maxdepth);
-/* Returns a reference to the message's unknown data. */
-const char *upb_msg_getunknown(const upb_msg *msg, size_t *len);
-
/** upb_array *****************************************************************/
/* Creates a new array on the given arena that holds elements of this type. */
@@ -163,6 +191,10 @@ upb_msgval upb_mapiter_value(const upb_map *map, size_t iter);
* iterator must not have been initialized const. */
void upb_mapiter_setvalue(upb_map *map, size_t iter, upb_msgval value);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#include "upb/port_undef.inc"
#endif /* UPB_REFLECTION_H_ */
diff --git a/contrib/libs/grpc/third_party/upb/upb/table.c b/contrib/libs/grpc/third_party/upb/upb/table.c
index 88370476599..21e42ac816d 100644
--- a/contrib/libs/grpc/third_party/upb/upb/table.c
+++ b/contrib/libs/grpc/third_party/upb/upb/table.c
@@ -1,13 +1,39 @@
/*
-** upb_table Implementation
-**
-** Implementation is heavily inspired by Lua's ltable.c.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_table Implementation
+ *
+ * Implementation is heavily inspired by Lua's ltable.c.
+ */
#include <string.h>
-#include "third_party/wyhash/wyhash.h"
-#include "upb/table.int.h"
+#include "upb/table_internal.h"
/* Must be last. */
#include "upb/port_def.inc"
@@ -25,9 +51,15 @@ static const double MAX_LOAD = 0.85;
* cache effects). The lower this is, the more memory we'll use. */
static const double MIN_DENSITY = 0.1;
-bool is_pow2(uint64_t v) { return v == 0 || (v & (v - 1)) == 0; }
+static bool is_pow2(uint64_t v) { return v == 0 || (v & (v - 1)) == 0; }
+
+static upb_value _upb_value_val(uint64_t val) {
+ upb_value ret;
+ _upb_value_setval(&ret, val);
+ return ret;
+}
-int log2ceil(uint64_t v) {
+static int log2ceil(uint64_t v) {
int ret = 0;
bool pow2 = is_pow2(v);
while (v >>= 1) ret++;
@@ -35,11 +67,7 @@ int log2ceil(uint64_t v) {
return UPB_MIN(UPB_MAXARRSIZE, ret);
}
-char *upb_strdup(const char *s, upb_alloc *a) {
- return upb_strdup2(s, strlen(s), a);
-}
-
-char *upb_strdup2(const char *s, size_t len, upb_alloc *a) {
+char *upb_strdup2(const char *s, size_t len, upb_arena *a) {
size_t n;
char *p;
@@ -48,7 +76,7 @@ char *upb_strdup2(const char *s, size_t len, upb_alloc *a) {
/* Always null-terminate, even if binary data; but don't rely on the input to
* have a null-terminating byte since it may be a raw binary buffer. */
n = len + 1;
- p = upb_malloc(a, n);
+ p = upb_arena_malloc(a, n);
if (p) {
memcpy(p, s, len);
p[len] = 0;
@@ -83,16 +111,24 @@ typedef bool eqlfunc_t(upb_tabkey k1, lookupkey_t k2);
/* Base table (shared code) ***************************************************/
-/* For when we need to cast away const. */
-static upb_tabent *mutable_entries(upb_table *t) {
- return (upb_tabent*)t->entries;
+static uint32_t upb_inthash(uintptr_t key) {
+ return (uint32_t)key;
+}
+
+static const upb_tabent *upb_getentry(const upb_table *t, uint32_t hash) {
+ return t->entries + (hash & t->mask);
}
+static bool upb_arrhas(upb_tabval key) {
+ return key.val != (uint64_t)-1;
+}
+
+
static bool isfull(upb_table *t) {
return t->count == t->max_count;
}
-static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) {
+static bool init(upb_table *t, uint8_t size_lg2, upb_arena *a) {
size_t bytes;
t->count = 0;
@@ -101,21 +137,17 @@ static bool init(upb_table *t, uint8_t size_lg2, upb_alloc *a) {
t->max_count = upb_table_size(t) * MAX_LOAD;
bytes = upb_table_size(t) * sizeof(upb_tabent);
if (bytes > 0) {
- t->entries = upb_malloc(a, bytes);
+ t->entries = upb_arena_malloc(a, bytes);
if (!t->entries) return false;
- memset(mutable_entries(t), 0, bytes);
+ memset(t->entries, 0, bytes);
} else {
t->entries = NULL;
}
return true;
}
-static void uninit(upb_table *t, upb_alloc *a) {
- upb_free(a, mutable_entries(t));
-}
-
static upb_tabent *emptyent(upb_table *t, upb_tabent *e) {
- upb_tabent *begin = mutable_entries(t);
+ upb_tabent *begin = t->entries;
upb_tabent *end = begin + upb_table_size(t);
for (e = e + 1; e < end; e++) {
if (upb_tabent_isempty(e)) return e;
@@ -265,9 +297,9 @@ static size_t begin(const upb_table *t) {
/* A simple "subclass" of upb_table that only adds a hash function for strings. */
-static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a) {
+static upb_tabkey strcopy(lookupkey_t k2, upb_arena *a) {
uint32_t len = (uint32_t) k2.str.len;
- char *str = upb_malloc(a, k2.str.len + sizeof(uint32_t) + 1);
+ char *str = upb_arena_malloc(a, k2.str.len + sizeof(uint32_t) + 1);
if (str == NULL) return 0;
memcpy(str, &len, sizeof(uint32_t));
if (k2.str.len) memcpy(str + sizeof(uint32_t), k2.str.str, k2.str.len);
@@ -275,8 +307,143 @@ static upb_tabkey strcopy(lookupkey_t k2, upb_alloc *a) {
return (uintptr_t)str;
}
+/* Adapted from ABSL's wyhash. */
+
+static uint64_t UnalignedLoad64(const void *p) {
+ uint64_t val;
+ memcpy(&val, p, 8);
+ return val;
+}
+
+static uint32_t UnalignedLoad32(const void *p) {
+ uint32_t val;
+ memcpy(&val, p, 4);
+ return val;
+}
+
+#if defined(_MSC_VER) && defined(_M_X64)
+#include <intrin.h>
+#endif
+
+/* Computes a * b, returning the low 64 bits of the result and storing the high
+ * 64 bits in |*high|. */
+static uint64_t upb_umul128(uint64_t v0, uint64_t v1, uint64_t* out_high) {
+#ifdef __SIZEOF_INT128__
+ __uint128_t p = v0;
+ p *= v1;
+ *out_high = (uint64_t)(p >> 64);
+ return (uint64_t)p;
+#elif defined(_MSC_VER) && defined(_M_X64)
+ return _umul128(v0, v1, out_high);
+#else
+ uint64_t a32 = v0 >> 32;
+ uint64_t a00 = v0 & 0xffffffff;
+ uint64_t b32 = v1 >> 32;
+ uint64_t b00 = v1 & 0xffffffff;
+ uint64_t high = a32 * b32;
+ uint64_t low = a00 * b00;
+ uint64_t mid1 = a32 * b00;
+ uint64_t mid2 = a00 * b32;
+ low += (mid1 << 32) + (mid2 << 32);
+ // Omit carry bit, for mixing we do not care about exact numerical precision.
+ high += (mid1 >> 32) + (mid2 >> 32);
+ *out_high = high;
+ return low;
+#endif
+}
+
+static uint64_t WyhashMix(uint64_t v0, uint64_t v1) {
+ uint64_t high;
+ uint64_t low = upb_umul128(v0, v1, &high);
+ return low ^ high;
+}
+
+static uint64_t Wyhash(const void *data, size_t len, uint64_t seed,
+ const uint64_t salt[]) {
+ const uint8_t* ptr = (const uint8_t*)data;
+ uint64_t starting_length = (uint64_t)len;
+ uint64_t current_state = seed ^ salt[0];
+
+ if (len > 64) {
+ // If we have more than 64 bytes, we're going to handle chunks of 64
+ // bytes at a time. We're going to build up two separate hash states
+ // which we will then hash together.
+ uint64_t duplicated_state = current_state;
+
+ do {
+ uint64_t a = UnalignedLoad64(ptr);
+ uint64_t b = UnalignedLoad64(ptr + 8);
+ uint64_t c = UnalignedLoad64(ptr + 16);
+ uint64_t d = UnalignedLoad64(ptr + 24);
+ uint64_t e = UnalignedLoad64(ptr + 32);
+ uint64_t f = UnalignedLoad64(ptr + 40);
+ uint64_t g = UnalignedLoad64(ptr + 48);
+ uint64_t h = UnalignedLoad64(ptr + 56);
+
+ uint64_t cs0 = WyhashMix(a ^ salt[1], b ^ current_state);
+ uint64_t cs1 = WyhashMix(c ^ salt[2], d ^ current_state);
+ current_state = (cs0 ^ cs1);
+
+ uint64_t ds0 = WyhashMix(e ^ salt[3], f ^ duplicated_state);
+ uint64_t ds1 = WyhashMix(g ^ salt[4], h ^ duplicated_state);
+ duplicated_state = (ds0 ^ ds1);
+
+ ptr += 64;
+ len -= 64;
+ } while (len > 64);
+
+ current_state = current_state ^ duplicated_state;
+ }
+
+ // We now have a data `ptr` with at most 64 bytes and the current state
+ // of the hashing state machine stored in current_state.
+ while (len > 16) {
+ uint64_t a = UnalignedLoad64(ptr);
+ uint64_t b = UnalignedLoad64(ptr + 8);
+
+ current_state = WyhashMix(a ^ salt[1], b ^ current_state);
+
+ ptr += 16;
+ len -= 16;
+ }
+
+ // We now have a data `ptr` with at most 16 bytes.
+ uint64_t a = 0;
+ uint64_t b = 0;
+ if (len > 8) {
+ // When we have at least 9 and at most 16 bytes, set A to the first 64
+ // bits of the input and B to the last 64 bits of the input. Yes, they will
+ // overlap in the middle if we are working with less than the full 16
+ // bytes.
+ a = UnalignedLoad64(ptr);
+ b = UnalignedLoad64(ptr + len - 8);
+ } else if (len > 3) {
+ // If we have at least 4 and at most 8 bytes, set A to the first 32
+ // bits and B to the last 32 bits.
+ a = UnalignedLoad32(ptr);
+ b = UnalignedLoad32(ptr + len - 4);
+ } else if (len > 0) {
+ // If we have at least 1 and at most 3 bytes, read all of the provided
+ // bits into A, with some adjustments.
+ a = ((ptr[0] << 16) | (ptr[len >> 1] << 8) | ptr[len - 1]);
+ b = 0;
+ } else {
+ a = 0;
+ b = 0;
+ }
+
+ uint64_t w = WyhashMix(a ^ salt[1], b ^ current_state);
+ uint64_t z = salt[1] ^ starting_length;
+ return WyhashMix(w, z);
+}
+
+const uint64_t kWyhashSalt[5] = {
+ 0x243F6A8885A308D3ULL, 0x13198A2E03707344ULL, 0xA4093822299F31D0ULL,
+ 0x082EFA98EC4E6C89ULL, 0x452821E638D01377ULL,
+};
+
static uint32_t table_hash(const char *p, size_t n) {
- return wyhash(p, n, 0, _wyp);
+ return Wyhash(p, n, 0, kWyhashSalt);
}
static uint32_t strhash(upb_tabkey key) {
@@ -291,9 +458,7 @@ static bool streql(upb_tabkey k1, lookupkey_t k2) {
return len == k2.str.len && (len == 0 || memcmp(str, k2.str.str, len) == 0);
}
-bool upb_strtable_init2(upb_strtable *t, upb_ctype_t ctype,
- size_t expected_size, upb_alloc *a) {
- UPB_UNUSED(ctype); /* TODO(haberman): rm */
+bool upb_strtable_init(upb_strtable *t, size_t expected_size, upb_arena *a) {
// Multiply by approximate reciprocal of MAX_LOAD (0.85), with pow2 denominator.
size_t need_entries = (expected_size + 1) * 1204 / 1024;
UPB_ASSERT(need_entries >= expected_size * 0.85);
@@ -307,14 +472,7 @@ void upb_strtable_clear(upb_strtable *t) {
memset((char*)t->t.entries, 0, bytes);
}
-void upb_strtable_uninit2(upb_strtable *t, upb_alloc *a) {
- size_t i;
- for (i = 0; i < upb_table_size(&t->t); i++)
- upb_free(a, (void*)t->t.entries[i].key);
- uninit(&t->t, a);
-}
-
-bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a) {
+bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_arena *a) {
upb_strtable new_table;
upb_strtable_iter i;
@@ -323,17 +481,15 @@ bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a) {
upb_strtable_begin(&i, t);
for ( ; !upb_strtable_done(&i); upb_strtable_next(&i)) {
upb_strview key = upb_strtable_iter_key(&i);
- upb_strtable_insert3(
- &new_table, key.data, key.size,
- upb_strtable_iter_value(&i), a);
+ upb_strtable_insert(&new_table, key.data, key.size,
+ upb_strtable_iter_value(&i), a);
}
- upb_strtable_uninit2(t, a);
*t = new_table;
return true;
}
-bool upb_strtable_insert3(upb_strtable *t, const char *k, size_t len,
- upb_value v, upb_alloc *a) {
+bool upb_strtable_insert(upb_strtable *t, const char *k, size_t len,
+ upb_value v, upb_arena *a) {
lookupkey_t key;
upb_tabkey tabkey;
uint32_t hash;
@@ -360,19 +516,11 @@ bool upb_strtable_lookup2(const upb_strtable *t, const char *key, size_t len,
return lookup(&t->t, strkey2(key, len), v, hash, &streql);
}
-bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len,
- upb_value *val, upb_alloc *alloc) {
+bool upb_strtable_remove(upb_strtable *t, const char *key, size_t len,
+ upb_value *val) {
uint32_t hash = table_hash(key, len);
upb_tabkey tabkey;
- if (rm(&t->t, strkey2(key, len), val, &tabkey, hash, &streql)) {
- if (alloc) {
- /* Arena-based allocs don't need to free and won't pass this. */
- upb_free(alloc, (void*)tabkey);
- }
- return true;
- } else {
- return false;
- }
+ return rm(&t->t, strkey2(key, len), val, &tabkey, hash, &streql);
}
/* Iteration */
@@ -470,7 +618,7 @@ static void check(upb_inttable *t) {
}
bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
- upb_alloc *a) {
+ upb_arena *a) {
size_t array_bytes;
if (!init(&t->t, hsize_lg2, a)) return false;
@@ -479,9 +627,8 @@ bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
t->array_size = UPB_MAX(1, asize);
t->array_count = 0;
array_bytes = t->array_size * sizeof(upb_value);
- t->array = upb_malloc(a, array_bytes);
+ t->array = upb_arena_malloc(a, array_bytes);
if (!t->array) {
- uninit(&t->t, a);
return false;
}
memset(mutable_array(t), 0xff, array_bytes);
@@ -489,18 +636,12 @@ bool upb_inttable_sizedinit(upb_inttable *t, size_t asize, int hsize_lg2,
return true;
}
-bool upb_inttable_init2(upb_inttable *t, upb_ctype_t ctype, upb_alloc *a) {
- UPB_UNUSED(ctype); /* TODO(haberman): rm */
+bool upb_inttable_init(upb_inttable *t, upb_arena *a) {
return upb_inttable_sizedinit(t, 0, 4, a);
}
-void upb_inttable_uninit2(upb_inttable *t, upb_alloc *a) {
- uninit(&t->t, a);
- upb_free(a, mutable_array(t));
-}
-
-bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
- upb_alloc *a) {
+bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val,
+ upb_arena *a) {
upb_tabval tabval;
tabval.val = val.val;
UPB_ASSERT(upb_arrhas(tabval)); /* This will reject (uint64_t)-1. Fix this. */
@@ -531,7 +672,6 @@ bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
UPB_ASSERT(t->t.count == new_table.count);
- uninit(&t->t, a);
t->t = new_table;
}
insert(&t->t, intkey(key), key, val, upb_inthash(key), &inthash, &inteql);
@@ -575,21 +715,7 @@ bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val) {
return success;
}
-bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
- upb_alloc *a) {
- return upb_inttable_insert2(t, (uintptr_t)key, val, a);
-}
-
-bool upb_inttable_lookupptr(const upb_inttable *t, const void *key,
- upb_value *v) {
- return upb_inttable_lookup(t, (uintptr_t)key, v);
-}
-
-bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val) {
- return upb_inttable_remove(t, (uintptr_t)key, val);
-}
-
-void upb_inttable_compact2(upb_inttable *t, upb_alloc *a) {
+void upb_inttable_compact(upb_inttable *t, upb_arena *a) {
/* A power-of-two histogram of the table keys. */
size_t counts[UPB_MAXARRSIZE + 1] = {0};
@@ -637,12 +763,11 @@ void upb_inttable_compact2(upb_inttable *t, upb_alloc *a) {
upb_inttable_begin(&i, t);
for (; !upb_inttable_done(&i); upb_inttable_next(&i)) {
uintptr_t k = upb_inttable_iter_key(&i);
- upb_inttable_insert2(&new_t, k, upb_inttable_iter_value(&i), a);
+ upb_inttable_insert(&new_t, k, upb_inttable_iter_value(&i), a);
}
UPB_ASSERT(new_t.array_size == arr_size);
UPB_ASSERT(new_t.t.size_lg2 == hashsize_lg2);
}
- upb_inttable_uninit2(t, a);
*t = new_t;
}
diff --git a/contrib/libs/grpc/third_party/upb/upb/table.int.h b/contrib/libs/grpc/third_party/upb/upb/table_internal.h
index 49caac463ee..13136868484 100644
--- a/contrib/libs/grpc/third_party/upb/upb/table.int.h
+++ b/contrib/libs/grpc/third_party/upb/upb/table_internal.h
@@ -1,21 +1,48 @@
/*
-** upb_table
-**
-** This header is INTERNAL-ONLY! Its interfaces are not public or stable!
-** This file defines very fast int->upb_value (inttable) and string->upb_value
-** (strtable) hash tables.
-**
-** The table uses chained scatter with Brent's variation (inspired by the Lua
-** implementation of hash tables). The hash function for strings is Austin
-** Appleby's "MurmurHash."
-**
-** The inttable uses uintptr_t as its key, which guarantees it can be used to
-** store pointers or integers of at least 32 bits (upb isn't really useful on
-** systems where sizeof(void*) < 4).
-**
-** The table must be homogeneous (all values of the same type). In debug
-** mode, we check this on insert and lookup.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * upb_table
+ *
+ * This header is INTERNAL-ONLY! Its interfaces are not public or stable!
+ * This file defines very fast int->upb_value (inttable) and string->upb_value
+ * (strtable) hash tables.
+ *
+ * The table uses chained scatter with Brent's variation (inspired by the Lua
+ * implementation of hash tables). The hash function for strings is Austin
+ * Appleby's "MurmurHash."
+ *
+ * The inttable uses uintptr_t as its key, which guarantees it can be used to
+ * store pointers or integers of at least 32 bits (upb isn't really useful on
+ * systems where sizeof(void*) < 4).
+ *
+ * The table must be homogeneous (all values of the same type). In debug
+ * mode, we check this on insert and lookup.
+ */
#ifndef UPB_TABLE_H_
#define UPB_TABLE_H_
@@ -33,47 +60,18 @@ extern "C" {
/* upb_value ******************************************************************/
-/* A tagged union (stored untagged inside the table) so that we can check that
- * clients calling table accessors are correctly typed without having to have
- * an explosion of accessors. */
-typedef enum {
- UPB_CTYPE_INT32 = 1,
- UPB_CTYPE_INT64 = 2,
- UPB_CTYPE_UINT32 = 3,
- UPB_CTYPE_UINT64 = 4,
- UPB_CTYPE_BOOL = 5,
- UPB_CTYPE_CSTR = 6,
- UPB_CTYPE_PTR = 7,
- UPB_CTYPE_CONSTPTR = 8,
- UPB_CTYPE_FPTR = 9,
- UPB_CTYPE_FLOAT = 10,
- UPB_CTYPE_DOUBLE = 11
-} upb_ctype_t;
-
typedef struct {
uint64_t val;
} upb_value;
-/* Like strdup(), which isn't always available since it's not ANSI C. */
-char *upb_strdup(const char *s, upb_alloc *a);
/* Variant that works with a length-delimited rather than NULL-delimited string,
* as supported by strtable. */
-char *upb_strdup2(const char *s, size_t len, upb_alloc *a);
-
-UPB_INLINE char *upb_gstrdup(const char *s) {
- return upb_strdup(s, &upb_alloc_global);
-}
+char *upb_strdup2(const char *s, size_t len, upb_arena *a);
UPB_INLINE void _upb_value_setval(upb_value *v, uint64_t val) {
v->val = val;
}
-UPB_INLINE upb_value _upb_value_val(uint64_t val) {
- upb_value ret;
- _upb_value_setval(&ret, val);
- return ret;
-}
-
/* For each value ctype, define the following set of functions:
*
* // Get/set an int32 from a upb_value.
@@ -181,14 +179,7 @@ typedef struct {
uint32_t mask; /* Mask to turn hash value -> bucket. */
uint32_t max_count; /* Max count before we hit our load limit. */
uint8_t size_lg2; /* Size of the hashtable part is 2^size_lg2 entries. */
-
- /* Hash table entries.
- * Making this const isn't entirely accurate; what we really want is for it to
- * have the same const-ness as the table it's inside. But there's no way to
- * declare that in C. So we have to make it const so that we can statically
- * initialize const hash tables. Then we cast away const when we have to.
- */
- const upb_tabent *entries;
+ upb_tabent *entries;
} upb_table;
typedef struct {
@@ -202,8 +193,6 @@ typedef struct {
size_t array_count; /* Array part number of elements. */
} upb_inttable;
-#define UPB_ARRAY_EMPTYENT -1
-
UPB_INLINE size_t upb_table_size(const upb_table *t) {
if (t->size_lg2 == 0)
return 0;
@@ -216,48 +205,10 @@ UPB_INLINE bool upb_tabent_isempty(const upb_tabent *e) {
return e->key == 0;
}
-/* Used by some of the unit tests for generic hashing functionality. */
-uint32_t upb_murmur_hash2(const void * key, size_t len, uint32_t seed);
-
-UPB_INLINE uintptr_t upb_intkey(uintptr_t key) {
- return key;
-}
-
-UPB_INLINE uint32_t upb_inthash(uintptr_t key) {
- return (uint32_t)key;
-}
-
-static const upb_tabent *upb_getentry(const upb_table *t, uint32_t hash) {
- return t->entries + (hash & t->mask);
-}
-
-UPB_INLINE bool upb_arrhas(upb_tabval key) {
- return key.val != (uint64_t)-1;
-}
-
/* Initialize and uninitialize a table, respectively. If memory allocation
* failed, false is returned that the table is uninitialized. */
-bool upb_inttable_init2(upb_inttable *table, upb_ctype_t ctype, upb_alloc *a);
-bool upb_strtable_init2(upb_strtable *table, upb_ctype_t ctype,
- size_t expected_size, upb_alloc *a);
-void upb_inttable_uninit2(upb_inttable *table, upb_alloc *a);
-void upb_strtable_uninit2(upb_strtable *table, upb_alloc *a);
-
-UPB_INLINE bool upb_inttable_init(upb_inttable *table, upb_ctype_t ctype) {
- return upb_inttable_init2(table, ctype, &upb_alloc_global);
-}
-
-UPB_INLINE bool upb_strtable_init(upb_strtable *table, upb_ctype_t ctype) {
- return upb_strtable_init2(table, ctype, 4, &upb_alloc_global);
-}
-
-UPB_INLINE void upb_inttable_uninit(upb_inttable *table) {
- upb_inttable_uninit2(table, &upb_alloc_global);
-}
-
-UPB_INLINE void upb_strtable_uninit(upb_strtable *table) {
- upb_strtable_uninit2(table, &upb_alloc_global);
-}
+bool upb_inttable_init(upb_inttable *table, upb_arena *a);
+bool upb_strtable_init(upb_strtable *table, size_t expected_size, upb_arena *a);
/* Returns the number of values in the table. */
size_t upb_inttable_count(const upb_inttable *t);
@@ -265,12 +216,6 @@ UPB_INLINE size_t upb_strtable_count(const upb_strtable *t) {
return t->t.count;
}
-void upb_inttable_packedsize(const upb_inttable *t, size_t *size);
-void upb_strtable_packedsize(const upb_strtable *t, size_t *size);
-upb_inttable *upb_inttable_pack(const upb_inttable *t, void *p, size_t *ofs,
- size_t size);
-upb_strtable *upb_strtable_pack(const upb_strtable *t, void *p, size_t *ofs,
- size_t size);
void upb_strtable_clear(upb_strtable *t);
/* Inserts the given key into the hashtable with the given value. The key must
@@ -280,26 +225,10 @@ void upb_strtable_clear(upb_strtable *t);
*
* If a table resize was required but memory allocation failed, false is
* returned and the table is unchanged. */
-bool upb_inttable_insert2(upb_inttable *t, uintptr_t key, upb_value val,
- upb_alloc *a);
-bool upb_strtable_insert3(upb_strtable *t, const char *key, size_t len,
- upb_value val, upb_alloc *a);
-
-UPB_INLINE bool upb_inttable_insert(upb_inttable *t, uintptr_t key,
- upb_value val) {
- return upb_inttable_insert2(t, key, val, &upb_alloc_global);
-}
-
-UPB_INLINE bool upb_strtable_insert2(upb_strtable *t, const char *key,
- size_t len, upb_value val) {
- return upb_strtable_insert3(t, key, len, val, &upb_alloc_global);
-}
-
-/* For NULL-terminated strings. */
-UPB_INLINE bool upb_strtable_insert(upb_strtable *t, const char *key,
- upb_value val) {
- return upb_strtable_insert2(t, key, strlen(key), val);
-}
+bool upb_inttable_insert(upb_inttable *t, uintptr_t key, upb_value val,
+ upb_arena *a);
+bool upb_strtable_insert(upb_strtable *t, const char *key, size_t len,
+ upb_value val, upb_arena *a);
/* Looks up key in this table, returning "true" if the key was found.
* If v is non-NULL, copies the value for this key into *v. */
@@ -316,74 +245,21 @@ UPB_INLINE bool upb_strtable_lookup(const upb_strtable *t, const char *key,
/* Removes an item from the table. Returns true if the remove was successful,
* and stores the removed item in *val if non-NULL. */
bool upb_inttable_remove(upb_inttable *t, uintptr_t key, upb_value *val);
-bool upb_strtable_remove3(upb_strtable *t, const char *key, size_t len,
- upb_value *val, upb_alloc *alloc);
-
-UPB_INLINE bool upb_strtable_remove2(upb_strtable *t, const char *key,
- size_t len, upb_value *val) {
- return upb_strtable_remove3(t, key, len, val, &upb_alloc_global);
-}
-
-/* For NULL-terminated strings. */
-UPB_INLINE bool upb_strtable_remove(upb_strtable *t, const char *key,
- upb_value *v) {
- return upb_strtable_remove2(t, key, strlen(key), v);
-}
+bool upb_strtable_remove(upb_strtable *t, const char *key, size_t len,
+ upb_value *val);
/* Updates an existing entry in an inttable. If the entry does not exist,
* returns false and does nothing. Unlike insert/remove, this does not
* invalidate iterators. */
bool upb_inttable_replace(upb_inttable *t, uintptr_t key, upb_value val);
-/* Convenience routines for inttables with pointer keys. */
-bool upb_inttable_insertptr2(upb_inttable *t, const void *key, upb_value val,
- upb_alloc *a);
-bool upb_inttable_removeptr(upb_inttable *t, const void *key, upb_value *val);
-bool upb_inttable_lookupptr(
- const upb_inttable *t, const void *key, upb_value *val);
-
-UPB_INLINE bool upb_inttable_insertptr(upb_inttable *t, const void *key,
- upb_value val) {
- return upb_inttable_insertptr2(t, key, val, &upb_alloc_global);
-}
-
/* Optimizes the table for the current set of entries, for both memory use and
* lookup time. Client should call this after all entries have been inserted;
* inserting more entries is legal, but will likely require a table resize. */
-void upb_inttable_compact2(upb_inttable *t, upb_alloc *a);
-
-UPB_INLINE void upb_inttable_compact(upb_inttable *t) {
- upb_inttable_compact2(t, &upb_alloc_global);
-}
-
-/* A special-case inlinable version of the lookup routine for 32-bit
- * integers. */
-UPB_INLINE bool upb_inttable_lookup32(const upb_inttable *t, uint32_t key,
- upb_value *v) {
- *v = upb_value_int32(0); /* Silence compiler warnings. */
- if (key < t->array_size) {
- upb_tabval arrval = t->array[key];
- if (upb_arrhas(arrval)) {
- _upb_value_setval(v, arrval.val);
- return true;
- } else {
- return false;
- }
- } else {
- const upb_tabent *e;
- if (t->t.entries == NULL) return false;
- for (e = upb_getentry(&t->t, upb_inthash(key)); true; e = e->next) {
- if ((uint32_t)e->key == key) {
- _upb_value_setval(v, e->val.val);
- return true;
- }
- if (e->next == NULL) return false;
- }
- }
-}
+void upb_inttable_compact(upb_inttable *t, upb_arena *a);
/* Exposed for testing only. */
-bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_alloc *a);
+bool upb_strtable_resize(upb_strtable *t, size_t size_lg2, upb_arena *a);
/* Iterators ******************************************************************/
diff --git a/contrib/libs/grpc/third_party/upb/upb/text_encode.c b/contrib/libs/grpc/third_party/upb/upb/text_encode.c
index 028cc29e090..12840c0fae5 100644
--- a/contrib/libs/grpc/third_party/upb/upb/text_encode.c
+++ b/contrib/libs/grpc/third_party/upb/upb/text_encode.c
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "upb/text_encode.h"
@@ -28,8 +54,10 @@ static void txtenc_putbytes(txtenc *e, const void *data, size_t len) {
memcpy(e->ptr, data, len);
e->ptr += len;
} else {
- if (have) memcpy(e->ptr, data, have);
- e->ptr += have;
+ if (have) {
+ memcpy(e->ptr, data, have);
+ e->ptr += have;
+ }
e->overflow += (len - have);
}
}
@@ -50,7 +78,7 @@ static void txtenc_printf(txtenc *e, const char *fmt, ...) {
if (UPB_LIKELY(have > n)) {
e->ptr += n;
} else {
- e->ptr += have;
+ e->ptr = UPB_PTRADD(e->ptr, have);
e->overflow += (n - have);
}
}
@@ -74,10 +102,10 @@ static void txtenc_endfield(txtenc *e) {
static void txtenc_enum(int32_t val, const upb_fielddef *f, txtenc *e) {
const upb_enumdef *e_def = upb_fielddef_enumsubdef(f);
- const char *name = upb_enumdef_iton(e_def, val);
+ const upb_enumvaldef *ev = upb_enumdef_lookupnum(e_def, val);
- if (name) {
- txtenc_printf(e, "%s", name);
+ if (ev) {
+ txtenc_printf(e, "%s", upb_enumvaldef_name(ev));
} else {
txtenc_printf(e, "%" PRId32, val);
}
@@ -408,7 +436,7 @@ size_t upb_text_encode(const upb_msg *msg, const upb_msgdef *m,
e.buf = buf;
e.ptr = buf;
- e.end = buf + size;
+ e.end = UPB_PTRADD(buf, size);
e.overflow = 0;
e.indent_depth = 0;
e.options = options;
diff --git a/contrib/libs/grpc/third_party/upb/upb/text_encode.h b/contrib/libs/grpc/third_party/upb/upb/text_encode.h
index 4ad3d1c4d74..9456082a381 100644
--- a/contrib/libs/grpc/third_party/upb/upb/text_encode.h
+++ b/contrib/libs/grpc/third_party/upb/upb/text_encode.h
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#ifndef UPB_TEXTENCODE_H_
#define UPB_TEXTENCODE_H_
diff --git a/contrib/libs/grpc/third_party/upb/upb/upb.c b/contrib/libs/grpc/third_party/upb/upb/upb.c
index a12656973d6..48621b9f6ea 100644
--- a/contrib/libs/grpc/third_party/upb/upb/upb.c
+++ b/contrib/libs/grpc/third_party/upb/upb/upb.c
@@ -1,5 +1,31 @@
-
-#include "upb/upb.int.h"
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "upb/upb_internal.h"
#include <errno.h>
#include <stdarg.h>
@@ -67,6 +93,19 @@ static void *upb_global_allocfunc(upb_alloc *alloc, void *ptr, size_t oldsize,
}
}
+static uint32_t *upb_cleanup_pointer(uintptr_t cleanup_metadata) {
+ return (uint32_t *)(cleanup_metadata & ~0x1);
+}
+
+static bool upb_cleanup_has_initial_block(uintptr_t cleanup_metadata) {
+ return cleanup_metadata & 0x1;
+}
+
+static uintptr_t upb_cleanup_metadata(uint32_t *cleanup,
+ bool has_initial_block) {
+ return (uintptr_t)cleanup | has_initial_block;
+}
+
upb_alloc upb_alloc_global = {&upb_global_allocfunc};
/* upb_arena ******************************************************************/
@@ -112,7 +151,8 @@ static void upb_arena_addblock(upb_arena *a, upb_arena *root, void *ptr,
a->head.ptr = UPB_PTR_AT(block, memblock_reserve, char);
a->head.end = UPB_PTR_AT(block, size, char);
- a->cleanups = &block->cleanups;
+ a->cleanup_metadata = upb_cleanup_metadata(
+ &block->cleanups, upb_cleanup_has_initial_block(a->cleanup_metadata));
UPB_POISON_MEMORY_REGION(a->head.ptr, a->head.end - a->head.ptr);
}
@@ -160,6 +200,7 @@ upb_arena *arena_initslow(void *mem, size_t n, upb_alloc *alloc) {
a->refcount = 1;
a->freelist = NULL;
a->freelist_tail = NULL;
+ a->cleanup_metadata = upb_cleanup_metadata(NULL, false);
upb_arena_addblock(a, a, mem, n);
@@ -169,6 +210,14 @@ upb_arena *arena_initslow(void *mem, size_t n, upb_alloc *alloc) {
upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc) {
upb_arena *a;
+ if (n) {
+ /* Align initial pointer up so that we return properly-aligned pointers. */
+ void *aligned = (void*)UPB_ALIGN_UP((uintptr_t)mem, 16);
+ size_t delta = (uintptr_t)aligned - (uintptr_t)mem;
+ n = delta <= n ? n - delta : 0;
+ mem = aligned;
+ }
+
/* Round block size down to alignof(*a) since we will allocate the arena
* itself at the end. */
n = UPB_ALIGN_DOWN(n, UPB_ALIGN_OF(upb_arena));
@@ -187,7 +236,7 @@ upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc) {
a->head.ptr = mem;
a->head.end = UPB_PTR_AT(mem, n - sizeof(*a), char);
a->freelist = NULL;
- a->cleanups = NULL;
+ a->cleanup_metadata = upb_cleanup_metadata(NULL, true);
return a;
}
@@ -222,15 +271,17 @@ void upb_arena_free(upb_arena *a) {
bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) {
cleanup_ent *ent;
+ uint32_t* cleanups = upb_cleanup_pointer(a->cleanup_metadata);
- if (!a->cleanups || _upb_arenahas(a) < sizeof(cleanup_ent)) {
+ if (!cleanups || _upb_arenahas(a) < sizeof(cleanup_ent)) {
if (!upb_arena_allocblock(a, 128)) return false; /* Out of memory. */
UPB_ASSERT(_upb_arenahas(a) >= sizeof(cleanup_ent));
+ cleanups = upb_cleanup_pointer(a->cleanup_metadata);
}
a->head.end -= sizeof(cleanup_ent);
ent = (cleanup_ent*)a->head.end;
- (*a->cleanups)++;
+ (*cleanups)++;
UPB_UNPOISON_MEMORY_REGION(ent, sizeof(cleanup_ent));
ent->cleanup = func;
@@ -239,11 +290,18 @@ bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func) {
return true;
}
-void upb_arena_fuse(upb_arena *a1, upb_arena *a2) {
+bool upb_arena_fuse(upb_arena *a1, upb_arena *a2) {
upb_arena *r1 = arena_findroot(a1);
upb_arena *r2 = arena_findroot(a2);
- if (r1 == r2) return; /* Already fused. */
+ if (r1 == r2) return true; /* Already fused. */
+
+ /* Do not fuse initial blocks since we cannot lifetime extend them. */
+ if (upb_cleanup_has_initial_block(r1->cleanup_metadata)) return false;
+ if (upb_cleanup_has_initial_block(r2->cleanup_metadata)) return false;
+
+ /* Only allow fuse with a common allocator */
+ if (r1->block_alloc != r2->block_alloc) return false;
/* We want to join the smaller tree to the larger tree.
* So swap first if they are backwards. */
@@ -261,4 +319,5 @@ void upb_arena_fuse(upb_arena *a1, upb_arena *a2) {
r1->freelist = r2->freelist;
}
r2->parent = r1;
+ return true;
}
diff --git a/contrib/libs/grpc/third_party/upb/upb/upb.h b/contrib/libs/grpc/third_party/upb/upb/upb.h
index 11c0e4dc99a..bc0edf9dc10 100644
--- a/contrib/libs/grpc/third_party/upb/upb/upb.h
+++ b/contrib/libs/grpc/third_party/upb/upb/upb.h
@@ -1,6 +1,33 @@
/*
-** This file contains shared definitions that are widely used across upb.
-*/
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This file contains shared definitions that are widely used across upb.
+ */
#ifndef UPB_H_
#define UPB_H_
@@ -33,9 +60,12 @@ bool upb_ok(const upb_status *status);
/* These are no-op if |status| is NULL. */
void upb_status_clear(upb_status *status);
void upb_status_seterrmsg(upb_status *status, const char *msg);
-void upb_status_seterrf(upb_status *status, const char *fmt, ...);
-void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args);
-void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args);
+void upb_status_seterrf(upb_status *status, const char *fmt, ...)
+ UPB_PRINTF(2, 3);
+void upb_status_vseterrf(upb_status *status, const char *fmt, va_list args)
+ UPB_PRINTF(2, 0);
+void upb_status_vappenderrf(upb_status *status, const char *fmt, va_list args)
+ UPB_PRINTF(2, 0);
/** upb_strview ************************************************************/
@@ -156,7 +186,7 @@ typedef struct {
upb_arena *upb_arena_init(void *mem, size_t n, upb_alloc *alloc);
void upb_arena_free(upb_arena *a);
bool upb_arena_addcleanup(upb_arena *a, void *ud, upb_cleanup_func *func);
-void upb_arena_fuse(upb_arena *a, upb_arena *b);
+bool upb_arena_fuse(upb_arena *a, upb_arena *b);
void *_upb_arena_slowmalloc(upb_arena *a, size_t size);
UPB_INLINE upb_alloc *upb_arena_alloc(upb_arena *a) { return (upb_alloc*)a; }
diff --git a/contrib/libs/grpc/third_party/upb/upb/upb.hpp b/contrib/libs/grpc/third_party/upb/upb/upb.hpp
index b7b99761fb2..361053745ac 100644
--- a/contrib/libs/grpc/third_party/upb/upb/upb.hpp
+++ b/contrib/libs/grpc/third_party/upb/upb/upb.hpp
@@ -1,3 +1,27 @@
+// Copyright (c) 2009-2021, Google LLC
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Google LLC nor the
+// names of its contributors may be used to endorse or promote products
+// derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef UPB_HPP_
#define UPB_HPP_
diff --git a/contrib/libs/grpc/third_party/upb/upb/upb.int.h b/contrib/libs/grpc/third_party/upb/upb/upb.int.h
deleted file mode 100644
index b857560e4e8..00000000000
--- a/contrib/libs/grpc/third_party/upb/upb/upb.int.h
+++ /dev/null
@@ -1,29 +0,0 @@
-
-#ifndef UPB_INT_H_
-#define UPB_INT_H_
-
-#include "upb/upb.h"
-
-struct mem_block;
-typedef struct mem_block mem_block;
-
-struct upb_arena {
- _upb_arena_head head;
- uint32_t *cleanups;
-
- /* Allocator to allocate arena blocks. We are responsible for freeing these
- * when we are destroyed. */
- upb_alloc *block_alloc;
- uint32_t last_size;
-
- /* When multiple arenas are fused together, each arena points to a parent
- * arena (root points to itself). The root tracks how many live arenas
- * reference it. */
- uint32_t refcount; /* Only used when a->parent == a */
- struct upb_arena *parent;
-
- /* Linked list of blocks to free/cleanup. */
- mem_block *freelist, *freelist_tail;
-};
-
-#endif /* UPB_INT_H_ */
diff --git a/contrib/libs/grpc/third_party/upb/upb/upb_internal.h b/contrib/libs/grpc/third_party/upb/upb/upb_internal.h
new file mode 100644
index 00000000000..ae50678b5fa
--- /dev/null
+++ b/contrib/libs/grpc/third_party/upb/upb/upb_internal.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009-2021, Google LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Google LLC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef UPB_INT_H_
+#define UPB_INT_H_
+
+#include "upb/upb.h"
+
+struct mem_block;
+typedef struct mem_block mem_block;
+
+struct upb_arena {
+ _upb_arena_head head;
+ /* Stores cleanup metadata for this arena.
+ * - a pointer to the current cleanup counter.
+ * - a boolean indicating if there is an unowned initial block. */
+ uintptr_t cleanup_metadata;
+
+ /* Allocator to allocate arena blocks. We are responsible for freeing these
+ * when we are destroyed. */
+ upb_alloc *block_alloc;
+ uint32_t last_size;
+
+ /* When multiple arenas are fused together, each arena points to a parent
+ * arena (root points to itself). The root tracks how many live arenas
+ * reference it. */
+ uint32_t refcount; /* Only used when a->parent == a */
+ struct upb_arena *parent;
+
+ /* Linked list of blocks to free/cleanup. */
+ mem_block *freelist, *freelist_tail;
+};
+
+#endif /* UPB_INT_H_ */
diff --git a/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.cc b/contrib/libs/grpc/tools/codegen/core/.yandex_meta/licenses.list.txt
index 2e5b306909b..c982a91eb12 100644
--- a/contrib/libs/grpc/src/core/lib/gpr/tls_pthread.cc
+++ b/contrib/libs/grpc/tools/codegen/core/.yandex_meta/licenses.list.txt
@@ -1,7 +1,4 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
+====================Apache-2.0====================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -13,18 +10,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
- */
-#include <grpc/support/port_platform.h>
-#ifdef GPR_PTHREAD_TLS
-
-#include "src/core/lib/gpr/tls.h"
-
-intptr_t gpr_tls_set(struct gpr_pthread_thread_local* tls, intptr_t value) {
- GPR_ASSERT(0 == pthread_setspecific(tls->key, (void*)value));
- return value;
-}
-
-#endif /* GPR_PTHREAD_TLS */
+====================COPYRIGHT====================
+ * Copyright 2015 gRPC authors.
diff --git a/contrib/libs/grpc/tools/codegen/core/gen_hpack_tables.cc b/contrib/libs/grpc/tools/codegen/core/gen_hpack_tables.cc
index 0e7a7b80d80..d01a90eb78f 100644
--- a/contrib/libs/grpc/tools/codegen/core/gen_hpack_tables.cc
+++ b/contrib/libs/grpc/tools/codegen/core/gen_hpack_tables.cc
@@ -27,92 +27,6 @@
#include "src/core/ext/transport/chttp2/transport/huffsyms.h"
/*
- * first byte LUT generation
- */
-
-typedef struct {
- const char *call;
- /* bit prefix for the field type */
- unsigned char prefix;
- /* length of the bit prefix for the field type */
- unsigned char prefix_length;
- /* index value: 0 = all zeros, 2 = all ones, 1 otherwise */
- unsigned char index;
-} spec;
-
-static const spec fields[] = {
- {"INDEXED_FIELD", 0X80, 1, 1}, {"INDEXED_FIELD_X", 0X80, 1, 2},
- {"LITHDR_INCIDX", 0X40, 2, 1}, {"LITHDR_INCIDX_X", 0X40, 2, 2},
- {"LITHDR_INCIDX_V", 0X40, 2, 0}, {"LITHDR_NOTIDX", 0X00, 4, 1},
- {"LITHDR_NOTIDX_X", 0X00, 4, 2}, {"LITHDR_NOTIDX_V", 0X00, 4, 0},
- {"LITHDR_NVRIDX", 0X10, 4, 1}, {"LITHDR_NVRIDX_X", 0X10, 4, 2},
- {"LITHDR_NVRIDX_V", 0X10, 4, 0}, {"MAX_TBL_SIZE", 0X20, 3, 1},
- {"MAX_TBL_SIZE_X", 0X20, 3, 2},
-};
-
-static const int num_fields = sizeof(fields) / sizeof(*fields);
-
-static unsigned char prefix_mask(unsigned char prefix_len) {
- unsigned char i;
- unsigned char out = 0;
- for (i = 0; i < prefix_len; i++) {
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- out = (unsigned char)(out | (unsigned char)(1 << (7 - i)));
- }
- return out;
-}
-
-static unsigned char suffix_mask(unsigned char prefix_len) {
- return (unsigned char)~prefix_mask(prefix_len);
-}
-
-static void generate_first_byte_lut(void) {
- int i, j, n;
- const spec *chrspec;
- unsigned char suffix;
-
- n = printf("static CALLTYPE first_byte[256] = {");
- /* for each potential first byte of a header */
- for (i = 0; i < 256; i++) {
- /* find the field type that matches it */
- chrspec = NULL;
- for (j = 0; j < num_fields; j++) {
- if ((prefix_mask(fields[j].prefix_length) & i) == fields[j].prefix) {
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container
- * type is then required to avoid the compiler warning */
- suffix = (unsigned char)(suffix_mask(fields[j].prefix_length) &
- (unsigned char)i);
- if (suffix == suffix_mask(fields[j].prefix_length)) {
- if (fields[j].index != 2) continue;
- } else if (suffix == 0) {
- if (fields[j].index != 0) continue;
- } else {
- if (fields[j].index != 1) continue;
- }
- GPR_ASSERT(chrspec == NULL);
- chrspec = &fields[j];
- }
- }
- if (chrspec) {
- n += printf("%s, ", chrspec->call);
- } else {
- n += printf("ILLEGAL, ");
- }
- /* make some small effort towards readable output */
- if (n > 70) {
- printf("\n ");
- n = 2;
- }
- }
- printf("};\n");
-}
-
-/*
* Huffman decoder table generation
*/
@@ -325,29 +239,9 @@ static void generate_base64_huff_encoder_table(void) {
printf("};\n");
}
-static void generate_base64_inverse_table(void) {
- static const char alphabet[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- unsigned char inverse[256];
- unsigned i;
-
- memset(inverse, 255, sizeof(inverse));
- for (i = 0; i < strlen(alphabet); i++) {
- inverse[(unsigned char)alphabet[i]] = (unsigned char)i;
- }
-
- printf("static const gpr_uint8 inverse_base64[256] = {");
- for (i = 0; i < 256; i++) {
- printf("%d,", inverse[i]);
- }
- printf("};\n");
-}
-
int main(void) {
generate_huff_tables();
- generate_first_byte_lut();
generate_base64_huff_encoder_table();
- generate_base64_inverse_table();
return 0;
}
diff --git a/contrib/libs/grpc/tools/codegen/core/gen_legal_metadata_characters.cc b/contrib/libs/grpc/tools/codegen/core/gen_legal_metadata_characters.cc
deleted file mode 100644
index fbabd2464f6..00000000000
--- a/contrib/libs/grpc/tools/codegen/core/gen_legal_metadata_characters.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* generates constant table for metadata.cc */
-
-#include <stdio.h>
-#include <string.h>
-
-static unsigned char legal_bits[256 / 8];
-
-static void legal(int x) {
- int byte = x / 8;
- int bit = x % 8;
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- legal_bits[byte] =
- (unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
-}
-
-static void dump(void) {
- int i;
-
- printf("static const uint8_t legal_header_bits[256/8] = ");
- for (i = 0; i < 256 / 8; i++)
- printf("%c 0x%02x", i ? ',' : '{', legal_bits[i]);
- printf(" };\n");
-}
-
-static void clear(void) { memset(legal_bits, 0, sizeof(legal_bits)); }
-
-int main(void) {
- int i;
-
- clear();
- for (i = 'a'; i <= 'z'; i++) legal(i);
- for (i = '0'; i <= '9'; i++) legal(i);
- legal('-');
- legal('_');
- legal('.');
- dump();
-
- clear();
- for (i = 32; i <= 126; i++) {
- legal(i);
- }
- dump();
-
- return 0;
-}
diff --git a/contrib/libs/grpc/tools/codegen/core/gen_percent_encoding_tables.cc b/contrib/libs/grpc/tools/codegen/core/gen_percent_encoding_tables.cc
deleted file mode 100644
index a99024e5ed3..00000000000
--- a/contrib/libs/grpc/tools/codegen/core/gen_percent_encoding_tables.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright 2015 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-/* generates constant table for metadata.cc */
-
-#include <stdio.h>
-#include <string.h>
-
-static unsigned char legal_bits[256 / 8];
-
-static void legal(int x) {
- int byte = x / 8;
- int bit = x % 8;
- /* NB: the following integer arithmetic operation needs to be in its
- * expanded form due to the "integral promotion" performed (see section
- * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
- * is then required to avoid the compiler warning */
- legal_bits[byte] =
- (unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
-}
-
-static void dump(const char *name) {
- int i;
-
- printf("const uint8_t %s[256/8] = ", name);
- for (i = 0; i < 256 / 8; i++)
- printf("%c 0x%02x", i ? ',' : '{', legal_bits[i]);
- printf(" };\n");
-}
-
-static void clear(void) { memset(legal_bits, 0, sizeof(legal_bits)); }
-
-int main(void) {
- int i;
-
- clear();
- for (i = 'a'; i <= 'z'; i++) legal(i);
- for (i = 'A'; i <= 'Z'; i++) legal(i);
- for (i = '0'; i <= '9'; i++) legal(i);
- legal('-');
- legal('_');
- legal('.');
- legal('~');
- dump("grpc_url_percent_encoding_unreserved_bytes");
-
- clear();
- for (i = 32; i <= 126; i++) {
- if (i == '%') continue;
- legal(i);
- }
- dump("grpc_compatible_percent_encoding_unreserved_bytes");
-
- return 0;
-}
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt
new file mode 100644
index 00000000000..7370f8085b2
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/absl_hashtablez_sampler/CMakeLists.txt
@@ -0,0 +1,43 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(ycontainer-internal-absl_hashtablez_sampler)
+target_include_directories(ycontainer-internal-absl_hashtablez_sampler PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring
+)
+target_include_directories(ycontainer-internal-absl_hashtablez_sampler PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring
+)
+target_link_libraries(ycontainer-internal-absl_hashtablez_sampler PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ yabseil-cpp-tstring-y_absl-base
+ ybase-internal-low_level_alloc
+ ybase-internal-raw_logging
+ ybase-internal-spinlock_wait
+ ybase-internal-throw_delegate
+ yabsl-base-log_severity
+ yabseil-cpp-tstring-y_absl-debugging
+ yabsl-debugging-stacktrace
+ yabsl-debugging-symbolize
+ yabseil-cpp-tstring-y_absl-demangle
+ yabseil-cpp-tstring-y_absl-numeric
+ yprofiling-internal-exponential_biased
+ yabseil-cpp-tstring-y_absl-strings
+ ystrings-internal-absl_strings_internal
+ yabseil-cpp-tstring-y_absl-synchronization
+ yabsl-synchronization-internal
+ yabseil-cpp-tstring-y_absl-time
+ yabsl-time-civil_time
+ yabsl-time-time_zone
+)
+target_sources(ycontainer-internal-absl_hashtablez_sampler PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler.cc
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/hashtablez_sampler_force_weak_definition.cc
+)
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt
new file mode 100644
index 00000000000..cbf5477dc5d
--- /dev/null
+++ b/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set/CMakeLists.txt
@@ -0,0 +1,46 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(ycontainer-internal-raw_hash_set)
+target_include_directories(ycontainer-internal-raw_hash_set PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring
+)
+target_include_directories(ycontainer-internal-raw_hash_set PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring
+)
+target_link_libraries(ycontainer-internal-raw_hash_set PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ yabseil-cpp-tstring-y_absl-base
+ ybase-internal-low_level_alloc
+ ybase-internal-raw_logging
+ ybase-internal-spinlock_wait
+ ybase-internal-throw_delegate
+ yabsl-base-log_severity
+ ycontainer-internal-absl_hashtablez_sampler
+ yabseil-cpp-tstring-y_absl-debugging
+ yabsl-debugging-stacktrace
+ yabsl-debugging-symbolize
+ yabseil-cpp-tstring-y_absl-demangle
+ yabseil-cpp-tstring-y_absl-hash
+ yabseil-cpp-tstring-y_absl-numeric
+ yprofiling-internal-exponential_biased
+ yabseil-cpp-tstring-y_absl-strings
+ ystrings-internal-absl_strings_internal
+ yabseil-cpp-tstring-y_absl-synchronization
+ yabsl-synchronization-internal
+ yabseil-cpp-tstring-y_absl-time
+ yabsl-time-civil_time
+ yabsl-time-time_zone
+ yabsl-types-bad_optional_access
+ abseil-cpp-tstring-y_absl-types
+)
+target_sources(ycontainer-internal-raw_hash_set PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/abseil-cpp-tstring/y_absl/container/internal/raw_hash_set.cc
+)
diff --git a/library/cpp/grpc/client/grpc_client_low.cpp b/library/cpp/grpc/client/grpc_client_low.cpp
index 73cc908ef82..5794e1ecb1d 100644
--- a/library/cpp/grpc/client/grpc_client_low.cpp
+++ b/library/cpp/grpc/client/grpc_client_low.cpp
@@ -84,6 +84,10 @@ private:
static void Destroy(grpc_socket_mutator* mutator) {
delete Cast(mutator);
}
+ static bool Mutate2(const grpc_mutate_socket_info* info, grpc_socket_mutator* mutator) {
+ auto self = Cast(mutator);
+ return self->SetOption(info->fd);
+ }
static grpc_socket_mutator_vtable VTable;
const int Idle_;
@@ -95,7 +99,8 @@ grpc_socket_mutator_vtable TGRpcKeepAliveSocketMutator::VTable =
{
&TGRpcKeepAliveSocketMutator::Mutate,
&TGRpcKeepAliveSocketMutator::Compare,
- &TGRpcKeepAliveSocketMutator::Destroy
+ &TGRpcKeepAliveSocketMutator::Destroy,
+ &TGRpcKeepAliveSocketMutator::Mutate2
};
TChannelPool::TChannelPool(const TTcpKeepAliveSettings& tcpKeepAliveSettings, const TDuration& expireTime)